Skip to content

Commit 585b20e

Browse files
committed
Analyze : commands after removing spaces, range, and count
1 parent ddb7e93 commit 585b20e

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

lua/scrollview.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3763,7 +3763,9 @@ if api.nvim_create_autocmd ~= nil then
37633763
return
37643764
end
37653765
local cmdline = fn.getcmdline()
3766-
if string.match(cmdline, '^%d*winc') ~= nil then
3766+
-- Remove the leading non-alphabetic characters (count and spaces).
3767+
cmdline = cmdline:gsub('^[^%a]*', '')
3768+
if vim.startswith(cmdline, 'winc') then
37673769
refresh_impl_async()
37683770
end
37693771
end

lua/scrollview/signs/marks.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,13 @@ function M.init(enable)
8888
-- :[range]k{a-zA-Z'}
8989
-- :delm[arks] {marks}
9090
-- :kee[pmarks] {command}
91-
-- WARN: [range] is not handled.
9291
-- WARN: Only text at the beginning of the command is considered.
9392
-- WARN: CmdlineLeave is not executed for command mappings (<cmd>).
9493
-- WARN: CmdlineLeave is not executed for commands executed from Lua
9594
-- (e.g., vim.cmd('help')).
9695
local cmdline = fn.getcmdline()
96+
-- Remove the leading non-alphabetic characters (range and spaces).
97+
cmdline = cmdline:gsub('^[^%a]*', '')
9798
if vim.startswith(cmdline, 'ma')
9899
or vim.startswith(cmdline, 'k')
99100
or vim.startswith(cmdline, 'delm')

lua/scrollview/signs/spell.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ function M.init(enable)
109109
-- WARN: CmdlineLeave is not executed for commands executed from Lua
110110
-- (e.g., vim.cmd('help')).
111111
local cmdline = fn.getcmdline()
112-
if string.match(cmdline, '^%d*spe') ~= nil then
112+
-- Remove the leading non-alphabetic characters (count and spaces).
113+
cmdline = cmdline:gsub('^[^%a]*', '')
114+
if vim.startswith(cmdline, 'spe') then
113115
invalidate_cache()
114116
scrollview.refresh()
115117
end

0 commit comments

Comments
 (0)