Open jazzpi opened 7 years ago
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 Error: Cannot find module 'node-gyp/bin/node-gyp'
. However, I believe the atom-editor-bin
package I'm using actually installs Atom from the .deb package on atom.io, and the same issue also occurs on this Travis build.
This has been reproduced by @mkiken in https://github.com/lloeki/ex-mode/pull/178#issuecomment-287731613 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:
Failures:
1) TextBuffer ::scanInRange(range, regex, fn) when given a regex with a global flag works with newline splitting
Message:
Expected 'abc
def,ghi' to be 'abc
def
ghi'.
Stack:
Error: Expected 'abc
def,ghi' to be 'abc
def
ghi'.
at Object.<anonymous> (/home/sophaskins/development/text-buffer/spec/text-buffer-spec.coffee:1520:34)
at runCallback (timers.js:672:20)
at tryOnImmediate (timers.js:645:5)
at processImmediate [as _immediateCallback] (timers.js:617:5)
@50Wliu Any news on this issue? 😄
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 https://github.com/atom/text-buffer/commit/7ad08bc4b3a1de7780a923e37aaba0d2a89cb5d7, but I don't really want to bisect.