Skip to content
This repository has been archived by the owner on Oct 16, 2020. It is now read-only.

Commit

Permalink
Fixed column displayed in status bar.
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrunwald committed Sep 28, 2010
1 parent 169c640 commit c143e6c
Showing 1 changed file with 12 additions and 1 deletion.
Expand Up @@ -6,6 +6,7 @@
using System.Linq;
using System.Text;
using System.Windows.Threading;
using ICSharpCode.AvalonEdit.AddIn.Options;
using ICSharpCode.AvalonEdit.Document;
using ICSharpCode.AvalonEdit.Highlighting;
using ICSharpCode.AvalonEdit.Utils;
Expand Down Expand Up @@ -182,7 +183,17 @@ public override INavigationPoint BuildNavPoint()
void CaretChanged(object sender, EventArgs e)
{
NavigationService.Log(this.BuildNavPoint());
WorkbenchSingleton.StatusBar.SetCaretPosition(this.Column, this.Line, this.Column);
var document = codeEditor.Document;
int lineOffset = document.GetLineByNumber(this.Line).Offset;
int chOffset = this.Column;
int col = 1;
for (int i = 1; i < chOffset; i++) {
if (document.GetCharAt(lineOffset + i - 1) == '\t')
col += CodeEditorOptions.Instance.IndentationSize;
else
col += 1;
}
WorkbenchSingleton.StatusBar.SetCaretPosition(col, this.Line, chOffset);
}

public override bool IsReadOnly {
Expand Down

0 comments on commit c143e6c

Please sign in to comment.