polymode / poly-rst

Polymode for ReStructured Text
7 stars 3 forks source link

weird cursor behavior #3

Open kevinboulain opened 5 years ago

kevinboulain commented 5 years ago

Hi there,

It seems sometimes poly-rst introduces some unwanted cursor behavior.

Since it's a bit complicated to explain faithfully, here is a demo: https://asciinema.org/a/zbDx85g6BoQqvzbgMZDFjPqbX

There are two small issues (the links point to specific parts of the demo for easier understanding/comparison):

The issue.bash script used is as follow (be careful, the first line is destructive, the rest setups an Emacs configuration in /tmp/trash so feel free to execute):

rm -rf /tmp/trash && mkdir -p /tmp/trash

cat > /tmp/trash/config.el << EOF
(setq user-emacs-directory "/tmp/trash")

(defvar bootstrap-version)
(let ((bootstrap-file
       (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
      (bootstrap-version 5))
  (unless (file-exists-p bootstrap-file)
    (with-current-buffer
        (url-retrieve-synchronously
         "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
         'silent 'inhibit-cookies)
      (goto-char (point-max))
      (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))
(straight-use-package 'use-package)

(use-package command-log-mode
  :straight (:host github :repo "lewang/command-log-mode")
  :hook ((rst-mode . command-log-mode))
  :config
  (setq command-log-mode-auto-show t
        command-log-mode-window-size 80
        clm/log-command-exceptions* '()))

EOF

cat > /tmp/trash/example.rst << EOF
.. code-block::
EOF

emacs -Q -l /tmp/trash/config.el /tmp/trash/example.rst

cat >> /tmp/trash/config.el << EOF
(use-package poly-rst
  :straight (:host github :repo "polymode/poly-rst"))
EOF

exec emacs -Q -l /tmp/trash/config.el /tmp/trash/example.rst

Hope it helps, polymode seems nice otherwise.

On a kinda unrelated note, is the 3 spaces indentation removed while using the Python major mode? I get some linter errors telling me there is too much spaces.

Regards.

vspinu commented 5 years ago

Thanks for the detailed report. I will have a look. Such point issues are generally difficult to track.