Compare commits

..

No commits in common. "959030f70d615dda47c9a75b0c6494ed4fad1890" and "1eed4cc7ee70deb3eda5026db43007d00fe61929" have entirely different histories.

2 changed files with 9 additions and 20 deletions

View File

@ -1,19 +1,8 @@
local fs = require 'fs' -- Add command builtins
require 'nature.commands.cd'
-- explanation: this specific function gives to us info about require 'nature.commands.cdr'
-- the currently running source. this includes a path to the require 'nature.commands.doc'
-- source file (info.source) require 'nature.commands.exit'
-- we will use that to automatically load all commands by reading require 'nature.commands.disown'
-- all the files in this dir and just requiring it. require 'nature.commands.fg'
local info = debug.getinfo(1) require 'nature.commands.bg'
local commandDir = fs.dir(info.source)
if commandDir == '.' then return end
local commands = fs.readdir(commandDir)
for _, command in ipairs(commands) do
local name = command:gsub('%.lua', '') -- chop off extension
if name ~= 'init' then
-- skip this file (for obvious reasons)
require('nature.commands.' .. name)
end
end

2
rl.go
View File

@ -55,7 +55,7 @@ func newLineReader(prompt string, noHist bool) *lineReader {
return []rune{} return []rune{}
} }
retVal, err := rt.Call1(l.MainThread(), rt.FunctionValue(hinter), retVal, err := rt.Call1(l.MainThread(), rt.FunctionValue(highlighter),
rt.StringValue(string(line)), rt.IntValue(int64(pos))) rt.StringValue(string(line)), rt.IntValue(int64(pos)))
if err != nil { if err != nil {
fmt.Println(err) fmt.Println(err)