diff options
author | Eli Zaretskii <eliz@gnu.org> | 2019-03-16 19:53:46 +0200 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2019-03-16 19:53:46 +0200 |
commit | ab42892fb7d265e72a85e918d4f5c6dfeee3fcd8 (patch) | |
tree | 120fabb930e1b2c3212a6a87d994c70150dfd0b3 /gdb/source-cache.c | |
parent | 8d8c087f34beaa271c3f8d5597d92bce4e9c7f4a (diff) | |
download | gdb-ab42892fb7d265e72a85e918d4f5c6dfeee3fcd8.zip gdb-ab42892fb7d265e72a85e918d4f5c6dfeee3fcd8.tar.gz gdb-ab42892fb7d265e72a85e918d4f5c6dfeee3fcd8.tar.bz2 |
Fix vertical scrolling of TUI source window
gdb/ChangeLog:
2019-03-16 Eli Zaretskii <eliz@gnu.org>
* source-cache.c (source_cache::get_source_lines): Call
find_source_lines to initialize s->nlines. This fixes vertical
scrolling of TUI source window when the DOWN arrow is pressed.
Diffstat (limited to 'gdb/source-cache.c')
-rw-r--r-- | gdb/source-cache.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gdb/source-cache.c b/gdb/source-cache.c index 1ed2601..9211f09 100644 --- a/gdb/source-cache.c +++ b/gdb/source-cache.c @@ -200,6 +200,13 @@ source_cache::get_source_lines (struct symtab *s, int first_line, std::ifstream input (fullname); if (input.is_open ()) { + if (s->line_charpos == 0) + { + scoped_fd desc = open_source_file (s); + if (desc.get () < 0) + return false; + find_source_lines (s, desc.get ()); + } srchilite::SourceHighlight highlighter ("esc.outlang"); highlighter.setStyleFile("esc.style"); |