Menu

Highlight config for NppExec

Song XU
2008-07-25
2012-11-14
  • Song XU

    Song XU - 2008-07-25

    The highlight feature of NppExec is powerful.But frankly speaking, the mask config is not smart enough. See the example below:
    1) ant(java make tool) output line for J2SE is:
        [javac] D:\Documents\workplace\snippets\src\MainWin.java:2: some message...
    2) ant output line for J2ME is:
    [wtkbuild] D:\Documents\workplace\dida\src\DidaMIDlet.java:16: some message...

    Since the number of leading space characters is different in the examples, I should config two similar mask configures:
    1) * %ABSFILE%:%LINE%
    2)    * %ABSFILE%:%LINE%
    Why not make the first mask match the second one? If I've similar syntax except for different spaces in some outputs, I should list them all?
    Even worse,the list sequence cannot be changed. In this case if there're different mask configs with different space chars, I should adjust the whole existing list.

    XS

     
    • DV

      DV - 2008-07-28

      Well, after some time I've understood that the error is in your highlight mask. The plugin works correctly.
      The right mask is the following:

      *] %ABSFILE%:%LINE%:*

      You see, your mask "* %ABSFILE%:%LINE% " does not provide enough information. The keyword "%ABSFILE%" is something similar to "%s" in scanf(), so, in common case, it does not know where the substring starts and where it ends. Thus, if you specify "*] %ABSFILE%:%LINE%:*", it will be clear that the "%ABSFILE%" starts right after "] " in the string.

       
    • DV

      DV - 2008-07-28

      We can not perform additional verification for the start and end of "%ABSFILE%", because, in common case, "%ABSFILE%" may have different form:
      1) c:\folder\file.ext
      2) c:/folder/file.ext
      3) \\path\file.ext
      4) //path/file.ext
      5) ..\path\file.ext
      6) ../path/file.ext

      And maybe we can invent other forms of %ABSFILE% :-)

       
    • Song XU

      Song XU - 2008-07-30

      Even though I cannot understand the working logic for the mask right now, your suggestion WORKS perfect.

      Thank you!

       
    • Song XU

      Song XU - 2008-07-30

      Mask:
      * %ABSFILE%:%LINE%

      Output (replace '@' with ' ' below):
      @@@@[javac] D:\Documents\

      decision logic:
      Step 1) Search each space char from beginning of a line
      Step 2) Get the char next to the space char, and see if it's a legal leading char for %ABSFILE%
      Step 3) Since '[' can not be a leading char for %ABSFILE%, continue Step 1)

      With this decision procedure, my highlight mask works. If it doesn't make sense for other scenarioes, just forget it. Anyhow, '*] %ABSFILE' is obviously working fine.

      XS

       
    • Song XU

      Song XU - 2008-07-25

      [Since the space char ' ' is ignored by the forum system, i replace it with '@' and re-post the message here]

      The highlight feature of NppExec is powerful.But frankly speaking, the mask config is not smart enough. See the example below ['@' stands for space char ' ']:
      1) ant(java make tool) output line for J2SE is:
      @[javac] D:\Documents\workplace\snippets\src\MainWin.java:2: some message...
      2) ant output line for J2ME is:
      @@@@[wtkbuild] D:\Documents\workplace\dida\src\DidaMIDlet.java:16: some message...

      Since the number of leading space characters is different in the examples, I should config two similar mask configures:
      1)@* %ABSFILE%:%LINE%
      2)@@@@* %ABSFILE%:%LINE%
      Why not make the first mask match the second one? If I've similar syntax except for different spaces in some outputs, I should list them all?
      Even worse,the list sequence cannot be changed. In this case if there're different mask configs with different space chars, I should adjust the whole existing list.

      XS

       
    • DV

      DV - 2008-07-25

      It looks like an error... I'll debug the sources to see what's wrong.