##// END OF EJS Templates
Expand tabs to 4 spaces in %history.
Fernando Perez -
Show More
@@ -117,7 +117,7 b" def magic_history(self, parameter_s = ''):"
117 sh = self.shadowhist.all()
117 sh = self.shadowhist.all()
118 for idx, s in sh:
118 for idx, s in sh:
119 if fnmatch.fnmatch(s, pattern):
119 if fnmatch.fnmatch(s, pattern):
120 print >> outfile, "0%d: %s" %(idx, s)
120 print >> outfile, "0%d: %s" %(idx, s.expandtabs(4))
121 found = True
121 found = True
122
122
123 if found:
123 if found:
@@ -126,8 +126,11 b" def magic_history(self, parameter_s = ''):"
126 "shadow history ends, fetch by %rep <number> (must start with 0)"
126 "shadow history ends, fetch by %rep <number> (must start with 0)"
127 print >> outfile, "=== start of normal history ==="
127 print >> outfile, "=== start of normal history ==="
128
128
129 for in_num in range(init,final):
129 for in_num in range(init,final):
130 inline = input_hist[in_num]
130 # Print user history with tabs expanded to 4 spaces. The GUI clients
131 # use hard tabs for easier usability in auto-indented code, but we want
132 # to produce PEP-8 compliant history for safe pasting into an editor.
133 inline = input_hist[in_num].expandtabs(4)
131 if pattern is not None and not fnmatch.fnmatch(inline, pattern):
134 if pattern is not None and not fnmatch.fnmatch(inline, pattern):
132 continue
135 continue
133
136
General Comments 0
You need to be logged in to leave comments. Login now