Commit graph

1292 commits

Author SHA1 Message Date
Folke Lemaitre
2ccb70fd3a
fix(terminal): properly deal with args in vim.o.shell. Fixes #69 2024-11-13 10:42:04 +01: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
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
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 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 Lemaitre
0df7775541
docs: docgen 2024-11-10 08:03:44 +01:00
Folke Lemaitre
679074b341
ci: fix docgen titles 2024-11-10 08:03:16 +01: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 Lemaitre
4f99818b0a
fix: added compatibility with Neovim >= 0.9.4 2024-11-09 15:38:43 +01: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
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
92da87c910
feat(gitbrowse): choose to open repo, branch or file. Closes #10. Closes #17 2024-11-08 10:39:55 +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
Folke Lemaitre
5fd9c426e8
fix(win): update win/buf opts when needed 2024-11-08 09:27:28 +01:00
Folke Lemaitre
9576081e87
fix(words): disable notify_jump by default 2024-11-08 09:15:17 +01:00
Chris Grieser
6a3f865357
feat(words): jump optionally shows notification with reference count (#23)
## Description

Add an opt-in option to show a notification for `Snacks.words.jump`,
that displays the number and index of the current reference. The
notification uses `Snacks.notify.info` to be consistent with the rest of
the repo.

## Screenshots

![Pasted image 2024-11-07 at 16 39
46](https://github.com/user-attachments/assets/35930d62-335a-44b4-be9d-2799c129d324)

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2024-11-08 09:14:30 +01:00
Folke Lemaitre
fc2a8e7468
feat(debug): simple log function to quickly log something to a debug.log file 2024-11-08 08:58:52 +01:00
Folke Lemaitre
8512896228
perf(notifier): optimize layout code 2024-11-08 08:07:41 +01:00
Folke Lemaitre
61496a3ef0
perf(win): skip events when setting buf/win options. Trigger FileType on BufEnter only if needed 2024-11-08 07:28:27 +01:00
Folke Lemaitre
08190a5458
perf(notifier): skip processing queue when free space is smaller than min height 2024-11-08 00:10:51 +01:00
Folke Lemaitre
12077bcf65
feat(win): disable winblend when colorscheme is transparent. Fixes #26 2024-11-07 23:10:39 +01:00
Folke Lemaitre
662795c285
fix(notifier): set default conceallevel=2 2024-11-07 22:31:13 +01:00
Folke Lemaitre
65d8c8f00b
feat(notifier): added history to notifier. Closes #14 2024-11-07 22:25:03 +01:00
Folke Lemaitre
cc5ee192ca
fix(win): properly resolve user styles as last 2024-11-07 22:22:55 +01:00
Folke Lemaitre
5df4394c60
perf(notifier): index queue by id 2024-11-07 20:43:37 +01:00
Folke Lemaitre
f59237f1dc
fix(win): simpler way to add buffer padding 2024-11-07 18:30:01 +01:00
Folke Lemaitre
334895c5bb
fix(terminal): user options 2024-11-07 18:04:37 +01:00
Folke Lemaitre
0b08d280b6
fix(terminal): dont overwrite user opts 2024-11-07 18:03:23 +01:00
borgy
f5602e60c3
fix(win): set border to none for backdrop windows (#19)
## Description
Previously, backdrop windows were being created with the default border
options set in `opts`. I can't imagine this is ever desirable (see
screenshots), so always set the backdrop window border to none.

## Related Issue(s)
N/A

## Screenshots
### Before:

![image](https://github.com/user-attachments/assets/1ff0d810-ac6a-4309-b198-125f2a68331c)

### After:

![image](https://github.com/user-attachments/assets/2f1b348e-4e55-4631-934f-67896c0e2488)
2024-11-07 14:38:16 +01:00
Folke Lemaitre
d3efb92aa5
feat(win): util methods to handle buffer text 2024-11-07 14:32:34 +01:00
Folke Lemaitre
4991e347dc
fix(win): dont center float when relative="cursor" 2024-11-07 14:32:18 +01:00
Folke Lemaitre
107d10b52e
fix(win): disable sidescroloff in minimal style 2024-11-07 14:31:57 +01:00
Teppei Taguchi
59ae7cf162
docs(readme, lazygit): fix typos (#16)
## Description

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

## 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. -->
2024-11-07 13:50:13 +01:00
Folke Lemaitre
080e0d4039
feat(notifier): added option to show notifs top-down or bottom-up. Closes #9 2024-11-07 11:41:51 +01:00
Folke Lemaitre
9bdb24e735
fix(notifier): try to keep layout when replacing notifs 2024-11-07 11:21:37 +01:00
Folke Lemaitre
8bcb2bc805
feat(notifier): allow overriding hl groups per notification 2024-11-07 11:08:31 +01:00
Folke Lemaitre
36e9f45302
feat(notifier): allow setting dynamic options 2024-11-07 10:47:06 +01:00