File: right-trim.lua

package info (click to toggle)
geany-plugins 0.19-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 6,864 kB
  • ctags: 3,059
  • sloc: ansic: 30,059; sh: 10,145; makefile: 531; python: 523
file content (13 lines) | stat: -rw-r--r-- 241 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
--[[
  Trim all trailing whitespace from the current document
--]]


local s=geany.text()

if (s and string.match(s, "[ \t]\n") )
then
  geany.text(string.gsub(s,"[ \t]+\n", "\n"))
else
  geany.message("Right trim:", "Match not found.")
end