1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 17:45:09 +00:00

Shell: Add live formatting and take an option to enable it

This patchset makes it possible for the shell to format the current
buffer of the line editor live, with somewhat accurate cursor tracking.
Since this feature is pretty goofy at best, let's keep it off by default
for now :^)
This commit is contained in:
AnotherTest 2020-09-16 05:18:33 +04:30 committed by Andreas Kling
parent e94ee08eca
commit fa03a2848f
2 changed files with 18 additions and 0 deletions

View file

@ -73,6 +73,9 @@ public:
constexpr static auto local_init_file_path = "~/.shellrc";
constexpr static auto global_init_file_path = "/etc/shellrc";
bool should_format_live() const { return m_should_format_live; }
void set_live_formatting(bool value) { m_should_format_live = value; }
void setup_signals();
int run_command(const StringView&);
@ -243,6 +246,8 @@ private:
HashMap<String, String> m_aliases;
bool m_is_interactive { true };
bool m_is_subshell { false };
bool m_should_format_live { false };
};
static constexpr bool is_word_character(char c)