Bug 1508351 - The editor should not select the line when shift-clicking. r=dwalsh
authorJason Laster <jlaster@mozilla.com>
Wed, 14 Nov 2018 08:32:34 -0500
changeset 503529 9c14b7e88ab7a046c281815707916d76cbca3cb2
parent 503528 401763b97e54cd99c6a5ad2a617379da011a57e5
child 503530 335eb23dc594577ad46a07feec893345a22f7023
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdwalsh
bugs1508351
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1508351 - The editor should not select the line when shift-clicking. r=dwalsh Tags: Differential Revision: https://phabricator.services.mozilla.com/D11875
devtools/client/sourceeditor/editor.js
devtools/client/sourceeditor/test/browser_editor_cursor.js
--- a/devtools/client/sourceeditor/editor.js
+++ b/devtools/client/sourceeditor/editor.js
@@ -419,25 +419,16 @@ Editor.prototype = {
       if (!this._lastDirty) {
         this._lastDirty = true;
         this.emit("dirty-change");
       }
     });
 
     cm.on("gutterClick", (cmArg, line, gutter, ev) => {
       const lineOrOffset = !this.isWasm ? line : this.lineToWasmOffset(line);
-      const head = { line: line, ch: 0 };
-      const tail = { line: line, ch: this.getText(lineOrOffset).length };
-
-      // Shift-click on a gutter selects the whole line.
-      if (ev.shiftKey) {
-        cmArg.setSelection(head, tail);
-        return;
-      }
-
       this.emit("gutterClick", lineOrOffset, ev.button);
     });
 
     win.CodeMirror.defineExtension("l10n", (name) => {
       return L10N.getStr(name);
     });
 
     if (!this.config.disableSearchAddon) {
--- a/devtools/client/sourceeditor/test/browser_editor_cursor.js
+++ b/devtools/client/sourceeditor/test/browser_editor_cursor.js
@@ -32,13 +32,13 @@ function test() {
 
     // Check that shift-click on a gutter selects the whole line (bug 919707)
     const iframe = win.document.querySelector("iframe");
     const gutter =
       iframe.contentWindow.document.querySelector(".CodeMirror-gutters");
 
     EventUtils.sendMouseEvent({ type: "mousedown", shiftKey: true }, gutter,
       iframe.contentWindow);
-    is(ed.getSelection(), "Hello.", "shift-click");
+    is(ed.getSelection(), "", "shift-click");
 
     teardown(ed, win);
   });
 }