UpdateScintilla() 공개 정적인 메소드

Updates the current scintilla handle for Npp's functions Called when the user changes the current document
public static UpdateScintilla ( bool reverse = false ) : void
reverse bool
리턴 void
예제 #1
0
파일: Plug.cs 프로젝트: devjerome/3P
        /// <summary>
        /// called when the user changes its selection in npp (the carret moves)
        /// </summary>
        public static void OnUpdateSelection()
        {
            Npp.UpdateScintilla();

            // close popup windows
            ClosePopups();
            Snippets.FinalizeCurrent();

            // update scope of code explorer (the selection img)
            CodeExplorer.RedrawCodeExplorerList();
        }
예제 #2
0
파일: Plug.cs 프로젝트: devjerome/3P
        public static void DoNppDocumentSwitched(bool initiating = false)
        {
            // update current file info
            IsPreviousFileProgress = IsCurrentFileProgress;
            IsCurrentFileProgress  = Abl.IsCurrentProgressFile;
            CurrentFilePath        = Npp.GetCurrentFilePath();
            CurrentFileObject      = FilesInfo.GetFileInfo(CurrentFilePath);

            // accept advanced notifications only if the current file is a progress file
            CurrentFileAllowed = IsCurrentFileProgress;

            // update current scintilla
            Npp.UpdateScintilla();

            // Apply options to npp and scintilla depending if we are on a progress file or not
            ApplyOptionsForScintilla();

            // close popups..
            ClosePopups();

            // Update info on the current file
            FilesInfo.UpdateErrorsInScintilla();

            // refresh file explorer currently opened file
            FileExplorer.RedrawFileExplorerList();

            if (!initiating)
            {
                if (Config.Instance.CodeExplorerAutoHideOnNonProgressFile)
                {
                    CodeExplorer.Toggle(IsCurrentFileProgress);
                }
                if (Config.Instance.FileExplorerAutoHideOnNonProgressFile)
                {
                    FileExplorer.Toggle(IsCurrentFileProgress);
                }
            }
            else
            {
                // make sure to use the ProEnvironment and colorize the error counter
                FilesInfo.UpdateFileStatus();
                ProEnvironment.Current.ReComputeProPath();
            }

            if (IsCurrentFileProgress)
            {
                // Need to compute the propath again, because we take into account relative path
                ProEnvironment.Current.ReComputeProPath();

                // rebuild lines info (MANDATORY)
                Npp.RebuildLinesInfo();
            }

            // Parse the document
            ParserHandler.ParseCurrentDocument(true);

            // publish the event
            if (OnDocumentChangedEnd != null)
            {
                OnDocumentChangedEnd();
            }
        }