'Weird behaviour on neovim inside a tmux when writting yaml files

I have a weird behavior in neovim when editing a YAML file, but it only happens when I run it inside tmux.

Given the file:

foo:               
  foo: value      
bar: value

if I use tmux+nvim to edit the bar value to anything like value1, when I write the file it has been modified indenting bar, like:

foo:
  foo: value
  bar: value1

As you can guess, that usually invalidates my yaml file, what avoids me moving to neovim.

The problem is that when I edit the same file with tmux+vim.tiny it works fine, as well as with neovim outside of tmux. I'm not sure about where to search or to ask... So finally I've decided to ask here to see if any of you have the same problem.

Thank you in advance.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source