Commit graph

15 commits

Author SHA1 Message Date
Tod Morrison
1c3f15cb54
fix(image): correct render fallback to handle "editor" relative position (#2297)
PR #2296 had the conditionals in the wrong order and with an "or"
instead of an "and". This should finally fix the issue and pass
stylelua.

## Description

The correct condition for correcting the off-by-one is:
```
    if
      (Snacks.config.styles.snacks_image.relative ~= "editor")
      and ((vim.o.showtabline == 2) or (vim.o.showtabline == 1 and vim.fn.tabpagenr("$") > 1))
    then
```
This patch gets the conditional in the right order
2025-10-21 07:36:13 +02:00
Tod Morrison
c552cea131
fix(image): correct render fallback to handle "editor" relative position (#2296)
In PR 1560, @phanen reported an additional case that was not handled by
that fix when the style is set to `relative = "editor"`. This new patch
adds a check to handle that case.

## Description ##

This patch adds a check for `Snacks.config.styles.snacks_image.relative
~= "editor"` to the conditional in render_fallback that handles the
off-by-one error. The previous patch fixed the relative = "cursor" case,
but introduced a regression in the relative = "editor" case.
2025-10-21 07:01:50 +02:00
Folke Lemaitre
19ff343a16
style: format 2025-10-20 15:29:47 +02:00
Tod Morrison
441bdcd210
fix(image): correct off by one issue in render fallback (#1560)
Fix off-by-one issue in render_fallback when a tabline is shown (e.g.
with plugins like bufferline.nvim).

## Description

When a tabline is used/shown, the positioning in render_fallback is off
by one. This change checks whether a tabline would be shown and uses the
correct math for that case and, otherwise, works as before.

## Related Issue(s)

  - Fixes #1557
2025-10-20 14:59:33 +02:00
Folke Lemaitre
bc2ed15c41
fix(image): only show anchor icon for inline images shown on the lines below. Closes #1479 2025-03-01 22:58:56 +01:00
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
5fa93cb684
fix(image.placement): max width/height in cells is 297. Closes #1345
Some checks failed
CI / ci (push) Failing after 0s
2025-02-20 18:12:49 +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
44e2f8e573
fix(image): fix disappearing images when changing colorscheme 2025-02-18 21:52:16 +01:00
Folke Lemaitre
526896ad3e
fix(image): hide progress when finished loading in for wezterm 2025-02-18 17:22:05 +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
b65178b470
feat(image): show progress indicator when converting image files 2025-02-17 23:56:55 +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
0bf0c6223d
feat(image): refactor of treesitter queries to support inline image data 2025-02-17 12:49:38 +01:00
Folke Lemaitre
e35d6cd4ba
feat(image): refactor + css/html + beter image fitting 2025-02-15 14:28:49 +01:00