From a0de41d165c5e71f7672e44f4f6d2d09aae9d173 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sat, 24 Feb 2018 21:09:09 +1100 Subject: [PATCH] goto last change: do not try to avoid end of lines Avoiding end of line is a behaviour we avoid (pun intended) more and more in Kakoune source code, now that end of lines are regularly selected, it makes no sense to just to next line when last modification lies on an EOL (and it probably did not make much sense back when that code was written). --- src/normal.cc | 2 -- test/normal/goto-extending/last-change/selections | 2 +- test/normal/goto/last-change/selections | 3 ++- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/normal.cc b/src/normal.cc index 5a631e76..85597432 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -280,8 +280,6 @@ void goto_commands(Context& context, NormalParams params) auto pos = buffer.last_modification_coord(); if (pos >= buffer.back_coord()) pos = buffer.back_coord(); - else if (buffer[pos.line].length() == pos.column + 1) - pos = BufferCoord{ pos.line+1, 0 }; select_coord(buffer, pos, context.selections()); break; } diff --git a/test/normal/goto-extending/last-change/selections b/test/normal/goto-extending/last-change/selections index c4ff167b..333dc6b4 100644 --- a/test/normal/goto-extending/last-change/selections +++ b/test/normal/goto-extending/last-change/selections @@ -1,3 +1,3 @@ foo -b + diff --git a/test/normal/goto/last-change/selections b/test/normal/goto/last-change/selections index 61780798..139597f9 100644 --- a/test/normal/goto/last-change/selections +++ b/test/normal/goto/last-change/selections @@ -1 +1,2 @@ -b + +