Skip to content

Allow ˆ modifier work on line content in buf_lines picker #1921

@orporick

Description

@orporick

Contributing guidelines

Module(s)

mini.pick

Neovim version

0.11.x

Description

Hello, I have a small issue with the Pick module, and I'm not sure if I'm doing something wrong. Basically, I want to use Pick buf_lines scope="current" to search for specific lines in the current buffer. Specifically, I want to find all lines that start with 'j' followed by a space. Trying with "^j " doesn't work because the line is interpreted as starting with the line number, so the ^ modifier seems less useful in this case. Am I doing something wrong? Is there a way to remove line numbers from the picker's selection window? I know I can use a search or vimgrep to get the same result, but using buf_lines mode is simpler and faster. Thank you very much for your help.

Reproduction

  1. Create separate 'nvim-repro' config directory:

    • '~/.config/nvim-repro/' on Unix
    • '~/AppData/Local/nvim-repro/' on Windows
  2. Inside 'nvim-repro' directory create a file named 'init.lua'.
    Populate it with the following content:

    -- Clone latest 'mini.nvim' (requires Git CLI installed)
    vim.cmd('echo "Installing `mini.nvim`" | redraw')
    local mini_path = vim.fn.stdpath('data') .. '/site/pack/deps/start/mini.nvim'
    local clone_cmd = { 'git', 'clone', '--depth=1', 'https://github.com/echasnovski/mini.nvim', mini_path }
    vim.fn.system(clone_cmd)
    vim.cmd('echo "`mini.nvim` is installed" | redraw')
    
    -- Make sure 'mini.nvim' is available
    vim.cmd('packadd mini.nvim')
    require('mini.deps').setup()
    
    -- Add extra setup steps needed to reproduce the behavior
    -- Use `MiniDeps.add('user/repo')` to install another plugin from GitHub
  3. Run NVIM_APPNAME=nvim-repro nvim (i.e. execute nvim with NVIM_APPNAME environment variable set to "nvim-repro").
    Wait for all dependencies to install.

  4. Replace this with description of interactive reproduction steps along with the behavior you observe.
    Feel free to include images/videos/etc, this helps a lot.

What to do after reporting an issue

After reporting the issue, it is safe (and even recommended for cleaner possible future bug reports) to remove 'nvim-repro' config from the system:

  • Delete config directory ('~/.config/nvim-repro' on Unix).
  • Delete data directory ('~/.local/share/nvim-repro' on Unix).
  • Delete state directory ('~/.local/state/nvim-repro' on Unix).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions