You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.
I tried using the SCN_AUTOCSELECTION notification to insert something else than what was selected in the autocomplete menu.
The pointer to the text of the selected option should be in notification.TextPointer. But when run in 64bit, it points to nothing, and notification.Length contains some large negative number.
The problem seems to be that the type of position that appears ahead of TextPointer in the ScNotification struct is of the wrong type.
In the plugin template it's an int, while in the sourcecode of scintilla it's defined as a Sci_Position which is a ptrdiff_t.
So I think that needs to change from int to IntPtr (and if I try and test that, it does seem to work for both 32 and 64 bit).
Here is a small project to demonstrate the issue (run it, use the Plugins > MyNppPluginAutoC > MyMenuCommand, an autocomplete menu should appear, select something, and a messagebox should show what was selected, then try again in 64bit): MyNppPluginAutoC.zip
The text was updated successfully, but these errors were encountered:
I tried using the SCN_AUTOCSELECTION notification to insert something else than what was selected in the autocomplete menu.
The pointer to the text of the selected option should be in notification.TextPointer. But when run in 64bit, it points to nothing, and notification.Length contains some large negative number.
The problem seems to be that the type of position that appears ahead of TextPointer in the ScNotification struct is of the wrong type.
In the plugin template it's an int, while in the sourcecode of scintilla it's defined as a Sci_Position which is a ptrdiff_t.

So I think that needs to change from int to IntPtr (and if I try and test that, it does seem to work for both 32 and 64 bit).
There seems to be a few more fields (mentioned by dinkumoil in the topic linked below) that have changed from int to ptrdiff_t, so you'll probably need to change more than just position:
https://community.notepad-plus-plus.org/topic/17755/notepad-7-7-breaking-change-of-scnotification-definition-in-x64-build
Here is a small project to demonstrate the issue (run it, use the Plugins > MyNppPluginAutoC > MyMenuCommand, an autocomplete menu should appear, select something, and a messagebox should show what was selected, then try again in 64bit):
MyNppPluginAutoC.zip
The text was updated successfully, but these errors were encountered: