atom / bookmarks

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

Create bookmark when clicking on the gutter #10

Open syedz opened 10 years ago

syedz commented 10 years ago

Keyboard shortcuts are nice, but I'd really to see bookmarks created when you click on a line in the gutter.

tecfu commented 9 years ago

+1

50Wliu commented 9 years ago

:+1:

locksoft commented 9 years ago

+1

tariqkhan-co-uk commented 9 years ago

+1

simonbrent commented 9 years ago

+1

llagerlof commented 9 years ago

+1

odegraciajr commented 9 years ago

+1 just like on notepad++!

piotr-cz commented 9 years ago

+1

piotr-cz commented 9 years ago

or add a menu item 'Toggle bookmark here' to the Right-click menu stack

piotr-cz commented 9 years ago

Perhaps something like this in menus/bookmarks.cson:

'context-menu': {
  'atom-text-editor': [
    { 'label': 'Toggle bookmark', 'command': 'bookmarks:toggle-bookmark' }
  ]
}

I can't find this file in my local installation to test changes.

As for clicking on the line number, there might be a problem, because ATM inside of <atom-text-editor /> there is one parent element with class line-number, holding text of line number and element for code folding icon. So clicking on line number would fire an event for folding too, at least as long as line number doesn't have its own element.

<div class="gutter-container">
  <div class="gutter">
    <div class="line-numbers">
      <div class="line-number line-number-1">
        &nbsp;&nbsp;1 <!-- Need to wrap it in element to be able to receive click events and attach to to bookmarks:toggle-bookmark command -->
        <div class="icon-right">
        </div>
      </div>
    </div>
  </div>
</div>
underdpt commented 8 years ago

+1

oXis commented 8 years ago

+1 :)

Zorgatone commented 8 years ago

+1 :+1:

pinguinpfleger commented 8 years ago

+1

alexisfrjp commented 7 years ago

+1, still no news ?

daemonburrito commented 7 years ago

Yep, one more here, would love to see this. :+1:

bartek-szymanski commented 7 years ago

+1

CTimmerman commented 7 years ago

Please subscribe or add helpful info instead of adding +1 comments.

CudaText and Geany are free and have this feature on Linux, Windows (which also has Notepad++ which runs on Wine), and Mac (which also has non-free TextMate).

jonasflint commented 7 years ago

+1 to comments means that they want the feature... dude. Why is this closed?

jolsen71 commented 7 years ago

"+1"-only comments send an email to everyone that is assigned or subscribed to the task and provides no useful information. As @CTimmerman mentioned, comments should only be used to provide information or appropriate discussion regarding the ticket. If you want to show you want to show your support for a feature or resolution of an issue, the appropriate methods for doing that are to subscribe to the issue and/or use the "reaction" button on the original post. These will register your "vote" without emailing everyone attached to the ticket.

The subscribe button is in the "Notification" area on the right-hand side of an the issue page. To more directly "+1" an issue, simply to do that click the (the "+(smiley face)" you see on the original post) and then chose the "thumbs up" icon, which is "+1". You're free to choose any appropriate reaction.

The "+1" emails may not seem like a big deal, but if you're on a core Atom team and/or are attached to many issues, and each issue has 10+ people sending you emails that just say "+1" then you're now getting hundreds of emails you have to weed through and probably just end up deleting. We're all better off if the developers spend more time fixing issues and adding features than if they have to spend time wading through floods of emails to no benefit. I truly wish gitlab.com would put a check into their website to alert users that they should use a reaction instead when they try to add a comment that is just "+1".

While these are my words and not @CTimmerman's regarding the +1 issue, I hope that explains the reasoning behind the sentiment.

It looks like someone already responded to your question about #87 being closed (ie, the original request for this feature is still open, which is this one, #10). Did you have any additional questions on that?

yani commented 6 years ago

The php-debug package has a click-toggle for the gutter. It might be easy to port it over: https://github.com/gwomacks/php-debug/search?q=gutter

nestg commented 6 years ago

4 years and this essential function is not implemented, no plugin for this, is sad.

franklinrt commented 6 years ago

Perhaps something like this in menus/bookmarks.cson:

'context-menu': {
  'atom-text-editor': [
    { 'label': 'Toggle bookmark', 'command': 'bookmarks:toggle-bookmark' }
  ]
}

I can't find this file in my local installation to test changes.

Edit >> Init Script...

Put the above code in your init script and you'll have a new context menu with the bookmark toggle.

Editing my comment to add a submenu with more options.

atom.contextMenu.add {
    "atom-text-editor": [{
        label: "Bookmark"
        submenu: [
            {label: "View All", command:"bookmarks:view-all"},
            {label: "Toogle Bookmark", command:"bookmarks:toggle-bookmark"},
            {label: "Jump to Next Bookmark", command:"bookmarks:jump-to-next-bookmark"},
            {label: "Jump to Previous Bookmark", command:"bookmarks:jump-to-previous-bookmark"},
            {label: "Clear All", command:"bookmarks:clear-bookmarks"}
        ]
    }]
}

Edit 2: Fixed the "Toogle Bookmark" code thanks to @Ugotsta catching an error.

R3V1Z3 commented 6 years ago

@franklinrt awesome! If you could add a simple way to click to toggle bookmarks and then bundle all that as a package, I'm sure we'd use it.

Works great though, thanks!

franklinrt commented 6 years ago

@Ugotsta thanks for catching that. I'll edit my original post just in case anyone copies and pastes it.

As for a package with a mouse button, I haven't looked into building a package for atom. I'd have to spend some time and look into what that would entail.

macu commented 4 years ago

Is it possible to move the bookmark toggle to the left of the gutter like the breakpoint toggle? Then it wouldn't interfere with collapsing blocks. Would also like to see a right side panel listing the bookmarked lines grouped under filenames, allowing you to click any to jump there. The standard bookmarks package can go a lot further.

troskater commented 2 years ago

I created a simple package for this that adds a click event to utilize core bookmark functionality: https://atom.io/packages/click-bookmarks