New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to stage individual lines using magit #15448
Comments
|
After a package update today, I experience the same issue. I regularly use this feature of magit, so hope someone can contribute a work-able fix to Spacemacs to make these packages work again. Rather than do a full package update rollback, I manually copied the previous magit package folder, A full rollback is a safer approach though. |
|
So maybe it's an upstream issue? |
|
It is indeed upstream in a literal sense. However, it's arguably not a bug in |
|
to fix this:
|
|
Perfect; I'll do that in a PR shortly |
|
I also think it makes sense not to turn on evil-surround globally. Specifically, it can be turned on for all text-mode and prog-mode. Or in other words, specialm-mode won't be affected. This should be fine in most use cases. Except for a few specfic special-mode such as various terminal, inferior emacs lisp, inferior python, etc. But then evil-surround can be turned on when needed. |
|
With the latest Magit Melpa package installed, using |
|
Addressed this in #15462. While I agree that |
|
Fixed in #15462 |
|
I will keep it open and close it until evil-surround is turned off for special-mode buffers. |
Why do that though? Is it causing any issues as far as you know? |
|
Okay I made a tracking issue referencing this and closed this one. |
Activating evil-surround in special-mode (i.e. read-only) buffers does not make sense. Furthermore, the bindings can overwrite bindings in modes like magit-diff-mode (see syl20bnr/spacemacs#15448 (comment)). This commit limits the 'globally activated modes' to text-mode and prog-mode via the `define-globalized-minor-mode` its [:predicate](https://www.gnu.org/software/emacs/manual/html_node/elisp/Defining-Minor-Modes.html#index-define_002dglobalized_002dminor_002dmode] keyword. As this should be the default behavior, it is not essential to change the documentation.
Activating evil-surround in special-mode (i.e. read-only) buffers does not make sense. Furthermore, the bindings can overwrite bindings in modes like magit-diff-mode (see syl20bnr/spacemacs#15448 (comment)). This commit limits the 'globally activated modes' to (modes derived from) text-, prog- and comint-mode via the `define-globalized-minor-mode` its [:predicate](https://www.gnu.org/software/emacs/manual/html_node/elisp/Defining-Minor-Modes.html#index-define_002dglobalized_002dminor_002dmode] keyword. As this should be the default behavior, it is not essential to change/update the documentation.
Description
Unable to stage individual lines using magit
I believe this is due to this recent change in
magit.Previously,
magit-stagewas bound tosusing thekeymaptext property,which has very high priority. Now, instead the text property simply rebinds
magit-stage-filetomagit-stage.sis bound tomagit-stage-filein thekeymap for the
magit-statusglobal mode, butevil-surroundbindsstoevil-surround-regionwhen in visual state, which has higher priority than theglobal mode keymap.
This isn't really a bug in
magitbut rather a complication of usingevil-surroundandmagitat the same time. This could potentially be remediedby making a change to
evil-collectionto explicitly mapstomagit-stagein a way that would override the
evil-surround-regionmapping, or really any solution that would appropriately over-shadow theevil-surround-regionmapping withmagic-stage. I'm happy to take this on in a PR, but am open to input on the most graceful way to fix this (e.g., inspacemacs, inevil-collection, or (somehow?) inmagititself).Reverting to an older version of
magitremedies the issue.Reproduction guide 🪲
SPC g s)v) and select a line or two (j)sto try to stage just those linesObserved behaviour: 👀 💔
sdoesn't stage and instead waits for another character due toevil-surround-regionfiringExpected behaviour: ❤️ 😄
sshould triggermagit-stageand stage the currently selected linesSystem Info 💻
The text was updated successfully, but these errors were encountered: