Sublime Forum

How to close and don't save all open tabs

#1

I did a find a replace and by accident did my entire project, which opened up 30,000 tabs and made the change. Now I want to discard all the changes, but there is not a “Don’t Save All” button in the confirmation modal.

How do I close and don’t save all open tabs?

See:

0 Likes

#2

Restart your pc :smile:

0 Likes

#3

Run this in the console:

len(v.run_command("revert") for v in window.views())

It will undo all changes in the currently opened views.

0 Likes

#4

Thanks for the reply, but getting an error:

>>> len(v.run_command("revert") for v in window.views()) Traceback (most recent call last): File "<string>", line 1, in <module> TypeError: object of type 'generator' has no len()

I am running version 3083.

0 Likes

#5

Sorry,

len([v.run_command("revert") for v in window.views()])

then.

1 Like

#6

That worked. You sir deserve a beer! Thanks so much.

1 Like

#7

[quote=“FichteFoll”]Sorry,

len([v.run_command("revert") for v in window.views()])

then.[/quote]

Please I must have multiple tabs open and I need to “save and close all of them” at once, but every each of them with a different name: i.e I have 20 tabs open and I´d like to close all of them at once but being numbered from 1 to 20: is this possible? for the moment what I do is: Ctrl+S then save as HTML “1”, then Crtl+W and go to the next tab.

I´ll be very thankful if you can help me out with this!!! but if it aín´t possible thank you nayways!!!

jl

0 Likes

#8

Thanks a lot!

I used it to save all tables:

len([v.run_command("save") for v in window.views()])
0 Likes