* 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
* 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.
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.
* 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
* Fix jump regression in LSP references action handler
This change restores the possibility to exclude the current line when
invoking the lsp_references picker.
- opts.include_current_line is by default unset, so the previous
equality check would fail unless the option was set explicitly.
- vim.api.nvim_win_get_cursor() returns both line and column, so it
can't be directly compared with the returned line number.
- The actual comparison was expecting quickfix-like items, when in
actuality, we were dealing with raw LSP location objects.
* lsp: Pass offset_encoding to action_handlers
* LSP: Action handlers take both locations and items
* LSP: Rename (flattened_)results → locations
* LSP: Early return in list_or_jump
Remove backslash escaping in oldfiles picker, which was needed
before the code was changed to use substring comparison instead of
regex matching. (Commit b3ff5f33)
Previous implementation of placing the cursor on the first column of the
highlight failed to take into account that the highlighter can return
more than one data structure.