Skip to content

Commit

Permalink
Add a stabs mode toggle function
Browse files Browse the repository at this point in the history
This allows only a single map to be used, driven by state retained in a
single global variable
  • Loading branch information
smemsh committed May 26, 2024
1 parent f05a606 commit ab4dd08
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions plugin/stabs.vim
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ if exists('g:loaded_stabs') && g:loaded_stabs
endif
let g:loaded_stabs = 1


if !exists('g:stabs_indent_regex')
let g:stabs_indent_regex = '^\t*'
endif
Expand Down Expand Up @@ -337,9 +336,14 @@ function StabsUninstall()
let g:stabs_active = 0
endfunc

function StabsToggle()
if !exists('g:stabs_active') | let g:stabs_active = 0 | endif
call function(g:stabs_active ? 'StabsUninstall' : 'StabsInstall')()
endfunc

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

call StabsInstall()
call StabsToggle()

" Retab the indent of a file - ie only the first nonspace.
" Optional argument specified the value of the new tabstops
Expand Down

0 comments on commit ab4dd08

Please sign in to comment.