Home Download Buy Blog Forum Support

command_mode in find panel

command_mode in find panel

Postby voxmea on Fri Feb 25, 2011 11:48 pm

I'm starting to setup my basic Vim bindings with command_mode. However, I can't figure out how to have the find panel open with command_mode off. How do I get access to the find panel's settings? I'm guessing the following doesn't work because the active_view isn't the find panel until it's shown, but once I show it my script stops until it returns:

Code: Select all
import sublime, sublime_plugin

class SearchInsert(sublime_plugin.WindowCommand):
    def run(self, *args):
        self.window.active_view().settings().set('command_mode', False)
        self.window.run_command('show_panel', {'panel': 'find'})


Thanks!
voxmea
 
Posts: 28
Joined: Fri Feb 04, 2011 10:02 pm

Re: command_mode in find panel

Postby jps on Sat Feb 26, 2011 12:11 am

Only files will ever become the active_view(), however in 2032 EventListeners will receive an on_activated(view) call when the find panel gets input focus. You can identify widget views (e.g., find panel, console panel, etc), by checking for the is_widget setting on the view (e.g., view.settings().get('is_widget') == True).
jps
Site Admin
 
Posts: 3077
Joined: Wed Mar 19, 2008 12:33 pm

Re: command_mode in find panel

Postby voxmea on Sun Feb 27, 2011 4:50 pm

Thanks! I look forward to 2032.
voxmea
 
Posts: 28
Joined: Fri Feb 04, 2011 10:02 pm

Re: command_mode in find panel

Postby voxmea on Mon Feb 28, 2011 1:59 am

BTW, any chance for the ability to enable a block cursor in command mode?
voxmea
 
Posts: 28
Joined: Fri Feb 04, 2011 10:02 pm

Re: command_mode in find panel

Postby jps on Mon Feb 28, 2011 3:53 am

You can use the inverse_cursor_state setting to get a block cursor
jps
Site Admin
 
Posts: 3077
Joined: Wed Mar 19, 2008 12:33 pm

Re: command_mode in find panel

Postby voxmea on Mon Feb 28, 2011 2:14 pm

Perfect, thanks again!
voxmea
 
Posts: 28
Joined: Fri Feb 04, 2011 10:02 pm


Return to General Discussion

Who is online

Users browsing this forum: codejo, Google [Bot] and 14 guests