Sublime Forum

Auto-create new tab while pasting content into empty window

#1

Automatically create new tab/document while pasting text or code into Sublime Text window with no tabs / open documents. So it wouldn’t require the extra step of manually creating one each and every time.

Please vote for this request here:
sublimetext.userecho.com/topic/1 … ty-window/

Thank you.

0 Likes

#2

ST already create an empty view ready to use in most case (New Window, Close Project, …), so the only case I see is when you manually close all files, which I probably never do.
What’s your workflow that result an empty ST window ?

In addition, hitting ctrl+n before pasting is not a big deal…

And you can always use a plugin to do what you want (not tested):

[code]import sublime, sublime_plugin

class MyPasteCommand(sublime_plugin.WindowCommand):
def run(self):
if not self.window.views():
self.window.run_command(“new_file”)
self.window.run_command(“paste”)[/code]

0 Likes

#3

You guessed it, I get an empty ST window by closing tabs manually. That is something I do occasionally.

Maybe ST shouldn’t close the last tab? Just create an empty/untitled document instead? That’s exactly what web browsers do (there’s always at least one tab open).

0 Likes

#4

Really? What web browser do you use?

0 Likes

#5

All browsers keep at least one tab open. There’s no tabless mode like ST has.

0 Likes

#6

Well, again, I’m not sure what browser you use (or OS?) because on my computer I can close all the tabs in any of my browsers (Chrome, Firefox, Safari).

0 Likes

#7

And when you do close the last one the whole windows closes itself.
But when the window is open, there’s always at least one tab open too (unlike in Sublime Text).

This is true of Firefox, Chrome, Safari, Internet Explorer and Opera.
(Additionally… Safari and Opera don’t allow users to close the last tab from tab bar.)

0 Likes