tweak Buffer::{,char_}prev

This commit is contained in:
Maxime Coste 2013-06-04 14:11:55 +02:00
parent cf1f26ac91
commit ee22596d61

View File

@ -651,10 +651,7 @@ BufferCoord Buffer::prev(BufferCoord coord) const
if (coord.column == 0) if (coord.column == 0)
{ {
if (coord.line > 0) if (coord.line > 0)
{ coord.column = m_lines[--coord.line].length() - 1;
--coord.line;
coord.column = m_lines[coord.line].length() - 1;
}
} }
else else
--coord.column; --coord.column;
@ -669,7 +666,7 @@ BufferCoord Buffer::char_prev(BufferCoord coord) const
else if (coord.column == 0) else if (coord.column == 0)
{ {
if (coord.line > 0) if (coord.line > 0)
coord = { coord.line-1, m_lines[coord.line-1].length() - 1 }; coord.column = m_lines[--coord.line].length() - 1;
} }
else else
{ {