summaryrefslogtreecommitdiff
path: root/src/fe-text
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-08-08 15:43:07 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-08-08 15:43:07 +0000
commitb9a83129fe65d6d81d0ef82d5bf7814018700a8d (patch)
tree8ce1082282835954cf1ee59b8a9d0715e318021f /src/fe-text
parent9beaf82839472e2c68897605370aeefd18224a86 (diff)
downloadirssi-b9a83129fe65d6d81d0ef82d5bf7814018700a8d.zip
Some extra cleanups for /SB CLEAR.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1719 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-text')
-rw-r--r--src/fe-text/textbuffer-view.c9
-rw-r--r--src/fe-text/textbuffer.c1
2 files changed, 10 insertions, 0 deletions
diff --git a/src/fe-text/textbuffer-view.c b/src/fe-text/textbuffer-view.c
index aa9f5c2b..37434f55 100644
--- a/src/fe-text/textbuffer-view.c
+++ b/src/fe-text/textbuffer-view.c
@@ -966,6 +966,12 @@ void textbuffer_view_remove_line(TEXT_BUFFER_VIEW_REC *view, LINE_REC *line)
textbuffer_remove(view->buffer, line);
}
+static int g_free_true(void *data)
+{
+ g_free(data);
+ return TRUE;
+}
+
/* Remove all lines from buffer. */
void textbuffer_view_remove_all_lines(TEXT_BUFFER_VIEW_REC *view)
{
@@ -975,6 +981,9 @@ void textbuffer_view_remove_all_lines(TEXT_BUFFER_VIEW_REC *view)
textbuffer_remove_all_lines(view->buffer);
+ g_hash_table_foreach_remove(view->bookmarks,
+ (GHRFunc) g_free_true, NULL);
+
/* destroy line caches - note that you can't do simultaneously
unrefs + cache_get()s or it will keep using the old caches */
textbuffer_cache_unref(view->cache);
diff --git a/src/fe-text/textbuffer.c b/src/fe-text/textbuffer.c
index 105e192a..743cd2a2 100644
--- a/src/fe-text/textbuffer.c
+++ b/src/fe-text/textbuffer.c
@@ -333,6 +333,7 @@ void textbuffer_remove_all_lines(TEXT_BUFFER_REC *buffer)
buffer->cur_line = NULL;
buffer->lines_count = 0;
+ buffer->last_eol = TRUE;
}
void textbuffer_line2text(LINE_REC *line, int coloring, GString *str)