Skip to content

Commit

Permalink
fix sameid toggle
Browse files Browse the repository at this point in the history
* always show the status when turning toggling same ids.
* fix a spelling mistake (Toogle -> Toggle)
* call go#guru#SameIds with the expected argument when re-entering the
  buffer
  • Loading branch information
bhcleek committed Dec 7, 2018
1 parent 75df082 commit 844e502
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions autoload/go/guru.vim
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ function! s:same_ids_highlight(exit_val, output, mode) abort
" is redisplayed: e.g. :edit, :GoRename, etc.
augroup vim-go-sameids
autocmd!
autocmd BufWinEnter <buffer> nested call go#guru#SameIds()
autocmd BufWinEnter <buffer> nested call go#guru#SameIds(0)
augroup end
endif
endfunction
Expand Down Expand Up @@ -517,13 +517,13 @@ function! go#guru#ClearSameIds() abort
return 0
endfunction

function! go#guru#ToggleSameIds(showstatus) abort
function! go#guru#ToggleSameIds() abort
if go#guru#ClearSameIds() != 0
call go#guru#SameIds(a:showstatus)
call go#guru#SameIds(1)
endif
endfunction

function! go#guru#AutoToogleSameIds() abort
function! go#guru#AutoToggleSameIds() abort
if go#config#AutoSameids()
call go#util#EchoProgress("sameids auto highlighting disabled")
call go#guru#ClearSameIds()
Expand Down
4 changes: 2 additions & 2 deletions ftplugin/go/commands.vim
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ command! -range=% GoReferrers call go#guru#Referrers(<count>)

command! -range=0 GoSameIds call go#guru#SameIds(1)
command! -range=0 GoSameIdsClear call go#guru#ClearSameIds()
command! -range=0 GoSameIdsToggle call go#guru#ToggleSameIds(1)
command! -range=0 GoSameIdsAutoToggle call go#guru#AutoToogleSameIds()
command! -range=0 GoSameIdsToggle call go#guru#ToggleSameIds()
command! -range=0 GoSameIdsAutoToggle call go#guru#AutoToggleSameIds()

" -- tags
command! -nargs=* -range GoAddTags call go#tags#Add(<line1>, <line2>, <count>, <f-args>)
Expand Down

0 comments on commit 844e502

Please sign in to comment.