Sublime Forum

What is the difference between ApplicationCommand vs WindowCommand vs TextCommand

#1

Hello,

I was using ST for a long time. For one my client I am developing a custom ST plugin. Read about the basics of on official website and few other articles.

  1. What is the main difference between ApplicationCommand vs WindowCommand vs TextCommand?
  2. I am developing a plugin for ST3. Is is possible to use Python 2.7 for developing a plugin for ST3
1 Like

#2

no, why would you want to? Python 3 handles unicode much better.

http://sublime-text-unofficial-documentation.readthedocs.io/en/latest/reference/plugins.html?highlight=windowcommand

Instances of WindowCommand have a .window attribute pointing to the window instance that created them. Similarly, instances of TextCommand have a .view attribute.

if you are going to interact with the current view, use TextCommand, otherwise use WindowCommand. I have yet to see a use case for ApplicationCommand, but I guess if you need to interact with all windows.

6 Likes

#3

Thanks for taking time and replying Keith.

My main need is to create a panel and display json data in a collapsible tree structure.

So I believe I should be using WindowCommand (showQuickPanel). Also, is it possible to create a collapsible tree structure for a json data on a panel? Right now I am going through the open source ST plugins on GitHub for references.

1 Like