What makes a custom lexer appear as item in the Prefrences > Indentation list?
-
I’ve created the CSV Lint plug-in and someone posted an issue about not being able to save the Indentation.
I didn’t know about this feature, but the “CSV Lint” is somehow in this list. I want to remove it from this dialog, but I don’t know what makes a custom lexer appear as item in the Prefrences > Indentation list? Why is the CSV Lint plugin in this list?
In the lexer class, I’ve tried removing the
public IDocumentGetLineIndentation GetLineIndentation;
from thepublic struct IDocumentVtable
but it still appears. -
I had never thought of that as a consequence, but the app just looks at the full list of lexers – and it apparently treats the built-in lexers and the lexer-plugins as equivalent from that respect.
I doubt there is currently a mechanism to have your lexer-plugin not be listed in that list. If no one else knows of a way to opt out, you might have to put in a feature request to provide such a mechanism to lexer plugins. (Since the app cannot see into your code, and thus wouldn’t know whether you have a the
GetLineIndentation
element or not, I don’t think that would be a way to implement your request. Maybe a messageNPPM_LEXERPLUGIN_INDENT_OPTOUT
or some such. If making such a request, check to see if there are other language lists that you want to be able to opt out of.)I have a feeling that if lexer plugins weren’t in that list, their authors would be asking that the ability to be in that list be added into Notepad++. It thus surprises me (1) that it already put lexer plugins in that list, and (2) that you don’t want to be in that list. Why not add the feature to CSV Lint to be able to use that
GetLineIndentation
, if at all possible? If CSV Lint were mine, I would at least try to make that work, before asking Don to let you opt out of the list; if you couldn’t make that work, I could understand asking for the feature, but if you can, then it’s a win-win. :-) -
As @PeterJones already said, there is currently no way to escape this listing. To make this persistent for your user, one can currently use a workaround and simply make the changes in the CSVLint.xml.
E.g.
<Language name="VLang" ext="v" commentLine="//" commentStart="/*" commentEnd="*/" tabSettings="4" backspaceUnindent="no">
You can find more information about here.
Of course it would be nicer if this could also be done via the dialog, which in my opinion would also make the most sense if Npp did this itself. It already knows that this lexer exists and already has the code to do this for the built-in lexers.
-
Official issue opened: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/16460
-