-
Notifications
You must be signed in to change notification settings - Fork 74
Conversation
an ugly but useful hack
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> |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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:..."
attributes re-ordered, no other changes
line selection was broken click wasn't leaving focus in the editor
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. |
"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)
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; |
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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:
Sorry for the delay! Could you also post a screenshot or two of what this looks like? |
Hi @respeccing, |
Hyperlink line numbers ( continuation of #143 )
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.