From b81c6b5840346d6c67c0652bd8c9e89fc2df907d Mon Sep 17 00:00:00 2001 From: Delapouite Date: Sun, 17 Dec 2017 14:42:09 +0100 Subject: [PATCH] Use existing window reference in view mode --- src/normal.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/normal.cc b/src/normal.cc index 0b3d8645..b3d947c6 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -331,29 +331,29 @@ void view_commands(Context& context, NormalParams params) { case 'v': case 'c': - context.window().center_line(cursor.line); + window.center_line(cursor.line); break; case 'm': - context.window().center_column( + window.center_column( context.buffer()[cursor.line].column_count_to(cursor.column)); break; case 't': - context.window().display_line_at(cursor.line, 0); + window.display_line_at(cursor.line, 0); break; case 'b': - context.window().display_line_at(cursor.line, window.dimensions().line-1); + window.display_line_at(cursor.line, window.dimensions().line-1); break; case 'h': - context.window().scroll(-std::max(1, count)); + window.scroll(-std::max(1, count)); break; case 'j': - context.window().scroll( std::max(1, count)); + window.scroll( std::max(1, count)); break; case 'k': - context.window().scroll(-std::max(1, count)); + window.scroll(-std::max(1, count)); break; case 'l': - context.window().scroll( std::max(1, count)); + window.scroll( std::max(1, count)); break; } }, lock ? "view (lock)" : "view",