diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-11-10 21:00:33 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-11-10 21:00:33 +0100 |
commit | a59315f2f37b99dcee66ce0e875838b4a28ee253 (patch) | |
tree | 1d86be5d89dc5a992d9ffb494d029aab9f906b5e /qbuffers.cpp | |
parent | 406ddaa73a75e34eb57db18dfc62c7d8208d141a (diff) | |
download | sciteco-a59315f2f37b99dcee66ce0e875838b4a28ee253.tar.gz |
support 0EB...$ command
* same as EB...$, but displays the buffer ring in the filename popup with the current file highlighted immediately after the EB
Diffstat (limited to 'qbuffers.cpp')
-rw-r--r-- | qbuffers.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/qbuffers.cpp b/qbuffers.cpp index 61eab15..289683a 100644 --- a/qbuffers.cpp +++ b/qbuffers.cpp @@ -5,11 +5,14 @@ #include <glib/gprintf.h> #include <glib/gstdio.h> +#include "gtk-info-popup.h" + #include <Scintilla.h> #include "sciteco.h" #include "undo.h" #include "parser.h" +#include "expressions.h" #include "qbuffers.h" Ring ring; @@ -110,7 +113,7 @@ Ring::close(void) Buffer *buffer = current; buffer->close(); - current = LIST_NEXT(buffer, buffers) ? : LIST_FIRST(&head); + current = buffer->next() ? : first(); if (!current) edit(NULL); @@ -137,6 +140,22 @@ StateFile::do_edit(const gchar *filename) ring.undo_close(); } +void +StateFile::initial(void) +{ + gint64 id = expressions.pop_num_calc(1, -1); + + if (id == 0) { + for (Buffer *cur = ring.first(); cur; cur = cur->next()) + gtk_info_popup_add_filename(filename_popup, + GTK_INFO_POPUP_FILE, + cur->filename ? : "(Unnamed)", + cur == ring.current); + + gtk_widget_show(GTK_WIDGET(filename_popup)); + } +} + State * StateFile::done(const gchar *str) { |