Home Download Buy Blog Forum Support

How to exit selection mode ?

How to exit selection mode ?

Postby ask on Wed Sep 14, 2011 12:49 pm

Hi everyone !
I have a small problem.

Code: Select all
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 ?
ask
 
Posts: 26
Joined: Wed Sep 14, 2011 12:40 pm

Re: How to exit selection mode ?

Postby bizoo on Wed Sep 14, 2011 1:23 pm

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.
bizoo
 
Posts: 870
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: How to exit selection mode ?

Postby ask on Wed Sep 14, 2011 5:10 pm

Thanks, now I understand the idea.
ask
 
Posts: 26
Joined: Wed Sep 14, 2011 12:40 pm

Re: How to exit selection mode ?

Postby jbjornson on Thu Sep 15, 2011 7:03 am

ask wrote:So, how can I exit selection mode ?


Escape will also reduce multiple selections down to one selection (the one closest to the beginning of the file).
jbjornson
 
Posts: 340
Joined: Tue Oct 27, 2009 4:25 pm
Location: Zurich, Switzerland


Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 6 guests