Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.6, 0.7, and 0.7.1

status: expand tabs to spaces in status and commit dialogs

Changeset b105ad0b82e9

Parent fa36a04eb942

by Steve Borho

Changes to one file · Browse files at b105ad0b82e9 Showing diff from parent fa36a04eb942 Diff from another changeset...

Change 1 of 3 Show Entire File hggtk/​status.py Stacked
 
27
28
29
30
 
31
32
33
 
190
191
192
 
 
193
194
195
 
576
577
578
 
 
579
580
 
 
581
582
583
584
 
 
585
586
587
 
27
28
29
 
30
31
32
33
 
190
191
192
193
194
195
196
197
 
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
@@ -27,7 +27,7 @@
 from mercurial import merge as merge_  from hgext import extdiff  from shlib import shell_notify -from hglib import toutf, rootpath +from hglib import toutf, rootpath, gettabwidth  from gdialog import *  from dialog import entry_dialog   @@ -190,6 +190,8 @@
  else:   self._setting_pos = 64000   self._setting_lastpos = 270 + self.tabwidth = gettabwidth(self.ui) +       def get_body(self): @@ -576,12 +578,18 @@
  if line.startswith('---') or line.startswith('+++'):   buffer.insert_with_tags_by_name(iter, line, 'header')   elif line.startswith('-'): + if self.tabwidth: + line = line[0] + line[1:].expandtabs(self.tabwidth)   buffer.insert_with_tags_by_name(iter, line, 'removed')   elif line.startswith('+'): + if self.tabwidth: + line = line[0] + line[1:].expandtabs(self.tabwidth)   buffer.insert_with_tags_by_name(iter, line, 'added')   elif line.startswith('@@'):   buffer.insert_with_tags_by_name(iter, line, 'position')   else: + if self.tabwidth: + line = line[0] + line[1:].expandtabs(self.tabwidth)   buffer.insert(iter, line)     self.diff_text.set_buffer(buffer)