![]() Registered Member ![]()
|
Hi,
I am developing a plugin to support multiple cursors in a document but I am having problems rendering. Currently, to display a cursor, I made a selection of 1 character with KtextEditor::MovingRange interface (KtextEditor::MovingCursor has no property of rendering). But this confuses the cursor position (before or after the selected character?) And it is not displayed when the virtual cursor is positioned at the end of line (there is no character to select ...) So I made my own widget to display a cursor but I can not
I'm interested in any ideas ![]() My implementation is here. |
![]() Global Moderator ![]()
|
Hi!
I'm not sure if writing a plugin for multiple cursors is the best approach. It will probably be quite difficult to get that working nicely. If KTE should support multiple cursors, I think it would be better to implement it in there directly. Maybe you should start a discussion on the mailing list (kwrite-devel) about this -- other people have already been thinking about how to implement this best, and it might be fruitful to talk to them first ![]() Best regards, Sven
I'm working on the KDevelop IDE.
|
![]() Registered Member ![]()
|
Hi!
Thank you for your answer.Sure, I had some problems I solved it a little dirty. I think it lacks a KTE interface to move a cursor (next or previous word / character, bracket matching, etc). The final result is satisfaisant however, the big problem is the visual rendering. I start a discussion soon as I has more time. Best regards, Jonathan |
![]() Global Moderator ![]()
|
Rendering of the cursors should be done by kate's renderer, which is not accessible from a plugin. You could of course overlay additional widgets over the editor area, but that is an ugly hack and really shouldn't be done like that.
I'm working on the KDevelop IDE.
|
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]