1055 Commits

Author SHA1 Message Date
Simon Hauser 5263cb6021 fix: always reset prompt highlighting (#2739)
(cherry picked from commit 3a2579e203)
2023-11-28 11:16:52 +01:00
Simon Hauser d436fc6c4d fix: prefix color highlighting on nvim 0.9 (#2403)
(cherry picked from commit a3f17d3baf)
2023-11-28 11:16:45 +01:00
Frantisek Stanko 195be6acc2 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.

(cherry picked from commit a62db885fd)
2023-11-28 11:16:39 +01:00
Simon Hauser 7011eaae0a fix: correctly create User autocmd in action.which_key (#2736)
(cherry picked from commit 550055e640)
2023-10-11 08:15:56 +02:00
AI 296668f632 fix(lsp): call hierarchy results processing (#2728)
(cherry picked from commit 5a747a9587)
2023-10-11 08:15:42 +02:00
Folke Lemaitre 2eb23ffa34 fix(actions): fixes folding. Fixes #699 (#2726)
(cherry picked from commit 205f469244)
2023-10-11 08:13:36 +02:00
Yorick Peterse e0449fdb13 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.

(cherry picked from commit 5c91b855b8)
2023-10-11 08:11:55 +02:00
Charles Moscofian 415876d486 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.

(cherry picked from commit 40c8d2fc2b)
2023-10-11 08:10:29 +02:00
James Trew 461d6e7803 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>
(cherry picked from commit b543aaa2c9)
2023-10-11 08:09:33 +02:00
Sofronie Cristian 54930e1abf 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

(cherry picked from commit 3d8e051c8c)
2023-09-10 12:54:18 +02:00
Sofronie Cristian 9a9ca52206 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

(cherry picked from commit 20a37e43bb)
2023-09-05 16:11:12 +02:00
JINNOUCHI Yasushi 573a8b2b5f 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

(cherry picked from commit 6b79d7a6a4)
2023-09-05 16:10:57 +02:00
Sofronie Cristian 0847120c40 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.

(cherry picked from commit 74be3c3bba)
2023-09-05 16:10:48 +02:00
Hawtian Wang d3105f70dd 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!

(cherry picked from commit 3fae9c1e14)
2023-09-05 16:09:33 +02:00
cristiansofronie a52167fe41 fix(files.current_buffer_fuzzy_find): fix nil indexing on enter if nothing is selected (#2678)
(cherry picked from commit 2c1ed33a6f)
2023-09-05 16:09:05 +02:00
James Trew c4032ad297 fix(utils): is_uri empty path (#2671)
(cherry picked from commit 83133f66c8)
2023-09-05 16:08:30 +02:00
James Trew 30ba3dbdff perf(utils): linear scan is_uri (#2648)
(cherry picked from commit 1dfa66b845)
2023-09-05 16:08:25 +02:00
James Trew 92b5e7f90a test(utils): add tests for is_uri (#2645)
(cherry picked from commit 2d92125620)
2023-09-05 16:08:07 +02:00
Alejandro Maturrano 1384b2e99b fix: handle windows file paths as uris (#2640)
* fix: handle windows file paths as uris

* nit: rename FILE_PATH_PATTERN to WINDOWS_ROOT_PATTERN

(cherry picked from commit bc2330bc9c)
2023-09-05 16:07:51 +02:00
Michael Henry 947cb46344 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.

(cherry picked from commit b6fccfb0f7)
2023-09-05 16:06:14 +02:00
Andrii Berezhynskyi dc4ea2cab4 fix: do not ignore mappings from setup() when attach_mappings provided (#2613)
(cherry picked from commit 597a3cc889)
2023-09-05 16:05:32 +02:00
TJ DeVries 6bc7bd7c60 fix: handle non-file uris for lsp (#2604)
(cherry picked from commit 47c755d737)
2023-09-05 16:04:18 +02:00
Stanislav Asunkin 5077c3d6e6 fix: fix builtins lazy loading (#2590)
(cherry picked from commit 0e0600908d)
2023-09-05 16:02:35 +02:00
Nghia Le Minh 11a3b16487 fix(lsp_dynamic_workspace_symbols): add prefilter as per documentation (after to_fuzzy_refine) (#2584)
* fix(lsp_dynamic_workspace_symbols): add prefilter as per documentation (after to_fuzzy_refine)

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

* docs grammar

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

---------

Co-authored-by: Github Actions <actions@github>
Co-authored-by: James Trew <j.trew10@gmail.com>
(cherry picked from commit 219584a6ef)
2023-09-05 16:01:35 +02:00
James Trew 50e942530e fix(live_grep/grep_string): support non-utf8 patterns (#2570)
(cherry picked from commit ffe35cb433)
2023-09-05 15:59:32 +02:00
Simon Hauser 776b509f80 fix(actions): which_key after mappings rework (#2556)
(cherry picked from commit 42267407ae)
2023-06-09 11:28:32 +02:00
Simon Hauser c757f8a17d refactor(mappings): use vim.keymap and remove __TelescopeKeymapStore (#2551)
(cherry picked from commit 991d5db624)
2023-06-09 11:28:27 +02:00
Munif Tanjim 9b54003f5e fix: use :botright modifier for quickfix window open (#2554)
(cherry picked from commit 9a82b5b73e)
2023-06-09 11:28:14 +02:00
Kalmander 866cd41242 fix(registers): add small delete remove black hole (#2553)
Co-authored-by: Tryggvi Kalman <tryggvikalman@protonmail.com>
(cherry picked from commit be49680937)
2023-06-09 11:27:28 +02:00
Simon Hauser 6a169a6fe4 fix(mappings): expr for insert mode (#2458)
(cherry picked from commit 9e3922f628)
2023-06-09 11:27:21 +02:00
Zhanibek Adilbekov e7d17b1890 fix(bcommits): wrong selection field is used (#2550)
(cherry picked from commit 333966610c)
2023-06-09 11:27:16 +02:00
Simon Hauser 533c7fb1b3 Revert "fix: correctly restore cursor position in original window (#2336)" (#2538)
This reverts commit 3f1b57908b.

(cherry picked from commit eb95a31836)
2023-05-25 07:43:48 +02:00
Simon Hauser 7c2f0f8398 fix: make sure that prompt_win is valid bevore closing it (#2533)
(cherry picked from commit ff8ed2351f)
2023-05-24 22:19:03 +02:00
Simon Hauser a5881cffc3 fix: make sure buf is valid before updating highlighting (#2524)
(cherry picked from commit e943f93a6a)
2023-05-24 22:18:56 +02:00
Simon Hauser ec42e02030 fix(actions): send_to_* and smart_send_to_* now append to history (#2527)
(cherry picked from commit dda9a3965b)
2023-05-24 17:09:41 +02:00
Simon Hauser 66390a6f53 fix(finder): followup to #2442, make sure entry is not nil (#2526)
(cherry picked from commit 19e8a8ae8b)
2023-05-24 17:08:58 +02:00
cristiansofronie be8d87b122 fix: correctly restore cursor position in original window (#2336)
(cherry picked from commit 3f1b57908b)
2023-05-24 17:08:51 +02:00
James Trew f97f4a04f7 fix: previewers & entry maker file encoding (#2430)
(cherry picked from commit c8b65238e8)
2023-05-24 17:08:36 +02:00
Stef a0208d8d60 fix: always add index to entry (#2442)
59497d6 introduced `sorters.fuzzy_with_index_bias`, which gives a
scoring boost to earlier entries.

However, this sorter relies on an `index` key existing for the entry, which is
only populated by the static finder currently. We should set it from the
other finders, too.

This will allow us to use said sorter everywhere. It will also let us
replicate the behaviour of `fzf --tiebreak=index`:

```
  return pickers.new(opts, {
    finder = finders.new_oneshot_job(...)
    sorter = telescope.extensions.fzf.native_fzf_sorter(),
    tiebreak = function(current_entry, existing_entry, _)
      return current_entry.index < existing_entry.index
    end
  }):find()
```

This gives me better results for my "recently opened files" picker.
Other builtin pickers might benefit from this, too.

(cherry picked from commit 0b891ec934)
2023-05-24 17:07:23 +02:00
Juan Barrios b98bc793c4 feat: sorting popup autocomplete items and initial builtin items (#2518)
(cherry picked from commit 8dd1cb2771)
2023-05-24 17:07:01 +02:00
Azad 5caa8ab208 fix(lsp.definitions): compare file uri with targetUri (#2514)
(cherry picked from commit 233cd6ad0d)
2023-05-24 17:06:16 +02:00
Folke Lemaitre 1c951e27e1 fix: icon highlights (broken on nightly) (#2522)
(cherry picked from commit 057ee0f878)
2023-05-24 17:06:01 +02:00
Simon Hauser fccfbbb6a6 fix: opening file starting with a plus (#2509)
(cherry picked from commit ebf93395e7)
2023-05-24 17:05:50 +02:00
Pete Matsyburka a49c3aa977 fix: exclude directories from oldfiles picker (#2485)
(cherry picked from commit 0900f6fcaa)
2023-05-14 22:18:09 +02:00
KevinSilvester ce5cc56dee fix(preview): update mime-type check for json files (#2221) (#2480)
(cherry picked from commit 89c67676a8)
2023-05-14 22:18:03 +02:00
Hoang Nguyen 9b4a1a20c2 fix(pickers): display preview title at the same position as results title for bottom_pane layout (#2494)
(cherry picked from commit d5bef7c52d)
2023-05-14 22:06:28 +02:00
Rishikesh Vaishnav 7bcbbb853d fix: replace default mapping rather than mapping CR directly for history and search pickers (#2506)
(cherry picked from commit 40dc952352)
2023-05-14 22:06:22 +02:00
Nguyễn Văn Đức 341519f545 fix: flex layout strategy configurations error (#2503) (#2504)
(cherry picked from commit 697c64b121)
2023-05-14 22:06:16 +02:00
James Trew 37fa401040 Revert "chore: simplify vimgrep_arguments args (#2440)" (#2488)
This reverts commit cfe6df6257.

(cherry picked from commit d77b37f452)
2023-05-14 21:34:13 +02:00
NAKAI Tsuyoshi 05b42dab55 fix(actions): support commands with special chars (#2224)
(cherry picked from commit 713d26b985)
2023-05-14 21:34:07 +02:00