From 064324984ba2e101c3b61bbb156f6569961a969d Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sun, 7 Jun 2020 12:56:14 -0700 Subject: [PATCH] Use consistent variable names in decl and def of calc_prompt_layout --- src/screen.cpp | 2 +- src/screen.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/screen.cpp b/src/screen.cpp index e930bbdb4..57be553e2 100644 --- a/src/screen.cpp +++ b/src/screen.cpp @@ -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; diff --git a/src/screen.h b/src/screen.h index a212c557f..6a33ecfb2 100644 --- a/src/screen.h +++ b/src/screen.h @@ -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::max()); + prompt_layout_t calc_prompt_layout(const wcstring &prompt_str, + wcstring *out_trunc_prompt = nullptr, + size_t max_line_width = std::numeric_limits::max()); void clear() { esc_cache_.clear();