mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-03 22:59:33 +00:00
HackStudio: do not open empty directories as file
When _double clicking_ or _right click > Open_ in the tree view, the selected directory, if empty, was open in the editor section as file.
This commit is contained in:
parent
a8dfba6348
commit
2031baebce
Notes:
sideshowbarker
2024-07-18 22:37:07 +09:00
Author: https://github.com/masozzi
Commit: 2031baebce
Pull-request: https://github.com/SerenityOS/serenity/pull/5219
1 changed files with 3 additions and 0 deletions
|
@ -209,6 +209,9 @@ Vector<String> HackStudioWidget::selected_file_names() const
|
||||||
|
|
||||||
void HackStudioWidget::open_file(const String& filename)
|
void HackStudioWidget::open_file(const String& filename)
|
||||||
{
|
{
|
||||||
|
if (Core::File::is_directory(filename))
|
||||||
|
return;
|
||||||
|
|
||||||
if (!currently_open_file().is_empty()) {
|
if (!currently_open_file().is_empty()) {
|
||||||
// Since the file is previously open, it should always be in m_open_files.
|
// Since the file is previously open, it should always be in m_open_files.
|
||||||
ASSERT(m_open_files.find(currently_open_file()) != m_open_files.end());
|
ASSERT(m_open_files.find(currently_open_file()) != m_open_files.end());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue