Skip to content
New issue

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

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

Already on GitHub? # to your account

Line numbers do not align with lines #286

Open
albe-jj opened this issue Nov 1, 2024 · 3 comments
Open

Line numbers do not align with lines #286

albe-jj opened this issue Nov 1, 2024 · 3 comments

Comments

@albe-jj
Copy link

albe-jj commented Nov 1, 2024

See an example here:

image image
@mjarkk
Copy link

mjarkk commented Nov 17, 2024

Adding a gutter style fixed it for me:

        CodeField(
          gutterStyle: const GutterStyle(
            textStyle: TextStyle(height: 1.5),
            showLineNumbers: true,
          ),
          controller: controller,
        )

Got this from:
#270 (comment)

@simeonangelov94
Copy link

simeonangelov94 commented Dec 27, 2024

Quick Fix: Copy the library to your local project.
or Fork flutter_code_editor repository

  1. Navigate to the code of the package and modify within.(cmd + left click --> on MAC) on CodeField Widget.
  2. Navigate to GutterWidget (CMD + F --> GutterWidget)
  3. Wrap the GutterWidget in a Container and add padding top 4.

For more advance solutions you can define gutterPadding within the widget and pass it when you call CodeField Widget

@AthulNoobie
Copy link

Quick Fix: Copy the library to your local project. or Fork flutter_code_editor repository

  1. Navigate to the code of the package and modify within.(cmd + left click --> on MAC) on CodeField Widget.
  2. Navigate to GutterWidget (CMD + F --> GutterWidget)
  3. Wrap the GutterWidget in a Container and add padding top 4.

@simeonangelov94

padding: EdgeInsets.only(top: 3) solved my issue
You are a legend

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants