diff --git a/4chan_x.user.js b/4chan_x.user.js index 38c52826f..a069e0ed6 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1570,6 +1570,9 @@ ta.value = ta.value.slice(0, caretPos) + text + ta.value.slice(ta.selectionEnd); ta.focus(); range = caretPos + text.length; + if ($.engine === 'presto') { + range++; + } ta.setSelectionRange(range, range); e = d.createEvent('Event'); e.initEvent('input', true, false); diff --git a/changelog b/changelog index ffd74a58e..80081b804 100644 --- a/changelog +++ b/changelog @@ -1,4 +1,7 @@ master +- Mayhem + Opera fixes. + /f/ fixes. 2.32.1 - Mayhem diff --git a/script.coffee b/script.coffee index de035fa7b..3ddaadb87 100644 --- a/script.coffee +++ b/script.coffee @@ -1155,6 +1155,8 @@ QR = ta.focus() # Move the caret to the end of the new quote. range = caretPos + text.length + # XXX Opera counts newlines as double + range++ if $.engine is 'presto' ta.setSelectionRange range, range # Fire the 'input' event