Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Librerator started with opening last document will now go to FileChooser

on document close
  • Loading branch information...
commit 93e09754ec3ee7dcb0fbc552045612559c2e9986 1 parent 2bdafe1
@kai771 authored
Showing with 11 additions and 2 deletions.
  1. +5 −1 filechooser.lua
  2. +6 −1 reader.lua
View
6 filechooser.lua
@@ -223,7 +223,11 @@ function FileChooser:setPath(newPath, reset_pos)
end
end
-function FileChooser:choose(ypos, height)
+function FileChooser:choose(ypos, height, lf)
+ if lf ~= nil then
+ openFile(lf)
+ ret_code = ""
+ end
self.perpage = math.floor(G_height / self.spacing) - 2
self.pagedirty = true
self.markerdirty = false
View
7 reader.lua
@@ -176,7 +176,12 @@ if ARGV[argidx] and lfs.attributes(ARGV[argidx], "mode") == "directory" then
elseif ARGV[argidx] and lfs.attributes(ARGV[argidx], "mode") == "file" then
openFile(ARGV[argidx])
elseif patharg and lfs.attributes(patharg, "mode") == "file" then
- openFile(patharg)
+ local handle = io.popen("dirname '"..patharg.."'")
+ local lfdir = handle:read("*a")
+ handle:close()
+ lfdir = string.gsub(lfdir, "\n", "")
+ FileChooser:setPath(lfdir)
+ FileChooser:choose(0, G_height, patharg)
else
return showusage()
end
Please sign in to comment.
Something went wrong with that request. Please try again.