Open nongcaro opened 5 years ago
What were the testing conditions when this gif was created?
Looking at this gif now and having tested for the issue myself, when does it change the position of the cursor? All that happens is the cursor gets placed back where it was when you were making the change. I believe this is expected functionality, feel free to correct me if I am wrong.
I take that back, I think I can see what you are talking about, do you mean when the cursor jumps forward by one character?
Hey @Hexman768, thanks for the reply.
Yeah, that's what I meant, sorry if I wasn't clear. It jumps forward by one character.
@Hexman768
For the testing conditions, it really doesn't matter. Anything that has a FastColoredTextBox
has this issue.
I just tried implementing the Delete
key myself, overriding it. But the problem is, now undo doesn't work. It just does delete again.
Forget about the custom implementation. I did have a hacky solution to the problem:
But it doesn't work perfectly yet. It has conflictions with when using Delete
and then writing something else, and then doing Ctrl+Z, and then doing Ctrl+Z
for the Delete
. However, I haven't tried fixing this yet, but I would really rather have an official solution because this is not the way Delete
is supposed to work.
I believe there is an official solution available, in the meantime could you add the bug label to this issue? When I get off work I will look into finding a code change that will resolve this issue.
Um lol, I don't think I can.
Can you click on the labels button directly?
I don't have any label button @Hexman768. I think it's only available for owners/contributors. I'll just leave the [BUG]
in the title for now.
Sounds good, I didn't get a chance to look into this last night, I'll see if I have enough time tonight.
No problems. Thanks anyways!
Any news @Hexman768?
Honestly, between school and work, I haven't had time to look into this issue and I probably won't have the time in the near future, we can choose to leave it open and I can get to it when I can or you can close it if you so choose.
Okay.
Never mind this, I implemented my own Delete function. It shows the selection after doing Undo, but it's way better than changing the cursor. The selection can simply be removed though (detecting it after the Undo). I'll leave this issue open because it's still technically a logical bug, and my solution is not official.
The way FastColoredTextBox implements Delete, is by moving the cursor one column to the right, and then inserting the character "\b" (backspace) (this method is private). And when you do Undo, it inserts the text back, and the cursor goes one position to the right when doing that, because that's what its place was before the backspace.
Here's a GIF: