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

Add bookmarked class to lines as well #33

Open
mjomble opened this issue Jun 28, 2015 · 10 comments
Open

Add bookmarked class to lines as well #33

mjomble opened this issue Jun 28, 2015 · 10 comments

Comments

@mjomble
Copy link

mjomble commented Jun 28, 2015

Currently the "bookmarked" CSS class is added to the line number element in the gutter, but it would be very helpful for customizing styles if the class was also added to the code line elements.

You could then change, for example, the background color of bookmarked lines with

atom-text-editor::shadow .line.bookmarked {
  background-color: rgba(0, 153, 204, 0.3)
}

in your styles.less file.

solendil pushed a commit to solendil/bookmarks that referenced this issue Jun 12, 2016
@CyberPunkCodes
Copy link

This should have been in atom since day one. If you can add a bookmark, and style the gutter line number section, you should be able to style the line itself. It seems like a basic and common necessity for an editor like Atom, which prides itself of flexibility and customization through a wide array of themes and packages. Yes, we can create a package to "hack it", but we shouldn't have to. The "bookmarked" class on the gutter and not on the line number, just shows someone only thought out the bookmark process half way. Seriously, a few lines and push the update. It would take only a few minutes to add this feature baked into the next Atom release.

I CAN NOT BELIEVE that this has been going on for over a year, and it still isn't built into Atom. It is a huge let down. I hate seeing something so easy, simple, and duh should have been there from the beginning, get ignored!

This issue has fallen through the cracks, and someone responsible for Atom's updates/code fixes/modifications should add it.

@CyberPunkCodes
Copy link

I want to add, that I manually added the Atom "bookmarks" package via apm develop bookmarks, and manually added the changes purposed in PR #67 . Then of course, wrote my own style in styles.less.

It works just fine, no issues.

This looks super simple, and mimics exactly how the bookmarked class is added to the gutter line. I can't fathom how there would be any issues with these few minor lines.

This PR #67 should be merged. Until then, you can add the modifications yourself 👍

@round
Copy link

round commented Sep 13, 2017

I hacked a stylesheet-based solution that may be able to hold us over:

atom-text-editor .gutter .bookmarked {
  background: rgba(0,153,204,.15);
  padding-right: 1024px; //arbitrary large width
  pointer-events: none;
  border-left: 2px solid #09C; //optional gutter decoration
  z-index: -1;
  color: rgba(255,255,255,.5);
  transition: color .1s linear; //smooth transition
  &.cursor-line {
    color: #fff;
  }

Ends up looking like this:
screen shot 2017-09-13 at 2 23 48 am

@CyberPunkCodes
Copy link

@round This issue is not regarding the gutter. It is about the actual line itself. The CSS classes targeted in your post point to the gutter.

Without modifying the Atom bookmark plugin, it is not possible. The line itself is not given any bookmark class we can use.

So either:

  • Atom needs to fix this (NOW, there is a PR waiting!!!)
  • We need to swap the built-in atom plugin for our-own until they fix it.
  • or a 3rd party plugin to hook into the Atom bookmarks and listen for a new bookmark being added, then applies a class to the respective line so we can style it with CSS.

@round
Copy link

round commented Sep 13, 2017

@WadeShuler I hear you – even agree with you.

As I mentioned, what I shared is a hack that visually highlights the bookmarked line(s), without having/needing the ability to alter the actual classes of the line.

Doesn't solve the issue, but may help folks looking for an interim fix.

@Spherikal
Copy link

@WadeShuler Any chance you could post a step-by-step on how to implement the changes? I've been trying to get it to work for the better part of this evening but can't figure it out.

I'm on Windows 10 if that is important

Would REALLY appreciate it!!

@CyberPunkCodes

This comment has been minimized.

@PhilippWoelfel
Copy link

Would be great to have. Seems it's standard for most other editors.

@s-m-e
Copy link

s-m-e commented Jun 24, 2022

It appears that this has been added and merged in #104 (superseding #67).

@s-m-e
Copy link

s-m-e commented Jun 24, 2022

Ok, here is the bad news: The latest release of bookmarks, 0.46.0, still in use in Atom, dates back to Jan 2019. PR #104 got merged in May 2019. bookmarks needs a new release and an update within Atom.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants