Add horizontal scrolling support and refactor mouse click handling in GUI.

- Introduce horizontal scrolling with column offset synchronization in GUI.
- Refactor mouse click handling for improved accuracy and viewport alignment.
- Enhance tab expansion and cursor rendering logic for better user experience.
- Replace redundant variable declarations in `Buffer` for cleaner code.
This commit is contained in:
2025-11-30 17:19:46 -08:00
parent 38ba8c9871
commit fcb2e9a7ed
5 changed files with 189 additions and 83 deletions

View File

@@ -1,5 +1,8 @@
#include "KKeymap.h"
#include <iostream>
#include <ncurses.h>
#include <ostream>
auto
@@ -21,9 +24,7 @@ KLookupKCommand(const int ascii_key, const bool ctrl, CommandId &out) -> bool
out = CommandId::SaveAndQuit;
return true;
default:
// Important: do not return here — fall through to non-ctrl table
// so that C-k u/U still work even if Ctrl is (incorrectly) held
break;
return false;
}
}
@@ -49,6 +50,9 @@ KLookupKCommand(const int ascii_key, const bool ctrl, CommandId &out) -> bool
case 'e':
out = CommandId::OpenFileStart;
return true;
case 'E':
std::cerr << "E is not a valid command" << std::endl;
return false;
case 'f':
out = CommandId::FlushKillRing;
return true;