From 0fbddb0df1495e1cb275fa5ab15ba7f0ab3cc9fa Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Fri, 24 Jan 2014 17:51:28 -0800 Subject: Add fish_new_pager variable to enable new pager on request, disabled by default. --- parser.cpp | 13 +++++++++++++ parser.h | 1 + reader.cpp | 5 +++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/parser.cpp b/parser.cpp index 9bb1e649..4badfff8 100644 --- a/parser.cpp +++ b/parser.cpp @@ -3122,3 +3122,16 @@ bool parser_use_ast(void) return from_string(var); } } + +bool pager_use_inline(void) +{ + env_var_t var = env_get_string(L"fish_new_pager"); + if (var.missing_or_empty()) + { + return 0; + } + else + { + return from_string(var); + } +} diff --git a/parser.h b/parser.h index 32add3fb..6e43c8da 100644 --- a/parser.h +++ b/parser.h @@ -547,6 +547,7 @@ public: /* Temporary */ bool parser_use_ast(void); +bool pager_use_inline(void); #endif diff --git a/reader.cpp b/reader.cpp index 1c313a63..2bba5f97 100644 --- a/reader.cpp +++ b/reader.cpp @@ -1876,8 +1876,9 @@ static bool handle_completions(const std::vector &comp) parse_util_get_parameter_info(data->command_line, data->buff_pos, "e, NULL, NULL); bool is_quoted = (quote != L'\0'); - if (1) + if (pager_use_inline()) { + /* Inline pager */ data->pager.set_prefix(prefix); data->pager.set_completions(surviving_completions); @@ -1886,7 +1887,7 @@ static bool handle_completions(const std::vector &comp) } else { - /* Clear the autosuggestion from the old commandline before abandoning it (see #561) */ + /* Classic pager. Clear the autosuggestion from the old commandline before abandoning it (see #561) */ if (! data->autosuggestion.empty()) reader_repaint_without_autosuggestion(); -- cgit v1.2.3