Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yad
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vladislav
yad
Commits
0108d5e1
Commit
0108d5e1
authored
May 02, 2021
by
Victor Ananjevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix find procedure
parent
ce491748
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
text.c
src/text.c
+9
-2
No files found.
src/text.c
View file @
0108d5e1
...
...
@@ -28,6 +28,7 @@ static GdkCursor *hand, *normal;
static
YadSearchBar
*
search_bar
;
static
GtkTextIter
search_pos
;
static
gboolean
text_changed
=
FALSE
;
static
gboolean
search_changed
=
FALSE
;
/* searching */
static
void
...
...
@@ -52,6 +53,7 @@ do_find_next (GtkWidget *w, gpointer d)
gtk_text_view_scroll_to_iter
(
GTK_TEXT_VIEW
(
text_view
),
&
match_start
,
0
.
0
,
FALSE
,
0
.
0
,
0
.
0
);
gtk_text_buffer_select_range
(
GTK_TEXT_BUFFER
(
text_buffer
),
&
match_start
,
&
match_end
);
search_pos
=
match_end
;
search_changed
=
TRUE
;
}
search_bar
->
new_search
=
FALSE
;
...
...
@@ -73,6 +75,7 @@ do_find_prev (GtkWidget *w, gpointer d)
gtk_text_view_scroll_to_iter
(
GTK_TEXT_VIEW
(
text_view
),
&
match_start
,
0
.
0
,
FALSE
,
0
.
0
,
0
.
0
);
gtk_text_buffer_select_range
(
GTK_TEXT_BUFFER
(
text_buffer
),
&
match_start
,
&
match_end
);
search_pos
=
match_start
;
search_changed
=
TRUE
;
}
}
...
...
@@ -90,8 +93,12 @@ stop_search_cb (GtkWidget *w, YadSearchBar *sb)
ignore_esc
=
FALSE
;
gtk_search_bar_set_search_mode
(
GTK_SEARCH_BAR
(
search_bar
->
bar
),
FALSE
);
gtk_widget_grab_focus
(
text_view
);
gtk_text_iter_backward_char
(
&
search_pos
);
gtk_text_buffer_place_cursor
(
GTK_TEXT_BUFFER
(
text_buffer
),
&
search_pos
);
if
(
search_changed
)
{
gtk_text_iter_backward_char
(
&
search_pos
);
gtk_text_buffer_place_cursor
(
GTK_TEXT_BUFFER
(
text_buffer
),
&
search_pos
);
}
search_changed
=
FALSE
;
}
/* early prototype for use in open_file_cb() */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment