mirror of
https://github.com/2dust/v2rayN.git
synced 2025-10-13 11:59:13 +00:00
Update MsgView.axaml.cs
This commit is contained in:
parent
b25d4d57bd
commit
d4818e8d28
1 changed files with 10 additions and 2 deletions
|
@ -58,7 +58,15 @@ public partial class MsgView : ReactiveUserControl<MsgViewModel>
|
|||
ClearMsg();
|
||||
}
|
||||
|
||||
txtMsg.AppendText(msg.ToString());
|
||||
var s = msg?.ToString() ?? string.Empty;
|
||||
s = s.TrimEnd('\r', '\n');
|
||||
if (txtMsg.Document.TextLength > 0)
|
||||
{
|
||||
var last = txtMsg.Document.GetText(txtMsg.Document.TextLength - 1, 1);
|
||||
if (last != "\n")
|
||||
txtMsg.AppendText("\n");
|
||||
}
|
||||
txtMsg.AppendText(s);
|
||||
if (togScrollToEnd.IsChecked ?? true)
|
||||
{
|
||||
txtMsg.ScrollToEnd();
|
||||
|
@ -68,7 +76,7 @@ public partial class MsgView : ReactiveUserControl<MsgViewModel>
|
|||
public void ClearMsg()
|
||||
{
|
||||
txtMsg.Clear();
|
||||
txtMsg.AppendText("----- Message cleared -----\n");
|
||||
txtMsg.AppendText("----- Message cleared -----");
|
||||
}
|
||||
|
||||
private void menuMsgViewSelectAll_Click(object? sender, RoutedEventArgs e)
|
||||
|
|
Loading…
Reference in a new issue