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

Does not ignore whitespace on current line when switching tabs #180

@Aerijo

Description

@Aerijo

Prerequisites

Description

The Ignore Whitespace on Current Line setting is not respected.

Steps to Reproduce

  1. Ensure autosave on lose focus is enabled
  2. Open two editor tabs
  3. In the first, set the language to JavaScript, paste in the following, and place your cursor where the pipe is (delete the pipe)
{
  |
}
  1. Switch to the other tab, and then back to this one

Expected behavior: [What you expect to happen]
No change

Actual behavior: [What actually happens]
Whitespace eaten

Reproduces how often: [What percentage of the time does it reproduce?]
70%

I can't reliably reproduce every time, but it will happen when I try enough times.

Versions

Atom    : 1.30.0-beta2
Electron: 2.0.5
Chrome  : 61.0.3163.100
Node    : 8.9.3

whitespace 0.37.6

Additional Information

Seems to be a regression introduced by #169. It uses the getActiveTextEditor API, meaning to grab the file we are leaving, but instead grabs the editor we arrive at. It then sees that the buffer is not the same as the actual editor, and doesn't look for any cursors.

Probably related is that saving is async, so the event is likely firing after we switch tabs (or something to that effect).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions