Commit graph

32 commits

Author SHA1 Message Date
Folke Lemaitre
6ea4fa72dc
feat(image): proper inline rendering of math expressions. Closes #1318. Closes #1454 2025-03-01 08:01:11 +01:00
Folke Lemaitre
e039139291
feat(image): configurable templates for math expressions. Closes #1338 2025-02-20 17:11:12 +01:00
Folke Lemaitre
1543a063fb
feat(image): allow disabling math rendering. Closes #1247 2025-02-20 11:56:56 +01:00
Folke Lemaitre
f45dd6c44c
fix(image): remove some default latex packages 2025-02-19 22:56:11 +01:00
Folke Lemaitre
d389c5df14
feat(image): better health checks 2025-02-19 17:16:05 +01:00
Folke Lemaitre
684666f643
feat(image): conceal option for inline rendering (disabled by default) 2025-02-19 15:41:16 +01:00
Folke Lemaitre
e146a66cb7
fix(image): better cell size calculation for non-HDPI displays 2025-02-19 15:07:28 +01:00
Folke Lemaitre
2096fcdd73
feat(image): allow customizing the default magick args for vector images 2025-02-19 13:15:11 +01:00
Folke Lemaitre
e27ba726b1
feat(image): make math packages configurable. Closes #1295 2025-02-19 06:48:02 +01:00
Folke Lemaitre
e2258236a2
feat(image): added math rendering for typst. Closes #1260 2025-02-19 00:11:27 +01:00
Folke Lemaitre
1adfd29af3
feat(image): better error handling + option to disable error notifications 2025-02-18 22:54:24 +01:00
Folke Lemaitre
8117fb4cbb
fix(image): mermaid theme. Closes #1282 2025-02-18 21:53:57 +01:00
Folke Lemaitre
f4583da710
refactor(image): opts.image.magick => opts.image.convert.magick 2025-02-18 21:53:12 +01:00
Folke Lemaitre
004050c435
feat(image): images are now properly scaled based on device DPI and image DPI. Closing #1257 2025-02-18 16:31:37 +01:00
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
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
39bf5131c4
feat(image): enabled pdf previews 2025-02-17 17:17:56 +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
4589e25758
fix(image.health): allow convert if magick not available 2025-02-17 14:00:37 +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
0bf0c6223d
feat(image): refactor of treesitter queries to support inline image data 2025-02-17 12:49:38 +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
118eab0cfd
fix(image): return converted filename instead of original src. Closes #1213 2025-02-16 12:19:24 +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
356f6216b9
fix(image): handle file uppercase file extensions. Closes #1202 2025-02-15 22:05:28 +01:00
Folke Lemaitre
59bbe8d90e
feat(image): added support for .image tags in neorg 2025-02-15 15:20:10 +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