docs w/ improved method

getATtriuteOnSelection-extend
John McLear 2016-03-26 11:03:51 +08:00
parent add21368f9
commit 375ac50e14
1 changed files with 2 additions and 1 deletions

View File

@ -49,7 +49,8 @@ prevChar value should be true if you want to get the previous Character attribut
if the caret is at position 0,1 (after first character) it's probable you want the attributes on the character at 0,0
The attribute should be the string name of the attribute applied to the selection IE subscript
Example usage: Apply the activeButton Class to a button if an attribute is on a highlighted/selected caret position or range.
Example: `call.editorInfo.ace_getAttributeOnSelection("subscript");` // call here is the callstack from aceEditEvent.
Example `var isItThere = documentAttributeManager.getAttributeOnSelection("turkey::balls", true);`
See the ep_subscript plugin for an example of this function in action.
Notes: Does not work on first or last character of a line. Suffers from a race condition if called with aceEditEvent.
## editorInfo.ace_performSelectionChange(?)