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

Misc code editor additions/fixes #967

Merged
merged 1 commit into from
Dec 3, 2019
Merged

Conversation

wadetb
Copy link
Contributor

@wadetb wadetb commented Dec 2, 2019

  • Ctrl+backspace, Ctrl+delete delete adjacent words.
  • Ctrl+x without selection cuts the entire line. Previously
    it was implemented but buggy; it copied the line but didn't have a
    selection to replace.
  • Outline match supports non-consecutive forward matches, for
    instance "dph" will match "drawPlayerHit". Matching characters are
    highlighted in the outline view.

- Ctrl+backspace, Ctrl+delete delete adjacent words.
- Ctrl+x without selection cuts the entire line. Previously
it was implemented but buggy; it copied the line but didn't have a
selection to replace.
- Outline match supports non-consecutive forward matches, for
instance "dph" will match "drawPlayerHit". Matching characters are
highlighted in the outline view.
@wadetb
Copy link
Contributor Author

wadetb commented Dec 2, 2019

This is just some minor editor stuff that I found useful, feel free to take it or leave it.

@wadetb
Copy link
Contributor Author

wadetb commented Dec 2, 2019

code-editor-1
code-editor-2

Copy link
Owner

@nesbox nesbox left a comment

Choose a reason for hiding this comment

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

I reviewed and tested, all is ok except small bug, it doesn't save cursor position properly when I use ctrl+del and the undo, however, ctrl+backspace works well.
bug
Could you please fix it?
Thank you.

@nesbox nesbox added editor: code Issues related to code editor enhancement Improvement of existing feature or adding something new labels Dec 2, 2019
@nesbox nesbox added this to the 0.80.0 milestone Dec 2, 2019
@wadetb
Copy link
Contributor Author

wadetb commented Dec 2, 2019

Sure- I took a quick look and found that it's two separate issues with the undo system.

If there is no change (e.g. the cursor doesn't move) there will be no list entry created by history_add. You can repro the same behavior with just the delete key.

Also, undo state is recorded after the action, so the first edit made will always undo the cursor back to the top of the file.

I'll spend some time later and try to fix both issues without causing other problems.

@nesbox
Copy link
Owner

nesbox commented Dec 3, 2019

Ahh, it looks like a more general issue and doesn't depend on the PR, I'll merge it and create a separate issue then, it will be better.
Thanks :)

@nesbox nesbox merged commit 462cbe4 into nesbox:master Dec 3, 2019
@nesbox nesbox removed this from the 0.80.0 milestone Jul 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor: code Issues related to code editor enhancement Improvement of existing feature or adding something new
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants