From 6cb8d69d29c77c01d92f8adb63e574f7f8d512a4 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 27 May 2013 19:23:59 +0200 Subject: [PATCH] Context: return DynamicSelectionLists in jump_{forward,backward} --- src/context.cc | 4 ++-- src/context.hh | 4 ++-- src/normal.cc | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/context.cc b/src/context.cc index 30c56e202..ed01e1c6f 100644 --- a/src/context.cc +++ b/src/context.cc @@ -98,7 +98,7 @@ void Context::push_jump() m_current_jump = m_jump_list.end(); } -const SelectionList& Context::jump_forward() +const DynamicSelectionList& Context::jump_forward() { if (m_current_jump != m_jump_list.end() and m_current_jump + 1 != m_jump_list.end()) @@ -106,7 +106,7 @@ const SelectionList& Context::jump_forward() throw runtime_error("no next jump"); } -const SelectionList& Context::jump_backward() +const DynamicSelectionList& Context::jump_backward() { if (m_current_jump != m_jump_list.begin()) { diff --git a/src/context.hh b/src/context.hh index 1217df3ac..3332392ed 100644 --- a/src/context.hh +++ b/src/context.hh @@ -52,8 +52,8 @@ struct Context void print_status(const DisplayLine& status) const; void push_jump(); - const SelectionList& jump_forward(); - const SelectionList& jump_backward(); + const DynamicSelectionList& jump_forward(); + const DynamicSelectionList& jump_backward(); void forget_jumps_to_buffer(Buffer& buffer); int& numeric_param() { return m_numeric_param; } diff --git a/src/normal.cc b/src/normal.cc index cb6b3b143..a3e24f501 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -691,7 +691,7 @@ void jump(Context& context) auto jump = (direction == JumpDirection::Forward) ? context.jump_forward() : context.jump_backward(); - Buffer& buffer = const_cast(jump.front().buffer()); + Buffer& buffer = const_cast(jump.buffer()); BufferManager::instance().set_last_used_buffer(buffer); if (&buffer != &context.buffer()) {