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

allow turning off auto tracking of active pane #1336

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bobjunga
Copy link

@bobjunga bobjunga commented Mar 17, 2020

Description of the Change

Enhance the tree-view config to allow turning off the behavior to change the tree selection when the active pane item changes.

Moved tree-view:autoReveal config into a config object that also has an enable boolean

tree-view:autoTrackActivePane
    |  enable
    '  autoReveal

AutoRevealConfigChange

tree-view's onDidChangeActivePaneItem handler now 1) migrates the old autoReveal to new autoTrackActivePane.autoReveal (if its present) and 2) uses autoTrackActivePane.enable to decide whether to call selectActiveFile and revealActiveFile

  • closes Add config to determine if tree selection changes when editor changes  #1335
  • the defaults are Enabled:true, AutoScroll:false which maintains the same default behavior as before this change.
  • it migrates the old autoReveal if its present in the config.
    • migration is required not only to keep the user's preference, but also we need to call unset on it so that the Settings View does not keep displaying it even though its no longer in the schema.
  • note that I also changed the description of the "Focus On Reveal" config to make it clear that it does not affect Auto Reveal but just the Reveal Active File command.

Alternate Designs

Considered changing autoReveal to an enum. See #1335

Benefits

Backward compatible with previous behavior and now allows a new behavior. See #1335

Possible Drawbacks

If other packages use tree-view:autoReveal they should eventually be updated to use autoTrackActivePane.autoReveal instead but in the mean time the impact should not be severe. If they enable autoReveal, it will still take effect because of the migration condition in the code.

Applicable Issues

#1335

* closes atom#1335
* the defaults are Enabled:true, AutoScroll:false which maintains the same default behavior as before this change.
* it migrates the old autoReveal if its present in the config.
  * migration is required not only to keep the user's preference, but also we need to call unset on it so that the Settings View does not keep displaying it even though its no longer in the schema.
* note that I also changed the description of the "Focus On Reveal" config to make it clear that it does not affect Auto Reveal but just the Reveal Active File command.
* I believe that this is 100% non-breaking, backward compatible.
@bobjunga bobjunga marked this pull request as ready for review March 18, 2020 12:43
@bobjunga bobjunga changed the title replace autoReveal config with autoTrackActiveFile.{enabled,autoScroll} allow turning off auto tracking of active pane Mar 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add config to determine if tree selection changes when editor changes
1 participant