From b2ae5ade795e4ac5f603f8446c6e9f780225fc2d Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sat, 27 Jan 2024 11:05:43 -0700 Subject: [PATCH] docs: show how to get whole scrollback in get_xxx_as_text Folks often ask how to do this. Pre-empt the question. --- docs/config/lua/pane/get_lines_as_text.md | 5 +++++ docs/config/lua/pane/get_logical_lines_as_text.md | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/docs/config/lua/pane/get_lines_as_text.md b/docs/config/lua/pane/get_lines_as_text.md index 675e62dd9..10b771966 100644 --- a/docs/config/lua/pane/get_lines_as_text.md +++ b/docs/config/lua/pane/get_lines_as_text.md @@ -19,3 +19,8 @@ Trailing blank lines are stripped, which may result in fewer lines being returned than you might expect if the pane only had a couple of lines of output. +To obtain the entire scrollback, you can do something like this: + +```lua +pane:get_lines_as_text(pane:get_dimensions().scrollback_rows) +``` diff --git a/docs/config/lua/pane/get_logical_lines_as_text.md b/docs/config/lua/pane/get_logical_lines_as_text.md index a07375200..6cbdab680 100644 --- a/docs/config/lua/pane/get_logical_lines_as_text.md +++ b/docs/config/lua/pane/get_logical_lines_as_text.md @@ -24,4 +24,8 @@ Trailing blank lines are stripped, which may result in fewer lines being returned than you might expect if the pane only had a couple of lines of output. +To obtain the entire scrollback, you can do something like this: +```lua +pane:get_logical_lines_as_text(pane:get_dimensions().scrollback_rows) +```