Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backspace deletes last readonly character #54

Open
suleyman-shb opened this issue Sep 9, 2020 · 0 comments
Open

Backspace deletes last readonly character #54

suleyman-shb opened this issue Sep 9, 2020 · 0 comments

Comments

@suleyman-shb
Copy link

Steps to reproduct:
Start new "ConsoleControlSample.WPF" process.
Click "Run command" starts new command shell
Hit backspace on input area
Last character on output, probable a ">" character is removed.

Fix proposal:
on "richTextBoxConsole_PreviewKeyDown" method, change

var caretPosition = richTextBoxConsole.GetCaretPosition();
var delta = caretPosition - inputStartPos;
var inReadOnlyZone = delta < 0;

with this

var caretPosition = richTextBoxConsole.GetCaretPosition();
var delta = caretPosition - inputStartPos;
var inReadOnlyZone = delta <= 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant