From 92b2ece950fd09044c49a828994566b35fa7303b Mon Sep 17 00:00:00 2001 From: Alexander Garustovich Date: Wed, 11 Feb 2026 16:53:25 +0300 Subject: [PATCH] [view] reset horizontal offset when enabling word-wrap --- src/views_vtab.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/views_vtab.cc b/src/views_vtab.cc index 41d46d9d5a..000295a74f 100644 --- a/src/views_vtab.cc +++ b/src/views_vtab.cc @@ -741,7 +741,11 @@ CREATE TABLE lnav_db.lnav_views ( tc.set_overlay_selection(vis_line_t(vo.vo_overlay_focus.value())); } if (vo.vo_word_wrap) { - tc.set_word_wrap(vo.vo_word_wrap.value() == word_wrap_t::normal); + auto wrap_words = vo.vo_word_wrap.value() == word_wrap_t::normal; + tc.set_word_wrap(wrap_words); + if (wrap_words) { + left = 0; // reset horizontal scroll position + } } if (vo.vo_hidden_fields) { tc.set_hide_fields(vo.vo_hidden_fields.value()