Commit Graph

1223 Commits

Author SHA1 Message Date
James Trew
a5b69afa48 refactor(lsp): consolidate some picker jump logic (#2935) 2024-02-23 03:15:55 +00:00
Pedro Ferrari
b744cf5975 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>
2024-02-17 01:44:31 +00:00
Anton Kastritskii
45d61cc8da fix(builtin.current_buffer_fuzzy_find): manually go through highlighted chars to pick smallest one (#2922) 2024-02-15 13:54:21 +00:00
Anton Kastritskii
fac5da839e feat(builtin.current_buffer_fuzzy_find): jump to first matched char (#2909)
* feat(builtin.current_buffer_fuzzy_find): jump to first matched char

* use highlighter to detect column to jump to

* replace default select

* handle non 0 based column index

* handle no highlight scenario

---------

Co-authored-by: James Trew <j.trew10@gmail.com>
2024-02-15 02:01:13 +00:00
Tyler Miller
eb88dc6434 feat(builtin.autocommands): support jumping to lua callback src (#2916) 2024-02-14 03:00:33 +00:00
James Trew
0f865f17af fix(action): horizontal scroll after preview toggling (#2915) 2024-02-09 02:38:30 +00:00
Marco De Donno
236083884c fix: do not alter jumplist when jumping to a line in a file (#2910) 2024-02-04 21:37:33 +00:00
rjooske
e54fbf4ab2 fix(previewer): buffer previews for term not initially scrolled (#2899) 2024-01-29 18:11:46 +00:00
James Trew
2f3857c25b feat(mappings): allowing passing desc to mappings (#2892) 2024-01-27 14:00:48 +01:00
Kobu
f1fd99ebfb doc(action_state): improve description of action_state.get_current_line (#2895) 2024-01-27 13:52:55 +01:00
James Trew
1bfbb1fb5c Revert "doc(layout_strategies): document shared options for bottom_pane" (#2893) 2024-01-25 03:56:32 +00:00
atusy
301505da4b fix(previewer): buffer_previewer_maker now receives all necessary opts everywhere (#2833) 2024-01-23 23:36:00 +01:00
James Trew
36dce6261a doc(layout_strategies): document shared options for bottom_pane (#2887)
* doc(layout_strategies): document shared options for `bottom_pane`

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

---------

Co-authored-by: Github Actions <actions@github>
2024-01-23 03:13:22 +00:00
James Trew
0902bb39eb fix(git_status): support path_display (#2881) 2024-01-21 01:50:21 +00:00
James Trew
24778fd72f feat(picker): allow appending original window cword to prompt (#2878)
* feat(picker): allow appending original window cword to prompt

* add default mapping and document

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

* add mapping to README

also format README

* oops

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

---------

Co-authored-by: Github Actions <actions@github>
2024-01-20 02:38:27 +00:00
Simon Hauser
9cf58f438f fix(config)!: fallback to vim.o.winblend (#2861) 2024-01-18 11:45:02 +01:00
Sebastian Lyng Johansen
b4befa1c2f fix: fallback to filetype for get_lang for treesitter highlighting (#2867) 2024-01-18 11:43:26 +01:00
Arne Van Maele
da8b3d4859 feat(builtin.oldfiles): support file location opening (#2863) 2024-01-12 03:53:31 +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
James Trew
b3ff5f3320 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.
2024-01-11 02:02:29 +00:00
James Trew
5550bbb1b6 fix(builtin.marks): normalize mark path (#2859) 2024-01-11 01:38:09 +00:00
JD
4367e05c06 fix(builtin)!: quickfix entry maker does not used fixed width for file (#2842) 2024-01-09 10:14:24 +01:00
taeruh
03681adde1 fix(builin.grepstring): use 'normal!' instead of 'normal' (#2852) 2024-01-09 09:39:44 +01: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
James Trew
87e92ea31b chore(debounce): update type annotations to use LuaCATS (#2848) 2024-01-04 16:24:19 +00:00
James Trew
8b56e9bb2d 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.
2024-01-04 03:18:39 +00:00
James Trew
c621f71012 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`
2024-01-04 00:49:03 +00:00
Sultanahamer
983460fb8c fix(picker): correctly apply wrap_results option (#2840)
Co-authored-by: sultanm <sultanm@sultanms-MacBook-Pro.local>
2024-01-03 14:03:36 +00:00
James Trew
3466159b0f fix(builtin.colorscheme): get current colorscheme (#2837) 2023-12-29 01:18:41 +00:00
James Trew
e0651458f2 fix(builtin.keymaps): escape newline chars in desc (#2832)
closes #2827
2023-12-27 17:21:05 +00:00
James Trew
aacaa9cd03 refactor(colorscheme): clean up vim.cmd colorscheme calls (#2830) 2023-12-27 01:50:20 +00:00
James Trew
c0ee29e8e4 refactor(git_status): clean up prompt retrieval for on_complete (#2829)
relevant #2825
2023-12-26 20:54:54 +00:00
Sean Mackesey
ae6708a90b 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>
2023-12-25 21:01:16 +00:00
James Trew
bccedaf88b fix(git_status): keep picker open with no matches (#2825)
Previously, `git_status` with a prompt that has zero matches closes the
picker.

Only automatically close the picker if working tree is completely clean.
If working tree is not clean, and a prompt is given but no matches are
found, keep the picker open. This behavior is consistent with other
pickers where lack of matches doesn't result in the picker closing.

closes #2815
2023-12-25 19:17:41 +00:00
James Trew
fa4d663c8c 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>
2023-12-25 16:45:01 +00:00
Liu
9907deaed2 fix(builtin.commands): make 0-arg commands be repeatable by @: (#2808) 2023-12-24 19:25:02 +00:00
Ahmni Pang-Johnson
f336f8cfab feat(mappings): add horizontal scrolling to normal mode defaults
Co-authored-by: Ahmni Pang-Johnson <ahmnii@amazon.com>
2023-12-19 23:58:36 +00:00
LUCIANO FURTADO
6213322ab5 feat(builtin.git_status): convert to async finder
Avoids timeout issues in large git repos.
2023-12-06 03:50:38 +00:00
Brian Mayo
3f5f165447 feat(buffers): add buffers_sort option (#2793)
* refactor: add sort_buffers option to buffers picker

* refactor: validate sort_buffers opt is a function
2023-12-03 21:24:07 +03:00
Liu
5f18f3dc51 fix(action): ensure delete_mark handles uppercase marks
* fix(action): delete_mark can not delete an uppercase named mark which
not in the current buffer

* Update init.lua

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

* format and lint

---------

Co-authored-by: James Trew <66286082+jamestrew@users.noreply.github.com>
Co-authored-by: James Trew <j.trew10@gmail.com>
2023-12-02 22:01:46 +00:00
Marskey
84c5a71d82 fix: async job close not working #2797 (#2798) 2023-11-27 19:50:22 +01:00
Chen Lu
e4c62dedd7 feat(actions): add delete_mark (#2769)
* feat(actions): add delete_mark

* style(init.lua): fix formatting
2023-11-26 03:37:50 +00:00
geril2207
18774ec792 fix: split commands while picker is open (#2784) 2023-11-16 02:12:34 +00:00
Carlos Afonso
b6edf826b4 fix(preview): allow arbitrary horizontal scrolling (#2787) 2023-11-16 01:26:52 +00:00
James Trew
721cdcae13 chore: fix marks picker options (#2783)
* chore: fix marks picker options

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

---------

Co-authored-by: Github Actions <actions@github>
2023-11-15 03:47:37 +00:00
LUCIANO FURTADO
4e77d1991d feat(marks): add support for displaying marks according to the mark_type (#2775)
* Fixes: #2763

* clean up docs type annotations

---------

Co-authored-by: LUCIANO FURTADO <l.furtado@f5.com>
Co-authored-by: James Trew <j.trew10@gmail.com>
2023-11-15 02:42:17 +00:00
Hicro
20bf20500c fix: nil problem when jump to location when tab drop is set as jump_type (#2760)
* feat(lsp_definitions): adding `tab drop` as `jump_type`

* feat(lsp-jump-types): `tab drop` for LSP features

Now, you're able to use `tab drop` as `jump_type` for these LSP
features: references, type definitions, definitions an implementations.

* fix(docs): reordering `tab drop` option

* feat: generate docs

* fix: nil problem with `vim.uri_to_fname`

* fix: removing warning about `file_uri` variable not being used

---------

Co-authored-by: Simon Hauser <simon.hauser@helsinki-systems.de>
2023-11-06 02:06:57 +00:00
Garry Filakhtov
4522d7e3ea 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`.
2023-10-23 14:19:17 +02:00
Giuseppe Rota
8c9fd22952 fix(actions): set location list title (#2741) 2023-10-23 09:57:47 +02:00
Simon Hauser
3a2579e203 fix: always reset prompt highlighting (#2739) 2023-10-23 09:45:01 +02:00