mickeynp / combobulate

Structured Editing and Navigation in Emacs with Tree-Sitter
GNU General Public License v3.0
945 stars 54 forks source link

Minor `combobulate-navigate-end-of-defun` behavior mismatch with other packages #20

Closed 2kays closed 1 year ago

2kays commented 1 year ago

This is minor but worth documenting, as Combobulate drops in its own end-of-defun on top of treesit's.

Combobulate's combobulate-navigate-end-of-defun (C-M-e) does not behave exactly like treesit-end-of-defun (and Emacs' end-of-defun in Lispier modes).

Given initial buffer state:

|def f():
    pass
# Comment (or empty line)

combobulate-navigate-end-of-defun takes us here:

def f():
    pass|
# Comment (or empty line)

Whereas, treesit-end-of-defun takes us here:

def f():
    pass
|# Comment (or empty line)

GNU Emacs 30.0.50 (master), Combobulate master@5806ad7

mickeynp commented 1 year ago

Thanks for raising it. They're intentionally different implementations and I've no real plan to ensure parity with Emacs's. (Indeed, people can freely use that one if they prefer it.) It's simply a matter of taste more than anything, I think.

Moving to a newline is only going to work for things like def and class but it would not for lambda for instance. And I rather purposefully want to avoid having rules for one defun over another; it's just a bit messy.