Remove support for invoking old pager

This commit is contained in:
ridiculousfish 2014-03-15 13:46:15 -07:00
parent 20f9dd9a6b
commit 6c096191ba
3 changed files with 9 additions and 39 deletions

View File

@ -3152,16 +3152,3 @@ bool parser_use_ast(void)
return from_string<bool>(var);
}
}
bool pager_use_inline(void)
{
env_var_t var = env_get_string(L"fish_new_pager");
if (var.missing_or_empty())
{
return 1;
}
else
{
return from_string<bool>(var);
}
}

View File

@ -550,7 +550,6 @@ public:
/* Temporary */
bool parser_use_ast(void);
bool pager_use_inline(void);
#endif

View File

@ -1988,32 +1988,16 @@ static bool handle_completions(const std::vector<completion_t> &comp, bool conti
wchar_t quote;
parse_util_get_parameter_info(el->text, el->position, &quote, NULL, NULL);
bool is_quoted = (quote != L'\0');
if (pager_use_inline())
{
/* Inline pager */
data->pager.set_prefix(prefix);
data->pager.set_completions(surviving_completions);
/* Invalidate our rendering */
data->current_page_rendering = page_rendering_t();
/* Modify the command line to reflect the new pager */
data->pager_selection_changed();
}
else
{
/* Classic pager. Clear the autosuggestion from the old commandline before abandoning it (see #561) */
if (! data->autosuggestion.empty())
reader_repaint_without_autosuggestion();
write_loop(1, "\n", 1);
run_pager(prefix, is_quoted, surviving_completions);
s_reset(&data->screen, screen_reset_abandon_line);
}
/* Update the pager data */
data->pager.set_prefix(prefix);
data->pager.set_completions(surviving_completions);
/* Invalidate our rendering */
data->current_page_rendering = page_rendering_t();
/* Modify the command line to reflect the new pager */
data->pager_selection_changed();
reader_repaint_needed();