When using the vim command API and passing a number to the `search`
option of `grep_string` (eg. `:Telescope grep_string search=3`), the
number is passed as a number. This eventually causes a type error at
`string.gsub` as the `search` value is expected to be a string.
We'll just cast `search` value to a string.
Fixes a minor bug in the builtin highlights picker where having
`Comment` selected in the picker shows `SpecialComment` in the
previewer. Only happens when the selected highlight is a suffix of
another highlight and the other highlight occurs first.
With `sorting_strategy='ascending'`, the results buffer should never
have lines beyond the `max_results` count OR the number of available
results, whichever is smaller.
closes#3282
* fix(__internal) : fix slash problem in oldfiles
- Problems
Problem with slash and backslash being mixed up is chronic issue of
neovim in Windows. it makes telescope prompt perceive same path
differently when it execute to oldfiles picker.
some function like `nvim_buf_get_name()` or `vim.v.oldfiles` give paths
which are mixed up with slash and backslash.
- What it did
For windows, it always needs to change slash(/) to backslash(\) when
function which deal with path because entry_maker works properly only
the case that path string has \ not /.
- Effect
1) oldfiles picker doesn't show duplicated list
2) `defaults.path_display` configuration feature will works well at
oldfiles pikcer
* fix(__internal) : Repeated comments are erased
Probably due to some async race condition, when typing fast, an error "attempt to index field 'manager' (a boolean value)" can be thrown if accidentally pressed <Tab> or <C-i>
This is a temp fix for that.
* feat(builtin.help_tags): show help pages for plugins not yet loaded by Lazy.nvim
* feat(builtin.colorscheme): allow picking colors not yet loaded by Lazy.nvim
Bad condition led to the selection being stuck at idx = 2 until only one
result is left, despite idx = 1 result being a better match.
Neither `sort_lastused` or `ignore_current_buffer` should affect the
position of the selection.
Former is used simply to sort the buffer list. The latter is used to
filter out the current buffer.
Adds `--max-count=1000` flag to the `git log` command in the
`git_branch_log` previewer. This prevents potential fork bombing
issues with large repositories.
Using `bat` would result in the command being a nested list.
eg. using `:Telescope plaents` with `bat` installed
```
{
"bat",
{ "--pager", "less -RS" },
"--style=plain",
"--color=always",
"--paging=always",
"--",
"/home/jt/projects/telescope.nvim/data/memes/planets/earth",
}
```
This would cause `vim.fn.termopen` to throw an error as the command is
expected to be a flat list or string.
Without scheduling, lots of vim state will be related to the builtin
picker when the new picker is opened despite closing the builtin picker
first and then opening a new picker.
This impacts state like `vim.fn.mode()`. If the builtin picker was
closed in insert mode, the closing action _should_ put you back in
normal mode. But without scheduling, the next picker is opened before it
does. So doing `vim.fn.mode()` in the subsequent picker will tell you,
you're still in insert mode. Typically, when chaining pickers, you want
the pre-telescope state, making the transitions between pickers
seemless.
Previously, when having window splits, with deleting a buffer involving
deleting a window, getting the jumplist for said deleted window would
result in an invalid jumplist. Trying to iterate over this invalid
jumplist would error out.
When there are split, there's no need to find a valid buffer to switch
the current window to (as the window is deleted). Instead, what's needed
is the updating of telescope's `picker.original_win_id` state. This is
important for when chaining buffer deletes (ie. closing many splits).
Also improve behavior when the "current" buffer is the only valid buffer
-> it will now open an empty buffer (same as when doing `:bdelete`).
* fix(builtin.live_grep, builtin.treesitter): not adding jumps to jumplist
Whenever a picker, that can jump to a different location in the same buffer does so it should have `push_cursor_on_edit` otherwise the jump won't be recorded.
Maybe this affects other pickers too, but I only noticed it on grep and treesitter since I use those two a lot.
* fix(builtin.grep_string): not adding jumps to jumplist
* fix(lsp.reference): Only filter the current line of the current filname
fix(lsp.reference): Only filter the current line of the current filname when include_current_line=false
* fix(lsp.reference): Only filter the current line of the current filname
* run stylua
---------
Co-authored-by: James Trew <j.trew10@gmail.com>