diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index 8576ee336..f2c45f6a3 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -2338,8 +2338,17 @@ function Ace2Inner(){ editorInfo.ace_setAttributeOnSelection = setAttributeOnSelection; - function getAttributeOnSelection(attributeName){ + function getAttributeOnSelection(attributeName, prevChar){ if (!(rep.selStart && rep.selEnd)) return + var isNotSelection = (rep.selStart[0] == rep.selEnd[0] && rep.selEnd[1] === rep.selStart[1]); + if(isNotSelection){ + if(prevChar){ + // If it's not the start of the line + if(rep.selStart[1] !== 0){ + rep.selStart[1]--; + } + } + } var withIt = Changeset.makeAttribsString('+', [ [attributeName, 'true']