Merge bf9c2c4767 into 4747bcf5e8
This commit is contained in:
commit
ec2849d701
2 changed files with 9 additions and 6 deletions
|
|
@ -367,9 +367,12 @@ class Ex
|
||||||
|
|
||||||
editor.transact ->
|
editor.transact ->
|
||||||
for line in [range[0]..range[1]]
|
for line in [range[0]..range[1]]
|
||||||
editor.scanInBufferRange(
|
# Following some simple testing and reading the atom docs
|
||||||
|
# calling backwardsScanInBufferRange is a better solution.
|
||||||
|
# https://atom.io/docs/api/v1.18.0/TextEditor#instance-backwardsScanInBufferRange
|
||||||
|
editor.backwardsScanInBufferRange(
|
||||||
patternRE,
|
patternRE,
|
||||||
[[line, 0], [line + 1, 0]],
|
[[line, 0], [line - 1, 0]],
|
||||||
({match, replace}) ->
|
({match, replace}) ->
|
||||||
replace(replaceGroups(match[..], substition))
|
replace(replaceGroups(match[..], substition))
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -764,12 +764,12 @@ describe "the commands", ->
|
||||||
|
|
||||||
test = (escapeChar, escaped) ->
|
test = (escapeChar, escaped) ->
|
||||||
openEx()
|
openEx()
|
||||||
submitNormalModeInputText(":substitute/,/\\#{escapeChar}/g")
|
submitNormalModeInputText(":substitute/,/#{escapeChar}/g")
|
||||||
expect(editor.getText()).toEqual("abc#{escaped}def#{escaped}ghi")
|
expect(editor.getText()).toEqual("abc#{escaped}def#{escaped}ghi")
|
||||||
|
|
||||||
it "replaces with a tab", -> test('t', '\t')
|
it "replaces with a tab", -> test('\\t', '\t')
|
||||||
it "replaces with a linefeed", -> test('n', '\n')
|
it "replaces with a linefeed", -> test('\\n', '\n')
|
||||||
it "replaces with a carriage return", -> test('r', '\r')
|
it "replaces with a carriage return", -> test('\\r', '\r')
|
||||||
|
|
||||||
describe "case sensitivity", ->
|
describe "case sensitivity", ->
|
||||||
describe "respects the smartcase setting", ->
|
describe "respects the smartcase setting", ->
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue