summaryrefslogtreecommitdiffstats
path: root/devtools/client/debugger/src/actions
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
commit59203c63bb777a3bacec32fb8830fba33540e809 (patch)
tree58298e711c0ff0575818c30485b44a2f21bf28a0 /devtools/client/debugger/src/actions
parentAdding upstream version 126.0.1. (diff)
downloadfirefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz
firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip
Adding upstream version 127.0.upstream/127.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/client/debugger/src/actions')
-rw-r--r--devtools/client/debugger/src/actions/context-menus/editor.js25
1 files changed, 8 insertions, 17 deletions
diff --git a/devtools/client/debugger/src/actions/context-menus/editor.js b/devtools/client/debugger/src/actions/context-menus/editor.js
index 4785c963cb..2b82628f1a 100644
--- a/devtools/client/debugger/src/actions/context-menus/editor.js
+++ b/devtools/client/debugger/src/actions/context-menus/editor.js
@@ -39,7 +39,7 @@ import { toggleBlackBox } from "../../actions/sources/blackbox";
import { addExpression } from "../../actions/expressions";
import { evaluateInConsole } from "../../actions/toolbox";
-export function showEditorContextMenu(event, editor, location) {
+export function showEditorContextMenu(event, editor, lineObject, location) {
return async ({ dispatch, getState }) => {
const { source } = location;
const state = getState();
@@ -63,9 +63,9 @@ export function showEditorContextMenu(event, editor, location) {
location,
isPaused,
editorWrappingEnabled,
- selectionText: editor.codeMirror.getSelection().trim(),
- isTextSelected: editor.codeMirror.somethingSelected(),
- editor,
+ selectionText: editor.getSelectedText(),
+ isTextSelected: editor.isTextSelected(),
+ lineObject,
isSourceOnIgnoreList,
dispatch,
})
@@ -339,7 +339,7 @@ function editorMenuItems({
isTextSelected,
isPaused,
editorWrappingEnabled,
- editor,
+ lineObject,
isSourceOnIgnoreList,
dispatch,
}) {
@@ -368,14 +368,8 @@ function editorMenuItems({
blackBoxMenuItem(source, blackboxedRanges, isSourceOnIgnoreList, dispatch)
);
- const startLine = toSourceLine(
- source.id,
- editor.codeMirror.getCursor("from").line
- );
- const endLine = toSourceLine(
- source.id,
- editor.codeMirror.getCursor("to").line
- );
+ const startLine = toSourceLine(source.id, lineObject.from.line);
+ const endLine = toSourceLine(source.id, lineObject.to.line);
// Find any blackbox ranges that exist for the selected lines
const blackboxRange = findBlackBoxRange(source, blackboxedRanges, {
@@ -400,10 +394,7 @@ function editorMenuItems({
items.push(
blackBoxSourceLinesMenuItem(
source,
- {
- from: editor.codeMirror.getCursor("from"),
- to: editor.codeMirror.getCursor("to"),
- },
+ lineObject,
blackboxedRanges,
isSourceOnIgnoreList,
null,