1238 Commits
Author SHA1 Message Date
zoriya 25bfb32406 Fallback use_file_path to vim.loop.cwd() 2025-01-25 22:44:50 +01:00
RockyandGitHub 2eca9ba220 fix: offset_encoding is required now in make_position_params (#3368)
Adapt to the upstream change
https://github.com/neovim/neovim/commit/629483e24eed3f2c07e55e0540c553361e0345a2
2024-11-29 13:54:06 +01:00
Tristan KnightandGitHub 85922dde37 refactor: adapt to deprecated jump_to_location (#3344) 2024-10-29 01:22:28 +00:00
f06e7a8871 Revert "feat(lsp): use native lsp handlers for some pickers" (#3349)
* Revert "feat(lsp): use native lsp handlers for some pickers (#3335)"

This reverts commit 6c468ff9ec.

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

---------

Co-authored-by: Github Actions <actions@github>
2024-10-29 01:11:39 +00:00
James TrewandGitHub 6c468ff9ec feat(lsp): use native lsp handlers for some pickers (#3335)
Switch the following pickers to use the native neovim lsp handler
functions using the `on_list` option:

- `references` -> `vim.lsp.buf.references`
- `definitions` -> `vim.lsp.buf.definition`
- `type_definitions` -> `vim.lsp.buf.type_definition`
- `implementations` -> `vim.lsp.buf.implementation`

This offloads the request and response handling off the neovim. This
also let's responses pass through any custom handlers registered via
`vim.lsp.handlers`.

This only affects users on neovim 0.11+. The `on_list` option was
introduced in nvim 0.10 but only recently in 0.11, has neovim's
`vim.lsp.buf.*` functions added improved support for responses from
multiple language servers.
2024-10-29 01:03:54 +00:00
Tristan KnightandGitHub 37dc9233a4 fix: add shim for vim.lsp.util._str_byteindex() (#3338)
Will be removed in Nvim 0.11: https://github.com/neovim/neovim/pull/30915
2024-10-26 16:33:10 +02:00
James TrewandGitHub df534c3042 fix(git_status): correctly count result on_complete (#3321)
The previous implementation with `self.manager:num_results()` could return
0 despite having results due to suspected async/event loop issues
(#3316). This change counts valid entries manually to ensure accurate
result count.
2024-10-10 00:08:12 +00:00
James TrewandGitHub dc6fc321a5 fix(grep_string): cast search value to string (#3319)
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.
2024-10-06 02:11:05 +00:00
Christian ClasonandGitHub eae0d8fbde fix(treesitter): adapt to upstream change (#3308)
In Nvim 0.11, `vim.treesitter.language.add()` returns `true` on success
or `nil,errmsg` on failure instead of throwing an error.
2024-09-30 08:56:14 +02:00
Cameron RingandGitHub cb3f98d935 fix(highlights): previewer show correct highlight group (#3305)
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.
2024-09-26 00:22:16 +00:00
6b08cdcc22 docs(builtin.tags): add show_kind option (#3304)
* docs(builtin.tags): add `show_kind` option

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

---------

Co-authored-by: Github Actions <actions@github>
2024-09-25 02:44:41 +00:00
21bfcc3e39 feat(tags): add support for displaying tag kind (#3235)
* Add kind to builtin.tags picker

* Add show_kind option

* Make show_kind true by default

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

* lint

---------

Co-authored-by: Ruben Laguna <ruben.laguna@tele2.com>
Co-authored-by: Github Actions <actions@github>
2024-09-25 01:47:39 +00:00
James TrewandGitHub b324469959 fix(pickers): sorting_strategy=asc stale result clearing (#3298)
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
2024-09-23 02:02:08 +00:00
sid-6581andGitHub 2ffcfc0d93 fix(builtin.vim_options): fix getting current option values (#3258)
* fix(builtin.vim_options): fix getting current option values

* fix: get options properly and skip invalid options

* fix: move option getting out of entry maker

* fix: fix toggle of booleans

* style: fix formatting
2024-09-23 01:58:34 +00:00
JaehaksandGitHub 175178e388 fix(__internal) : fix slash problem in oldfiles (#3260)
* 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
2024-09-22 03:35:27 +00:00
xudyang1andGitHub b5fd7f7ae0 fix(picker): nil check manager on toggle_selection (#3283)
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.
2024-09-19 02:26:50 +00:00
Micah HalterandGitHub 40d6d81b1d feat(builtin): allow picking help pages and colorschemes not yet loaded by Lazy.nvim (#3295)
* 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
2024-09-16 18:27:51 +02:00
Ronan DaltonandGitHub 927c10f748 fix(builtin.oldfiles): no output when cwd is root (#3271) 2024-09-13 01:12:33 +00:00
James TrewandGitHub f377c772d9 Revert "fix(buffers): bad sort_lastused result selection (#3289)" (#3293)
This reverts commit 1398e11b06.
2024-09-13 00:35:25 +00:00
James TrewandGitHub 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 TrewandGitHub 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
Cameron RingandGitHub f8985648e0 fix(picker): delete selection in disjointed finder results (#3266)
ipairs won't find find all results if entry_maker happens to return
nil for a line.
2024-09-12 00:32:38 +00:00
James TrewandGitHub fe999db6e0 fix(previewers): limit git log entries to prevent fork bomb (#3287)
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.
2024-09-11 00:11:39 +00:00
MarcusGrassandGitHub 5972437de8 fix(term_previewer): ensure terms are closed (#3225) 2024-08-15 01:50:24 +00:00
James TrewandGitHub cac2494a6e fix(term_preview): bad bat command generation (#3256)
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.
2024-08-15 01:44:40 +00:00
James TrewandGitHub 68a6d8e8a0 fix(term_previewer): save state from opt.setup call (#3254)
The merged table return from `vim.tbl_deep_extend` was not being
utilized/assigned.
2024-08-14 02:17:32 +00:00
James TrewandGitHub 159b8b7966 fix(buffer_previewer): save state from opt.setup call (#3253)
The merged table return from `vim.tbl_deep_extend` was not being
utilized/assigned.
2024-08-14 01:44:42 +00:00
James TrewandGitHub 43c47ebc49 fix(lsp): support multiple servers for dynamic symbols (#3248) 2024-08-13 01:33:53 +00:00
Ronan DaltonandGitHub 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
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
10b8a82b04 docs(previewer): term_preview env option (#3226)
* docs(previewer): term_preview `env` option

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

---------

Co-authored-by: Github Actions <actions@github>
2024-07-26 03:29:57 +00:00
MarcusGrassandGitHub 3264f0ae9d feat(previewer): allow passing env to new_termopen_previewer (#3224)
* Allow passing env through term opts

* Add doc update
2024-07-26 03:25:46 +00:00
James TrewandGitHub 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
DhananjayandGitHub d39ad2acde fix(edit action): update jumplist when moving in same file (#3205)
C-o behaves unintuitively when same file is selected at different
position.
2024-07-25 01:11:02 +00:00
James TrewandGitHub 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
James TrewandGitHub d54578395a fix(actions.insert_symbol): schedule to insert at correct position (#3218) 2024-07-24 01:23:46 +00:00
OKURA MasafumiandGitHub 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 TrewandGitHub bfcc7d5c6f fix(action.delete_buffer): improve behavior with splits (#3194)
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`).
2024-07-01 19:06:50 +00:00
AaronandGitHub 816dff9bbf feat(layout_config): add anchor_padding option (#3035) 2024-06-27 00:47:23 +00:00
James TrewandGitHub 61a4a61536 fix(lsp): if_nil <0.10 compat (#3184) 2024-06-25 10:30:33 -04:00
James TrewandGitHub 58ec6eca1c fix(builtin.lsp): respect file_ignore_patterns opt for direct jumps (#3173) 2024-06-25 03:15:17 +00:00
ashandGitHub 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 TrewandGitHub c392f1b78e fix(builtin.buffers): missing return in attach_mappings (#3172) 2024-06-15 18:40:26 +00:00
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 GrieserandGitHub 77cab9ad63 feat(builtin.colorscheme): add option ignore_builtins (#3155) 2024-06-15 15:29:34 +02:00
Ronan DaltonandGitHub 19584e666f fix(layout_strategies): odd flex layout default behavior, previewer hidden at certain widths (#3148) 2024-06-15 15:25:51 +02:00
Simon HauserandGitHub ae4420758e chore: don't construct add offset every time merge_styles is called (#3169) 2024-06-15 15:13:06 +02:00
AntonandGitHub 25f04509f7 feat: refactors transform_path and allow smart to be used in conjunction with filename_first (#3152) 2024-06-15 14:57:24 +02:00
Axel DahlbergandGitHub f12b15e1b3 feat(lsp): notify list_or_jump when no results (#3158) 2024-06-09 14:10:46 +00:00
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