diff options
| author | Maxime Coste <mawww@kakoune.org> | 2019-11-12 21:56:45 +1100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2019-11-12 21:56:45 +1100 |
| commit | e964b68ab818a9c5be1c16f024ba346f3983a3e3 (patch) | |
| tree | 6213845a6368411ec548bdc7806af62889887292 /src/normal.cc | |
| parent | 7a8f57f97bbd057c35e0b47f9a4503856d8bd891 (diff) | |
Add support for selecting and exporting selections in display columns
Fixes #2724
Diffstat (limited to 'src/normal.cc')
| -rw-r--r-- | src/normal.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/normal.cc b/src/normal.cc index 24d30c8b..58dc9698 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -1774,7 +1774,7 @@ SelectionList read_selections_from_register(char reg, Context& context) const size_t timestamp = str_to_int(desc[1]); size_t main = str_to_int(desc[2]); - return selection_list_from_strings(buffer, false, content | skip(1), timestamp, main); + return selection_list_from_strings(buffer, ColumnType::Byte, content | skip(1), timestamp, main); } enum class CombineOp @@ -1889,8 +1889,9 @@ void save_selections(Context& context, NormalParams params) auto save_to_reg = [reg](Context& context, const SelectionList& sels) { auto& buffer = context.buffer(); + auto to_string = [&] (const Selection& sel) { return selection_to_string(ColumnType::Byte, buffer, sel); }; auto descs = concatenated(ConstArrayView<String>{format("{}@{}@{}", buffer.name(), buffer.timestamp(), sels.main_index())}, - sels | transform(selection_to_string)) | gather<Vector<String>>(); + sels | transform(to_string)) | gather<Vector<String>>(); RegisterManager::instance()[reg].set(context, descs); context.print_status({format("{} {} selections to register '{}'", |
