Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

onDidStopChanging and undo Regression in Atom 1.19.4 #251

Closed
GlenCFL opened this issue Aug 30, 2017 · 4 comments
Closed

onDidStopChanging and undo Regression in Atom 1.19.4 #251

GlenCFL opened this issue Aug 30, 2017 · 4 comments
Assignees

Comments

@GlenCFL
Copy link

GlenCFL commented Aug 30, 2017

With the recent update from Atom v1.19.3 to v1.19.4, the values passed to the callback which you provide to both TextEditor's onDidStopChanging and TextBuffer's onDidStopChanging have changed. I believe these Atom versions correlate with TextBuffer versions v13.1.4 and v13.1.12, but I am not 100% sure due to Atom's documentation link for TextBuffer classes breaking with v1.19.

Text insertion continues to work as normal, so on editing a single line the callback provided to onDidStopChanging will be called with the following object:

{
  changes: TextChange[] = [
    {
      newExtent: Point (computed)
      newRange: Range
      newText: string
      oldExtent: Point (computed)
      oldRange: Range
      oldText: string
      start: Point (computed)
    }
  ]
}

However, if you were to undo that change within Atom, then you are now fed a changes array containing zero elements, whereas in Atom 1.19.3 this array would contain an instance of the TextChange class representing the change that undo has had on the buffer. This is causing buffer updating issues in a lot of Linter packages, with decorations just sticking around anytime a user uses undo after causing a Linter error.

This issue still exists in Atom 1.20.0-beta5 on both Windows x64 and Linux, with other platforms being untested.

@rsese
Copy link

rsese commented Aug 31, 2017

Added to the project board for discussion but maybe /cc @maxbrunsfeld for 👓 on a potential regression?

@maxbrunsfeld maxbrunsfeld self-assigned this Aug 31, 2017
@maxbrunsfeld
Copy link
Contributor

Thanks for describing this in such detail @GlenCFL. My apologies for this very serious regression, I'll begin work on a fix tomorrow morning.

@dra1019
Copy link

dra1019 commented Sep 2, 2017

I'm brand new to programming and getting started with all of this for an intro to programming class, this error popped up for me? Can someone tell me what to do to fix it? Thanks!

@maxbrunsfeld
Copy link
Contributor

Upgrade to Atom 1.19.5.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants