Use consistent variable names in decl and def of calc_prompt_layout

This commit is contained in:
ridiculousfish
2020-06-07 12:56:14 -07:00
parent 9636d9f5d3
commit 064324984b
2 changed files with 5 additions and 5 deletions

View File

@@ -351,7 +351,7 @@ static void truncate_run(wcstring *run, size_t desired_width, size_t *width,
prompt_layout_t layout_cache_t::calc_prompt_layout(const wcstring &prompt_str,
wcstring *out_trunc_prompt,
size_t max_line_width) {
// FIXME: we could avoid allocating trunc_prompt if max_line_width is max.
// FIXME: we could avoid allocating trunc_prompt if max_line_width is SIZE_T_MAX.
if (const auto *entry = this->find_prompt_layout(prompt_str, max_line_width)) {
if (out_trunc_prompt) out_trunc_prompt->assign(entry->trunc_text);
return entry->layout;

View File

@@ -270,11 +270,11 @@ class layout_cache_t {
return 0;
}
/// Computes a prompt layout for \p prompt_str, perhaps truncating it to \p desired_line_width.
/// Computes a prompt layout for \p prompt_str, perhaps truncating it to \p max_line_width.
/// \return the layout, and optionally the truncated prompt itself, by reference.
prompt_layout_t calc_prompt_layout(
const wcstring &prompt_str, wcstring *out_trunc_prompt = nullptr,
size_t desired_line_width = std::numeric_limits<size_t>::max());
prompt_layout_t calc_prompt_layout(const wcstring &prompt_str,
wcstring *out_trunc_prompt = nullptr,
size_t max_line_width = std::numeric_limits<size_t>::max());
void clear() {
esc_cache_.clear();