Enable or disable highlight focused line


#1

There is no possibility to disable the highlight of the focused line. Maybe add the possibility to edit the color of the highlight too.


#2

You can do this from your styles.less file.

.editor.is-focused {
  .line.cursor-line {
    background: transparent;
  }
}

This will make the current lines background transparent.

Also: Pink! :smirk:


#3

Hum indeed. Thank you. However maybe a simple checkbox in setting could be more friendly and easy to use.


#4

If you’re talking about this: https://atom.io/packages/highlight-line

Then yes, my goal is to have options so you don’t have to go in to your style sheet to use it. If you feel like you can do it go ahead and submit a PR.

It was something I created to learn how to create an Atom package. I work on multiple computers and couldn’t be bothered to change the style sheet.


#5

Thank you @richrace, it’s a good work !


#6

Hey, I’ve updated it so you can now disable/enable the highlighted line, change the colour (only support RBG at the moment) and change the opacity.

Happy coding!


#7

Yes you rock thanks !


#8

I used this to hide the highlight on the line number as well:

.editor.is-focused {
  .line.cursor-line, .line-number.cursor-line-no-selection {
    background: transparent;
  }
}

#9

It seems you need to modify this trick to account for the new Shadow DOM. In styles.less do this instead:


atom-text-editor.is-focused::shadow {
  .line.cursor-line, .line-number.cursor-line-no-selection {
    background-color: transparent;
  }
}

[Edit: Corrected to use atom-text-editor as suggested by @olmokramer]


#10

The .editor class is actually deprecated. You should use atom-text-editor instead. So

atom-text-editor.is-focused::shadow {
  // etc.
}

#11

For the newbies… To edit your stylesheet, click Atom->Preferences->Themes, and click the link “your stylesheet”. You must restart for changes to take effect.


#12

The Atom Flight Manual has information on how to open your stylesheet for all platforms. Additionally, you shouldn’t have to restart Atom for stylesheet changes to take effect.


#13

Thank you nfarina, this works well.


#14

Hi jdhenckel,
On Windows this is:

  1. File > Stylesheet… (this opens styles.less)
  2. Add code snippet
  3. File > Save (Ctrl + S)

#15

The location of the menu item is different on each platform because each platform has different standards on where such configuration menu items are supposed to be located. This is why I recommend going to the Atom Flight Manual instructions for opening your stylesheet because it auto-detects your OS and displays the correct instructions.


#16

A different aproach, using theme colors.

It also use highlight layer, so you don´t need to use opacity.