Skip to content

Lua Error: function does not exist #3928

@wf5w

Description

@wf5w

In my .config/micro/ I have two files:

init.lua:

function addTextAtTop(buffer, text)
buffer:Start() -- Move cursor to the beginning of the file
buffer:Insert(text) -- Insert the specified text
end

and in my bindings.json I have:

{
"Ctrl-t": "lua:addTextAtTop(buffer, "Your text here\n")"
}

I want to be able to insert Your text here\n at the top of the current buffer, by pressing Ctrl-t

But when create a file with Micro I get:
Lua Error: addTextAtTop(buffer does not exist

What am I not doing correctly? I am a noob when it comes to Micro.

Thanks for your help,

Jerry

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions