From 34f07efcfbda9fd7dc302fdf4bb9a150c059a6ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Bartelme=C3=9F?= Date: Sat, 7 Apr 2012 01:07:25 +0200 Subject: [PATCH] Delete key removes line attributes if prev line is not emtpy --- src/static/js/ace2_inner.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index 99bbbb4f1..8980b2039 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -3365,6 +3365,9 @@ function Ace2Inner(){ var thisLineListType = getLineListType(theLine); var prevLineEntry = (theLine > 0 && rep.lines.atIndex(theLine - 1)); var prevLineBlank = (prevLineEntry && prevLineEntry.text.length == prevLineEntry.lineMarker); + + var thisLineHasMarker = documentAttributeManager.lineHasMarker(theLine); + if (thisLineListType) { // this line is a list @@ -3378,6 +3381,9 @@ function Ace2Inner(){ // delistify performDocumentReplaceRange([theLine, 0], [theLine, lineEntry.lineMarker], ''); } + }else if (thisLineHasMarker && prevLineEntry){ + // If the line has any attributes assigned, remove them by removing the marker '*' + performDocumentReplaceRange([theLine -1 , prevLineEntry.text.length], [theLine, lineEntry.lineMarker], ''); } else if (theLine > 0) {