Open johanatan opened 4 years ago
Repro steps are as follows: 1) enable clojure mode. 2) enable superword mode. 3) advance one word at a time until you get stuck at the end of a line (does not happen on every line).
@dpsutton
@duianto please let me know if you require more detail. thank you.
I was unable to reproduce this on my non-spacemacs distro with clojure-mode and superword-mode enabled. What makes you think its these two packages interacting?
I reproduced this on a fresh machine w/ a fresh install of spacemacs (default config, no customization). I have no knowledge of whether it reproduces on vanilla emacs or not. The combination of things here is: a) spacemacs b) superword-mode c) clojure-mode.
Confirmed
In this example file: https://github.com/clojurebook/ClojureProgramming/blob/master/ch03-game-of-life/src/com/clojurebook/collections/life.clj
With the url added on the first line as a comment:
;; https://github.com/clojurebook/ClojureProgramming/blob/master/ch03-game-of-life/src/com/clojurebook/collections/life.clj
pressing w
, stops at the end of the url
and after function names with a dash:
(defn empty-board
(defn count-neighbours
etc.
There's an open issue about it upstream in the emacs-evil/evil
repository:
evil-forward-word-begin doesn't work with superword-mode https://github.com/emacs-evil/evil/issues/721
There's a comment with a possible workaround: https://github.com/emacs-evil/evil/issues/721#issuecomment-517855583
I am experiencing this issue as well.
If it helps, I found that disabling superword-mode and using this workaround helps: https://emacs.stackexchange.com/a/27350/2676
;; For python (add-hook 'python-mode-hook #'(lambda () (modify-syntax-entry ?_ "w"))) ;; For ruby (add-hook 'ruby-mode-hook #'(lambda () (modify-syntax-entry ?_ "w"))) ;; For Javascript (add-hook 'js2-mode-hook #'(lambda () (modify-syntax-entry ?_ "w")))
which allows evil-mode to consider _ as part of the word. It's not a great solution, but it somewhat mimics superword-mode
This issue is actually fairly important to me. It would be nice if it could get some attention at some point. My editing experience would improve tremendously with its resolution.
It's been reported upstream: evil-forward-word-begin doesn't work with superword-mode https://github.com/emacs-evil/evil/issues/721
Could you ping them in that thread. It would also help non-Spacemacs users if it was fixed upstream.
This is still an issue.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!
Still valid.
When superword-mode is enabled simultaneous to clojure-mode, the cursor will get stuck at the end of specific lines when advancing one word at a time.