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:
parent
728ccaa5f9
commit
e2841dc26c
2 changed files with 10 additions and 3 deletions
|
|
@ -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", ->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue