Commit Graph

430 Commits

Author SHA1 Message Date
James Trew
1398e11b06 fix(buffers): bad sort_lastused result selection (#3289)
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.
2024-09-12 01:49:25 +00:00
James Trew
cfaf68420e fix(lsp): handle empty call hierarchy items (#3288)
- Added a check for empty call hierarchy items using vim.tbl_isempty.
- Fixed the return value to correctly return the chosen item from the
  list.
2024-09-12 01:07:47 +00:00
James Trew
43c47ebc49 fix(lsp): support multiple servers for dynamic symbols (#3248) 2024-08-13 01:33:53 +00:00
Ronan Dalton
3bb24bb6a9 fix(builtin.colorscheme): improve enable_preview behavior (#3244)
* fix(builtin.colorscheme): don't preview colors when enable_preview=false

* fix(builtin.colorscheme): update preview on mouse click
2024-08-13 01:30:48 +00:00
Enric Lluelles
3b1600d0fd feat(lsp): support requests to many servers for some pickers (#3211)
* Implement list_or_jump_all and use it

* Update lua/telescope/builtin/__lsp.lua

Co-authored-by: James Trew <66286082+jamestrew@users.noreply.github.com>

* Make list_or_jump listen to multiple lsps at once

* Don't fail early if an lsp errors

---------

Co-authored-by: James Trew <66286082+jamestrew@users.noreply.github.com>
2024-08-02 01:12:41 +00:00
James Trew
47ab113de5 fix(builtin.builtin): schedule opening next picker (#3222)
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.
2024-07-25 01:43:14 +00:00
James Trew
bc4e7e4503 fix(current_buffer_fuzzy_find): push cursor on edit (#3219)
Setting `push_cursor_on_edit = true` wasn't actually doing anything as
the picker replaces `select_default`.

Instead, call `normal! m'` manually in the replacement `select_default`.
2024-07-24 03:22:00 +00:00
OKURA Masafumi
79552ef848 docs: mention default value of follow option for find_files (#3209)
https://github.com/nvim-telescope/telescope.nvim/blob/master/lua/telescope/builtin/__files.lua#L298

It seems the default value is `false`, and unlike other options, the default value of `follow` option is not mentioned.
2024-07-20 14:11:14 +00:00
James Trew
61a4a61536 fix(lsp): if_nil <0.10 compat (#3184) 2024-06-25 10:30:33 -04:00
James Trew
58ec6eca1c fix(builtin.lsp): respect file_ignore_patterns opt for direct jumps (#3173) 2024-06-25 03:15:17 +00:00
ash
af78ba3b7d fix(builtin): grep/treesitter push cursor on edit (#3175)
* 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
2024-06-25 03:13:53 +00:00
James Trew
c392f1b78e fix(builtin.buffers): missing return in attach_mappings (#3172) 2024-06-15 18:40:26 +00:00
James Trew
979bfa2c44 feat(builtin.buffers): enhance and bind delete_buffer action (#3145)
* feat(builtin.buffers): enhance and bind `delete_buffer` action

* change default bind and add docs

* [docgen] Update doc/telescope.txt
skip-checks: true

---------

Co-authored-by: Github Actions <actions@github>
2024-06-15 14:24:18 +00:00
Chris Grieser
77cab9ad63 feat(builtin.colorscheme): add option ignore_builtins (#3155) 2024-06-15 15:29:34 +02:00
Axel Dahlberg
f12b15e1b3 feat(lsp): notify list_or_jump when no results (#3158) 2024-06-09 14:10:46 +00:00
Yeri Pratama
7231b52276 fix(buffers): select_current not selecting current buffer index (#3147)
Co-authored-by: Yeri <yeri@accelbyte.net>
2024-06-09 14:09:00 +00:00
Lonzo_ghf
3a743491e5 fix(lsp.reference): only filter the current line of the current filname (#3154)
* 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>
2024-06-08 02:32:45 +00:00
Lawrence Ho
dfa230be84 fix(lsp): handle URI in item_to_location (#3144) 2024-05-29 19:24:09 +02:00
James Trew
127159a52f fix(lsp.reference): single reference direct jump (#3137)
* fix(lsp.reference): single reference direct jump

* [docgen] Update doc/telescope.txt
skip-checks: true

---------

Co-authored-by: Github Actions <actions@github>
2024-05-29 01:34:22 +00:00
James Trew
4c96370cf9 fix(make_entry): improve filename_first support (#3140)
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.
2024-05-27 01:50:31 +00:00
xudyang1
349660c0d3 fix(pickers): improve CRLF line splitting support for windows (#3127)
* 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
2024-05-26 14:15:31 +00:00
Tristan Knight
5665d93988 fix(builtin.spell_suggest): ciw into black hole register (#3124) 2024-05-23 02:41:23 +00:00
Max Jendruk
05f4d6f0a9 feat(builtin.treesitter): add symbol_width opt (#3105)
* 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
2024-05-23 01:50:14 +00:00
Christian Clason
33f04c3a86 fixup: adapt to deprecations in Nvim 0.10 (#3112) 2024-05-17 18:10:21 +02:00
Christian Clason
bbdbb7593f fix: adapt to Nvim deprecations in 0.10 (#3109) 2024-05-17 14:39:12 +02:00
DevFortunato
96610122a4 fix(builtin.colorscheme): preview colorscheme without previewer (#3097)
* fix: enable_preview true

* fix: remove buflisted check and colorscheme command in the buffer previewer

---------

Co-authored-by: nobrain <moviemaker@alfonso>
2024-05-17 03:08:28 +00:00
James Trew
6f6bb80655 Revert "refactor(lsp): simplify list_to_jump (#3099)" (#3101)
This reverts commit e9be6bb7a7.
2024-05-14 14:34:00 +00:00
James Trew
e9be6bb7a7 refactor(lsp): simplify list_to_jump (#3099)
* refactor(lsp): simplify `list_to_jump`

* [docgen] Update doc/telescope.txt
skip-checks: true

---------

Co-authored-by: Github Actions <actions@github>
2024-05-14 04:10:11 +00:00
James Trew
c8b69caae5 fix(lsp): add missing offset_encoding param (#3098) 2024-05-14 02:54:56 +00:00
Adrian Göransson
df4dd3089d fix(lsp.references): include_current_line option regression (#3091)
* 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
2024-05-14 02:27:57 +00:00
Christoph Bier
02a60a8396 fix(builtin.oldfiles): fix cwd_only for windows (#3096)
Remove backslash escaping in oldfiles picker, which was needed
before the code was changed to use substring comparison instead of
regex matching. (Commit b3ff5f33)
2024-05-12 18:30:53 +00:00
Nolan Prochnau
486a6489c4 fix(builtin.commands): don't remap for feedkeys (#3087) 2024-05-03 01:28:13 +00:00
Kevin Traver
2d0d057791 fix(picker): notify on empty quickfix and loclist (#3082) 2024-05-01 02:26:27 +00:00
gzbfgjf2
d26b666b45 fix(marks): preserve uri filenames with path_expand (#3029) 2024-04-05 01:03:48 +00:00
James Trew
3b8399c273 fix: expand/normalize paths more selectively (#2628) 2024-03-19 22:55:27 +00:00
James Trew
c816406bd5 fix(builtin.lsp): bad check for jump_type option (#2991) 2024-03-18 15:39:57 +00:00
James Trew
5730b950d9 fix(builtin.lsp): extra No Name buffer opening with jump_type (#2990) 2024-03-18 13:41:56 +00:00
James Trew
1fa3b801f0 docs(builtin.colorscheme): add colors option desc (#2989)
* docs(builtin.colorscheme): add `colors` option desc

* docgen plz
2024-03-18 02:05:26 +00:00
James Trew
8cd58c6e81 fix(lsp): incoming/outgoing_call range locations (#2985)
Previous implementation uses the incorrect lsp result fields for
generating call site locations resulting in incomplete and incorrect
results.
2024-03-18 01:09:56 +00:00
fcying
04dfe370b0 fix: remove duplicate lazyloaded items in colorscheme (#2951) 2024-03-18 00:28:10 +00:00
Damjan 9000
6868df51d2 feat(bultin.buffer): add select_current option (#2918) 2024-02-24 15:21:25 +01:00
James Trew
955e50dfed feat(git_files): support emoji/unicode in filenames (#2943)
Pass `core.quotepath=false` to achieve this.

Could alternatively pass `-z` but that uses `\0` line termination and
complicates things.

Closes #2900
2024-02-24 01:28:29 +00:00
James Trew
12e42a3625 fix(current_buffer_fuzzy_find): error on select (#2942)
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.
2024-02-24 01:08:59 +00:00
James Trew
a5b69afa48 refactor(lsp): consolidate some picker jump logic (#2935) 2024-02-23 03:15:55 +00:00
Anton Kastritskii
45d61cc8da fix(builtin.current_buffer_fuzzy_find): manually go through highlighted chars to pick smallest one (#2922) 2024-02-15 13:54:21 +00:00
Anton Kastritskii
fac5da839e feat(builtin.current_buffer_fuzzy_find): jump to first matched char (#2909)
* feat(builtin.current_buffer_fuzzy_find): jump to first matched char

* use highlighter to detect column to jump to

* replace default select

* handle non 0 based column index

* handle no highlight scenario

---------

Co-authored-by: James Trew <j.trew10@gmail.com>
2024-02-15 02:01:13 +00:00
Tyler Miller
eb88dc6434 feat(builtin.autocommands): support jumping to lua callback src (#2916) 2024-02-14 03:00:33 +00:00
Marco De Donno
236083884c fix: do not alter jumplist when jumping to a line in a file (#2910) 2024-02-04 21:37:33 +00:00
Sebastian Lyng Johansen
b4befa1c2f fix: fallback to filetype for get_lang for treesitter highlighting (#2867) 2024-01-18 11:43:26 +01:00
Arne Van Maele
da8b3d4859 feat(builtin.oldfiles): support file location opening (#2863) 2024-01-12 03:53:31 +00:00