From b6617fa378fb16b19fc669d39cb875711368307d Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Fri, 12 Aug 2022 12:37:34 -0600 Subject: Fix some bugs --- autoload/hints.vim | 2 +- autoload/hints/plugins.vim | 6 +++--- plugin/fall.vim | 10 ++++++++++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/autoload/hints.vim b/autoload/hints.vim index e699736..5a74386 100644 --- a/autoload/hints.vim +++ b/autoload/hints.vim @@ -99,7 +99,7 @@ function! hints#runHints(visual) abort if line >= 0 norm m' if len(a:visual) - exec "norm " . a:visual + exec "norm gv" endif call cursor(line, 1) norm ^ diff --git a/autoload/hints/plugins.vim b/autoload/hints/plugins.vim index b707205..e3e5a9d 100644 --- a/autoload/hints/plugins.vim +++ b/autoload/hints/plugins.vim @@ -28,9 +28,6 @@ function! s:java_plugin.TagLine(linenr, line) dict \ a:line =~ '\<\(public\|private\|protected\|class\|static\|try\|while\|for\|if\|else\|catch\)\>' endfunction -call hints#plugins#registerFt("vim", s:vim_plugin) -call hints#plugins#registerFt("java", s:java_plugin) - function! hints#plugins#registerFt(filetype, plugin) abort let s:ftplugins[a:filetype] = a:plugin endfunction @@ -66,3 +63,6 @@ function! s:default_plugin.TagLine(linenr, line) let self.last_kind = kind return v:false endfunction + +call hints#plugins#registerFt("vim", s:vim_plugin) +call hints#plugins#registerFt("java", s:java_plugin) diff --git a/plugin/fall.vim b/plugin/fall.vim index 3fba6d5..05d4e6e 100644 --- a/plugin/fall.vim +++ b/plugin/fall.vim @@ -24,3 +24,13 @@ onoremap ii :exec "normal! V" \ . fall#fall('j', '^\s*$') \ . "kO" \ . fall#fall('k', '^\s*$') . 'j' + +vnoremap ai :exec "normal! gv" + \ . fall#fall('j', '^\s*$') + \ . "O" + \ . fall#fall('k', '^\s*$') + +vnoremap ii :exec "normal! gv" + \ . fall#fall('j', '^\s*$') + \ . "kO" + \ . fall#fall('k', '^\s*$') . 'j' -- cgit