File tree 1 file changed +12
-3
lines changed
1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -533,24 +533,33 @@ function! s:same_ids_highlight(exit_val, output) abort
533
533
endif
534
534
endfunction
535
535
536
+ " ClearSameIds returns 0 when it removes goSameId groups and non-zero if no
537
+ " goSameId groups are found.
536
538
function ! go#guru#ClearSameIds () abort
539
+ let l: cleared = 0
540
+
537
541
let m = getmatches ()
538
542
for item in m
539
543
if item[' group' ] == ' goSameId'
540
544
call matchdelete (item[' id' ])
545
+ let l: cleared = 1
541
546
endif
542
547
endfor
543
548
549
+ if ! l: cleared
550
+ return 1
551
+ endif
552
+
544
553
" remove the autocmds we defined
545
554
if exists (" #BufWinEnter#<buffer>" )
546
555
autocmd ! BufWinEnter <buffer>
547
556
endif
557
+
558
+ return 0
548
559
endfunction
549
560
550
561
function ! go#guru#ToggleSameIds () abort
551
- if len (getmatches ()) != 0
552
- call go#guru#ClearSameIds ()
553
- else
562
+ if go#guru#ClearSameIds () != 0
554
563
call go#guru#SameIds ()
555
564
endif
556
565
endfunction
You can’t perform that action at this time.
0 commit comments