akinsho / flutter-tools.nvim

Tools to help create flutter apps in neovim using the native lsp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Syntax highlighting not working immediately

paulkre opened this issue · comments

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When opening the first Dart file after starting Neovim, the code is not highlighted correctly. After making any change to the code (like inserting a new line) the syntax highlighting updates and works correctly.

This is how the code looks on first startup:
Screenshot 2023-11-18 at 12 16 56

And this is how the code looks after any change:
Screenshot 2023-11-18 at 12 17 06

Expected Behavior

The colors of the syntax highlighting should be correct immediately.

Steps To Reproduce

  1. Create a new project with flutter create my_app
  2. Open main.dart

Environment

- OS: macOS 14.0
- Flutter version: 3.13.9
- Is flutter in $PATH: yes
- neovim version: 0.9.2

Anything else?

No response

commented

This plugin has no relationship to syntax highlighting. It doesn't add any. This is all handled by either neovim's syntax functionality or semantic highlighting from the lsp but neither of these things are configured or handled here

Do you by chance know a function to make neovim rerender the buffer after the LSP has been initialized? Then I could maybe call it in on_attach.

commented

You can use vim.cmd(':e') otherwise check reddit as I believe doing this will definitely have been discussed there