Commit graph

1292 commits

Author SHA1 Message Date
Folke Lemaitre
63277f96c9
refactor(compat): use svim.islist 2025-02-20 07:00:05 +01:00
Folke Lemaitre
bc902f7032
feat(compat): added svim, a compatibility layer for Neovim. Closes #1321 2025-02-20 06:59:44 +01:00
Folke Lemaitre
4551f499c7
fix(picker): go back to last window on cancel instead of main 2025-02-20 06:24:06 +01:00
Stefan Boca
4f8b9ebf71
fix(image.doc): crop inline typst equations properly (#1320)
Some checks failed
CI / ci (push) Failing after 0s
## Description

Tall inline typst equations were previously cropped too much vertically.
The change to the template now resize text frames to the bounding box of
their glyphs. See
https://typst.app/docs/reference/text/text/#parameters-top-edge for more
details.

## Related Issue(s)

<!--
  If this PR fixes any issues, please link to the issue here.
  - Fixes #<issue_number>
-->

## Screenshots
Before:

![image](https://github.com/user-attachments/assets/15ea02e2-7d10-43bb-8d4f-fc51013c8a20)
After:

![image](https://github.com/user-attachments/assets/70de42d9-4b29-4333-a908-6be4729baa8a)
2025-02-19 23:41:29 +01:00
Folke Lemaitre
31e21ccef8
fix(image): move assertion for src/content. See #1276 2025-02-19 23:40:18 +01:00
Folke Lemaitre
bde3adddc7
feat(image.doc): allow configuring the header for latex / typst inline in the document. Closes #1303 2025-02-19 23:06:51 +01:00
Folke Lemaitre
e2d9941896
perf(image): no need to run identify before convert for local files 2025-02-19 22:56:11 +01:00
Folke Lemaitre
6d1cda4a6d
fix(image): let text conversion continue on errors. See #1303 2025-02-19 22:56:11 +01:00
Folke Lemaitre
f45dd6c44c
fix(image): remove some default latex packages 2025-02-19 22:56:11 +01:00
Folke Lemaitre
6614a2c84f
feat(explorer): deal with existing buffers when renaming / deleting files. Closes #1315 2025-02-19 22:18:21 +01:00
Folke Lemaitre
5f2864e8c9
style(picker): fix autogen types for select & resume 2025-02-19 19:44:52 +01:00
Folke Lemaitre
a1cb54cc9e
fix(win): call on_close before actually closing so that prev win can be set. Closes #962 2025-02-19 19:38:36 +01:00
Folke Lemaitre
bf01460e6d
feat(image): use search dirs to resolve file from both cwd and dirname of file. Closes #1305 2025-02-19 18:43:37 +01:00
Folke Lemaitre
d389c5df14
feat(image): better health checks 2025-02-19 17:16:05 +01:00
Folke Lemaitre
bd6a62af12
feat(picker): renamed native -> builtin + fixed diff mode used for undo. Closes #1302 2025-02-19 16:56:40 +01:00
Folke Lemaitre
92786c5b03
feat(picker.git_diff): use the diff previewer for git_diff so that delta can be used. See #1302 2025-02-19 16:56:40 +01:00
Folke Lemaitre
684666f643
feat(image): conceal option for inline rendering (disabled by default) 2025-02-19 15:41:16 +01:00
Iordanis Petkakis
d62e7527a5
feat(words): add filter function for user to disable specific filetypes (#1296)
## Description
This allows user to specify explicitly filetypes to disable
`snacks.words`.
<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->

## Related Issue(s)
Closes #1294 
<!--
  If this PR fixes any issues, please link to the issue here.
  - Fixes #<issue_number>
-->

## Screenshots

<!-- Add screenshots of the changes if applicable. -->
2025-02-19 15:24:01 +01:00
Folke Lemaitre
65f89e2d6f
feat(image.doc): allow setting image.src with #set!. Closes #1276 2025-02-19 15:17:33 +01:00
Tristan Partin
a3b47e5202
feat(gitbrowse): add support for git.sr.ht (#1297)
Simply upstreaming this from my own config.

Signed-off-by: Tristan Partin <tristan@partin.io>
2025-02-19 15:15:21 +01:00
Folke Lemaitre
45ec90bdd9
fix(words): default count to 1. Closes #1307 2025-02-19 15:12:59 +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
b052eb9372
feat(image): allow customizing font size for math expressions 2025-02-19 13:15:42 +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
aaed4a9411
fix(health): skip dot dirs... Closes #1293 2025-02-19 00:15:10 +01:00
Folke Lemaitre
e2258236a2
feat(image): added math rendering for typst. Closes #1260 2025-02-19 00:11:27 +01:00
Folke Lemaitre
76f5ee4a1b
fix(image.doc): fixed at_cursor. Closes #1258
Some checks failed
CI / ci (push) Failing after 0s
2025-02-18 23:36:07 +01:00
Folke Lemaitre
2ee64887c2
fix(image.latex): include doc packages for math rendering. Closes #1262 2025-02-18 23:24:16 +01:00
Joshua Li
b91f417670
perf(dashboard): speed up filtering for recent_files (#1250)
## Description

I have 5000 oldfiles, every time i go to a new directory and open nvim,
the dashboard recent_files (with `cwd=true`) computation takes 4-5
seconds to go through all oldfiles before deciding nothing should show
up

```lua
sections = {
  { icon = " ", title = "Recent files (current directory)", section = "recent_files", cwd = true },
}
```

It appears to be the `vim.v.oldfiles[i]` indexing. I didn't look much
into it but it opens much faster looping with ipairs.

Repro:
1. add the above section config in dashboard
2. increase oldfiles limit and populate up to the limit
3. `mkdir brand-new-directory; cd brand-new-directory; nvim`
4. the section is empty as expected, but it takes a few seconds before
dashboard shows up

## Related Issue(s)

<!--
  If this PR fixes any issues, please link to the issue here.
  - Fixes #<issue_number>
-->

## Screenshots

<!-- Add screenshots of the changes if applicable. -->
2025-02-18 23:05:55 +01:00
Folke Lemaitre
a9a84dde2e
fix(picker.actions): keymap confirm. Closes #1252 2025-02-18 23:05:40 +01:00
Folke Lemaitre
570c035b94
fix(picker.actions): better set cmdline. Closes #1291 2025-02-18 23:00:02 +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
5c0607e31a
fix(image): better image position caluclation. Closes #1268 2025-02-18 22:02:59 +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
44e2f8e573
fix(image): fix disappearing images when changing colorscheme 2025-02-18 21:52:16 +01:00
Folke Lemaitre
77204102a1
fix(win): better handling when the command window is open. Closes #1245 2025-02-18 21:23:10 +01:00
Imron Gamidli
8c1166165b
feat(git_log): add author filter (#1091)
## Description

I was using LazyGit feature to filter git logs by the author,
unfortunately it was missing in snacks picker. Here is my solution to
it. Let me know if you have better suggestion :)

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2025-02-18 21:12:31 +01:00
Folke Lemaitre
f32002607a
fix(picker.git): formatting of git log 2025-02-18 21:10:25 +01:00
folke
988af56423 chore(build): auto-generate docs 2025-02-18 20:08:52 +00:00
Pedro Pombeiro
4d46574b24
feat(picker.git): allow passing extra args to other git pickers (#1205)
## Description

<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->

This PR builds on
7122a03fdf
to provide a way to pass custom `args` to git command invocations.

An alternative (probably cleaner) way of doing this could be to add an
`args` field to `picker.sources.git`:

```yaml
      picker = {
        ---@class snacks.picker.previewers.Config
        previewers = {
          git = {
            args = git_opts(),
          },
        },
        ---@class snacks.picker.sources.Config
        sources = {
          git = {
            args = git_opts(),
          },
        },
```

## Related Issue(s)

<!--
  If this PR fixes any issues, please link to the issue here.
  - Fixes #<issue_number>
-->

Fixes #1184

## Screenshots

<!-- Add screenshots of the changes if applicable. -->

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2025-02-18 21:07:50 +01:00
Folke Lemaitre
d6a38acbf5
feat(picker): new native diff mode (disabled by default). Can be used to show delta diffs for undo. Closes #1288 2025-02-18 20:47:11 +01:00
Folke Lemaitre
74c42985be
fix(image): wrong return when trying second command 2025-02-18 18:55:53 +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
de3cba5158
fix(image): fixup 2025-02-18 17:07:04 +01:00
Folke Lemaitre
f8c4e03d02
fix(image): create cache dir 2025-02-18 17:05:50 +01:00
Olle Månsson
54ab77c5d2
feat(image): add support for svelte (#1277)
## Description

Added queries for Svelte as well, based on Vue.

Note that I am not sure if the current HTML queries, which both Vue and
this Svelt query inherits from, is working as intended.

I do not get any sort of inline images. But I guess that will have to be
debugged and fixed in another issue and the fix should not affect this
patch (hopefully).

## Related Issue(s)

Fixes #1275

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2025-02-18 16:49:40 +01:00
Folke Lemaitre
13863ea25d
fix(image): remove debug 2025-02-18 16:37:42 +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