Home Download Buy Blog Forum Support

Auto-create new tab while pasting content into empty window

Auto-create new tab while pasting content into empty window

Postby taimar on Mon May 13, 2013 10:05 am

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:
http://sublimetext.userecho.com/topic/1 ... ty-window/

Thank you.
taimar
 
Posts: 7
Joined: Thu Aug 30, 2012 12:03 pm

Re: Auto-create new tab while pasting content into empty window

Postby bizoo on Mon May 13, 2013 10:51 am

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: Select all
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")
bizoo
 
Posts: 886
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: Auto-create new tab while pasting content into empty window

Postby taimar on Mon May 13, 2013 12:42 pm

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).
taimar
 
Posts: 7
Joined: Thu Aug 30, 2012 12:03 pm

Re: Auto-create new tab while pasting content into empty window

Postby adzenith on Mon May 13, 2013 1:38 pm

taimar wrote:That’s exactly what web browsers do (there’s always at least one tab open).

Really? What web browser do you use?
adzenith
 
Posts: 1217
Joined: Mon Oct 19, 2009 9:12 pm

Re: Auto-create new tab while pasting content into empty window

Postby taimar on Mon May 13, 2013 4:56 pm

adzenith wrote:Really? What web browser do you use?

All browsers keep at least one tab open. There’s no tabless mode like ST has.
taimar
 
Posts: 7
Joined: Thu Aug 30, 2012 12:03 pm

Re: Auto-create new tab while pasting content into empty window

Postby adzenith on Mon May 13, 2013 9:17 pm

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).
adzenith
 
Posts: 1217
Joined: Mon Oct 19, 2009 9:12 pm

Re: Auto-create new tab while pasting content into empty window

Postby taimar on Tue May 14, 2013 9:42 am

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.)
taimar
 
Posts: 7
Joined: Thu Aug 30, 2012 12:03 pm


Return to Ideas and Feature Requests

Who is online

Users browsing this forum: No registered users and 9 guests