renumbering should be OK in most situations now :). It is automatically triggered on delete and return key and executed only when necessary

This commit is contained in:
Jean-Tiare Le Bigot 2011-12-09 17:23:32 +01:00
parent 4078ad83da
commit 4715900eeb

View file

@ -3691,6 +3691,15 @@ function OUTER(gscope)
} }
} }
} }
//if the list has been removed, it is necessary to renumber
//starting from the *next* line because the list may have been
//separated. If it returns null, it means that the list was not cut, try
//from the current one.
var line = caretLine();
if(line != -1 && renumberList(line+1)==null)
{
renumberList(line);
}
} }
// set of "letter or digit" chars is based on section 20.5.16 of the original Java Language Spec // set of "letter or digit" chars is based on section 20.5.16 of the original Java Language Spec
@ -5192,7 +5201,13 @@ function OUTER(gscope)
function renumberList(lineNum){ function renumberList(lineNum){
//1-check we are in a list //1-check we are in a list
if(!getLineListType(lineNum)) var type = getLineListType(lineNum);
if(!type)
{
return null;
}
type = /([a-z]+)[12345678]/.exec(type);
if(type[1] == "indent")
{ {
return null; return null;
} }
@ -5307,7 +5322,14 @@ function OUTER(gscope)
performDocumentApplyChangeset(cs); performDocumentApplyChangeset(cs);
} }
renumberList(lineNum); //if the list has been removed, it is necessary to renumber
//starting from the *next* line because the list may have been
//separated. If it returns null, it means that the list was not cut, try
//from the current one.
if(renumberList(lineNum+1)==null)
{
renumberList(lineNum);
}
} }
function doInsertList(type) function doInsertList(type)