Interesting! It is better now, but I still have problem with words coming after the one with accent.
Here's my code, let's imagine this "procedure" adds what's in my clipboard to the end of each word (say the end of a word is what comes before the next blank space) :
var
posi:integer;
caret: TPoint;
begin
Caret.y:=Memo.CaretPos.y;
Caret.x:=Memo.CaretPos.x;
posi:=UTF8Pos(' ',Memo.Lines[Caret.y].Substring(Caret.x,Length(Memo.Lines[Caret.y])));
If posi<>0 then
begin
Caret.x:=Memo.CaretPos.x+posi-1;
Memo.CaretPos:=Caret;
Memo.PasteFromClipboard;
end
end;
This way, when my cursor is in the middle of the word "bagunça" in the sentence "vc bagunça demais as coisas", and supposing my clipboard has "_TAG", "bagunça" becomes "bagunça_TAG", perfect.
However, if the cursor is at "demais", it becomes "demais _TAGas".
Sentences without any accentuation are tagged like a charm.
Any idea?