mirror of
https://github.com/zyedidia/micro.git
synced 2024-10-27 12:37:38 +03:00
Change the help binding to Ctrl-g from Ctrl-h
This is necessary because some terminals send Backspace and Ctrl-h as the same key, so Ctrl-h must be reserved for deleting. See #8.
This commit is contained in:
parent
fdceddefe1
commit
d10c401a97
@ -26,7 +26,7 @@ Ctrl-c: Copy
|
||||
Ctrl-x: Cut
|
||||
Ctrl-v: Paste
|
||||
|
||||
Ctrl-h: Open help
|
||||
Ctrl-g: Open this help screen
|
||||
|
||||
Ctrl-u: Half page up
|
||||
Ctrl-d: Half page down
|
||||
|
@ -197,7 +197,7 @@ func main() {
|
||||
if !canceled {
|
||||
HandleCommand(input, view)
|
||||
}
|
||||
case tcell.KeyCtrlH:
|
||||
case tcell.KeyCtrlG:
|
||||
DisplayHelp()
|
||||
// Make sure to resize the view if the user resized the terminal while looking at the help text
|
||||
view.Resize(screen.Size())
|
||||
|
@ -40,7 +40,7 @@ func (sline *Statusline) Display() {
|
||||
// Add the filetype
|
||||
file += " " + sline.view.buf.filetype
|
||||
|
||||
centerText := "Press Ctrl-h for help"
|
||||
centerText := "Press Ctrl-g for help"
|
||||
|
||||
statusLineStyle := defStyle.Reverse(true)
|
||||
if style, ok := colorscheme["statusline"]; ok {
|
||||
|
@ -394,7 +394,7 @@ func (v *View) HandleEvent(event tcell.Event) {
|
||||
v.eh.Insert(v.cursor.Loc(), " ")
|
||||
v.cursor.Right()
|
||||
v.UpdateLines(v.cursor.y, v.cursor.y)
|
||||
case tcell.KeyBackspace2:
|
||||
case tcell.KeyBackspace2, tcell.KeyBackspace:
|
||||
// Delete a character
|
||||
if v.cursor.HasSelection() {
|
||||
v.cursor.DeleteSelection()
|
||||
|
Loading…
Reference in New Issue
Block a user