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

Removed deprecated SCI_GETSTYLEBITS call for Notepad++ 7.7 update. #8

Merged
merged 1 commit into from
Jun 20, 2019
Merged

Removed deprecated SCI_GETSTYLEBITS call for Notepad++ 7.7 update. #8

merged 1 commit into from
Jun 20, 2019

Conversation

vinsworldcom
Copy link
Contributor

Possible fix for #7

Original code:
int bits = (int)SendMessage(hScintilla, SCI_GETSTYLEBITS, 0, 0); unsigned char mask = 0xFF >> (8-bits);

SCI_GETSTYLEBITS deprecated
It always returned 8, so we use bits=8 and then a shift of 8-8=0 does nothing

This should fix for Notepad++ 7.7 above (new Scintilla), as well as stay backward compatible with older Notepad++ < 7.7.

Further discussion

@chcg
Copy link
Owner

chcg commented Jun 20, 2019

Seems also the masking could be removed completely as

csd->dataBuffer[i*2+1] &= 0xFF;

will not change data anyhow.

Issue is probably due to changed define INCLUDE_DEPRECATED_FEATURES, so

https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/scintilla/src/Editor.cxx#L7071-L7078

is not compiled anymore and the return value is no longer 8.

@chcg chcg merged commit 8e51c06 into chcg:master Jun 20, 2019
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.

2 participants