gpfsmurf wrote:But he's talking about empty untitled tabs, so you wouldn't lose your work anyways. I think it makes sense
import sublime, sublimeplugin
def onModified(self, view):
#we only check empty tabs...
if(view.fileName() == None):
view_has_content = view.findAll('\S')
if(len(view_has_content) <= 0):
gpfsmurf wrote:The problem is that if you have a genuine scratch buffer, the plugin will remove its scratch flag.
I think using view.name() instead of view.fileName() will fix this, as long as scratch buffers are named.
If I don't have any tabs open in Sublime, and I have text in the clipboard, if I hit CTRL+V, a new untitled tab should open, and the contents of the clipboard should be pasted into it.
def run(self, window, args):
if(len(window.views()) == 0 and sublime.getClipboard() != ''):
view = window.activeView()
EJ12N wrote:Also only way to run multiple commands with one command is to do a custom command (plugin)
Users browsing this forum: Exabot [Bot] and 14 guests