Commit Graph

1405 Commits

Author SHA1 Message Date
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
Matteo Golin
207285ccec Fixed small typo. (#2665) 2023-08-26 01:52:14 +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
Yifan Hu
31b05ad3c3 fix: autocmd example in README (#2635) 2023-08-05 19:31:19 +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
Andrii Berezhynskyi
597a3cc889 fix: do not ignore mappings from setup() when attach_mappings provided (#2613) 2023-07-21 09:28:26 -04:00
TJ DeVries
47c755d737 fix: handle non-file uris for lsp (#2604) 2023-07-17 13:20:09 -04:00
James Trew
2ea8dcd17b feat(git): support detached working trees (#2597)
* feat(git): support detached working trees

closes #2595

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

* fix: use_file_path

---------

Co-authored-by: Github Actions <actions@github>
2023-07-14 17:12:03 +00:00
Folke Lemaitre
276362a802 feat(lsp): added support for dynamic capabilities (#2594) 2023-07-06 18:30:43 -04:00
Stanislav Asunkin
0e0600908d fix: fix builtins lazy loading (#2590) 2023-07-02 21:51:55 +02:00
James Trew
b14de80d1c refactor(previewer): clean up file_maker (#2585)
- split apart functions
- replace magic numbers with named constants
- reorganize functions for better grouping
2023-07-01 17:57:00 +00:00
James Trew
c5b11f4fe7 docs: update install instructions with latest tag (#2587)
tag 0.1.1 -> 0.1.2
2023-06-30 16:39:57 +00:00
Frantisek Stanko
e651c37317 docs: fix the branch example for lazy.nvim (#2586)
The previous values were incorrect. The new values reflect the correct
way of using the branch, as showcased in the previous examples.
2023-06-29 09:24:41 -04:00
Oscar
6074847b6e Fix tagrelative option not considered in builtin.tags (#2583)
* Fix tagrelative option not considered in builtin.tags

* Fix wrong notify name

* ctags filtering with grep or rg and normalize path

* pass stylua check

---------

Co-authored-by: James Trew <j.trew10@gmail.com>
2023-06-25 19:16:15 +00:00
Nghia Le Minh
219584a6ef 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>
2023-06-24 22:11:35 +00:00
Lucía Andrea Illanes Albornoz
5fff2a138b Implements horizontal scrolling in previewer & results. (#2437)
* Implements horizontal scrolling in previewer & results.

* docs: update wrt. horizontal scrolling in previewer &  results
2023-06-24 19:17:55 +00:00
James Trew
ffe35cb433 fix(live_grep/grep_string): support non-utf8 patterns (#2570) 2023-06-21 21:25:35 +00:00
Simon Hauser
00cf15074a fix(previewer): dont treat unknown filetypes as binary file (#2567) 2023-06-13 02:09:13 +00:00
Liam Jarvis
37c5268578 fix(previewer): Cast filepath to string before matching for filetype (#2565) 2023-06-11 08:31:19 +02:00
Simon Hauser
89ca726572 refactor(previewer): remove with_preview_window (#2563) 2023-06-10 21:01:23 +02:00
Simon Hauser
116dbea580 fix(previewer): call fthook after we determined the filetype (#2560) 2023-06-10 15:55:43 +02:00
Simon Hauser
69e8715786 fix(previewer): only run ftdetect for files (#2559) 2023-06-09 18:51:17 +02:00
Simon Hauser
8c998877f1 fix(previewer): ft detect for filetypes defined as functions (#2557) 2023-06-09 12:42:21 +02:00
Simon Hauser
66b03e7740 feat!(previewer): replace plenary.filetype with vim.filetype.match (#2529) 2023-06-09 11:24:52 +02:00
Simon Hauser
42267407ae fix(actions): which_key after mappings rework (#2556) 2023-06-08 23:10:26 +02:00
Simon Hauser
991d5db624 refactor(mappings): use vim.keymap and remove __TelescopeKeymapStore (#2551) 2023-06-08 20:28:10 +02:00
Munif Tanjim
9a82b5b73e fix: use :botright modifier for quickfix window open (#2554) 2023-06-07 23:54:23 +00:00
Kalmander
be49680937 fix(registers): add small delete remove black hole (#2553)
Co-authored-by: Tryggvi Kalman <tryggvikalman@protonmail.com>
2023-06-07 14:59:50 +02:00
Simon Hauser
9e3922f628 fix(mappings): expr for insert mode (#2458) 2023-06-07 11:29:57 +02:00
Zhanibek Adilbekov
333966610c fix(bcommits): wrong selection field is used (#2550) 2023-06-07 11:17:57 +02:00
Simon Hauser
6d3fbffe42 Revert "feat!: allow full height, width by resolving 1 as a percentage rather than absolute val (#2525)"
This reverts commit 066bda8ea4.
2023-05-25 07:44:39 +02:00
Simon Hauser
9cb9648a39 Revert "fix: entry_display width 1, followup to #2508 (#2530)"
This reverts commit 9609686a8c.
2023-05-25 07:44:39 +02:00
Simon Hauser
eb95a31836 Revert "fix: correctly restore cursor position in original window (#2336)" (#2538)
This reverts commit 3f1b57908b.
2023-05-25 07:43:19 +02:00
Simon Hauser
ff8ed2351f fix: make sure that prompt_win is valid bevore closing it (#2533) 2023-05-24 22:15:59 +02:00
Pijus Navickas
109a183045 fix: prevent pfiletype from failing when bufname is nil (#2531)
* Prevent pfiletype from failing when bufname is nil

* Fix code style
2023-05-24 21:42:29 +02:00
Simon Hauser
e943f93a6a fix: make sure buf is valid before updating highlighting (#2524) 2023-05-24 20:28:55 +02:00