summaryrefslogtreecommitdiff
path: root/src/glibext
diff options
context:
space:
mode:
Diffstat (limited to 'src/glibext')
-rw-r--r--src/glibext/gbufferline.c7
-rw-r--r--src/glibext/gbufferline.h4
2 files changed, 10 insertions, 1 deletions
diff --git a/src/glibext/gbufferline.c b/src/glibext/gbufferline.c
index 7f88bff..6e3c928 100644
--- a/src/glibext/gbufferline.c
+++ b/src/glibext/gbufferline.c
@@ -87,6 +87,7 @@ struct _GBufferLine
buffer_line_column columns[BLC_COUNT]; /* Répartition du texte */
BufferLineColumn merge_start; /* Début de la zone globale */
+ BufferLineColumn last_used; /* Dernière colonne utilisée */
};
@@ -472,6 +473,7 @@ static void g_buffer_line_init(GBufferLine *line)
reset_column(&line->columns[i]);
line->merge_start = BLC_COUNT;
+ line->last_used = BLC_COUNT;
}
@@ -623,6 +625,11 @@ void g_buffer_line_insert_text(GBufferLine *line, BufferLineColumn column, const
class = G_BUFFER_LINE_GET_CLASS(line);
+ if (column == BLC_LAST_USED)
+ column = line->last_used;
+ else
+ line->last_used = column;
+
segment = g_buffer_segment_new(class->context, class->attribs[type], text, length);
g_buffer_line_add_segment(line, column, segment);
diff --git a/src/glibext/gbufferline.h b/src/glibext/gbufferline.h
index 1bba0ba..3f0676a 100644
--- a/src/glibext/gbufferline.h
+++ b/src/glibext/gbufferline.h
@@ -59,7 +59,9 @@ typedef enum _BufferLineColumn
BLC_ASSEMBLY, /* Code pour assembleur */
BLC_COMMENTS, /* Commentaires éventuels */
- BLC_COUNT
+ BLC_COUNT,
+
+ BLC_LAST_USED /* Dernière colonne utilisée */
} BufferLineColumn;