Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
pwmt
zathura
Commits
ed615533
Commit
ed615533
authored
Feb 07, 2012
by
Sebastian Ramacher
Browse files
jump to first result if it is not one the current page
parent
4450f41e
Changes
1
Hide whitespace changes
Inline
Side-by-side
commands.c
View file @
ed615533
...
...
@@ -285,9 +285,10 @@ cmd_search(girara_session_t* session, const char* input, girara_argument_t* argu
return
false
;
}
bool
firsthit
=
true
;
for
(
unsigned
int
page_id
=
0
;
page_id
<
zathura
->
document
->
number_of_pages
;
++
page_id
)
{
zathura_page_t
*
page
=
zathura
->
document
->
pages
[
page_id
];
if
(
page
==
NULL
||
page
->
visible
==
false
)
{
zathura_page_t
*
page
=
zathura
->
document
->
pages
[
(
page_id
+
zathura
->
document
->
current_page_number
)
%
zathura
->
document
->
number_of_pages
];
if
(
page
==
NULL
)
{
continue
;
}
...
...
@@ -301,6 +302,12 @@ cmd_search(girara_session_t* session, const char* input, girara_argument_t* argu
}
g_object_set
(
page
->
drawing_area
,
"search-results"
,
result
,
NULL
);
if
(
firsthit
==
true
)
{
if
(
page_id
!=
0
)
{
page_set_delayed
(
zathura
,
page
->
number
);
}
firsthit
=
false
;
}
}
return
true
;
...
...
Write
Preview
Supports
Markdown
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