Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#1053 Block Comment Support for KiXtart

Committed
closed
Neil Hodgson
5
2014-11-24
2014-06-19
Lee Wilmott
No

I hope someone can help me.

I use Notepad++ which uses Scintilla.

When I'm editing KiXtart scripts within Notepad++ the block comments are not recognised as comments.

For example, I would expect the following code...

/* These are block comments...
And this is...
...This is the final comment
/*

...to be identified as a comment (which are shown in green) but it isn't.

I have put this to the developer of Notepad++ (please see https://sourceforge.net/p/notepad-plus/discussion/331753/thread/51131c27/) but they have informed me that this should be directed at the Scintilla developers.

I was told that the lexer needs to include support for stream comments for KiXtart. The 'suggested' code is 'something' along the lines of...

#define SCE_KIX_STREAM_COMMENT 10

if (sc.state == SCE_KIX_COMMENT) {
    if (sc.atLineEnd) {
        sc.SetState(SCE_KIX_DEFAULT);
    }
} else if (sc.state == SCE_KIX_STREAM_COMMENT) {
    if (sc.ch == '*' && sc.chNext == '/') {
        sc.ForwardSetState(SCE_KIX_DEFAULT);
}
} else if (sc.state == SCE_KIX_STRING1) {
    // This is a doubles quotes string
    if (sc.ch == '\"') {
        sc.ForwardSetState(SCE_KIX_DEFAULT);
}
.
.
.

if (sc.state == SCE_KIX_DEFAULT) {
    if (sc.ch == ';') {
        sc.SetState(SCE_KIX_COMMENT);
    } else if (sc.ch == '/' && sc.chNext == '*') {
        sc.SetState(SCE_KIX_STREAM_COMMENT);
    } else if (sc.ch == '\"') {
        sc.SetState(SCE_KIX_STRING1);
.
.
.

Please can you consider adding this to Scintilla?

Many thanks,

Lee

Discussion

  • Neil Hodgson
    Neil Hodgson
    2014-06-19

    Has this been compiled and tested? I will accept a tested patch or changed copy of LexKix.cxx. I do not use KiXtart so have no way of knowing if a change works.

     
  • Lee Wilmott
    Lee Wilmott
    2014-06-20

    Hi Neil,

    No this has not been compiled or tested...this was just 'suggested' code. I'm not sure I'm in a position to be able to compile it.

    I am more than happy to test it - but I'm not sure I know how! I use Notepad++ which, in turn, uses Scintilla...but I don't know how I am able to test Scintilla without Notepad++.

    KiXtart scripts are merely text files...A 'Comment Block' begins with "/*" and ends with "*/". Currently Scintilla isn't able to detect 'Comment Blocks' in KiXtart. If you let me know how or if I can work out how, then I am more than happy to test it.

    Lee

     
    Last edit: Lee Wilmott 2014-06-20
  • Neil Hodgson
    Neil Hodgson
    2014-06-20

    Notepad++ includes a copy of Scintilla so change that, follow whatever procedure Notepad++ has for building then test in Notepad++. If you can't work out how to do this, you could ask if anyone is interested in helping on the mailing list.

    https://groups.google.com/forum/?hl=en#!forum/scintilla-interest

     
  • Lee Wilmott
    Lee Wilmott
    2014-07-02

    Hi Neil, I have been in touch with the original author of the code I wish to change. He says that he no longer has a development environment to make changes. I have therefore downloaded the Scintilla source myself and made the changes I want to change and successfully compiled it. I have also tested it thoroughly. How can I submit my changes?

    Kind regards,

    Lee

     
    • Neil Hodgson
      Neil Hodgson
      2014-07-03

      Attach either a patch file or all of the changed files to this tracker issue.

       
  • Lee Wilmott
    Lee Wilmott
    2014-07-07

    Thanks Neil. Please find attached the files that I have updated.

    Any problems then please give me a shout.

    Lee

     
    Attachments
  • Neil Hodgson
    Neil Hodgson
    2014-07-08

    • labels: --> scintilla, kixtart
    • assigned_to: Neil Hodgson
    • Group: Completed --> Committed
     
  • Neil Hodgson
    Neil Hodgson
    2014-07-08

    Committed as [573dde].

     

    Related

    Commit: [573dde]

  • Lee Wilmott
    Lee Wilmott
    2014-07-08

    That's great...thank you Neil.

    Lee

     
  • Neil Hodgson
    Neil Hodgson
    2014-08-14

    • status: open --> closed