-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
feat(debug): highlight current line #5957
feat(debug): highlight current line #5957
Conversation
55788ea
to
34fe8a9
Compare
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.
I am gonna test this out tomorrow. Just a couple quick comments.
I think the CI failure is unrelated and a rerun would pass fine
34fe8a9
to
3df9d6a
Compare
I am afraid you misunderstood my hint a bit. All the code you pushed in b26b98e is unnecessary. Simply add the code below after the following line: This will if let Some(frame_line) = current_frame{
let doc = doc.text();
highlights = Box::new(syntax::merge(
highlights,
vec![(frame_highlight_scope, doc.line_to_char(frame_line), doc.line_to_char(frame_line + 1))],
));
} I just wrote this down off the top of my head so there might be a typo somewhere and the code is probably not perfect but it should set you on the right path. This will remove any foreground/background colors set by syntax highlighting but leave cursors untouched (since those are merged in afterwards) |
Seems like I overcomplicated the solution a bunch. I did not realise I could just use Thank you for pointing it out! |
a9d342f
to
9950765
Compare
Fixed all issues, I just need to also update basically all themes, which I'll do during this week. |
9950765
to
c8c3f07
Compare
Talked a bit more with @pascalkuthe (thanks for being so helpful and patient) and decided to go for a more VSCode design, rather than VS. This simplifies the logic a lot the logic needed for this feature and makes it so we only need to add at minimum 1 new mandatory highlight, I would still like to allow for more customisation (read as allow VS style frame-lines), but I think it's a lot more important to get the overhaul in an MVP state, rather than focus on customisation and endless architecture discussions. This solution should be a simple one, which should not raise any/many concerns, leading to rapid inclusion. |
c8c3f07
to
26847d4
Compare
26847d4
to
bb01335
Compare
After talking some more with @archseer, we landed on this colour for the debug highlight, which I find beautiful: |
bb01335
to
33f172d
Compare
33f172d
to
15c1354
Compare
bda88b1
to
9ec135d
Compare
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.
LGTM, thanks for working on this 👍
Thank you very much for guiding me through the process! Looking forward to many more contributions 😁 |
return; | ||
} | ||
renderer.surface.set_style( | ||
Rect::new(inner.x, inner.y + pos.visual_line, inner.width, 1), |
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.
just a reference for other reviews:
Adding inner,.y
is correct here, the fact that it was missing before was a regression from #5420
Continuing work done in helix-editor#5957, these changes add column precision to breakpoints for those set using the keymap command. For those set with the mouse, preserve the current behaviour, concretely, add a line breakpoint. This allows for more fine grained control, allowing, for debuggers which support it, to add breakpoints to scopes such as lambda functions, callbacks and more. Change how the stack frame line is highlighted, using a full line for breakpoints which apply to a line and highlight only the scope for those that operate only on those scopes. Closes: helix-editor#6238 Signed-off-by: Filip Dutescu <filip.dutescu@gmail.com>
Continuing work done in helix-editor#5957, these changes add column precision to breakpoints for those set using the keymap command. For those set with the mouse, preserve the current behaviour, concretely, add a line breakpoint. This allows for more fine grained control, allowing, for debuggers which support it, to add breakpoints to scopes such as lambda functions, callbacks and more. Change how the stack frame line is highlighted, using a full line for breakpoints which apply to a line and highlight only the scope for those that operate only on those scopes. Closes: helix-editor#6238 Signed-off-by: Filip Dutescu <filip.dutescu@gmail.com>
Continuing work done in helix-editor#5957, these changes add column precision to breakpoints for those set using the keymap command. For those set with the mouse, preserve the current behaviour, concretely, add a line breakpoint. This allows for more fine grained control, allowing, for debuggers which support it, to add breakpoints to scopes such as lambda functions, callbacks and more. Change how the stack frame line is highlighted, using a full line for breakpoints which apply to a line and highlight only the scope for those that operate only on those scopes. Closes: helix-editor#6238 Signed-off-by: Filip Dutescu <filip.dutescu@gmail.com>
Continuing work done in helix-editor#5957, these changes add column precision to breakpoints for those set using the keymap command. For those set with the mouse, preserve the current behaviour, concretely, add a line breakpoint. This allows for more fine grained control, allowing, for debuggers which support it, to add breakpoints to scopes such as lambda functions, callbacks and more. Change how the stack frame line is highlighted, using a full line for breakpoints which apply to a line and highlight only the scope for those that operate only on those scopes. Closes: helix-editor#6238 Signed-off-by: Filip Dutescu <filip.dutescu@gmail.com>
9ec135d
to
a258f6d
Compare
a258f6d
to
0d87b48
Compare
0d87b48
to
31be813
Compare
Add new theme highlight keys, for setting the colour of the breakpoint character and the current line at which execution has been paused at. The two new keys are `ui.highlight.frameline` and `ui.debug.breakpoint`. Highlight according to those keys, both the line at which debugging is paused at and the breakpoint indicator. Add an indicator for the current line at which execution is paused at, themed by the `ui.debug.active` theme scope. Update various themes to showcase how the new functionality works. Better icons are dependent on helix-editor#2869, and as such will be handled in the future, once it lands. Closes: helix-editor#5952 Signed-off-by: Filip Dutescu <filip.dutescu@gmail.com>
31be813
to
0dde083
Compare
Add new theme highlight keys, for setting the colour of the breakpoint character and the current line at which execution has been paused at. The two new keys are `ui.highlight.frameline` and `ui.debug.breakpoint`. Highlight according to those keys, both the line at which debugging is paused at and the breakpoint indicator. Add an indicator for the current line at which execution is paused at, themed by the `ui.debug.active` theme scope. Update various themes to showcase how the new functionality works. Better icons are dependent on helix-editor#2869, and as such will be handled in the future, once it lands. Closes: helix-editor#5952 Signed-off-by: Filip Dutescu <filip.dutescu@gmail.com>
Add new theme highlight keys, for setting the colour of the breakpoint character and the current line at which execution has been paused at. The two new keys are `ui.highlight.frameline` and `ui.debug.breakpoint`. Highlight according to those keys, both the line at which debugging is paused at and the breakpoint indicator. Add an indicator for the current line at which execution is paused at, themed by the `ui.debug.active` theme scope. Update various themes to showcase how the new functionality works. Better icons are dependent on helix-editor#2869, and as such will be handled in the future, once it lands. Closes: helix-editor#5952 Signed-off-by: Filip Dutescu <filip.dutescu@gmail.com>
Add new theme highlight keys, for setting the colour of the breakpoint character and the current line at which execution has been paused at. The two new keys are `ui.highlight.frameline` and `ui.debug.breakpoint`. Highlight according to those keys, both the line at which debugging is paused at and the breakpoint indicator. Add an indicator for the current line at which execution is paused at, themed by the `ui.debug.active` theme scope. Update various themes to showcase how the new functionality works. Better icons are dependent on helix-editor#2869, and as such will be handled in the future, once it lands. Closes: helix-editor#5952 Signed-off-by: Filip Dutescu <filip.dutescu@gmail.com>
Add new theme highlight keys, for setting the colour of the breakpoint
character and the current line at which execution has been paused at.
The two new keys are
ui.highlight.frameline
andui.debug.breakpoint
.Highlight according to those keys, both the line at which debugging
is paused at and the breakpoint indicator.
Add an indicator for the current line at which execution is paused
at, themed by the
ui.debug.active
theme scope. Update various themesto showcase how the new functionality works.
Better icons are dependent on #2869, and as such will be handled in the
future, once it lands.
Closes: #5952
Signed-off-by: Filip Dutescu filip.dutescu@gmail.com