From 0e18db5a88e955e060aaeacea143b77759e9463f Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 27 Oct 2011 14:27:39 +0000 Subject: [PATCH] lines and columns used for user interaction are 1-indexed --- src/filters.cc | 2 +- src/main.cc | 2 +- src/window.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/filters.cc b/src/filters.cc index 0422b979..6eca43c4 100644 --- a/src/filters.cc +++ b/src/filters.cc @@ -123,7 +123,7 @@ void show_line_numbers(DisplayBuffer& display_buffer) Color::Black, Color::White)); char buffer[6]; - snprintf(buffer, 6, "%3d ", coord.line); + snprintf(buffer, 6, "%3d ", coord.line + 1); display_buffer.replace_atom_content(atom_it, buffer); } } diff --git a/src/main.cc b/src/main.cc index 8f2dd8d7..89f81a58 100644 --- a/src/main.cc +++ b/src/main.cc @@ -321,7 +321,7 @@ void do_go(Window& window, int count) if (count != 0) { BufferIterator target = - window.buffer().iterator_at(BufferCoord(count, 0)); + window.buffer().iterator_at(BufferCoord(count-1, 0)); window.move_cursor_to(target); } diff --git a/src/window.cc b/src/window.cc index 83762587..942be83a 100644 --- a/src/window.cc +++ b/src/window.cc @@ -370,7 +370,7 @@ std::string Window::status_line() const oss << m_buffer.name(); if (m_buffer.is_modified()) oss << " [+]"; - oss << " -- " << cursor.line << "," << cursor.column + oss << " -- " << cursor.line+1 << "," << cursor.column+1 << " -- " << m_selections.size() << " sel -- "; if (m_current_inserter) oss << "[Insert]";