aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ring.cpp
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2016-01-28 05:00:52 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2016-01-28 05:00:52 +0100
commit131fe7c3431c039825587db0def807fff97b15fc (patch)
tree142f358fe34b1ed4acfda24687dc7c5029cc1ccb /src/ring.cpp
parentf4ac90104f59de06de96692213643e3b80c65e56 (diff)
downloadsciteco-131fe7c3431c039825587db0def807fff97b15fc.tar.gz
added :EX (colon-modified EX): exits SciTECO saving all modified buffers
* this allows you to exit and save only those buffers that are modified. This was not yet possible using macros, since there is currently no way to query the dirty state of buffers programmatically. * even if there was, the necessary key presses might be too much for some users. * the ability to save all modified buffers has been explicitly requested by an user in ticket #4. * the new behaviour is not compatible with classic TECO where EX would save the current file by default but provides a relatively short way to do just that. * updated the documentation: there was also one mistake regarding the boolean that EX accepts non-colon-modified.
Diffstat (limited to 'src/ring.cpp')
-rw-r--r--src/ring.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ring.cpp b/src/ring.cpp
index fcaea3a..fb10552 100644
--- a/src/ring.cpp
+++ b/src/ring.cpp
@@ -160,6 +160,16 @@ Ring::is_any_dirty(void)
return false;
}
+void
+Ring::save_all_dirty_buffers(void)
+{
+ Buffer *cur;
+
+ TAILQ_FOREACH(cur, &head, buffers)
+ if (cur->dirty && cur->filename)
+ cur->save();
+}
+
bool
Ring::edit(tecoInt id)
{