summaryrefslogtreecommitdiff
path: root/src/normal.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2014-12-28 11:16:51 +0000
committerMaxime Coste <frrrwww@gmail.com>2014-12-28 11:16:51 +0000
commit8cc96ec36bb6ac189fac339150185a30482c8556 (patch)
treebab9766f44e16262e7478519672a75e162855798 /src/normal.cc
parent71bfe5498d40ff5bf7b512b3ab9e43ead8a3ce51 (diff)
Add a join function for joining strings using a specific char
Diffstat (limited to 'src/normal.cc')
-rw-r--r--src/normal.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/normal.cc b/src/normal.cc
index 13f1fb7c..35eb4db3 100644
--- a/src/normal.cc
+++ b/src/normal.cc
@@ -721,7 +721,7 @@ void split_lines(Context& context, NormalParams)
selections = std::move(res);
}
-void join_select_spaces(Context& context, NormalParams)
+void join_lines_select_spaces(Context& context, NormalParams)
{
auto& buffer = context.buffer();
std::vector<Selection> selections;
@@ -746,7 +746,7 @@ void join_select_spaces(Context& context, NormalParams)
context.selections().insert(" "_str, InsertMode::Replace);
}
-void join(Context& context, NormalParams params)
+void join_lines(Context& context, NormalParams params)
{
SelectionList sels{context.selections()};
auto restore_sels = on_scope_end([&]{
@@ -754,7 +754,7 @@ void join(Context& context, NormalParams params)
context.selections() = std::move(sels);
});
- join_select_spaces(context, params);
+ join_lines_select_spaces(context, params);
}
template<bool matching>
@@ -1430,8 +1430,8 @@ KeyMap keymap =
{ alt('{'), { "extend to inner object start", select_object<ObjectFlags::ToBegin | ObjectFlags::Inner, SelectMode::Extend> } },
{ alt('}'), { "extend to inner object end", select_object<ObjectFlags::ToEnd | ObjectFlags::Inner, SelectMode::Extend> } },
- { alt('j'), { "join lines", join } },
- { alt('J'), { "join lines and select spaces", join_select_spaces } },
+ { alt('j'), { "join lines", join_lines } },
+ { alt('J'), { "join lines and select spaces", join_lines_select_spaces } },
{ alt('k'), { "keep selections matching given regex", keep<true> } },
{ alt('K'), { "keep selections not matching given regex", keep<false> } },