[geany/geany-plugins] 23e563: GeanyLua: Fix right-trim.lua

Skif-off git-noreply at xxxxx
Mon Jan 29 06:39:08 UTC 2018


Branch:      refs/heads/master
Author:      Skif-off <Skif-off at users.noreply.github.com>
Committer:   GitHub <noreply at github.com>
Date:        Tue, 09 Jan 2018 00:02:24 UTC
Commit:      23e563337611fb0087679c36fb0e91472e865bb5
             https://github.com/geany/geany-plugins/commit/23e563337611fb0087679c36fb0e91472e865bb5

Log Message:
-----------
GeanyLua: Fix right-trim.lua

Now script works with files with CRLF too


Modified Paths:
--------------
    geanylua/examples/edit/right-trim.lua

Modified: geanylua/examples/edit/right-trim.lua
4 lines changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -5,9 +5,9 @@
 
 local s=geany.text()
 
-if (s and string.match(s, "[ \t]\n") )
+if (s and string.match(s, "[ \t][\r\n]") )
 then
-  geany.text(string.gsub(s,"[ \t]+\n", "\n"))
+  geany.text(string.gsub(s,"([ \t]+)([\r\n]+)", "%2"))
 else
   geany.message("Right trim:", "Match not found.")
 end



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Plugins-Commits mailing list