Re: Why is Scintilla doing this?

Andrew Truckle <[email protected]>
Newsgroups gmane.comp.lib.scintilla.devel
Message-ID <[email protected]>
Firstly, I apologise by my wording "why is scintilla doing this". That was 
a bold assumption!

Upon closer inspecting I can confirm that saving an existing file does as 
it should. Cursor says in the same place and nothing gets selected.

It is when I show my file dialog and then click either OK or cancel that 
this issue happens.


On Sunday 5 May 2024 at 19:02:33 UTC+1 Andrew Truckle wrote:

> Here is my saving code:
>
> Scintilla::Position nBytesToWrite{ m_edit.GetLength() };
> const char* CharacterPointer = m_edit.GetCharacterPointer();
> while (nBytesToWrite > 0)
> {
> Scintilla::Position nDataToWrite{ nBytesToWrite };
> if (nDataToWrite > UINT_MAX)
> nDataToWrite = UINT_MAX;
> #pragma warning(suppress: 26472)
> file.Write(CharacterPointer, static_cast<UINT>(nDataToWrite));
>
> // Prepare for the next loop around
> #pragma warning(suppress: 26481)
> CharacterPointer += nDataToWrite;
> nBytesToWrite -= nDataToWrite;
> }
>
>
>
> It works  really well. But I have two annoying side effects:
>
>
>    1. It selects all the text.
>    2. It scrolls all the way to the bottom.
>
> I don't want it to do any of this. The cursor should stay where it was and 
> it shouldn't select all the text.
>
> Why is it doing this?
>

-- 
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/15e3f689-01f7-4c82-8db6-aef1650f0a87n%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.