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

hyperlink compiler error line numbers #143

Closed
wants to merge 10 commits into from

Conversation

mcast
Copy link
Contributor

@mcast mcast commented Jul 17, 2015

I should say I haven't brought up an entire playpen, I only tested it with file:/// and hacking one of the UI buttons to inject canned rustc output.

an ugly but useful hack
@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @huonw (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

function editLine(r1) { var e = editSel(); e.clearSelection(); e.setSelectionAnchor(r1-1,0); e.selectLine() }
function editShow(r1,c1, r2,c2) { var e = editSel(); old_range = e.getRange(); e.clearSelection(); e.setSelectionAnchor(r1-1,c1-1); e.selectTo(r2-1,c2-1) }
function editGo(r1,c1) { var e = editSel(); e.moveCursorTo(r1-1,c1-1,false); old_range = undefined }
</script>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be added to the js instead of here in the html?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. This was hastiness plus my misunderstanding of where functions can be declared, to be reachable from href="javascript:..."

mcast added 7 commits July 17, 2015 22:30
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 '+'.
@mcast
Copy link
Contributor Author

mcast commented Jul 18, 2015

Tidier now. Also discovered some of the new features were broken, fixed now.

I added style and detect panics, but suspect I'm not finding all the possible line number sites. I will "watch" for issues later.

mcast added 2 commits July 18, 2015 15:05
  "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)
@mcast
Copy link
Contributor Author

mcast commented Jul 18, 2015

The "editor.$blockScrolling = Infinity" fix for console noise broke scrolling. Fixed it better now.

@@ -553,6 +575,8 @@
themes = document.getElementById("themes");
editor = ace.edit("editor");
set_result.editor = editor;
editor.$blockScrolling = Infinity;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's up with this variable? It looks like it may be a little fishy...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That var is also used here

It looks like it's needed to be set in order to avoid showing a warning when calling setValue() ajaxorg/ace#2499

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current rust-playpen actually gives the warning twice:
blockcursor

@alexcrichton
Copy link
Member

Sorry for the delay! Could you also post a screenshot or two of what this looks like?

@alexcrichton alexcrichton assigned alexcrichton and unassigned huonw Jul 27, 2015
@panicbit
Copy link
Contributor

@alexcrichton Rawgit demo

@respeccing
Copy link
Contributor

According to that rawgit demo, looks like it breaks(or broke at the time) the colors codes:

Otherwise, it looks good:
I positioned cursor at line 33, to show how hovering works next
screenshot_2016-04-03_07-12-38

The below screenshot is when I hover mouse - temporarily scrolls to line(when I move away, it scrolls back to where cursor is: line 33 like in the above screenshot):
screenshot_2016-04-03_07-12-48
screenshot_2016-04-03_07-12-55

And the following is what happens when I click(permanently move cursor):
screenshot_2016-04-03_07-13-05
screenshot_2016-04-03_07-13-11

@respeccing
Copy link
Contributor

Nevermind! The colors actually work when this PR is applied on latest master!

untitled

Should I attempt to address the last of Alex's comments and resubmit this as new PR? (uses original commits - so author preserved) - on it anyway, if there are no objections xD

@mcast
Copy link
Contributor Author

mcast commented Apr 4, 2016

Hi @respeccing,
Thanks for picking this up in #192, I guess my side-project-budget dried up but it'll be good to have it merged in some form.

@mcast mcast closed this Apr 4, 2016
alexcrichton added a commit that referenced this pull request Apr 4, 2016
Hyperlink line numbers ( continuation of #143 )
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.

6 participants