Block insert cursor. Block cursor for overwrite mode in xterm

This commit is contained in:
Margers 2024-09-01 20:04:20 +00:00 committed by Michael Van Canneyt
parent 2cc454da26
commit ae81a69cb1
2 changed files with 9 additions and 3 deletions

View File

@ -3943,13 +3943,17 @@ begin
end; end;
procedure TCustomCodeEditor.DrawCursor; procedure TCustomCodeEditor.DrawCursor;
var InsertMode : boolean;
begin begin
if Elockflag>0 then if Elockflag>0 then
DrawCursorCalled:=true DrawCursorCalled:=true
else else
begin begin
SetCursor(GetReservedColCount+CurPos.X-Delta.X,EditorToViewLine(CurPos.Y)-Delta.Y); SetCursor(GetReservedColCount+CurPos.X-Delta.X,EditorToViewLine(CurPos.Y)-Delta.Y);
SetState(sfCursorIns,Overwrite); InsertMode:=Overwrite;
if IsFlagSet (efBlockInsCursor) then
InsertMode:=not InsertMode; {revers insert and overwrite mode cursor shapes}
SetState(sfCursorIns,InsertMode);
end; end;
end; end;

View File

@ -147,8 +147,8 @@ const term_codes_ansi:Ttermcodes=
#$1B#$5B#$48#$1B#$5B#$32#$4A, {clear_screen} #$1B#$5B#$48#$1B#$5B#$32#$4A, {clear_screen}
#$1B#$5B#$48, {cursor_home} #$1B#$5B#$48, {cursor_home}
#$1B#$5B#$3F#$31#$32#$6C#$1B#$5B#$3F#$32#$35#$68, {cursor_normal} #$1B#$5B#$3F#$31#$32#$6C#$1B#$5B#$3F#$32#$35#$68, {cursor_normal}
#$1B#$5B#$3F#$31#$32#$3B#$32#$35#$68, {cursor visible, underline} #27'[?25h'#27'[4 q', {cursor visible, underline}
#$1B#$5B#$3F#$31#$32#$3B#$32#$35#$68, {cursor visible, block} #27'[?25h'#27'[2 q', {cursor visible, block}
#$1B#$5B#$3F#$32#$35#$6C, {cursor_invisible} #$1B#$5B#$3F#$32#$35#$6C, {cursor_invisible}
#$1B#$5B#$3F#$31#$30#$34#$39#$68, {enter_ca_mode} #$1B#$5B#$3F#$31#$30#$34#$39#$68, {enter_ca_mode}
#$1B#$5B#$3F#$31#$30#$34#$39#$6C, {exit_ca_mode} #$1B#$5B#$3F#$31#$30#$34#$39#$6C, {exit_ca_mode}
@ -1283,6 +1283,8 @@ begin
case NewType of case NewType of
crBlock: crBlock:
SendEscapeSeqNdx(cursor_visible_block); SendEscapeSeqNdx(cursor_visible_block);
crUnderLine:
SendEscapeSeqNdx(cursor_visible_underline);
crHidden: crHidden:
SendEscapeSeqNdx(cursor_invisible); SendEscapeSeqNdx(cursor_invisible);
else else