LayoutWrapper GetVirtualSpaceLayout (DocumentLine line, DocumentLocation location)
{
string virtualSpace = "";
var data = textEditor.GetTextEditorData ();
if (data.HasIndentationTracker && line.Length == 0) {
virtualSpace = this.textEditor.GetTextEditorData ().GetIndentationString (location);
}
if (location.Column > line.Length + 1 + virtualSpace.Length)
virtualSpace += new string (' ', location.Column - line.Length - 1 - virtualSpace.Length);
// predit layout already contains virtual space.
if (!string.IsNullOrEmpty (textEditor.preeditString))
virtualSpace = "";
LayoutWrapper wrapper = new LayoutWrapper (textEditor.LayoutCache.RequestLayout ());
wrapper.LineChars = virtualSpace.ToCharArray ();
wrapper.Layout.SetText (virtualSpace);
wrapper.Layout.Tabs = tabArray;
wrapper.Layout.FontDescription = textEditor.Options.Font;
int vy, vx;
wrapper.Layout.GetSize (out vx, out vy);
wrapper.Width = wrapper.LastLineWidth = vx / Pango.Scale.PangoScale;
return wrapper;
}