aboutsummaryrefslogtreecommitdiff
path: root/autoload/hints
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2022-08-09 00:56:19 -0600
committerJosh Rahm <joshuarahm@gmail.com>2022-08-09 00:56:19 -0600
commit487a0e61303523ee108beb9eea4c276cd11388ec (patch)
treee049acd955b2c0657c4af4ed488d9e5f8508c5aa /autoload/hints
parent54ce931f0bcede9affde3a6934656fa6d4ad9961 (diff)
downloadfieldmarshal.vim-487a0e61303523ee108beb9eea4c276cd11388ec.tar.gz
fieldmarshal.vim-487a0e61303523ee108beb9eea4c276cd11388ec.tar.bz2
fieldmarshal.vim-487a0e61303523ee108beb9eea4c276cd11388ec.zip
Change the default plugin. Only use redraw, not redraw!
Diffstat (limited to 'autoload/hints')
-rw-r--r--autoload/hints/plugins.vim19
1 files changed, 14 insertions, 5 deletions
diff --git a/autoload/hints/plugins.vim b/autoload/hints/plugins.vim
index de8cc6c..b707205 100644
--- a/autoload/hints/plugins.vim
+++ b/autoload/hints/plugins.vim
@@ -44,16 +44,25 @@ function! hints#plugins#getDefaultPlugin() abort
endfunction
function! s:default_plugin.Before(file)
- let self.last_line = ''
+ let self.last_kind = 1
endfunction
-let s:ISSPACE= '^\s*$'
+let s:ISSPACE = '^\s*$'
+let s:ISCOMMENT = '^\s*#'
function! s:default_plugin.TagLine(linenr, line)
- if self.last_line =~ s:ISSPACE && !(a:line =~ s:ISSPACE)
- let self.last_line = a:line
+ if a:line =~ s:ISSPACE
+ let kind = 1
+ elseif a:line =~ s:ISCOMMENT
+ let kind = 2
+ else
+ let kind = 3
+ endif
+
+ if self.last_kind != kind && kind != 1
+ let self.last_kind = kind
return v:true
endif
- let self.last_line = a:line
+ let self.last_kind = kind
return v:false
endfunction