[QScintilla] text(line) trims the first character for CR+LF files
    Phil Thompson 
    phil at riverbankcomputing.com
       
    Tue Nov 27 10:27:33 GMT 2018
    
    
  
On 19 Nov 2018, at 11:03 pm, Manuel Gómez <mgrojo at gmail.com> wrote:
> 
> This pointed me in the right direction. If I change this:
> 
>          setSelection(line, 0, line, lineLength(line));
> 
> by this:
> 
>        indexTo = lineText.endsWith("\r\n") ? lineLength(line)-1 : lineLength(line);
>        setSelection(line, 0, line, indexTo);
> 
> I get correct results in both file formats. If this is the expected behaviour (I didn't expect for text(line) to include line terminators, nor for lineLength to count them), I can leave it as is.
Just to confirm, that is the expected behaviour.
Phil
    
    
More information about the QScintilla
mailing list