From a4c706d327822bb1a6d0a64942866c935e97eb13 Mon Sep 17 00:00:00 2001 From: chatlanin Date: Wed, 7 Jun 2023 21:37:20 +0300 Subject: [PATCH] add run editor from rrr --- .../gui/browser/navigation/navigation.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/rrr/layers/gui/browser/navigation/navigation.cpp b/src/rrr/layers/gui/browser/navigation/navigation.cpp index 83457b1..a5d59a6 100755 --- a/src/rrr/layers/gui/browser/navigation/navigation.cpp +++ b/src/rrr/layers/gui/browser/navigation/navigation.cpp @@ -1,6 +1,7 @@ #include "navigation.hpp" #include +#include #include "try_engine/event/event_classificator.hpp" #include "utils/types.hpp" @@ -285,12 +286,18 @@ namespace rrr::layers::gui if (key.get_keycode() == try_engine::key::ENTER) { - if (!std::filesystem::is_directory(selected_file.path)) return; - cnt->navigation_right(); - data = cnt->get(TYPE_WIN::NAVIGATION); - selected_file = cnt->get_selected_file(TYPE_WIN::NAVIGATION); - em->execute(types::event_type::NAVIGATION_RIGHT, nullptr); - set_scroll(); + if (std::filesystem::is_directory(selected_file.path)) + { + cnt->navigation_right(); + data = cnt->get(TYPE_WIN::NAVIGATION); + selected_file = cnt->get_selected_file(TYPE_WIN::NAVIGATION); + em->execute(types::event_type::NAVIGATION_RIGHT, nullptr); + set_scroll(); + } + else + { + system(("kitty --name \"project_rrr_editor\" --directory " + selected_file.path.parent_path().string() + " nv ").c_str()); + } } if (key.get_keycode() == try_engine::key::L)