Commit Graph
104 Commits
Author SHA1 Message Date
James TrewandSimon Hauser 588e26ff9f fix(previewer): improve binary mime type check (#3083)
* 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>
(cherry picked from commit fac83a556e)
2024-05-20 11:34:02 +02:00
AoMe · 青目andSimon Hauser 01928ddecc fix(buffer_previewer): no preview showing when set nomodifiable (#3077)
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.

(cherry picked from commit 1084d07cf4)
2024-05-20 11:29:39 +02:00
Edwin TangandSimon Hauser 097a64a166 fix(previewer): preview message out of bounds (#3003)
* 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.

(cherry picked from commit c2b8311dfa)
2024-05-20 11:11:57 +02:00
James TrewandSimon Hauser ce398bcdc8 fix(previewer): don't escape paths for fs_stat (#2996)
`vim.loop.fs_stat` takes file paths literally so no escaping special
characters are need (eg spaces, `$`, etc)

(cherry picked from commit 221778e93b)
2024-05-20 11:10:16 +02:00
James TrewandSimon Hauser d5fe96ec8a fix: expand/normalize paths more selectively (#2628)
(cherry picked from commit 3b8399c273)
2024-05-20 11:10:12 +02:00
Pedro FerrariandSimon Hauser ec3474b596 fix(git_branch): previewer commit hash dynamic highlighting (#2921)
* Fix highlight of commit hash in git branches preview

* Update lua/telescope/previewers/buffer_previewer.lua

Co-authored-by: James Trew <66286082+jamestrew@users.noreply.github.com>

---------

Co-authored-by: James Trew <66286082+jamestrew@users.noreply.github.com>
(cherry picked from commit b744cf5975)
2024-03-06 15:55:11 +01:00
Marco De DonnoandSimon Hauser 6d2be79385 fix: do not alter jumplist when jumping to a line in a file (#2910)
(cherry picked from commit 236083884c)
2024-03-06 11:12:43 +01:00
rjooskeandSimon Hauser 199ce5fc25 fix(previewer): buffer previews for term not initially scrolled (#2899)
(cherry picked from commit e54fbf4ab2)
2024-03-06 11:10:50 +01:00
atusyandSimon Hauser 9594a7eb46 fix(previewer): buffer_previewer_maker now receives all necessary opts everywhere (#2833)
(cherry picked from commit 301505da4b)
2024-03-06 11:08:23 +01:00
Garry FilakhtovandSimon Hauser d0f095243b fix: jumplist picker resume after bwipeout (#2753)
With this change we will check if the provided buffer number is valid,
before querying its `buftype` option. This is necessary, because
currently we would fail with:
```
Error executing vim.schedule lua callback:
...scope.nvim/lua/telescope/previewers/buffer_previewer.lua:473:
Invalid buffer id: X
```
error, if we try to resume a jumplist picker after doing `:bwipeout`.

(cherry picked from commit 4522d7e3ea)
2023-11-28 11:19:08 +01:00
Frantisek StankoandSimon Hauser 195be6acc2 fix: do not send data to closed stream (#2746)
This commit fixes the following error:

E5108: Error executing lua: Vim:Can't send data to closed stream
stack traceback:
[C]: in function 'chansend'
/lua/telescope/previewers/term_previewer.lua:224: in function '_send_input'
/lua/telescope/previewers/previewer.lua:85: in function 'send_input'
/lua/telescope/previewers/term_previewer.lua:238: in function '_scroll_fn'
/lua/telescope/previewers/previewer.lua:93: in function 'scroll_fn'
/lua/telescope/actions/set.lua:249: in function 'run_replace_or_original'
/lua/telescope/actions/mt.lua:65: in function 'scroll_previewer'
/lua/telescope/actions/init.lua:222: in function 'run_replace_or_original'

This happens when previewers.new_termopen_previewer()'s get_command()
ends without pagination.

(cherry picked from commit a62db885fd)
2023-11-28 11:16:39 +01:00
James TrewandSimon Hauser f97f4a04f7 fix: previewers & entry maker file encoding (#2430)
(cherry picked from commit c8b65238e8)
2023-05-24 17:08:36 +02:00
KevinSilvesterandSimon Hauser ce5cc56dee fix(preview): update mime-type check for json files (#2221) (#2480)
(cherry picked from commit 89c67676a8)
2023-05-14 22:18:03 +02:00
zoriyaandSimon Hauser 5c06f24ed3 fix: make git_status diff works with staged files (#2421)
(cherry picked from commit eba418cca7)
2023-04-09 10:23:32 +02:00
KalkaandSimon Hauser 686aea90ef fix: wrap nvim_buf_set_option in a protected call (#2346)
(cherry picked from commit 65287605c3)
2023-02-19 14:08:59 +01:00
vladislav dosterandSimon Hauser a1bd6866b5 docs: telescope.nvim spelling and grammar fixes (#2325)
Corrects the following issues:
- article agreement
- spelling

(cherry picked from commit dce1156ca1)
2023-01-22 10:09:28 +01:00
James TrewandSimon Hauser 0077389133 docs: proof-read edits (#2311)
(cherry picked from commit 053f2303c4)
2023-01-22 10:09:23 +01:00
Simon Hauser fd1b8bd9cf fix: preview = true (#2168)
(cherry picked from commit 3a29c1e89d)
2023-01-06 14:27:30 +01:00
Simon Hauser d74977591b fix: previewer if custom_captures are set (#2156)
(cherry picked from commit 19047b6b3c)
2022-09-04 22:01:47 +02:00
Fabian David SchmidtandSimon Hauser fdb4be95df fix(previewer): regression on live_grep (#2119)
(cherry picked from commit 8f80e82108)
2022-08-10 22:14:56 +02:00
Fabian David SchmidtandSimon Hauser 42bebcb81c fix(buffer_previewer): bypass path validation for terminal buffers (#2117)
(cherry picked from commit 787db424e3)
2022-08-10 22:14:50 +02:00
Simon HauserandGitHub 10a3310546 fix: from_entry escape and validation (#2058) 2022-07-10 21:28:22 +02:00
Simon HauserandGitHub 9b3afe51c4 fix: autocmd, show desc if available (#2046) 2022-07-07 16:45:32 +02:00
Simon Hauser f838695459 chore: reformat with stylua 0.14.0 2022-07-07 08:27:46 +02:00
marcelandGitHub 5dd4b52910 break: cleanup preview.treesitter language setting (#1612)
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-07-01 22:58:05 +02:00
Simon Hauser 75deb22aa8 fix: crash in tags on enter for no results and random crash in previewer 2022-07-01 19:18:30 +02:00
Simon Hauser 4ef490defa fix: Inconsistent Color highlighting inside Git File Diff Preview
fix #1098
2022-06-30 14:01:52 +02:00
Simon HauserandSimon Hauser 25b1bc8f17 feat: clear previewer if no item is selected (#2004) 2022-06-30 14:01:52 +02:00
Simon HauserandSimon Hauser 77e2b8ceea chore: cleanup autocmd builtin (#1947) 2022-06-30 14:01:51 +02:00
zeertzjqandGitHub d96eaa914a fix: block autocommands when setting preview buffer (#2010)
Telescope creates most floating windows with `noautocmd = true`, so
these windows do not trigger autocommands, but preview buffer is set in
window using `nvim_win_set_buf()`, which triggers buffer autocommands.
This may be unwanted, so block them using 'eventignore'.
2022-06-15 10:43:10 +02:00
Simon HauserandGitHub 3d304a9a55 fix: TelescopePreviewerLoaded (#2005) 2022-06-13 21:49:10 +02:00
Simon HauserandGitHub 23e28d066a fix: termpreviewer scrolling (#1906) 2022-05-02 08:48:50 +02:00
Simon HauserandGitHub 544c5ee407 fix: termopen previewer (#1901)
- buffer leaking
- still insert mode on confirm
2022-05-01 09:46:50 +02:00
Simon HauserandGitHub 831f76a809 docs: add module prefix (#1847) 2022-04-18 08:21:00 +02:00
ibhagwanandGitHub cf2d6d3428 fix (tags|btags): escape all special characters (#1806) 2022-03-26 10:29:34 +01:00
ef7b6ada6d feat: improve UX with vim.notify (#1763)
* fix(notify): don't report request on new line

* ref(notify): update message format

* ref(msgs): always quote values + decrease duplication

* fix(ci): undefined variables

* ref(actions): temporary silent actions.__index errors

* cleanup

* revert: panic effort, we continue to use error for those

Co-authored-by: Simon Hauser <Simon-Hauser@outlook.de>
2022-03-13 18:11:27 +01:00
Simon HauserandGitHub 2d0b4a3243 fix: disable signcolumn in telescope windows (#1781) 2022-03-11 15:34:39 +01:00
LauraandGitHub a7517b4b2d refactor: remove redundant state in preview (#1761) 2022-03-10 16:34:02 +01:00
Simon HauserandGitHub 234066f875 fix: man_pages previewer, respecting MANPATH and apropos output parsing (#1764)
- 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 `,`
2022-03-10 13:48:40 +01:00
Vedant NeemaandGitHub 567ec85b15 fix builtin.autocommands throwing error (#1758) 2022-02-23 15:36:45 +01:00
daangoossens22andGitHub c948263d89 fix: builtin autocommands previewer throws error (#1732) 2022-02-14 17:36:55 +01:00
smhcandGitHub 991d0127f0 fix: previewer for builtin.builtin (#1583) 2021-12-10 11:44:50 +01:00
Simon HauserandGitHub d0083f9e4c fix: git_branch previewer highlighter error (#1543) 2021-12-05 08:39:16 +01:00
Patrick ZieglerandGitHub ce8c8d4a45 fix(highlight): Use TS built-in is_enabled function (#1513)
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-11-30 21:18:08 +01:00
Simon HauserandGitHub a8e9aa58a4 fix: issue when scrollbind is set (#1496) 2021-11-26 22:42:54 +01:00
Zoltan KlingerandGitHub 3d45c6c555 fix: typo in previewers documentation (#1450) 2021-11-13 08:52:08 +01:00
fdschmidt93andGitHub 97842abb03 fix: revert buffers previewer (#1400)
* Reverts #1120 many issues arise (mru, highlighting, settings inheritance, ...) when previewing actual buffers
2021-11-04 07:55:32 +01:00
Simon HauserandGitHub a0835edd86 fix: preview title key and a bug with dynamic_title (#1350) 2021-10-20 16:23:26 +02:00
fdschmidt93andGitHub ec48777990 fix: stacking highlights in buffer previewer (#1294) 2021-10-04 22:35:22 +02:00
fdschmidt93andGitHub a6c7498bdc feat: filetype_hook & improved docs; fix preview partial override (#1273) 2021-09-27 15:24:35 +02:00