some improvements at undo function

This commit is contained in:
erqan 2014-04-07 20:22:47 +03:00
parent 860feec894
commit 5dcf8e84ee

View File

@ -889,6 +889,13 @@ function undoLastUnicode(e) {
if (pt.substr(uc.p, uc.u.length) === uc.u)
$ta.val(pt.substr(0,uc.p) + uc.k + pt.substr(uc.p + 2));
else {
//if it can't be found at its index, last unicode will be removed
var i = pt.lastIndexOf(uc.u);
if (i>-1) {
$ta.val(pt.substr(0,i) + uc.k + pt.substr(i + 2));
}
}
if (unicodeConversionStack.length > 0)
$(this).text("undo: " + unicodeConversionStack[0].u);