[Github-comments] [geany/geany-plugins] GeanyLua: get selected filename (#786)

Skif-off notifications at xxxxx
Sat Nov 17 07:12:13 UTC 2018


I updated Lua-script in first message: missing symbol "\\" and returning default list of wordchars.
___
I wrote a Lua script as module https://pastebin.com/6v5xft6R List of functions:
```
get_sel_filename()
file_is_exists(path)
path_is_absolute(path)
tidy_path(path)
```
How to use: Save as ```getselfile.lua``` in ```~/.config/geany/plugins/geanylua/support``` (default on Linux).
Example:
```lua
-- Get the user's plugin directory and add folder "support" in "package.path"
local gi = geany.appinfo()
package.path = package.path .. ";" .. gi.scriptdir .. geany.dirsep .. "support" .. geany.dirsep .. "?.lua";
-- Load our module
local gsfn = require "getselfile"
-- Get selected filename
local f = gsfn.get_sel_filename();
if (f ~= nil) then geany.message(f) end;
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/issues/786#issuecomment-439594771
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20181116/311acc25/attachment-0001.html>


More information about the Github-comments mailing list