@@ -409,11 +409,11 @@ struct TerminalProfile
409
409
ConfigEntry<std::map<vtbackend::DECMode, bool >, documentation::FrozenDecMode> frozenModes {};
410
410
ConfigEntry<std::chrono::milliseconds, documentation::SmoothLineScrolling> smoothLineScrolling { 100 };
411
411
ConfigEntry<vtbackend::PageSize, documentation::TerminalSize> terminalSize { {
412
- vtbackend::LineCount (25 ),
413
- vtbackend::ColumnCount (80 ),
412
+ . lines = vtbackend::LineCount (25 ),
413
+ . columns = vtbackend::ColumnCount (80 ),
414
414
} };
415
- ConfigEntry<WindowMargins, documentation::Margins> margins { { HorizontalMargin { 0u },
416
- VerticalMargin { 0u } } };
415
+ ConfigEntry<WindowMargins, documentation::Margins> margins { { . horizontal = HorizontalMargin { 0u },
416
+ . vertical = VerticalMargin { 0u } } };
417
417
ConfigEntry<HistoryConfig, documentation::History> history {};
418
418
ConfigEntry<ScrollBarConfig, documentation::Scrollbar> scrollbar {};
419
419
ConfigEntry<MouseConfig, documentation::Mouse> mouse { true };
@@ -422,16 +422,18 @@ struct TerminalProfile
422
422
ConfigEntry<vtrasterizer::FontDescriptions, documentation::Fonts> fonts { defaultFont };
423
423
ConfigEntry<bool , documentation::DrawBoldTextWithBrightColors> drawBoldTextWithBrightColors { false };
424
424
ConfigEntry<InputModeConfig, documentation::ModeInsert> modeInsert { CursorConfig {
425
- vtbackend::CursorShape::Bar, vtbackend::CursorDisplay::Steady, std::chrono::milliseconds { 500 } } };
425
+ .cursorShape = vtbackend::CursorShape::Bar,
426
+ .cursorDisplay = vtbackend::CursorDisplay::Steady,
427
+ .cursorBlinkInterval = std::chrono::milliseconds { 500 } } };
426
428
ConfigEntry<InputModeConfig, documentation::ModeNormal> modeNormal {
427
- CursorConfig { vtbackend::CursorShape::Block,
428
- vtbackend::CursorDisplay::Steady,
429
- std::chrono::milliseconds { 500 } },
429
+ CursorConfig { . cursorShape = vtbackend::CursorShape::Block,
430
+ . cursorDisplay = vtbackend::CursorDisplay::Steady,
431
+ . cursorBlinkInterval = std::chrono::milliseconds { 500 } },
430
432
};
431
433
ConfigEntry<InputModeConfig, documentation::ModeVisual> modeVisual {
432
- CursorConfig { vtbackend::CursorShape::Block,
433
- vtbackend::CursorDisplay::Steady,
434
- std::chrono::milliseconds { 500 } },
434
+ CursorConfig { . cursorShape = vtbackend::CursorShape::Block,
435
+ . cursorDisplay = vtbackend::CursorDisplay::Steady,
436
+ . cursorBlinkInterval = std::chrono::milliseconds { 500 } },
435
437
};
436
438
ConfigEntry<std::chrono::milliseconds, documentation::HighlightTimeout> highlightTimeout { 100 };
437
439
ConfigEntry<vtbackend::LineCount, documentation::ModalCursorScrollOff> modalCursorScrollOff {
@@ -452,7 +454,12 @@ const InputMappings defaultInputMappings {
452
454
.modifiers { vtbackend::Modifiers { vtbackend::Modifier::Alt } },
453
455
.input = vtbackend::Key::Enter,
454
456
.binding = { { actions::ToggleFullscreen {} } } },
455
- KeyInputMapping { .modes {},
457
+ KeyInputMapping { .modes = []() -> vtbackend::MatchModes {
458
+ auto mods = vtbackend::MatchModes ();
459
+ mods.enable (vtbackend::MatchModes::Select);
460
+ mods.enable (vtbackend::MatchModes::Insert);
461
+ return mods;
462
+ }(),
456
463
.modifiers { vtbackend::Modifiers {} },
457
464
.input = vtbackend::Key::Escape,
458
465
.binding = { { actions::CancelSelection {} } } },
@@ -1049,10 +1056,15 @@ struct Writer
1049
1056
1050
1057
[[nodiscard]] std::string format (KeyInputMapping v)
1051
1058
{
1059
+ auto actionAndModes = format (" action: {} }}" , v.binding [0 ]);
1060
+ if (v.modes .any ())
1061
+ {
1062
+ actionAndModes = format (" action: {}, mode: '{}' }}" , v.binding [0 ], v.modes );
1063
+ }
1052
1064
return format (" {:<30},{:<30},{:<30}\n " ,
1053
1065
format (" - {{ mods: [{}]" , format (v.modifiers )),
1054
1066
format (" key: '{}'" , v.input ),
1055
- format ( " action: {} }} " , v. binding [ 0 ]) );
1067
+ actionAndModes );
1056
1068
}
1057
1069
1058
1070
[[nodiscard]] std::string format (CharInputMapping v)
0 commit comments