Sublime Forum

command_mode in find panel

#1

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]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’})[/code]

Thanks!

0 Likes

#2

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).

0 Likes

#3

Thanks! I look forward to 2032.

0 Likes

#4

BTW, any chance for the ability to enable a block cursor in command mode?

0 Likes

#5

You can use the inverse_cursor_state setting to get a block cursor

0 Likes

#6

Perfect, thanks again!

0 Likes