Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement flags for synchronizing the image list when changing the working directory #792

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Commits on Mar 18, 2024

  1. Implement :scroll left/right --open-selected

    In the library, this option will autoload the images in the newly opened
    directory.
    
    Related to #694 and #132.
    karlch committed Mar 18, 2024
    Configuration menu
    Copy the full SHA
    a652fb0 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0b8b9f4 View commit details
    Browse the repository at this point in the history

Commits on Mar 19, 2024

  1. Refactor :scroll left/right --open-selected

    Instead of having the working directory handler directly load the
    directory, we now defer this to the LibraryModel. This way, the model
    can decide if the path selected in the new directory is an image. If
    yes, load it - with this image focused.
    
    Thus, we don't end up jumping positions like previously, when we enter a
    directory that:
    * Has images
    * Has an image in the stored position
    Where:
    1) We would load the directory into the library => paths visible in
       library
    2) We would load the stored position => new path selected
    3) We would load all images into the image filelist
    4) We would open the first image
    5) The library would select the first image => jump to new path which is
       not desirable
    karlch committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    46dd68b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7422de3 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5aa7e95 View commit details
    Browse the repository at this point in the history
  4. Extend behaviour of :scroll left/right --autoload

    1) The stored path is an image => load images and select this one
    2) There are images in the directory => load images and select the first
       image, overriding any stored directory
    3) There are no images in the new directory => clear images
    
    This comes very close to the preferred behaviour in #132, except for the
    async part which we are omitting, in favour of the *optional*
    --open-selected flag.
    karlch committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    dff7cdc View commit details
    Browse the repository at this point in the history
  5. Add --open-images flag to :open command

    This emulates the behaviour of :scroll left/right --open-selected by
    directly setting autoload in the library.
    karlch committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    8e7d35c View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    98d403e View commit details
    Browse the repository at this point in the history
  7. Add test for clearing images after :scroll left

    The image filelist should be empty when running
    :scroll left --open-selected and entering a directory without any
    images.
    karlch committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    65d8266 View commit details
    Browse the repository at this point in the history
  8. Update imutils.filelist clear behaviour

    React to the emitted signal, instead of exclusively emitting it.
    karlch committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    c89ffce View commit details
    Browse the repository at this point in the history