Author Topic: How to get the cursor to toggle between the start and end of a selection  (Read 5415 times)


  • Junior Community Member
  • Posts: 5
  • Hero Points: 0
I want to write a function that toggles the cursor from its current
position within a selection to the beginning of the selection, then to
the end, then back to its original location.

The function should detect if the current cursor position is already
on either the beginning or the end of the selection and toggle the
cursor appropriately.

Is there a function or a macro that returns the beginning and ending
line and column of the active selection, or, alternatively, the byte
offset of the cursor's current position within the selection?  Also, I
don't see how to identify the cursor's current position.  How can I
do that?

I suppose I could just create a bookmark then simply toggle to the
beginning then toggle to the end with _begin-select and _end-select,
without putting in any finer logic, because in most cases, I'm
somewhere in a large selection and want to get to the top.

Thanks for your interest and assistance.


  • Senior Community Member
  • Posts: 2766
  • Hero Points: 342
Look at

all in the help index.