summaryrefslogtreecommitdiff
path: root/office/zathura/synctex_fix.diff
blob: 904bd663fea599893243e36315de347050bddf5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
diff -Naur zathura-0.3.8/zathura/synctex.c zathura-0.3.8.patched/zathura/synctex.c
--- zathura-0.3.8/zathura/synctex.c	2017-12-20 08:40:45.000000000 -0500
+++ zathura-0.3.8.patched/zathura/synctex.c	2018-09-09 13:56:54.489287021 -0400
@@ -24,13 +24,13 @@
     return false;
   }
 
-  synctex_scanner_t scanner = synctex_scanner_new_with_output_file(filename, NULL, 1);
+  synctex_scanner_p scanner = synctex_scanner_new_with_output_file(filename, NULL, 1);
   if (scanner == NULL) {
     girara_debug("Failed to create synctex scanner.");
     return false;
   }
 
-  synctex_scanner_t temp = synctex_scanner_parse(scanner);
+  synctex_scanner_p temp = synctex_scanner_parse(scanner);
   if (temp == NULL) {
     girara_debug("Failed to parse synctex file.");
     synctex_scanner_free(scanner);
@@ -41,7 +41,7 @@
 
   if (synctex_edit_query(scanner, page + 1u, x, y) > 0) {
     /* Assume that a backward search returns at most one result. */
-    synctex_node_t node = synctex_next_result(scanner);
+    synctex_node_p node = synctex_scanner_next_result(scanner);
     if (node != NULL) {
       if (input_file != NULL) {
         *input_file = g_strdup(synctex_scanner_get_name(scanner, synctex_node_tag(node)));
@@ -127,13 +127,13 @@
   ++line;
   ++column;
 
-  synctex_scanner_t scanner = synctex_scanner_new_with_output_file(filename, NULL, 1);
+  synctex_scanner_p scanner = synctex_scanner_new_with_output_file(filename, NULL, 1);
   if (scanner == NULL) {
     girara_debug("Failed to create synctex scanner.");
     return NULL;
   }
 
-  synctex_scanner_t temp = synctex_scanner_parse(scanner);
+  synctex_scanner_p temp = synctex_scanner_parse(scanner);
   if (temp == NULL) {
     girara_debug("Failed to parse synctex file.");
     synctex_scanner_free(scanner);
@@ -143,11 +143,11 @@
   girara_list_t* hitlist     = girara_list_new2(g_free);
   girara_list_t* other_rects = girara_list_new2(g_free);
 
-  if (synctex_display_query(scanner, input_file, line, column) > 0) {
-    synctex_node_t node        = NULL;
+  if (synctex_display_query(scanner, input_file, line, column, -1) > 0) {
+    synctex_node_p node        = NULL;
     bool got_page              = false;
 
-    while ((node = synctex_next_result (scanner)) != NULL) {
+    while ((node = synctex_scanner_next_result (scanner)) != NULL) {
       const unsigned int current_page = synctex_node_page(node) - 1;
       if (got_page == false) {
         got_page = true;