-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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: Allow mi
, ma
, mr
and md
to use newlines
#12521
base: master
Are you sure you want to change the base?
Conversation
helix-term/src/commands.rs
Outdated
|
||
if let Some(ch) = event | ||
.char() | ||
.or((event.code == KeyCode::Enter).then_some('\n')) |
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.
Searching for \n
is not exactly correct unless the document has LF line endings. This needs to search for doc.line_ending.as_str()
instead. For a doc with CRLF line endings, selecting around \n
s would exclude the opening \r
s. The surround
code needs to be refactored to accept &str
s instead of char
s in order to search for line endings
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 going with a simpler implementation since we are dealing with line endings, I'm just using line_to_char
to get information about the nth surrounding line ending. I hope that's fine
@darshanCommits It looks like you closed your PR which was going to implement replacing / deleting surrounding newlines Are you still planning on adding it? If not, I can implement it in this PR |
It was unintentional mistake on my end. I won't be able to attend it prior next week, you may go ahead and implement it here. |
mi
and ma
to use newlinesmi
, ma
, mr
and `md to use newlines
mi
, ma
, mr
and `md to use newlinesmi
, ma
, mr
and md
to use newlines
No description provided.