Do not call HighlightRects if there was no usable output from synctex view

Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
Sebastian Ramacher 2014-04-07 16:36:48 +02:00
parent 950a52b612
commit 06205940bb
2 changed files with 9 additions and 1 deletions

2
main.c
View File

@ -110,7 +110,7 @@ main(int argc, char* argv[])
free(real_path);
return 0;
} else {
girara_error("Could not find open instance for '%s'", real_path);
girara_error("Could not find open instance for '%s' or got no usable output from 'synctex view'.", real_path);
free(real_path);
return -1;
}

View File

@ -1,6 +1,7 @@
/* See LICENSE file for license and copyright information */
#include <glib.h>
#include <girara/utils.h>
#include "synctex.h"
#include "zathura.h"
@ -259,6 +260,13 @@ synctex_rectangles_from_position(const char* filename, const char* position,
g_scanner_destroy(scanner);
close(output);
if (ret == false) {
girara_debug("Got no usable output from running synctex view.");
girara_list_free(hitlist);
girara_list_free(other_rects);
return NULL;
}
if (page != NULL) {
*page = rpage;
}