how to close all saved tabs and keep unsaved ones? #1686
abdeldjalil-fellah
started this conversation in
General
Replies: 1 comment
-
You can make your own command like this: local command = require "core.command"
local DocView = require "core.docview"
command.add(nil, {
["root:close-all-saved"] = function()
local rn = core.root_view.root_node
local children = rn:get_children()
for _, v in ipairs(children) do
if v:is(DocView) and not v.doc:is_dirty() then
rn:get_node_for_view(v):close_view(rn, v)
end
end
end
}) Add this to your user module, and you'll be able to call it from the command palette. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
how to close all saved tabs and keep unsaved ones?
Beta Was this translation helpful? Give feedback.
All reactions