Prompt editor now properly parses |T# codes
This commit is contained in:
parent
9981b7bf63
commit
5bdad54a08
|
@ -113,10 +113,23 @@ Begin
|
|||
If S[Count] = '|' Then Begin
|
||||
Code := Copy(S, Count + 1, 2);
|
||||
|
||||
If (Code[1] in ['0'..'2']) and (Code[2] in ['0'..'9']) Then Begin
|
||||
If (Code[2] in ['0'..'9']) Then Begin
|
||||
Case Code[1] of
|
||||
'0'..
|
||||
'2' : Begin
|
||||
Inc (Count, 2);
|
||||
|
||||
Session.io.BufAddStr(Session.io.Pipe2Ansi(strS2I(Code)));
|
||||
End;
|
||||
'T' : Begin
|
||||
Inc (Count, 2);
|
||||
|
||||
Session.io.BufAddStr(Session.io.Attr2Ansi(Session.Lang.Colors[strS2I(Code[2])]));
|
||||
End;
|
||||
Else
|
||||
Session.io.BufAddChar(S[Count]);
|
||||
Dec (SZ);
|
||||
End;
|
||||
End Else Begin
|
||||
Session.io.BufAddChar(S[Count]);
|
||||
Dec (SZ);
|
||||
|
@ -131,9 +144,9 @@ Begin
|
|||
Inc (Count);
|
||||
End;
|
||||
|
||||
While SZ > 0 Do Begin
|
||||
Session.io.BufAddChar(' ');
|
||||
Dec(SZ);
|
||||
If SZ > 0 Then Begin
|
||||
Session.io.AnsiColor (7);
|
||||
Session.io.BufAddStr (strRep(' ', SZ));
|
||||
End;
|
||||
|
||||
Session.io.BufFlush;
|
||||
|
|
|
@ -404,6 +404,7 @@ Var
|
|||
Saved : Boolean = False;
|
||||
Count : Integer;
|
||||
Image : TConsoleImageRec;
|
||||
SavedTheme : RecTheme;
|
||||
Begin
|
||||
Screen.GetScreenImage(1, 1, 79, 24, Image);
|
||||
|
||||
|
@ -414,6 +415,10 @@ Begin
|
|||
Session.io.AnsiColor(7);
|
||||
Session.io.AnsiClear;
|
||||
|
||||
SavedTheme := Session.Lang;
|
||||
|
||||
Move (Theme.Colors, Session.Lang.Colors, SizeOf(Theme.Colors));
|
||||
|
||||
Box := TAnsiMenuBox.Create;
|
||||
Input := TAnsiMenuInput.Create;
|
||||
|
||||
|
@ -547,6 +552,8 @@ Begin
|
|||
Input.Free;
|
||||
|
||||
Session.io.RemoteRestore(Image);
|
||||
|
||||
Session.Lang := SavedTheme;
|
||||
End;
|
||||
|
||||
Procedure EditBars (Var Theme: RecTheme);
|
||||
|
|
Loading…
Reference in New Issue