Skip to content

bug: press :w made the code little bit unreadable #601

@GWLGT

Description

@GWLGT

Neovim version (nvim -v)

NVIM v0.10.2

Operating system/version

Android 10

Read debugging tips

Add the debug logs

  • I have set log_level = vim.log.levels.DEBUG and pasted the log contents below.

Log file

2024-12-21 15:28:22[DEBUG] Running formatters on /data/data/com.termux/files/home/.config/nvim/init.lua: { "stylua" }
2024-12-21 15:28:22[INFO] Run stylua on /data/data/com.termux/files/home/.config/nvim/init.lua
2024-12-21 15:28:22[DEBUG] Run command: { "/data/data/com.termux/files/usr/bin/stylua", "--search-parent-directories", "--stdin-filepath", "/data/data/com.termux/files/home/.config/nvim/init.lua", "-" }
2024-12-21 15:28:22[DEBUG] Run CWD: /data/data/com.termux/files/home/.config/nvim
2024-12-21 15:28:22[DEBUG] stylua exited with code 0
2024-12-21 15:29:24[DEBUG] Running LSP formatter on /data/data/com.termux/files/home/test.cpp

Describe the bug

So, i have this issue in Neovim, whenever i try to save a file using :w, the syntax (indentation, line etc) becomes "broken", what i mean is that, let's say I'm write a C++ file, in a line that has:

void somefunction() {
    std::cout << "Hello, idk" << std::endl;
}

when i press :w, the part become little bit unreadable:

void somefunction() { std::cout << "Hello, idk" << std::endl; }

see, why?, can someone explain it to me? how do i fix it?

What is the severity of this bug?

minor (annoyance)

Steps To Reproduce

disabling conform.nvim.

but it will make formatting harder

Expected Behavior

when pressing :w, the file should saved and the syntax remain untouch.

Minimal example file

No response

Minimal init.lua

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions