Sublime Forum

How to get sidebar click file info

#1

What I am trying to achieve is when user click on sidebar -> my command, I can get the files info. I didn’t see anything about this in the API doc. I read some others’ code which looks like this:

class SyncMultipleFileCommand(sublime_plugin.WindowCommand): def run(self, files):

However, it doesn’t work for me. It complains: run() missing 1 required positional argument: ‘files’, when I try to run it via side bar clicking. Am I missing something from the setup phase?

0 Likes

#2

Resolved. I just need to setup the parameters in the side bar.sublime-menu file like this:

[code]

{  
    "caption": "Sync File",  
    "command": "sync_multiple_file",
    "args": { "files": ] }
 }

][/code]

0 Likes