• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tstack / lnav / 18602397746-2581

17 Oct 2025 07:07PM UTC coverage: 69.26% (-0.6%) from 69.886%
18602397746-2581

push

github

tstack
[log-view] if the top message is not fully in view, display the first line

82 of 105 new or added lines in 5 files covered. (78.1%)

481 existing lines in 35 files now uncovered.

50183 of 72456 relevant lines covered (69.26%)

415322.24 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

77.27
/src/log_gutter_source.hh
1
/**
2
 * Copyright (c) 2018, Timothy Stack
3
 *
4
 * All rights reserved.
5
 *
6
 * Redistribution and use in source and binary forms, with or without
7
 * modification, are permitted provided that the following conditions are met:
8
 *
9
 * * Redistributions of source code must retain the above copyright notice, this
10
 * list of conditions and the following disclaimer.
11
 * * Redistributions in binary form must reproduce the above copyright notice,
12
 * this list of conditions and the following disclaimer in the documentation
13
 * and/or other materials provided with the distribution.
14
 * * Neither the name of Timothy Stack nor the names of its contributors
15
 * may be used to endorse or promote products derived from this software
16
 * without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ''AS IS'' AND ANY
19
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
 * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
22
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
 */
29

30
#ifndef lnav_log_gutter_source_hh
31
#define lnav_log_gutter_source_hh
32

33
#include "logfile_sub_source.hh"
34

35
class log_gutter_source : public list_gutter_source {
36
public:
37
    void listview_gutter_value_for_range(const listview_curses& lv,
659✔
38
                                         int start,
39
                                         int end,
40
                                         const char*& ch,
41
                                         role_t& role_out,
42
                                         role_t& bar_role_out) override
43
    {
44
        auto tc = (textview_curses*) &lv;
659✔
45
        vis_bookmarks& bm = tc->get_bookmarks();
659✔
46
        bool search_hit = false;
659✔
47

48
        start -= 1;
659✔
49

50
        auto next = bm[&textview_curses::BM_SEARCH].next(vis_line_t(start));
659✔
51
        search_hit = (next && next.value() <= end);
659✔
52

53
        next = bm[&textview_curses::BM_USER].next(vis_line_t(start));
659✔
54
        if (!next) {
659✔
55
            next = bm[&textview_curses::BM_META].next(vis_line_t(start));
659✔
56
        }
57
        if (next && next.value() <= end) {
659✔
UNCOV
58
             ch = search_hit ? NCACS_PLUS : NCACS_LTEE;
×
59
        } else {
60
             ch = search_hit ? NCACS_RTEE : NCACS_VLINE;
659✔
61
        }
62
        next = bm[&textview_curses::BM_ERRORS].next(vis_line_t(start));
659✔
63
        if (next && next.value() <= end) {
659✔
64
            role_out = role_t::VCR_ERROR;
×
65
            bar_role_out = role_t::VCR_SCROLLBAR_ERROR;
×
66
        } else {
67
            next = bm[&textview_curses::BM_WARNINGS].next(vis_line_t(start));
659✔
68
            if (next && next.value() <= end) {
659✔
69
                role_out = role_t::VCR_WARNING;
×
70
                bar_role_out = role_t::VCR_SCROLLBAR_WARNING;
×
71
            }
72
        }
73
    }
659✔
74
};
75

76
#endif
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc