misc cleanups
This commit is contained in:
parent
346108ec62
commit
260b30e6d9
|
@ -98,7 +98,8 @@ BufferIterator Buffer::iterator_at_line_begin(const BufferIterator& iterator) co
|
|||
BufferIterator Buffer::iterator_at_line_end(const BufferIterator& iterator) const
|
||||
{
|
||||
BufferPos line = iterator.line();
|
||||
return ++BufferIterator(*this, { line, std::max(line_length(line) - 1, 0) });
|
||||
assert(line_length(line) > 0);
|
||||
return ++BufferIterator(*this, { line, line_length(line) - 1 });
|
||||
}
|
||||
|
||||
BufferIterator Buffer::begin() const
|
||||
|
|
|
@ -43,8 +43,7 @@ void expand_tabulations(Buffer& buffer, BufferIterator& position, String& conten
|
|||
if (content == "\t")
|
||||
{
|
||||
int column = 0;
|
||||
BufferCoord pos = buffer.line_and_column_at(position);
|
||||
for (auto line_it = buffer.iterator_at({pos.line, 0});
|
||||
for (auto line_it = buffer.iterator_at_line_begin(position);
|
||||
line_it != position; ++line_it)
|
||||
{
|
||||
assert(*line_it != '\n');
|
||||
|
|
|
@ -188,10 +188,8 @@ void expand_tabulations(Window& window, DisplayBuffer& display_buffer)
|
|||
if (it+1 != end)
|
||||
atom_it = line.split(atom_it, it+1);
|
||||
|
||||
BufferCoord pos = it.buffer().line_and_column_at(it);
|
||||
|
||||
int column = 0;
|
||||
for (auto line_it = it.buffer().iterator_at({pos.line, 0});
|
||||
for (auto line_it = it.buffer().iterator_at_line_begin(it);
|
||||
line_it != it; ++line_it)
|
||||
{
|
||||
assert(*line_it != '\n');
|
||||
|
|
Loading…
Reference in New Issue
Block a user