From 14e7200314a6ea1b69b97efa7ef99156843ab024 Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Sun, 23 Feb 2020 18:52:57 +0000 Subject: [PATCH] Make behave like it would in insert mode --- plugin/skybison.vim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugin/skybison.vim b/plugin/skybison.vim index b73e5cd..8d79b22 100644 --- a/plugin/skybison.vim +++ b/plugin/skybison.vim @@ -35,6 +35,10 @@ function s:RunCommandAndQuit(cmdline) return 0 endfunction +function! s:iskeyword(ch) + return match(a:ch, "^\\k") == 0 +endfunction + " main function function SkyBison(initcmdline) " If starting from the cmdline, restart with the cmdline's value @@ -265,7 +269,8 @@ function SkyBison(initcmdline) if l:cmdline[-1:] == " " let l:cmdline = l:cmdline[:-2] endif - while strlen(l:cmdline) > 0 && l:cmdline[-1:] != " " + let l:iskw = s:iskeyword(l:cmdline[-1:]) + while strlen(l:cmdline) > 0 && s:iskeyword(l:cmdline[-1:]) == l:iskw let l:cmdline = l:cmdline[:-2] endwhile elseif l:input == "\" || l:input == "\"