Skip to content

bottom_panel_height clamps to [8, 10] but comment states min = 10, max = 25 #157

@ooloth

Description

@ooloth

Current state

lua/config/plugins/specs/nvim-dap-ui.lua lines 44–45 contain a comment stating the panel height should have a minimum of 10 and a maximum of 25. The implementation is:

math.max(8, math.min(10, math.floor(total_ui_height * 0.15)))

This expression clamps the result to [8, 10] — the math.min(10, ...) caps the value at 10, and the math.max(8, ...) sets a floor of 8. The documented range [10, 25] is never achieved. On a large terminal the panel height is always 10 lines, not the up-to-25 the comment implies.

Ideal state

  • bottom_panel_height is computed with math.max(10, math.min(25, math.floor(total_ui_height * 0.15))), matching the comment.
  • On terminals taller than approximately 67 rows the panel height grows proportionally up to 25 lines.
  • The comment and the code agree so a reader can trust either without checking the other.

Out of scope

  • Changing the 0.15 proportional factor.
  • Changing the range values — only aligning the implementation with the existing comment.

Starting points

  • lua/config/plugins/specs/nvim-dap-ui.lua lines 44–45 — the comment and the math.max/math.min expression to correct

QA plan

  1. Open nvim-dap-ui.lua and read lines 44–45 — expect math.max(10, math.min(25, math.floor(total_ui_height * 0.15))) and no comment/code discrepancy.
  2. Open Neovim in a terminal taller than ~70 rows, start a debug session, and observe the bottom panel height — expect it is greater than 10 lines.
  3. Open Neovim in a terminal shorter than ~67 rows, start a debug session, and observe the bottom panel — expect it is clamped at 10 lines.
  4. Run stylua --check . — expect no formatting errors.

Done when

bottom_panel_height uses math.max(10, math.min(25, ...)) and the comment accurately describes the [10, 25] clamp range.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions