diff options
| author | Maxime Coste <mawww@kakoune.org> | 2018-03-13 14:00:57 +1100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2018-03-13 14:00:57 +1100 |
| commit | bfaf52f8c0ff6ab5e25944484be8014e855dd410 (patch) | |
| tree | cc17ddad0961def8d8c86c188371a269566edd76 /src/normal.cc | |
| parent | 1f4ad0f25e82023c5982dbbcb5a1a5aa835e1014 (diff) | |
Do not jump to buffer start on `g.` with no previous modifications
Diffstat (limited to 'src/normal.cc')
| -rw-r--r-- | src/normal.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/normal.cc b/src/normal.cc index 21609090..aef3f79a 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -306,9 +306,11 @@ void goto_commands(Context& context, NormalParams params) { context.push_jump(); auto pos = buffer.last_modification_coord(); - if (pos >= buffer.back_coord()) + if (not pos) + throw runtime_error("no last modification position"); + if (*pos >= buffer.back_coord()) pos = buffer.back_coord(); - select_coord<mode>(buffer, pos, context.selections()); + select_coord<mode>(buffer, *pos, context.selections()); break; } } |
