Ejemplo n.º 1
0
        public void CheckIfNeedsClosing()
        {
            if (IsShowing && !simple && lastMethodStartPos.HasValue)
            {
                int methodStartPos = lastMethodStartPos.Value;

                string text;
                popupForm.ProcessMethodOverloadHint(NppEditor.GetMethodOverloadHint(methodStartPos, out text));

                int currentPos = Npp.GetCurrentDocument().GetCurrentPos();
                if (currentPos <= methodStartPos) //user removed/substituted method token as the result of keyboard input
                {
                    base.Close();
                }
                else if (text != null && text[text.Length - 1] == ')')
                {
                    string typedArgs = text;
                    if (NRefactoryExtensions.AreBracketsClosed(typedArgs))
                    {
                        base.Close();
                    }
                }
            }
        }