Commit graph

400 commits

Author SHA1 Message Date
Folke Lemaitre
d0cb7070e9
feat(input): allow configuring position of prompt and icon 2024-12-13 23:57:50 +01:00
Folke Lemaitre
2a664b615f
ci: try making config options optional 2024-12-13 15:58:54 +01:00
Folke Lemaitre
ac6a74823b
fix(scope): possible loop? See #278 2024-12-13 15:44:11 +01:00
Scott Swensen
ef114c0efe
feat(lazygit): respect existing LG_CONFIG_FILE when setting config paths (#208)
## Description

This change preserves any existing Lazygit user config while still
adding the theme configuration.

New Behavior:
1. Check if `LG_CONFIG_FILE` already exists in the environment
(`vim.env.LG_CONFIG_FILE`)
2. If it exists, use that value; if not, fall back to the default config
path (`vim.fs.normalize(config_dir .. "/config.yml")`)
3. Append the normalized theme configuration path (`opts.theme_path`)

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2024-12-13 14:36:26 +01:00
Folke Lemaitre
05bb95739a
feat(zen): make zen/zoom mode work for floating windows. Closes #5028 2024-12-13 13:37:39 +01:00
Folke Lemaitre
12e68a33b5
fix(notifier): set modifiable=false for notifier history 2024-12-13 13:36:59 +01:00
Folke Lemaitre
e8dd394c01
fix(scope): change from/to selection to make more sense 2024-12-13 13:23:52 +01:00
Folke Lemaitre
5200a8baa5
fix(scratch): normalize filename 2024-12-13 13:23:36 +01:00
Folke Lemaitre
5532ba07be
feat(scroll): improve smooth scrolling when user is spamming keys 2024-12-13 09:52:58 +01:00
Folke Lemaitre
7c7b18fdee
fix(dashboard): set cursor to non-hidden actionable items. Fixes #273 2024-12-13 09:45:28 +01:00
Folke Lemaitre
ec73346b7d
feat(animate): add done to animation object 2024-12-13 08:08:42 +01:00
Folke Lemaitre
370703da81
fix(indent): fix rendering issues when only_scope is set for indent. Fixes #268 2024-12-13 08:08:22 +01:00
Folke Lemaitre
5851de157a
feat(zen): added on_open / on_close callbacks 2024-12-12 18:32:22 +01:00
Folke Lemaitre
54294cba6a
fix(indent): only render adjusted top/bottom. See #268 2024-12-12 18:27:30 +01:00
Folke Lemaitre
c58605f8b3
feat(scroll): added spamming detection and disable animations when user is spamming keys :) 2024-12-12 18:13:19 +01:00
Folke Lemaitre
a986851a74
fix(scroll): don't animate scroll distance 1 2024-12-12 18:13:19 +01:00
Folke Lemaitre
a9e1e699c2
style(indent): comments 2024-12-12 12:01:43 +01:00
Folke Lemaitre
9b4a85905a
feat(indent): don't animate indents when new scope overlaps with the previous one, taking white-space into account. See #264 2024-12-12 11:56:28 +01:00
Folke Lemaitre
39c009fe0b
fix(indent): make sure cursor line is in scope for the out style. Fixes #264 2024-12-12 11:55:46 +01:00
Folke Lemaitre
0a9b013ff1
feat(indent): animation styles out, up_down, up, down 2024-12-12 11:03:35 +01:00
Folke Lemaitre
50912dc2fd
feat(animate): allow toggling buffer-local / global animations with or without id 2024-12-12 09:18:54 +01:00
Folke Lemaitre
42439123c4
feat(util): get var either from buffer or global 2024-12-12 09:18:12 +01:00
Folke Lemaitre
baf8c180d9
feat(indent): move animate settings top-level, since they impact both scope and chunk 2024-12-12 09:17:54 +01:00
Folke Lemaitre
851dc7854b
docs: docgen 2024-12-12 08:44:47 +01:00
Folke Lemaitre
25c290d7c0
feat(animate): allow disabling all animations globally or per buffer 2024-12-12 08:44:19 +01:00
Folke Lemaitre
4f22016b4b
feat(toggle): return toggle after map 2024-12-12 08:00:14 +01:00
Folke Lemaitre
3367705813
feat(toggle): added zoom toggle 2024-12-12 07:28:09 +01:00
SueXY
63506d5168
feat(dashboard): add dashboard startuptime icon option (#214)
## Description

Adds an `icon` option to the dashboard `startup` section. So people
(like me, who thinks an emoji in a bunch of nerdfonts is awkward) can
change it easily.

## Screenshots

<details>
<summary>Screenshots</summary>

Screenshot with a minimal config

![Snipaste_2024-12-07_22-08-42](https://github.com/user-attachments/assets/bf8c4754-3902-412d-83dc-f7efec77ee7f)

</details>

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2024-12-12 06:50:04 +01:00
Folke Lemaitre
2457d913dc
fix(indent): when at edge of two blocks, prefer the one below. See #231 2024-12-12 06:42:35 +01:00
Folke Lemaitre
bc7f96bdee
fix(indent): gradually increase scope when identical to visual selection for text objects 2024-12-11 23:58:55 +01:00
Folke Lemaitre
5f217bca6a
fix(indent): set max_size=1 for textobjects and jumps by default. See #231 2024-12-11 23:58:55 +01:00
Folke Lemaitre
897f801924
fix(indent): expand scopes to inlude end_pos based on the end_pos scope. See #231 2024-12-11 23:58:55 +01:00
Folke Lemaitre
33fbb309f8
fix(compat): fixes for Neovim < 0.10 2024-12-11 23:20:28 +01:00
Folke Lemaitre
b13eaf6bd9
fix(zen): return after closing. Fixes #259 2024-12-11 22:54:19 +01:00
Folke Lemaitre
69018d070c
fix(dim): check if win still exist when animating. Closes #259 2024-12-11 22:53:55 +01:00
Folke Lemaitre
0324125ca1
fix(scope): typo for textobject 2024-12-11 22:37:13 +01:00
pynappo
9c68a54af6
fix(dashboard): add filetype to terminal sections (#215)
The intention is to make it easier to exclude the dashboard terminal
from some plugins. For example, heirline.nvim sets winbar per-window to
allow for winbar to be optionally disabled in non-floating windows, so
this PR lets me disable heirline for snacks' dashboard terminals over
other floating terminals.
2024-12-11 22:35:56 +01:00
Folke Lemaitre
8b58b55e40
fix(notifier): toggle show history. Fixes #197 2024-12-11 22:26:23 +01:00
Folke Lemaitre
ec191b3fe9
docs: docgen 2024-12-11 22:20:26 +01:00
Folke Lemaitre
b72560fa58
docs: docgen 2024-12-11 22:18:44 +01:00
Folke Lemaitre
8faafb3483
feat(scope): text objects and jumping for scopes. Closes #231 2024-12-11 22:17:59 +01:00
Folke Lemaitre
41ca13d119
fix(scroll): don't animate invalid windows 2024-12-11 20:50:44 +01:00
Folke Lemaitre
8c2410c2de
fix(input): set current win in vim.schedule so that it works properly from expr keymaps. Fixes #257 2024-12-11 18:53:38 +01:00
Folke Lemaitre
c1296836f5
fix(indent): better way of dealing with indents on blank lines. See #246 2024-12-11 18:50:55 +01:00
Folke Lemaitre
c17c1b2f6c
fix(input): set current win before executing callback. Fixes #257 2024-12-11 18:31:32 +01:00
Folke Lemaitre
c9f494bd9a
feat(toggle): add which-key mappings when which-key loads 2024-12-11 18:23:39 +01:00
Folke Lemaitre
f540b7b6cc
feat(util): added Snacks.util.on_module to execute a callback when a module loads (or immediately when already loaded) 2024-12-11 18:23:14 +01:00
Folke Lemaitre
6c27ff2a36
fix(input): update window position in the context of the parent window to make sure position=cursor works as expected. Fixes #254 2024-12-11 17:23:27 +01:00
Chris Grieser
e01668c367
fix(input): various minor visual fixes (#252)
## Description
1. Trim the trailing `:` from the prompt. The `:` is usually added to
`vim.ui.input`, since it is by default displayed in the cmdline, where a
separater is useful. As a window title, however, it serves no purpose;
adding a `:` to a title is generally disrecommended.
2. Disable cursorline in the input window by default. Since the input
window by default has a height of 1, the cursorline is not helpful at
all, and only results in an inconsistently looking appearance.
3. In case the user disables the icon by setting it to `""`, there is
excess padding which looks weird (and also does not align with a window
title set to `left`). Thus added a check for an empty string and adjust
the padding accordingly.
4. Set `snacks_input` as default filetype for the input buffer, in line
with how the other modules of `snacks` work.

All four changes are a separate commit, in case one of them is for some
reason not desirable.

## Screenshots
before

![before](https://github.com/user-attachments/assets/fb49e269-ab1d-4510-a571-de3408ac57c3)

after

![after](https://github.com/user-attachments/assets/a0e34d34-c406-4213-8a89-a04d36419362)
2024-12-11 14:51:52 +01:00
Jorge Villalobos
9454ba35f8
feat(toggle): add zen mode toggle (#243)
## Description

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

Adds a `zen` mode toggle.

## 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. -->

![Screenshot 2024-12-10 at 15 19
19](https://github.com/user-attachments/assets/f923f1d2-10f7-440a-9855-0a44e6798269)
![Screenshot 2024-12-10 at 15 19
28](https://github.com/user-attachments/assets/5fb6ca3d-a82d-49e3-92fe-3f7d99d176bb)
![Screenshot 2024-12-10 at 15 20
10](https://github.com/user-attachments/assets/a9560795-51e3-423a-8765-960922855622)
![Screenshot 2024-12-10 at 15 20
17](https://github.com/user-attachments/assets/a6478530-a971-4abe-bb69-3f5cf5d6a579)

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2024-12-11 11:28:48 +01:00