Replace \#{delimiter} with #{delimiter} in :s

This commit is contained in:
jazzpi 2015-06-10 18:19:59 +02:00
parent bf0f492740
commit 4cccef79a5

View file

@ -190,6 +190,9 @@ class Ex
throw new CommandError('Trailing characters') throw new CommandError('Trailing characters')
spl[1] ?= '' spl[1] ?= ''
spl[2] ?= '' spl[2] ?= ''
notDelimRE = new RegExp("\\\\#{delim}", 'g')
spl[0] = spl[0].replace(notDelimRE, delim)
spl[1] = spl[1].replace(notDelimRE, delim)
try try
pattern = new RegExp(spl[0], spl[2]) pattern = new RegExp(spl[0], spl[2])