aboutsummaryrefslogtreecommitdiff
path: root/core/file_io.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2013-10-18 12:05:32 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2013-10-18 12:05:32 -0400
commit20c4fb3baaac9d176e029e3680cc0c8e8101e44c (patch)
tree785ad6aefe188739ffe8560cd6138e8309425f9c /core/file_io.lua
parent8f682b9de06785cd20b9fb6e18460a1e53fd1ca1 (diff)
downloadtextadept-20c4fb3baaac9d176e029e3680cc0c8e8101e44c.tar.gz
textadept-20c4fb3baaac9d176e029e3680cc0c8e8101e44c.zip
The buffer API applies to all buffers now, not just the global one.
Created a "dummy" Scintilla view for operating on non-global documents. Removed `buffer:check_global()` and replaced `buffer.dirty` with Scintilla's `buffer.modify`.
Diffstat (limited to 'core/file_io.lua')
-rw-r--r--core/file_io.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/file_io.lua b/core/file_io.lua
index ad8f677f..cfd0967f 100644
--- a/core/file_io.lua
+++ b/core/file_io.lua
@@ -254,7 +254,7 @@ 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.dirty then io.save_file() end
+ if buffer.filename and buffer.modify then io.save_file() end
end
view:goto_buffer(current_buffer)
end
@@ -266,7 +266,7 @@ end
-- @name close_buffer
function io.close_buffer()
local filename = buffer.filename or buffer._type or _L['Untitled']
- if buffer.dirty and ui.dialogs.msgbox{
+ if buffer.modify and ui.dialogs.msgbox{
title = _L['Close without saving?'],
text = _L['There are unsaved changes in'],
informative_text = filename:iconv('UTF-8', _CHARSET),
@@ -319,7 +319,7 @@ events_connect(events.VIEW_AFTER_SWITCH, update_modified_file)
-- Closes the initial "Untitled" buffer.
events_connect(events.FILE_OPENED, function(filename)
local buf = _BUFFERS[1]
- if #_BUFFERS == 2 and not (buf.filename or buf._type or buf.dirty) then
+ if #_BUFFERS == 2 and not (buf.filename or buf._type or buf.modify) then
view:goto_buffer(1)
io.close_buffer()
end