pygtkspellcheck icon indicating copy to clipboard operation
pygtkspellcheck copied to clipboard

Pasted misspelled text merges incorrectly

Open cheywood opened this issue 1 year ago • 1 comments

Copying and pasting a section of text which includes a misspelled word results in the pasted section being broken up and incorrectly merged with the destination text.

I'll try and explain the behaviour through a set of examples.


Starting with a small example, take a buffer like this

word
 asdfasdf

Cut the asdfasdf (note the preceding space) and paste it before word. This should result in the following buffer

 asdfasdfword

But instead we get

 wordasdfasdf

A slightly longer example, take the following buffer

word
valid asdfasdf valid

Cut valid asdfasdf valid and paste it before word

Expected

valid asdfasdf validword

Result

valid wordasdfasdf valid

I haven't looked into at all yet. Pasting text with misspelled words from elsewhere doesn't appear to trigger the issue.

cheywood avatar Aug 14 '22 23:08 cheywood

I can replicate this problem, however, only with GTK4 but not with GTK3.

Pasting should trigger an insert-text event which will set a mark at the position where the text will be inserted and after the insert rechecks the text starting at that mark (functions _before_text_insert and _after_text_insert). I see no reason why this should interfere with pasting in any way. Maybe this has something to do with copying decorated text?

koehlma avatar Sep 09 '22 18:09 koehlma