Re: Why are my visible line ending different?

Andrew Truckle <[email protected]>
Newsgroups gmane.comp.lib.scintilla.devel
Message-ID <[email protected]>
Another resolved issue. Changing the way I read the file corrected the line 
ending matter:

void CScintillaHelper::ReadFile(const CString& filePath)
{
ifstream ifs(filePath, ios::in | ios::binary | ios::ate);

const ifstream::pos_type fileSize = ifs.tellg();
ifs.seekg(0, ios::beg);

vector<char> bytes(fileSize);
ifs.read(bytes.data(), fileSize);

m_edit.AppendText(fileSize, std::string(bytes.data(), fileSize).c_str());
m_edit.SetSavePoint();
}

On Friday 26 April 2024 at 05:59:15 UTC+1 Andrew Truckle wrote:

> Hi Neil
>
> Thanks for your response. But, I specifically used \r\n in my code (CR 
> LF).. Notepad++ correctly show these line endings as CRLF. My question is 
> about why my attempt at displaying the same file in Scintilla is only 
> showing CR for the same file?
>
> On Thursday 25 April 2024 at 22:40:25 UTC+1 Neil Hodgson wrote:
>
>> Andrew Truckle:
>>
>> > m_edit.AppendText(1, L"\r\n");
>>
>> "\r\n" contains 2 characters, not 1.
>>
>> Neil
>>
>

-- 
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/scintilla-interest/6cc2f88e-d04a-4c3a-8b05-f107937f2b2bn%40googlegroups.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.