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
d2a1a2d6
Commit
d2a1a2d6
authored
Oct 21, 2014
by
Sebastian Ramacher
Browse files
Adjust for different indices in SyncTex
Signed-off-by:
Sebastian Ramacher
<
sebastian+dev@ramacher.at
>
parent
71d9f6a5
Changes
2
Hide whitespace changes
Inline
Side-by-side
main.c
View file @
d2a1a2d6
...
...
@@ -118,8 +118,16 @@ main(int argc, char* argv[])
return
-
1
;
}
const
int
line
=
MIN
(
INT_MAX
,
g_ascii_strtoll
(
split_fwd
[
0
],
NULL
,
10
));
const
int
column
=
MIN
(
INT_MAX
,
g_ascii_strtoll
(
split_fwd
[
1
],
NULL
,
10
));
int
line
=
MIN
(
INT_MAX
,
g_ascii_strtoll
(
split_fwd
[
0
],
NULL
,
10
));
int
column
=
MIN
(
INT_MAX
,
g_ascii_strtoll
(
split_fwd
[
1
],
NULL
,
10
));
/* SyncTeX starts indexing at 1, but we use 0 */
if
(
line
>
0
)
{
--
line
;
}
if
(
column
>
0
)
{
--
column
;
}
const
bool
ret
=
zathura_dbus_synctex_position
(
real_path
,
split_fwd
[
2
],
line
,
column
,
synctex_pid
);
g_strfreev
(
split_fwd
);
...
...
synctex.c
View file @
d2a1a2d6
...
...
@@ -122,6 +122,10 @@ synctex_rectangles_from_position(const char* filename, const char* input_file,
return
NULL
;
}
/* We use indexes starting at 0 but SyncTeX uses 1 */
++
line
;
++
column
;
synctex_scanner_t
scanner
=
synctex_scanner_new_with_output_file
(
filename
,
NULL
,
1
);
if
(
scanner
==
NULL
)
{
girara_debug
(
"Failed to create synctex scanner."
);
...
...
@@ -187,3 +191,4 @@ synctex_rectangles_from_position(const char* filename, const char* input_file,
return
hitlist
;
}
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