diff --git a/src/buffer.cc b/src/buffer.cc index 884ae270..c9293a98 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -318,8 +318,8 @@ ByteCoord Buffer::do_erase(ByteCoord begin, ByteCoord end) { kak_assert(is_valid(begin)); kak_assert(is_valid(end)); - String prefix = m_lines[begin.line].substr(0, begin.column); - String suffix = m_lines[end.line].substr(end.column); + StringView prefix = m_lines[begin.line].substr(0, begin.column); + StringView suffix = m_lines[end.line].substr(end.column); String new_line = prefix + suffix; ByteCoord next; diff --git a/src/command_manager.cc b/src/command_manager.cc index 682f7ed9..b01dea2b 100644 --- a/src/command_manager.cc +++ b/src/command_manager.cc @@ -260,8 +260,7 @@ TokenList parse(StringView line) String token = line.substr(token_start, pos - token_start); static const Regex regex{R"(\\([ \t;\n]))"}; result.emplace_back(Token::Type::Raw, token_start, pos, - boost::regex_replace(token, regex, - "\\1")); + boost::regex_replace(token, regex, "\\1")); } } diff --git a/src/insert_completer.cc b/src/insert_completer.cc index 27342245..aab807f1 100644 --- a/src/insert_completer.cc +++ b/src/insert_completer.cc @@ -115,7 +115,7 @@ InsertCompletion complete_filename(const Buffer& buffer, ByteCoord cursor_pos, } InsertCompletion complete_option(const Buffer& buffer, ByteCoord cursor_pos, - OptionManager& options, const String& option_name) + OptionManager& options, StringView option_name) { const StringList& opt = options[option_name].get();; if (opt.empty()) @@ -151,7 +151,7 @@ InsertCompletion complete_option(const Buffer& buffer, ByteCoord cursor_pos, InsertCompletion complete_line(const Buffer& buffer, ByteCoord cursor_pos) { - String prefix = buffer[cursor_pos.line].substr(0_byte, cursor_pos.column); + StringView prefix = buffer[cursor_pos.line].substr(0_byte, cursor_pos.column); StringList res; for (LineCount l = 0_line; l < buffer.line_count(); ++l) {