Conversation
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.
Motivation
convertallcaused by invalid per-line block selection positions returned from Scintilla.trimtrailingspaceso trailing whitespace is fully trimmed.Description
SCI_GETLINESELSTARTPOSITION/SCI_GETLINESELENDPOSITIONintoSci_Position(ls/le) and validate againstINVALID_POSITIONandle < ls, neutralizing invalid lines withlps[ln]=lpe[ln]=0so they are skipped during replacements.memspnin the per-line replacement loop and ensure we never pass invalid offsets toSCI_SETTARGETSTART/END/SCI_REPLACETARGET.trimtrailingspaceto treat\tas whitespace (so both spaces and tabs are removed at line ends) and simplify the trimming logic accordingly.adjustprplistto avoid unsigned underflow by checking lengths before adding or subtracting and clamping indexes when necessary.Testing
nl -ba SRC/NPPTextFX.cpp | sed -n '3674,3680p;4825,4838p;4954,4961p'which showed the intended changes and succeeded.git diff --stat -- SRC/NPPTextFX.cppand created a commit withgit commit -m, both operations succeeded.mcp__make_pr__make_prhelper which produced the PR title/body; no Notepad++/Scintilla runtime tests were available in this environment.Codex Task