aboutsummaryrefslogtreecommitdiffhomepage
path: root/main.cpp
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2012-11-16 14:42:47 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2012-11-16 14:42:47 +0100
commitf6ff327f0b7b50b74328e448ce862f7212dcae23 (patch)
tree4a773dcb9120d6a7fb96fce92422667e8702dbdf /main.cpp
parent0a8f940ffe1aaf77ba12ccc02d4e382be2118151 (diff)
downloadsciteco-f6ff327f0b7b50b74328e448ce862f7212dcae23.tar.gz
keep a buffer dirty flag and display infos about the current buffer in the interfaces (including the dirty flag)
* was a bit tricky because the Scintilla SAVEPOINTS cannot be (fully) used * when a file is loaded or saved, a Scintilla SAVEPOINT is set * SAVEPOINTLEFT notifications are used to set a buffer dirty * SAVEPOINTREACHED notifications are useless since Scintilla does not consider the saves themselves to be undoable * GTK interface displays infos in window title bar * NCURSES interface has also been updated and cleaned up a bit. Infos are displayed in a new info line. * NCURSES: fixed popup display after terminal resizing
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp30
1 files changed, 29 insertions, 1 deletions
diff --git a/main.cpp b/main.cpp
index 300d2f8..a6919c5 100644
--- a/main.cpp
+++ b/main.cpp
@@ -43,6 +43,34 @@ Interface::stdio_vmsg(MessageType type, const gchar *fmt, va_list ap)
}
}
+void
+Interface::process_notify(SCNotification *notify)
+{
+ switch (notify->nmhdr.code) {
+#ifdef DEBUG
+ case SCN_SAVEPOINTREACHED:
+ g_printf("SCINTILLA SAVEPOINT REACHED\n");
+ break;
+#endif
+ case SCN_SAVEPOINTLEFT:
+#ifdef DEBUG
+ g_printf("SCINTILLA SAVEPOINT LEFT\n");
+#endif
+
+ if (!ring.current || ring.current->dirty)
+ break;
+
+ undo.push_msg(SCI_SETSAVEPOINT);
+ undo_info_update(ring.current);
+ undo.push_var(ring.current->dirty);
+ ring.current->dirty = true;
+ info_update(ring.current);
+ break;
+ default:
+ break;
+ }
+}
+
static inline void
process_options(int &argc, char **&argv)
{
@@ -55,7 +83,7 @@ process_options(int &argc, char **&argv)
GOptionContext *options;
GOptionGroup *interface_group = interface.get_options();
- options = g_option_context_new("- Advanced interactive TECO");
+ options = g_option_context_new("- " PACKAGE_STRING);
g_option_context_add_main_entries(options, option_entries, NULL);
if (interface_group)