Adding selection for ParagraphPrevious and ParagraphNext.#3353
Merged
JoeKar merged 1 commit intomicro-editor:masterfrom Jul 20, 2024
hchac:master
Merged
Adding selection for ParagraphPrevious and ParagraphNext.#3353JoeKar merged 1 commit intomicro-editor:masterfrom hchac:master
JoeKar merged 1 commit intomicro-editor:masterfrom
hchac:master
Conversation
Neko-Box-Coder
suggested changes
Jul 6, 2024
Contributor
Author
|
@Neko-Box-Coder done, thanks |
Neko-Box-Coder
approved these changes
Jul 13, 2024
Contributor
Neko-Box-Coder
left a comment
There was a problem hiding this comment.
Tested the changes, seems good to me.
dmaluka
reviewed
Jul 16, 2024
internal/action/actions.go
Outdated
| } | ||
| // Find the first empty line | ||
| for ; line > 0; line-- { | ||
| if len(h.Buf.LineBytes(line)) == 0 && line != h.Cursor.Y { |
Collaborator
There was a problem hiding this comment.
line != h.Cursor.Y seems not needed anymore?
Contributor
Author
There was a problem hiding this comment.
You're right, thanks.
dmaluka
reviewed
Jul 16, 2024
internal/action/actions.go
Outdated
| } | ||
| } | ||
|
|
||
| // ParagraphPrevious moves the cursor to the first empty line that comes before the paragraph closest to the cursor, or beginning of the buffer if there isn't a paragraph |
Collaborator
There was a problem hiding this comment.
Just noticed: these comment lines are way too long, could you split them?
Besides that, the PR looks good to me.
Contributor
Author
|
Would you folks prefer I squash into one commit, or the 4 independent are fine? |
Collaborator
|
Ideally, squash. It's generally better to keep separate commits for separate logical changes, and squash them otherwise. In other words, organize commits in such a way that the commit history is easier to review, not harder. |
Also tweaked the behavior of Paragraph/{Previous/Next} so that it skips
all empty lines immediately next to cursor position, until it finds the
start/end of the paragraph closest to it. Once it finds the paragraph
closest to it, the same behavior as before applies. With the previous
behavior if the cursor was surrounded by empty lines, then
Paragraph/{Previous/Next} would only jump to the next empty line,
instead of jumping to the start/end of a paragraph.
Contributor
Author
|
@dmaluka done |
dmaluka
approved these changes
Jul 17, 2024
JoeKar
approved these changes
Jul 20, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Also tweaked the behavior of Paragraph/{Previous/Next} so that it skips all empty lines immediately next to cursor position, until it finds the start/end of the paragraph closest to it. Once it finds the paragraph closest to it, the same behavior as before applies. With the previous behavior if the cursor was surrounded by empty lines, then Paragraph/{Previous/Next} would only jump to the next empty line, instead of jumping to the start/end of a paragraph.