Skip to content

Commit 1d35536

Browse files
committed
[vim] Do not open prompt if no cm.openDialog
1 parent 1ddba34 commit 1d35536

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

keymap/vim.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,9 @@
561561
MacroModeState.prototype = {
562562
exitMacroRecordMode: function() {
563563
var macroModeState = vimGlobalState.macroModeState;
564-
macroModeState.onRecordingDone(); // close dialog
564+
if (macroModeState.onRecordingDone) {
565+
macroModeState.onRecordingDone(); // close dialog
566+
}
565567
macroModeState.onRecordingDone = undefined;
566568
macroModeState.isRecording = false;
567569
},
@@ -571,8 +573,10 @@
571573
if (register) {
572574
register.clear();
573575
this.latestRegister = registerName;
574-
this.onRecordingDone = cm.openDialog(
575-
'(recording)['+registerName+']', null, {bottom:true});
576+
if (cm.openDialog) {
577+
this.onRecordingDone = cm.openDialog(
578+
'(recording)['+registerName+']', null, {bottom:true});
579+
}
576580
this.isRecording = true;
577581
}
578582
}

0 commit comments

Comments
 (0)