static public void RemoveAllBreakpoints() { foreach (var key in breakpoints.Keys) { Npp.DeleteMarker(breakpoints[key]); if (IsRunning) { DebuggerServer.RemoveBreakpoint(key); } } breakpoints.Clear(); foreach (string file in Npp.GetOpenFiles()) { string dbgInfo = CSScriptHelper.GetDbgInfoFile(file, false); if (File.Exists(dbgInfo)) { File.Delete(dbgInfo); } } if (OnBreakpointChanged != null) { OnBreakpointChanged(); } }
static public void SaveAllButNew() { //Win32.SendMessage(Npp.NppHandle, NppMsg.NPPM_SAVEALLFILES, 0, 0); var files = Npp.GetOpenFiles(); var current = Npp.GetCurrentFile(); foreach (var item in files) { if (Path.IsPathRooted(item)) //the "new" file is not saved so it has no root { Npp.OpenFile(item); Win32.SendMessage(Npp.NppHandle, NppMsg.NPPM_SAVECURRENTFILE, 0, 0); } } Npp.OpenFile(current); }
static public void SaveDocuments(string[] files) { var filesToSave = files.Select(x => Path.GetFullPath(x)); var openFiles = Npp.GetOpenFiles(); var current = Npp.GetCurrentFile(); foreach (var item in files) { if (Path.IsPathRooted(item)) //the "new" file is not saved so it has no root { var path = Path.GetFullPath(item); if (filesToSave.Contains(path)) { Npp.OpenFile(item); Win32.SendMessage(Npp.NppHandle, NppMsg.NPPM_SAVECURRENTFILE, 0, 0); } } } Npp.OpenFile(current); }