Skip to content

Map keys incorrectly inserted into filter when provider started from :Clap #1118

@Coacher

Description

@Coacher
  • OS: Fedora 41
  • vim-clap version: f2393e8
  • Have you reproduced with a minimal vimrc: yes
  • Have you updated to the latest plugin version: yes
  • Have you upgraded to/compiled the latest Rust binary: yes

Describe the bug
<Down> inserts gj into filter instead of moving selection down in any provider, when entered through :Clap with the supplied vimrc.

Clap debug


                  Vim: VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Mar 21 2025 00:00:00) Included patches: 1-1227
            has ctags: Universal Ctags 6.0.0 (+json)
            has cargo: 1
            has maple: /home/coacher/.vim/plugins/vim-clap/target/release/maple
           maple info: version 0.1.51, compiled at: 2025-01-27 02:11:24.353911155 +03:00, built for x86_64-unknown-linux-gnu by rustc 1.83.0 (90b35a623 2024-11-26).

        rustc version: rustc 1.84.0 (9fc6b4312 2025-01-07)

     Current FileType: vim
Third Party Providers: []
       Global Options:
    let g:clap#autoload_dir = '/home/coacher/.vim/plugins/vim-clap/autoload'
    let g:clap#provider_alias = {'gfiles': 'git_files', 'hist:': 'command_history', 'hist/': 'search_history'}
    let g:clap_actions = ['listPlugins', 'openConfig', 'git.blame', 'git.diffSummary', 'git.hunkModifications', 'git.openPermalinkInBrowser', 'git.permalink', 'git.toggle', 'syntax.sublimeSyntaxHighlight', 'syntax.sublimeSyntaxListThemes', 'syntax.toggle', 'syntax.treeSitterHighlight', 'syntax.treeSitterHighlightDisable', 'syntax.treeSitterListScopes', 'syntax.treeSitterPropsUnderCursor']
    let g:clap_background_shadow_blend = 50
    let g:clap_disable_bottom_top = 0
    let g:clap_disable_matches_indicator = v:false
    let g:clap_disable_run_rooter = v:false
    let g:clap_enable_background_shadow = v:false
    let g:clap_enable_debug = v:false
    let g:clap_enable_icon = 0
    let g:clap_forerunner_status_sign = {'done': '•', 'running': '!', 'using_cache': '*'}
    let g:clap_insert_mode_only = v:false
    let g:clap_multi_selection_warning_silent = 0
    let g:clap_no_matches_msg = 'NO MATCHES FOUND'
    let g:clap_open_action = {'ctrl-v': 'vsplit', 'ctrl-x': 'split', 'ctrl-t': 'tab split'}
    let g:clap_open_preview = 'always'
    let g:clap_popup_border = 'rounded'
    let g:clap_preview = {'scrollbar': {'fill_char': '▌'}}
    let g:clap_preview_direction = 'AUTO'
    let g:clap_preview_size = 5
    let g:clap_providers_relaunch_code = '@@'
    let g:clap_search_box_border_style = 'nil'
    let g:clap_search_box_border_symbols = {'nil': ['', ''], 'curve': ['', ''], 'arrow': ['', '']}
  Provider Variables:
                     []

To Reproduce
Steps to reproduce the behavior:

  1. Create the minimal vimrc min.vim:
set nocompatible

call plug#begin('~/.vim/plugins/')
Plug 'liuchengxu/vim-clap', {'do': ':call clap#installer#build_all()'}
call plug#end()

" Make j/k/<Up>/<Down> move through screen lines
noremap j gj
noremap k gk
map <Down> j
map <Up>   k
  1. Start (neo)vim with command: vim -u min.vim min.vim
  2. :Clap<CR>
  3. Use <Down> to select blines provider, press <CR>
  4. Press <Down>
  5. See gj inserted into filter

Expected behavior
Selection is moved one line down.

Additional context
Same problem with all providers. Doesn't happen when provider is started directly, e.g. :Clap blines

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingvim

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions