Permalink
Browse files

remove outdated code

  • Loading branch information...
1 parent 95ee1e2 commit b17f9135e96ea1829fa8d209a7817530d12b19a6 @zaufi committed Jun 26, 2012
Showing with 7 additions and 13 deletions.
  1. +6 −12 commentar.py
  2. +1 −1 libkatepate/selection.py
View
18 commentar.py
@@ -96,15 +96,6 @@ def isApplicableMime():
return str(kate.activeDocument().mimeType()).find('c++') != -1
-def insertTextBlock(document, line, text):
- """Put lines from a list into the current position (line) in a document
- """
- if bool(text):
- for l in text:
- document.insertLine(line, l)
- line += 1
-
-
def extendSelectionToWholeLine(view):
selectedRange = view.selectionRange()
if not selectedRange.isEmpty():
@@ -284,7 +275,8 @@ def commentar():
document.startEditing() # Start edit transaction:
document.removeLine(pos.line()) # Remove current line
# insert resulting text line by line...
- insertTextBlock(document, pos.line(), text)
+ pos.setColumn(0)
+ document.insertText(pos, '\n'.join(text) + '\n')
document.endEditing() # End transaction
# Move cursor to desired position
@@ -335,7 +327,8 @@ def moveAbove():
document.removeLine(pos.line()) # Remove current line
# insert resulting text line by line...
- insertTextBlock(document, pos.line(), insertionText)
+ pos.setColumn(0)
+ document.insertText(pos, '\n'.join(insertionText) + '\n')
# Move cursor to desired position
pos.setColumn(column)
@@ -409,7 +402,8 @@ def moveInline():
document.removeLine(pos.line()) # Remove current line
# insert resulting text line by line...
- insertTextBlock(document, pos.line(), insertionText)
+ pos.setColumn(0)
+ document.insertText(pos, '\n'.join(insertionText) + '\n')
# Move cursor to desired position
pos.setColumn(column)
View
2 libkatepate/selection.py
@@ -19,7 +19,7 @@
''' Reusable code for Kate/Pâté plugins: selection mode constants
- ... just to introduce seperate `namespace`
+ ... just to introduce separate `namespace`
NOTE Is there (in Python) a better way to do it?
'''

0 comments on commit b17f913

Please sign in to comment.