1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-08 20:15:47 +01:00

Fix pasting.

--HG--
extra : rebase_source : 338ca94353f9f407ab9cf2f5c892008adfce46fa
This commit is contained in:
Kris Maglione
2010-09-22 13:59:02 -04:00
parent 97072fd46f
commit a37167b95a
2 changed files with 4 additions and 2 deletions

View File

@@ -170,7 +170,9 @@ const Dactyl = Module("dactyl", {
str = data.data.substring(0, dataLen.value / 2);
}
}
catch (e) {}
catch (e) {
dactyl.reportError(e, true);
}
return str;
},

View File

@@ -72,7 +72,7 @@ const Editor = Module("editor", {
let rangeStart = elem.selectionStart; // caret position
let rangeEnd = elem.selectionEnd;
let tempStr1 = elem.value.substring(0, rangeStart);
let tempStr2 = dactyl.clipboardRead();
let tempStr2 = dactyl.clipboardRead() || "";
let tempStr3 = elem.value.substring(rangeEnd);
elem.value = tempStr1 + tempStr2 + tempStr3;
elem.selectionStart = rangeStart + tempStr2.length;