diff --git a/TODO b/TODO index cfde09f..e54bfc1 100644 --- a/TODO +++ b/TODO @@ -14,9 +14,11 @@ [ ] add a cross to close tab [ ] prevent overscrolling on treeview [x] user config file and/or init.lua -[ ] change tmp directory to somewhere in /tmp +[x] change tmp directory to somewhere in /tmp [x] save project directory and restore on reopening [ ] optimize dir tree taking too long to load on big folders +[ ] SDL: optimize drawing operations +[ ] syntax: do not reload syntax on every draw event [ ] go in background when launching from terminal [ ] some key bindings: [x] alt+right == End diff --git a/data/core/common.lua b/data/core/common.lua index b195cea..1fc91b8 100644 --- a/data/core/common.lua +++ b/data/core/common.lua @@ -81,7 +81,7 @@ function common.fuzzy_match(haystack, needle) return system.fuzzy_match(haystack, needle) end --- FIXME: why does this crash when specifying path? + function common.path_suggest(text) local path, name = text:match("^(.-)([^/\\]*)$") local files = system.list_dir(path == "" and "." or path) or {} diff --git a/data/core/init.lua b/data/core/init.lua index 7cb64b2..1fa17f3 100644 --- a/data/core/init.lua +++ b/data/core/init.lua @@ -157,16 +157,16 @@ local temp_file_prefix = string.format(".lite_temp_%08x", temp_uid) local temp_file_counter = 0 local function delete_temp_files() - for _, filename in ipairs(system.list_dir(EXEDIR)) do + for _, filename in ipairs(system.list_dir(TEMPDIR)) do if filename:find(temp_file_prefix, 1, true) == 1 then - os.remove(EXEDIR .. PATHSEP .. filename) + os.remove(TEMPDIR .. PATHSEP .. filename) end end end function core.temp_filename(ext) temp_file_counter = temp_file_counter + 1 - return EXEDIR .. PATHSEP .. temp_file_prefix + return TEMPDIR .. PATHSEP .. temp_file_prefix .. string.format("%06x", temp_file_counter) .. (ext or "") end diff --git a/src/main.c b/src/main.c index e582238..cf018a5 100644 --- a/src/main.c +++ b/src/main.c @@ -96,6 +96,7 @@ int main(int argc, char **argv) "xpcall(function()\n" " SCALE = tonumber(os.getenv(\"LITE_SCALE\")) or SCALE\n" " USERDIR = os.getenv(\"HOME\") .. '/.config/lite'\n" + " TEMPDIR = os.getenv(\"LITE_CACHE\") or '/tmp'\n" " PATHSEP = package.config:sub(1, 1)\n" " EXEDIR = EXEFILE:match(\"^(.+)[/\\\\].*$\")\n" " package.path = EXEDIR .. '/data/?.lua;' .. package.path\n"