rougier / mu4e-thread-folding

Functions for folding threads in mu4e headers view
GNU General Public License v3.0
136 stars 12 forks source link

strange behavior from 'n' and 'p' keys when near collapsed threads #7

Open mankoff opened 3 years ago

mankoff commented 3 years ago

Navigating the header view with 'n' and 'p' no longer works perfectly.

'n' moves right 1 when 1 line below a ">". 'p' from below a ">" moves to end of line with ">"

rougier commented 3 years ago

I confirm. I'm navigating with up/down arrows which work fine s maybe the native binding for n/p is different. I suspect make you point on an hidden child and this might be the reason.

emacsomancer commented 3 years ago

I think the one issue I'm having is probably the same one as this:

if I navigate in headers view to a folded thread (say by arrows keys or mouse click) and view the first message in the folded thread (without unfolding), then pressing =n= moves me to the next message in the next in the =Article= buffer but the indicator from the =mu4e-headers= buffer just disappears.

Would there be a way of having navigation beyond the first message of a folded thread automatically trigger the unfolding of that thread?

rougier commented 3 years ago

That might be doable. If you look at the toggle-at-point code, I think you can probably adapt it.

maxmahlke commented 3 years ago

I noticed the same scrolling issue as described in the first post, using the j and k keys in evil-mode. Unbinding the keys from the original mu4e-headers-next and mu4e-headers-previous and rebinding to the regular evil-next-line and evil-previous-line fixed it.

  (define-key mu4e-headers-mode-map (kbd "<normal-state> j")     nil)
  (define-key mu4e-headers-mode-map (kbd "<normal-state> j")     'evil-next-line)
  (define-key mu4e-headers-mode-map (kbd "<normal-state> k")     nil)
  (define-key mu4e-headers-mode-map (kbd "<normal-state> k")     'evil-previous-line)
rougier commented 3 years ago

Do you what the difference between the mu4e-heders-next and evil-next-line?

maxmahlke commented 3 years ago

From the documentation, it seems that mu4e-headers-next works based on the message headers, not on the lines themselves. I assume that the folded thread counts as two messages but just one line, so evil-next-line skips the hidden message correctly.

evil-next-line

Documentation Move the cursor COUNT lines down.

mu4e-headers-next

Documentation Move point to the next message header.

rougier commented 3 years ago

Thanks. Skipping hidden lines make sense. I need to implement this (or just copy the code from evil-next-line)