Currently, if :write is given a directory name as its argument, it fails with the "Failed to save document." error. This can sometimes be quite annoying: for instance, when viewing documents that have been downloaded to /tmp from the web, I often find myself wanting to hang on to file without changing its file name. In order to do so, I either have to leave Zathura and cp the file or else retype the whole filename after :write, neither of which are too convenient.
The following patch would make :write work sort of how mv does: if its argument is a currently existing directory, it will be inferred that the user wants to save the document in that directory using its current basename.
Signed-off-by: Sebastian Ramacher <sebastian@ramacher.at>
A rectangle whose horizontal coordinates are x1 on the left and x2 on
the right is (x2 + 1) - x1 pixels wide, not x2 - x1.
This error caused the search result highlighting to leave a
one-pixel-wide border behind, on the right and bottom side of the
result.
See issue 242 <http://bugs.pwmt.org/issue242>.
Reported-by: Abdó Roig <abdo.roig@gmail.com>
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
The width of the vertical scrollbar (if there is one) needs to be
substracted from the width of the GtkScrolledWindow in order to obtain
the correct dimensions of the view area.
See issue 27 <http://bugs.pwmt.org/issue27>.
It also deals better with documents where pages don't all have the same
size.
Reported-by: Andreas Weinlich <business@weinlich.org>
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
zathura_get_document_size computes the size of the document to be
displayed (in pixels), given the size of the individual cells. It takes
padding between the cells into account.
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
A document is laid out on a homogeneous gtk table/grid. This new method,
zathura_document_get_cell_size, computes the size of the cells in that
table/grid, at the current scale.
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
Initializing page_rect makes Valgrind happy; it was complaining before,
even though all the values were properly initialized, but it's more
obvious this way.
Initialize the other two structs in the same way for consitency.
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
"focus_inputbar" and "toggle_page_mode" were defined in code but not
declared as shortcut functions (and thus could not be mapped to
different keys by the user using "map").
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
Also alphabetize the shortcut functions declarations in code, to make it
easier to keep the documentation and code in sync.
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This is useful when the text of the link doesn't match its target. The
default key is set to 'F'.
See issue 266 <http://bugs.pwmt.org/issue266>.
Reported-by: Iron <o380770@rtrtr.com>
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
The scroll-wrap option used to only change the behavior of 'J' and 'K'
(i.e. moving one page forward/backward).
Now, if scroll-wrap is true and the top of the first page is shown,
pressing 'k' will show the bottom of the last page; conversely, when at
the bottom of the last page, pressing 'j' will show the top of the first
page.
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
When set to true, it used to _not_ wrap around the begining/end. Now it
wraps if set to true, and it doesn't if set to false.
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
Both in the documentation and in function names, "synctex" was sometimes
spelled "syntex" or "syntec".
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
No matter what the value of n was, the "n=" shortcut would set the zoom
value to 100%. It is now set to n% instead.
See issue #273 <http://bugs.pwmt.org/issue273>.
Reported-by: Kamil Smardzewski <roderyk197@gmail.com>
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>