StatusPanel now does not work when disabled in settings

This commit is contained in:
Alexander 2019-10-21 14:26:40 +03:00
parent 6d0518dc0c
commit 305410e5f8

View file

@ -430,21 +430,28 @@ private async void StatusPanelMessage(string type)
private void StatusPanelTextInfo()
{
int currentColumn = 1 + richTextBox.SelectionStart - richTextBox.GetFirstCharIndexOfCurrentLine();
RichTextBox rtb = new RichTextBox();
rtb.WordWrap = false;
rtb.Text = richTextBox.Text;
int currentLine = 1 + rtb.GetLineFromCharIndex(richTextBox.SelectionStart);
int linesCount = richTextBox.Lines.Count();
if (linesCount == 0)
int currentColumn = 0;
int currentLine = 0;
int linesCount = 0;
if (statusPanel.Visible)
{
linesCount = 1;
currentColumn = 1 + richTextBox.SelectionStart - richTextBox.GetFirstCharIndexOfCurrentLine();
RichTextBox rtb = new RichTextBox
{
WordWrap = false,
Text = richTextBox.Text
};
currentLine = 1 + rtb.GetLineFromCharIndex(richTextBox.SelectionStart);
linesCount = richTextBox.Lines.Count();
if (linesCount == 0)
{
linesCount = 1;
}
}
statusPanelLengthLabel.Text = "Length: " + richTextBox.TextLength;
statusPaneLinesLabel.Text = "Lines: " + linesCount;
statusPaneLnLabel.Text = "Ln: " + currentLine;
statusPaneColLabel.Text = "Col: " + currentColumn;
}
private void LockFile()