mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-03 23:11:14 -03:00
Use consistent variable names in decl and def of calc_prompt_layout
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user