Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Editor options set on hidden editors when switching files #6578

@peterflynn

Description

@peterflynn
  1. Open a bunch of files in the Brackets source
  2. Put a breakpoint in _setEditorOption() in the Editor module
  3. Open codemirror.js

Result:
setOption() gets called on every Editor instance that exists, setting them all to use codemirror.js's tab settings. When to switch away from codemirror.js, setOption() gets called on all of them again to restore the setting (and also, mirroring this, the now-hidden codemirror.js is set to the 'wrong' setting).

This seems inefficient... and you could maybe even imagine some prefs where temporarily applying a different setting isn't 100% non-destructive.

Expected:
Only the visible editor (the editor to whose path the setting actually applies) gets the change event.
Or better yet, when the editor is new'ed up, it's constructed with the right path-appropriate settings to begin with and no change events are processed. (Though then we'd need a way to distinguish ignored change events due to path context from change events due to the user changing a setting, which we still couldn't ignore).

Low priority @dangoor as food for thought...

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions