summaryrefslogtreecommitdiff
path: root/src/context.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2013-12-15 20:37:07 +0000
committerMaxime Coste <frrrwww@gmail.com>2013-12-15 20:37:07 +0000
commitea95632709a6ae3df76772e83e1497a9fcfee52d (patch)
treeaa258ec83e7ec6f765c9c055d5faf1748dbde91b /src/context.cc
parentad0682ec75d072c648f044580d817bef4098abc0 (diff)
Move Editor::selections_content to Context
Diffstat (limited to 'src/context.cc')
-rw-r--r--src/context.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/context.cc b/src/context.cc
index 6e94b174..163beb16 100644
--- a/src/context.cc
+++ b/src/context.cc
@@ -187,6 +187,14 @@ const SelectionList& Context::selections() const
return editor().selections();
}
+std::vector<String> Context::selections_content() const
+{
+ std::vector<String> contents;
+ for (auto& sel : selections())
+ contents.push_back(buffer().string(sel.min(), buffer().char_next(sel.max())));
+ return contents;
+}
+
void Context::begin_edition()
{
++m_edition_level;