Skip to content
This repository has been archived by the owner on Jun 27, 2018. It is now read-only.

Hyperlink line numbers ( continuation of #143 ) #192

Merged
merged 15 commits into from
Apr 4, 2016

Conversation

respeccing
Copy link
Contributor

This is a continuation of #143
Hyperlink line numbers, Features:

  • temporarily move into view the line(or region) that the mouse hovers on eg. line: <anon>:3 region: <anon>:3:5: 3:10
  • restore view when mouse doesn't hover on such lines. (wherever you left your cursor while editing)
  • when left clicked, move cursor at the beginning of the specified line(or region)

In this PR I tried to address Alex's comments.
All the hard work is actually done by @mcast ! Much appreciated!

Screenshots (look at mouse hover):
1
2
3
4

And this is mouse left click:
5click
6click
7click

EDIT: fixed last screenshot which wasn't showing the cursor(blinking - timing)

mcast and others added 12 commits April 3, 2016 08:01
an ugly but useful hack
attributes re-ordered, no other changes
line selection was broken
click wasn't leaving focus in the editor
static/web.js: line 556, col 30, Bad line breaking before '+'.
  "Automatically scrolling cursor into view after selection change"
  "this will be disabled in the next version"
  "set editor.$blockScrolling = Infinity to disable this message"

cf. ajaxorg/ace#2499

> [...]  I'm calling a documented API, and it's in turn
> telling me to call an undocumented one.

and angular-ui/ui-ace#104
$blockScrolling = Infinity breaks the auto-show of selection,
  fix with explicit scrolling

improve restore of old region

(the Ace docs I found are a bit sparse, so this is works-for-me-ware)
@rust-highfive
Copy link

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@respeccing
Copy link
Contributor Author

TODO: it currently doesn't highlight panicsdone below
(I mean, that <anon>:3)
panics

EDIT: Done by a commit below, screenshot:
hyperlink program output

Side effect is obvious: println!("Hello, world!<anon>:3"); this will hyperlink to line 3.

@alexcrichton
Copy link
Member

Nice work, thanks @respeccing!

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

Successfully merging this pull request may close these issues.

4 participants