Commit graph

846 commits

Author SHA1 Message Date
Henrik Lissner
62f9b2ec94
feat(parinfer): enable for dune-mode
Close: #8019
Co-authored-by: i-am-linja <i-am-linja@users.noreply.github.com>
2024-08-25 17:44:28 -04:00
Henrik Lissner
804da58540
fix(format): disable on-save for LaTeX-mode
Since latex-mode != LaTeX-mode.
2024-08-22 12:32:14 -04:00
Henrik Lissner
a0c901cca7
fix(format): lsp-mode/eglot formatters
There seems to be context that eglot needs that isn't available in
Apheleia's scratch buffer.

Fix: #7962
2024-08-22 12:32:14 -04:00
Henrik Lissner
c1c3b521d6
bump: :editor evil
emacs-evil/evil-collection@e49d8e96cc -> emacs-evil/evil-collection@772571fc67
emacs-evil/evil@30ebe6df27 -> emacs-evil/evil@5db0bdc7dc
2024-08-20 18:07:42 -04:00
Henrik Lissner
abf19aa63e
tweak(format): +format/region: emit message on success 2024-08-20 16:36:22 -04:00
Henrik Lissner
67e5dda526
fix(format): void-function +javascript-npm-conf error
Amend: c0a1b9efc9
Close: #8005
2024-08-20 16:27:34 -04:00
Henrik Lissner
50adaa9e48
fix(format): prettier-*: 'void-variable unless' error
Also short-circuits the condition with
apheleia-formatters-respect-indent-level, if it's been disabled.

Amend: c0a1b9efc9
Ref: #7998
2024-08-19 16:21:08 -04:00
Henrik Lissner
c0a1b9efc9
fix(format): prettier: don't override prettier indent config
Apheleia's default config for prettier adds --use-tabs/--tab-width to
force prettier to match Emacs' indent settings, which is fine until a
prettier config file tries to overwrite it and is ignored. As a
compromise (and stopgap solution), I omit these flags if any prettier
settings are set in the current project.

Fix: #7998
2024-08-18 03:59:18 -04:00
Henrik Lissner
f6040832e5
nit(format): move formatter configs to bottom
There will likely be more of these later, so I move them to the bottom
of the :config block.
2024-08-16 14:58:33 -04:00
Henrik Lissner
5e2e886b35
nit: comment revision & reformatting 2024-08-15 23:18:47 -04:00
Henrik Lissner
511c8af365
bump: :editor
doomemacs/snippets@3a0b029c5d -> doomemacs/snippets@b672e69bbf
emacs-evil/evil-collection@acb056b1d0 -> emacs-evil/evil-collection@e49d8e96cc
emacs-evil/evil@0ad84c5216 -> emacs-evil/evil@30ebe6df27
emacs-straight/adaptive-wrap@a3b179ea21 -> emacs-straight/adaptive-wrap@d75665b9c8
emacs-tree-sitter/ts-fold@5b8abb69cd -> emacs-tree-sitter/ts-fold@55f80a202a
gabesoft/evil-mc@bdf893ea6f -> gabesoft/evil-mc@cff3374bfe
justinbarclay/parinfer-rust-mode@a96c768e9d -> justinbarclay/parinfer-rust-mode@0d16bd75ad
2024-08-09 17:41:49 -04:00
Henrik Lissner
c93b70237c
fix(evil): defer evil-collection-kmacro
Emacs 30+ loads kmacro.el eagerly at startup, pulling in all of
evil-collection, so I defer it until it's needed.
2024-08-09 17:41:49 -04:00
Henrik Lissner
877008a00e
fix(evil): set evil-want-keybinding sooner
Early loading of evil-collection may trigger an annoying (and
unsuppressable) warning, otherwise.
2024-08-09 17:41:48 -04:00
Henrik Lissner
0bac5fe132
fix(format): register shfmt for sh-mode
Apheleia already has a (and better) definition for shfmt.

Fix: #5268
2024-07-30 02:54:25 -04:00
Henrik Lissner
04efd82590
feat(evil): optionally wrap move-window commands
Introduces an `+evil-want-move-window-to-wrap-around` option. If
non-nil, `+evil/window-move-*` commands will wrap around the frame. If
these commands are passed the prefix arg, behave as if
`+evil-want-move-window-to-wrap-around` were inverted (just once).

Close: #7218
Co-authored-by: agzam <agzam@users.noreply.github.com>
2024-07-29 18:51:50 -04:00
Henrik Lissner
69f4b70069
fix(evil): remove gA keybind
I was working on a +lookup/assignments around the time I introduced
+lookup/implementations, but I dropped it and forgot to remove this
keybind, which snuck in on f1d89bf.

Amend: f1d89bf9c2
2024-07-25 19:43:28 -04:00
Henrik Lissner
13ed89f235
fix(format): disengage selection after +format-region
Fix: #7951
2024-07-16 11:34:14 -04:00
Henrik Lissner
1eaa1aef2c
refactor(format): rename to +format/org-blocks-in-region
To better reflect that it operates on multiple blocks.

Ref: #7936
2024-07-14 02:00:24 -04:00
Henrik Lissner
7543b04e15
feat(format): add +format/org-block-in-region
Also updates `+org/reformat-at-point` to call
`+format/org-block-in-region` if selection is active.

Fix: #7936
2024-07-14 01:57:20 -04:00
Henrik Lissner
ce84690dc5
feat(evil): vim completion keybinds on C-x
Vim has a set of completion commands bound to the C-x prefix. We had
this for company, but with this commit, we now have them for the corfu
module.
2024-07-13 19:38:20 -04:00
Henrik Lissner
9d7885abbf
fix(evil): q/Q keybinds in view-mode
Caused by evil-collection-view binding q to quit-window, which breaks
view-exit-action. This should be reported upstream.
2024-07-10 01:16:29 -04:00
Henrik Lissner
e43d575caf
refactor(lib): don't use smartparens' API
Toward our eventual goal of moving smartparens out of core, I've adapted
this from code provided by hpfr on Discord, which was adapted from
smartparen's syntax-ppss caching logic. `:config default` will need need
some attention before we can fully move smartparens to its own `:editor
smartparens` module.

Co-authored-by: hpfr <hpfr@users.noreply.github.com>
2024-07-09 20:55:29 -04:00
Eloise Christian
081231b73f fix(format): apheleia doesn't invoke lsp formatter
change `+format--lsp-fn` to run `+format--lsp-fn` in context of main
buffer rather than apheleia's scratch buffer so that the lsp mode can
be discovered
2024-07-08 21:41:39 -04:00
Henrik Lissner
dfe9d572a7
docs(format): hacks: mention save-buffer advice 2024-07-08 13:59:16 -04:00
Henrik Lissner
7d25ba3f6c
fix(format): void function +format-with-lsp-maybe-h error
Regression introduced in fd1941b.

Amend: fd1941b95f
2024-07-08 13:59:06 -04:00
Henrik Lissner
6b526b1b47
refactor(format): +format/org-block: make arg optional 2024-07-07 21:48:17 -04:00
Henrik Lissner
f104f10c5b
docs(format): revise README.org
To reflect recent changes and for clarity.
2024-07-07 21:48:17 -04:00
Henrik Lissner
fd1941b95f
refactor!(format): simplify & gate lsp/eglot impl behind +lsp
BREAKING CHANGE: This commit introduces two changes, a breaking, one
not.

The breaking change: `+format-with-lsp` used to control lsp-mode/eglot
integration for this module, but it is now gated behind a new +lsp flag.
Users will need to add it to their `doom!` blocks (in $DOOMDIR/init.el)
to restore the integration.

The other change: I've merged the former `lsp` and `eglot` formatters
into a single `lsp` formatter that dispatches to the appropriate
backend, as well as wrapping this integration in a
`+format-with-lsp-mode` minor mode, so it can be toggled at will; mainly
to assist in debugging formatter behavior.

A unified formatter makes it easier for folks to configure
`+format-with` on a per-project/directory/file basis, without needing to
know what backend this module uses, and opens us up to integrating other
LSP backends in the future (like lsp-bridge).
2024-07-07 21:43:27 -04:00
Henrik Lissner
cca40c0277
tweak(format): doom-debug-variables: add apheleia-log-debug-info 2024-07-07 21:43:27 -04:00
Henrik Lissner
d648bfda40
docs(format): revise docstrings and comments 2024-07-07 20:41:03 -04:00
Henrik Lissner
c5c7f0bc99
feat(format): add +format-inhibit alias
I want both `apheleia-formatter` and `apheleia-inhibit` exposed for easy
setting from directory/file-local variables (like .dir-locals.el), but
I'd like to abstract away the implementation (Apheleia) a little, hence
these aliases. This way, whether or not we're still using Apheleia in a
year or three, `+format-with` and `+format-inhibit` should always work.
2024-07-07 16:31:24 -04:00
Henrik Lissner
5e78ed0911
refactor(format): use eglot-server-capable
eglot--server-capable was deprecated.
2024-07-07 14:39:50 -04:00
Henrik Lissner
deb59ca4ad
fix(format): LSP formatters before Apheleia is loaded 2024-07-07 14:39:27 -04:00
Henrik Lissner
21a427c33b
fix(format): eglot-managed{,-mode}-hook hook 2024-07-06 21:18:34 -04:00
Henrik Lissner
17d4aaace3
fix(format): add lsp functions
Forgot to include these functions in 8072762. Oops.

Amend: 8072762de8
2024-07-06 21:03:12 -04:00
Henrik Lissner
8072762de8
refactor(format): redesign module
Rather than wrap Apheleia in custom formatting logic, I now use
Apheleia's own machinary to integrate into LSP and Eglot, which is less
complexity to maintain. It also makes settings +format-with a more
reliable option for per-project or per-file configuration.

This also adds a +format/org-src-block command, which I'll incorporate
into the org module in a follow-up commit.

Ref: #7685
2024-07-06 19:54:55 -04:00
Henrik Lissner
2bfb7821b6
refactor(evil): +evil--window-swap: no-op if on edge
Also error checks DIRECTION, just in case.
2024-07-05 20:10:57 -04:00
Henrik Lissner
39ee7129ef
refactor(evil): remove unneeded advice
This was resolved upstream.

Fix: #2493
Ref: emacs-evil/evil#1268
2024-06-30 22:20:39 -04:00
45mg
42ae401deb fix(fold): +fold/next: actually support outlines
The docstring says that this function will move to the next folded
outline heading, but this had not been implemented.
2024-06-27 18:07:33 -04:00
45mg
bff7baca69 fix(fold): fold-levels off-by-one
Without this change, we need to pass a prefix arg that is one more than
the actual fold-level we're trying to achieve; `C-u 2` is equivalent to
not passing a digit arg. While this looks intentional, I don't see what
purpose it serves.

This change provides saner behavior that matches other commands that
handle fold-levels (eg. `org-fold-hide-sublevels`).
2024-06-27 18:07:19 -04:00
45mg
56e998c577 fix(fold): properly handle recursive folds
With four folding systems in play, there are numerous ways to create
nested folds (eg. hideshow folds inside folded outline headings with
`+fold/close-all`). So `+fold/open-rec' needs to be able to open all
kinds of folds within the newly unfolded region. It can't stop at
unfolding the type of fold it was called on.
2024-06-26 20:45:14 -04:00
45mg
c471ab00a6 fix(fold): don't expect evil-vimish-fold
This module is also used by non-Evil users. Also,
`evil-vimish-fold/next-fold` and friends just wrap the corresponding
vimish-fold functions in `dotimes`, anyway.
2024-06-26 20:45:00 -04:00
Henrik Lissner
cc7a509e10
bump: :editor fold
emacs-tree-sitter/ts-fold@6ce584d1ac -> emacs-tree-sitter/ts-fold@5b8abb69cd
2024-06-25 19:36:51 -04:00
Henrik Lissner
7ce9a99583
fix(fold): only enable ts-fold-mode in tree-sitter buffers
ts-fold-mode is buffer-local, and will complain if activated in a buffer
tree-sitter doesn't support (e.g. fundamental-mode). global-ts-fold-mode
will filter based on tree-sitter-mode's activation and language support.

Fix: #7895
2024-06-25 19:36:51 -04:00
Henrik Lissner
c48a5e5f9c
fix(god): cursor color change
If the cursor's color changed from A to B, it didn't change back.

Close: #7841
Amend: #7049
Co-authored-by: darth10 <darth10@users.noreply.github.com>
2024-06-23 15:56:17 -04:00
Henrik Lissner
a3a0629e03
bump: :editor
doomemacs/snippets@c1384cc797 -> doomemacs/snippets@3a0b029c5d
emacs-evil/evil-collection@ca977acb83 -> emacs-evil/evil-collection@acb056b1d0
emacs-evil/evil@0251080640 -> emacs-evil/evil@0ad84c5216
emacs-straight/adaptive-wrap@70005d2012 -> emacs-straight/adaptive-wrap@a3b179ea21
emacs-tree-sitter/ts-fold@0627723e5f -> emacs-tree-sitter/ts-fold@6ce584d1ac
emacsmirror/visual-fill-column@5e74afe39d -> emacsmirror/visual-fill-column@e04d3521b6
joaotavora/yasnippet@297546f085 -> joaotavora/yasnippet@eb5ba2664c
juliapath/evil-numbers@7a1b62afc1 -> juliapath/evil-numbers@c789989451
justinbarclay/parinfer-rust-mode@e9a23e136b -> justinbarclay/parinfer-rust-mode@a96c768e9d
magnars/multiple-cursors.el@234806c832 -> magnars/multiple-cursors.el@c870c18462
radian-software/apheleia@96a9805ecb -> radian-software/apheleia@61766b50b2
2024-06-22 18:14:05 -04:00
Henrik Lissner
b405225b90
refactor!(vc-gutter): drop git-gutter for diff-hl
BREAKING CHANGE: This removes git-gutter as an implementation for the
`:ui vc-gutter` module, leaving only the diff-hl implementation. There
are no longer any +git-gutter or +diff-hl flags for this module. Users
don't have to do anything to keep the vc gutter, unless they prefer
git-gutter for any reason (in which case they'll need to install and set
it up themselves).

This has been planned for some time, because of a roadmap goal for Doom
to lean into native/built-in functionality where it's equal or better
than the third party alternatives. diff-hl relies on the built-in vc.el
library instead of talking to git directly (thus expanding support to
whatever VCS's vc.el supports, and not git alone), which also means it
can take advantage of its caching and other user configuration for
vc.el. Overall, it is faster and lighter.

What I've also been waiting for was a stage-hunk command, similar to
git-gutter:stage-hunk, which arrived in dgutov/diff-hl@a0560551cd and
dgutov/diff-hl@133538973b, and have evolved since.

Ref: dgutov/diff-hl@a0560551cd
Ref: dgutov/diff-hl@133538973b
Ref: https://github.com/orgs/doomemacs/projects/5/views/1?pane=issue&itemId=58747789
2024-06-22 18:14:04 -04:00
Hyunggyu Jang
6479fc7132 fix(word-wrap): choose first element if indent-var is list 2024-06-19 22:25:34 -04:00
Henrik Lissner
7c20ef2619
bump: :editor parinfer
justinbarclay/parinfer-rust-mode@8df117a3b5 -> justinbarclay/parinfer-rust-mode@e9a23e136b

Close: #7876
Co-authored-by: welcome-linja <welcome-linja@users.noreply.github.com>
2024-06-03 16:22:10 -04:00
Henrik Lissner
9620bb45ac
fix(evil): ]f/[f opening broken symlinks 2024-04-18 14:20:48 -04:00