Merge pull request #178 from mkiken/fix-substitute-vim-mode-plus

Support vim-mode-plus substitute command
This commit is contained in:
Jasper v. B 2017-05-25 01:06:58 +02:00 committed by GitHub
commit ed3417c842
3 changed files with 21 additions and 2 deletions

View file

@ -36,6 +36,9 @@ module.exports = ExMode =
@vim = vim
@globalExState.setVim(vim)
consumeVimModePlus: (vim) ->
this.consumeVim(vim)
config:
splitbelow:
title: 'Split below'

View file

@ -335,12 +335,23 @@ class Ex
[pattern, substition, flags] = parsed
if pattern is ''
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
if vimState.pushSearchHistory?
# vim-mode
vimState.pushSearchHistory(pattern)
else if vimState.searchHistory?
# vim-mode-plus
vimState.searchHistory.save(pattern)
try
flagsObj = {}

View file

@ -23,6 +23,11 @@
"versions": {
"^0.1.0": "consumeVim"
}
},
"vim-mode-plus": {
"versions": {
"^0.1.0": "consumeVimModePlus"
}
}
},
"providedServices": {