ends of line shouldn't show incorrect formatted status

This commit is contained in:
John McLear 2013-12-01 18:54:46 +00:00
parent b4877f002d
commit 3791ad4186

View file

@ -498,6 +498,15 @@ function Ace2Inner(){
finally finally
{ {
var cs = currentCallStack; var cs = currentCallStack;
hooks.callAll('acePostEditEvent', {
callstack: cs,
editorInfo: editorInfo,
rep: rep,
documentAttributeManager: documentAttributeManager
});
//console.log("Finished action for: "+type); //console.log("Finished action for: "+type);
if (cleanExit) if (cleanExit)
{ {
@ -2396,6 +2405,9 @@ function Ace2Inner(){
if(rep.lines.atIndex(n).text.length == 0){ if(rep.lines.atIndex(n).text.length == 0){
return false; // If the line length is 0 we basically treat it as having no formatting return false; // If the line length is 0 we basically treat it as having no formatting
} }
if(rep.selStart[1] == rep.selEnd[1] && rep.selStart[1] == rep.lines.atIndex(n).text.length){
return false; // If we're at the end of a line we treat it as having no formatting
}
if (n == selStartLine) if (n == selStartLine)
{ {
selectionStartInLine = rep.selStart[1]; selectionStartInLine = rep.selStart[1];