<div dir="ltr">Hi Andy,<div><br></div><div>I understand you're working on a Rich Text control.</div><div><br></div><div>While working on IME (Input Method Editor) for Linux, I noticed that there is a feature called "surrounding"</div><div>that it supports to give the IME information about the text being inputted. More info here:</div><div><br></div><div><a href="https://docs.gtk.org/gtk3/class.IMContext.html">https://docs.gtk.org/gtk3/class.IMContext.html</a><br></div><div><br></div><div>It works like this:</div><div><br></div><div>When user is typing using an IME language, the underlying IME (for example <a href="https://github.com/tlwg/ibus-libthai">https://github.com/tlwg/ibus-libthai</a>)</div><div>may ask the Toolkit for the surrounding text and it should reply with:</div><div><br></div><div><a href="https://docs.gtk.org/gtk3/method.IMContext.set_surrounding.html">https://docs.gtk.org/gtk3/method.IMContext.set_surrounding.html</a><br></div><div><br></div><div>That contains:</div><div>- The text</div><div>- The length</div><div>- The cursor position within the text</div><div><br></div><div>So this way the underlying IME can provide accurate suggestions using the user context.</div><div><br></div><div>That would be a nice feature to have but it requires some work to retrieve it from the text-based control.</div><div><br></div><div>Just letting you know about this, it may be out of the scope of your rich text work for now.</div><div><br></div><div>-- Thiago.</div></div>