Commit graph

1292 commits

Author SHA1 Message Date
Folke Lemaitre
2b52d89508
fix(image.health): add check for ghost-script to render pdfs. Closes #1248
Some checks failed
CI / ci (push) Failing after 0s
2025-02-18 00:26:31 +01:00
Folke Lemaitre
9e422e1287
fix(image.latex): inline math formulas. Closes #1246 2025-02-18 00:25:08 +01:00
Folke Lemaitre
efcc25dcfa
fix(image.terminal): set passthrough=all instead of on for tmux. Closes #1249 2025-02-18 00:22:43 +01:00
Folke Lemaitre
f8e7942d6c
feat(image): added support for mermaid diagrams in markdown 2025-02-18 00:17:05 +01:00
Folke Lemaitre
5a37d83897
fix(image): failed state 2025-02-18 00:17:05 +01:00
Folke Lemaitre
b65178b470
feat(image): show progress indicator when converting image files 2025-02-17 23:56:55 +01:00
Folke Lemaitre
8d073ccc0c
feat(image): use tectonic when available 2025-02-17 23:56:21 +01:00
Folke Lemaitre
c3419cbf8b
refactor(image): use multi spawn 2025-02-17 23:13:12 +01:00
Folke Lemaitre
a76fe13148
feat(util): util.spawn 2025-02-17 23:12:54 +01:00
Pete Kazmier
8b19fd0332
fix(picker.git): preserve chronological order when matching (#1216)
## Description

When using the git log sources, what are your thoughts on preserving the
sort order when matching? I find most often when I use this picker I
want to see results in reverse chronological order. For example, I like
to use the picker to review the commit log to see new features added to
a repo.

## Screenshots

When matching for `feat` in the snacks repo with current behavior, the
output is less than useful:
<img width="868" alt="image"
src="https://github.com/user-attachments/assets/ed0fdf2a-ee1f-4325-8c87-85911837a757"
/>

But with the proposed change, it's much more relevant:
<img width="868" alt="image"
src="https://github.com/user-attachments/assets/7052b353-d38d-4573-bf72-b0d99c21672d"
/>

## Alternatives

I can override in my config:

```lua
      picker = {
        sources = {
          git_log = { sort = { fields = { "score:desc", "idx" } } },
          git_log_file = { sort = { fields = { "score:desc", "idx" } } },
          git_log_line = { sort = { fields = { "score:desc", "idx" } } },
        },
      },
```
2025-02-17 19:11:37 +01:00
Folke Lemaitre
4898d904db
refactor(image): convert 2025-02-17 17:23:11 +01:00
Folke Lemaitre
39bf5131c4
feat(image): enabled pdf previews 2025-02-17 17:17:56 +01:00
Folke Lemaitre
b5b0995e8b
style(image): luals 2025-02-17 16:09:41 +01:00
Folke Lemaitre
d7c8fd9a48
fix(image): show full size when not showing image inline 2025-02-17 16:07:04 +01:00
Folke Lemaitre
c1a1984fdb
fix(image): don't fallback to convert on windows, since that is a system tool 2025-02-17 14:29:25 +01:00
Folke Lemaitre
1f9ba12755
fix(image.hover): close when needed. Closes #1229 2025-02-17 14:37:27 +01:00
Folke Lemaitre
f4ca368672
fix(picker.list): correct offset calculation for large scrolloff. Closes #1208 2025-02-17 14:28:34 +01:00
Folke Lemaitre
4589e25758
fix(image.health): allow convert if magick not available 2025-02-17 14:00:37 +01:00
Folke Lemaitre
4752a87d54
docs: better doc tags. Closes #1234 2025-02-17 13:41:34 +01:00
Grzegorz Rozdzialik
9a5e4deaec
fix(image): do not attach to invalid buffers (#1238)
## Description

**Problem**: Sometimes when entering Insert mode, I would get an error
message from image's `attach` function:

```
Error executing vim.schedule lua callback: ...cal/share/nvim/lazy/snacks.nvim/lua/snacks/image/doc.lua:215: scoped variable: Invalid buffer id: 88
stack traceback:
        [C]: in function '__index'
        ...cal/share/nvim/lazy/snacks.nvim/lua/snacks/image/doc.lua:215: in function 'attach'
        ...al/share/nvim/lazy/snacks.nvim/lua/snacks/image/init.lua:174: in function <...al/share/nvim/lazy/snacks.nvim/lua/snacks/image/init.lua:173>
```

Looks like by the time the `attach` function is called, the buffer is no
longer valid. This is caused by using `vim.schedule`, which introduces a
small delay, during which the buffer can be deleted.

I suspect this is related to blink.cmp, but I cannot tell for certain.

**Solution**: Make sure that the buffer is valid using
`vim.api.nvim_buf_is_valid` inside the `vim.schedule` callback, before
calling `attach`.

With this fix, the error does not show up anymore.

## Screenshots

I used to get this error when entering Insert mode:

<img width="1474" alt="image"
src="https://github.com/user-attachments/assets/e256a36a-7ff6-4f84-8cdf-9e7b8132a3a1"
/>
2025-02-17 13:28:37 +01:00
Folke Lemaitre
ad0b88dc08
feat(image): added opts.img_dirs to configure the search path for resolving images. Closes #1222 2025-02-17 13:12:44 +01:00
Folke Lemaitre
1bca71a133
feat(image): added support for math expressions in latex and markdown doc + images in latex. Closes #1223 2025-02-17 12:50:35 +01:00
Folke Lemaitre
0bf0c6223d
feat(image): refactor of treesitter queries to support inline image data 2025-02-17 12:49:38 +01:00
Folke Lemaitre
48a3fed3c5
fix(debug): better args handling for debugging cmds 2025-02-17 12:44:05 +01:00
Folke Lemaitre
a33f65d936
feat(util): Snacks.util.color can now get the color from a list of hl groups 2025-02-16 22:56:49 +01:00
Folke Lemaitre
eced3033ea
feat(debug): graduate proc debug to Snacks.debug.cmd 2025-02-16 22:56:28 +01:00
Folke Lemaitre
a596f8a9ea
feat(image): added support for a bunch of aditional languages 2025-02-16 14:16:15 +01:00
Folke Lemaitre
c8285c2ca2
fix(picker.preview): don't reset preview when filtering and the same item is previewed 2025-02-16 12:39:59 +01:00
Folke Lemaitre
118eab0cfd
fix(image): return converted filename instead of original src. Closes #1213 2025-02-16 12:19:24 +01:00
Folke Lemaitre
544a2ae01c
fix(terminal): softer check for using jobstart with term=true instead of deprecated termopen 2025-02-16 12:12:08 +01:00
Folke Lemaitre
d18680c931
docs: docgen 2025-02-16 09:23:16 +01:00
Folke Lemaitre
ab0ba5cb22
feat(image): added support for tsx, jsx, vue and angular 2025-02-16 09:21:09 +01:00
Folke Lemaitre
d41704f3da
feat(image): url_decode strings 2025-02-16 09:09:23 +01:00
Folke Lemaitre
14a1f32eaf
feat(image): added support for angle bracket urls. Closes #1209 2025-02-16 08:55:53 +01:00
Folke Lemaitre
6348ccf120
feat(image): added Snacks.image.doc.at_cursor(). See #1108 2025-02-16 08:50:52 +01:00
Folke Lemaitre
3fda27200d
feat(image): added support for wikilink style images. Closes #1210 2025-02-16 08:45:29 +01:00
Folke Lemaitre
3100333fdb
fix(zen): properly get zoom options. Closes #1207 2025-02-16 08:29:43 +01:00
Folke Lemaitre
c760b8b85b
refactor(win): move fixbuf to separate method 2025-02-16 08:21:52 +01:00
Folke Lemaitre
a13c891a59
fix(notifier): keep notif when current buf is notif buf 2025-02-16 08:21:33 +01:00
Folke Lemaitre
b02cb5e882
fix(picker.list): don't show preview when target cursor/top not yet reached. Closes #1204
Some checks failed
CI / ci (push) Failing after 0s
2025-02-15 23:16:46 +01:00
Folke Lemaitre
86e3ddf2e4
fix(image): handle inline images at the same TS node, but that changed url. See #1203 2025-02-15 22:50:17 +01:00
Folke Lemaitre
942cb9291e
feat(image): make manual hover work correctly 2025-02-15 22:09:54 +01:00
Folke Lemaitre
356f6216b9
fix(image): handle file uppercase file extensions. Closes #1202 2025-02-15 22:05:28 +01:00
Folke Lemaitre
668cbbba47
feat(image): try resolving paths relative to the document and to the cwd. See #1203 2025-02-15 22:02:06 +01:00
Folke Lemaitre
41c4391b72
feat(picker): allow overriding default file/dir/dir_open icons. Closes #1199 2025-02-15 15:59:26 +01:00
Folke Lemaitre
938aee4a02
feat(explorer): added copy/paste (yank/paste) for files. Closes #1195 2025-02-15 15:44:35 +01:00
Folke Lemaitre
59bbe8d90e
feat(image): added support for .image tags in neorg 2025-02-15 15:20:10 +01:00
Folke Lemaitre
c067ffe86c
fix(image): support Neovim < 0.10 2025-02-15 14:48:25 +01:00
Folke Lemaitre
5f466becd9
feat(image): Snacks.image.hover() 2025-02-15 14:46:03 +01:00
Folke Lemaitre
e35d6cd4ba
feat(image): refactor + css/html + beter image fitting 2025-02-15 14:28:49 +01:00