mirror of
https://github.com/4sval/FModel.git
synced 2026-08-28 12:24:44 -05:00
code folding doesn't like tabs
This commit is contained in:
@@ -20,7 +20,6 @@ namespace FModel.Views.Resources.Controls
|
||||
private readonly Regex _hexColorRegex = new("\"Hex\": \"(?'target'[0-9A-Fa-f]{3,8})\"$",
|
||||
RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);
|
||||
private readonly System.Windows.Controls.ToolTip _toolTip = new();
|
||||
private JsonFoldingStrategies _manager;
|
||||
|
||||
public AvalonEditor()
|
||||
{
|
||||
@@ -82,9 +81,7 @@ namespace FModel.Views.Resources.Controls
|
||||
if (sender is not TextEditor avalonEditor || DataContext is not TabItem tabItem ||
|
||||
avalonEditor.Document == null || string.IsNullOrEmpty(avalonEditor.Document.Text))
|
||||
return;
|
||||
|
||||
_manager ??= new JsonFoldingStrategies(avalonEditor);
|
||||
_manager.UpdateFoldings(tabItem.Document);
|
||||
|
||||
avalonEditor.Document.FileName = tabItem.Directory + '/' + tabItem.Header.SubstringBeforeLast('.');
|
||||
if (!tabItem.ShouldScroll) return;
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ namespace FModel.Views.Resources.Controls
|
||||
private readonly Regex _hexColorRegex = new("\"Hex\": \"(?'target'[0-9A-Fa-f]{3,8})\"$",
|
||||
RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);
|
||||
private readonly System.Windows.Controls.ToolTip _toolTip = new();
|
||||
private JsonFoldingStrategies _manager;
|
||||
|
||||
public PropertiesPopout(TabItem contextViewModel)
|
||||
{
|
||||
@@ -30,6 +31,8 @@ namespace FModel.Views.Resources.Controls
|
||||
MyAvalonEditor.ScrollToVerticalOffset(contextViewModel.ScrollPosition);
|
||||
MyAvalonEditor.TextArea.TextView.ElementGenerators.Add(new GamePathElementGenerator());
|
||||
MyAvalonEditor.TextArea.TextView.ElementGenerators.Add(new HexColorElementGenerator());
|
||||
_manager = new JsonFoldingStrategies(MyAvalonEditor);
|
||||
_manager.UpdateFoldings(MyAvalonEditor.Document);
|
||||
}
|
||||
|
||||
private void OnMouseHover(object sender, MouseEventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user