コード例 #1
0
 public static void OnFileSavedAs(string oldName, string newName)
 {
     if (ProjectPanel.currentScript != null && ProjectPanel.currentScript == oldName) //script is loaded and renamed
     {
         ProjectPanel.LoadCurrentDoc();
     }
 }
コード例 #2
0
        static IEnumerable <Keys> BindInternalShortcuts()
        {
            var uniqueKeys = new Dictionary <Keys, int>();

            AddInternalShortcuts("Build:F7",
                                 "Build (validate)",
                                 Build, uniqueKeys);

            AddInternalShortcuts("LoadCurrentDocument:Ctrl+F7",
                                 "Load Current Document", () =>
            {
                InitProjectPanel();
                ShowProjectPanel();
                ProjectPanel.LoadCurrentDoc();
            }, uniqueKeys);

            AddInternalShortcuts("Stop:Shift+F5",
                                 "Stop running script",
                                 Stop, uniqueKeys);

            AddInternalShortcuts("_Run:F5",
                                 "Run",
                                 Run, uniqueKeys);

            AddInternalShortcuts("ShowNextFileLocationFromOutput:F4",
                                 "Next File Location in Output", () =>
            {
                OutputPanel.TryNavigateToFileReference(toNext: true);
            }, uniqueKeys);

            AddInternalShortcuts("ShowPrevFileLocationFromOutput:Shift+F4",
                                 "Previous File Location in Output", () =>
            {
                OutputPanel.TryNavigateToFileReference(toNext: false);
            }, uniqueKeys);

            return(uniqueKeys.Keys);
        }
コード例 #3
0
        static IEnumerable <Keys> BindInteranalShortcuts()
        {
            var uniqueKeys = new Dictionary <Keys, int>();

            AddInternalShortcuts("Build:F7",
                                 "Build (validate)",
                                 Build, uniqueKeys);

            AddInternalShortcuts("LoadCurrentDocument:Ctrl+F7",
                                 "Load Current Document", () =>
            {
                InitProjectPanel();
                ShowProjectPanel();
                ProjectPanel.LoadCurrentDoc();
            }, uniqueKeys);

            AddInternalShortcuts("Stop:Shift+F5",
                                 "Stop running script",
                                 Stop, uniqueKeys);

            AddInternalShortcuts("_Run:F5",
                                 "Run",
                                 Run, uniqueKeys);

            AddInternalShortcuts("_Debug:Alt+F5",
                                 "Debug", () =>
            {
                if (!Debugger.IsRunning && Npp.Editor.IsCurrentDocScriptFile())
                {
                    DebugScript();
                }
            }, uniqueKeys);

            AddInternalShortcuts("ToggleBreakpoint:F9",
                                 "Toggle Breakpoint",
                                 () => Debugger.ToggleBreakpoint(), uniqueKeys);

            AddInternalShortcuts("QuickWatch:Shift+F9",
                                 "Show QuickWatch...",
                                 QuickWatchPanel.PopupDialog, uniqueKeys);

            AddInternalShortcuts("StepInto:F11",
                                 "Step Into",
                                 Debugger.StepIn, uniqueKeys);

            AddInternalShortcuts("StepOut:Shift+F11",
                                 "Step Out",
                                 Debugger.StepOut, uniqueKeys);

            AddInternalShortcuts("StepOver:F10",
                                 "Step Over",
                                 StepOver, uniqueKeys);

            AddInternalShortcuts("SetNextIP:Ctrl+Shift+F10",
                                 "Set Next Statement",
                                 Debugger.SetInstructionPointer, uniqueKeys);

            AddInternalShortcuts("RunToCursor:Ctrl+F10",
                                 "Run To Cursor",
                                 Debugger.RunToCursor, uniqueKeys);

            AddInternalShortcuts("RunAsExternal:Ctrl+F5",
                                 "Run As External Process", () =>
            {
                if (Npp.Editor.IsCurrentDocScriptFile())
                {
                    RunAsExternal();
                }
            }, uniqueKeys);

            AddInternalShortcuts("ShowNextFileLocationFromOutput:F4",
                                 "Next File Location in Output", () =>
            {
                OutputPanel.TryNavigateToFileReference(toNext: true);
            }, uniqueKeys);

            AddInternalShortcuts("ShowPrevFileLocationFromOutput:Shift+F4",
                                 "Previous File Location in Output", () =>
            {
                OutputPanel.TryNavigateToFileReference(toNext: false);
            }, uniqueKeys);

            return(uniqueKeys.Keys);
        }