aboutsummaryrefslogtreecommitdiffstats
path: root/firefox/jp-hash.js
diff options
context:
space:
mode:
Diffstat (limited to 'firefox/jp-hash.js')
-rw-r--r--firefox/jp-hash.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/firefox/jp-hash.js b/firefox/jp-hash.js
index 4eaa42d..4e76e99 100644
--- a/firefox/jp-hash.js
+++ b/firefox/jp-hash.js
@@ -109,7 +109,11 @@ async function jp_hash_edit(elem)
let sel = elem.value.substring(start, end);
let tail = elem.value.substring(end, len);
- jphash(sel, (jph) => { elem.value = head + jph + tail; });
+ jphash(sel, (jph) => {
+ elem.value = head + jph + tail;
+ elem.selectionStart = start;
+ elem.selectionEnd = start + jph.length;
+ });
} else {
jphash(elem.value, (jph) => { elem.value = jph; });
}