editor: Display only the basename of the current file in the window title
This commit is contained in:
parent
6c8a4ad995
commit
662a315597
@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
#include "EditorWidget.h"
|
#include "EditorWidget.h"
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#include <luna/PathParser.h>
|
||||||
#include <luna/Utf8.h>
|
#include <luna/Utf8.h>
|
||||||
#include <os/File.h>
|
#include <os/File.h>
|
||||||
#include <os/FileSystem.h>
|
#include <os/FileSystem.h>
|
||||||
@ -42,7 +43,9 @@ Result<void> EditorWidget::load_file(const os::Path& path)
|
|||||||
|
|
||||||
m_path = path;
|
m_path = path;
|
||||||
|
|
||||||
String title = TRY(String::format("Text Editor - %s"_sv, m_path.name().chars()));
|
auto basename = TRY(PathParser::basename(m_path.name()));
|
||||||
|
|
||||||
|
String title = TRY(String::format("Text Editor - %s"_sv, basename.chars()));
|
||||||
window()->set_title(title.view());
|
window()->set_title(title.view());
|
||||||
|
|
||||||
TRY(recalculate_lines());
|
TRY(recalculate_lines());
|
||||||
|
Loading…
Reference in New Issue
Block a user