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

Extra highlights not included in Copy or Export #15

Open
pryrt opened this issue May 22, 2020 · 4 comments
Open

Extra highlights not included in Copy or Export #15

pryrt opened this issue May 22, 2020 · 4 comments

Comments

@pryrt
Copy link

pryrt commented May 22, 2020

As discussed in https://community.notepad-plus-plus.org/topic/19448/copying-highlighted-text-lines-from-1-notepad-file-to-another/:

if I have additional styling (such as Mark Using 3rd Style), that extra styling isn't included in the Copy HTML or RTF to clipboard.

Not mentioned in that thread: the same is true for Export to HTML or RTF.

I'm not sure whether it's a bug report or a feature request, but either way, the reasonable expectation is that all highlighting -- whether from active lexer/syntax highlighter or from user-applied Styles, Marks, etc -- would be included in the Export/Copy-to HTML/RTF.

I tried with both v0.2.9.21 that came bundled with Notepad 7.8.6, and the newer v0.3.0 which isn't in nppPluginList yet.

@pryrt
Copy link
Author

pryrt commented May 22, 2020

As clarified in the forum thread, the original poster's need was to copy highlights from one file in NPP to another. Since the NppExport plugin uses the Windows clipboard formats, and NPP itself will only paste from the plaintext entry in the clipboard, NppExport won't help the OP.

However, after my experiments, I would still expect the copy-to-HTML and export-to-HTML to include "extra" stylings, such as the Mark... > Using 3rd Style. However, I don't frequently use this feature, so it's not an urgent request. But it would be nice, eventually, to include the"extra" highlights in the export/copy using this plugin.

@chcg
Copy link
Owner

chcg commented Dec 7, 2020

Though maybe that is handled by SCI_STYLEGETHOTSPOT(https://www.scintilla.org/ScintillaDoc.html#SCI_STYLEGETHOTSPOT), but that is something different and not relevant here.

The relevant part seems to be:

#define SCE_UNIVERSAL_FOUND_STYLE_EXT1 25
#define SCE_UNIVERSAL_FOUND_STYLE_EXT2 24
#define SCE_UNIVERSAL_FOUND_STYLE_EXT3 23
#define SCE_UNIVERSAL_FOUND_STYLE_EXT4 22
#define SCE_UNIVERSAL_FOUND_STYLE_EXT5 21

with e.g.

execute(SCI_INDICSETSTYLE, SCE_UNIVERSAL_FOUND_STYLE_EXT1, INDIC_ROUNDBOX);

and further calls with:

SCI_INDICATOR...

see e.g. https://www.scintilla.org/ScintillaDoc.html#SCI_INDICATORVALUEAT

@pryrt
Copy link
Author

pryrt commented May 23, 2022

@chcg,

This recent Community Forum discussion shows that there are still users out there who want my original interpretation -- that is, that the user-applied additional styling (such as Mark Using Nth Style) get put in the exported RTF or HTML, not just the lexer styling.

@chcg
Copy link
Owner

chcg commented Oct 24, 2022

User applied 1th-5th style is handled additionally to the styling which is currently retrieved in code via SCI_GETSTYLEDTEXT. So current response from SCI_GETSTYLEDTEXT in dataBuffer seems to be not easily usable. Additionally multiple indicators could be set for the same text part.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants