summary refs log tree commit diff stats
path: root/src/fe-gtk/xtext.h
diff options
context:
space:
mode:
authorRichard Hitt <rbh00@localhost.localdomain>2013-09-18 15:25:50 -0700
committerRichard Hitt <rbh00@localhost.localdomain>2013-09-18 15:25:50 -0700
commitcd825ac735303393f2b36bfcd3dc99e1cf93b1db (patch)
treed003b999671f1796d4cc90cadfe21d6cecd6c824 /src/fe-gtk/xtext.h
parent1007af9506dc94f3ab41ee52e4899182a48c8dec (diff)
Improve text repositioning when searchbar string is modified.
Diffstat (limited to 'src/fe-gtk/xtext.h')
-rw-r--r--src/fe-gtk/xtext.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/fe-gtk/xtext.h b/src/fe-gtk/xtext.h
index 446708be..32e26af6 100644
--- a/src/fe-gtk/xtext.h
+++ b/src/fe-gtk/xtext.h
@@ -64,6 +64,20 @@ typedef struct _GtkXText GtkXText;
 typedef struct _GtkXTextClass GtkXTextClass;
 typedef struct textentry textentry;
 
+/*
+ * offsets_t is used for retaining search information.
+ * It is stored in the 'data' member of a GList,
+ * as chained from ent->marks.  It saves starting and
+ * ending+1 offset of a found occurrence.
+ */
+typedef union offsets_u {
+	struct offsets_s {
+		guint16	start;
+		guint16	end;
+	} o;
+	guint32 u;
+} offsets_t;
+
 typedef struct {
 	GtkXText *xtext;					/* attached to this widget */
 
@@ -105,6 +119,7 @@ typedef struct {
 	gtk_xtext_search_flags search_flags;	/* match, bwd, highlight */
 	GList *cursearch;			/* GList whose 'data' pts to current textentry */
 	GList *curmark;			/* current item in ent->marks */
+	offsets_t curdata;		/* current offset info, from *curmark */
 	GRegex *search_re;		/* Compiled regular expression */
 	textentry *hintsearch;	/* textentry found for last search */
 } xtext_buffer;