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>
Few pickers with entry makers that relied on `entry_display.create` were
not properly passing the highlight table returned by `transform_path`.
This made the `filename_first` `path_display` option not work as
expected for these pickers.
* fix(help_tags): show help tags on windows (#3126)
On Windows, `builtin.help_tags` picker does not show any help tags.
To fix this, the following changes are needed:
1. `util.path_tail` checks unix separator `/` on Windows and leave the
original implementation intact on unix systems.
2. Line endings should be taken carefully on Windows. `vim.split` with
only newline `\n` character as separator may result in unexpected
crash when parsing large files. When splits on lines are needed, call
it with `\r?\n`, or even set up a wrapper function in utils is more
prefered.
Fixes#3126
* fix: handle cross platform line splits
* Add options to customize length of symbols and line numbers for gen_from_treesitter
* Revert adding symbol_type_width option
* Add docs and type hint
vim.iter.flatten() is not a full replacement (does not support arrays
with `nil`); a fix may be backported but for now only use it on nightly
(0.10 has no warnings yet).