Commit graph

269 commits

Author SHA1 Message Date
Folke Lemaitre
e7a289f327
Merge branch 'main' into input 2024-11-14 18:42:05 +01:00
Folke Lemaitre
14c7875408
docs(terminal): add --color=always to example for Snacks.terminal.colorize() 2024-11-14 14:03:20 +01:00
Folke Lemaitre
0de2599b0a
docs(terminal): show as sh 2024-11-14 09:15:43 +01:00
folke
1b51dd9d2f chore(build): auto-generate docs 2024-11-14 08:13:56 +00:00
Folke Lemaitre
519b6841c4
feat(terminal): added Snacks.terminal.colorize() to replace ansi codes by colors 2024-11-14 09:12:59 +01:00
Folke Lemaitre
14f076e039
fix(lazygit): not needed to use deprecated fallback for set_hl 2024-11-14 09:12:27 +01:00
folke
f29c5865a8 chore(build): auto-generate docs 2024-11-13 09:45:37 +00:00
Folke Lemaitre
215b8b3705
docs: docgen 2024-11-13 10:44:36 +01:00
folke
44c3e9530d chore(build): auto-generate docs 2024-11-13 09:43:08 +00:00
Folke Lemaitre
2ccb70fd3a
fix(terminal): properly deal with args in vim.o.shell. Fixes #69 2024-11-13 10:42:04 +01:00
folke
f704f7479f chore(build): auto-generate docs 2024-11-12 19:10:23 +00:00
Chris Grieser
7627b81d9f
fix(notifier): disable colorcolumn by default (#66)
## Description
`colorcolumn` should be disabled by default, since in most cases, the
user will not want to have them displayed in a notification.

## Screenshots
before:
![Pasted image 2024-11-12 at 19 59
40](https://github.com/user-attachments/assets/c866b87a-6cae-4cb1-9a0c-a769acb3e99a)

after:
![Pasted image 2024-11-12 at 20 02
06](https://github.com/user-attachments/assets/55dc0ea7-34f1-47c4-aaf7-f55175422506)
2024-11-12 20:09:37 +01:00
Folke Lemaitre
97e0e1ec7f
fix(statuscolumn): ensure Snacks exists when loading before plugin loaded 2024-11-12 20:07:48 +01:00
folke
80e7e442ec chore(build): auto-generate docs 2024-11-12 18:57:56 +00:00
Tu Nguyen
f0e47fd5dc
fix(win): take border into account for window position (#64)
## Description

<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->
The window position is not correctly centered when position is set to
`float` and border isn't `none`. I found [a similar
issue](https://github.com/folke/lazy.nvim/issues/812) in
[lazy.nvim](https://github.com/folke/lazy.nvim) along with [your
fix](451f217e9b)
there, so I have applied the same fix here. Thank you for your work!

## Related Issue(s)
https://github.com/folke/lazy.nvim/issues/812

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

## Screenshots

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

### Before
<img width="2240" alt="image"
src="https://github.com/user-attachments/assets/6e5eeb7b-7993-4ab5-a40e-c77021a5ccb0">

### After
<img width="2240" alt="image"
src="https://github.com/user-attachments/assets/66ad76ab-8ca2-446f-afce-b18599313319">

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2024-11-12 19:57:01 +01:00
github-actions[bot]
bc0cf37091
chore(main): release 1.2.0 (#33)
🤖 I have created a release *beep* *boop*
---


## [1.2.0](https://github.com/folke/snacks.nvim/compare/v1.1.0...v1.2.0)
(2024-11-11)


### Features

* **bufdelete:** added `wipe` option. Closes
[#38](https://github.com/folke/snacks.nvim/issues/38)
([5914cb1](5914cb1010))
* **lazygit:** allow overriding extra lazygit config options
([d2f4f19](d2f4f1937e))
* **notifier:** added `refresh` option configurable
([df8c9d7](df8c9d7724))
* **notifier:** added backward compatibility for nvim-notify's replace
option
([9b9777e](9b9777ec3b))
* **words:** add `fold_open` and `set_jump_point` config options
([#31](https://github.com/folke/snacks.nvim/issues/31))
([5dc749b](5dc749b045))


### Bug Fixes

* added compatibility with Neovim &gt;= 0.9.4
([4f99818](4f99818b0a))
* **bufdelete:** opts.wipe. See
[#38](https://github.com/folke/snacks.nvim/issues/38)
([0efbb93](0efbb93e0a))
* **notifier:** take title/footer into account to determine notification
width. Fixes [#54](https://github.com/folke/snacks.nvim/issues/54)
([09a6f17](09a6f17ecc))
* **notifier:** update layout on vim resize
([7f9f691](7f9f691a12))
* **terminal:** `gf` properly opens file
([#45](https://github.com/folke/snacks.nvim/issues/45))
([340cc27](340cc2756e))
* **terminal:** pass a list of strings to termopen to prevent splitting.
Fixes [#59](https://github.com/folke/snacks.nvim/issues/59)
([458a84b](458a84bd1d))


### Performance Improvements

* **notifier:** only force redraw for new windows and for updated while
search is not active. Fixes
[#52](https://github.com/folke/snacks.nvim/issues/52)
([da86b1d](da86b1deff))
* **win:** don't try highlighting snacks internal filetypes
([eb8ab37](eb8ab37f6a))
* **win:** prevent treesitter and syntax attaching to scratch buffers
([cc80f6d](cc80f6dc1b))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-11-11 11:09:15 +01:00
Folke Lemaitre
562a14b43d
docs: docgen 2024-11-11 11:09:05 +01:00
folke
6af863903c chore(build): auto-generate docs 2024-11-11 10:08:25 +00:00
Folke Lemaitre
09a6f17ecc
fix(notifier): take title/footer into account to determine notification width. Fixes #54 2024-11-11 11:07:28 +01:00
folke
3aec3b2536 chore(build): auto-generate docs 2024-11-11 08:32:36 +00:00
Folke Lemaitre
458a84bd1d
fix(terminal): pass a list of strings to termopen to prevent splitting. Fixes #59 2024-11-11 09:31:39 +01:00
Folke Lemaitre
eb8ab37f6a
perf(win): don't try highlighting snacks internal filetypes 2024-11-10 09:20:12 +01:00
folke
166aed6c5d chore(build): auto-generate docs 2024-11-10 07:04:33 +00:00
Folke Lemaitre
0df7775541
docs: docgen 2024-11-10 08:03:44 +01:00
Folke Lemaitre
33ba45c540
docs: fix terminal example 2024-11-10 08:03:35 +01:00
Folke Lemaitre
679074b341
ci: fix docgen titles 2024-11-10 08:03:16 +01:00
folke
aa1c2477eb chore(build): auto-generate docs 2024-11-09 20:48:48 +00:00
Folke Lemaitre
da86b1deff
perf(notifier): only force redraw for new windows and for updated while search is not active. Fixes #52 2024-11-09 21:47:53 +01:00
Folke Lemaitre
df8c9d7724
feat(notifier): added refresh option configurable 2024-11-09 21:47:04 +01:00
Folke Lemaitre
0efbb93e0a
fix(bufdelete): opts.wipe. See #38 2024-11-09 19:19:53 +01:00
Folke Lemaitre
d2f4f1937e
feat(lazygit): allow overriding extra lazygit config options 2024-11-09 17:08:34 +01:00
folke
8a1d11ad08 chore(build): auto-generate docs 2024-11-09 14:45:21 +00:00
Jonáš Dujava
80927949f3
docs(example): fix rename file keymap (#47)
## Description

Fixes "Rename File" keymap in Usage section of README.

Signed-off-by: Jonas Dujava <jonas.dujava@gmail.com>
2024-11-09 15:44:37 +01:00
Folke Lemaitre
4f99818b0a
fix: added compatibility with Neovim >= 0.9.4 2024-11-09 15:38:43 +01:00
folke
18686a41ff chore(build): auto-generate docs 2024-11-09 14:02:17 +00:00
Iordanis Petkakis
340cc2756e
fix(terminal): gf properly opens file (#45)
## Description
1. Currently `gf` only search in current working directory. Use `**` in
`findfile()` to do a recursive search. Otherwise, `gf` can't open a file
down a nested directory.
2. `vim.schedule` the command `vim.cmd("e ", f)`, because otherwise it
opens the file but goes to the buffer that was already opened. Not sure
why this happens, but if we schedule it correctly goes to the opened
buffer by `gf`.
3. Also changed `self:close()` to `self:toggle()`, so as not to reset
the state of the terminal unless a user specifically exits the terminal.
This is rather personal and also based on a [LazyVim
Discussion](https://github.com/LazyVim/LazyVim/discussions/4741), but I
can understand if it's not wanted in the scope of `snacks.nvim` and
probably users could change the behavior of the `gf` key in their
personal configuration.

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

## Related Issue(s)
[A LazyVim
discussion](https://github.com/LazyVim/LazyVim/discussions/4741)
<!--
  If this PR fixes any issues, please link to the issue here.
  - Fixes #<issue_number>
-->

## Screenshots

<!-- Add screenshots of the changes if applicable. -->
2024-11-09 15:01:39 +01:00
Folke Lemaitre
5914cb1010
feat(bufdelete): added wipe option. Closes #38 2024-11-09 15:01:10 +01:00
Folke Lemaitre
9b9777ec3b
feat(notifier): added backward compatibility for nvim-notify's replace option 2024-11-09 14:44:48 +01:00
Folke Lemaitre
7e6ea65f5f
docs: better docgen using treesitter 2024-11-09 14:42:09 +01:00
Folke Lemaitre
7f9f691a12
fix(notifier): update layout on vim resize 2024-11-08 21:19:14 +01:00
Folke Lemaitre
cc80f6dc1b
perf(win): prevent treesitter and syntax attaching to scratch buffers 2024-11-08 15:39:17 +01:00
Chris Grieser
5dc749b045
feat(words): add fold_open and set_jump_point config options (#31)
## Description
Added `fold_open` and `set_jump_point` as config options for
`Snacks.words.jump`.
2024-11-08 14:18:39 +01:00
Folke Lemaitre
5ccf72e6d0
docs(win): document width/height behavior for win 2024-11-08 13:20:02 +01:00
github-actions[bot]
edbd40aab4
chore(main): release 1.1.0 (#4)
🤖 I have created a release *beep* *boop*
---


## [1.1.0](https://github.com/folke/snacks.nvim/compare/v1.0.0...v1.1.0)
(2024-11-08)


### Features

* **bufdelete:** optional filter and shortcuts to delete `all` and
`other` buffers. Closes
[#11](https://github.com/folke/snacks.nvim/issues/11)
([71a2346](71a234608f))
* **debug:** simple log function to quickly log something to a debug.log
file
([fc2a8e7](fc2a8e7468))
* **docs:** docs for highlight groups
([#13](https://github.com/folke/snacks.nvim/issues/13))
([964cd6a](964cd6aa76))
* **gitbrowse:** choose to open repo, branch or file. Closes
[#10](https://github.com/folke/snacks.nvim/issues/10). Closes
[#17](https://github.com/folke/snacks.nvim/issues/17)
([92da87c](92da87c910))
* **notifier:** added history to notifier. Closes
[#14](https://github.com/folke/snacks.nvim/issues/14)
([65d8c8f](65d8c8f00b))
* **notifier:** added option to show notifs top-down or bottom-up.
Closes [#9](https://github.com/folke/snacks.nvim/issues/9)
([080e0d4](080e0d4039))
* **notifier:** allow overriding hl groups per notification
([8bcb2bc](8bcb2bc805))
* **notifier:** allow setting dynamic options
([36e9f45](36e9f45302))
* **win:** added default hl groups for windows
([8c0f10b](8c0f10b9da))
* **win:** allow setting `ft` just for highlighting without actually
changing the `filetype`
([cad236f](cad236f9bb))
* **win:** disable winblend when colorscheme is transparent. Fixes
[#26](https://github.com/folke/snacks.nvim/issues/26)
([12077bc](12077bcf65))
* **win:** equalize splits
([e982aab](e982aabefd))
* **win:** util methods to handle buffer text
([d3efb92](d3efb92aa5))
* **win:** win:focus()
([476fb56](476fb56bfd))
* **words:** `jump` optionally shows notification with reference count
([#23](https://github.com/folke/snacks.nvim/issues/23))
([6a3f865](6a3f865357))
* **words:** configurable mode to show references. Defaults to n, i, c.
Closes [#18](https://github.com/folke/snacks.nvim/issues/18)
([d079fbf](d079fbfe35))


### Bug Fixes

* **config:** deepcopy config where needed
([6c76f91](6c76f91398))
* **config:** fix reading config during setup. Fixes
[#2](https://github.com/folke/snacks.nvim/issues/2)
([0d91a4e](0d91a4e364))
* **notifier:** re-apply winhl since level might have changed with a
replace
([b8cc93e](b8cc93e273))
* **notifier:** set default conceallevel=2
([662795c](662795c285))
* **notifier:** try to keep layout when replacing notifs
([9bdb24e](9bdb24e735))
* **terminal:** dont overwrite user opts
([0b08d28](0b08d280b6))
* **terminal:** user options
([334895c](334895c5bb))
* **win:** better winfixheight and winfixwidth for splits
([8be14c6](8be14c68a7))
* **win:** disable sidescroloff in minimal style
([107d10b](107d10b52e))
* **win:** dont center float when `relative="cursor"`
([4991e34](4991e347dc))
* **win:** properly resolve user styles as last
([cc5ee19](cc5ee192ca))
* **win:** set border to none for backdrop windows
([#19](https://github.com/folke/snacks.nvim/issues/19))
([f5602e6](f5602e60c3))
* **win:** simpler way to add buffer padding
([f59237f](f59237f1dc))
* **win:** update win/buf opts when needed
([5fd9c42](5fd9c426e8))
* **words:** disable notify_jump by default
([9576081](9576081e87))


### Performance Improvements

* **notifier:** index queue by id
([5df4394](5df4394c60))
* **notifier:** optimize layout code
([8512896](8512896228))
* **notifier:** skip processing queue when free space is smaller than
min height
([08190a5](08190a5458))
* **win:** skip events when setting buf/win options. Trigger FileType on
BufEnter only if needed
([61496a3](61496a3ef0))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-11-08 11:06:40 +01:00
Folke Lemaitre
71a234608f
feat(bufdelete): optional filter and shortcuts to delete all and other buffers. Closes #11 2024-11-08 10:58:40 +01:00
Folke Lemaitre
020e42fd18
docs: docgen 2024-11-08 10:40:26 +01:00
Folke Lemaitre
92da87c910
feat(gitbrowse): choose to open repo, branch or file. Closes #10. Closes #17 2024-11-08 10:39:55 +01:00
Folke Lemaitre
42e3a25d95
docs: docgen 2024-11-08 09:44:56 +01:00
Folke Lemaitre
d079fbfe35
feat(words): configurable mode to show references. Defaults to n, i, c. Closes #18 2024-11-08 09:44:45 +01:00
Folke Lemaitre
b8cc93e273
fix(notifier): re-apply winhl since level might have changed with a replace 2024-11-08 09:28:13 +01:00