Skip to content

Accessing the repeat variable to make multiple files/dirs etc. #1180

Answered by joelim-work
Joyje asked this question in Q&A
Discussion options

You must be logged in to vote

This behaviour is currently not supported in lf, because up until now nobody has ever mentioned such a use case.

In order to achieve this, the code would have to be modified to export the command count as a variable:

--- a/eval.go
+++ b/eval.go
@@ -1254,20 +1254,21 @@ func insert(app *app, arg string) {
                }
                fallthrough
        default:
                app.ui.menuBuf = nil
                app.menuCompActive = false
                app.ui.cmdAccLeft = append(app.ui.cmdAccLeft, []rune(arg)...)
        }
 }

 func (e *callExpr) eval(app *app, args []string) {
+       os.Setenv("lf_count", strconv.Itoa(e.count))
        switch e.name {
        case "up":
         …

Replies: 2 comments 12 replies

Comment options

You must be logged in to vote
12 replies
@Joyje
Comment options

@joelim-work
Comment options

@Joyje
Comment options

@joelim-work
Comment options

@gokcehan
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by Joyje
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants