Don't allow :s delimiters not allowed by vim

"Instead of the '/' which surrounds the pattern and replacement string,
you can use any other single-byte character, but not an alphanumeric
character, '\', '"'' or '|'."
- http://vimdoc.sourceforge.net/htmldoc/change.html#:substitute
This commit is contained in:
Jacob Wahlgren 2015-09-22 00:35:36 +02:00
parent 728ccaa5f9
commit e2841dc26c
2 changed files with 10 additions and 3 deletions

View file

@ -453,7 +453,14 @@ describe "the commands", ->
keydown(':')
submitNormalModeInputText(':substitute nanxngi')
expect(atom.notifications.notifications[0].message).toEqual(
"Command error: Regular expressions can't be delimited by letters")
"Command error: Regular expressions can't be delimited by alphanumeric characters, '\\', '\"' or '|'")
expect(editor.getText()).toEqual('abcaABC\ndefdDEF\nabcaABC')
it "can't be delimited by numbers", ->
keydown(':')
submitNormalModeInputText(':substitute 1a1x1gi')
expect(atom.notifications.notifications[0].message).toEqual(
"Command error: Regular expressions can't be delimited by alphanumeric characters, '\\', '\"' or '|'")
expect(editor.getText()).toEqual('abcaABC\ndefdDEF\nabcaABC')
describe "capturing groups", ->