1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 06:58:00 +01:00

Fix issue with ?.

This commit is contained in:
Kris Maglione
2011-04-28 22:27:34 -04:00
parent c4d69376d9
commit c2acfadc85
2 changed files with 13 additions and 6 deletions

View File

@@ -375,7 +375,7 @@ var Buffer = Module("buffer", {
* @returns {string}
*/
get currentWord() Buffer.currentWord(this.focusedFrame),
getCurrentWord: deprecated("buffer.currentWord", function getCurrentWord() this.currentWord),
getCurrentWord: deprecated("buffer.currentWord", function getCurrentWord() Buffer.currentWord(this.focusedFrame, true)),
/**
* Returns true if a scripts are allowed to focus the given input
@@ -1088,7 +1088,7 @@ var Buffer = Module("buffer", {
*
* @returns {string}
*/
currentWord: function currentWord(win) {
currentWord: function currentWord(win, select) {
let selection = win.getSelection();
if (selection.rangeCount == 0)
return "";
@@ -1099,6 +1099,10 @@ var Buffer = Module("buffer", {
Editor.extendRange(range, true, re, true);
Editor.extendRange(range, false, re, true);
}
if (select) {
selection.removeAllRanges();
selection.addRange(range);
}
return util.domToString(range);
},