Commit Graph
100 Commits
Author SHA1 Message Date
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
Hoang NguyenandSimon Hauser 9b4a1a20c2 fix(pickers): display preview title at the same position as results title for bottom_pane layout (#2494)
(cherry picked from commit d5bef7c52d)
2023-05-14 22:06:28 +02:00
Nguyễn Văn ĐứcandSimon Hauser 341519f545 fix: flex layout strategy configurations error (#2503) (#2504)
(cherry picked from commit 697c64b121)
2023-05-14 22:06:16 +02:00
Pooyan KhanjankhaniandSimon Hauser 818ad69723 doc: fix border characters in docs (#2388)
* chore: Fix border characters in comments

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

---------

Co-authored-by: Github Actions <actions@github>
(cherry picked from commit e504cf03c2)
2023-04-09 10:23:54 +02:00
James TrewandSimon Hauser 0077389133 docs: proof-read edits (#2311)
(cherry picked from commit 053f2303c4)
2023-01-22 10:09:23 +01:00
Adam TajtiandSimon Hauser 96c4060084 fix(tests): uses testharness in scrolling strategy (#2307)
(cherry picked from commit cd67e819e4)
2023-01-07 12:34:35 +01:00
TJ DeVriesandSimon Hauser 226d9852c7 fix: restore testing framework to actually work (#2070)
after refactor to some new asynchronous items for finders,
the tests stopped actually doing anything.

now they do things again.

(cherry picked from commit 4725867ec6)
2023-01-07 12:34:11 +01:00
Tsakiris TryfonandSimon Hauser 7408286e67 docs: fix typos/wording (#2283)
(cherry picked from commit a606bd10c7)
2023-01-06 14:35:17 +01:00
Simon HauserandGitHub 5acb9474a0 fix: cursor theme for nvim 0.7 (#2069) 2022-07-12 15:47:39 +02:00
Simon HauserandGitHub 7485b06d58 fix: cursor theme if winbar is set (#2066) 2022-07-12 13:21:19 +02:00
Simon Hauser f838695459 chore: reformat with stylua 0.14.0 2022-07-07 08:27:46 +02:00
julianfandSimon Hauser a0a038170d docs: make_entry and entry_display 2022-07-01 16:59:10 +02:00
Simon HauserandSimon Hauser 83b6cadb2c break: deprecate utils.get_default utils.if_nil (#1545) 2022-06-30 14:01:49 +02:00
fdschmidt93andGitHub 39b12d84e8 feat(entry_display): expose prompt_bufnr opt (#1934)
Required for `vim.ui.input` with file_browser extension
when prompt_bufnr may be left intermittently
2022-05-12 08:39:19 +02:00
Simon HauserandGitHub 831f76a809 docs: add module prefix (#1847) 2022-04-18 08:21:00 +02:00
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
76120285f8 Change center layout strategy to allow vertical anchoring (#1719)
* Change center layout strategy to allow vertical anchoring

Affects `telescope.pickers.layout_strategies.center` that is used by dropdown
(`telescope.themes.get_dropdown()`) theme, allowing more customization for
dropdown theme, i. e. setting it in the top with mirrored preview.

For `anchor` containing `N` or `S` will ignore `mirror` config
and preview will be placed as follows:
- Anchoring for `N` put the preview below the prompt result block.
- Anchoring for `S` put the preview above the prompt result block.

- For horizontal anchoring preview will be placed according to `mirror`.

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

Co-authored-by: Github Actions <actions@github>
2022-03-02 22:05:09 +00:00
2bfc0eb2cf fix: update multi_icon with select/drop/toggle_all actions (#1682)
* fix: `multi_icon` with `select/drop/toggle_all`

* typos

* fix: add check for no caret found

* fix: add check for no line found

* fix: check `max_results` in `Picker:can_select_row`

- also switch order of highlighting in `select/drop/toggle_all` actions

* fix: make `max_results` check a strict inequality

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

* fix: update `prompt_status` on `select/drop/toggle_all` actions

Co-authored-by: Github Actions <actions@github>
2022-01-15 22:27:03 +00:00
Luke KershawandGitHub 948f5adff2 fix: allow selection_caret to be entirely whitespace (#1660) 2022-01-06 13:44:39 +00:00
Luke KershawandGitHub f285599440 feat: multiselect icon (#1572)
* feat: add `multi_icon` option to pickers and corresponding highlight

* feat: allow `multi_icon` to be any length

* fix: adjust `selection_caret` highlighting
2022-01-05 22:42:29 +00:00
Luke KershawandGitHub 5f37fbfa83 feat: layout anchor (#1582)
* feat: add `anchor` option to some `layout_strategies`

* tests: improve tests for `resolve_height/width`
2021-12-10 19:08:24 +00:00
Simon HauserandGitHub 61240ac75a break: bump the minimum required neovim version to 0.6 or higher (#1549)
So we can use `vim.json` and `vim.diagnostics`.

If you aren't able to update to 0.6.* yet you should pin the previous commit.
2021-12-10 16:32:28 +01:00
Luke KershawandGitHub 80cdb00b22 feat: center layout mirror option (#1577) 2021-12-10 11:48:14 +01:00
Luke KershawandGitHub 914da77bb7 fix: bottom_pane remove results border next to prompt (#1563) 2021-12-08 18:28:55 +00:00
Luke KershawandGitHub 0c819d6605 docs: layout strategy usage (#1493) 2021-12-03 15:21:26 +01:00
Luke KershawandGitHub 22e59556f9 chore: layout strategy tidying (#1509) 2021-11-29 10:42:23 +00:00
max397574andGitHub 7cfddbfd93 feat: add preview width option for bottom_pane layout (#1505)
* feat(layout_strategies): started adding preview width for bottom pane

* fix(bottom_pane preview_width): fixed some values and added defualt

* fix(config): better default for preview cutoff

* fix(layout): removed unnecessary variable value
2021-11-28 17:32:50 +00:00
Luke KershawandGitHub 414a7a5b44 feat: extend functionality of entry_display.create (#1408)
* feat: extend functionality of `entry_display.create`

- now allows passing functions or fractional values to `width` option

* refactor: cache `width` instead of results window size

* feat: use new `width` functionality for more entry makers
2021-11-27 16:00:24 +00:00
Luke Kershawandjohnybx edcf07cf88 feat: layout actions (#1383)
Co-authored-by: johnybx <johnybx@users.noreply.github.com>
2021-11-18 19:44:12 +00:00
Julian FrickerandGitHub 6652d4d555 feat: Full width select (#1403)
Can be changed back by setting 
telescope.setup {
  defaults = {
    hl_result_eol = false,
  }
}
2021-11-04 07:22:09 +01:00
Simon HauserandGitHub 0caec3d6e4 Revert "break: changed the results window highlight to always be full width (#1312)" (#1398)
This reverts commit 3b9ac8edba.
2021-10-31 17:02:38 +01:00
Julian FrickerandGitHub 3b9ac8edba break: changed the results window highlight to always be full width (#1312)
Can be changed back by setting 
telescope.setup {
  defaults = {
    hl_result_eol = false,
  }
}
2021-10-29 18:57:41 +02:00
VsevolodandGitHub 782d802d44 fix: missing check for negative index in cycle scrolling (#1372) 2021-10-24 16:01:18 +02:00
Simon HauserandGitHub 50e45f86d9 fix: scroll_strategy limit + sorting_strategy descending (#1322) 2021-10-09 15:23:18 +02:00
koopa1338andGitHub 2dc75704b7 fix: scroll_strategy limit (#1320) 2021-10-09 09:06:52 +02:00
be600b5421 feat: more prompt position strategies (#1280)
* feat: allow `prompt_position` for `vertical` layout strategy

* feat: allow `prompt_position` for `bottom_pane` layout strategy

* stylua

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

* refactor: switch to `string.format`

* stylua

* feat: allow `prompt_position` for `center` layout strategy

* feat: handle user defined `prompt_position` within themes

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

* fix: tweak `center` layout

- ensure `prompt` title is visible when `prompt_position="bottom"`

* fix: refactor `center` tweak

- move title to bottom of picker when `prompt_position="bottom"`

* fix: tweak `bottom_pane` layout

* stylua

Co-authored-by: Github Actions <actions@github>
2021-10-04 21:16:58 +02:00
Luke KershawandGitHub 007b6e3061 fix: adjust layout positioning for new indexing (#1260) 2021-09-19 17:23:37 +01:00
37c9ab6688 feat: layout_strategies refactor (#1039)
* wip: 2021-07-22 15:00 BST

* wip: `horizontal` refactored

* wip: `center` refactored

* wip: `cursor` and `vertical` refactored

* wip: `current_buffer` refactor

- also changed `layout_config_defaults` as they gave errors when using `current_buffer`

* wip: `bottom_pane` refactor

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

* fix: put accidentally remove config option back

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

* wip: standardise `height` calculation for `center` and `bottom_pane`

* wip: improve comments

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

* stylua

- also fix a merge mistake

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

* fix: attempt to fix bad merge

* refactor: remove unused entry in `borderchars` table

- also fix some typos

* wip: tweak padding for `bottom_pane`

* wip: add `tabline` checks to `bottom_pane`

- also tweaked position so that `statusline` is not covered when borders are enabled

* stylua

* refactor: factor out size capping function

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

* fix: adjust tests that relied on height being number of results

* fix: forgot variable in calc_size_and_spacing

* fix: maybe this fixes these tests?

* test: try other plenary branch for ci

* test: switch back to main plenary branch for ci

* fix: actually define `max_results` in the test

* fix: final tweaks for edge cases

Co-authored-by: Github Actions <actions@github>
2021-09-19 09:30:25 +01:00
Simon Hauser 5131df7df1 docs: rewrite readme and add missing config values + builtin opts 2021-09-16 11:12:12 +02:00
TJ DeVriesandGitHub a97af306c4 feat(performance): Major performance improvements using async v2 from @oberblastmeister (#987)
* start: Working w/ async jobs

* short circuit to using bad finder if you pass writer.
2021-08-20 11:11:24 -04:00
Simon HauserandGitHub 79644ab677 chore: use stylua for formatting (#1040)
* chore: stylua job and config

* reformat with stylua
2021-07-23 11:42:37 -04:00
Luke KershawandGitHub d057b10503 fix: check if tabline is present when calculating certain layouts (#1027)
* fix: check if tabline is present when calculating certain layouts

- also tweaks height calculation for `center` strategy

* refactor: remove `center` strategy tweak

- will reimplement something similar in another PR for a few of the strategies

* fix: check if `preview.line` is `nil`

* refactor: factor out `tbln` calculation and `max_lines` adjustment

- also tweaked `vertical` calculations so that no `nil` check is required
2021-07-20 18:15:01 +01:00
Ben SmithandGitHub 87fecbea95 fix for #847 (#1022) 2021-07-18 07:42:23 +00:00
b48a16f866 Mirror option for bottom_pane layout_strategy (#847)
* functional mirror opt for bottom_pane strategy

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

* forgot 'end' to close function

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

Co-authored-by: Github Actions <actions@github>
2021-07-18 07:24:51 +00:00
b13306e5cc feat: add cursor layout (#878)
* Add basic implementation of "cursor" layout strategy

* Update cursor layout strategy to properly follow cursor

* feat(cursor_layout): handle previewer

* Refactor cursor layout code

* Add cursor theme

* Update readme

* Improve cursor theme and layout documentation

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

* Remove trailing whitespace

* Fix issues related with neovim and plugin api changes

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

* Allow preview width to be configured

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

Co-authored-by: Github Actions <actions@github>
Co-authored-by: cbrunel <cbrunel@sogescom.local>
2021-07-16 19:17:21 +01:00
5a53ec5c2f feat: Consistent and sensible layout_config (#922)
* feat: Consistent and sensible layout_config

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

* [WIP]: Thu 17 Jun 2021 03:36:44 PM EDT

* [WIP]: Thu 17 Jun 2021 03:38:11 PM EDT

* layout_default -> layout_defaults

* remove options from bug repot

* Conni2461 suggestions: part 1

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

* Conni2461 suggestions: part 2

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

* Linting

* Improve deprecation checks

- Move `layout_defaults` handling to `deprecated.lua`
- Check for "layout keys" outside of `layout_config` on `setup`

* fixup: Just add a few more words

Co-authored-by: Luke Kershaw <35707277+l-kershaw@users.noreply.github.com>
Co-authored-by: Github Actions <actions@github>
2021-07-01 05:41:58 -04:00
0c1bc129da chore: use plenary.strings and remove strings functions from utils (#690)
Co-authored-by: Simon Hauser <Simon-Hauser@outlook.de>
2021-06-14 20:47:33 +02:00
4da66dab44 feat: add ivy-style layout strategy (#771)
* feat: add new layout strategy

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

Co-authored-by: Github Actions <actions@github>
2021-05-15 15:02:14 -04:00
TJ DeVriesandGitHub 64e59060b1 feat: asyncify pickers - except for live_grep (#709)
* something kind of works already

* yayayayayayayayayayayayayayayayayayayayayayayayayayayayayayayayaya

* use async for everything besides live jobs

* fix: fixup autocmds previewer

* fix: lints for prime

* temp: Add example of how we can think about async sorters

* feat: Allow picker to decide when to cancel

* fix: simplify scoring logic and tests

* fixup: name

* fix: Move back towards more backwards compat methods

* fixup: Remove results from opts

* fixup: remove trailing quote

* fixup: Attempt to clean up some more async items. Next is status

* wip: Add todo for when bfredl implements extmarks over the EOL

* wip

* fixup: got em

* fixup: cleaning

* fixup: docs
2021-04-08 10:35:44 -04:00
TJ DeVriesandGitHub 0b2c801978 feat: buf highlights for current buffer fuzzy find (#732)
* feat: Add buffer highlights from treesitter

* fix: Handle not having tree sitter in some buffers

* fixup

* fixup

* fixup: move back to old node
2021-04-06 19:59:42 -04:00