MCPcopy Create free account
hub / github.com/gokcehan/lf / exportMode

Method exportMode

app.go:751–793  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

749}
750
751func (app *app) exportMode() {
752 getMode := func() string {
753 if app.menuCompActive {
754 return "compmenu"
755 }
756
757 if strings.HasPrefix(app.ui.cmdPrefix, "delete") {
758 return "delete"
759 }
760
761 if strings.HasPrefix(app.ui.cmdPrefix, "replace") || strings.HasPrefix(app.ui.cmdPrefix, "create") {
762 return "rename"
763 }
764
765 switch app.ui.cmdPrefix {
766 case "filter: ":
767 return "filter"
768 case "find: ", "find-back: ":
769 return "find"
770 case "mark-save: ", "mark-load: ", "mark-remove: ":
771 return "mark"
772 case "rename: ":
773 return "rename"
774 case "/", "?":
775 return "search"
776 case ":":
777 return "command"
778 case "$", "%", "!", "&":
779 return "shell"
780 case ">":
781 return "pipe"
782 case "":
783 if app.nav.isVisualMode() {
784 return "visual"
785 }
786 return "normal"
787 default:
788 return "unknown"
789 }
790 }
791
792 os.Setenv("lf_mode", getMode())
793}

Callers 1

runShellMethod · 0.95

Calls 1

isVisualModeMethod · 0.80

Tested by

no test coverage detected