Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too many wrong highlight words in live_grep #934

Open
liubog2008 opened this issue Jun 24, 2021 · 1 comment · May be fixed by #2536
Open

Too many wrong highlight words in live_grep #934

liubog2008 opened this issue Jun 24, 2021 · 1 comment · May be fixed by #2536
Labels
bug Something isn't working

Comments

@liubog2008
Copy link

liubog2008 commented Jun 24, 2021

Description

Now some unexpected worlds are highlighted in live_grep results (based on rg)

Expected Behavior

I search components but con, om, on ... are all highlighted.

Actual Behavior

Only components is highlighted.

Details

Reproduce
  1. nvim -nu test.vim
Environment
  • nvim --version output:
  • Operating system:
  • Telescope commit:
Configuration

set nocompatible hidden laststatus=2

if !filereadable('/tmp/plug.vim')
  silent !curl --insecure -fLo /tmp/plug.vim
    \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
endif

source /tmp/plug.vim
call plug#begin('/tmp/plugged')
Plug 'nvim-lua/popup.nvim'
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim'
call plug#end()

autocmd VimEnter * PlugClean! | PlugUpdate --sync | close
lua << EOF

require('telescope').setup{
  defaults = {
    vimgrep_arguments = {
      'rg',
      '--color=never',
      '--no-heading',
      '--with-filename',
      '--line-number',
      '--column',
      '--smart-case'
    },
    prompt_position = "bottom",
    prompt_prefix = ">",
    selection_strategy = "reset",
    sorting_strategy = "descending",
    layout_strategy = "horizontal",
    layout_defaults = {},
    file_ignore_patterns = {},
    shorten_path = true,
    winblend = 0,
    width = 0.75,
    preview_cutoff = 120,
    results_height = 1,
    results_width = 0.8,
    border = {},
    borderchars = { '', '', '', '', '', '', '', ''},
    color_devicons = true,
    use_less = true,
  }
}
EOF
@liubog2008 liubog2008 added the bug Something isn't working label Jun 24, 2021
@liubog2008 liubog2008 changed the title Too much wrong highlight error in live_grep Too many wrong highlight words in live_grep Jun 24, 2021
@Conni2461
Copy link
Member

Conni2461 commented Jun 24, 2021

Thats because we are using the fuzzy sorter to highlight it and not the ripgrep output. Depending on which generic sorter you are using the highlighting may differ. There were some work on actually using ripgreps coloring and more #670 and i told jesseleite how he could do it. But its open source and time is rare :)

@jamestrew jamestrew linked a pull request Feb 25, 2024 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants