forgot this one

pull/2940/head
John McLear 2016-03-26 22:01:26 +08:00
parent 4846798528
commit 97b971747f
1 changed files with 10 additions and 1 deletions

View File

@ -2338,8 +2338,17 @@ function Ace2Inner(){
editorInfo.ace_setAttributeOnSelection = setAttributeOnSelection; editorInfo.ace_setAttributeOnSelection = setAttributeOnSelection;
function getAttributeOnSelection(attributeName){ function getAttributeOnSelection(attributeName, prevChar){
if (!(rep.selStart && rep.selEnd)) return 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('+', [ var withIt = Changeset.makeAttribsString('+', [
[attributeName, 'true'] [attributeName, 'true']