Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow command chaining for :ClearSwapList and :SwapIdea #18

Merged
merged 1 commit into from
Jun 9, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Allow command chaining for :ClearSwapList and :SwapIdea
Especially for :ClearSwapList, one may want to put this into
    let b:undo_ftplugin .= '|ClearSwapList'

To enable appending other such commands, the command must support chaining, and because it doesn't take arguments, this is trivially done through -bar.
  • Loading branch information
inkarkat committed Jun 4, 2014
commit 68512d99e21cedc6186e5413a60eae01fd6b96b0
4 changes: 2 additions & 2 deletions plugin/swapit.vim
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ vnoremap <silent><c-x> :<c-u>let swap_count = v:count<Bar>call SwapWord(<SID>Get

" For adding lists
com! -nargs=* SwapList call AddSwapList(<q-args>)
com! ClearSwapList let b:swap_lists = []
com! SwapIdea call OpenSwapFileType()
com! -bar ClearSwapList let b:swap_lists = []
com! -bar SwapIdea call OpenSwapFileType()
com! -range -nargs=1 SwapWordVisual call SwapWord(getline('.'), 1, <f-args>,'yes')
"au BufEnter call LoadFileTypeSwapList()
com! SwapListLoadFT call LoadFileTypeSwapList()
Expand Down