File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change 3232--- @param win ? integer Window ID , defaults to state.windows.output_win
3333--- @return boolean true if at bottom , false otherwise
3434function M .is_at_bottom (win )
35- -- If always_scroll_to_bottom is enabled, always return true
3635 if config .ui .output .always_scroll_to_bottom then
3736 return true
3837 end
3938
4039 win = win or (state .windows and state .windows .output_win )
4140
4241 if not win or not vim .api .nvim_win_is_valid (win ) then
43- return true -- Assume at bottom if window invalid
42+ return true
4443 end
4544
4645 if not state .windows or not state .windows .output_buf then
@@ -49,7 +48,7 @@ function M.is_at_bottom(win)
4948
5049 local ok , line_count = pcall (vim .api .nvim_buf_line_count , state .windows .output_buf )
5150 if not ok or not line_count or line_count == 0 then
52- return true -- Empty buffer, consider at bottom
51+ return true
5352 end
5453
5554 local botline = vim .fn .line (' w$' , win )
@@ -215,7 +214,6 @@ function M.setup_autocmds(windows, group)
215214 group = group ,
216215 buffer = windows .output_buf ,
217216 callback = function ()
218- -- Update state to track if user is at bottom
219217 M .viewport_at_bottom = M .is_at_bottom (windows .output_win )
220218 end ,
221219 })
You can’t perform that action at this time.
0 commit comments