~ubuntu-branches/debian/sid/geany-plugins/sid

« back to all changes in this revision

Viewing changes to geanylua/examples/edit/right-trim.lua

  • Committer: Bazaar Package Importer
  • Author(s): Chow Loong Jin
  • Date: 2009-07-10 22:56:41 UTC
  • Revision ID: james.westby@ubuntu.com-20090710225641-xc1126t7pq0jmpos
Tags: upstream-0.17.1
ImportĀ upstreamĀ versionĀ 0.17.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--[[
 
2
  Trim all trailing whitespace from the current document
 
3
--]]
 
4
 
 
5
 
 
6
local s=geany.text()
 
7
 
 
8
if (s and string.match(s, "[ \t]\n") )
 
9
then
 
10
  geany.text(string.gsub(s,"[ \t]+\n", "\n"))
 
11
else
 
12
  geany.message("Right trim:", "Match not found.")
 
13
end