summaryrefslogtreecommitdiff
path: root/lua/telescope/previewers/utils.lua
AgeCommit message (Collapse)Author
2023-01-30fix: wrap nvim_buf_set_option in a protected call (#2346)Kalka
2022-10-08fix: preview = true (#2168)Simon Hauser
2022-09-04fix: previewer if custom_captures are set (#2156)Simon Hauser
2022-07-07chore: reformat with stylua 0.14.0Simon Hauser
2022-07-01break: cleanup preview.treesitter language setting (#1612)marcel
this follows nvim-treesitter more closely but enable can also be a table of enabled languages The config now looks like this: ```lua defaults = { preview = { treesitter = { enable = false, -- or enable = { "c" }, -- disable can be set if enable isn't set disable = { "perl", "javascript" }, }, }, }, ```
2022-03-10fix: man_pages previewer, respecting MANPATH and apropos output parsing (#1764)Simon Hauser
- introducing putils writer and use it rather than using PAGER env var - introducing env for lua/telescope/_.lua job interface - to respect MANPATH (and PATH just in case) - fix for apropos output parsing might return e.g. `alacritty, Alacritty` We need to split on first `,`
2021-11-30fix(highlight): Use TS built-in is_enabled function (#1513)Patrick Ziegler
The function just replicated the logic from is_enabled and assumed the `disable` setting is always a table. This is no longer the case (https://github.com/nvim-treesitter/nvim-treesitter/pull/2009), it can now also be a function.
2021-09-27feat: filetype_hook & improved docs; fix preview partial override (#1273)fdschmidt93
2021-09-17fix: fallback to syntax hl if treesitter fails (#1249)fdschmidt93
2021-09-16feat: skip/timeout preview if file cannot be easily previewed (#1231)fdschmidt93
* For full configuration, see `:h telescope.defaults.preview` * Unblocks previewer on binaries, too large files, and files that take too long to read * Allows toggling treesitter highlighting for buffer_previewer * Allows to globally opt out of previewer
2021-07-23chore: use stylua for formatting (#1040)Simon Hauser
* chore: stylua job and config * reformat with stylua
2021-07-20fix: unknown filetype error message (#1034)Simon Hauser
2021-03-30fix: no longer leaking one buffer previewer in some occasions (#664)Simon Hauser
* 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-02-09fix: all git builtin respect cwd now (#517)Simon Hauser
2021-01-30fix: no TS highlight if it gets loaded after Telescope (#479)elianiva
2021-01-11refactor file_maker signature and fix scrolling (#412)Simon Hauser
2021-01-01fix: make sure preview buffer is valid before writing to it (#376)Alvaro Muñoz
2020-12-31fix: has ts (#374)Simon Hauser
2020-12-30fix: add ts_parsers.ft_to_lang to detect lang (#373)fffed
Add detection of a proper buffer language by `ts_parsers.ft_to_lang` as `ts_parsers.has_parser` works with `language` but not with `filetype` https://github.com/nvim-treesitter/nvim-treesitter/issues/796
2020-12-30feat: append mode for previewers.utils.job_maker (#372)Alvaro Muñoz
2020-12-29feat: All buffer previewers are now async and more config options (#354)Simon Hauser
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, } }
2020-12-19Refactor previewers (#345)Simon Hauser