diff --git a/lua/various-textobjs/charwise-textobjs.lua b/lua/various-textobjs/charwise-textobjs.lua index 675a9bb..adb3fc2 100644 --- a/lua/various-textobjs/charwise-textobjs.lua +++ b/lua/various-textobjs/charwise-textobjs.lua @@ -227,11 +227,11 @@ end ---current line (but characterwise) ---@param scope "inner"|"outer" outer includes indentation and trailing spaces function M.lineCharacterwise(scope) - -- FIX being on line break in visual mode, see #108 + -- FIX being on NUL, see #108 and #109 -- (Not sure why this only happens for `lineCharacterwise` though…) -- `col()` results in "true" char, as it factors in Tabs - local isOnLineBreak = #vim.api.nvim_get_current_line() < vim.fn.col(".") - if isOnLineBreak and vim.fn.mode():find("[Vv]") and scope == "outer" then u.normal("h") end + local isOnNUL = #vim.api.nvim_get_current_line() < vim.fn.col(".") + if isOnNUL then u.normal("g_") end local pattern = "^(%s*).-(%s*)$" M.selectTextobj(pattern, scope, 0)