Skip to content

Commit bb969bf

Browse files
authored
Jeremypw/fix cancel folder creation (#1454)
1 parent 3850abd commit bb969bf

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

data/code.metainfo.xml.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
<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>
9090
<issue url="https://github.com/elementary/code/issues/1418">Duplicated items in "Find In Project Popover"</issue>
9191
<issue url="https://github.com/elementary/code/issues/1429">Extensions dialogue MUST be resizable</issue>
92+
<issue url="https://github.com/elementary/code/issues/1436">Cancelling new folder creation in project causes parent folder to disappear from sidebar</issue>
9293
<issue url="https://github.com/elementary/code/issues/570">Draw Spaces On Current Line</issue>
9394
<issue url="https://github.com/elementary/code/issues/574">git branch not readable if dir name is too long</issue>
9495
<issue url="https://github.com/elementary/code/pull/1446">Fix "go to line" behaviour when column number is not explicitly set</issue>

src/FolderManager/FolderItem.vala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,8 @@ namespace Scratch.FolderManager {
252252

253253
view.ignore_next_select = true;
254254
((Code.Widgets.SourceList.ExpandableItem)this).remove (item);
255-
// Add back dummy if empty unless we are removing a rename item
256-
if (!(item is RenameItem || has_dummy || n_children > 0)) {
255+
// Add back dummy if empty
256+
if (!(has_dummy || n_children > 0)) {
257257
((Code.Widgets.SourceList.ExpandableItem)this).add (dummy);
258258
has_dummy = true;
259259
}

src/Utils.vala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,12 @@ namespace Scratch.Utils {
172172
return false;
173173
}
174174

175+
var content_type = info.get_content_type ();
175176
if (info.get_file_type () == FileType.REGULAR &&
176-
ContentType.is_a (info.get_content_type (), "text/*")) {
177+
ContentType.is_a (content_type, "text/*") ||
178+
ContentType.is_a (content_type, "application/x-zerosize")
179+
) {
180+
177181
return true;
178182
}
179183

0 commit comments

Comments
 (0)