* Number type should be allowed for option keys
Some extension (e.g. `dap`) use integer numbers for their selector
options instead of strings. Before this commit, the interface for these
plugins breaks when using `ui-select` with a stack trace like the
following:
Error detected while processing function StartDebugger:
line 33:
E5108: Error executing lua .../telescope.nvim/lua/telescope/pickers.lua:1359: Should be string, found: number
stack traceback:
[C]: in function 'assert'
.../.vim/bundle/telescope.nvim/lua/telescope/pickers.lua:1359: in function 'new'
...e-ui-select.nvim/lua/telescope/_extensions/ui-select.lua:22: in function 'pick_one'
.../nvim-dap/lua/dap/ui.lua:32: in function 'pick_if_many'
.../nvim-dap/lua/dap.lua:225: in function 'select_config_and_run'
.../nvim-dap/lua/dap.lua:551: in function 'continue'
[string ":lua"]:1: in main chunk
* style
Co-authored-by: Simon Hauser <Simon-Hauser@outlook.de>
* 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>
* feat: add `multi_icon` option to pickers and corresponding highlight
* feat: allow `multi_icon` to be any length
* fix: adjust `selection_caret` highlighting
* fix: action mt so we can again concat actions from two different tables
- without actually changing the public interface
- without having a local table that keeps track of all actions
* this should clear actions now
we never actually called this function which is kinda a problem because
we never cleaned up previous mapping stores.
We can also make a better mappings store which has access to the keys
sequences which would help the showing actions part
* bugfix
* that should now clear everything
only tests left i think
* more tests
* cleanup
* hack: make sure all actions get cleared
* fix: finish docs and remove mistakes from merge
* fix: change order of `popup` changes based on type of change
- removes "flash" issue where popups don't update in sync
* 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
* 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>
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.
* expose `cache_picker` in telescope.setup to configure caching, see `:h telescope.defaults.cache_picker`
* add builtin.resume and builtin.pickers picker
**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
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 :)
* 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
* 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