Skip to content


Subversion checkout URL

You can clone with
Download ZIP


End point of selection should not be included #147

oskusalerma opened this Issue · 0 comments

1 participant


Our selection logic does not match what other text editors do, and makes it impossible to implement a thin cursor.

The problem is that the end-point of the selection is inclusive, whereas it should be exclusive. So if you set the mark at line 0, column 0, and keep the cursor at the same location, right now in Trelby that means that the first character is selected. That can somehow be justified when using a block cursor, but if you're using a thin cursor that's to the left of the character, it makes no sense. It also is not how emacs works, which also has a block cursor.

There are two approaches to fixing this:

  • Make Screenplay.getMarkedLines/Columns return value semantics stay the same (inclusive), only return one less character as end point.
    • Problem: How do we mark empty lines then? We can't return -1 as column.
  • Change the semantics of those two return values to be exclusive for the end-point, and change all callers to deal with that change.

The second option looks like the right thing to do.

See discussion at #143 for history of how this was discovered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.