liuchengxu / vim-clap

:clap: Modern performant fuzzy picker, tree-sitter highlighting, and more, for both Vim and NeoVim
https://liuchengxu.github.io/vim-clap/
MIT License
2.11k stars 87 forks source link

History list switch to Files list after Backspace, Ctrl-u or Ctrl-w #1033

Closed vds2212 closed 9 months ago

vds2212 commented 9 months ago

Environment (please complete the following information):

Describe the bug

After issuing:

:Clap history

If I hit Backspace I get something similar to what I would get if I would issue:

:Clap files

Remark: for some reason the order of the files is slightly different.

Clap debug

                  Vim: VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Jan  8 2024 16:36:45) MS-Windows 64-bit GUI/console version with OLE support
            has ctags: Universal Ctags 6.0.0(v6.0.0) (+json)
            has cargo: 1
            has maple: C:\Users\vds\vimfiles\plugged\vim-clap/target/release/maple.exe
           maple info: version 0.1.50 (git v0.50), compiled at: 2024-01-02 16:19:35.249980400 +01:00, built for x86_64-pc-windows-msvc by rustc 1.74.0 (79e9716c9 2023-11-13).

        rustc version: rustc 1.75.0 (82e1608df 2023-12-21)

     Current FileType: markdown
Third Party Providers: []
       Global Options:
    let g:clap#autoload_dir = 'C:\Users\vds\vimfiles\plugged\vim-clap\autoload'
    let g:clap#provider_alias = {'gfiles': 'git_files', 'hist:': 'command_history', 'hist/': 'search_history'}
    let g:clap_actions = ['list-plugins', 'open-config', 'git/blame', 'git/diff-summary', 'git/hunk-modifications', 'git/open-permalink-in-browser', 'git/toggle', 'syntax/sublime-syntax-highlight', 'syntax/sublime-syntax-list-themes', 'syntax/toggle', 'syntax/tree-sitter-highlight', 'syntax/tree-sitter-highlight-disable', 'syntax/tree-sitter-list-scopes', 'syntax/tree-sitter-props-at-cursor']
    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 = 1
    let g:clap_forerunner_status_sign = {'done': '•', 'running': '!', 'using_cache': '*'}
    let g:clap_fuzzy_match_hl_groups = [0]
    let g:clap_insert_mode_only = v:false
    let g:clap_layout = {'relative': 'editor'}
    let g:clap_match_color = ['#5E81AC', '12']
    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 = 'never'
    let g:clap_popup_border = 'rounded'
    let g:clap_popup_move_manager = {'^P': '<80>ku', '^N': '<80>kd'}
    let g:clap_preview = {'scrollbar': {'fill_char': '▌'}}
    let g:clap_preview_direction = 'AUTO'
    let g:clap_preview_size = 5
    let g:clap_project_root_markers = ['.gitignore', '.vimspector.json', '.root', '.git', '.git/']
    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
set runtimepath^=/path/to/vim-clap
syntax on
filetype plugin indent on
  1. Start Vim with command: vim -u min.vim

  2. Type

    :Clap history

    You get the history of buffer visible in the dialog

Wait for the history dialog to come and hit Backspace

  1. See error

You get the list of file you would have if you have issued:

:Clap files

Expected behavior

Get the same list of files you would get if you have only issued:

:Clap history

Remark: You have the same unexpected behavior if you type:

liuchengxu commented 9 months ago

Should be fixed in the latest commit. It looks like switching to the files list, but not, when you press the backspace, it's an empty query, previously the filtering will start to work and then the order may be changed even for the empty query due to some contextual matching scheme. Now the behaviour of empty query is made to be consistent with what we see on intializing the provider.

vds2212 commented 9 months ago

I'll test and let you know :-)

vds2212 commented 9 months ago

It works like a charm :-) Thanks you so much for your support!