Skip to content

Add per-document word wrap settings - #18278

Open
ocp1006 wants to merge 1 commit into
notepad-plus-plus:masterfrom
ocp1006:codex/word-wrap-per-tab-20260808
Open

ocp1006 wants to merge 1 commit into
notepad-plus-plus:masterfrom
ocp1006:codex/word-wrap-per-tab-20260808

Conversation

@ocp1006

@ocp1006 ocp1006 commented Aug 8, 2026 •

Copy link
Copy Markdown

What and why

Word wrap was represented only by the global Scintilla view preference, and the existing command applied that value indiscriminately to both editor views. As a result, switching tabs could not preserve a document-specific choice, and opening a large file could disable wrapping globally for unrelated documents.

This change adds a persistent three-state word-wrap mode to each document buffer:

  • Use Global Setting resolves through the existing global Word Wrap preference.
  • Off keeps wrapping disabled for that document.
  • On keeps wrapping enabled for that document.

The existing View menu and toolbar command remain global. Global changes update only visible documents using the global setting, while their checked state continues to represent the global preference.

User impact

  • Adds a Word Wrap submenu to the default tab context menu with mutually exclusive Use Global Setting, Off, and On choices.
  • Applies the effective document setting before restoring view position when a tab becomes active.
  • Synchronizes cloned documents in both editor views and refreshes Document Map wrapping.
  • Persists the choice as wrapMode="global|off|on" in session files.
  • Initializes large files with an Off override instead of changing the global preference.

Compatibility

Older session files without wrapMode, and session files containing an unrecognized value, default to Use Global Setting. Untranslated languages retain the built-in English labels. No plugin API changes are introduced.

Validation

  • python PowerEditor\Test\xmlValidator\validator_xml.py
  • git diff --check
  • Visual Studio 2022 C++ build: Win32 Debug
  • Visual Studio 2022 C++ build: x64 Release
  • Isolated runtime smoke checks: independent tabs, all three modes, global isolation, cloned views, session persistence, missing/invalid session fallback, large-file isolation, wrap-disable scroll stability, and Document Map synchronization

Fixes #5232

@ocp1006
ocp1006 force-pushed the codex/word-wrap-per-tab-20260808 branch 4 times, most recently from bcaf407 to 35d0245 Compare August 8, 2026 21:39
@ocp1006
ocp1006 force-pushed the codex/word-wrap-per-tab-20260808 branch from 35d0245 to 1a0635a Compare August 8, 2026 21:49
@pryrt

pryrt commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

This is intentionally a draft because issue #5232 does not currently have the contributor guide's Accepted label.

That's not quite how most people read that instruction. Specifically, it says:

For Pull Requests regarding enhancements and questions, the issue must first be approved by one of project's administrators before being merged into the project. An approved issue will have the label Accepted. For issues that have not been accepted, you may request to be assigned to that issue.

That means that before a PR is merged, the underlying issue must be accepted by an administrator: they can do that explicitly, either before or after a PR is submitted, or implicitly, by the primary developer choosing to merge the PR. Since the primary developer reviews all PRs, and decides whether or not to merge them, his review and merging is tacit "approval", even if he doesn't bother changing the label on the Issue.

As far as I've seen, he doesn't generally review a PR that is marked as draft (I don't even know if he reads draft PR; he's very busy), and isn't likely to mark the original issue as Approved just because you made a draft PR against it.

As such: once you believe your PR is ready, mark it "ready for review". Then, as the developer has time, he will review it, and decide whether or not to merge it.

@ocp1006
ocp1006 marked this pull request as ready for review September 26, 2026 07:04
@ocp1006

ocp1006 commented Sep 26, 2026

Copy link
Copy Markdown
Author

Thank you, @pryrt, for clarifying how the Accepted-label requirement is applied and for pointing out that draft PRs may not be reviewed. I've marked the PR ready for review.

pryrt added a commit to pryrt/notepad-plus-plus that referenced this pull request Oct 8, 2026
Comments like the following show that there is some confusion as to the requirements for Pull Requests:
- notepad-plus-plus#18278 (comment)
- notepad-plus-plus#17565 (comment)

In general:
- People have historically thought they needed to wait for the Issue to be `Accepted` before submitting a PR
- People get confused as to whether or not they need an Issue to attach their PR to
- People have historically asked to be assigned to open Issues, and never get assigned, so they never put in a PR (I know I have seen that in some of Issues I've read, but cannot immediately find an example)

I have tried to reword things so that those are all more clear, and match the current practices (don't need to wait for `Accepted`; almost always need to attach to Issue or comment; don't need to ask to be assigned to Issue)
@pryrt pryrt mentioned this pull request Oct 8, 2026
1 task done
donho pushed a commit that referenced this pull request Oct 8, 2026
Comments like the following show that there is some confusion as to the requirements for Pull Requests:
- #18278 (comment)
- #17565 (comment)

In general:
- People have historically thought they needed to wait for the Issue to be `Accepted` before submitting a PR
- People get confused as to whether or not they need an Issue to attach their PR to
- People have historically asked to be assigned to open Issues, and never get assigned, so they never put in a PR (I know I have seen that in some of Issues I've read, but cannot immediately find an example)

I have tried to reword things so that those are all more clear, and match the current practices (don't need to wait for `Accepted`; almost always need to attach to Issue or comment; don't need to ask to be assigned to Issue)

Close #18469
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.

Feature Request - word wrap per tab

2 participants