Commit Graph

1685 Commits

Author SHA1 Message Date
malc a51c29b315 Replace %p with a page number when invoking path launcher
for details see:
 https://github.com/moosotc/llpp/issues/45#issuecomment-1028683741
2022-02-05 16:56:26 +03:00
malc 13a46476e4 Remove bogus(?) assert
01ff5cb4ce commented out redisplay and
added assert, without specifying why, will err on the side of "it was
a debugging leftover" (after all the commit in question was a WIP) and
return things to the way they were (i.e. post redisplay instead of
dying)

Currently the assert can be triggered while navigating ML2015-talk.pdf
in presentation mode.
2022-01-28 23:20:52 +03:00
malc 59c9db704b Cosmetics 2022-01-09 01:46:29 +03:00
malc 2164157308 Behave sanely when $HOME/.config does not exist
cf. https://github.com/moosotc/llpp/issues/180
2022-01-09 01:31:18 +03:00
malc 01ff5cb4ce wip#1
rename layoutready to alltilesrendered
as this is what the funciton returns
2021-12-08 02:09:49 +03:00
malc 55e2f04867 Rename garbage collection function more aptly describing its argument 2021-12-06 20:20:27 +03:00
malc 586cb86554 Magic
There is rational explanation for gotohist changes in my mind, there
isn't one for the layout in gc.
2021-12-06 17:48:17 +03:00
malc b97d64eba1 Redisplay when visible tile is rendered 2021-12-06 00:44:33 +03:00
malc 2903c841af Do not start preloading unless current layout has been rendered
Addresses problems that so far has only been seen in split columns mode.
2021-12-05 22:15:18 +03:00
malc ae2e5a9419 Paper over preloading issue
This bug has me running for cover, without a clue why the code enters
vicious render/throw-away cycle. For the time being this band-aid will
do.
2021-11-26 16:44:18 +03:00
malc cef1744fda Consistency and correct(erer)ness 2021-11-26 15:59:03 +03:00
malc 15a48bfc9d Stay within 80 columns 2021-11-21 15:41:17 +03:00
malc f4933f4538 Do not use spaces in argument names 2021-11-21 15:40:06 +03:00
malc 1354eb8cc0 Fix F9 binding
Guard binds to the pattern in a surprising (to me) way.
2021-10-19 04:17:49 +03:00
malc 4f38a4cec8 Allow selecting text in split columns mode
There likely to be ton of pitfalls, but it does work. Furthermore the
book i'm currently reading has two columns and so i split them due to
<reasons> furthermore at times i cut interesting portions. This lovely
commit makes things that much easier for me.

https://www.youtube.com/watch?v=8z8SpgmF0sA (It's good to be The King)
2021-10-14 18:51:07 +03:00
malc 7042a6c497 Clearer wording 2021-10-14 18:44:41 +03:00
malc bfa56eda75 Consistency 2021-10-06 03:09:21 +03:00
malc f15da866d5 Add the ability to specify mime type
Otherwise mupdf will guess document type based on the file extension,
falling back to PDF.
2021-09-15 14:14:34 +03:00
malc e865c15976 Cosmetics 2021-09-10 12:48:44 +03:00
malc 17d4bbf7b9 Draw vertical separators for all pages in the layout
... when using page scaling factor.
2021-09-10 12:02:48 +03:00
malc 0623887ca5 Improve stderr redirection again 2021-07-12 20:41:36 +03:00
malc 6d307c0d6f Cosmetics 2021-07-08 09:38:14 +03:00
malc 7ba3a745e9 Add a visual clue for a page scaled scrolling
Guess adding it is as good as any method of finding out whether
somebody else uses scalled page scrolling.
2021-06-27 19:17:43 +03:00
malc d8adb22669 Cosmetics 2021-06-27 17:55:52 +03:00
malc 9fa0eadbd3 Rename clamp to add_to_y_and_clamp 2021-06-27 17:54:39 +03:00
malc ee48dd014f Move launchers under external commands 2021-06-22 15:30:07 +03:00
malc c5dfc96481 Consistency 2021-06-15 10:21:57 +03:00
Dmitri Iouchtchenko bd45579ee3 Scroll horizontally with shift 2021-06-15 10:21:30 +03:00
malc 9870819742 Add bounds checking 2021-06-11 10:39:16 +03:00
malc d9acdc0081 Save attached files when
C code was mostly copy pasted from
$MUPDF/platform/gl/gl-annotate.c:save_attachment_dialog

This piggybacks on existing savepath-command.

Testing was done when savepath-command was set to "echo '%s'" and a
document from https://github.com/moosotc/llpp/issues/170 [1]. The
annotation rectangles an the fifth page overlap making it impossible
to use mouse to click on the icon with a pin (file attachment
annotation), however one can enter keyboard navigation mode (set to
insert by default) and select last/covered annotation rectangle with
the keyboard) (selecting this annotation via hint mode (bound to 'F'
by default) works too)

[1] https://github.com/moosotc/llpp/files/6566150/CorrectionLEMAIRE_SAKURA.AMELIE_CPFR_DEV02.pdf
2021-05-31 14:54:34 +03:00
malc 16bb666167 Better text/file-attachment annotation differentiation 2021-05-31 07:39:10 +03:00
malc c572e1c8b0 Decrease indentation of reflowable layout knobs 2021-05-30 14:20:31 +03:00
malc c133be8e75 Hack around intermittent postprocess failures
How it was found:

An attempt was made to search for 'a' in an infinitely tall document
(HTML font test page produced by llppac with
  Extended parameters » reflowable Layout » height
 set to zero)

Searching took surprisingly long time. At some point ml_postprocess
was trying to acquire the lock, failed, schedulled a redisplay, which
failed because concurently running earch was holding it), tho "fix" is
to not even attempt postprocessing.

Maybe someday enough courage will be found to tackle the problem
"properly".
2021-05-30 14:18:55 +03:00
malc b9a267b768 Use Glutils explicitly in main 2021-05-30 12:28:53 +03:00
malc a87934313a Use local exception instead of globally usable Exit 2021-05-25 03:46:29 +03:00
malc 57bdd79506 Simplify layoutready
Layout is ready when all the tiles comprising it are rendered.
2021-05-25 00:38:02 +03:00
malc 182385f367 Cosmetics 2021-05-24 23:52:47 +03:00
malc 2ea7feb6da Change reflowable layout handling
Move control over reflowable layout parameters out of the command line
into the info screen. This also moved the parameters from state into
config, thus making them persistent.
2021-05-23 11:36:04 +03:00
malc c372f0334a Remove remnants of home row remapping attempt 2021-05-23 10:52:56 +03:00
malc 8ee3cd48b2 Cosmetics 2021-05-22 21:48:14 +03:00
malc 626db2a83a Allow setting all fz_layout_document arguments on the command line
Use case:
 a epub with a text that is laid out too wide (for me)

 [grantted - it is s possible to just go and edit the .css inside the
  .epub but this is, arguably, a better approach

  besides layout-height Arg docstring was, probably, incorrect]
2021-05-22 20:40:13 +03:00
malc 21b4d90644 Remove opaque<->string operators 2021-05-02 10:51:13 +03:00
malc c44fdbc40f Reset rects1 when search is invoked 2021-03-28 00:43:20 +03:00
malc e1773ba97c Change getlinkn
Negative and zero indicate the fact that link wasn't found, otherwise
one plus link index is returned. Price one has to pay for not wanting
to deal with exceptions or sum type returns.

This fixes the behavior in cases where a link is on the page following
the one without links at all.
2021-03-27 14:59:41 +03:00
malc 8d87c6e535 Remove home row remapping code/hack
<map in='n' out='down'/>
<map in='t' out='up'/>

or j/k in ASCII.
2021-02-18 17:52:45 +03:00
malc c2cffdcf8e Only remap keycodes in View mode 2021-01-17 05:36:33 +03:00
malc 7a6f4a6453 Kill stray ’s’ 2021-01-16 16:15:59 +03:00
malc d7adab5f4e Another key shuffle
So that hist/help modes are accessible when home row is remapped.
2021-01-16 16:14:33 +03:00
malc 76b80053b2 Remove remapping help/hist hack
Some keyboards (like the one that is used to write this commit
message) do not have arrow keys, thus remappping code/hack was
introduced that maps home row key_codes_ to arrows. h (help/history)
is on the home row (Dvorak) and so the hack on the hack was added to
recognize those as just letters when certain masks are used. But
alt-left/right was reserved for navigational history traversal. So
remove the second hack layer and deal with the fact that history is
not accessible in a remapped case. The whole situation is less than
ideal.
2021-01-16 04:06:13 +03:00
malc c35b1afb0f Group command options together 2021-01-15 14:44:11 +03:00