changeset 94:4232c8e2e2bf

- align display of context lines with added/removed lines. (issue #31)
author Mark Edgington <edgimar@gmail.com>
date Sat, 28 Apr 2012 21:26:49 -0400
parents 4e2c6a7c659f
children f6c90dc7b5a1
files crecord/chunk_selector.py
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/crecord/chunk_selector.py
+++ b/crecord/chunk_selector.py
@@ -685,18 +685,16 @@
         if hunk.folded and not ignoreFolding:
             return outStr
 
-        indentNumChars = self.hunkLineIndentNumChars-1
         # a bit superfluous, but to avoid hard-coding indent amount
         checkBox = self.getStatusPrefixString(hunk)
         for line in hunk.after:
-            lineStr = " "*(indentNumChars + len(checkBox)) + line
+            lineStr = " "*(self.hunkLineIndentNumChars + len(checkBox)) + line
             outStr += self.printString(self.chunkpad, lineStr, toWin=toWin)
 
         return outStr
 
     def printHunkChangedLine(self, hunkLine, selected=False, toWin=True):
         outStr = ""
-        indentNumChars = self.hunkLineIndentNumChars
         checkBox = self.getStatusPrefixString(hunkLine)
 
         lineStr = hunkLine.prettyStr().strip("\n")
@@ -711,7 +709,7 @@
         elif lineStr.startswith("\\"):
             colorPair = self.getColorPair(name="normal")
 
-        linePrefix = " "*indentNumChars + checkBox
+        linePrefix = " "*self.hunkLineIndentNumChars + checkBox
         outStr += self.printString(self.chunkpad, linePrefix, toWin=toWin,
                                    align=False) # add uncolored checkbox/indent
         outStr += self.printString(self.chunkpad, lineStr, pair=colorPair,