add run editor from rrr

This commit is contained in:
chatlanin 2023-06-07 21:37:20 +03:00
parent 1880278487
commit a4c706d327

View File

@ -1,6 +1,7 @@
#include "navigation.hpp"
#include <algorithm>
#include <exception>
#include "try_engine/event/event_classificator.hpp"
#include "utils/types.hpp"
@ -285,13 +286,19 @@ namespace rrr::layers::gui
if (key.get_keycode() == try_engine::key::ENTER)
{
if (!std::filesystem::is_directory(selected_file.path)) return;
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)
{