Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

remove outdated code

  • Loading branch information...
commit b17f9135e96ea1829fa8d209a7817530d12b19a6 1 parent 95ee1e2
Alex Turbov authored

Showing 2 changed files with 7 additions and 13 deletions. Show diff stats Hide diff stats

  1. +6 12 commentar.py
  2. +1 1  libkatepate/selection.py
18 commentar.py
@@ -96,15 +96,6 @@ def isApplicableMime():
96 96 return str(kate.activeDocument().mimeType()).find('c++') != -1
97 97
98 98
99   -def insertTextBlock(document, line, text):
100   - """Put lines from a list into the current position (line) in a document
101   - """
102   - if bool(text):
103   - for l in text:
104   - document.insertLine(line, l)
105   - line += 1
106   -
107   -
108 99 def extendSelectionToWholeLine(view):
109 100 selectedRange = view.selectionRange()
110 101 if not selectedRange.isEmpty():
@@ -284,7 +275,8 @@ def commentar():
284 275 document.startEditing() # Start edit transaction:
285 276 document.removeLine(pos.line()) # Remove current line
286 277 # insert resulting text line by line...
287   - insertTextBlock(document, pos.line(), text)
  278 + pos.setColumn(0)
  279 + document.insertText(pos, '\n'.join(text) + '\n')
288 280 document.endEditing() # End transaction
289 281
290 282 # Move cursor to desired position
@@ -335,7 +327,8 @@ def moveAbove():
335 327 document.removeLine(pos.line()) # Remove current line
336 328
337 329 # insert resulting text line by line...
338   - insertTextBlock(document, pos.line(), insertionText)
  330 + pos.setColumn(0)
  331 + document.insertText(pos, '\n'.join(insertionText) + '\n')
339 332
340 333 # Move cursor to desired position
341 334 pos.setColumn(column)
@@ -409,7 +402,8 @@ def moveInline():
409 402 document.removeLine(pos.line()) # Remove current line
410 403
411 404 # insert resulting text line by line...
412   - insertTextBlock(document, pos.line(), insertionText)
  405 + pos.setColumn(0)
  406 + document.insertText(pos, '\n'.join(insertionText) + '\n')
413 407
414 408 # Move cursor to desired position
415 409 pos.setColumn(column)
2  libkatepate/selection.py
@@ -19,7 +19,7 @@
19 19
20 20 ''' Reusable code for Kate/Pâté plugins: selection mode constants
21 21
22   - ... just to introduce seperate `namespace`
  22 + ... just to introduce separate `namespace`
23 23 NOTE Is there (in Python) a better way to do it?
24 24 '''
25 25

0 comments on commit b17f913

Please sign in to comment.
Something went wrong with that request. Please try again.