Skip to content

Improve findfilemode to be more flexible #6

@mogenslund

Description

@mogenslund

The dk.salza.liq.modes.findfilemode should be more flexible in the following senses:

Callback

The mode should be able to take a callback function, which will operate on the found file or folder, so it can be used in a variety of situations, including:

  1. To open a file in the editor
  2. To insert the path as text
  3. To evaluate the file

Selection

If there are any choices in the typeahead the first one should be selected as default (At the moment of writing this, none is selected until "next-res" command executed C-k.)

Choosing file

The rules below for choosing a file should be implemented.

There are 4 cases:

  1. Choosing a new file
  2. Choosing existing file
  3. Choosing existing folder
  4. Navigate to folder

On enter press

  1. If a file is choosen in the typehead, the path to that should be the result.
  2. If a folder is choosen in the typeahead the path to that should be the result.
  3. If there are no typeahead results asume the search is a new file. Use that as result.

On M-enter (3611)

The typed search content is the result (To create a new file although there is non empty typeahead results.)

On C-k

If a folder is choosen, use C-k to navigate to that folder

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions