Skip to content

Fix: Block Uncomment functionality removes comment tags even with quotes#16467

Open
AbhiSuram wants to merge 1 commit intonotepad-plus-plus:masterfrom
AbhiSuram:patch004242025
Open

Fix: Block Uncomment functionality removes comment tags even with quotes#16467
AbhiSuram wants to merge 1 commit intonotepad-plus-plus:masterfrom
AbhiSuram:patch004242025

Conversation

@AbhiSuram
Copy link

@AbhiSuram AbhiSuram commented Apr 24, 2025

Bug #15914
Fixing block uncomment functionality for HTML tags, adding in a method and some new conditional checks.

}
// Do a search for the pattern
Sci_TextToFind ttf;
ttf.chrg.cpMin = static_cast<Sci_PositionCR>(fromPos);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use Sci_TextToFindFull and SCI_FINDTEXTFULL instead: https://groups.google.com/g/scintilla-interest/c/mPLwYdC0-FE

Although Sci_PositionCR is effectively the same size as Sci_Position (since N++ 8.3), the Scintilla definition should be preferred.


@chcg, next time there's a Scintilla upgrade, maybe the headers can be edited to include the deprecation warnings currently in the plugin template?, e.g.: https://github.com/npp-plugins/plugintemplate/blob/319c80b1161b332a203b7c6df2cadca6d68a9a88/src/Scintilla.h#L1340

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rdipardo I had some branch for it since some time (https://github.com/chcg/notepad-plus-plus/tree/deprecate_32bit_sci_structs_and_defines) , but not pushed it so far.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chcg , is that something that could be pushed? @rdipardo suggested we wait on npp-plugins/plugintemplate#14 until the deprecation is in the N++ repo, since it will start automatically updating the plugin template from the N++ repo... And we don't want the template to lose its existing deprecation change

Copy link
Contributor

@chcg chcg May 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

created PR #16522

donho pushed a commit that referenced this pull request May 7, 2025
- disabled versions with usage of Sci_PositionCR restricted to 2GB files on windows
- didn't adapt ScintillaStructures.h yet to avoid disabling/patching of functions for SCI_GETTEXTRANGE, SCI_FINDTEXT, SCI_GETSTYLEDTEXTFULL and SCI_FORMATRANGE already now

Ref: discussion at #16467

Close #16522
@SuLaus
Copy link
Contributor

SuLaus commented Oct 17, 2025

Apparently, bug #15914 is easier to fix.

Just replace in Notepad_plus.cpp around line 8800 within undoStreamComment()

		flags = SCFIND_WORDSTART;
by
		flags = 0;

and "Block un-comment" will work as expected. Give it a try.

@chcg chcg added the bug label Dec 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants