fortrangoingonforty/fortress / b181446

Browse files

ctrl-d to deselect

Authored by espadonne
SHA
b181446579f673ad2aebf6641b92596ebf432fd7
Parents
bbb26d1
Tree
adfe09d

1 changed file

StatusFile+-
M app/main.f90 7 1
app/main.f90modified
@@ -203,7 +203,7 @@ program fortress
203203
 
204204
         ! Handle input
205205
         select case(ichar(key))
206
-        case(27)  ! ESC - could be arrow keys, Shift+arrow, or standalone ESC
206
+        case(27)  ! ESC - could be arrow keys, Shift+arrow, or standalone ESC to clear selections
207207
             ! Read the arrow key sequence first to determine what was pressed
208208
             call read_arrow_key_with_shift(key, is_shift_pressed)
209209
 
@@ -468,6 +468,12 @@ program fortress
468468
                 call clear_all_selections(is_selected, selection_count, in_selection_mode)
469469
                 call detect_git_repo(current_dir, in_git_repo, repo_name, branch_name)
470470
             end if
471
+        case(4)  ! Ctrl-D - clear multi-select (deselect all)
472
+            if (selection_count > 0) then
473
+                call clear_all_selections(is_selected, selection_count, in_selection_mode)
474
+                selection_anchor = -1
475
+                has_disjoint_selection = .false.
476
+            end if
471477
         case(32)  ! Space - toggle selection on current item
472478
             if (trim(current_files(selected)) /= "." .and. trim(current_files(selected)) /= "..") then
473479
                 if (is_selected(selected)) then