get current file name from sublime_plugin.WindowCommand

痴心易碎 提交于 2019-12-06 06:09:31

Take a look at the API (http://www.sublimetext.com/docs/3/api_reference.html#sublime.Window). self is a window object. So you need to do self.window.active_view() to get the view.

For Sublime Text 3 the command that worked for me was:

self.view.window().active_view().file_name()

For sublime Text 3 i think using the following :

myCompleteName = self.view.file_name()

can be a solution,i've tried it with sublime_plugin.TextCommand and it works just fine

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!