Style fixes

This commit is contained in:
Maxime Coste 2014-06-26 19:01:39 +01:00
parent 047488a8da
commit 63878b03c5
3 changed files with 5 additions and 6 deletions

View File

@ -318,8 +318,8 @@ ByteCoord Buffer::do_erase(ByteCoord begin, ByteCoord end)
{ {
kak_assert(is_valid(begin)); kak_assert(is_valid(begin));
kak_assert(is_valid(end)); kak_assert(is_valid(end));
String prefix = m_lines[begin.line].substr(0, begin.column); StringView prefix = m_lines[begin.line].substr(0, begin.column);
String suffix = m_lines[end.line].substr(end.column); StringView suffix = m_lines[end.line].substr(end.column);
String new_line = prefix + suffix; String new_line = prefix + suffix;
ByteCoord next; ByteCoord next;

View File

@ -260,8 +260,7 @@ TokenList parse(StringView line)
String token = line.substr(token_start, pos - token_start); String token = line.substr(token_start, pos - token_start);
static const Regex regex{R"(\\([ \t;\n]))"}; static const Regex regex{R"(\\([ \t;\n]))"};
result.emplace_back(Token::Type::Raw, token_start, pos, result.emplace_back(Token::Type::Raw, token_start, pos,
boost::regex_replace(token, regex, boost::regex_replace(token, regex, "\\1"));
"\\1"));
} }
} }

View File

@ -115,7 +115,7 @@ InsertCompletion complete_filename(const Buffer& buffer, ByteCoord cursor_pos,
} }
InsertCompletion complete_option(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<StringList>();; const StringList& opt = options[option_name].get<StringList>();;
if (opt.empty()) 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) 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; StringList res;
for (LineCount l = 0_line; l < buffer.line_count(); ++l) for (LineCount l = 0_line; l < buffer.line_count(); ++l)
{ {