Repository navigation
terminal/screen: preserve leading whitespaces in selectLine - #11503
Closed
jesusvazquez wants to merge 1 commit into
Closed
jesusvazquez wants to merge 1 commit into
jesusvazquez wants to merge 1 commit into
Conversation
Relates to ghostty-org#11463 selectLine was trimming leading whitespace on triple-click line selection, which strips indentation from the first selected line. That behavior has now changed to preserve the leading whitespaces. We continue to drop the trailing whitespaces in the line. Also added a regression unit test. Also updated a few other unit tests that had leading whitespaces. Signed-off-by: Jesus Vazquez <jesusvzpg@gmail.com>
Contributor
|
This isn't right. We already have an option to modify whitespace matching. triple-click select should probably use that. If I'm wrong in that assessment please let me know. |
Author
You are right 👍 I did not fully understand that bit before, my bad. Here is the new attempt at it #11535 |
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.
Fixes #11463
selectLinewas trimming leading whitespace on triple-click line selection, which strips indentation from the first selected line. I can see how this seemed right at the time but based on the discussion #11411 and how other terminals behave we're now adjusting this.selectLinewill now preserve the leading whitespaces.We continue to drop the trailing whitespaces in the line.
Also added a regression unit test.
Also updated a few other unit tests that had leading whitespaces.
Before
Now