Because Elixir source code can contain `|`, the removed substitution
sometimes broke `lsp_document_symbols()`.
Example:
```
E5108: Error executing lua ...packer/start/telescope.nvim/lua/telescope/make_entry.lua:392: attempt to concatenate local 'symbol_name' (a nil value)
stack traceback:
...packer/start/telescope.nvim/lua/telescope/make_entry.lua:392: in function 'entry_maker'
...scope.nvim/lua/telescope/finders/async_static_finder.lua:17: in function 'new_table'
...acker/start/telescope.nvim/lua/telescope/builtin/lsp.lua:137: in function 'v'
...acker/start/telescope.nvim/lua/telescope/builtin/lsp.lua:500: in function 'v'
...cker/start/telescope.nvim/lua/telescope/builtin/init.lua:496: in function <...cker/start/telescope.nvim/lua/telescope/builtin/init.lua:467>
...ck/packer/start/telescope.nvim/lua/telescope/command.lua:179: in function 'run_command'
...ck/packer/start/telescope.nvim/lua/telescope/command.lua:241: in function 'load_command'
[string ":lua"]:1: in main chunk
```
Closes#874
* 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
* expose `cache_picker` in telescope.setup to configure caching, see `:h telescope.defaults.cache_picker`
* add builtin.resume and builtin.pickers picker
* fix: display issues in `:Telescope registers`
- Problems occured when a register contained newlines
- Caused issues in `Picker:set_selection`
- Couldn't move selection when a register with newlines was selected
- 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>
If you don't want to have a previewer disable it with `:Telescope current_buffer_fuzzy_find previewer=false`
To ignore empty lines do: `:Telescope current_buffer_fuzzy_find skip_empty_lines=true`
:Telescope man_pages sections=3 will only show man pages from section 3
:Telescope man_pages sections=1,2,3 will show man pages from section 1, 2 and 3
Configure preview window with:
autocmd User TelescopePreviewerLoaded setlocal wrap
autocmd User TelescopePreviewerLoaded setlocal number
file_maker example: Use regex highlighting for certain filetype like `*min.js` because they slow
down things with treesitter highlighter. Just a snippet for tests. We will do an extension :)
local previewers = require('telescope.previewers')
local putils = require('telescope.previewers.utils')
local pfiletype = require('plenary.filetype')
local _bad = { '.*%.min%.js' }
local bad_files = function(filepath)
for _, v in ipairs(_bad) do
if filepath:match(v) then
return true
end
end
return false
end
local new_maker = function(filepath, bufnr, bufname, use_ft_detect, callback)
if use_ft_detect == nil then use_ft_detect = true end
if bad_files(filepath) then
previewers.buffer_previewer_maker(filepath, bufnr, bufname, false, callback)
local ft = pfiletype.detect(filepath)
putils.regex_highlighter(bufnr, ft)
else
previewers.buffer_previewer_maker(filepath, bufnr, bufname, use_ft_detect, callback)
end
end
require('telescope').setup {
defaults = {
buffer_previewer_maker = new_maker,
}
}
* add vim hl_groups for autocmds finder
* spacing
* add displayer/colouring for git_commits
* LSP colouring and restore filename for workspace symbols
* resolve review issues.
* fix: handle 'show_line', 'ignore_filename', 'hide_filename'
* fix lsp workspace defaults
* allow for setting show_line when ignore filename is true
* move lsp_doc_symbol lineinfo to 2nd column
* reformat treesitter display to match LSP
* use utility functions for setting opts defaults
* add fix-me note for unlikely configuration permutation
* use hl_chars format for inline lineinfo