public static void Update(IWpfTextView view, FileSettings settings) { if (settings.InsertFinalNewLine.HasValue && settings.InsertFinalNewLine.Value) { EnsureTrailingNewLine(view); } if (settings.TrimTrailingWhitespace.HasValue && settings.TrimTrailingWhitespace.Value) { TrimTrailingWhitespace(view); } }
public static void Update(IWpfTextView view, FileSettings settings) { if (settings.InsertFinalNewLine.HasValue && settings.InsertFinalNewLine.Value) { EnsureTrailingNewLine(view); } if (settings.TrimTrailingWhitespace.HasValue && settings.TrimTrailingWhitespace.Value) { TrimTrailingWhitespace(view); } if (settings.EndOfLine != null) { EnsureEndOfLine(view, settings.EndOfLine); } }
public ViewsSettings(IWpfTextView view, FileSettings settings) { Settings = settings; Views = new HashSet <IWpfTextView>(); Views.Add(view); }
public void Update(string oldFilepath, string newFilePath, IWpfTextView view, FileSettings newSettings) { Unregister(oldFilepath, view); Register(newFilePath, view, newSettings); }
/// <summary> /// Loads the settings for the given file path /// </summary> private void LoadSettings(string path) { ClearMessage(); settings = null; // Prevent parsing of internet-located documents, // or documents that do not have proper paths. if (path.StartsWith("http:", StringComparison.OrdinalIgnoreCase) || path.Equals("Temp.txt")) return; try { settings = new FileSettings(Core.Parse(path)); ApplyLocalSettings(); } catch (ParseException e) { ShowError(path, "EditorConfig syntax error in file \"" + e.File + "\", line " + e.Line); } catch (CoreException e) { ShowError(path, "EditorConfig core error: " + e.Message); } }
public void Register(string filepath, IWpfTextView view, FileSettings settings) { ViewsSettings viewsSettings; if (!views.TryGetValue(filepath, out viewsSettings)) { viewsSettings = new ViewsSettings(view, settings); views.Add(filepath, viewsSettings); } else { Debug.Assert(!viewsSettings.Views.Contains(view)); viewsSettings.Views.Add(view); } }
public ViewsSettings(IWpfTextView view, FileSettings settings) { Settings = settings; Views = new HashSet<IWpfTextView>(); Views.Add(view); }