Page Menu
Home
Xreate
Search
Configure Global Search
Log In
Docs
Questions
Repository
Issues
Patches
Internal API
Files
F2730142
geany-plugin-sort.lua
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Mar 13, 8:12 PM
Size
603 B
Mime Type
text/plain
Expires
Sun, Mar 15, 8:12 PM (1 d, 12 h)
Engine
blob
Format
Raw Data
Handle
242786
Attached To
rXR Xreate
geany-plugin-sort.lua
View Options
function split(str, pat)
local t = {} -- NOTE: use {n = 0} in Lua-5.0
local fpat = "(.-)" .. pat
local last_end = 1
local s, e, cap = str:find(fpat, 1)
while s do
if s ~= 1 or cap ~= "" then
table.insert(t,cap)
end
last_end = e+1
s, e, cap = str:find(fpat, last_end)
end
if last_end <= #str then
cap = str:sub(last_end)
table.insert(t, cap)
end
return t
end
geany.select(0, geany.length())
local text = geany.selection()
local lines = split(text, " ")
table.sort(lines)
local output = table.concat(lines, "\n")
geany.selection(output)
Event Timeline
Log In to Comment