aboutsummaryrefslogtreecommitdiffhomepage
path: root/qbuffers.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qbuffers.cpp')
-rw-r--r--qbuffers.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/qbuffers.cpp b/qbuffers.cpp
index 762566e..51bf65f 100644
--- a/qbuffers.cpp
+++ b/qbuffers.cpp
@@ -173,6 +173,9 @@ Buffer::load(const gchar *filename)
interface.ssm(SCI_GOTOPOS, 0);
interface.ssm(SCI_SETSAVEPOINT);
+ interface.undo_info_update(this);
+ undo.push_var(dirty);
+ dirty = false;
set_filename(filename);
@@ -231,7 +234,9 @@ Ring::edit(const gchar *filename)
current_save_dot();
+ qregisters.current = NULL;
if (buffer) {
+ current = buffer;
buffer->edit();
} else {
new_in_ring = true;
@@ -239,6 +244,8 @@ Ring::edit(const gchar *filename)
buffer = new Buffer();
LIST_INSERT_HEAD(&head, buffer, buffers);
+ current = buffer;
+
if (g_file_test(filename, G_FILE_TEST_IS_REGULAR)) {
buffer->load(filename);
@@ -258,9 +265,6 @@ Ring::edit(const gchar *filename)
}
}
- qregisters.current = NULL;
- current = buffer;
-
return new_in_ring;
}
@@ -377,6 +381,11 @@ Ring::save(const gchar *filename)
if (!g_file_set_contents(filename, buffer, size, NULL))
return false;
+ interface.ssm(SCI_SETSAVEPOINT);
+ interface.undo_info_update(current);
+ undo.push_var(current->dirty);
+ current->dirty = false;
+
/*
* FIXME: necessary also if the filename was not specified but the file
* is (was) new, in order to canonicalize the filename.