fix: Resolve 'n' key navigation issue by using ASCII code
This commit is contained in:
parent
d86be60b40
commit
7ff50bb49a
9
gtm
9
gtm
|
|
@ -312,9 +312,6 @@ def jump_to_next_change(state: AppState) -> AppState:
|
|||
if next_idx != -1:
|
||||
# Get the start position of the change block
|
||||
new_scroll = max(0, state.change_blocks[next_idx][0] - 3) # Show 3 lines of context above
|
||||
# Add debug output to a log file
|
||||
with open("/tmp/gtm_debug.log", "a") as f:
|
||||
f.write(f"Jumping to change block {next_idx+1}/{len(state.change_blocks)}, line {state.change_blocks[next_idx][0]}\n")
|
||||
return replace(state, right_scroll_offset=new_scroll, current_change_idx=next_idx)
|
||||
return state
|
||||
|
||||
|
|
@ -750,12 +747,10 @@ def handle_keyboard_input(key, state: AppState) -> AppState:
|
|||
return toggle_sidebar(state)
|
||||
elif key == ord('w'):
|
||||
return replace(state, wrap_lines=not state.wrap_lines)
|
||||
elif key == ord('n'):
|
||||
# Remove the focus check to allow 'n' to work regardless of focus
|
||||
elif key == 110: # ASCII code for 'n'
|
||||
if state.show_whole_diff or state.show_additions or state.show_deletions:
|
||||
return jump_to_next_change(state)
|
||||
elif key == ord('p'):
|
||||
# Remove the focus check to allow 'p' to work regardless of focus
|
||||
elif key == 112: # ASCII code for 'p'
|
||||
if state.show_whole_diff or state.show_additions or state.show_deletions:
|
||||
return jump_to_prev_change(state)
|
||||
elif key in [curses.KEY_LEFT, ord('h')]:
|
||||
|
|
|
|||
Loading…
Reference in New Issue