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

Method exportFiles

nav.go:714–742  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

712}
713
714func (nav *nav) exportFiles() {
715 var currFile string
716 if curr := nav.currFile(); curr != nil {
717 currFile = quoteString(curr.path)
718 }
719
720 var selections []string
721 for _, selection := range nav.currSelections() {
722 selections = append(selections, quoteString(selection))
723 }
724 currSelections := strings.Join(selections, gOpts.filesep)
725
726 var vSelections []string
727 for _, selection := range nav.currDir().visualSelections() {
728 vSelections = append(vSelections, quoteString(selection))
729 }
730 currVSelections := strings.Join(vSelections, gOpts.filesep)
731
732 os.Setenv("f", currFile)
733 os.Setenv("fs", currSelections)
734 os.Setenv("fv", currVSelections)
735 os.Setenv("PWD", quoteString(nav.currDir().path))
736
737 if len(selections) == 0 {
738 os.Setenv("fx", currFile)
739 } else {
740 os.Setenv("fx", currSelections)
741 }
742}
743
744func (nav *nav) preloadLoop(ui *ui) {
745 stack := []string{}

Callers 1

runShellMethod · 0.80

Calls 5

currFileMethod · 0.95
currSelectionsMethod · 0.95
currDirMethod · 0.95
visualSelectionsMethod · 0.80
quoteStringFunction · 0.70

Tested by

no test coverage detected