Commit Graph

102 Commits

Author SHA1 Message Date
Tristan Knight
37dc9233a4 fix: add shim for vim.lsp.util._str_byteindex() (#3338)
Will be removed in Nvim 0.11: https://github.com/neovim/neovim/pull/30915
2024-10-26 16:33:10 +02:00
Christian Clason
eae0d8fbde fix(treesitter): adapt to upstream change (#3308)
In Nvim 0.11, `vim.treesitter.language.add()` returns `true` on success
or `nil,errmsg` on failure instead of throwing an error.
2024-09-30 08:56:14 +02:00
Simon Hauser
ae4420758e chore: don't construct add offset every time merge_styles is called (#3169) 2024-06-15 15:13:06 +02:00
Anton
25f04509f7 feat: refactors transform_path and allow smart to be used in conjunction with filename_first (#3152) 2024-06-15 14:57:24 +02:00
xudyang1
349660c0d3 fix(pickers): improve CRLF line splitting support for windows (#3127)
* fix(help_tags): show help tags on windows (#3126)

On Windows, `builtin.help_tags` picker does not show any help tags.

To fix this, the following changes are needed:

1. `util.path_tail` checks unix separator `/` on Windows and leave the
original implementation intact on unix systems.

2. Line endings should be taken carefully on Windows. `vim.split` with
   only newline `\n` character as separator may result in unexpected
   crash when parsing large files. When splits on lines are needed, call
   it with `\r?\n`, or even set up a wrapper function in utils is more
   prefered.

Fixes #3126

* fix: handle cross platform line splits
2024-05-26 14:15:31 +00:00
Christian Clason
0c12735d5a fixup: adapt to deprecations in Nvim 0.10 (#3113)
vim.iter.flatten() is not a full replacement (does not support arrays
with `nil`); a fix may be backported but for now only use it on nightly
(0.10 has no warnings yet).
2024-05-17 20:02:19 +02:00
Christian Clason
bbdbb7593f fix: adapt to Nvim deprecations in 0.10 (#3109) 2024-05-17 14:39:12 +02:00
Michael
35f94f0ef3 feat: expand path_display function return type (#3074)
* feat: support path_style in path_display option

* docs: document second value

* tests: add test

* tests: handle function in assert_path

* docs: more explanation

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

---------

Co-authored-by: James Trew <66286082+jamestrew@users.noreply.github.com>
2024-04-26 00:25:42 +00:00
James Trew
7d1698f3d8 fix(utils): transform_path always return styling (#3067)
* fix(utils): transform_path always return styling

* fix docs/type hints

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

---------

Co-authored-by: Github Actions <actions@github>
2024-04-21 02:14:52 +00:00
Anton
ef75145f80 fix(utils): transform_path filename_first composability (#3065)
* Moves filename_first to last position to fix issues with composing other options

* Adds comment
2024-04-20 22:59:36 +00:00
Anton
a4432dfb9b feat(entry_maker): add 'filename_first' option for path_display (#3010)
* Initial commit

* Fixes issue with find_files where devicons where disabled

* Fixes issue with vimgrep where devicons where disabled

* Fixes trailing space for path with only a file name

* Adds test for reverse path_display

* Refactors reverse to filename_first

* Adds tests

* Fixes highlighting

* Fixes linting issues

* Uses trim function

* Fixes issue with highlighting

* Moves local function to utils

* Removes redundant code

* Adds highlighting for gen_from_buffer

* fix formatting

---------

Co-authored-by: alycklama <>
Co-authored-by: James Trew <j.trew10@gmail.com>
2024-04-20 04:21:35 +00:00
James Trew
4d4ade7f2b build: rework ci tests to include windows (#3011) 2024-04-13 17:27:53 +02:00
gzbfgjf2
d26b666b45 fix(marks): preserve uri filenames with path_expand (#3029) 2024-04-05 01:03:48 +00:00
James Trew
b22e6f6896 test(utils): add unit test for transform_path (#3013) 2024-03-28 03:39:14 +00:00
James Trew
1e59188575 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.
2024-03-23 03:56:56 +00:00
James Trew
3b8399c273 fix: expand/normalize paths more selectively (#2628) 2024-03-19 22:55:27 +00:00
James Trew
d8129bf9f0 fix(pickers): when no lnum given, don't set entry.lnum (#2865)
Fixes couple of regressions from #2791 when no line number info is given
in the prompt (eg. `file.txt` rather than `file.txt:10`).

Both issues stemming from the fact that when no line number info is
given, the `entry.lnum` was set to `0`. `entry.lnum` is 1-index.
- Sending results to quickfix would send faulty results (closes #2864)
- Will no open the file on the correct (previous) line number

For this, setting the lnum to 1 is still undesirable since this
overwrites the lnum priority handling in the `select` action.
2024-01-12 03:35:52 +00:00
Dmitriy Kovalenko
0bf09d05ab feat: Support Line Column in file pickers (#2791)
This implements a experimental interface for allowing prompts like this `file.txt:3:4`. It is already enabled on default for `find_files` and `git_files`.

Be wary of breaking changes for the interface if you plan to manually enable it.
2024-01-09 09:35:26 +01:00
Munif Tanjim
84d53dfdbe feat(pickers): fully customizable layout (#2572) 2023-09-27 08:34:22 +02:00
Sofronie Cristian
74be3c3bba 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.
2023-09-03 20:42:09 +00:00
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
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
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
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
Christian Clason
d8c5ed4e40 feat(ts)!: use upstream treesitter implementation (#2499)
bumps minimum required neovim version to 0.9, see `help telescope.changelog-2499`
2023-05-24 10:43:04 +02:00
James Trew
c20d4fb592 fix: icon hl width for various pickers (#2450) 2023-04-09 10:04:20 +02:00
Maksym Klishevych
942fe5faef feat(treesitter): symbols & ignore symbols options (#2338)
* feat(treesitter): symbols & ignore symbols options

* renamed the function passed to utils.filter_symbols

---------

Co-authored-by: Maksym Klishevych <max@klishevy.ch>
2023-03-22 09:49:55 -04:00
James Trew
053f2303c4 docs: proof-read edits (#2311) 2023-01-22 09:57:53 +01:00
Simon Hauser
361a172fce fix: icons with multiple dots but without custom overrides (#2256) 2022-12-02 10:21:44 +01:00
Mat Jones
f37c603303 feat: support for multi-part file extensions like *.test.js (#2252) 2022-12-01 19:20:52 +01:00
Antoine Bertin
5fadc247c5 fix: selected icon highlight with color_devicons to false (#2187) 2022-10-08 09:10:26 +02:00
Simon Hauser
5f25375191 chore: remove deprecated functions / messages (#2063) 2022-07-12 13:24:23 +02:00
Simon Hauser
f838695459 chore: reformat with stylua 0.14.0 2022-07-07 08:27:46 +02:00
Charles Moscofian
b44e657986 fix(path_display): allow function on path_display (#2043) 2022-07-06 08:29:15 +02:00
Simon Hauser
1ba967f84e fix: truncate for builtin.buffers
fix #2022
2022-06-30 14:29:57 +02:00
Simon Hauser
83b6cadb2c break: deprecate utils.get_default utils.if_nil (#1545) 2022-06-30 14:01:49 +02:00
Simon Hauser
edc6f55ba2 docs: document limitations of file_ignore_patterns and transform_path (#1955) 2022-06-30 14:01:49 +02:00
zeertzjq
d96eaa914a fix: block autocommands when setting preview buffer (#2010)
Telescope creates most floating windows with `noautocmd = true`, so
these windows do not trigger autocommands, but preview buffer is set in
window using `nvim_win_set_buf()`, which triggers buffer autocommands.
This may be unwanted, so block them using 'eventignore'.
2022-06-15 10:43:10 +02:00
xeluxee
20040cac31 fix: correctly use nvim-web-devicons (#1937)
Also performance improvements for utils.path_tail
2022-05-15 21:58:03 +02:00
fdschmidt93
d88094fbfd feat: show assigned function in actions.which_key (#1871) 2022-04-22 15:52:22 +02:00
Antoine Bertin
6e7ed1b963 feat: add default hl group for devicons (#1849) 2022-04-18 14:05:57 +02:00
tami5
ef7b6ada6d feat: improve UX with vim.notify (#1763)
* fix(notify): don't report request on new line

* ref(notify): update message format

* ref(msgs): always quote values + decrease duplication

* fix(ci): undefined variables

* ref(actions): temporary silent actions.__index errors

* cleanup

* revert: panic effort, we continue to use error for those

Co-authored-by: Simon Hauser <Simon-Hauser@outlook.de>
2022-03-13 18:11:27 +01:00
Simon Hauser
75b5730432 chore: delete unused functions (#1788)
* chore: delete unused functions

* chore: remove unused file

No one needs this WIP file as well. We already have all these pickers
implemented in a better way
2022-03-13 07:31:37 +01:00
tami5
ddb9e56160 feat(lsp): ignore_symbols option (#1745)
Co-authored-by: Simon Hauser <Simon-Hauser@outlook.de>
2022-03-11 14:41:48 +01:00
Simon Hauser
802fe5d49e fix: transform_path nil input (#1576) 2021-12-27 09:49:07 +01:00
Simon Hauser
56325fefb2 feat: migrate to Telescope diagnostics using vim.diagnostic (#1553) 2021-12-10 17:49:06 +01:00
johnybx
b952c2f852 feat: add hide / unhide preview (#1305)
* feat: add hide / unhide preview or results and prompt

* fix edit actions while only preview window is active

* add option to start telescope without previewer -> "disable_previewer_at_startup"

* remove hide / unhide prompt and resutls, improve hide / unhide preview

* fix tests - check if popup window should be created with borders - popup.create does not support setting borderhighlight and border=false

* allow toggle preview even if preview is set to false

* reuse recalculate_layout in hide / unhide preview

* add docs to toggle preview

* check if preview window is valid window

* remove unnecessary changes

* cleanup, remove unnecessary changes

* close all previewers, refactor toggle preview code

[docgen] Update doc/telescope.txt
skip-checks: true
2021-11-18 19:44:12 +00:00