File: list-open-files.lua

package info (click to toggle)
geany-plugins 2.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 22,832 kB
  • sloc: ansic: 107,883; sh: 5,567; makefile: 1,531; sed: 16
file content (34 lines) | stat: -rw-r--r-- 615 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--[[ 
  Creates a new, untitled document containing a list
  of all currently opened (and named) files.
--]]

local files={}

for file in geany.documents()
do
  table.insert(files,file)
end

if ( #files > 0 )
then
  if geany.confirm("Found "..#files.." files.", "Open list in new tab?", false )
  then
    local names = ""
    for i,file in pairs(files)
    do
      names=names..file.."\n"
    end
    geany.newfile("Files")
    geany.text(names)
  else
    file=geany.choose("Choose a tab to activate:", files)
    if (file)
    then
      geany.activate(file)
    end
  end
else
	geany.message("No files!")
end