Merge pull request #178 from mkiken/fix-substitute-vim-mode-plus
Support vim-mode-plus substitute command
This commit is contained in:
commit
ed3417c842
3 changed files with 21 additions and 2 deletions
|
|
@ -36,6 +36,9 @@ module.exports = ExMode =
|
|||
@vim = vim
|
||||
@globalExState.setVim(vim)
|
||||
|
||||
consumeVimModePlus: (vim) ->
|
||||
this.consumeVim(vim)
|
||||
|
||||
config:
|
||||
splitbelow:
|
||||
title: 'Split below'
|
||||
|
|
|
|||
|
|
@ -335,12 +335,23 @@ class Ex
|
|||
|
||||
[pattern, substition, flags] = parsed
|
||||
if pattern is ''
|
||||
pattern = vimState.getSearchHistoryItem()
|
||||
if vimState.getSearchHistoryItem?
|
||||
# vim-mode
|
||||
pattern = vimState.getSearchHistoryItem()
|
||||
else if vimState.searchHistory?
|
||||
# vim-mode-plus
|
||||
pattern = vimState.searchHistory.get('prev')
|
||||
|
||||
if not pattern?
|
||||
atom.beep()
|
||||
throw new CommandError('No previous regular expression')
|
||||
else
|
||||
vimState.pushSearchHistory(pattern)
|
||||
if vimState.pushSearchHistory?
|
||||
# vim-mode
|
||||
vimState.pushSearchHistory(pattern)
|
||||
else if vimState.searchHistory?
|
||||
# vim-mode-plus
|
||||
vimState.searchHistory.save(pattern)
|
||||
|
||||
try
|
||||
flagsObj = {}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,11 @@
|
|||
"versions": {
|
||||
"^0.1.0": "consumeVim"
|
||||
}
|
||||
},
|
||||
"vim-mode-plus": {
|
||||
"versions": {
|
||||
"^0.1.0": "consumeVimModePlus"
|
||||
}
|
||||
}
|
||||
},
|
||||
"providedServices": {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue