code: function () {
        if (!codeViewer.codeActive) {
          return;
        }
  
        if (window.getSelection().empty) {
          window.getSelection().empty();
        }
        else if (window.getSelection().removeAllRanges) {
          window.getSelection().removeAllRanges();
        }
      }
docs: Clear any selection of code when swapping tabs or opening a new pattern.