mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-09 10:04:41 +00:00
Shell: Add a (very basic) formatter
This commit is contained in:
committed by
Andreas Kling
parent
6e6be8e56e
commit
b3dd97a694
@@ -26,6 +26,7 @@
|
||||
|
||||
#include "Shell.h"
|
||||
#include "Execution.h"
|
||||
#include "Formatter.h"
|
||||
#include <AK/Function.h>
|
||||
#include <AK/LexicalPath.h>
|
||||
#include <AK/ScopeGuard.h>
|
||||
@@ -449,6 +450,15 @@ bool Shell::invoke_function(const AST::Command& command, int& retval)
|
||||
return true;
|
||||
}
|
||||
|
||||
String Shell::format(const StringView& source, ssize_t& cursor) const
|
||||
{
|
||||
Formatter formatter(source, cursor);
|
||||
auto result = formatter.format();
|
||||
cursor = formatter.cursor();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Shell::Frame Shell::push_frame()
|
||||
{
|
||||
m_local_frames.empend();
|
||||
|
||||
Reference in New Issue
Block a user