diff options
author | Daniel Francis <santiago.danielfrancis@gmail.com> | 2011-12-07 18:24:53 (GMT) |
---|---|---|
committer | Daniel Francis <santiago.danielfrancis@gmail.com> | 2011-12-07 18:24:53 (GMT) |
commit | f634cd98e98652f2ec2a110def9ace68a55b7788 (patch) | |
tree | 469c58c0f3ddc2290b5df1bcf80cc6799ebd4d6f | |
parent | 17e7d48a5f33c1ae7d552e8ca8a76f52a0e0d5f5 (diff) |
Correction of some bugs
-rwxr-xr-x | bin/pep8 (renamed from pep8/pep8.py) | 0 | ||||
-rw-r--r-- | editor.py | 2 | ||||
-rw-r--r-- | pep8_check.py | 14 |
3 files changed, 9 insertions, 7 deletions
@@ -182,7 +182,7 @@ class Editor(gtksourceview2.View): def _get_all_text(self): start = self.buffer.get_start_iter() end = self.buffer.get_end_iter() - text = self.buffer.get_text(start, end, True) + text = self.buffer.get_text(start, end, False) return text def _search_entry_activate_cb(self, entry): diff --git a/pep8_check.py b/pep8_check.py index aba5329..a0ab2dd 100644 --- a/pep8_check.py +++ b/pep8_check.py @@ -49,20 +49,22 @@ class PEP8_Check(): num += 1 if str(num) in chk: line_iter = editor.buffer.get_iter_at_line(num-1) - - editor.buffer.insert_with_tags(line_iter, line+"\n", editor.error_tag) + if num == 0: + editor.buffer.insert_with_tags(line_iter, line, editor.error_tag) + else: + editor.buffer.insert_with_tags(line_iter, "\n"+line, editor.error_tag) elif not num in chk: char = 0 line_iter = editor.buffer.get_iter_at_line(num) - if num != len(text.split("\n")): - editor.buffer.insert_with_tags_by_name(line_iter, line+"\n") - else: + if num == 0: editor.buffer.insert_with_tags_by_name(line_iter, line) + else: + editor.buffer.insert_with_tags_by_name(line_iter, "\n"+line) editor.connect("move-cursor", self.set_bar_text, chk) def get_check(self): (status, output) = commands.getstatusoutput( - "python pep8/pep8.py --repeat /tmp/jamedit-pep8-chk.py") + "pep8 --repeat /tmp/jamedit-pep8-chk.py") check = self.interpret_output(output) return check |