From 064e965500048ecddaf0025f815bb1151464d772 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 11 Apr 2016 13:54:47 +0100 Subject: [PATCH] Remove padding control options from ncurses ui --- src/ncurses_ui.cc | 22 +--------------------- src/ncurses_ui.hh | 5 ----- 2 files changed, 1 insertion(+), 26 deletions(-) diff --git a/src/ncurses_ui.cc b/src/ncurses_ui.cc index 05ba0106..52b29b0d 100644 --- a/src/ncurses_ui.cc +++ b/src/ncurses_ui.cc @@ -363,17 +363,11 @@ void NCursesUI::draw(const DisplayBuffer& display_buffer, } set_face(m_window, padding_face, default_face); - - const DisplayLine padding_line = m_buffer_padding_str; - const DisplayLine* padding_line_ptr = m_buffer_padding_type != BufferPaddingType::None ? - &padding_line : &empty_line; while (line_index < m_dimensions.line + (m_status_on_top ? 1 : 0)) { wmove(m_window, (int)line_index++, 0); wclrtoeol(m_window); - draw_line(m_window, *padding_line_ptr, 0, m_dimensions.column, padding_face); - if (m_buffer_padding_type == BufferPaddingType::Single) - padding_line_ptr = &empty_line; + waddch(m_window, '~'); } m_dirty = true; @@ -991,20 +985,6 @@ void NCursesUI::set_ui_options(const Options& options) m_wheel_down_button = wheel_down_it != options.end() ? str_to_int_ifp(wheel_down_it->value).value_or(5) : 5; } - - { - auto padding_str_it = options.find("ncurses_buffer_padding_str"); - m_buffer_padding_str = padding_str_it == options.end() or !padding_str_it->value.length() ? - "~" : padding_str_it->value; - - auto padding_type_it = options.find("ncurses_buffer_padding_type"); - if (padding_type_it == options.end() or padding_type_it->value == "fill") - m_buffer_padding_type = BufferPaddingType::Fill; - else if (padding_type_it->value == "single") - m_buffer_padding_type = BufferPaddingType::Single; - else - m_buffer_padding_type = BufferPaddingType::None; - } } } diff --git a/src/ncurses_ui.hh b/src/ncurses_ui.hh index 6f8d9fd9..0b0cf08b 100644 --- a/src/ncurses_ui.hh +++ b/src/ncurses_ui.hh @@ -13,8 +13,6 @@ namespace Kakoune struct NCursesWin; -enum BufferPaddingType { None, Single, Fill }; - class NCursesUI : public UserInterface { public: @@ -129,9 +127,6 @@ private: int m_wheel_up_button = 4; int m_wheel_down_button = 5; - String m_buffer_padding_str = "~"; - BufferPaddingType m_buffer_padding_type = BufferPaddingType::None; - bool m_set_title = true; bool m_dirty = false;