tools/neotree: keep cursor at beginning-of-text, not bol
This commit is contained in:
parent
2425893cc9
commit
40e5357566
1 changed files with 15 additions and 1 deletions
|
@ -38,4 +38,18 @@
|
|||
'((quit . current) (select . t)))
|
||||
|
||||
(when (bound-and-true-p winner-mode)
|
||||
(push neo-buffer-name winner-boring-buffers)))
|
||||
(push neo-buffer-name winner-boring-buffers))
|
||||
|
||||
;; The cursor always sits at bol. `+neotree*fix-cursor' and
|
||||
;; `+neotree*indent-cursor' change that behavior, so that the cursor is always
|
||||
;; on the first non-blank character on the line, in the neo buffer.
|
||||
(defun +neotree*fix-cursor (&rest _)
|
||||
(with-current-buffer neo-global--buffer
|
||||
(+neotree*indent-cursor)))
|
||||
(add-hook 'neo-enter-hook #'+neotree*fix-cursor)
|
||||
|
||||
(defun +neotree*indent-cursor (&rest _)
|
||||
(beginning-of-line)
|
||||
(skip-chars-forward " \t\r"))
|
||||
(advice-add #'neotree-next-line :after #'+neotree*indent-cursor)
|
||||
(advice-add #'neotree-previous-line :after #'+neotree*indent-cursor))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue