fortrangoingonforty/fuss / e782f7f

Browse files

fix some things with inputs in rename mode

Authored by espadonne
SHA
e782f7fdbe99dbb00cf449d67d6db389786522e2
Parents
954f4a6
Tree
be2688d

2 changed files

StatusFile+-
M src/display_module.f90 1 1
M src/fuss_main.f90 6 5
src/display_module.f90modified
@@ -180,7 +180,7 @@ contains
180180
         print '(A)', ''
181181
         if (in_rename_mode) then
182182
             ! Rename mode help - show in cyan
183
-            print '(A)', achar(27) // '[36mRENAME MODE: Type new name | ←/→:move cursor | Backspace:delete | Enter/Tab:confirm | ESC:cancel' // achar(27) // '[0m'
183
+            print '(A)', achar(27) // '[36mRENAME MODE: Type name (caps A/B ok, C/D use arrows) | ←/→:cursor | Backspace:del | Tab:save | ESC:cancel' // achar(27) // '[0m'
184184
         else if (mode == 'git') then
185185
             ! Git mode help - show in yellow tint
186186
             print '(A)', achar(27) // '[33mLegend: ' // achar(27) // '[32m↑' // achar(27) // '[0m=staged ' // &
src/fuss_main.f90modified
@@ -465,23 +465,24 @@ contains
465465
                         needs_full_redraw = .true.
466466
                     end if
467467
                     cycle
468
+                ! NOTE: Arrow keys (after escape processing) are indistinguishable from uppercase A/B/C/D
469
+                ! Trade-off: Prioritize arrow functionality over uppercase C/D letters
470
+                ! Uppercase A/B work fine, C/D reserved for arrows
468471
                 else if (key == 'C') then
469
-                    ! Right arrow - move cursor right
472
+                    ! Right arrow - move cursor right (also blocks uppercase C)
470473
                     if (rename_cursor_pos < len_trim(rename_buffer)) then
471474
                         rename_cursor_pos = rename_cursor_pos + 1
472475
                         needs_full_redraw = .true.
473476
                     end if
474477
                     cycle
475478
                 else if (key == 'D') then
476
-                    ! Left arrow - move cursor left
479
+                    ! Left arrow - move cursor left (also blocks uppercase D)
477480
                     if (rename_cursor_pos > 0) then
478481
                         rename_cursor_pos = rename_cursor_pos - 1
479482
                         needs_full_redraw = .true.
480483
                     end if
481484
                     cycle
482
-                else if (key == 'A' .or. key == 'B') then
483
-                    ! Up/Down arrows - ignore in rename mode
484
-                    cycle
485
+                ! A and B (up/down arrows) are allowed as uppercase letters - arrows ignored
485486
                 else if ((key >= 'a' .and. key <= 'z') .or. &
486487
                          (key >= 'A' .and. key <= 'Z') .or. &
487488
                          (key >= '0' .and. key <= '9') .or. &