Commit Graph

1238 Commits

Author SHA1 Message Date
Marskey
84c5a71d82 fix: async job close not working #2797 (#2798) 2023-11-27 19:50:22 +01:00
Chen Lu
e4c62dedd7 feat(actions): add delete_mark (#2769)
* feat(actions): add delete_mark

* style(init.lua): fix formatting
2023-11-26 03:37:50 +00:00
geril2207
18774ec792 fix: split commands while picker is open (#2784) 2023-11-16 02:12:34 +00:00
Carlos Afonso
b6edf826b4 fix(preview): allow arbitrary horizontal scrolling (#2787) 2023-11-16 01:26:52 +00:00
James Trew
721cdcae13 chore: fix marks picker options (#2783)
* chore: fix marks picker options

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

---------

Co-authored-by: Github Actions <actions@github>
2023-11-15 03:47:37 +00:00
LUCIANO FURTADO
4e77d1991d feat(marks): add support for displaying marks according to the mark_type (#2775)
* Fixes: #2763

* clean up docs type annotations

---------

Co-authored-by: LUCIANO FURTADO <l.furtado@f5.com>
Co-authored-by: James Trew <j.trew10@gmail.com>
2023-11-15 02:42:17 +00:00
Hicro
20bf20500c fix: nil problem when jump to location when tab drop is set as jump_type (#2760)
* feat(lsp_definitions): adding `tab drop` as `jump_type`

* feat(lsp-jump-types): `tab drop` for LSP features

Now, you're able to use `tab drop` as `jump_type` for these LSP
features: references, type definitions, definitions an implementations.

* fix(docs): reordering `tab drop` option

* feat: generate docs

* fix: nil problem with `vim.uri_to_fname`

* fix: removing warning about `file_uri` variable not being used

---------

Co-authored-by: Simon Hauser <simon.hauser@helsinki-systems.de>
2023-11-06 02:06:57 +00:00
Garry Filakhtov
4522d7e3ea fix: jumplist picker resume after bwipeout (#2753)
With this change we will check if the provided buffer number is valid,
before querying its `buftype` option. This is necessary, because
currently we would fail with:
```
Error executing vim.schedule lua callback:
...scope.nvim/lua/telescope/previewers/buffer_previewer.lua:473:
Invalid buffer id: X
```
error, if we try to resume a jumplist picker after doing `:bwipeout`.
2023-10-23 14:19:17 +02:00
Giuseppe Rota
8c9fd22952 fix(actions): set location list title (#2741) 2023-10-23 09:57:47 +02:00
Simon Hauser
3a2579e203 fix: always reset prompt highlighting (#2739) 2023-10-23 09:45:01 +02:00
Frantisek Stanko
a62db885fd fix: do not send data to closed stream (#2746)
This commit fixes the following error:

E5108: Error executing lua: Vim:Can't send data to closed stream
stack traceback:
[C]: in function 'chansend'
/lua/telescope/previewers/term_previewer.lua:224: in function '_send_input'
/lua/telescope/previewers/previewer.lua:85: in function 'send_input'
/lua/telescope/previewers/term_previewer.lua:238: in function '_scroll_fn'
/lua/telescope/previewers/previewer.lua:93: in function 'scroll_fn'
/lua/telescope/actions/set.lua:249: in function 'run_replace_or_original'
/lua/telescope/actions/mt.lua:65: in function 'scroll_previewer'
/lua/telescope/actions/init.lua:222: in function 'run_replace_or_original'

This happens when previewers.new_termopen_previewer()'s get_command()
ends without pagination.
2023-10-23 09:44:27 +02:00
Hicro
060fedfdea feat(lsp-jump-type): tab drop as new jump_type option for go-to LSP pickers (#2751) 2023-10-23 09:41:29 +02:00
Simon Hauser
550055e640 fix: correctly create User autocmd in action.which_key (#2736) 2023-10-11 08:07:30 +02:00
AI
5a747a9587 fix(lsp): call hierarchy results processing (#2728) 2023-10-07 20:05:04 +00:00
Folke Lemaitre
205f469244 fix(actions): fixes folding. Fixes #699 (#2726) 2023-10-06 01:56:00 +00:00
LW
8c69f58427 feat(preview)!: add opts.preview.highlight_limit with default 1MB (#2715) 2023-10-02 17:51:34 +02:00
James Trew
ffe90fac32 feat(current_buffer_fuzzy_find): results_ts_highlight option (#2722)
* feat(current_buffer_fuzzy_find): `results_ts_highlight` option

adds new option to the `current_buffer_fuzzy_find` picker
`results_ts_highlight` to enable/disable treesitter highlight for result
entries (default: true)

closes #2720

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

---------

Co-authored-by: Github Actions <actions@github>
2023-09-29 01:42:03 +00:00
Munif Tanjim
84d53dfdbe feat(pickers): fully customizable layout (#2572) 2023-09-27 08:34:22 +02:00
Yorick Peterse
5c91b855b8 Fix resize/preview toggles of the cursor layout (#2718)
The cursor layout uses winline() and wincol() to calculate the cursor
position. Both these functions operate on the currently active window.
The first time the calculations are performed, that happens to be the
window active before showing the Telescope window. However, if the
editor is then resized or the preview window is toggled, the active
window changes. The result is that recalculating the position is then
done using the wrong window, resulting in the Telescope window moving
around in an erratic manner.

To fix this, we have to scope the winline() and wincol() calls to the
original window ID.
2023-09-27 02:41:34 +00:00
Andrés Cuellar
ed9574dd6d Add git_rename_branch git action (#2713) 2023-09-23 20:29:15 +00:00
Charles Moscofian
40c8d2fc2b fix: only validate severity table when using a range (#2709)
The only possibility for having a table with different severities to
pass to `vim.diagnostics.get()` as opts is when setting a range (limit
and bound), so just check for an empty table when a range is set.
2023-09-19 23:55:48 +00:00
James Trew
e7cfbb5d1f fix(git): tbl_isarray compat with nvim 0.9 (#2710) 2023-09-19 23:43:18 +00:00
James Trew
b543aaa2c9 fix: prompt_prefix leading whitespace normal mode cc (#2699)
* fix: `prompt_prefix` leading whitespace normal mode cc

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

---------

Co-authored-by: Github Actions <actions@github>
2023-09-16 03:40:00 +00:00
Will Hopkins
a19770625a feat: check if cmd extension can be loaded (#2655)
As a last resort if no other cmd is found in `run_cmd`, check
if the command can be loaded as an extension.
2023-09-10 12:23:28 +02:00
James Trew
08e6d7904d feat(actions): add quickfix list autocmd event exec (#2672)
Add `QuickFixCmdPre` and `QuickFixCmdPost` event triggers to
`send_selected_to_qf` and `send_all_to_qf`
2023-09-10 12:16:48 +02:00
Sofronie Cristian
3d8e051c8c fix(internal.resume): dynamic_preview_title was not respected and title became static (#2696)
* fix(internal.resume): dynamic_preview_title was not respected and title became static

* run stylua
2023-09-09 23:33:01 +00:00
Sofronie Cristian
20a37e43bb fix(telescope.state.get_existing_prompts): it should only return keys that are numbers (#2684)
* fix(telescope.state.get_existing_prompts): it should only return keys that are numbers

* Table keys not table values should be numbers

* Rename get_existing_prompts to get_existing_prompt_bufnrs and make the impl more efficient
2023-09-04 18:05:59 +00:00
JINNOUCHI Yasushi
6b79d7a6a4 fix: use nil for the default diagnostics severity (#2662)
* fix: use nil for the default diagnostics severity

https://github.com/neovim/neovim/pull/24736 has introduced a new syntax
for severity format in `vim.diagnostic.get()`.

Fix #2661

* fix: fallback for 0.9.1

* fix: detect changes only when minor version > 9
2023-09-03 22:22:17 +00:00
Sofronie Cristian
74be3c3bba fix(builtin.pickers): fix wrong picker resuming when using filtering (#2682)
When filtering is applied, `picker:get_index(picker:get_selection_row())` returns index relative to the filtered entry list rather than the original full results. This causes inaccurate indexing into the `cache_pickers` table.
2023-09-03 20:42:09 +00:00
blue pitaya
dc7f25c810 add 'full' for line_width in diagnostics options (#2452)
* add 'full' for line_width in diagnostics options

* lowercase documentation entry and change error notify method

* moved line_width options checking
2023-09-03 19:15:21 +00:00
Hawtian Wang
3fae9c1e14 fix results win cursor for sorting_strategy descending (#2679)
* add an additional nvim_win_set_cursor

* Fix after filter

* remove redundant check

* use `redraw!` to replace ugly `nvim_win_set_cursor`

* redraw results win in `on_lines`

* use move instead of redraw

* fix

* keep both!

* fix!

* fix!
2023-09-02 22:07:57 +00:00
cristiansofronie
2c1ed33a6f fix(files.current_buffer_fuzzy_find): fix nil indexing on enter if nothing is selected (#2678) 2023-08-30 17:33:30 +00:00
Sergey Kuznetsov
32e6792f86 fix(actions): fix Esc in git actions confirmation (#2674)
For some git actions pressing Esc for the dialog of action confirmation
didn't cancel the action. I moved asking for confirmation to a separate
function and a bit changed notifications about canceled action.
2023-08-29 19:56:53 +00:00
James Trew
83133f66c8 fix(utils): is_uri empty path (#2671) 2023-08-29 10:36:56 -04:00
James Trew
1dfa66b845 perf(utils): linear scan is_uri (#2648) 2023-08-28 04:26:09 +00:00
James Trew
2d92125620 test(utils): add tests for is_uri (#2645) 2023-08-10 00:34:54 +00:00
Alejandro Maturrano
bc2330bc9c fix: handle windows file paths as uris (#2640)
* fix: handle windows file paths as uris

* nit: rename FILE_PATH_PATTERN to WINDOWS_ROOT_PATTERN
2023-08-10 00:30:14 +00:00
Marskey
dc192faceb feat: add searching indicator (#1717) (#2637) 2023-08-07 17:10:24 +00:00
James Trew
96da5716e4 add missing dependency warning for ripgrep (#2639)
For live_grep and grep_string pickers.
2023-08-07 17:05:21 +00:00
James Trew
5a3fb8a012 Revert "add missing dependency warning for ripgrep (#2623)" (#2638)
This reverts commit 49a03aa844.
2023-08-06 21:07:24 +00:00
James Trew
49a03aa844 add missing dependency warning for ripgrep (#2623)
For live_grep and grep_string pickers.
2023-08-06 20:51:08 +00:00
James Trew
f5363d3c2a feat(diagnostics): add sort_by option (#2632)
* feat(diagnostics): add `sort_by` option

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

---------

Co-authored-by: Github Actions <actions@github>
2023-08-06 20:46:34 +00:00
James Trew
d2e17ba18a Revert "Fix tagrelative option not considered in builtin.tags (#2583)" (#2629)
This reverts commit 6074847b6e due to
performance regression.
2023-08-01 00:22:53 +00:00
Michael Henry
b6fccfb0f7 fix: preserve queued keys at picker launch (#2274) (#2625)
Ensure that any keystrokes that are queued at picker launch are
processed only after the picker's mode (`insert` or `normal`) has been
chosen, preserving their intended meaning.

Previously the picker's mode was set by simulating keystrokes via
`nvim_feedkeys(simulated_keypresses, "n")`. In the absence of queued
keystrokes, this works fine; but if the user is able to queue keystrokes
before the call to `nvim_feedkeys()`, those queued keystrokes are
processed before the simulated keystrokes that change the picker's mode.
Because of this unexpected ordering, the user's queued keystrokes may
appear to be ignored or may cause the picker to start in the wrong mode.

For example, consider the below normal-mode mapping:
```vim
:nnoremap <space>ff :Telescope find_files<CR>
```

Upon launching the picker via `<space>ff`, Neovim is already in normal
mode. To switch to insert mode in the picker, Telescope previously used
a call to `nvim_feedkeys("A", "n")`, simulating a keypress of `A` to
enter insert mode at the end of the current line.  This `A` would not be
processed until all previously queued user keystrokes have been
processed, causing issues.

In real-world use, problems occur when the user types `<space>ff`
followed quickly by characters intended as fuzzy match text.  This can
be demonstrated using `nvim_feedkeys()` as shown below.

```vim
:call nvim_feedkeys("\<space>ff" . "apple")
```

The user intended to search for `apple`, but the `a` is misinterpreted
as a request to enter insert mode at end of line, after which `pple` is
inserted; subsequently, Telescope's simulated `A` is then appended,
resulting in a search string of `ppleA`.

To ensure that Telescope's simulated keypresses are processed first, an
additional `i` flag is now passed to `nvim_feedkeys()`, causing the
simulated keypresses to be inserted at the start of the typeahead buffer
ahead of any user keystrokes.

Fixes #2274.
2023-07-29 20:48:13 +00:00
Luis
22735947d8 feat: highlight range in grep buffer previewer (#2611) 2023-07-27 09:24:50 +02:00
James Trew
1228f3b15c Revert "fix: preserve queued keys at picker launch (#2274)" (#2619)
* Revert "fix: preserve queued keys at picker launch (#2274) (#2618)"

This reverts commit f78d956901.

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

---------

Co-authored-by: Github Actions <actions@github>
2023-07-22 23:23:22 +00:00
Aaron Kollasch
e7e6492a2d feat(git): Add bcommits_range picker (#2398)
* Filter bcommits by selection in visual mode

* Split bcommits_range into new picker

* Add option to run bcommits_range as operator

Starts operator-pending mode and shows commits in the range of lines
covered by the next text object or motion

* Rename range arguments to "first" and "last"

Can't use start/end, since end is an annoying keyword to use in lua
and start/stop doesn't fit as well

* Move operators functionality to new module

* Run bcommits if no range given to bcommits_range

* Make bcommits_range default to current line

Instead of calling bcommits

* Improve documentation of telescope.operators

* Add default value for last_operator

Default to a no-op callback

* Update bcommits_range for detached worktrees

See #2597

* Rename range arguments to "from" and "to"

* Move shared bcommits picker into single function
2023-07-22 21:35:52 +00:00
Michael Henry
f78d956901 fix: preserve queued keys at picker launch (#2274) (#2618)
Ensure that any keystrokes that are queued at picker launch are processed only
after the picker's mode (`insert` or `normal`) has been chosen, preserving
their intended meaning.

Previously the picker's mode was set by simulating keystrokes via `feedkeys()`.
In the absence of queued keystrokes, this works fine; but if the user is able
to queue keystrokes before the call to `feedkeys()`, those queued keystrokes
are processed before the simulated keystrokes that change the picker's mode.
Because of this unexpected ordering, the user's queued keystrokes may appear to
be ignored or may cause the picker to start in the wrong mode.

For example, consider the below normal-mode mapping:
```vim
:nnoremap <space>ff :Telescope find_files<CR>
```

Upon launching the picker via `<space>ff`, Neovim is already in normal mode.
To switch to insert mode in the picker, Telescope previously used a call to
`feedkeys("A")`, simulating a keypress of `A` to enter insert mode at the end
of the current line.  This `A` will not be processed until all previously
queued user keystrokes have been processed, causing issues.

In real-world use, problems occur when the user types `<space>ff` followed
quickly by characters intended as fuzzy match text.  This can be demonstrated
using `feedkeys()` as shown below.

```vim
:call feedkeys("\<space>ff" . "apple")
```

The user intended to search for `apple`, but the `a` is mis-interpreted as a
request to enter insert mode at end of line, after which `pple` is inserted;
subsequently, Telescope's simulated `A` is then appended, resulting in a search
string of `ppleA`.

Using `:startinsert!` (to enter insert mode as if by `A`) or `:normal! $` (to
enter normal mode and move to end-of-line) avoids interfering with the user's
queued keys.

Fixes #2274.
2023-07-22 21:27:22 +00:00
James Trew
7bb2fcecdc Revert "expand paths more smartly (#2599)" (#2615)
This reverts commit f52ea4061d.
2023-07-21 21:50:44 -04:00
James Trew
f52ea4061d expand paths more smartly (#2599) 2023-07-21 22:12:29 +00:00