From c9ea0ee56ea65c17150b92e50539dafc6515aba4 Mon Sep 17 00:00:00 2001 From: Thomas Brouard <contact@brrd.fr> Date: Tue, 26 Sep 2017 19:39:19 +0200 Subject: [PATCH] [continuelist addon] Don't continue list when cursor is before bullet --- addon/edit/continuelist.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addon/edit/continuelist.js b/addon/edit/continuelist.js index f13e52199..02c8eff9f 100644 --- a/addon/edit/continuelist.js +++ b/addon/edit/continuelist.js @@ -25,7 +25,8 @@ var inQuote = eolState.quote !== 0; var line = cm.getLine(pos.line), match = listRE.exec(line); - if (!ranges[i].empty() || (!inList && !inQuote) || !match) { + var cursorBeforeBullet = /^\s*$/.test(line.slice(0, pos.ch)); + if (!ranges[i].empty() || (!inList && !inQuote) || !match || cursorBeforeBullet) { cm.execCommand("newlineAndIndent"); return; } -- GitLab