editor: Display only the basename of the current file in the window title
This commit is contained in:
parent
ec44213f4e
commit
d6f7069589
@ -9,6 +9,7 @@
|
||||
|
||||
#include "EditorWidget.h"
|
||||
#include <ctype.h>
|
||||
#include <luna/PathParser.h>
|
||||
#include <luna/Utf8.h>
|
||||
#include <os/File.h>
|
||||
#include <os/FileSystem.h>
|
||||
@ -42,7 +43,9 @@ Result<void> EditorWidget::load_file(const os::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());
|
||||
|
||||
TRY(recalculate_lines());
|
||||
|
Loading…
Reference in New Issue
Block a user