LadyDefile / Wordsmith-DalamudPlugin

Wordsmith is a Dalamud Plugin aiming to make roleplay easier, more convenient, and harder to accidentally "wrong chat" your post.
6 stars 3 forks source link

v1.15.0.0 Scratchpad: ctrl-x and ctrl-v on multiline causes new lines #53

Open Shuro opened 1 month ago

Shuro commented 1 month ago

Preparation: image

Expected behavior: STRG-C cuts the content, STRG-V pastes it, as before.

Actual behavior: It adds whitespaces inbetween lines. image

LadyDefile commented 1 month ago

Yea, so this is unfortunately a problem with ImGUI that I can't really resolve without a massive amount of work. The new lines in the multiline textbox actually have several hidden characters in it for markers because ImGUI doesn't support wrapping multiline textboxes so I have to handle the wrapping manually by adding these hidden characters. Unfortunately, that means using Ctrl+X copies these hidden characters where the "Copy" button doesn't. So when you paste the lines into the multiline text, it wraps the already wrapped text.

Maybe as a stopgap I can have a "Copy All" option. Maybe do it as a right click menu on the multiline textbox that way it copies without the hidden characters? I'll experiment a little.

Shuro commented 1 month ago

Okay yes, that explains the problem and also explains how I manage to sometimes mess up the text when I go somewhere and change something. I wanted to create a ticket for that too, but I cannot reproduce it. Might be related to those hidden characters.

LadyDefile commented 1 month ago

Yea. It happens every now and then you somehow manage to get the caret between hidden characters and enter text there. I have a few things in place to prevent it from happening as much as possible but there is only so much I can do, lol.

Shuro commented 1 month ago

I think it is when you change something at the end of the box. So causing text changes in that area of the textbox. I also noticed that sometimes, you cannot add a space behind a word if you edit inbetween. Might be related to that characters too. But I do not know an solution, not a C# dev sadly. image