`\r` (or `^M`) added at the end of each line when renaming variables in windows

Hey there.

I am using neovim as my editor in windows. And I got troubled in renaming variables. Everytime I renaming a variable, ^M are added after each line, which is unwanted.

I realized it may be the encoding problems, therefore I added this line into my file. However, it doesn’t works.

# -*- coding: utf-8 -*-

I am still wondering if it is a bug, it also may be the consequence of my ignorant to the correct method in configurating neovim in windows. If it is my problem, how can i fix it?

Thanks!

Have you checked fileencoding? :h fenc