Skip to content

Cannot remove last bookmark when multiple items exist and separate_save_and_remove is true #107

@blast-yuki

Description

@blast-yuki

Steps to reproduce:

  1. Run the following code as nvim --clean -u minimal.lua:

    minimal.lua
    vim.env.LAZY_STDPATH = '.repro'
    load(vim.fn.system('curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua'))()
    
    vim.g.mapleader = vim.keycode('<Space>')
    vim.g.maplocalleader = vim.keycode('<Bslash>')
    
    local plugins = {
      {
        'otavioschwanck/arrow.nvim',
        dependencies = { 'nvim-tree/nvim-web-devicons' },
        opts = {
          leader_key = '<localleader>',
          separate_save_and_remove = true,
          show_icons = true,
          mappings = {
            edit = 'e',
            delete_mode = 'd',
            clear_all_items = 'C',
            toggle = 'a', -- used as save if separate_save_and_remove is true
            open_vertical = 'v',
            open_horizontal = 's',
            quit = 'q',
            remove = 'x', -- only used if separate_save_and_remove is true
            next_item = ']',
            prev_item = '[',
          },
          window = { border = 'rounded' },
        },
      },
    }
    
    require('lazy.minit').repro({ spec = plugins })
  2. Add two or more items to the list using a.

  3. Try to remove all bookmarks using x.

Expected Behavior:

The last bookmark should be removable, regardless of how many items are in the list. Currently, it only works correctly when there is a single item.

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