Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Remove unicode() calls, change loader #12

Merged
merged 5 commits into from

1 participant

@drahnr
Collaborator

There is no python loader, only a python3 loader (at least on ArchLinux)
Function unicode is not defined for python 3.3.2

drahnr added some commits
@drahnr drahnr merged commit 2644c1d into jonleighton:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 26, 2013
  1. @drahnr
  2. @drahnr

    Precompile regex pattern

    drahnr authored
  3. @drahnr

    Update README

    drahnr authored
Commits on Dec 1, 2013
  1. @drahnr
  2. @drahnr

    Bump version to 3.3.0

    drahnr authored
    A lot of different versions are floating around, thus omit the 3.2.x series which were spotted in the whild.
This page is out of date. Refresh to see the latest.
Showing with 15 additions and 8 deletions.
  1. +10 −4 README.md
  2. +2 −2 trailsave.plugin
  3. +3 −2 trailsave.py
View
14 README.md
@@ -1,16 +1,15 @@
-**I am no longer maintaining this project. Please contact me if you'd like to take over.**
-
Gedit Trailsave
---------------
A plugin for Gedit 3 to strip trailing whitespace on save.
-This will not work on Gedit 2. You can download the Gedit 2 version here: http://users.tkk.fi/~otsaloma/gedit/
+This will not work on Gedit 2.
* Authors:
* Osmo Salomaa wrote original Gedit 2 plugin
* Jon Leighton ported to Gedit 3
-* Version: 3.1.2
+ * Bernhard Schuster maintainance & fixes
+* Version: 3.3.0
Installation
------------
@@ -21,9 +20,16 @@ Installation
4. Activate the plugin in 'Edit > Preferences'
5. Now, whenever a document is saved, trailing whitepace will be removed
+Issues
+------
+
+Report issues to the [bug tracker on github](https://github.com/jonleighton/gedit-trailsave/issues)
+
+
License
-------
+Copyright (C) 2013 Bernhard Schuster
Copyright (C) 2006-2011 Osmo Salomaa & Jon Leighton
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
View
4 trailsave.plugin
@@ -1,5 +1,5 @@
[Plugin]
-Loader=python
+Loader=python3
Module=trailsave
IAge=3
Name=Trailsave
@@ -7,4 +7,4 @@ Description=Strip trailing whitespace on save
Authors=Osmo Salomaa <otsaloma@cc.hut.fi>, Jon Leighton <j@jonathanleighton.com>
Copyright=Copyright (C) 2006-2011 Osmo Salomaa & Jon Leighton
Website=http://github.com/jonleighton/gedit-trailsave
-Version=3.1.2
+Version=3.3.0
View
5 trailsave.py
@@ -58,7 +58,8 @@ def strip_trailing_spaces(self):
"""
text = self.doc.get_text(self.doc.get_start_iter(), self.doc.get_end_iter(), False)
- text = unicode(text, 'utf-8')
+
+ compiledpattern = re.compile('.*?([ \t]+)$', flags=re.MULTILINE)
start_iter = self.doc.get_start_iter()
end_iter = self.doc.get_start_iter()
@@ -66,7 +67,7 @@ def strip_trailing_spaces(self):
line_no = 0 # Last matched line no
last_match_pos = 0 # Last matched position in the string
- for match in re.finditer('.*?([ \t]+)$', text, flags=re.MULTILINE):
+ for match in re.finditer(compiledpattern, text):
# Count the newlines since the last match
line_no += text.count('\n', last_match_pos, match.start())
Something went wrong with that request. Please try again.