Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The line number area becomes wider after call RoslynCodeEditor.Initialize #439

Open
ZjzMisaka opened this issue Jul 23, 2022 · 0 comments
Open

Comments

@ZjzMisaka
Copy link

ZjzMisaka commented Jul 23, 2022

Describe the bug
The line number area becomes wider every time I change the theme by calling RoslynCodeEditor.Initialize.
code:

        private void ActualApplicationThemeChanged(ThemeManager themeManager, object obj)
        {
            if (ThemeManager.Current.ActualApplicationTheme == ApplicationTheme.Light)
            {
                lightModeDocumentId = editor.Initialize(_host, new ClassificationHighlightColors(),
                    Directory.GetCurrentDirectory(), string.Empty);
                documentViewModel.Initialize(lightModeDocumentId);
            }
            else if (ThemeManager.Current.ActualApplicationTheme == ApplicationTheme.Dark)
            {
                darkModeDocumentId = editor.Initialize(_host, new DarkModeHighlightColors(),
                    Directory.GetCurrentDirectory(), string.Empty);
                documentViewModel.Initialize(darkModeDocumentId);
            }
        }

image
image

I've tried calling editor.Initialize only once for each theme, and saving the DocumentId, but it doesn't work when used in documentViewModel.Initialize.

The dark mode based on #372 and his sample https://gist.github.com/gmanny/d40f71f0e38a6a9da673a2e05117b847

To Reproduce

Expected behavior
No matter how many times the theme is switched, the dotted line in the line number area is close to the number.

Version

  • OS: Windows 10
  • Build (or commit ID if built from source): commit 45e792c
@ZjzMisaka ZjzMisaka changed the title The line number area becomes wider every time I change the theme The line number area becomes wider after call RoslynCodeEditor.Initialize Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants