gecko-dev/devtools
Nicolas Chevobbe 010f6b2666 Bug 1578283 - Don't scroll jsterm viewport when inserting a tab character. r=Honza.
When we wanted to insert a string in the webconsole input,
we were setting the input value, and setting the cursor
manually. But since the editor setCursor function is calling
alignLine, there could be cases where the editor scroll position
would jump, feeling awkward for the user.
It turns out we can simplify this code a lot since codeMirror
provides a replaceRange function, which is a perfect replacement
for what we were using, without having to manage the cursor position.

The only downside to that is that inserting characters this
way *does* fire a `changes` event, that we are listening to
in the JsTerm to request autocompletion (which we don't need
as we only insert characters when accepting a completion or
adding a tab).
To mitigate that, we pass a specific jsterm origin string to
replaceRange, which let's us discriminate in the changes event
listener if those changes originate from jsterm only actions.

A test is added to ensure this works as expected (the test was
failing without the fix).

Differential Revision: https://phabricator.services.mozilla.com/D44466

--HG--
extra : moz-landing-system : lando
2019-09-04 09:02:09 +00:00
..
client Bug 1578283 - Don't scroll jsterm viewport when inserting a tab character. r=Honza. 2019-09-04 09:02:09 +00:00
docs Bug 1576835 - Update DAMP test writing documentation r=ochameau 2019-08-29 06:22:18 +00:00
platform Bug 1561435 - Format remaining devtools/, a=automatic-formatting, CLOSED TREE 2019-07-05 11:29:32 +02:00
server Bug 1578565 - SVG and MathML elements don't follow the CSS layout model. r=pbro 2019-09-04 07:45:32 +00:00
shared Bug 1574401 - allow DevTools to access BrowsingContext; r=ochameau 2019-09-02 13:24:20 +00:00
startup Bug 1519586 - Fix js error in browser_aboutdevtools_reuse_existing.js r=ladybenko 2019-09-02 15:22:37 +00:00
.eslintrc.js Bug 1558517 - Pre 3.0: Remove conflicting eslint rules, and turn on "curly: all" everywhere, r=standard8 2019-06-28 17:14:01 +02:00
.eslintrc.mochitests.js
.eslintrc.xpcshell.js
CODE_OF_CONDUCT.md
moz.build
templates.mozbuild