You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have this code now mapped on RET in markdown-mode:
(defunmy-markdown-ret ()
"Preserve list indentation after RET in markdown-mode.";; improved version of http://emacs.stackexchange.com/a/14642
(interactive)
(if-let ((bounds (markdown-cur-list-item-bounds))
(beg (car bounds))
(end (cadr bounds))
(indent (cadddr bounds))
(text (buffer-substring beg end)))
(if (= (- end beg)
indent)
(progn
(kill-region beg end)
(markdown-enter-key))
(call-interactively #'markdown-insert-list-item))
(markdown-enter-key)))
I think it is quite convenient... maybe you would like to integrate it in some way?
The text was updated successfully, but these errors were encountered:
An update: I realized that this is not what you want to happen if you wrap lines yourself using RET. You might want a multi-line list item, for example. So, I added a new setting to markdown-indent-on-enter in 9e10d57: it can be nil, indent, or indent-and-new-item. You'll want it set to the latter:
I have this code now mapped on RET in markdown-mode:
I think it is quite convenient... maybe you would like to integrate it in some way?
The text was updated successfully, but these errors were encountered: