Commit Graph
235 Commits
Author SHA1 Message Date
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
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
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
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
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
Simon HauserandSimon 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
cristiansofronieandSimon Hauser be8d87b122 fix: correctly restore cursor position in original window (#2336)
(cherry picked from commit 3f1b57908b)
2023-05-24 17:08:51 +02:00
Andrii BerezhynskyiandSimon Hauser c3b992ceba fix: preview cycling and titles work after :Telescope resume (#2422)
(cherry picked from commit 10ebb30f0d)
2023-04-09 10:23:10 +02:00
Simon HauserandSimon Hauser 5d02292286 fix: previewer = true (#2395)
(cherry picked from commit 3915d933dc)
2023-02-20 15:51:56 +01:00
SultanahamerandSimon Hauser be2aba7464 fix: wrap_results option breaking scrolling of results window (#2322)
(cherry picked from commit 3d8bd0a105)
2023-02-19 14:10:16 +01:00
Josa GesellandSimon Hauser 0b4e54e86b fix: execute autocmds correctly (#2375)
(cherry picked from commit e572c63c7d)
2023-02-19 14:09:24 +01:00
AkiandSimon Hauser 7bad079d46 fix(pickers): always redraw when screen is resized (#2140)
Due to regression from switching
to lua autocmd api pickers
 were resized only once.

(cherry picked from commit 3e944f02ff)
2022-08-26 15:27:51 +02:00
Jonas StrittmatterandSimon Hauser 028dc2799d chore: reduce log level to trace in pickers.lua (#2124)
(cherry picked from commit c6cd725bc0)
2022-08-13 11:06:07 +02:00
Simon HauserandGitHub 4ab56d215a perf: limit scrolling size (#2059) 2022-07-12 09:46:51 +02:00
Simon Hauser f838695459 chore: reformat with stylua 0.14.0 2022-07-07 08:27:46 +02:00
Fabian David SchmidtandSimon Hauser ef9137d85c feat: refine with new_table 2022-07-01 18:13:25 +02:00
Simon HauserandSimon Hauser 25b1bc8f17 feat: clear previewer if no item is selected (#2004) 2022-06-30 14:01:52 +02:00
TheMeaningfulEngineerandSimon Hauser a6c9ae088e feat: force buffer delete for terminal and improvements for Picker:delete_selection (#1943) 2022-06-30 14:01:50 +02:00
Simon HauserandSimon Hauser 83b6cadb2c break: deprecate utils.get_default utils.if_nil (#1545) 2022-06-30 14:01:49 +02:00
fdschmidt93andSimon Hauser a1aec79cb1 feat: none strategy & control attachment (#1867) 2022-06-30 14:01:49 +02:00
Fabian David SchmidtandGitHub ad19bf6b8e fix: cursor move in actions.insert_symbol_i (#1979) 2022-06-01 16:52:15 +02:00
fdschmidt93andGitHub b4c45e8c61 fix: exiting picker from insert mode (#1202) 2022-05-20 09:18:27 +02:00
3cc44f8f05 fix: set tagstack when we jump with lsp in telescope (#1887)
Co-authored-by: Simon Hauser <Simon-Hauser@outlook.de>
2022-05-18 19:59:12 +02:00
TJ DeVriesandGitHub 0b5f1d69d7 feat: Add ability to choose window to edit (#745) 2022-05-15 22:08:16 +02:00
Simon HauserandGitHub 4681dcdffe fix: another teardown issue (#1918) 2022-05-05 10:05:37 +02:00
fdschmidt93andGitHub c93276acd3 fix: initial mode setting issues (#1917) 2022-05-04 15:00:28 +02:00
fdschmidt93andGitHub 80e4313cc8 Revert "fix(pickers): misc initial_mode setting fixes (#1895)" (#1914)
Reverts circumventing A for initial_mode insert as many more users have issues with the current (failed attempt at a) fix
2022-05-03 18:36:45 +02:00
fdschmidt93andGitHub e454a0ad37 fix(pickers): misc initial_mode setting fixes (#1895) 2022-05-03 08:53:22 +02:00
Simon HauserandGitHub 544c5ee407 fix: termopen previewer (#1901)
- buffer leaking
- still insert mode on confirm
2022-05-01 09:46:50 +02:00
fdschmidt93andGitHub 4449f709c3 fix(finder): don't trigger twice w/ inital_mode="insert" (#1886) 2022-04-27 12:33:49 +02:00
Simon Hauser 2b8c7b1ec7 fix: prompt now has always buftype prompt
fix #1882
2022-04-26 08:49:16 +02:00
Dave LageandGitHub 697ee7aa70 feat: lua autocmd (#1707) 2022-04-22 16:20:59 +02:00
cc1a3440f9 fix: fix keep insert when going from telescope window to telescope window (#1600)
Also fixes `initial_mode`

Co-authored-by: Simon Hauser <Simon-Hauser@outlook.de>
2022-04-22 16:13:32 +02:00
fdschmidt93andGitHub 92019d5053 fix: extra finder loop on refresh w/ reset prompt (#1860) 2022-04-20 20:34:39 +02:00
Simon Hauser 66c3e2a351 fix: error if telescope is being opened from command-line window
This is impossible see `:help E11`
Close #1810
2022-04-17 16:32:47 +02:00
Simon HauserandGitHub c8ef91a052 fix: displayer when tabs are used and ts is != 1 (#1845) 2022-04-17 15:59:46 +02:00
Joshua CaoandGitHub 8af0d384d2 fix: save position into jumplist before 'edit' action (#1234)
currently enabled for some builtins. You can manually enable it by adding `push_cursor_on_edit = true` to the builtin options. But feel free to open a PR if you find a builtin that needs this option enabled.
2022-04-08 20:09:58 +02:00
Michael BenfordandGitHub 317371d37c feat: global configuration of results_title and prompt_title (#1817) 2022-04-08 18:17:54 +02:00
Simon Hauser 40c1e88904 chore: fix lint errors from latest ci run 2022-03-26 10:25:47 +01:00
Simon Hauser df303e12e0 hotfix: scrolling should work correctly again 2022-03-13 20:21:14 +01:00
Simon HauserandGitHub 2532b98d67 fix: selection strategy madness if its not set to reset (#1559)
* fix: selection strategy madness when its not row

* fix: selection_strategy row
2022-03-13 20:04:32 +01:00
Simon HauserandGitHub 9f0dd2e402 fix: action mt again (#1487)
actions should be concatinable again
2022-03-13 19:22:16 +01:00
c5bf83dc61 fix: allow Number type should be allowed for option keys (#1782)
* Number type should be allowed for option keys

Some extension (e.g. `dap`) use integer numbers for their selector
options instead of strings. Before this commit, the interface for these
plugins breaks when using `ui-select` with a stack trace like the
following:

Error detected while processing function StartDebugger:
line   33:
E5108: Error executing lua .../telescope.nvim/lua/telescope/pickers.lua:1359: Should be string, found: number
stack traceback:
        [C]: in function 'assert'
        .../.vim/bundle/telescope.nvim/lua/telescope/pickers.lua:1359: in function 'new'
        ...e-ui-select.nvim/lua/telescope/_extensions/ui-select.lua:22: in function 'pick_one'
        .../nvim-dap/lua/dap/ui.lua:32: in function 'pick_if_many'
        .../nvim-dap/lua/dap.lua:225: in function 'select_config_and_run'
        .../nvim-dap/lua/dap.lua:551: in function 'continue'
        [string ":lua"]:1: in main chunk

* style

Co-authored-by: Simon Hauser <Simon-Hauser@outlook.de>
2022-03-11 12:49:55 +01:00
Tor BratsbergandGitHub 6d5634b477 fix: error on toggling selection with empty picker (#1786) 2022-03-10 21:23:27 +01:00
SultanahamerandGitHub df0b35c8bc feat: allow user to wrap picker results (#701, #1296) (#1735) 2022-02-15 08:51:56 +01:00
Luke KershawandGitHub 1ec682b29d fix: always update preview when _selection_entry changes (#1693) 2022-01-18 07:45:03 +01:00