Skip to content

Commit 08c78cc

Browse files
committed
[headless] always go to the top of the view
Related to #1592
1 parent e060452 commit 08c78cc

File tree

5 files changed

+12
-13
lines changed

5 files changed

+12
-13
lines changed

src/lnav.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4181,7 +4181,7 @@ SELECT tbl_name FROM sqlite_master WHERE sql LIKE 'CREATE VIRTUAL TABLE%'
41814181
std::pair<Result<std::string, lnav::console::user_message>,
41824182
std::string>>
41834183
cmd_results;
4184-
textview_curses *log_tc, *text_tc, *tc;
4184+
textview_curses *tc;
41854185
bool output_view = true;
41864186
auto msg_cb_guard = lnav_data.ld_exec_context.add_msg_callback(
41874187
[](const auto& um) {
@@ -4224,7 +4224,7 @@ SELECT tbl_name FROM sqlite_master WHERE sql LIKE 'CREATE VIRTUAL TABLE%'
42244224
lnav_data.ld_exec_context.set_output("stdout", stdout, nullptr);
42254225
alerter::singleton().enabled(false);
42264226

4227-
log_tc = &lnav_data.ld_views[LNV_LOG];
4227+
auto* log_tc = &lnav_data.ld_views[LNV_LOG];
42284228
log_tc->set_height(24_vl);
42294229
lnav_data.ld_view_stack.push_back(log_tc);
42304230
// Read all of stdin
@@ -4233,7 +4233,7 @@ SELECT tbl_name FROM sqlite_master WHERE sql LIKE 'CREATE VIRTUAL TABLE%'
42334233
wait_for_children();
42344234

42354235
log_tc->set_top(0_vl);
4236-
text_tc = &lnav_data.ld_views[LNV_TEXT];
4236+
auto* text_tc = &lnav_data.ld_views[LNV_TEXT];
42374237
if (text_tc->get_inner_height() > 0_vl
42384238
&& (!text_tc->get_selection().has_value()
42394239
|| lnav_data.ld_text_source.current_file()
@@ -4255,7 +4255,6 @@ SELECT tbl_name FROM sqlite_master WHERE sql LIKE 'CREATE VIRTUAL TABLE%'
42554255
tview.set_selection(0_vl);
42564256
}
42574257
}
4258-
lnav_data.ld_text_source.tss_apply_default_init_location = true;
42594258

42604259
log_info("Executing initial commands");
42614260
execute_init_commands(lnav_data.ld_exec_context, cmd_results);

test/expected/Makefile.am

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ dist_noinst_DATA = \
1616
test_cli.sh_17a68b798354f9a6cdfab372006caeb74038d15c.out \
1717
test_cli.sh_1ec76eb2416d2c09c13eba62ff8bcf920a888b9c.err \
1818
test_cli.sh_1ec76eb2416d2c09c13eba62ff8bcf920a888b9c.out \
19-
test_cli.sh_3114508cf42fb2608ef77f4bc294a84885c97a79.err \
20-
test_cli.sh_3114508cf42fb2608ef77f4bc294a84885c97a79.out \
21-
test_cli.sh_4761827b538a623c60d2e7d243bae9b653bb1975.err \
22-
test_cli.sh_4761827b538a623c60d2e7d243bae9b653bb1975.out \
2319
test_cli.sh_4a90f3241f857801474a1ae522c6c6a452e33e5a.err \
2420
test_cli.sh_4a90f3241f857801474a1ae522c6c6a452e33e5a.out \
2521
test_cli.sh_4b7e1d207a7094b0d13152cb469848bd0fae08f3.err \
2622
test_cli.sh_4b7e1d207a7094b0d13152cb469848bd0fae08f3.out \
23+
test_cli.sh_51f5fc7865022bbd9c0d40355fbbc908e9377f44.err \
24+
test_cli.sh_51f5fc7865022bbd9c0d40355fbbc908e9377f44.out \
2725
test_cli.sh_5381ebb34f10dc3dc26a6f92aff199c16c3b8a5b.err \
2826
test_cli.sh_5381ebb34f10dc3dc26a6f92aff199c16c3b8a5b.out \
27+
test_cli.sh_54633172fadd70061373be5dcb340f24bf5507d5.err \
28+
test_cli.sh_54633172fadd70061373be5dcb340f24bf5507d5.out \
2929
test_cli.sh_5524542b1a6954ff9741155101497270a2f0c557.err \
3030
test_cli.sh_5524542b1a6954ff9741155101497270a2f0c557.out \
3131
test_cli.sh_5a08fb5360e41bc1a880c04112af35604d3eaea0.err \
@@ -36,10 +36,10 @@ dist_noinst_DATA = \
3636
test_cli.sh_6d8527ea7806e393f848e29abed8c45acc7be2d2.out \
3737
test_cli.sh_712cb8b623e9230d97008a8b7d06df1ea76c37af.err \
3838
test_cli.sh_712cb8b623e9230d97008a8b7d06df1ea76c37af.out \
39+
test_cli.sh_791b5cc9d5d1c5179ebaff0fcecbc49d055159c4.err \
40+
test_cli.sh_791b5cc9d5d1c5179ebaff0fcecbc49d055159c4.out \
3941
test_cli.sh_97e19b9ff3775d84074455a2e8993a0611b1c269.err \
4042
test_cli.sh_97e19b9ff3775d84074455a2e8993a0611b1c269.out \
41-
test_cli.sh_a2f9a3e798e5f4f09c92eaa25ae236a2fb09dbd9.err \
42-
test_cli.sh_a2f9a3e798e5f4f09c92eaa25ae236a2fb09dbd9.out \
4343
test_cli.sh_c69c835a3c43210225cf62564b3e9584c899af20.err \
4444
test_cli.sh_c69c835a3c43210225cf62564b3e9584c899af20.out \
4545
test_cli.sh_cc06341dd560f927512e92c7c0985ed8b25827ae.err \
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
ⓘ info: the following piper captures were found in:
22
{TMPDIR}/lnav-user-{uid}-work/piper
3-
 = note: The captures currently consume 33B of disk space. File sizes include associated metadata.
3+
 = note: The captures currently consume 653B of disk space. File sizes include associated metadata.
44
 = help: You can reopen a capture by passing the piper URL to lnav
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
 just now piper://p-c2c985d5a09bfe95a9997cc8952c5269-000  33.0 B “sh-0 echo hi”
1+
 just now piper://p-f6141301471fe64e5841ce5b3f216834-000  653.0 B “sh-0 cat {test_dir}/textfile_plain.0”

test/test_cli.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ run_cap_test ${lnav_test} -m -I ${test_dir} config blame
5353
export TMPDIR="piper-tmp"
5454
rm -rf ./piper-tmp
5555
mkdir piper-tmp
56-
run_cap_test ${lnav_test} -n -e 'echo hi'
56+
run_cap_test ${lnav_test} -n -e "cat ${test_dir}/textfile_plain.0"
5757

5858
run_cap_test ${lnav_test} -m piper list
5959

0 commit comments

Comments
 (0)