-
-
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
Allow specifying file start position #445
Conversation
b1cb72e
to
722cdaa
Compare
c1c5486
to
5f1abac
Compare
7743cb9
to
f67d249
Compare
if limit_before_line_ending { | ||
row = row.min(text.len_lines() - 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.
Is this really necessary? It's handled a few lines lower
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.
Yes, or otherwise it will panic when it is out of bounds.
Linux allows |
EDIT: Oh, I see your point now. Then I suppose we should probably check if there's a file with the same name before starting to parse it for line and column. |
Then... How to open a file named |
There's no perfect solution. Even for your PR of Do you find yourself editing files named IMHO, I'd much rather support this syntax because that's what almost every compiler outputs in their diagnostics. |
Linux way:
I wrote an example, there are others: How to open a new file named
This problem has been well solved by other applications. I believe that it is convenient to take advantage of their experience. For example, reading compiler output with |
I am aware of this but I haven't encounter it myself. @Curiosidad-Racional please choose better wording, you made it sound like I purposely write this patch to annoy users. My original thoughts was check if it exists before splitting, but I think since file extension is usually at the back rather than the syntax here so I think it won't be an issue. Or maybe I should just add the check before splitting it? |
As you may have noticed I'm not a native English speaker. My intention was not to offend but to clarify. I was referring to annoying behaviors:
I didn't refer to the PR. Altruistic contributions are admirable.
IMO users espect
Whatever you prefer. We just don't make a possible use of :-) |
I implemented a check before splitting. |
helix-term/src/main.rs
Outdated
@@ -56,7 +56,7 @@ USAGE: | |||
hx [FLAGS] [files]... | |||
|
|||
ARGS: | |||
<files>... Sets the input file to use | |||
<files>... Sets the input file to use or with pos file[:row[:col]] |
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.
<files>... Sets the input file to use or with pos file[:row[:col]] | |
<files>... Sets the input file to use, position can also be specified via file[:row[:col]] |
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.
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.
Looks like there's a few merge conflicts
Like helix-term/src/commands.rs:3426:15
Like helix-term/src/commands.rs:3426:15