Notepad-JS-HTML-Beautifier-Plugin
Notepad-JS-HTML-Beautifier-Plugin copied to clipboard
Adding functionality that if user does not select take the current(view) document text
Following part modified to get proper position
getSelectionPositions: function(){
_if (!this.context.selection){
return {
start: this.byteToChars(0),
end: this.byteToChars(this.context.text.length)
};
};_
return {
start: this.byteToChars(
Math.min(this.context.anchor, this.context.pos)
),
end: this.byteToChars(
Math.max(this.context.anchor, this.context.pos)
)
};
},
Following edited to pick current document getContent: function(){ this.updateContext(); if (!this.context.selection){return this.context.text}; return this.context.selection; },