doomemacs / doomemacs

An Emacs framework for the stubborn martian hacker
MIT License
19.43k stars 3.06k forks source link

TAB doesn't toggle magit sections #4548

Closed SkyLeite closed 3 years ago

SkyLeite commented 3 years ago

What did you expect to happen? Pressing TAB on an unstaged change on Magit runs magit-section-toggle and opens a small diff of the change.

What actually happened? Pressing TAB on an unstaged change on Magit errors with "No matching item found on current line"

Additional details:

  1. SPC h k TAB with magit open returns evil-jump-item
  2. Opening Magit's help menu with ? then immediately pressing TAB results in the expected behavior
  3. M-x and typing magit-section-toggle shows it is bound to TAB (magit-section-toggle (TAB))

Steps to reproduce:

  1. Open magit on a repository with unstaged changes with SPC g g
  2. Move to an unstaged change
  3. Press TAB

System information:

SYSTEM  type       gnu/linux
    config     x86_64-pc-linux-gnu
    shell      /bin/fish
    uname      Linux 5.10.9-arch1-1 #1 SMP PREEMPT Tue, 19 Jan 2021 22:06:06 +0000 x86_64
    path       (~/.rbenv/shims ~/.asdf/shims /opt/asdf-vm/bin ~/.local/bin ~/.cargo/bin ~/.emacs.d/bin ~/.config/nvm/12.20.0/bin /usr/local/bin /usr/bin /bin /usr/local/sbin /usr/lib/jvm/default/bin /usr/bin/site_perl /usr/bin/vendor_perl /usr/bin/core_perl /usr/lib/emacs/27.1/x86_64-pc-linux-gnu)
EMACS   dir        ~/.emacs.d/
    version    27.1
    build      ago 28, 2020
    buildopts  --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib --localstatedir=/var --with-x-toolkit=gtk3 --with-xft --with-wide-int --with-modules --with-cairo --with-harfbuzz 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt' CPPFLAGS=-D_FORTIFY_SOURCE=2 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now
    features   XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD JSON PDUMPER LCMS2 GMP
    traits     (batch server-running envvar-file)
DOOM    dir        ~/.doom.d/
    version    2.0.9
    build      HEAD -> develop 2ad1eab6e 2021-01-18 19:59:18 -0500
    elc-files  146
    modules    (:completion (company +childframe) (ivy +fuzzy +childframe) :ui doom doom-dashboard doom-quit hl-todo indent-guides modeline nav-flash ophints (popup +all +defaults) treemacs vc-gutter vi-tilde-fringe window-select workspaces :editor (evil +everywhere) file-templates fold (format +onsave) multiple-cursors rotate-text snippets :emacs (dired +ranger +icons) electric :term eshell :emacs (&nopath imenu) vc :tools editorconfig eval :checkers syntax :tools (lookup +docsets) lsp (magit +forge) :lang (cc +lsp) (csharp +lsp +unity) data (elixir +lsp) (elm +lsp) emacs-lisp go (haskell +lsp) (javascript +lsp) kotlin ledger lua nix (org +attach +babel +capture +export +habit +present +protocol) (python +lsp +pyright) (ruby +lsp +rbenv +rails) (rust +lsp) (sh +fish) (web +lsp) (yaml +lsp) (fsharp +lsp) :email (mu4e +gmail) :collab (&nopath impatient-mode) :config (default +bindings +smartparens))
    packages   ((ox-hugo) (mpdel) (ivy-mpdel) (evil-numbers) (org-gcal :recipe (:host github :repo kidd/org-gcal.el)) (company-statistics))
    unpin      (n/a)
    elpa       (n/a)
hlissner commented 3 years ago

This has been reported before (on Discord) in magit and in org, but with no consistency. I'm unable to reproduce it on any of my test machines (Arch, NixOS, macOS, and Ubuntu), using 26.3, 27.1, 28 and 28+gccemacs. I'll revisit this once I find a lead.

SkyLeite commented 3 years ago

If there's any way I can provide more information let me know.

SkyLeite commented 3 years ago

Ok, it seems like disabling the +everywhere flag on the evil module makes TAB work again. Maybe it's something on evil-collection?

Edit: another development. shift+tab seems to work.

chzerv commented 3 years ago

Not sure if this is helpful, but I've only had this happen after byte-compiling my config (with doom compile). When pressing TAB in a magit section, the following error appears in Messages:

user-error: No matching item found on the current line

Are you byte-compiling your config @RodrigoLeiteF ?

SkyLeite commented 3 years ago

Not sure if this is helpful, but I've only had this happen after byte-compiling my config (with doom compile). When pressing TAB in a magit section, the following error appears in Messages:

user-error: No matching item found on the current line

Are you byte-compiling your config @RodrigoLeiteF ?

Yes! Good catch. Running doom clean made the issue go away so it's definitely related.

Raialbe commented 3 years ago

I'm getting the same bug, it seems that org mode activates only halfway and to solve I have to call org-mode again manually. A related bug is that when org mode is half activated it will not follow links on point with return but will just go to the next line. Simliarly in this state the list items checked as completed do not get the correct faded out face but remain instead of their default color. This happens even when not byte-compiling the config files.

aidenscott2016 commented 3 years ago

I've just had this issue after recompiling. doom clean also fixed it for me

mmarshall540 commented 3 years ago

Was also having this problem with org-mode. The org-cycle binding for TAB would not come about, and it seemed like there was no way to get it to.

So I backed up my configuration and re-installed Doom. With a clean install, org-cycle was bound to TAB upon entering org-mode, and cycling on headers with TAB worked fine.

So I began to re-implement my config one setting at a time in order to recreate the problem. It didn't take long at all.

The first setting I tried was to remove the "+everywhere" flag from the evil module.

from: :editor (evil +everywhere); come to the dark side, we have cookies to: :editor evil; come to the dark side, we have cookies

Save, exit, run doom sync, and restart. Tab doesn't work. Undo the edit, run doom sync, and restart. Tab works again.

hlissner commented 3 years ago

As of 16a495c this issue should be resolved. Let me know if that isn't the case and I'll reopen it. Thanks for bringing it to my attention!

SkyLeite commented 3 years ago

I'm still having this issue on the latest commit.

SYSTEM  info       ("EndeavourOS Linux" . Linux 5.10.9-arch1-1 x86_64)
    shell      /bin/fish
    path       (~/.rvm/gems/ruby-2.7.1/bin ~/.rvm/gems/ruby-2.7.1@global/bin ~/.rvm/rubies/ruby-2.7.1/bin ~/.rvm/bin /bin ~/.npm-global/bin ~/.local/bin ~/.cargo/bin ~/.emacs.d/bin ~/.config/nvm/12.4.0/bin /usr/local/bin /usr/bin /bin /usr/local/sbin /usr/lib/jvm/default/bin /usr/bin/site_perl /usr/bin/vendor_perl /usr/bin/core_perl /usr/lib/emacs/27.1/x86_64-pc-linux-gnu)
EMACS   dir        ~/.emacs.d/
    version    (27.1 ago 28, 2020)
    buildopts  --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib --localstatedir=/var --with-x-toolkit=gtk3 --with-xft --with-wide-int --with-modules --with-cairo --with-harfbuzz 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt' CPPFLAGS=-D_FORTIFY_SOURCE=2 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now
    features   XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD JSON PDUMPER LCMS2 GMP
    traits     (batch server-running envvar-file byte-compiled-config)
DOOM    dir        ~/.doom.d/
    version    (2.0.9 HEAD -> develop 28b3ad452 2021-02-16 11:44:59 -0500)
    modules    (:completion (company +childframe) (helm +fuzzy) :ui doom doom-dashboard doom-quit hl-todo indent-guides modeline nav-flash ophints (popup +all +defaults) treemacs vc-gutter vi-tilde-fringe window-select workspaces :editor (evil +everywhere) file-templates fold (format +onsave) multiple-cursors rotate-text snippets :emacs (dired +ranger +icons) electric :term eshell :emacs (&nopath imenu) vc :tools editorconfig eval :checkers syntax :tools (lookup +docsets) lsp (magit +forge) :lang (cc +lsp) (csharp +lsp +unity) data (elixir +lsp) (elm +lsp) emacs-lisp go (haskell +lsp) (javascript +lsp) kotlin ledger lua nix (org +attach +babel +capture +export +habit +present +protocol) (python +lsp +pyright) (ruby +lsp +rvm +rails) (rust +lsp) (sh +fish) (web +lsp) (yaml +lsp) (fsharp +lsp) :email (mu4e +gmail) :collab (&nopath impatient-mode) :config (default +bindings +smartparens))
    packages   ((ox-hugo) (mpdel) (ivy-mpdel) (evil-numbers) (org-gcal :recipe (:host github :repo kidd/org-gcal.el)) (company-statistics) (eslintd-fix) (company-tabnine))
    unpin      (n/a)
    elpa       (n/a)
reedspool commented 3 years ago

I newly had this issue after upgrading (to after 16a495c) and compiling.

I already had (evil +everywhere) which I saw above as a resolution.

doom clean did resolve the issue for me.

SYSTEM  info       (Pop!_OS 20.10 . Linux 5.8.0-7642-generic x86_64)
    shell      /bin/bash
    path       (--- omitted as ridiculously long ---)
EMACS   dir        ~/.emacs.d/
    version    (27.1 86d8d76aa36037184db0b2897c434cdaab1a9ae8 Jan 04, 2021)
    buildopts
    features   XPM JPEG TIFF GIF PNG RSVG SOUND GPM DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD JSON PDUMPER LCMS2 GMP
    traits     (batch server-running envvar-file)
DOOM    dir        ~/.doom.d/
    version    (2.0.9 HEAD -> develop 28b3ad452 2021-02-16 11:44:59 -0500)
    modules    (:completion company ivy :ui deft doom doom-dashboard doom-quit fill-column hl-todo modeline nav-flash neotree ophints (popup +defaults) unicode vc-gutter vi-tilde-fringe window-select workspaces zen :os (tty +osc) :editor (evil +everywhere) file-templates fold format lispy multiple-cursors rotate-text snippets :emacs dired electric ibuffer undo vc :term shell vterm :checkers syntax spell grammar :tools ansible docker editorconfig (eval +overlay) gist (lookup +dictionary +offline +docsets) lsp (magit +forge) make pass pdf rgb tmux upload :lang common-lisp data emacs-lisp json (javascript +lsp) latex markdown (org +dragndrop +journal +noter +pomodoro +present +roam +pretty +pandoc +gnuplot) plantuml racket rest (ruby +rails) scheme sh web yaml :app calendar :config (default +bindings +smartparens))
    packages   ((org) (org-drill) (org-super-agenda) (org-roam-server) (org-ql) (metrics-tracker) (org-analyzer))
    unpin      (n/a)
    elpa       (crossword)
rgrinberg commented 3 years ago

I'm able to reproduce this issue as well.

kitchen commented 3 years ago

same, but also unreliably. happens 100% of the time on my work computer (mac running catalina, emacs-plus 27.1) but not my other computers (big sur running 27.1 or rpi running ubuntu 20.04 and emacs 26.3. Happy to provide any info I can or try debugging steps!

I thought maybe it was some weird cache thing so I wiped out my whole .emacs.d directory, updated to latest develop (5d9efe89) and recompiled everything using my usual bin/doom clean && bin/doom sync -u && bin/doom sync && bin/doom compile method (I'm pulling in doom as a submodule from my dotfiles repo)

Thanks!

kitchen commented 3 years ago

fun: on my work computer, in gui mode I get this issue, in tui mode, it works as expected.

doing C-h k TAB in tui mode says magit-section-toggle, in gui mode it's evil-jump-item

kitchen commented 3 years ago

also, oddly, if I M-x magit-section-toggle in gui it shows TAB as the assigned keybind, but if I M-x evil-jump-item it shows without a bind.

looking at C-h f for those I see under keybindings:

wat.

I'm way over my head here, but thought I'd show the debugging things I've tried so far :D