Skip to content

Commit b67b4e0

Browse files
[command-line] Fix regression (#4025)
1 parent bc0a275 commit b67b4e0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/plugins/command-line/command-line.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const Self = {
1111
effect (Prism) {
1212
return Prism.hooks.add({
1313
'before-highlight': env => {
14-
const commandLine = env.commandLine ?? {};
14+
const commandLine = (env.commandLine ??= {});
1515

1616
if (commandLine.complete || !env.code) {
1717
commandLine.complete = true;
@@ -107,7 +107,7 @@ const Self = {
107107
env.code = codeLines.join('\n');
108108
},
109109
'before-insert': env => {
110-
const commandLine = env.commandLine ?? {};
110+
const commandLine = (env.commandLine ??= {});
111111
if (commandLine.complete) {
112112
return;
113113
}
@@ -130,7 +130,7 @@ const Self = {
130130
env.highlightedCode = codeLines.join('\n');
131131
},
132132
'complete': env => {
133-
const commandLine = env.commandLine ?? {};
133+
const commandLine = (env.commandLine ??= {});
134134
if (commandLine.complete) {
135135
return;
136136
}

0 commit comments

Comments
 (0)