Sublime Forum

How to exit selection mode?

#1

Hi everyone !
I have a small problem.

self.view.sel().clear() 

seems clear the selection as it should, but I still need to click somewhere to be able to type.
So, how can I exit selection mode ?

0 Likes

#2

There is nothing like selection mode.

view.sel() is a list of Region representing the current(s) selection(s).
Each selection is in fact a cursor so clearing this list remove all the cursors (and the selection) from the view.
It mean that there is nowhere left to type.
You have to have at least one Region in the view.sel() to be able to type something.

Take a look at the API documentation (http://www.sublimetext.com/docs/2/api_reference.html) and into the included plugins source in your Packages directory.

0 Likes

#3

Thanks, now I understand the idea.

0 Likes

#4

Escape will also reduce multiple selections down to one selection (the one closest to the beginning of the file).

0 Likes