Skip to content

Conversation

@junyixu
Copy link

@junyixu junyixu commented Dec 29, 2025

Description

Related Issue(s)

Screenshots

image

*   Prevent inline image previews from displaying when Neovim is in Insert or Select mode.
*   Hide the image preview when the cursor is positioned within the source text range of the concealed expression.
*   Refresh the concealment state immediately after image placements are updated to ensure visibility rules are applied instantly.
* Simplify cursor range checks for concealed inline images
* Hide image previews if the cursor is on any line covered by the range
* Explicitly include 'math' type images in the concealment hiding logic
*   Introduce `M.match_at_cursor` to return the full image match object, decoupling it from the old `M.at_cursor` function.
*   Update `M.at_cursor` to use the new matching function, maintaining backward compatibility while simplifying the original implementation.
*   Prevent image hover popups from appearing in non-normal modes, ensuring the hover window only shows up during navigation.
*   Ensure float windows are created when `Snacks.image.config.doc.float` is true, regardless of the `inline` setting, allowing simultaneous use of inline placeholders and hover previews.
- Calculate the buffer position corresponding to the end of the image range.
- Position the hover window relative to the range end when the image has defined delimiters.
- Ensure the image preview does not overlap the closing delimiters of the source expression.
- Update image documentation hover when the cursor moves in insert mode by listening to `CursorMovedI`.
- Allow documentation hover windows to remain visible in insert and select modes.
- Refine inline image concealment logic to only hide images in insert or select mode if they are explicitly marked for concealment.
- Conceal the image placement when the cursor enters the text range it represents.
- Apply cursor-based hiding logic in Normal mode to allow editing of concealed source text.
- Prevent hiding images that belong to inactive or non-current buffers during updates.
@github-actions github-actions bot added image size/l Large PR (<100 lines changed) labels Dec 29, 2025
@junyixu junyixu changed the title latex inline + hover feat(latex): latex inline + hover Dec 29, 2025
@junyixu
Copy link
Author

junyixu commented Dec 29, 2025

Previously, after a LuaSnip expansion(entering Select mode), the inline preview image ends up covering the code(i.e. latex) content.

image

The luasnip:

parse({ trig = "sum", name = "sum" }, "\\sum_{n=${1:1}}^{${2:\\infty}} ${3:a_n z^n}"),

@junyixu junyixu changed the title feat(latex): latex inline + hover fix(latex): latex inline + hover Dec 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

image size/l Large PR (<100 lines changed)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant