public void searchSame(bool next) { try { int curStartPos = Globals.SciControl.WordStartPosition(Globals.SciControl.CurrentPos, true); int curEndPos = Globals.SciControl.WordEndPosition(Globals.SciControl.CurrentPos, true); int a = Globals.SciControl.SelectionStart; int b = Globals.SciControl.SelectionEnd; GotoSameIdentifierCommand command = new GotoSameIdentifierCommand(true); command.spos = a; command.epos = b; command.back = next; command.curStartPos = curStartPos; command.curEndPos = curEndPos; command.Execute(); } catch (Exception ex) { ErrorManager.ShowError(ex); } }