vimiv-qt icon indicating copy to clipboard operation
vimiv-qt copied to clipboard

First image in directory not shown

Open mcp292 opened this issue 2 years ago • 10 comments

I see this request was implemented with the --open-selected option: https://github.com/karlch/vimiv/issues/81.

I am filing a bug because in the library, when I enter a directory with ENT, the first image is not shown. I have to n p back to it for the image shown to change; even though the first image is selected.

mcp292 avatar Aug 17 '23 18:08 mcp292

Also, binding next and prev to <down> and <up> respectively under [IMAGE], does not update images, but n and p do.

mcp292 avatar Aug 17 '23 19:08 mcp292

Thanks for the feedback! :blush:

You mean, when you enter a new directory, then, the image list does not update automatically? If yes, then this is essentially #132, right? This is still open, as I am sure having this optionally is useful, but the implementation is quite tricky as opening all images in a directory, all the time, is quite the performance hit. As a little convenience, note that you should be able to only view the image with l, instead of n and p. This is how I personally go about this, use l to enter a directory, and in case it is an image I may want to view, just hit it immediately again.

Concerning the second part, weird, this works just fine for me:

[IMAGE]
<down>: next
<up>: prev

mind sharing your keys.conf? This is for 0.9.0 or the git?

karlch avatar Aug 17 '23 19:08 karlch

Yes your are right. It is #132. The l trick is cool. If going all the way left closes the library menu, then shouldn't h bring it back?

I will get back to you on the .conf.

mcp292 avatar Aug 17 '23 19:08 mcp292

Using version 0.9.0.

[GLOBAL]
<colon> : command
o : command --text='open '
yy : copy-name
ya : copy-name --abspath
yA : copy-name --abspath --primary
yY : copy-name --primary
r : delete --ask %%
R : delete %%
gi : enter image
gl : enter library
gm : enter manipulate
gt : enter thumbnail
f : fullscreen
G : goto -1
gg : goto 1
m : mark %%
x : quit
. : repeat-command
j : scroll down
h : scroll left
<left> : scroll left
l : scroll right
<right> : scroll right
k : scroll up
/ : search
? : search --reverse
N : search-next
P : search-prev
b : set statusbar.show!
tl : toggle library
tm : toggle manipulate
tt : toggle thumbnail

[IMAGE]
M : center
| : flip
_ : flip --vertical
<end> : goto -1
<home> : goto 1
<page-down> : next
n : next
<down> : next
<ctrl>n : next --keep-zoom
<space> : play-or-pause
<page-up> : prev
p : prev
<up> : prev
<ctrl>p : prev --keep-zoom
> : rotate
< : rotate --counter-clockwise
W : scale --level=1
<equal> : scale --level=fit
w : scale --level=fit
E : scale --level=fit-height
e : scale --level=fit-width
J : scroll-edge down
H : scroll-edge left
L : scroll-edge right
K : scroll-edge up
sl : set slideshow.delay +0.5
sh : set slideshow.delay -0.5
ss : slideshow
+ : zoom in
- : zoom out

[LIBRARY]
go : goto 1 --open-selected
n : scroll down --open-selected
p : scroll up --open-selected
L : set library.width +0.05
H : set library.width -0.05

[THUMBNAIL]
+ : zoom in
- : zoom out

[COMMAND]
<tab> : complete
<shift><tab> : complete --inverse
<ctrl>p : history next
<ctrl>n : history prev
<up> : history-substr-search next
<down> : history-substr-search prev
<escape> : leave-commandline

[MANIPULATE]
<colon> : command
f : fullscreen
b : set statusbar.show!

The arrow keys will change the selection, but the image list only gets updated with n or p.

mcp292 avatar Aug 17 '23 19:08 mcp292

Oh wow, I'm just seeing the library bindings. That should be what i need:

<down> : scroll down --open-selected

mcp292 avatar Aug 17 '23 19:08 mcp292

Ah, in this case I misunderstood you, the issue was <up> / <down> not updating the image, when in library mode? Yes, in this case binding those as described under [LIBRARY] should do the trick :blush:

I can see why binding h in the way you described could be intuitive, but personally think having hjkl scroll the image is probably more important to stick with the vim-like flow ...

karlch avatar Aug 17 '23 19:08 karlch

Okay, adding the following to my [LIBRARY] works.

[LIBRARY]
...
<down> : scroll down --open-selected
<up> : scroll up --open-selected
<left> : scroll left --open-selected
<right> : scroll right --open-selected

Would adding --open-selected support for the last two bindings be a good workaround to #132? Instead of making it the default, the user can manually incur the expense.

I can see why binding h in the way you described could be intuitive, but personally think having hjkl scroll the image is probably more important to stick with the vim-like flow ...

This is a good point. From the library, two lefts brings you to the picture, but once on the picture, hjkl should move around that picture. Needing to do two lefts is a happy medium for me. It prevents me accidentally going into it and leaving the library and allows for the ll you mentioned to update the image.

mcp292 avatar Aug 17 '23 19:08 mcp292

That is an interesting point, instead of having a setting (or maybe at some point in addition to the setting), one could have a flag that forces loading. Would probably call it something along --load-directory or so, but this could definitely be a nice mid-ground! I'll copy over this point to #132.

EDIT: this is of course all in the :scroll command, having a different name is stupid then, shame on me :laughing:

karlch avatar Aug 17 '23 19:08 karlch

In case you are feeling feisty, you could give the extend-open-selected branch a quick go. In my keys.conf I added the bindings:

[IMAGE]
<ctrl>h: enter library

[LIBRARY]
<ctrl>h: scroll left --open-selected
<ctrl>l: scroll right --open-selected
<ctrl>j: scroll down --open-selected
<ctrl>k: scroll up --open-selected

to have a consistend "opening and jumping back" when holding <ctrl>. Seems to work quite well :blush:

Only issue I have, is that :scroll left --open-selected will jump to the image in the library once opened. Not sure if this is a bug or a feature :laughing:

karlch avatar Aug 17 '23 20:08 karlch

Glad you think so! I look forward to trying it out!

Only issue I have, is that :scroll left --open-selected will jump to the image in the library once opened. Not sure if this is a bug or a feature 😆

I have to play to be sure, but to me that sounds like what I'm after!

mcp292 avatar Aug 18 '23 21:08 mcp292