Commit Graph

168 Commits

Author SHA1 Message Date
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
TJ DeVries
9ac89ebf67 Fixes #1371
Force clearing the highlights while the picker is still open
2021-11-15 15:50:23 -05:00
fdschmidt93
404d2b5f10 feat: allow changing results/prompt title & persisting multi on picker:refresh (#1451) 2021-11-15 17:58:43 +01:00
Simon Hauser
587a10d149 chore: remove a lot of deprecated stuff (#1399) 2021-11-01 20:30:10 +01:00
Luke Kershaw
c08f95823d fix: check if caret is present before removal (#1390) 2021-10-31 15:52:09 +00:00
Luke Kershaw
02a02f7bcd fix: set preview titlehighlight when re-enabling preview (#1384) 2021-10-28 14:21:09 +01:00
Luke Kershaw
5809321290 feat: separate higlight for titles in picker windows (#1362)
- requires nvim-lua/plenary.nvim#260
2021-10-26 15:14:33 +01:00
Luke Kershaw
f56222738b fix: always remove previous caret when change selection (#1364) 2021-10-21 10:46:32 +01:00
Simon Hauser
a0835edd86 fix: preview title key and a bug with dynamic_title (#1350) 2021-10-20 16:23:26 +02:00
Luke Kershaw
adfbd616c6 feat: recalculate picker layout on VimResized (#959)
* WIP: recalculate picker layout on `VimResized`

* refactor: `popup.resize` -> `popup.move`

* fix: scroll to the correct place after resize

* fix: update positioning in results buffer

* fix: completely redraw results buffer on resize

* fix: handle preview enable/disable

* fix: work with scrolling

* docs: add plan for `toggle_padding`

* refactor: factor out creation of picker windows

* refactor: pass highlights directly to popup_create

* refactor: remove lines update and factor out scroll repositioning

Co-authored-by: Github Actions <actions@github>
2021-10-20 11:06:10 +01:00
Jean-Luc Bastarache
59f5873199 fix: highlighting when color_devicons=false (#1328) 2021-10-11 18:00:28 +02:00
Simon Hauser
603f55dedf fix: processed count to exclude entries that got ignored in make_entry (#1323)
It doesnt make sense to count these. Most likely they were never shown.
Example: `man_pages` excludes pages from different sections. So you
filter for man pages and end up with like 5 entries and the counter
still says 1000. Not a good experience.
2021-10-09 15:34:22 +02:00
TJ DeVries
dea927d0eb feat: Add scrolling through results (#1232)
* some scrollin

* [WIP]: Fri 10 Sep 2021 02:24:20 PM EDT

* ok, I think scrolling works

* change to 1000 for now, dont need to scroll that far :)
2021-10-08 10:56:01 -04:00
TheLeoP
02bc88e6d6 fix: pickers use entry.filename as default and fallback to entry.value for file_ignore_patterns (#1243) 2021-09-19 17:38:44 +02:00
Simon Hauser
5131df7df1 docs: rewrite readme and add missing config values + builtin opts 2021-09-16 11:12:12 +02:00
fdschmidt93
55ec6c5c9c fix: restoring picker table/function opts (#1205)
* fix: missing opts for cached picker creation

* fix: make properly overridable
2021-09-09 22:13:16 +02:00
fdschmidt93
5d37c3ea08 feat: allow caching and resuming picker (#1051)
* expose `cache_picker` in telescope.setup to configure caching, see `:h telescope.defaults.cache_picker`
* add builtin.resume and builtin.pickers picker
2021-09-01 18:17:18 +02:00
fdschmidt93
8710baa6fb fix(pickers): initial normal mode (#1165)
fix(pickers): opts.default_text and cursor are now correctly set for opts.initial_mode="normal"
2021-09-01 17:09:26 +02:00
TJ DeVries
4f91ffcbab fix: Close async oneshot jobs on finder:close (#1140) 2021-08-20 14:41:52 -04:00
TJ DeVries
ea5ab8f7c4 feat: Use nvim_buf_set_extmark right_align to do the magic for us (#1138) 2021-08-20 13:35:21 -04:00
TJ DeVries
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
fdschmidt93
cda284986f feat: api for clearing completion cb in userspace (#1097) 2021-08-11 09:00:23 -04:00
TJ DeVries
a056a9c7e0 feat: Move to plenary.popup (#1102) 2021-08-11 08:54:28 -04: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
Rasmus Bergström
1bb73aed5f Set a filetype for the results buffer (#1019)
**Why** is the change needed?

So that it can be targeted with specific settings. These could include disabling
plugins for the buffer (as in #840) or disabling folding (as per #991).

**How** is the need addressed?

- Add a filetype to the buffer after it has been created.

Closes #991
2021-07-18 10:12:04 +02:00
Simon Hauser
3699605627 feat: cycle prompt history (#521)
history is enabled on default but cycle_history_next and cycle_history_prev is not mapped yet

Example:
require('telescope').setup {
  defaults = {
    mappings = {
      i = {
        ["<C-Down>"] = require('telescope.actions').cycle_history_next,
        ["<C-Up>"] = require('telescope.actions').cycle_history_prev,
      }
    }
  }
}

For more information :help telescope.defaults.history

big thanks to clason and all other testers :)
2021-07-09 20:45:29 +02:00
fdschmidt93
bdd0df73a6 feat: select_all, toggle_all and drop_all actions (#931) 2021-07-03 10:54:06 +02:00
Tom
c5a6ed16e2 feat: selection_strategy closest (#885)
* Added closest selection_strategy to use default_selection_index initially but prefer highest ranked match when prompt not empty

* Updated supporting documentation to include selection_strategy
2021-07-02 12:42:25 +02:00
Luke Kershaw
50001d4965 fix: table number option extend (#947)
* fix: prevent error when overriding tables with numbers

Fixes #944

- refactor `config.smarter_depth_2_extend`

- use `config.smarter_depth_2_extend` for setting `layout_config` in `Picker:new`

* test: check that can override a table with a number for layout configuration
2021-07-02 08:50:55 +02: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
Simon Hauser
6ac5ee0854 feat: cycle previewers with commit and bcommit already using it (#528)
- new git previewers
- jump to line in bcommit previewer
- vimdiff for bcommits
- dynamic preview window titles
- more previewers documentation

Cycle previewers are not mapped yet. So you need to setup yourself:
```lua
require('telescope').setup {
  defaults = {
    mappings = {
      i = {
        ["<C-s>"] = actions.cycle_previewers_next,
        ["<C-a>"] = actions.cycle_previewers_prev,
      },
    },
  }
}
```

Co-authored-by: Thore Strassburg <thore@weilbier.net>
2021-06-14 21:50:46 +02:00
Dhruv Manilawala
495f84fd35 feat: delete entry from the picker without closing telescope (#828)
This action is not mapped but you can do it yourself in your telescope setup call
Example config:
```lua
require("telescope").setup {
  pickers = {
    buffers = {
      mappings = {
        i = {
          ["<c-d>"] = "delete_buffer",
        }
      }
    }
  }
}
```
2021-06-09 19:58:36 +02:00
kaddkaka
b06e17e4a1 fix: abort picker set_selection if no manager (#866) 2021-05-26 17:19:17 -04:00
Tom Praschan
b78d4ef10c Reset multi-selection in Picker:refresh() (#830)
If there's a new finder the multi selection is invalidated, so reset it
2021-05-15 12:54:53 -04:00
Luke Kershaw
c061c216bf fix: add check for nil win_id in Picker.close_windows (#831)
This probably fixes issues with nobuflisted buffers (startify, dashboard-nvim and probably more)
2021-05-09 22:17:39 +02:00
TJ DeVries
38765f68db fix: Fix things for conni 2021-04-28 10:38:24 -04:00
TJ DeVries
a28999574e feat: allow reset prompt to set text as well 2021-04-22 17:55:06 -04:00
TJ DeVries
d27907b0da fix: Default to an empty sorter, so we always have one 2021-04-16 11:11:40 -04:00
TJ DeVries
2e7ee55aa4 feat: Add more sorter hooks (#752)
* feat: Add more sorter hooks

* fix breaking conni brain
2021-04-15 09:24:10 -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
Simon Hauser
aefc831735 fix: no longer leaking one buffer previewer in some occasions (#664)
* fix: stop leaking last preview buffer
* fix: formatting for docs
* fix: async check if file is dir or not and
  - fix for in_fast_event when overriding file_maker
* fix: filtering for space in keymaps and fzy
* fix: show correct result numbers when using file_ignore_patterns
* Handle early close. Caused because we actually cleaning up buffers now
* cleanup
* [docgen] Update doc/telescope.txt
2021-03-30 12:32:18 +02:00
TJ DeVries
add7ee3943 nit: Don't reset highlights on detach 2021-03-09 22:44:45 -05:00
Simon Hauser
e1c8ad5d78 fix: entry_prefix if selection_caret > entry_prefix (#572) 2021-02-28 10:54:44 +01:00
TJ DeVries
11674ac021 feat: multi selection. Only integrates with send_selected_to_qflist (#551)
This will not yet work with select actions. More work is needed in that case.

Co-authored-by: Simon Hauser <Simon-Hauser@outlook.de>
2021-02-27 21:06:04 +01:00
Simon Hauser
ca92ec1a83 fix: a lot of small things and adds more customization for caret (#554)
Attention:
prompt_prefix will no longer add a space at the end. So if you still want a space at the end make sure your configuration has one.
The default should not be changed. So if you haven't copied prompt_prefix in your config this doesn't affect you.

Feat:
- prompt prefix does no longer always end with space
- selection_caret configurable. Default: `> `
- result_prefix configurable. Default: `  `
- more actions for git_branches
  - <c-t> does track the branch
  - <c-r> does rebase branch
  - also added delete branch action but not configured. See readme on how to do that

Fixes:
- fix docgen ci
- Better error for lsp_workspace_symbols
- better formatting for CONTRIBUTING.md
- move from systemlist to plenary.job
- git branch now supports checkout on remote branches
2021-02-27 16:26:25 +01:00
Simon Hauser
4dd35ef0e1 feat: file browser & refresh interface (#290)
and more picker api stuff for sunjon. refresh is implemented for file_browser and git_status
2021-02-23 22:10:19 +01:00
TJ DeVries
d7c02e3b52 feat: Action improvements (#472)
* feat: replace_map

* feat: Add action_set and action_state

* fix: Move all actions.get_ to action_state.get_

* fix: replace all internal references of _goto_file_selection_edit

* feat: add some docs

* fix: lint

* feat: actions.select

* remove mentions and usage of goto_file_selection APIs

* feat: special case attach_mappings to be overridable and defaultable

* Having goto_file_selection mappings will cause a error

as well as replacing deprecated goto_file_selection methodes

For config and replacing use this instead:
- actions.select_default
- actions.select_horizonal
- actions.select_vertical
- actions.select_tab

Only replacing:
- actions.set.edit -- for replacing all select functions

* adds actions.state.select_key_to_edit_key

Co-authored-by: Simon Hauser <Simon-Hauser@outlook.de>
2021-02-22 11:30:57 -05:00
Simon Hauser
3a7fa41857 fix: all git builtin respect cwd now (#517) 2021-02-09 18:25:57 +01:00
TJ DeVries
5f1d16acf6 nit: Abstract some functions (#498) 2021-02-04 20:56:05 -05:00
Raphael
779704bf26 Add user autocmd TelescopeFindPre (#491)
* Add user autocmd Telescope

* change name to TelescopeFindPre

* update Readme for Telescope user autocmds
2021-02-02 23:23:28 -05:00