Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Problem with \r in SEL_SETTEXT+

NppExec
2013-01-03
2013-05-21
  • CorruptedFile
    CorruptedFile
    2013-01-03

    It looks like something may be missing in the SEL_SETTEXT+ command.

    "SEL_SETTEXT+ \tFirst Line\r\n\t\tSecond line\r\n" should give me the following:

        First Line
            Second Line

    But, instead, I get:

        First Line\r
            Second Line\r

    Am I missing something, or is this a bug?

    Thank you for your help.

     
  • DV
    DV
    2013-01-03

    Executing "help sel_settext+" from the Console shows: 

    REMARKS: 
      Use sel_settext+ to insert special characters: 
      \n  - new line; 
      \\n - \n; 
      \t  - tabulation character.

    There's no \r or other mentioned. Doesn't Scintilla adapts new line character(s) according to the file's ones?

     
  • DV
    DV
    2013-01-05

    Anyway, the support of "\r" could be easily implemented. The source file "NppExec\src\NppExecEngine.cpp", function CScriptEngine::DoSelSetTextEx. 
    If required, this can be done as a quick update to current version of NppExec.

     
  • CorruptedFile
    CorruptedFile
    2013-01-08

    Unfortunately, no, the EOL characters are not adapted to the current file's format. 

    The script I have written outputs the lines with the  missing in a previously 'Windows EOL' formatted file.  Of course Notepad++ doesn't care and still displays the lines correctly.  However, when my boss opens it with MS Notepad all the lines added by my script are on one line due to the missing .

    If you could please add the \r function to the sel_settext+ command that would be awesome.

     
  • CorruptedFile
    CorruptedFile
    2013-01-11

    Excellent, works great now!!!

    Thanks.

     
  • DV
    DV
    2013-04-17

    NppExec v0.5.