Commit Graph
1039 Commits
Author SHA1 Message Date
James TrewandSimon Hauser 7ea9ae5118 build: rework ci tests to include windows (#3011)
(cherry picked from commit 4d4ade7f2b)
2024-05-20 11:18:23 +02:00
James TrewandSimon Hauser b9ea3a2d5f fix(actions): set function name for generate.which_key (#3044)
Using anonymous function is throwing warning "No name available for
anonymous functions" when `action_generate.which_key` is used as shown
in the docs.

(cherry picked from commit 5a701e9990)
2024-05-20 11:14:19 +02:00
gzbfgjf2andSimon Hauser 9ab6aa2a7c fix(marks): preserve uri filenames with path_expand (#3029)
(cherry picked from commit d26b666b45)
2024-05-20 11:13:59 +02:00
James TrewandSimon Hauser f9722f7ee4 test(utils): add unit test for transform_path (#3013)
(cherry picked from commit b22e6f6896)
2024-05-20 11:13:12 +02:00
Edwin TangandSimon Hauser 097a64a166 fix(previewer): preview message out of bounds (#3003)
* fix(set_preview_message): check line height of previewer before setting message.

* style: run changed file through stylua and remove unused variable.

* refactor: change lines table instead. check max between line_pos and 0

* style: run changed file through stylua.

(cherry picked from commit c2b8311dfa)
2024-05-20 11:11:57 +02:00
James TrewandSimon Hauser d7d32a3850 fix(utils.path_expand): improve windows support (#2999)
In order to maintain plenary compatibility (for now, and slightly for
other edgecase reasons), avoid converting backslashes to forward
slashes.

(cherry picked from commit 1e59188575)
2024-05-20 11:11:14 +02:00
James TrewandSimon Hauser ce398bcdc8 fix(previewer): don't escape paths for fs_stat (#2996)
`vim.loop.fs_stat` takes file paths literally so no escaping special
characters are need (eg spaces, `$`, etc)

(cherry picked from commit 221778e93b)
2024-05-20 11:10:16 +02:00
James TrewandSimon Hauser d5fe96ec8a fix: expand/normalize paths more selectively (#2628)
(cherry picked from commit 3b8399c273)
2024-05-20 11:10:12 +02:00
James TrewandSimon Hauser 48960a8164 fix(builtin.lsp): bad check for jump_type option (#2991)
(cherry picked from commit c816406bd5)
2024-05-20 10:55:29 +02:00
James TrewandSimon Hauser 6d61c905ee fix(builtin.lsp): extra No Name buffer opening with jump_type (#2990)
(cherry picked from commit 5730b950d9)
2024-05-20 10:54:30 +02:00
James TrewandSimon Hauser 332465c706 docs(builtin.colorscheme): add colors option desc (#2989)
* docs(builtin.colorscheme): add `colors` option desc

* docgen plz

(cherry picked from commit 1fa3b801f0)
2024-05-20 10:52:19 +02:00
James TrewandSimon Hauser 391581dd26 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.

(cherry picked from commit 8cd58c6e81)
2024-05-20 10:52:13 +02:00
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