mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-25 05:55:13 +00:00
GML Playground: Add Vim emulation
This commit is contained in:
parent
78757845bb
commit
1621311d73
Notes:
sideshowbarker
2024-07-18 08:25:15 +09:00
Author: https://github.com/dosu0 🔰 Commit: https://github.com/SerenityOS/serenity/commit/1621311d73f Pull-request: https://github.com/SerenityOS/serenity/pull/8949
1 changed files with 11 additions and 0 deletions
|
@ -19,8 +19,10 @@
|
|||
#include <LibGUI/Menubar.h>
|
||||
#include <LibGUI/MessageBox.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
#include <LibGUI/RegularEditingEngine.h>
|
||||
#include <LibGUI/Splitter.h>
|
||||
#include <LibGUI/TextEditor.h>
|
||||
#include <LibGUI/VimEditingEngine.h>
|
||||
#include <LibGUI/Window.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
@ -251,6 +253,15 @@ int main(int argc, char** argv)
|
|||
}
|
||||
}));
|
||||
|
||||
auto vim_emulation_setting_action = GUI::Action::create_checkable("&Vim Emulation", { Mod_Ctrl | Mod_Shift | Mod_Alt, Key_V }, [&](auto& action) {
|
||||
if (action.is_checked())
|
||||
editor.set_editing_engine(make<GUI::VimEditingEngine>());
|
||||
else
|
||||
editor.set_editing_engine(make<GUI::RegularEditingEngine>());
|
||||
});
|
||||
vim_emulation_setting_action->set_checked(false);
|
||||
edit_menu.add_action(vim_emulation_setting_action);
|
||||
|
||||
auto& help_menu = window->add_menu("&Help");
|
||||
help_menu.add_action(GUI::CommonActions::make_help_action([](auto&) {
|
||||
Desktop::Launcher::open(URL::create_with_file_protocol("/usr/share/man/man1/Playground.md"), "/bin/Help");
|
||||
|
|
Loading…
Add table
Reference in a new issue