Remove backslash escaping in oldfiles picker, which was needed
before the code was changed to use substring comparison instead of
regex matching. (Commit b3ff5f33)
* fix(previewer): improve binary mime type check
Problem: mime type for a ts/js file can either return `text/plain` or
`application/javascript` based on the contents of the file.
Previously, this meant `application/javascript` would be considered
"possibly binary". This, in conjunction with how `vim.filetype.match`
does not give a result for a filename that ends in `.ts`, would lead to
a typescript file taking the path of `check_mime_type` and eventually
`mime_hook`.
Solution: Include `application/javascript` as a non-binary file type
during mime type check.
* [docgen] Update doc/telescope.txt
skip-checks: true
---------
Co-authored-by: Github Actions <actions@github>
Not showing a preview with the new changes in the latest changes of
[plenary.nvim PR
#575](https://github.com/nvim-lua/plenary.nvim/pull/575).
The error occurs when changing from `nomodifiable` to `modifiable`.
Telescope itself works, but the previews don't render.
* Initial commit
* Fixes issue with find_files where devicons where disabled
* Fixes issue with vimgrep where devicons where disabled
* Fixes trailing space for path with only a file name
* Adds test for reverse path_display
* Refactors reverse to filename_first
* Adds tests
* Fixes highlighting
* Fixes linting issues
* Uses trim function
* Fixes issue with highlighting
* Moves local function to utils
* Removes redundant code
* Adds highlighting for gen_from_buffer
* fix formatting
---------
Co-authored-by: alycklama <>
Co-authored-by: James Trew <j.trew10@gmail.com>
* fix(which_key): close window on mouse click action
`nvim_buf_delete` is not allowed during text change or window change.
Window switching with left mouse click was leading to race
condition/error.
* [docgen] Update doc/telescope.txt
skip-checks: true
---------
Co-authored-by: Github Actions <actions@github>
Using anonymous function is throwing warning "No name available for
anonymous functions" when `action_generate.which_key` is used as shown
in the docs.
The previous scrolling implementation (#2687) moved the result selection
by one item at a time, which isn't technically scrolling (ie. moving the
view) and feels quite slow.
Let the neovim builtin scrolling do its thing, so using the scroll wheel
feels like scrolling and is functionally scrolling, too. Scrolling does
not move the selection so after scrolling it typically makes sense to
click. Moving the selection with keyboard takes you back to where you
were. This is in line with typical desktop user interfaces.
* feat(scrolling and mouse support): support scrolling and selecting with the mouse
* fix ascending sorting_strategy mouse clicks
---------
Co-authored-by: James Trew <j.trew10@gmail.com>
* fix(set_preview_message): check line height of previewer before setting message.
* style: run changed file through stylua and remove unused variable.
* refactor: change lines table instead. check max between line_pos and 0
* style: run changed file through stylua.
* fix(picker): wrap vim.fn.expand cword in pcall to avoid Vim:E348: No string under cursor
* run stylua
---------
Co-authored-by: James Trew <j.trew10@gmail.com>
There's a limitation with extmark's `right_align` virtual text and how
it handles side scrolling. This causes text entered to be hidden behind
the virtual text rather than begin the side scroll.
An issue is opened upstream https://github.com/neovim/neovim/issues/27540
But this could take a while before it's fixed as it's considered
`complexity:high`.
This PR adds a temporary workaround of just hiding the status text if the
prompt is long enough to interfere with it.
Previous implementation of placing the cursor on the first column of the
highlight failed to take into account that the highlighter can return
more than one data structure.
* feat(builtin.current_buffer_fuzzy_find): jump to first matched char
* use highlighter to detect column to jump to
* replace default select
* handle non 0 based column index
* handle no highlight scenario
---------
Co-authored-by: James Trew <j.trew10@gmail.com>