Skip to content

Conversation

@thecoolwinter
Copy link
Collaborator

Description

Fixes the getHighlightedLines method to get the text line instead of the visible line. This difference was pointed out in #259 when @Bogdan-Belogurov pointed out that a selection would select the line it ended on instead of the lines it contained.

This fix matches other editor's behavior, where selecting a line including the newline does not include the next line when applying a transformation.

Xcode example

An example is Xcode when indenting a selected line, note that the selection includes the newline character, but does not move the next line. Right now, CodeEdit moves the next line too.

Screen.Recording.2025-05-30.at.10.59.43.AM.mov

Related Issues

Checklist

  • I read and understood the contributing guide as well as the code of conduct
  • The issues this PR addresses are related to each other
  • My changes generate no new warnings
  • My code builds and runs on my machine
  • My changes are all related to the related issue above
  • I documented my code

Screenshots

Screen.Recording.2025-05-30.at.11.00.36.AM.mov

Copy link
Collaborator

@austincondiff austincondiff left a comment

Choose a reason for hiding this comment

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

Looks good! It's nicely documented and written. No issues that I can see.

@thecoolwinter thecoolwinter merged commit 7830486 into CodeEditApp:main May 31, 2025
2 checks passed
@thecoolwinter thecoolwinter deleted the fix/get-highlighted-ranges branch May 31, 2025 04:14
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