Fix vertical scrolling of TUI source window
authorEli Zaretskii <eliz@gnu.org>
Sat, 16 Mar 2019 17:53:46 +0000 (19:53 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sat, 16 Mar 2019 17:53:46 +0000 (19:53 +0200)
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.

gdb/ChangeLog
gdb/source-cache.c

index 13024ce6df9bceb1b596d7ea6f1b6ed0fc9a45b2..bf0031230c9e1a97f71d800b5e48503f4e25bbfa 100644 (file)
@@ -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'.
index 1ed2601c61459a96e1500abf4302bb07437e49a0..9211f098eb700c238d8815d6814132a643bf5183 100644 (file)
@@ -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");
 
This page took 0.040062 seconds and 4 git commands to generate.