Skip to content

Commit

Permalink
Fix vertical scrolling of TUI source window
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Eli-Zaretskii committed Mar 16, 2019
1 parent 8d8c087 commit ab42892
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gdb/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
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.

2019-03-16 Philippe Waroquiers <philippe.waroquiers@skynet.be>

* auto-load.c (_initialize_auto_load): Fix 'This options has'.
Expand Down
7 changes: 7 additions & 0 deletions gdb/source-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down

0 comments on commit ab42892

Please sign in to comment.