Commit f7945f3e authored by Phil Hagelberg's avatar Phil Hagelberg
Browse files

Remove some assumptions about running from a checkout.

parent 071c9c04
Loading
Loading
Loading
Loading
+0 −0

File moved.

+1 −0
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@
(require "config.fennel-mode")
(require "config.repl")
(require "config.irc")
(require "config.emacs")

(editor.open nil "*repl*" "repl")
(editor.change_buffer "*repl*")
+0 −0

File moved.

+12 −2
Original line number Diff line number Diff line
local fennel = require("fennel")
table.insert(package.loaders, fennel.make_searcher({correlate=true}))
fennel.path = love.filesystem.getSource() .. "/?.fnl;" ..
   love.filesystem.getSource() .. "/?/init.fnl;" .. fennel.path

-- hack for running on android where stdout is broken
if not os.getenv("PWD") then
   local out = io.open("/sdcard/lovegame/out", "w")
   print = function(...)
      for _, x in ipairs({...}) do out:write(tostring(x)) end out:write("\n")
   end
end

local polywell = require("polywell")
local fs_for = require("polywell.fs")
@@ -75,7 +85,7 @@ love.load = function()

   polywell.fs = polywell.fs or fs_for(os.getenv("PWD") or ".")
   -- You can use the init written in lua:
   -- dofile("config/init.lua")
   -- dofile("config/oldinit.lua")
   -- Or the init code written in Fennel:
   fennel.dofile("config/init.fnl")
   require("config")
end
+2 −1
Original line number Diff line number Diff line
@@ -590,7 +590,8 @@ local function bind(mode_name, keycode, fn)
end

local handle_textinput = function(text, long_ok)
   if(b and not find_binding(text) and (utf8.len(text) == 1 or long_ok)) then
   local _, len = pcall(utf8.len, text)
   if(b and not find_binding(text) and (len == 1 or long_ok)) then
      with_traceback(textinput, text)
   end
end