From 3d50923c4dc6512ca82855b64335098efd607bf9 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 26 Oct 2020 12:20:03 +0100 Subject: [PATCH] HackStudio: Allow toggling line wrapping on/off from the Edit menu :^) --- DevTools/HackStudio/HackStudioWidget.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/DevTools/HackStudio/HackStudioWidget.cpp b/DevTools/HackStudio/HackStudioWidget.cpp index ef79a84bd27..3381ba0f5ba 100644 --- a/DevTools/HackStudio/HackStudioWidget.cpp +++ b/DevTools/HackStudio/HackStudioWidget.cpp @@ -853,6 +853,16 @@ void HackStudioWidget::create_edit_menubar(GUI::MenuBar& menubar) reveal_action_tab(*m_find_in_files_widget); m_find_in_files_widget->focus_textbox_and_select_all(); })); + + edit_menu.add_separator(); + + auto line_wrapping_action = GUI::Action::create_checkable("Line wrapping", [this](auto& action) { + for (auto& wrapper : m_all_editor_wrappers) { + wrapper.editor().set_line_wrapping_enabled(action.is_checked()); + } + }); + line_wrapping_action->set_checked(current_editor().is_line_wrapping_enabled()); + edit_menu.add_action(line_wrapping_action); } void HackStudioWidget::create_build_menubar(GUI::MenuBar& menubar)