Skip to content

Selecting the second buffer after filtering in ivy-switch-buffer leads to unintuitive buffer switching #513

Closed
@dsedivec

Description

@dsedivec

Steps to reproduce, using ivy-switch-buffer to switch buffers:

  1. Open two buffers with a common prefix. In my case, todo.org and todo.org_archive.
  2. Switch to todo.org.
  3. Switch to some third buffer, like *Messages*.
  4. Switch to some fourth buffer, like *scratch*.
  5. Invoke ivy-switch-buffer.
  6. Start typing your common prefix from step 1, e.g. todo.

Expected behavior: todo.org is first in Ivy's candidates list and is selected, since that was the most recent buffer with that string.

Observed behavior: todo.org is first in Ivy's candidates, but todo.org_archive is the second and is the selected option, presumably because ivy-switch-buffer starts with the "other" buffer selected by default, which (AFAIK) is always the second option.

Is there any way to get ivy-switch-buffer to select the most recent non-current buffer after filtering? I believe this behavior changed as of 79ffa67 (#484). Thanks!

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