Add hidecursorinactive option to indicate status when terminal loses focus (#965)

* Enable focus events through configuration by using focus (option) and on-ui-enter/on-ui-exit events.

* Revert doc

This reverts commit 77f113639f.

* Revert rune evt

This reverts commit 77f113639f.

* hidecursorinactive with tcell

* cleanup

* cleanup
This commit is contained in:
Christian Zangl authored and GitHub committed 2023-12-26 15:37:11 +01:00
1 parent 2a4adb323f
commit 075caac3a9
8 files changed
+818 -997

No files matched your search

+21
View File
@@ -68,6 +68,27 @@ func (e *setExpr) eval(app *app, args []string) {
gOpts.cursorparentfmt = e.val
case "cursorpreviewfmt":
gOpts.cursorpreviewfmt = e.val
case "hidecursorinactive":
if e.val == "" || e.val == "true" {
gOpts.hidecursorinactive = true
} else if e.val == "false" {
gOpts.hidecursorinactive = false
} else {
app.ui.echoerr("hidecursorinactive: value should be empty, 'true', or 'false'")
return
}
case "nohidecursorinactive":
if e.val != "" {
app.ui.echoerrf("nohidecursorinactive: unexpected value: %s", e.val)
return
}
gOpts.hidecursorinactive = false
case "hidecursorinactive!":
if e.val != "" {
app.ui.echoerrf("hidecursorinactive!: unexpected value: %s", e.val)
return
}
gOpts.hidecursorinactive = !gOpts.hidecursorinactive
case "dircache":
if e.val == "" || e.val == "true" {
gOpts.dircache = true