Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible SCI_DESCRIBEKEYWORDSETS issue #175

Closed
dail8859 opened this issue Jun 9, 2023 · 1 comment
Closed

Possible SCI_DESCRIBEKEYWORDSETS issue #175

dail8859 opened this issue Jun 9, 2023 · 1 comment
Labels
bug Something isn't working committed Issue fixed in repository but not in release php Caused by the hypertext lexer for PHP

Comments

@dail8859
Copy link
Contributor

dail8859 commented Jun 9, 2023

Scintilla 5.3.5
Lexilla 5.2.5
Windows 11
Qt 6.5.1


I'm setting the Scintilla editor's lexer to "phpscript" and getting it to style the document correctly.

However when I call editor->describeKeyWordSets() it is not returning the result I'd expect.

Lexer "phpscript" uses one keyword list (index 4):

lexilla/lexers/LexHTML.cxx

Lines 722 to 730 in a6b8fca

const char * const phpscriptWordListDesc[] = {
"", //Unused
"", //Unused
"", //Unused
"", //Unused
"PHP keywords",
"", //Unused
0,
};

So I had expected editor->describeKeyWordSets() to return the string "\n\n\n\nPHP keywords\n". Since index 4 is the only valid keyword set that PHP uses.

However editor->describeKeyWordSets() is returning "PHP keywords\n" which would seem to incorrectly indicate that the lexer supports two lists, index 0 being "PHP keywords" and index 1 being ""

Thoughts?

@nyamatongwe nyamatongwe added bug Something isn't working php Caused by the hypertext lexer for PHP labels Jun 9, 2023
@nyamatongwe
Copy link
Member

DefineWordListSets isn't expecting empty entries:

	void DefineWordListSets(const char * const wordListDescriptions[]) {
		if (wordListDescriptions) {
			for (size_t wl = 0; wordListDescriptions[wl]; wl++) {
				if (!wordLists.empty())
					wordLists += "\n";
				wordLists += wordListDescriptions[wl];

I expect the !wordLists.empty() conddition should be replaced with wl > 0.

dail8859 added a commit to dail8859/lexilla that referenced this issue Jun 10, 2023
@nyamatongwe nyamatongwe added the committed Issue fixed in repository but not in release label Jun 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working committed Issue fixed in repository but not in release php Caused by the hypertext lexer for PHP
Projects
None yet
2 participants