Sublime Forum

When Adding a Bookmark, take file out of preview mode

#1

I’ve been bitten by this several times. Please take the file out of Preview Mode when a bookmark is added. Or, add an option to enable this behaviour.

If a user is adding a bookmark, it would be safe to assume that they would like to keep the file open for a few minutes.

The current behavior, causes the file to close, and therefore lose the bookmark, when another file is clicked.

0 Likes

#2

/Packages/User/Hooks.py


class Hooks(sublime_plugin.EventListener):

    def on_text_command(self, view, command_name, args):
        # print('on_text_command')
        # print(command_name)
        # print(args)
        pass

    def on_window_command(self, window, command_name, args):
        # print('on_window_command')
        # print(command_name)
        # print(args)
        pass

    def on_post_text_command(self, view, command_name, args):
        # print('on_post_text_command')
        # print(command_name)
        # print(args)
        if command_name == 'toggle_bookmark' and view.file_name():
        	sublime.active_window().open_file(view.file_name())
        pass

    def on_post_window_command(self, window, command_name, args):
        # print('on_post_window_command')
        # print(command_name)
        # print(args)
        pass
0 Likes