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] Not able to use flutter log commands

diego-rapoport opened this issue · comments

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Cannot use flutter run key commands like r or even q because it says to me that it is not 'modifiable'.

Expected Behavior

Should be able to run those commands inside flutter log.

Steps To Reproduce

  1. Open flutter project with neovim
  2. Run :FlutterRun
  3. Try to run commands on flutter log tab

Environment

- OS: Arch Linux 
- Flutter version: 3.7.12
- Is flutter in $PATH: yes
- neovim version: 0.9.0

Anything else?

I was even wondering if I could send this output to ToggleTerm as a possible solution. Otherwise, is there any other options than setting keymaps myself because it seems very unnecessary.

commented

Hi @diego-rapoport, you cannot use the log buffer directly since it's just a log buffer not a terminal, it is much easier to run and manage a process than doing the same with a terminal but definitely possible. This is why the plugin provides commands to do all of these things so that they are sent to the running process. I would checkout the docs on flutter commands. There are commands like FlutterRestart etc.

I'm going to close this out since it isn't actually a bug and there are known solutions, if you don't want to use keymaps then I'd happily take a PR to add a new runner that used the native terminal but since there is already a runner for the debugger and the existing native log runner with a bunch of commands I think there are plenty of solutions available.

These might not be to your exact preference but since this is FOSS you are very welcome to help contribute something.

commented

Also as an idea that is probably simpler you can also contribute a PR with creates buffer local mappings in the log buffer so that things like r etc work as you expect but under the hood these just call the commands like FlutterRestart.

That seems reasonable! Totally understood and if I have some time definately will try a PR.