From 0dec1e3a91ffeaa82989c452089488c4e53130ef Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 9 Jun 2017 15:30:13 +0100 Subject: [PATCH] Remove unused only_buffer mode for DisplayLine::trim --- src/display_buffer.cc | 8 +------- src/display_buffer.hh | 2 +- src/ncurses_ui.cc | 4 ++-- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/display_buffer.cc b/src/display_buffer.cc index c4e2d366..4b025fc9 100644 --- a/src/display_buffer.cc +++ b/src/display_buffer.cc @@ -168,16 +168,10 @@ ColumnCount DisplayLine::length() const return len; } -void DisplayLine::trim(ColumnCount first_col, ColumnCount col_count, bool only_buffer) +void DisplayLine::trim(ColumnCount first_col, ColumnCount col_count) { for (auto it = begin(); first_col > 0 and it != end(); ) { - if (only_buffer and not it->has_buffer_range()) - { - ++it; - continue; - } - auto len = it->length(); if (len <= first_col) { diff --git a/src/display_buffer.hh b/src/display_buffer.hh index ac6d4e82..e3c58516 100644 --- a/src/display_buffer.hh +++ b/src/display_buffer.hh @@ -128,7 +128,7 @@ public: // remove first_col from the begining of the line, and make sure // the line is less that col_count character - void trim(ColumnCount first_col, ColumnCount col_count, bool only_buffer); + void trim(ColumnCount first_col, ColumnCount col_count); // Merge together consecutive atoms sharing the same display attributes void optimize(); diff --git a/src/ncurses_ui.cc b/src/ncurses_ui.cc index 0c41b9d3..b9e80e52 100644 --- a/src/ncurses_ui.cc +++ b/src/ncurses_ui.cc @@ -430,7 +430,7 @@ void NCursesUI::draw_status(const DisplayLine& status_line, else if (remaining > 2) { DisplayLine trimmed_mode_line = mode_line; - trimmed_mode_line.trim(mode_len + 2 - remaining, remaining - 2, false); + trimmed_mode_line.trim(mode_len + 2 - remaining, remaining - 2); trimmed_mode_line.insert(trimmed_mode_line.begin(), { "…" }); kak_assert(trimmed_mode_line.length() == remaining - 1); @@ -733,7 +733,7 @@ void NCursesUI::menu_show(ConstArrayView items, for (auto& item : items) { m_menu.items.push_back(item); - m_menu.items.back().trim(0, maxlen, false); + m_menu.items.back().trim(0, maxlen); kak_assert(m_menu.items.back().length() <= maxlen); }