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

Active line highlight doesn't disappear in unfocused editor #3253

Closed
njx opened this issue Mar 26, 2013 · 2 comments · Fixed by #3274
Closed

Active line highlight doesn't disappear in unfocused editor #3253

njx opened this issue Mar 26, 2013 · 2 comments · Fixed by #3274

Comments

@njx
Copy link

njx commented Mar 26, 2013

  1. Turn on View > Highlight Active Line
  2. Open an inline editor
  3. Click in the inline editor
  4. Click back in the main editor

Result: Both editors always show active lines.
Expected: Active line should only show in focused editor.

@TomMalbran
Copy link
Contributor

I think this might need to be changed in the CodeMirror addon, or it would require a hack in Brackets to remove the highlight line class of the active line when the focus changes. An alternative would be to toggle Highlight Active Line it on and off to let the addon remove the classes.

@RaymondLim
Copy link
Contributor

@TomMalbran

I think we can handle it in Brackets by always setting a new "activeEditor" class to the active editor and remove that class when it is no longer active. Then we can add the new "activeEditor" class selector to all the rules that have ".CodeMirror-activeline-background" selector. Then split all the rules with ".CodeMirror-activeline-background" selector to two -- one with the new ".activeEditor"" class selector that has active-line background color and the other with ":not(.activeEditor)" class selector that has normal background color.

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 a pull request may close this issue.

3 participants