LoginSignup
3
3

More than 5 years have passed since last update.

プラグインの実行時に引数を渡す

Posted at

渡したい引数をrunメソッドの第3引数以降に定義。

class HogeCommand(sublime_plugin.TextCommand):
  def run(self, edit, fuga, hege):
    print fuga
    print huge

キーマップの設定でargsに対しハッシュを渡す。この際のキーが上記で定義したrunメソッドの引数と対応する。

{ "keys": ["super+c"], "command": "hoge", "args": {"fuga": "a", "hege": "b"} }
3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3