From ee22596d610d0cb22cb2b9e53be9241c227aa4f8 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 4 Jun 2013 14:11:55 +0200 Subject: [PATCH] tweak Buffer::{,char_}prev --- src/buffer.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/buffer.cc b/src/buffer.cc index 8e63350b9..31784e609 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -651,10 +651,7 @@ BufferCoord Buffer::prev(BufferCoord coord) const if (coord.column == 0) { if (coord.line > 0) - { - --coord.line; - coord.column = m_lines[coord.line].length() - 1; - } + coord.column = m_lines[--coord.line].length() - 1; } else --coord.column; @@ -669,7 +666,7 @@ BufferCoord Buffer::char_prev(BufferCoord coord) const else if (coord.column == 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 {