akvelon / flutter-code-editor

Flutter Code Editor is a multi-platform code editor supporting syntax highlighting, code blocks folding, autocompletion, read-only code blocks, hiding specific code blocks, themes, and more.
https://akvelon.com
Apache License 2.0
197 stars 47 forks source link

Limit the variability of TextStyle in the gutter #260

Open alexeyinkin opened 10 months ago

alexeyinkin commented 10 months ago

For the line numbers to be aligned with the code lines, they should share a lot of properties in TextStyle. This is because we use the natural vertical flow in the text field and in the gutter. We made two separate TextStyles for that to allow flexibility with color, weight, and other things, but the users repeatedly put different fonts, sizes, line spacing, etc. and expect the two to be aligned.

See:

We should:

  1. Inspect each property in TextStyle and see if different values in it break the alignment.
  2. For those properties breaking the alignment, take their values from CodeField.textStyle and force them in GutterStyle.textStyle.
  3. Document which properties in GutterStyle.textStyle have effect and are not overridden.