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

Fix triple clicking empty line and dragging #5068

Merged
merged 5 commits into from
Jan 20, 2025

Conversation

otomist
Copy link
Contributor

@otomist otomist commented Jan 14, 2025

Fixes core issue #4957. Adds a bool to SelectLine allowing the selectLine function to select lines that are empty. When starting a triple selection on an empty line the initial selectLine returns null because we don't see any characters, in this case we rerun selectLine but short circuit with the allow_empty_lines. We need to run selectLine with out allowing empty lines once because if there are characters on the line we don't want to select empty space.

@otomist otomist changed the title add and use flag for selecting empty lines in the selectLine function Fix triple clicking empty line and dragging Jan 14, 2025
Copy link
Contributor

@mitchellh mitchellh left a comment

Choose a reason for hiding this comment

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

The approach looks good, some requests.

src/terminal/Screen.zig Outdated Show resolved Hide resolved
src/terminal/Screen.zig Outdated Show resolved Hide resolved
src/Surface.zig Outdated Show resolved Hide resolved
@otomist
Copy link
Contributor Author

otomist commented Jan 15, 2025

Cleaned up the solution to use the pre-existing whitespace option in SelectLine. The logic in triple click drag hasn't changed. This way we don't add new unnecessary variables into screen.zip

@otomist otomist requested a review from mitchellh January 15, 2025 17:24
@mitchellh mitchellh force-pushed the fix-triple-clicking-drag branch from 38121bf to e5a3be3 Compare January 20, 2025 18:23
@mitchellh mitchellh enabled auto-merge January 20, 2025 18:24
@mitchellh mitchellh merged commit f8ece63 into ghostty-org:main Jan 20, 2025
30 checks passed
@github-actions github-actions bot added this to the 1.1.0 milestone Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants