Skip to content

Commit

Permalink
Jeremypw/fix cancel folder creation (#1454)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremypw authored Jul 24, 2024
1 parent 3850abd commit bb969bf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions data/code.metainfo.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
<issue url="https://github.com/elementary/code/issues/1416">Code hangs when choosing active project when two project starting with the same string are loaded</issue>
<issue url="https://github.com/elementary/code/issues/1418">Duplicated items in "Find In Project Popover"</issue>
<issue url="https://github.com/elementary/code/issues/1429">Extensions dialogue MUST be resizable</issue>
<issue url="https://github.com/elementary/code/issues/1436">Cancelling new folder creation in project causes parent folder to disappear from sidebar</issue>
<issue url="https://github.com/elementary/code/issues/570">Draw Spaces On Current Line</issue>
<issue url="https://github.com/elementary/code/issues/574">git branch not readable if dir name is too long</issue>
<issue url="https://github.com/elementary/code/pull/1446">Fix "go to line" behaviour when column number is not explicitly set</issue>
Expand Down
4 changes: 2 additions & 2 deletions src/FolderManager/FolderItem.vala
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,8 @@ namespace Scratch.FolderManager {

view.ignore_next_select = true;
((Code.Widgets.SourceList.ExpandableItem)this).remove (item);
// Add back dummy if empty unless we are removing a rename item
if (!(item is RenameItem || has_dummy || n_children > 0)) {
// Add back dummy if empty
if (!(has_dummy || n_children > 0)) {
((Code.Widgets.SourceList.ExpandableItem)this).add (dummy);
has_dummy = true;
}
Expand Down
6 changes: 5 additions & 1 deletion src/Utils.vala
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,12 @@ namespace Scratch.Utils {
return false;
}

var content_type = info.get_content_type ();
if (info.get_file_type () == FileType.REGULAR &&
ContentType.is_a (info.get_content_type (), "text/*")) {
ContentType.is_a (content_type, "text/*") ||
ContentType.is_a (content_type, "application/x-zerosize")
) {

return true;
}

Expand Down

0 comments on commit bb969bf

Please sign in to comment.