atom / bookmarks

Bookmark editor lines in Atom
MIT License
49 stars 36 forks source link

Decorate bookmarked lines #67

Closed solendil closed 5 years ago

solendil commented 8 years ago

As per request #33, this commit adds the .bookmarked class to .line as well as .line-number elements. This allows to decorate lines. For example:

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

image

solendil commented 8 years ago

The appveyor build failed due to an internal error, not because of tests related to this commit. How can I relaunch the build? Should I make a fake commit?

50Wliu commented 8 years ago

I've restarted the Appveyor build.

50Wliu commented 8 years ago

As I recall, bookmarks can now be selection-based (#47), so giving the entire line the bookmarked class doesn't seem like the right thing to do.

solendil commented 8 years ago

I believe many people think that Atom bookmarks is a line-only feature : when you define a bookmark at the cursor, it places a symbol in the gutter for the current line. Nice and sweet and useful.

I, for one, did not know that bookmarks were applied to range until I delved in the code and discovered this feature. It is powerful, but mildly confusing, and I still do not use it in my everyday work: to me, bookmarks are still a line-only feature.

Since this PR is aimed at providing classes that can be used, but are not mandatory, I believe it makes sense to offer a .line.bookmarked class for people or add-ons who want to decorate bookmarks on a line-basis.

I also added a .bookmarked class that allows to decorate the bookmarked selection. Here is an example of style

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

And the result

image

CyberPunkCodes commented 7 years ago

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 commented 7 years ago

I want to add, that I manually added the Atom "bookmarks" package via apm develop bookmarks, and added these changes from this PR manually. 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 should be merged.

CyberPunkCodes commented 6 years ago

A year later and still no solution... I swapped to VSCode for a while over this, came back to Atom because it's comfortable. Might have to swap back to VSCode again to see if I can't make the switch permanent.

If this holdup is all because of the selective bookmark feature (#47) , then remove it. There really is no need to bookmark a specific section of one line. It doesn't matter if it's the 34th char of the row. Bookmarking col+row is dumb.

Think of it this way: When your reading a book, and your on page 60 and stop, you place a bookmark in between page 60 and 61. When you open the book back up, you know which page you were on. Your not bookmarking page 60, paragraph 3, 1st sentence, 3rd word. If you quit mid-way on page 60, you skim over what you already read, and say, "ok, here is where I left off".

If you took a vote, it would be at least 1,000 to 1, that people want to bookmark the entire line and have it highlighted.

The fact that it's 3 years later and this isn't solved, is extremely pathetic.