Remove Alt+digit view shortcuts; views switch only via F1-F4
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -46,7 +46,7 @@ Keep the file private (`chmod 600`); it holds your API keys.
|
|||||||
|
|
||||||
| Key | Action |
|
| Key | Action |
|
||||||
|---|---|
|
|---|---|
|
||||||
| `F1`–`F4`, `Alt+1`–`4` | switch view |
|
| `F1`–`F4` | switch view |
|
||||||
| `Tab`, `Shift+Tab` | switch panel within a view |
|
| `Tab`, `Shift+Tab` | switch panel within a view |
|
||||||
| `?` / `F9` | help |
|
| `?` / `F9` | help |
|
||||||
| `/` | focus search box |
|
| `/` | focus search box |
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ Keybindings (initial proposal):
|
|||||||
| Key | Action |
|
| Key | Action |
|
||||||
|---|---|
|
|---|---|
|
||||||
| `Tab` / `Shift+Tab` | Switch panel within the current view (never the view) |
|
| `Tab` / `Shift+Tab` | Switch panel within the current view (never the view) |
|
||||||
| `F1-F4` / `Alt+1-4` | Switch view, also while typing in a search box |
|
| `F1-F4` | Switch view, also while typing in a search box |
|
||||||
| `/` | Focus search |
|
| `/` | Focus search |
|
||||||
| `Enter` | Search / open details / confirm |
|
| `Enter` | Search / open details / confirm |
|
||||||
| `a` | Add selected result |
|
| `a` | Add selected result |
|
||||||
|
|||||||
+1
-8
@@ -275,18 +275,11 @@ func (a *App) handleKey(ev *tcell.EventKey) *tcell.EventKey {
|
|||||||
return ev
|
return ev
|
||||||
}
|
}
|
||||||
|
|
||||||
// viewShortcut returns the view index for F1-F4 or Alt+1-4, or -1.
|
// viewShortcut returns the view index for F1-F4, or -1.
|
||||||
func (a *App) viewShortcut(ev *tcell.EventKey) int {
|
func (a *App) viewShortcut(ev *tcell.EventKey) int {
|
||||||
if ev.Key() >= tcell.KeyF1 && ev.Key() <= tcell.KeyF12 {
|
if ev.Key() >= tcell.KeyF1 && ev.Key() <= tcell.KeyF12 {
|
||||||
return int(ev.Key() - tcell.KeyF1)
|
return int(ev.Key() - tcell.KeyF1)
|
||||||
}
|
}
|
||||||
if ev.Key() == tcell.KeyRune && ev.Modifiers()&tcell.ModAlt != 0 {
|
|
||||||
for i, v := range a.views {
|
|
||||||
if ev.Rune() == v.key {
|
|
||||||
return i
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const helpText = `[yellow]Global[-]
|
const helpText = `[yellow]Global[-]
|
||||||
F1-F4, Alt+1-4 switch view
|
F1-F4 switch view
|
||||||
Tab, Shift+Tab switch panel within a view
|
Tab, Shift+Tab switch panel within a view
|
||||||
?, F9 this help (F9 works while typing)
|
?, F9 this help (F9 works while typing)
|
||||||
q, Ctrl+C quit
|
q, Ctrl+C quit
|
||||||
|
|||||||
Reference in New Issue
Block a user