Commit 41cc8271 by castro

Replace search.c

parent c01398b1
Showing with 3 additions and 1 deletions
...@@ -4,6 +4,7 @@ void find (GtkTextView *text_view, const gchar *text, GtkTextIter *iter) ...@@ -4,6 +4,7 @@ void find (GtkTextView *text_view, const gchar *text, GtkTextIter *iter)
{ {
GtkTextIter mstart, mend; GtkTextIter mstart, mend;
GtkTextBuffer *buffer; GtkTextBuffer *buffer;
GtkTextMark *last_pos;
gboolean found; gboolean found;
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view)); buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view));
...@@ -12,7 +13,8 @@ void find (GtkTextView *text_view, const gchar *text, GtkTextIter *iter) ...@@ -12,7 +13,8 @@ void find (GtkTextView *text_view, const gchar *text, GtkTextIter *iter)
if (found) if (found)
{ {
gtk_text_buffer_select_range (buffer, &mstart, &mend); gtk_text_buffer_select_range (buffer, &mstart, &mend);
gtk_text_buffer_create_mark (buffer, "last_pos", &mend, FALSE); last_pos = gtk_text_buffer_create_mark (buffer, "last_pos", &mend, FALSE);
gtk_text_view_scroll_mark_onscreen(text_view, last_pos);
} }
} }
// funktsioon selleks kui search nuppu vajutatakse // funktsioon selleks kui search nuppu vajutatakse
......
  • Scrolling probleem lahendatud. Nüüd näitab otsing teksti, mis asub väljas pool akent. Ei pea scrollima, et näha highlighted teksti.

Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment