aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2015-12-10 09:29:36 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2015-12-10 09:29:36 -0500
commit1cc6940c42c52ba9652e3f8f049f6671de6d89a7 (patch)
tree4062c2cfc69d5f8fd85caaa973789b29adf860cf
parent15887b8ac36d6c4032dde44981cc10bf5c0708cb (diff)
downloadtextadept-1cc6940c42c52ba9652e3f8f049f6671de6d89a7.tar.gz
textadept-1cc6940c42c52ba9652e3f8f049f6671de6d89a7.zip
Do not visit buffers that do not need saving in `io.save_all_files()`.
This speeds up `io.save_all_files()`, particularly on remote filesystems. Thanks to Ivan Baidakou.
-rw-r--r--THANKS.md1
-rw-r--r--core/file_io.lua6
2 files changed, 5 insertions, 2 deletions
diff --git a/THANKS.md b/THANKS.md
index 4c091473..110c4a29 100644
--- a/THANKS.md
+++ b/THANKS.md
@@ -35,6 +35,7 @@ private contract work related to Textadept.
* Daniel Wutke
* Gilles Grégoire
* Giovanni Salmeri
+* Ivan Baidakou
* Jay Gould
* Jeff Stone
* John Benediktsson
diff --git a/core/file_io.lua b/core/file_io.lua
index e4e08d07..ff1ecf9b 100644
--- a/core/file_io.lua
+++ b/core/file_io.lua
@@ -245,8 +245,10 @@ end
function io.save_all_files()
local current_buffer = _BUFFERS[buffer]
for i, buffer in ipairs(_BUFFERS) do
- view:goto_buffer(i)
- if buffer.filename and buffer.modify then io.save_file() end
+ if buffer.filename and buffer.modify then
+ view:goto_buffer(i)
+ io.save_file()
+ end
end
view:goto_buffer(current_buffer)
end