TMaskEdit: after deleting an extended selection, don't select a maskliteral. Reported in https://forum.lazarus.freepascal.org/index.php/topic,53557.0.html

git-svn-id: trunk@64744 -
This commit is contained in:
bart 2021-03-04 19:51:10 +00:00
parent 9046b533af
commit 294a0a98c4

View File

@ -1376,7 +1376,12 @@ procedure TCustomMaskEdit.DeleteChars(NextChar : Boolean);
begin
if NextChar then
begin//VK_DELETE
if HasSelection then DeleteSelected
if HasSelection then
begin
DeleteSelected;
if IsLiteral(FMask[FCursorPos]) then
SelectNextChar;
end
else
begin
//cannot delete beyond length of string
@ -1391,7 +1396,12 @@ begin
else
begin//VK_BACK
//if selected text > 1 char then delete selection
if HasExtSelection then DeleteSelected
if HasExtSelection then
begin
DeleteSelected;
if IsLiteral(FMask[FCursorPos]) then
SelectNextChar;
end
else
begin
//cannot backspace if we are at beginning of string, or if all chars in front are MaskLiterals