コード例 #1
0
ファイル: PluginUI.cs プロジェクト: thecocce/flashdevelop
 public void GotoPosAndFocus(ScintillaNet.ScintillaControl sci, int position)
 {
     int pos = sci.MBSafePosition(position);
     int line = sci.LineFromPosition(pos);
     sci.EnsureVisible(line);
     sci.GotoPos(pos);
 }
コード例 #2
0
ファイル: PluginUI.cs プロジェクト: heon21st/flashdevelop
		private void GotoPosAndFocus(ScintillaNet.ScintillaControl sci, int position)
		{
			// don't correct to multi-byte safe position (assumed correct)
			sci.GotoPos(position);
			int line = sci.LineFromPosition(position);
			// TODO  The folding makes the line centering fail - solution: expand all folds / make it smarter.
			//sci.EnsureVisible(line);
			sci.ExpandAllFolds();
			int top = sci.FirstVisibleLine;
			int middle = top + sci.LinesOnScreen/2;
			sci.LineScroll(0, line-middle);
			((Control)sci).Focus();
		}