From 5f7700e13268e9003fb7cff5bd1e7e2f9f3b18cc Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Tue, 20 Aug 2024 12:05:43 -0400 Subject: [PATCH] refactor: unexport modify other keys --- options.go | 10 +++++----- parse.go | 2 +- xterm.go | 16 ++++++++-------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/options.go b/options.go index 3b1bf66c99..7ecaec3401 100644 --- a/options.go +++ b/options.go @@ -256,7 +256,7 @@ func WithReportFocus() ProgramOption { func WithEnhancedKeyboard() ProgramOption { return func(p *Program) { _WithKittyKeyboard(3)(p) - WithModifyOtherKeys(1)(p) + _WithModifyOtherKeys(1)(p) } } @@ -281,7 +281,7 @@ func _WithKittyKeyboard(flags int) ProgramOption { } } -// WithModifyOtherKeys enables support for the XTerm modifyOtherKeys feature. +// _WithModifyOtherKeys enables support for the XTerm modifyOtherKeys feature. // This feature allows the terminal to report ambiguous keys as escape codes. // This is useful for terminals that don't support the Kitty keyboard protocol. // @@ -293,21 +293,21 @@ func _WithKittyKeyboard(flags int) ProgramOption { // and Meta- // // See https://invisible-island.net/xterm/manpage/xterm.html#VT100-Widget-Resources:modifyOtherKeys -func WithModifyOtherKeys(mode int) ProgramOption { +func _WithModifyOtherKeys(mode int) ProgramOption { return func(p *Program) { p.modifyOtherKeys = mode p.startupOptions |= withModifyOtherKeys } } -// WithWindowsInputMode enables Windows Input Mode (win32-input-mode) which +// _WithWindowsInputMode enables Windows Input Mode (win32-input-mode) which // allows for more advanced input handling and reporting. This is experimental // and may not work on all terminals. // // See // https://github.com/microsoft/terminal/blob/main/doc/specs/%234999%20-%20Improved%20keyboard%20handling%20in%20Conpty.md // for more information. -func WithWindowsInputMode() ProgramOption { +func _WithWindowsInputMode() ProgramOption { return func(p *Program) { p.startupOptions |= withWindowsInputMode p.win32Input = true diff --git a/parse.go b/parse.go index 908cbafb86..786d5fba71 100644 --- a/parse.go +++ b/parse.go @@ -263,7 +263,7 @@ func parseCsi(b []byte) (int, Msg) { case 'm' | '>'< // // See https://invisible-island.net/xterm/manpage/xterm.html#VT100-Widget-Resources:modifyOtherKeys -func EnableModifyOtherKeys(mode int) Cmd { +func enableModifyOtherKeys(mode int) Cmd { return func() Msg { return setModifyOtherKeysMsg(mode) } } -// DisableModifyOtherKeys is a command to disable XTerm modifyOtherKeys mode. -func DisableModifyOtherKeys() Msg { +// disableModifyOtherKeys is a command to disable XTerm modifyOtherKeys mode. +func disableModifyOtherKeys() Msg { return setModifyOtherKeysMsg(0) } @@ -56,15 +56,15 @@ func parseXTermModifyOtherKeys(csi *ansi.CsiSequence) Msg { // modifyOtherKeys mode. type modifyOtherKeys struct{} -// ModifyOtherKeys is a command that queries the terminal for its +// _ModifyOtherKeys is a command that queries the terminal for its // modifyOtherKeys mode. -func ModifyOtherKeys() Msg { +func _ModifyOtherKeys() Msg { return modifyOtherKeys{} } -// ModifyOtherKeysMsg is a message that represents XTerm modifyOtherKeys +// modifyOtherKeysMsg is a message that represents XTerm modifyOtherKeys // report. Querying the terminal for the modifyOtherKeys mode will return a -// ModifyOtherKeysMsg message with the current mode set. +// modifyOtherKeysMsg message with the current mode set. // // 0: disable // 1: enable mode 1 @@ -72,7 +72,7 @@ func ModifyOtherKeys() Msg { // // See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Functions-using-CSI-_-ordered-by-the-final-character_s_ // See: https://invisible-island.net/xterm/manpage/xterm.html#VT100-Widget-Resources:modifyOtherKeys -type ModifyOtherKeysMsg uint8 +type modifyOtherKeysMsg uint8 // TerminalVersionMsg is a message that represents the terminal version. type TerminalVersionMsg string