atom / snippets

Atom snippets package
MIT License
205 stars 100 forks source link

Abnormal page scroll when undo-ing snippet #231

Closed surdu closed 7 years ago

surdu commented 7 years ago

Description

Having the following snippets file:

{
    '.source.js' : {
        "Log value": {
            "prefix": "lov",
            "body": 'console.log("$1:",$1);$0'
        }
    }
}

When you try to use this snippet and then undo it, the file will scroll at the beginning every time you move the cursor until you close the file or redo the snippet undoing.

Steps to Reproduce

  1. Use the above snippets file
  2. Open large .js file (more than one screen of code)
  3. Type lovTAB to use the snippet somewhere not on the first screen of code
  4. Press Ctrl/Cmd + Z to undo the snippet

Expected behavior:

The text reverts to lov and the screen stays focused as it is.

Actual behavior:

The text reverts to lov BUT the screen scrolls at the beginning of the file. Every subsequent cursor move will continue to scroll the file up to the first line until you close the file or redo the snippet undoing.

Reproduces how often:

Every time

Versions

Atom: 1.15.0-beta1 x64 (safe mode) Snippets: 1.0.5

surdu commented 7 years ago

It was fixed in the meantime.