From a59315f2f37b99dcee66ce0e875838b4a28ee253 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sat, 10 Nov 2012 21:00:33 +0100 Subject: support 0EB...$ command * same as EB...$, but displays the buffer ring in the filename popup with the current file highlighted immediately after the EB --- qbuffers.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'qbuffers.cpp') diff --git a/qbuffers.cpp b/qbuffers.cpp index 61eab15..289683a 100644 --- a/qbuffers.cpp +++ b/qbuffers.cpp @@ -5,11 +5,14 @@ #include #include +#include "gtk-info-popup.h" + #include #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) { -- cgit v1.2.3