fixed plugins

This commit is contained in:
Gedion 2012-09-11 16:21:14 -05:00
parent c37c48cd12
commit 9be69ef258
3 changed files with 22 additions and 14 deletions

View File

@ -1719,8 +1719,8 @@ function Ace2Inner(){
root:root, root:root,
point:selection.startPoint, point:selection.startPoint,
documentAttributeManager: documentAttributeManager documentAttributeManager: documentAttributeManager
}); });
selStart = selStartFromHook || getLineAndCharForPoint(selection.startPoint); selStart = (selStartFromHook==null||selStartFromHook.length==0)?getLineAndCharForPoint(selection.startPoint):selStartFromHook;
} }
if (selection && !selEnd) if (selection && !selEnd)
{ {
@ -1746,7 +1746,7 @@ function Ace2Inner(){
point:selection.endPoint, point:selection.endPoint,
documentAttributeManager: documentAttributeManager documentAttributeManager: documentAttributeManager
}); });
selEnd = selEndFromHook || getLineAndCharForPoint(selection.endPoint); selEnd = (selEndFromHook==null||selEndFromHook.length==0)?getLineAndCharForPoint(selection.endPoint):selEndFromHook;
} }
// selection from content collection can, in various ways, extend past final // selection from content collection can, in various ways, extend past final
@ -3628,16 +3628,15 @@ function Ace2Inner(){
* This hook is provided to allow a plugin to handle key events. * This hook is provided to allow a plugin to handle key events.
* The return value should true if you have handled the event. * The return value should true if you have handled the event.
* *
*/ */
editorInfo.specialHandled = null; var specialHandledInHook = hooks.callAll('aceKeyEvent', {
specialHandled = hooks.callAll('aceKeyEvent', {
callstack: currentCallStack, callstack: currentCallStack,
editorInfo: editorInfo, editorInfo: editorInfo,
rep: rep, rep: rep,
documentAttributeManager: documentAttributeManager, documentAttributeManager: documentAttributeManager,
evt:evt evt:evt
}); });
specialHandled = (specialHandledInHook&&specialHandledInHook.length>0)?specialHandledInHook[0]:specialHandled;
if ((!specialHandled) && isTypeForSpecialKey && keyCode == 8) if ((!specialHandled) && isTypeForSpecialKey && keyCode == 8)
{ {
// "delete" key; in mozilla, if we're at the beginning of a line, normalize now, // "delete" key; in mozilla, if we're at the beginning of a line, normalize now,

View File

@ -388,6 +388,7 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class
* The return value should be the validated/manipulated text. * The return value should be the validated/manipulated text.
* *
*/ */
//top.console.log(' nodevalue ',txt);
var txtFromHook = hooks.callAll('collectContentLineText', { var txtFromHook = hooks.callAll('collectContentLineText', {
cc: this, cc: this,
state: state, state: state,
@ -397,7 +398,8 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class
styl: null, styl: null,
cls: null cls: null
}); });
var txt = txtFromHook||txt; var txt = (typeof(txtFromHook)=='object'&&txtFromHook.length==0)?dom.nodeValue(node):txtFromHook[0];
var rest = ''; var rest = '';
var x = 0; // offset into original text var x = 0; // offset into original text
if (txt.length == 0) if (txt.length == 0)
@ -409,7 +411,7 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class
if (endPoint && node == endPoint.node) if (endPoint && node == endPoint.node)
{ {
selEnd = _pointHere(0, state); selEnd = _pointHere(0, state);
} }
} }
while (txt.length > 0) while (txt.length > 0)
{ {
@ -476,8 +478,7 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class
* The return value should be either true(break the line) or false. * The return value should be either true(break the line) or false.
* *
*/ */
{ {
cc.startNewLine(state);
this.breakLine = true; this.breakLine = true;
var tvalue = dom.nodeAttr(node, 'value'); var tvalue = dom.nodeAttr(node, 'value');
var induceLineBreak = hooks.callAll('collectContentLineBreak', { var induceLineBreak = hooks.callAll('collectContentLineBreak', {
@ -487,8 +488,9 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class
tvalue:tvalue, tvalue:tvalue,
styl: null, styl: null,
cls: null cls: null
}); });
if(induceLineBreak){ var startNewLine= (typeof(induceLineBreak)=='object'&&induceLineBreak.length==0)?true:induceLineBreak[0];
if(startNewLine){
cc.startNewLine(state); cc.startNewLine(state);
} }
} }

View File

@ -146,9 +146,16 @@ linestylefilter.getLineStyleFilter = function(lineLength, aline, textAndClassFun
return function(txt, cls) return function(txt, cls)
{ {
var disableAuthColorForThisLine = hooks.callAll("disableAuthorColorsForThisLine", {
linestylefilter: linestylefilter,
text: txt,
class: cls
}, " ", " ", "");
var disableAuthors = (disableAuthColorForThisLine==null||disableAuthColorForThisLine.length==0)?false:disableAuthColorForThisLine[0];
while (txt.length > 0) while (txt.length > 0)
{ {
if (leftInAuthor <= 0) if (leftInAuthor <= 0 || disableAuthors)
{ {
// prevent infinite loop if something funny's going on // prevent infinite loop if something funny's going on
return nextAfterAuthorColors(txt, cls); return nextAfterAuthorColors(txt, cls);