Repository navigation
Add option to apply word wrap per document - #18488
Open
LucaSorvillo wants to merge 2 commits into
Open
LucaSorvillo wants to merge 2 commits into
LucaSorvillo wants to merge 2 commits into
Conversation
1 task done
Contributor
|
There's already #18278 submitted weeks ago to do the same thing. What is better about your AI's solution than the solution already proposed? Or did you have no clue it already existed, and your AI just doesn't bother looking to see if there's already a PR for a given issue. |
Contributor
Author
|
You're right, sorry: I looked at #5232 but missed #18278 in its timeline. My mistake, not a choice. I have now checked the other PRs I opened today: none of them duplicates an open PR. The two PRs fix #5232 with a different UI:
So it is not a better solution, just another way to reach the same thing: #18278 is more flexible (three states), this one keeps the usual command. #18278 came first: if the maintainers prefer it, I'll close this one. |
1 task done
New option in Preferences > Editing 1: "Word wrap applies to the current document only". When checked, View > Word wrap (and its toolbar button) wraps or unwraps the current document only. Each document keeps its own word wrap, also in the session (session.xml "wordWrap" attribute), and a document without its own setting follows the global word wrap. The option is off by default. Fix notepad-plus-plus#5232 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pass the current value as the default of getBoolAttribute when reading wordWrapPerDocument, as requested in the review of notepad-plus-plus#18485. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LucaSorvillo
force-pushed
the
wordWrap_perDocument_20261015
branch
from
October 19, 2026 15:02
86c2aab to
caed990
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the option "Word wrap applies to the current document only" to Preferences > Editing 1 (unchecked by default). When it is checked:
Buffer, saved in session.xml likeRTL(<File ... wordWrap="yes|no">). Documents without their own setting follow the global word wrap (Wrapin config.xml), which the command does not change while the option is on;ScintillaEditView::activateBuffer()before the position of the document is restored, so the first visible line is kept;NPPM_INTERNAL_WORDWRAPPERDOCUMENT).About performance (mentioned in the issue): the word wrap of a document is set right after
SCI_SETDOCPOINTER, andEditor::SetDocPointer()already callsNeedWrapping()for the new document.SCI_SETWRAPMODEdoes nothing when the mode does not change; when it changes, it marks the document for re-wrapping (already needed at that point) and refreshes the view style, which does not depend on the document size. So switching tabs costs about the same as with the global word wrap on, and less for the documents that are not wrapped.Tested on Windows 11 with a Release x64 build of this branch (0 warnings), with an automated GUI test (Win32 messages, separate settings folder):
The issue also suggests an entry in the tab context menu: it could be added on top of this, if wanted.
AI disclosure: the code and this description were written with Claude Code (Claude Opus 5.5); the build and the tests above were run on a real Windows 11 machine.
fix #5232
🤖 Generated with Claude Code