Added config parameter "link-hadjust" with default value true. When set to false,
following internal links do not change the horizontal position of the page, only
the vertical position.
Also updates page number when following links, now.
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
The last_view member in zathura_page_widget_private_s is gint64, so we should
do the same here.
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This patch implements a page cache that is invalidated in a LRU fashion.
Pages are added to the cache as soon as they become visible. When the cache is
full and a new page that isn't in the cache becomes visible, the least recently
viewed page in the cache is evicted from memory and the new one takes it's
place.
The cache size is configurable using the page-cache-size configuration
variable, with a default value of 15 pages. Very large values for the cache
size are not recommended, though, as it will stress the system memory out.
The old periodic page reclaiming code is no longer necessary with this patch,
so I removed it.
Special thanks to Ignas Anikevičius, and Sebastian Ramacher for the
inspirations.
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
Instead of guesstimating the values of the scrollbars adjustments after
a change in zoom level, connect callbacks to the "changed" GtkAdjustment
event (which is emitted when the bounds or page_size of the adjustment
change, e.g. when the zoom level changes), and compute the new values
from there.
The previous adjustment values are tracked in zathura->ui.hadjustment
and zathura->ui.vadjustment (and updated by signal handlers as well), so
that the view's position can be maintained while zooming.
cb_view_hadjustment_changed() centers the page horizontally if a
"best-fit" or "width" zoom is being performed, or if "zoom-center" is
true; otherwise, it keeps the view horizontally centered around the same
area of the page.
cb_view_vadjustment_changed() always keeps the view vertically centered
around the same area of the page.
Many thanks to Marwan Tanager for thoroughly reviewing the various
stages of this patch, and actually coming up with a working solution.
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
If '--page [number]' (or '-P [number]') is given on the command-line,
the document is opened at the specified page number. Negative numbers
are allowed, and denote a page number starting from the end of the
document.
See issue 275 <http://bugs.pwmt.org/issue275>.
Reported-by: bob <sean258@gmail.com>
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>
Both in the documentation and in function names, "synctex" was sometimes
spelled "syntex" or "syntec".
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
zathura records jumps through searches, index, links, etc. and enables to go
back and forth via ^o ^i.
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
It is now possible to open multiple files by passing them as additional
arguments. The password can now be set with the -w/--password parameter
instead of the argument after the filename.