abdo.r...@gmail.com writes:

> Hi,
>
>> Thanks for the patches. Unfortunately, they do not apply (starting with
>> patch 2).
>
> Oops, sorry about that. I missed the first commit in the series. I attach the
> missing piece, which now should apply on top of current develop branch.

And now I attach a non-empty patch. Again, sorry.

Abdó.

>From e0528d45d7108730ec9df0b6ce2d7b58b5a32b7a Mon Sep 17 00:00:00 2001
From: Abdo Roig-Maranges <abdo.r...@gmail.com>
Date: Fri, 17 Jan 2014 17:53:28 +0100
Subject: [PATCH] honor search-hadjust setting in synctex forward search

---
 dbus-interface.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/dbus-interface.c b/dbus-interface.c
index ce9ea64..356def7 100644
--- a/dbus-interface.c
+++ b/dbus-interface.c
@@ -9,6 +9,7 @@
 #include "utils.h"
 #include "adjustment.h"
 
+#include <girara/session.h>
 #include <girara/utils.h>
 #include <gio/gio.h>
 #include <sys/types.h>
@@ -173,6 +174,9 @@ highlight_rects(zathura_t* zathura, unsigned int page,
     return;
   }
 
+  bool search_hadjust = true;
+  girara_setting_get(zathura->ui.session, "search-hadjust", &search_hadjust);
+
   /* compute the position of the center of the page */
   double pos_x = 0;
   double pos_y = 0;
@@ -199,7 +203,9 @@ highlight_rects(zathura_t* zathura, unsigned int page,
   double center_y = (rectangle.y1 + rectangle.y2) / 2;
 
   pos_y += (center_y - (double)cell_height/2) / (double)doc_height;
-  pos_x += (center_x - (double)cell_width/2) / (double)doc_width;
+  if (search_hadjust == true) {
+    pos_x += (center_x - (double)cell_width/2) / (double)doc_width;
+  }
 
   /* move to position */
   zathura_jumplist_add(zathura);
-- 
1.8.5.3

_______________________________________________
zathura mailing list
zathura@lists.pwmt.org
http://lists.pwmt.org/mailman/listinfo/zathura

Reply via email to