Skip to content
Snippets Groups Projects
Commit 79733f7d authored by Yorhel's avatar Yorhel
Browse files

Determine which item to select after deletion in browser.c

Rather than the ugly hack in delete.c.
parent eed949d4
No related branches found
No related tags found
No related merge requests found
...@@ -379,7 +379,8 @@ int browse_key(int ch) { ...@@ -379,7 +379,8 @@ int browse_key(int ch) {
break; break;
info_show = 0; info_show = 0;
if((t = dirlist_get(1)) == sel) if((t = dirlist_get(1)) == sel)
t = dirlist_get(-1); if((t = dirlist_get(-1)) == sel || t == dirlist_parent)
t = sel->parent;
delete_init(sel, t); delete_init(sel, t);
break; break;
} }
......
...@@ -211,9 +211,6 @@ delete_nxt: ...@@ -211,9 +211,6 @@ delete_nxt:
void delete_process() { void delete_process() {
/* determine dir to open after successful delete */
struct dir *n = root->parent->sub != root ? root->parent->sub : root->next ? root->next : root->parent;
/* confirm */ /* confirm */
seloption = 1; seloption = 1;
while(state == DS_CONFIRM && !noconfirm) while(state == DS_CONFIRM && !noconfirm)
...@@ -237,9 +234,8 @@ void delete_process() { ...@@ -237,9 +234,8 @@ void delete_process() {
if(delete_dir(root)) if(delete_dir(root))
browse_init(root); browse_init(root);
else { else {
if(nextsel) nextsel->flags |= FF_BSEL;
nextsel->flags |= FF_BSEL; browse_init(nextsel);
browse_init(n);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment