• Login
Community
  • Login

Developer Needed...

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
4 Posts 2 Posters 2.9k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C
    Chris Mckevitt
    last edited by Jul 14, 2016, 2:45 PM

    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?!..

    C 1 Reply Last reply Jul 16, 2016, 10:36 PM Reply Quote 1
    • C
      Claudia Frank @Chris Mckevitt
      last edited by Jul 16, 2016, 10:36 PM

      @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

      1 Reply Last reply Reply Quote 0
      • C
        Chris Mckevitt
        last edited by Jul 22, 2016, 11:08 AM

        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?

        C 1 Reply Last reply Jul 22, 2016, 11:25 PM Reply Quote 0
        • C
          Claudia Frank @Chris Mckevitt
          last edited by Jul 22, 2016, 11:25 PM

          @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

          1 Reply Last reply Reply Quote 0
          2 out of 4
          • First post
            2/4
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors