unicode_input kitten: Add an option to specify the startup tab

Fixes #6552
This commit is contained in:
Kovid Goyal
2023-08-16 11:54:50 +05:30
parent f299549dba
commit 670ad353b2
3 changed files with 25 additions and 5 deletions

View File

@@ -555,14 +555,25 @@ func run_loop(opts *Options) (lp *loop.Loop, err error) {
defer cv.Save()
h := handler{recent: cached_data.Recent, lp: lp, emoji_variation: opts.EmojiVariation}
switch cached_data.Mode {
case "HEX":
switch opts.Tab {
case "previous":
switch cached_data.Mode {
case "HEX":
h.mode = HEX
case "NAME":
h.mode = NAME
case "EMOTICONS":
h.mode = EMOTICONS
case "FAVORITES":
h.mode = FAVORITES
}
case "code":
h.mode = HEX
case "NAME":
case "name":
h.mode = NAME
case "EMOTICONS":
case "emoticons":
h.mode = EMOTICONS
case "FAVORITES":
case "favorites":
h.mode = FAVORITES
}
all_modes[0] = ModeData{mode: HEX, title: "Code", key: "F1"}

View File

@@ -18,6 +18,13 @@ Whether to use the textual or the graphical form for emoji. By default the
default form specified in the Unicode standard for the symbol is used.
--tab
type=choices
default=previous
choices=previous,code,name,emoticons,favorites
The initial tab to display. Defaults to using the tab from the previous kitten invocation.
'''.format