This repository has been archived by the owner on Dec 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 73
Replacing multiple characters with newlines in a scanInRange only replaces the first occurence #224
Labels
Comments
Can you reproduce this using an official version of Atom, available at https://atom.io? |
No, since atom.io doesn't provide an Arch Linux version and building from source breaks with |
This has been reproduced by @mkiken in lloeki/ex-mode#178 (comment) using an official version of Atom. |
An example failing spec for the issue is: it "works with newline splitting", ->
buffer = new TextBuffer("abc,def,ghi")
buffer.scanInRange /,/g, [[0,0], [1,0]], ({replace}) ->
replace("\n")
expect(buffer.getText()).toBe "abc\ndef\nghi" I added this to a checkout of https://github.com/atom/text-buffer at master, and had the following failure:
|
@50Wliu Any news on this issue? 😄 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Prerequisites
(I didn't really want to factory reset but I'm fairly certain that wouldn't change anything, and this is not a feature request so no package searching)
Description
Replacing multiple characters with newlines (or carriage returns, but not alphanumeric characters or tabs!) in a TextBuffer.scanInRange only replaces the first occurence (but inserts more of the replacement without removing the pattern).
Steps to Reproduce
atom.workspace.getActiveTextEditor().buffer.scanInRange(/,/g, [[0,0],[1,0]], function(args) {console.debug("found");args.replace('\n')})
Expected behavior: "found" should be output twice and the buffer should now contain
Actual behavior: "found" is actually output twice, but the buffer now contains
Reproduces how often: 100% of the time.
Versions
OS: Arch Linux
Additional Information
This used to work. I believe it might have been broken in 7ad08bc, but I don't really want to bisect.
The text was updated successfully, but these errors were encountered: