Sublime Forum

Event listener for snippet field navigation?

#1

Hello everyone!

Is there a method which is being triggered when you navigate from one field of a snippet to another?

Iā€™m trying to present a popup upon snippet insertion, and update that popup based on the field index that is being edited. I guess that I need an event listener for such a case.

Waiting for you assistance :wink:
Have a lovely weekend

0 Likes

#2

Possibly this:

class FieldListener(sublime_plugin.EventListener):
        
    def on_text_command(self, view, command_name, args):

        if command_name == "next_field":
            # do stuff
1 Like