diff options
Diffstat (limited to 'gdb/tui/tui-winsource.c')
-rw-r--r-- | gdb/tui/tui-winsource.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c index 3ca723c..81937c1 100644 --- a/gdb/tui/tui-winsource.c +++ b/gdb/tui/tui-winsource.c @@ -69,7 +69,7 @@ tui_display_main () std::string tui_copy_source_line (const char **ptr, int line_no, int first_col, - int line_width) + int line_width, int ndigits) { const char *lineptr = *ptr; @@ -78,10 +78,15 @@ tui_copy_source_line (const char **ptr, int line_no, int first_col, if (line_no > 0) { - result = string_printf ("%-6d", line_no); - int len = result.size (); - len = len - ((len / tui_tab_width) * tui_tab_width); - result.append (len, ' '); + if (ndigits > 0) + result = string_printf ("%*d ", ndigits, line_no); + else + { + result = string_printf ("%-6d", line_no); + int len = result.size (); + len = len - ((len / tui_tab_width) * tui_tab_width); + result.append (len, ' '); + } } int column = 0; |