Add String Range::content() const
This commit is contained in:
parent
9230667c11
commit
2f410f62e4
|
@ -119,7 +119,7 @@ std::vector<String> Editor::selections_content() const
|
||||||
{
|
{
|
||||||
std::vector<String> contents;
|
std::vector<String> contents;
|
||||||
for (auto& sel : m_selections)
|
for (auto& sel : m_selections)
|
||||||
contents.push_back(m_buffer->string(sel.begin(), sel.end()));
|
contents.push_back(sel.content());
|
||||||
return contents;
|
return contents;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,11 @@ BufferIterator Range::end() const
|
||||||
return utf8::next(std::max(m_first, m_last));
|
return utf8::next(std::max(m_first, m_last));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String Range::content() const
|
||||||
|
{
|
||||||
|
return m_first.buffer().string(begin(), end());
|
||||||
|
}
|
||||||
|
|
||||||
void Range::check_invariant() const
|
void Range::check_invariant() const
|
||||||
{
|
{
|
||||||
#ifdef KAK_DEBUG
|
#ifdef KAK_DEBUG
|
||||||
|
|
|
@ -31,6 +31,8 @@ public:
|
||||||
// returns max(first, last) + 1
|
// returns max(first, last) + 1
|
||||||
BufferIterator end() const;
|
BufferIterator end() const;
|
||||||
|
|
||||||
|
String content() const;
|
||||||
|
|
||||||
void check_invariant() const;
|
void check_invariant() const;
|
||||||
private:
|
private:
|
||||||
BufferIterator m_first;
|
BufferIterator m_first;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user