Commit Graph
1027 Commits
Author SHA1 Message Date
fcyingandSimon Hauser 321d782c1d fix: remove duplicate lazyloaded items in colorscheme (#2951)
(cherry picked from commit 04dfe370b0)
2024-05-20 10:52:06 +02:00
0x7a7aandSimon Hauser d747440d64 fix: select correct results row with sorting_strategy=ascending (#2986)
(cherry picked from commit e9e01d6998)
2024-05-20 10:51:46 +02:00
James TrewandSimon Hauser 6312868392 docs(git_status): add missing opt expand_dir (#2824)
* docs(git_status): add missing opt `expand_dir`

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

---------

Co-authored-by: Github Actions <actions@github>
(cherry picked from commit fa4d663c8c)
2024-03-12 15:16:42 +01:00
James TrewandGitHub d85ad68222 fix(builtin.marks): expand mark path (#2980)
(cherry picked from commit 5550bbb1b6)
2024-03-12 14:24:34 +01:00
James TrewandSimon Hauser 93dc724f38 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

(cherry picked from commit 955e50dfed)
2024-03-06 16:05:54 +01:00
Pedro FerrariandSimon Hauser ec3474b596 fix(git_branch): previewer commit hash dynamic highlighting (#2921)
* Fix highlight of commit hash in git branches preview

* Update lua/telescope/previewers/buffer_previewer.lua

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

---------

Co-authored-by: James Trew <66286082+jamestrew@users.noreply.github.com>
(cherry picked from commit b744cf5975)
2024-03-06 15:55:11 +01:00
Marco De DonnoandSimon Hauser 6d2be79385 fix: do not alter jumplist when jumping to a line in a file (#2910)
(cherry picked from commit 236083884c)
2024-03-06 11:12:43 +01:00
rjooskeandSimon Hauser 199ce5fc25 fix(previewer): buffer previews for term not initially scrolled (#2899)
(cherry picked from commit e54fbf4ab2)
2024-03-06 11:10:50 +01:00
KobuandSimon Hauser 6ee97f1f8b doc(action_state): improve description of action_state.get_current_line (#2895)
(cherry picked from commit f1fd99ebfb)
2024-03-06 11:08:56 +01:00
atusyandSimon Hauser 9594a7eb46 fix(previewer): buffer_previewer_maker now receives all necessary opts everywhere (#2833)
(cherry picked from commit 301505da4b)
2024-03-06 11:08:23 +01:00
James TrewandSimon Hauser 5150bc2693 fix(git_status): support path_display (#2881)
(cherry picked from commit 0902bb39eb)
2024-03-06 11:07:18 +01:00
James TrewandSimon Hauser 72b42a5b80 fix(builtin.oldfiles): cwd matching with special characters (#2860)
`vim.fn.matchstrpos({expr}, {pat})` doesn't handle all characters well
since the pattern (cwd path in this case) is used as a regex pattern.

(cherry picked from commit b3ff5f3320)
2024-03-06 11:03:57 +01:00
James TrewandSimon Hauser 65ee034c35 fix(builtin.buffers): better buffer in cwd check (#2847)
Previously, using `string.find`, certain characters were taken as regex
special characters leading to bad matches.
New approach takes bufname truncated to the length of cwd and compares
the two strings.

(cherry picked from commit 8b56e9bb2d)
2024-03-06 10:46:02 +01:00
James TrewandSimon Hauser 425ab66b3b fix(builtin.buffers): improve only_cwd handling with partial matches (#2845)
closes #2843

Previously, bad partial matches between cwd and target buffer path would
result in non-cwd buffers showing up in the picker despite using
`only_cwd=true`.

eg.
cwd = `/foo/bar`
target buffer = `foo/bar1/baz.txt`
The target buffer starts with the cwd path.

This is fixed by appending a path separator before comparing/matching:
eg.
cwd = `/foo/bar/`
target buffer = `foo/bar1/baz.txt`

(cherry picked from commit c621f71012)
2024-03-06 10:44:30 +01:00
James TrewandSimon Hauser 42bbf5a481 fix(builtin.keymaps): escape newline chars in desc (#2832)
closes #2827

(cherry picked from commit e0651458f2)
2024-03-06 10:40:52 +01:00
Sean MackeseyandSimon Hauser abd9a6f451 fix(which_key): always close on telescope prompt exit
* Add autocmd to make `which_key` window close on prompt exit

Currently `actions.which_key` supports a `close_with_action` option
(default true). When this is set, the `which_key` window will close
after any Telescope action is triggered. This makes sense. However, when
it is false, the `which_key` window remains open even after Telescope
closes. This seems like a bug.

This PR fixes this by setting an autocommand when `close_with_action` is
false to close on prompt exit.

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

* Add autocmd to make `which_key` window close on prompt exit

Currently `actions.which_key` supports a `close_with_action` option
(default true). When this is set, the `which_key` window will close
after any Telescope action is triggered. This makes sense. However, when
it is false, the `which_key` window remains open even after Telescope
closes. This seems like a bug.

This PR fixes this by setting an autocommand when `close_with_action` is
false to close on prompt exit.

---------

Co-authored-by: Github Actions <actions@github>
(cherry picked from commit ae6708a90b)
2024-03-06 10:38:50 +01:00
LiuandSimon Hauser 1bec1c974e fix(builtin.commands): make 0-arg commands be repeatable by @: (#2808)
(cherry picked from commit 9907deaed2)
2024-03-06 10:36:06 +01:00
Will HopkinsandSimon Hauser d90956833d fix: check if cmd extension can be loaded - fix lazy loading of extensions (#2655)
As a last resort if no other cmd is found in `run_cmd`, check
if the command can be loaded as an extension.

(cherry picked from commit a19770625a)
2023-11-28 11:24:00 +01:00
MarskeyandSimon Hauser 2d0e6fd49c fix: async job close not working #2797 (#2798)
(cherry picked from commit 84c5a71d82)
2023-11-28 11:22:30 +01:00
geril2207andSimon Hauser 18be3fbfae fix: split commands while picker is open (#2784)
(cherry picked from commit 18774ec792)
2023-11-28 11:21:29 +01:00
Garry FilakhtovandSimon Hauser d0f095243b 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`.

(cherry picked from commit 4522d7e3ea)
2023-11-28 11:19:08 +01:00
Giuseppe RotaandSimon Hauser fbe2b6c309 fix(actions): set location list title (#2741)
(cherry picked from commit 8c9fd22952)
2023-11-28 11:19:00 +01:00
Simon HauserandSimon Hauser 5263cb6021 fix: always reset prompt highlighting (#2739)
(cherry picked from commit 3a2579e203)
2023-11-28 11:16:52 +01:00
Simon HauserandSimon 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 StankoandSimon Hauser 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 HauserandSimon 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
AIandSimon Hauser 296668f632 fix(lsp): call hierarchy results processing (#2728)
(cherry picked from commit 5a747a9587)
2023-10-11 08:15:42 +02:00
Folke LemaitreandSimon Hauser 2eb23ffa34 fix(actions): fixes folding. Fixes #699 (#2726)
(cherry picked from commit 205f469244)
2023-10-11 08:13:36 +02:00
Yorick PeterseandSimon Hauser 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 MoscofianandSimon Hauser 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 TrewandSimon Hauser 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 CristianandSimon Hauser 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 CristianandSimon Hauser 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 YasushiandSimon Hauser 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 CristianandSimon Hauser 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 WangandSimon Hauser 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
cristiansofronieandSimon Hauser 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 TrewandSimon Hauser c4032ad297 fix(utils): is_uri empty path (#2671)
(cherry picked from commit 83133f66c8)
2023-09-05 16:08:30 +02:00
James TrewandSimon Hauser 30ba3dbdff perf(utils): linear scan is_uri (#2648)
(cherry picked from commit 1dfa66b845)
2023-09-05 16:08:25 +02:00
James TrewandSimon Hauser 92b5e7f90a test(utils): add tests for is_uri (#2645)
(cherry picked from commit 2d92125620)
2023-09-05 16:08:07 +02:00
Alejandro MaturranoandSimon Hauser 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 HenryandSimon Hauser 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 BerezhynskyiandSimon Hauser 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 DeVriesandSimon Hauser 6bc7bd7c60 fix: handle non-file uris for lsp (#2604)
(cherry picked from commit 47c755d737)
2023-09-05 16:04:18 +02:00
Stanislav AsunkinandSimon Hauser 5077c3d6e6 fix: fix builtins lazy loading (#2590)
(cherry picked from commit 0e0600908d)
2023-09-05 16:02:35 +02:00
Nghia Le MinhandSimon Hauser 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 TrewandSimon Hauser 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 TanjimandSimon Hauser 9b54003f5e fix: use :botright modifier for quickfix window open (#2554)
(cherry picked from commit 9a82b5b73e)
2023-06-09 11:28:14 +02:00