summaryrefslogtreecommitdiffstats
path: root/src/scripts/lnav-pop-view.lnav
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 17:44:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 17:44:55 +0000
commit5068d34c08f951a7ea6257d305a1627b09a95817 (patch)
tree08213e2be853396a3b07ce15dbe222644dcd9a89 /src/scripts/lnav-pop-view.lnav
parentInitial commit. (diff)
downloadlnav-upstream.tar.xz
lnav-upstream.zip
Adding upstream version 0.11.1.upstream/0.11.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/scripts/lnav-pop-view.lnav')
-rw-r--r--src/scripts/lnav-pop-view.lnav21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/scripts/lnav-pop-view.lnav b/src/scripts/lnav-pop-view.lnav
new file mode 100644
index 0000000..89037e1
--- /dev/null
+++ b/src/scripts/lnav-pop-view.lnav
@@ -0,0 +1,21 @@
+#
+# @synopsis: lnav-pop-view
+# @description: Pop the top view on the view stack
+#
+
+;SELECT rowid as row_to_delete, name as last_view_name, CASE name
+ WHEN 'db' THEN $keymap_def_db_view
+ WHEN 'histogram' THEN $keymap_def_hist_view
+ WHEN 'text' THEN $keymap_def_text_view
+ ELSE ''
+ END as view_alt_msg FROM lnav_view_stack ORDER BY rowid DESC LIMIT 1;
+;SELECT top_time as last_top_time FROM lnav_views WHERE name = $last_view_name;
+;DELETE FROM lnav_view_stack WHERE rowid = $row_to_delete;
+;SELECT name AS new_top_view_name FROM lnav_view_stack ORDER BY rowid DESC LIMIT 1;
+;SELECT top_time AS old_top_time FROM lnav_views WHERE name = $new_top_view_name;
+;UPDATE lnav_views SET top_time = $last_top_time WHERE
+ $1 = 'x51' AND
+ name = $new_top_view_name AND
+ $last_top_time IS NOT NULL;
+:eval :alt-msg ${view_alt_msg}
+:echo