Skip to content

Commit 101cf69

Browse files
committed
Re-add 'highlight-line' option to "Source" and "Assembly" module
This allows to set the background color for Pygments text. This was originally added in 4328974 then reverted in 0736cf3. Here is the reason: #116 (comment) Close #252
1 parent 4cb3873 commit 101cf69

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

.gdbinit

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,8 +1226,8 @@ class Source(Dashboard.Module):
12261226
if int(number) == current_line:
12271227
# the current line has a different style without ANSI
12281228
if R.ansi:
1229-
if self.highlighted:
1230-
line_format = '{}' + ansi(number_format, R.style_selected_1) + ' {}'
1229+
if self.highlighted and not self.highlight_line:
1230+
line_format = '{}' + ansi(number_format, R.style_selected_1) + ' {}'
12311231
else:
12321232
line_format = '{}' + ansi(number_format + ' {}', R.style_selected_1)
12331233
else:
@@ -1282,6 +1282,12 @@ A value of 0 uses the whole height.''',
12821282
'name': 'tab_size',
12831283
'type': int,
12841284
'check': check_gt_zero
1285+
},
1286+
'highlight-line': {
1287+
'doc': 'Decide whether the whole current line should be highlighted.',
1288+
'default': False,
1289+
'name': 'highlight_line',
1290+
'type': bool
12851291
}
12861292
}
12871293

@@ -1407,7 +1413,7 @@ The instructions constituting the current statement are marked, if available.'''
14071413
indicator = ansi(indicator, R.style_selected_1)
14081414
opcodes = ansi(opcodes, R.style_selected_1)
14091415
func_info = ansi(func_info, R.style_selected_1)
1410-
if not highlighter.active:
1416+
if not highlighter.active or self.highlight_line:
14111417
text = ansi(text, R.style_selected_1)
14121418
elif line_info and line_info.pc <= addr < line_info.last:
14131419
if not R.ansi:
@@ -1416,7 +1422,7 @@ The instructions constituting the current statement are marked, if available.'''
14161422
indicator = ansi(indicator, R.style_selected_2)
14171423
opcodes = ansi(opcodes, R.style_selected_2)
14181424
func_info = ansi(func_info, R.style_selected_2)
1419-
if not highlighter.active:
1425+
if not highlighter.active or self.highlight_line:
14201426
text = ansi(text, R.style_selected_2)
14211427
else:
14221428
addr_str = ansi(addr_str, R.style_low)
@@ -1470,6 +1476,12 @@ A value of 0 uses the whole height.''',
14701476
'default': True,
14711477
'name': 'show_function',
14721478
'type': bool
1479+
},
1480+
'highlight-line': {
1481+
'doc': 'Decide whether the whole current line should be highlighted.',
1482+
'default': False,
1483+
'name': 'highlight_line',
1484+
'type': bool
14731485
}
14741486
}
14751487

0 commit comments

Comments
 (0)