mwim.el icon indicating copy to clipboard operation
mwim.el copied to clipboard

Issue when working with `(setq org-hide-emphasis-markers t)`

Open failable opened this issue 4 years ago • 2 comments

Hi, thanks for the very convenient package. I find an issue when using it in org-mode. I have (setq org-hide-emphasis-markers t) in my config.

Sample settings:

(use-package mwim
  :bind (("C-a" . mwim-beginning-of-line-or-code)
         ("C-e" . mwim-end-of-line-or-code)))

(setq org-hide-emphasis-markers t)

Reproduce steps:

  1. Create an empty org-mode buffer, and press RET to create some new lines.
  2. Move the cursor to any previous line to ensure there are at least one line below.
  3. At the end of current line, enter ~some text*~ (* denote cursor. Note that the markers are hidden at this moment.
  4. Call mwim-end-of-line-or-code or other variants to move to end of line.

Now, the cursor is moved to beginning of next line.

I do this because this is my workflow when typing and use smartparens to auto insert ~~ and type texts then move out of the markup area to continue typing.

failable avatar Mar 13 '21 08:03 failable

Hello and sorry for the long delay. I often miss github issues when my name is not mentioned explicitly.

I reproduce this bug, and I have found that it occurs only when the mwim-end command is called with a key binding. But when it is called directly with M-x mwim-…, the bug does not happen to me.

Moreover, this bug does not relate to mwim package at all! I have tried the following command:

(defun tmp-end ()
  (interactive)
  (goto-char 307))

(where 307 is the "end of line" position that I checked with C-x =)

and it has the same problem: when it is called with M-x, it works as expected, but when it is called via a key binding, it moves to the next line!

So this is not an mwim bug but I would like to keep this issue open in case other people will face the same problem.

alezost avatar Aug 28 '21 14:08 alezost

Thanks for digging into this.

failable avatar Aug 29 '21 01:08 failable