sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit dc62829249629046dee28d2df521894346be1130
parent 4dc5f0c1fa330375b2287c1d64667a539f27b625
Author: Dan Callaghan <djc@djc.id.au>
Date:   Sun,  5 Apr 2026 12:49:53 +1000

load more threads when jumping to the end

Diffstat:
M lib/sup/modes/line_cursor_mode.rb | 1 +
M test/unit/test_line_cursor_mode.rb | 11 +++++++++++
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/lib/sup/modes/line_cursor_mode.rb b/lib/sup/modes/line_cursor_mode.rb
@@ -177,6 +177,7 @@ protected
   def jump_to_end
     super if topline < (lines - buffer.content_height)
     set_cursor_pos(lines - 1)
+    call_load_more_callbacks buffer.content_height
   end
 
 private
diff --git a/test/unit/test_line_cursor_mode.rb b/test/unit/test_line_cursor_mode.rb
@@ -139,4 +139,15 @@ class TestLineCursorMode < Minitest::Test
     assert_equal 83, mode.curpos
     assert_equal 80, mode.topline
   end
+
+  def test_jump_to_end
+    mode = make_mode
+    expect_load_more 41
+
+    mode.handle_input Ncurses::CharCode.keycode(Ncurses::KEY_END)
+    assert_equal 40, mode.curpos
+    assert_equal 1, mode.topline
+    assert_equal 41, mode.botline
+    expect_load_more 40
+  end
 end