Call backwardsScanInBufferRange for :%s
This commit is contained in:
parent
2d6f39c037
commit
33c63b1cdc
1 changed files with 4 additions and 1 deletions
|
|
@ -367,7 +367,10 @@ 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}) ->
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue