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
How to obtain NPP bookmark ID #258
Comments
There isn't, but I think you've just made a feature-request for it. :-) Comment made current to PS releases 2.0 and 3.0.14 |
In the meantime I am using the following workaround: # https://github.com/notepad-plus-plus/notepad-plus-plus/commit/9455684b429449f668c1aedb77ec9dcb1642c244
NPP_MARK_BOOKMARK = 24 if notepad.getVersion() < (8, 4, 6) else 20
NPP_MARK_BOOKMARK_MASK = 1 << NPP_MARK_BOOKMARK |
Mainly as a curiousity, @Ekopalypse provided some code (hope it is OK to share) that will obtain the bookmark id from Notepad++ 8.4.7 and later, before PythonScript supports a first-class "Notepad" object function for it:
|
getBookMarkID is available now, can this be closed? |
What does "now" mean in this context?
with:
|
Ah, ok - so this is only available with a recent PS3 version, I see ... |
I have no explanation why this would be part of PS3 and not PS2, since PS2 is the currently the non-beta version. Features such as this should be present in both versions, IMO. |
... looks like the MS way. Offer a new product with new features to attract users for beta testing :-D |
I don't think our wonderful PS developers are dumb and would use that strategy. :-) |
I created two small utility scripts. One that exports the bookmarked line numbers of an editor view and another that imports (bookmarks) specified lines in an editor view.
For that purpose I hardcoded the following (from the HideLines.py sample):
Which I then use with
editor.markerNext(line, NPP_MARK_BOOKMARK_MASK)
andeditor.markerAdd(line, NPP_MARK_BOOKMARK)
.With the latest Notepad++ the value of MARK_BOOKMARK changed from 24 to 20 with Notepad++ commit 9455684 ("Renumber Notepad++ marks for preparing Scintilla 5.3.0's integration").
In the Notepad++ source I found that there is a NPP message NPPM_GETBOOKMARKID to get the bookmark ID. Is there any function in PythonScript to make use of that, so that I can replace the hardcoded bookmark ID with the one provided by the NPP API?
Thanks and regards,
Jens
The text was updated successfully, but these errors were encountered: