hashivim / vim-terraform

basic vim/terraform integration
http://hashivim.github.io/vim-terraform
ISC License
1.07k stars 111 forks source link

Vim terminal should redraw after fmt #167

Closed rsiwal closed 3 years ago

rsiwal commented 3 years ago

[166] Vim terminal should redraw after terraform file is saved

dimbleby commented 3 years ago

If redraw after formatting is necessary, then I expect this change should go in the function that does the formatting; not on this autocmd.

But I am yet to understand why this is necessary. I format terraform files through vim regularly and have never felt the need to redraw...

rajneshsiwal commented 3 years ago

My test file without fmt is :

provider "aws" {
          region = "us-west-2"
}

After fmt is

          region = "us-west-2"
} region = "us-west-2"

Here are the URLs of snapshots PRE: https://snipboard.io/tvGsuz.jpg POST writing the file https://snipboard.io/G1j3lR.jpg

If I redraw the window, it gets fixed.

dimbleby commented 3 years ago

I cannot reproduce: formatting the file, and formatting on save, both work exactly as expected for me.

I think this plugin has enough users that it's likely that whatever is going on here is something specific to your environment: maybe the vim version, or the terminal, or other plugins, or I don't know what.

If you're up for debugging I'd suggest:

In the long run that should be more valuable than working around the issue one plugin at a time...

dimbleby commented 3 years ago

Gonna close this one down, do feel free to open a fresh issue or MR if you want to make the case that this really is the right place to fix what you're seeing.