Commit Graph

60 Commits

Author SHA1 Message Date
Ronan Dalton
19584e666f fix(layout_strategies): odd flex layout default behavior, previewer hidden at certain widths (#3148) 2024-06-15 15:25:51 +02:00
James Trew
1bfbb1fb5c Revert "doc(layout_strategies): document shared options for bottom_pane" (#2893) 2024-01-25 03:56:32 +00: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
Yorick Peterse
5c91b855b8 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.
2023-09-27 02:41:34 +00:00
Hoang Nguyen
d5bef7c52d fix(pickers): display preview title at the same position as results title for bottom_pane layout (#2494) 2023-05-14 21:45:36 +02:00
Nguyễn Văn Đức
697c64b121 fix: flex layout strategy configurations error (#2503) (#2504) 2023-05-14 21:44:37 +02:00
Pooyan Khanjankhani
e504cf03c2 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>
2023-03-21 13:44:50 -04:00
James Trew
053f2303c4 docs: proof-read edits (#2311) 2023-01-22 09:57:53 +01:00
Simon Hauser
5acb9474a0 fix: cursor theme for nvim 0.7 (#2069) 2022-07-12 15:47:39 +02:00
Simon Hauser
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
Simon Hauser
83b6cadb2c break: deprecate utils.get_default utils.if_nil (#1545) 2022-06-30 14:01:49 +02:00
Simon Hauser
831f76a809 docs: add module prefix (#1847) 2022-04-18 08:21:00 +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
Alef Pereira
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
Luke Kershaw
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
Luke Kershaw
80cdb00b22 feat: center layout mirror option (#1577) 2021-12-10 11:48:14 +01:00
Luke Kershaw
914da77bb7 fix: bottom_pane remove results border next to prompt (#1563) 2021-12-08 18:28:55 +00:00
Luke Kershaw
0c819d6605 docs: layout strategy usage (#1493) 2021-12-03 15:21:26 +01:00
Luke Kershaw
22e59556f9 chore: layout strategy tidying (#1509) 2021-11-29 10:42:23 +00:00
max397574
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 Kershaw
edcf07cf88 feat: layout actions (#1383)
Co-authored-by: johnybx <johnybx@users.noreply.github.com>
2021-11-18 19:44:12 +00:00
Luke Kershaw
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 Kershaw
007b6e3061 fix: adjust layout positioning for new indexing (#1260) 2021-09-19 17:23:37 +01:00
Luke Kershaw
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
Simon Hauser
79644ab677 chore: use stylua for formatting (#1040)
* chore: stylua job and config

* reformat with stylua
2021-07-23 11:42:37 -04:00
Luke Kershaw
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 Smith
87fecbea95 fix for #847 (#1022) 2021-07-18 07:42:23 +00:00
Ben Smith
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
Corentin Brunel
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
TJ DeVries
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
TJ DeVries
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 DeVries
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
elianiva
6e941e0ece feat: define scroll speed + smart_send to qflist (#610)
* smart send to qflist

* Previewer scrolling for half window height

* Start doing cleanup in readme

* feat: add ability to define the scrolling speed

* move scrolling action to action.set

* docs: added more docs for actions

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

Co-authored-by: Simon Hauser <Simon-Hauser@outlook.de>
Co-authored-by: Github Actions <actions@github>
2021-03-05 20:13:48 +07:00
Simon Hauser
3faca0802f docs: start documenting previewers (#574)
Co-authored-by: Muhammed Zakir <MuhammedZakir@users.noreply.github.com>
2021-03-03 18:14:46 +01:00
Ben Smith
ed2764a1bd feat: layout horizontal and vertical can now be mirrored (#548)
See documentation for more info
2021-02-28 11:16:47 +01:00
TJ DeVries
55ab5c77a5 feat: Add vim docs & generators (#370)
* feat: Add vim docs & generators

* example of what we could start to do

* Docgen CI job

* wip

* incremental updates. soon good validation

* [Actions] Generate Documentation
skip-checks: true

* pretty cool now

* [Actions] Generate Documentation
skip-checks: true

* make sure telescope is loaded first

* Add updates. Maybe this will not delete now?

* Add defaults tags as well

* 😄

Co-authored-by: Simon Hauser <Simon-Hauser@outlook.de>
Co-authored-by: Github Actions <actions@github>
2021-02-24 21:44:51 -05:00
Simon Hauser
141dc6d55e ci: Add luacheck ci job (#317)
* Add luacheck ci job

* Fix most of the linting issues

* fixup: lint

Co-authored-by: TJ DeVries <devries.timothyj@gmail.com>
2020-12-09 15:46:41 -05:00
TJ DeVries
a3afb35614 feat: Added some docs & validation 2020-10-27 23:33:49 -04:00
TJ DeVries
59497d6640 feat: Do a bit better sorting for command history
To be honest, I'm not 100% sure this is fantastic, but it's definitely a
step in the right direction for command history.

Closes: #150
2020-10-08 22:31:44 -04:00
Dave Lage
27baff48d5 Revert "fix picking height as width (#157)" (#158)
This reverts commit c6716a5f6a.
2020-10-08 17:59:46 -04:00
Alvaro Muñoz
c6716a5f6a fix picking height as width (#157) 2020-10-08 17:45:11 -04:00
TJ DeVries
9d894f8229 fix: Respect cmdheight and laststatus 2020-10-08 12:53:42 -04:00
TJ DeVries
8736ea5f6a feat: ALPHA Add layout_defaults and layout_config options 2020-10-08 12:15:29 -04:00
TJ DeVries
2f03dbf265 fix: Remove useless prompt_title 2020-10-08 10:40:22 -04:00
Dave Lage
b4a6355f50 fix: Use width not results_width (#144) 2020-10-04 19:27:15 -04:00
rockerBOO
1821eb11f1 fix: Results height configurable. Properly collapse on border = false 2020-10-04 16:19:56 -04:00
rockerBOO
acd79d3d4c fix: Tighten up prompt on dropdown theme 2020-09-23 00:13:07 -04:00
rockerBOO
e4f1a748aa fix: Fixing positioning of dropdown 2020-09-18 02:10:03 -04:00