Developer Needed...



  • the way npp displays folds is annoying. from the visible fold line, to not being able to easily delete the fold etc…

    I have no experience in plugins/etc, but I know what I want npp to do. I would like the folds to resemble this:

    +function(){…}
    +function(){…}

    as opposed to:

    +function(){
    |----------------------------------------
    +function(){
    |----------------------------------------

    How would I go about achieving this, or better yet, which one of you will do it for me so as to learn from example?!..



  • @Chris-Mckevitt

    the problems are

    a) it is handled by scintilla
    and
    b) I assume a couple of lexer do it differently.

    So I guess there isn’t a quick solution for you. Sorry.

    Cheers
    Claudia



  • Thanks Claudia… Maybe we can hasten the solution if you would please explain you answers a little more. I’m don’t really know much about scintilla and lexers and as such, don’t understand the depth of your answers. Maybe a quick side note on how the scintilla handles it and how & why lexers are different?



  • @Chris-Mckevitt

    Scintilla is the component which
    is used by notepad++ to do all the coloring, folding, styling, … stuff of your language.
    A lexer is the component which calculates which parts should be colored, folded, styled etc…

    Scintilla itself has already a lot of builtin lexers but it also provides an interface for writing
    own lexers e.g. the UDL from npp. Those lexers are written by different programmers,
    although they may use the same scintilla version they are slightly different in functionality
    and representation. E.g. put the following python code into a doc and set the lexer to python

    def foo():
        # comment
        pass
    

    you will see that folding starts from line 1 and includes line 3.
    Use this vbs code and do the same (except you want select visual basic as lexer)

    Sub Foo()
        'comment
        
    End Sub
    

    You will see that folding starts also at line 1 but doesn’t include the last line.
    Even more critical is when pasting this, which from vbs syntax view is absolutely ok, into a doc.

    Sub Foo()
    'comment
        
    End Sub
    

    This results in no folding at all. Why? Because the visual basic lexer programmer decided to
    write the folding logic based on indention and not doing complex code analysis.
    Which is fine, as long as the vbs user does the same kind of code styling.

    So you see, even if one of the language lexer you use behaves the way you like,
    there is no guarantee that others act the same.

    When you want to write your own lexer than I would recommend to check the code of one of the existing lexers.
    This Gmod LUA plugin is known to be a good example but must admit that I never used or checked the code myself.

    Cheers
    Claudia


Log in to reply