From 869908b98f78e56c6cd64341f6d462e1d31f8825 Mon Sep 17 00:00:00 2001 From: Jason Blevins Date: Tue, 29 Jan 2013 09:35:09 -0500 Subject: [PATCH] Fix end detection for empty list items Check for empty list items of the following form: * Ensure that we don't skip over the whitespace following the marker on the same line. Previously, these list items were not being detected properly by `markdown-cur-list-item-bounds' as a result of this. In turn, list item insertion and other functions were broken following empty list items. --- markdown-mode.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/markdown-mode.el b/markdown-mode.el index afaa258..10e7f83 100644 --- a/markdown-mode.el +++ b/markdown-mode.el @@ -1261,7 +1261,11 @@ If the point is not in a list item, do nothing." (t t)) (forward-line) (setq indent (markdown-cur-line-indent))) - (skip-syntax-backward "-"))) + ;; Don't skip over whitespace for empty list items (marker and + ;; whitespace only), just move to end of whitespace. + (if (looking-back (concat markdown-regex-list "\\s-*")) + (goto-char (match-end 3)) + (skip-syntax-backward "-")))) (defun markdown-cur-list-item-bounds () "Return bounds and indentation of the current list item. -- 2.11.4.GIT