Skip to content

Commit

Permalink
Skip ability to go back to deleted directories
Browse files Browse the repository at this point in the history
  • Loading branch information
roberthawdon committed Mar 2, 2019
1 parent 0868476 commit 5884215
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/showmenus.c
Original file line number Diff line number Diff line change
Expand Up @@ -1439,6 +1439,7 @@ void directory_view_menu_inputs()
//printMenu(0, 0, modifyMenuText);
modify_key_menu_inputs();
} else if (*pc == menuHotkeyLookup(fileMenu, "f_quit", fileMenuSize)){
handleMissingDir:
if (historyref > 1){
strcpy(chpwd, hs[historyref - 2].path);
objectWild = hs[historyref - 2].objectWild;
Expand All @@ -1453,6 +1454,10 @@ void directory_view_menu_inputs()
topfileref = sanitizeTopFileRef(hs[historyref].topfileref);
clear_workspace();
display_dir(currentpwd, ob, topfileref, selected);
} else {
// Skip removed directories
historyref--;
goto handleMissingDir;
}
} else {
historyref = 0; // Reset historyref here. A hacky workaround due to the value occasionally dipping to minus numbers.
Expand Down

0 comments on commit 5884215

Please sign in to comment.