Repository navigation
layout-agnostic key bindings for non-Latin keyboards - #71
Merged
umputun merged 1 commit intoApr 8, 2026
Merged
Conversation
When a non-Latin keyboard layout is active (Russian, Greek, Hebrew), hotkeys work based on physical key position. Pressing г triggers the same action as u, ξ as j, ח as j — all transparent via Resolve(). - layout.go: static rune→rune map for 3 layouts (~150 entries) - keymap.go: Resolve() fallback tries layout alias on miss - layout_test.go: unit + integration tests for all layouts Only non-ASCII characters mapped to avoid ambiguity.
Contributor
Author
umputun
added a commit
that referenced
this pull request
Apr 8, 2026
Move standalone Save/gitDiff/gitCommitHash/filterRepoFiles functions to methods on Service struct. Extract history save logic from run() into saveHistory() with histReq parameter struct. Fix gofmt indentation in layout.go from merged PR #71.
umputun
added a commit
that referenced
this pull request
Apr 8, 2026
* feat: add review history auto-save on quit Add app/history/ package that saves review session history to ~/.config/revdiff/history/<repo>/<timestamp>.md on quit. Includes header metadata, annotations, and git diff for annotated files. Wired into main app quit path. All errors logged, never fatal. * refactor(history): use Service struct and extract saveHistory helper Move standalone Save/gitDiff/gitCommitHash/filterRepoFiles functions to methods on Service struct. Extract history save logic from run() into saveHistory() with histReq parameter struct. Fix gofmt indentation in layout.go from merged PR #71. * fix: improve git diff error logging and clarify non-git history paths Capture stderr from git diff failures for better diagnostics. Clarify docs that --stdin saves under stdin/ subdir and --only uses parent directory name instead of repo name.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Hotkeys now work regardless of the active keyboard layout. Pressing
г(Cyrillic) triggers the same action asu,ξ(Greek) asj,ח(Hebrew) asj— all based on physical key position.How it works
A transparent fallback in
Keymap.Resolve(): when a pressed key has no direct binding and is a known non-Latin character, it is translated to its Latin QWERTY equivalent and looked up again. Purely additive — existing behavior unchanged.Design decisions:
;or,exist at different positions across layouts — mapping them would be ambiguous.--dump-keys,KeysFor()unaffected — canonical Latin bindings only.Supported layouts
CJK layouts don't need this (IME sends Latin). Latin-script layouts already send correct letters.
Files changed
app/keymap/layout.go(new) — staticmap[rune]rune+layoutResolve()app/keymap/keymap.go—Resolve()tries layout alias on miss (3 lines)app/keymap/layout_test.go(new) — unit + integration testsExtensibility
Adding a layout = appending entries to the map. Arabic, Thai, etc. can be added the same way.