Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make line numbers clickable #43

Closed
adamjimenez opened this issue Jan 19, 2011 · 7 comments
Closed

Make line numbers clickable #43

adamjimenez opened this issue Jan 19, 2011 · 7 comments

Comments

@adamjimenez
Copy link
Contributor

Make line numbers select the corresponding line(s). A click on
a line number would select a unique line while a click+extend would select all
the lines between the initial mousedown and the mouseup.
@Gissues:{"order":95.03105590062114,"status":"backlog"}

@fjakobs
Copy link
Contributor

fjakobs commented Jan 20, 2011

Good idea. I just checked how textmate handles this:

  1. click on line number move cursor to this line
  2. shift+click extends selection until the end of the clicked line
  3. click and drag selects a range of lines
  4. clicking left of the line number adds a bookmark but doesn't move the cursor
  5. the space right of the line number is used for code folding. clicking there doesn't move the cursor either

I think we should implement 1-3

@peterflynn
Copy link

Hi, I'm interested in taking a crack at this, if no one else is working on it already...

I played with a few editors (including the latest TextMate), and I think the standard behavior is slightly different from what's stated above:

  1. Click moves cursor to start of line (as above)
  2. Shift+click extends selection to start of clicked line (differs from above)
  3. Click and drag selects everything between the start of the mousedown line and the start of the current/mouseup line.
  4. Click and drag auto-scrolls the editor when you get near the top/bottom of the view, just as it would when dragging to select within the text itself.
  5. Double-clicking the line number does different things in different editors: in TextMate it selects from the start of the line to the start of the next "word" (as if you used option+arrow on Mac or ctrl+arrow on Win), which doesn't seem very useful; in Eclipse it sets a breakpoint; in IntelliJ it selects an entire semantic unit (e.g. a conditional block); I think in some other editors it just selects the entire line.

It seems like 1-3 is the bare minimum, though 1-4 would be better. 5 doesn't seem as important. (I didn't look into bookmarking & code folding, but it sounds like that's something for another day).

@fjakobs
Copy link
Contributor

fjakobs commented Dec 1, 2011

Hi Peter,

it would be awesome I you could give it a try. I'm fine with the bahavior you described. Let me know if you need any help to get started.

@nightwing
Copy link
Member

closing since all the points (except 4 adding bookmark) are implemented now

@matthew-dean
Copy link

Does this fire an event when a line number is clicked?

@nightwing
Copy link
Member

events are not related to this issue,
and they were supported for quite some time (more than a year). try

env.editor.on("guttermousedown", function(e){
    console.log(e)
})

and the same for "guttermouseup" and "gutterclick"

@divat
Copy link

divat commented Jul 16, 2017

It's cool. Seems we have the option to set the bookmark on corresponding line inside ace editor. How to jump back to the book marked position on using any shortcut and it should be highlighted.

How to accomplish this anybody have an idea ??

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

No branches or pull requests

6 participants