Skip to content

Fix/20478 increase max line length - #20639

Draft
Rasaec5 wants to merge 8 commits into
nvaccess:masterfrom
Rasaec5:fix/20478-increase-max-line-length
Draft

Fix/20478 increase max line length#20639
Rasaec5 wants to merge 8 commits into
nvaccess:masterfrom
Rasaec5:fix/20478-increase-max-line-length

Conversation

@Rasaec5

@Rasaec5 Rasaec5 commented Aug 10, 2026

Copy link
Copy Markdown

Link to issue number:

Closes #20478

Summary of the issue:

When browse mode uses screen layout navigation, ordinary paragraphs frequently exceed 250 characters. The "Maximum number of characters on one line" setting (virtualBuffers.maxLineLength) is meant to control this, but the spin control in the Browse Mode settings panel capped user input at 250, so users couldn't raise the limit high enough to stop mid-paragraph line splitting.

Description of user facing changes:

The "Maximum number of characters on one line" spin control in NVDA Settings → Browse Mode now accepts values up to 4000 (previously capped at 250). The minimum (10) is unchanged. This allows users with screen layout enabled to set a limit that better matches the length of paragraphs they encounter, reducing how often lines are split mid-paragraph.

Description of developer facing changes:

None. No public API, config schema, or module signatures changed.

Description of development approach:

virtualBuffers.maxLineLength in source/config/configSpec.py already has no enforced min/max (integer(default=100)); the only ceiling was the SelectOnFocusSpinCtrl in BrowseModePanel.makeSettings() (source/gui/settingsDialogs.py), hardcoded to min=10, max=250. This PR raises max to 4000 and adds a comment explaining why.

Before making the change, I traced how the value is consumed: source/virtualBuffers/__init__.py passes it to NVDAHelper.localLib.VBuf_getLineOffsets, where it's declared as a plain c_int32 in source/NVDAHelper/localLib.py — not tied to any fixed-size native buffer. So raising the ceiling introduces no structural risk on the native side.

Scope is intentionally narrow: this only lifts the ceiling. It does not address the mid-phrase line-splitting behavior raised in the related issue #11717.

Testing strategy:

  • python3 -m py_compile on the modified file to confirm no syntax errors.
  • Searched tests/unit/ for existing coverage of BrowseModePanel or maxLineLength — none found, so there's no existing automated test to update.
  • Traced the data flow from config → GUI control → VBuf_getLineOffsets to confirm no native fixed-size buffer is tied to the old 250 cap (see development approach above).
  • Built and ran NVDA from source (scons source, runnvda.bat) and manually verified in the Browse Mode settings panel: the spin control accepts up to 4000, rejects/clamps values above 4000, the floor of 10 is unchanged, and the value persists across a restart.
  • Manually confirmed the functional fix: with maxLineLength raised and screen layout enabled, browse mode no longer splits long paragraphs at the old 250-character boundary; reducing it back to the default (100) restores the original splitting behavior, confirming the setting still controls line length correctly.
  • Ran the full local automated suite — rununittests.bat, runlint.bat, runcheckpot.bat, and runlicensecheck.bat — all passed cleanly with no failures.

Known issues with pull request:

None outstanding.

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

Rasaec5 added 3 commits July 27, 2026 00:59
…access#20478)

virtualBuffers.maxLineLength has no enforced min/max in the config spec, but the SpinCtrl in the Browse Mode settings panel capped user input at 250. With screen layout navigation enabled, ordinary paragraphs regularly exceed 250 characters, causing browse mode to split lines more often than needed.

Raised the SpinCtrl max from 250 to 4000. The value is only used as an int32 argument to VBuf_getLineOffsets, so there is no native buffer-size constraint this change would violate.

Related: nvaccess#11717 (line-splitting can break controls mid-phrase; not addressed by this change, which only lifts the ceiling).
Increased maximum character limit for Browse Mode setting to reduce paragraph splitting.
@Rasaec5
Rasaec5 marked this pull request as ready for review August 10, 2026 07:41
@Rasaec5
Rasaec5 requested a review from a team as a code owner August 10, 2026 07:41
@Rasaec5
Rasaec5 requested a review from seanbudd August 10, 2026 07:41
@seanbudd

Copy link
Copy Markdown
Member

Hi @Rasaec5 - did you read my comment here: #20478 (comment)

@seanbudd
seanbudd marked this pull request as draft August 10, 2026 23:11
@Rasaec5

Rasaec5 commented Aug 10, 2026

Copy link
Copy Markdown
Author

Hi @Rasaec5 - did you read my comment here: #20478 (comment)

Oh I am so sorry, I forgot as I was working late on this last night. I can get that changed and make a new pull request tonight or tomorrow.

@seanbudd

Copy link
Copy Markdown
Member

no need to open a new pull request. just push further commits to this one and mark it as ready for review

per seanbudd changed 4000 to 1000
Updated the maximum character limit for the 'Maximum number of characters on one line' setting in Browse Mode from 250 to 1000 to reduce paragraph splits.
@Rasaec5
Rasaec5 marked this pull request as ready for review August 11, 2026 03:36
@Rasaec5

Rasaec5 commented Aug 11, 2026

Copy link
Copy Markdown
Author

@seanbudd Sorry again for forgetting that, it is ready for review again

@seanbudd

Copy link
Copy Markdown
Member

In #20478 (comment) we suggested changing the min to 0, which sets a behaviour of no length capping (e.g. infinite). Can you please also document these changes in the user guide as requested.

@seanbudd
seanbudd marked this pull request as draft August 11, 2026 04:17
Updated the maximum and minimum values for the 'Maximum number of characters on one line' setting in Browse Mode settings.
Fixed the minimum value from 10->0 and updated the change log
@Rasaec5
Rasaec5 marked this pull request as ready for review August 11, 2026 23:00
@Rasaec5

Rasaec5 commented Aug 11, 2026

Copy link
Copy Markdown
Author

I re-read all of the comments, and I went back through the contribution guide. Hopefully I didn't miss anything this time. Thank you for your time.

@seanbudd

Copy link
Copy Markdown
Member

Hi - we still need to update the user guide section for the setting

@seanbudd
seanbudd marked this pull request as draft August 13, 2026 00:25
@Rasaec5

Rasaec5 commented Aug 17, 2026

Copy link
Copy Markdown
Author

@seanbudd Sorry, I was out of town for the weekend. I followed the Contribution Guide, but missed that the User guide needs to change. I will look at that tomorrow, and make sure that I set the user guide correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Increase the maximum value limit for the "Maximum number of characters on one line" setting control.

2 participants