[vim/vim] Rust has broken auto indent rules (Issue #18974)

9 views
Skip to first unread message

Pebble Real

unread,
Dec 19, 2025, 5:37:44 PM (20 hours ago) Dec 19
to vim/vim, Subscribed
Pebble8969 created an issue (vim/vim#18974)

Steps to reproduce

  1. Declare and assign a two dimensional array (e.g. [[u8; 3]; 12]) and make sure that the assignment goes over multiple lines.
  2. Make sure the closing bracket of the outer array (];) is not on the same line as the variable declaration line (one with let x =...).
  3. Create a new line after the closing bracket.
  4. Indentation is not at the same depth as the declaration.

Diagram of result (copied straight from my code):

let mut colors: [[u8; 3]; 12] = [
    [255; 3],
    [0; 3],
    [0; 3],
    [255; 3],
    [255; 3],
    [0; 3],
    [100; 3],
    [255; 3],
    [0; 3],
    [255, 0, 0],
    [0, 255, 0],
    [0, 0, 255],
];
    | <--- Cursor ends up 4 spaces too far.

Expected behaviour

I expected the cursor to end up with consistent indentation like how helix and kakoune do.

Like this:

let mut colors: [[u8; 3]; 12] = [
    [255; 3],
    [0; 3],
    [0; 3],
    [255; 3],
    [255; 3],
    [0; 3],
    [100; 3],
    [255; 3],
    [0; 3],
    [255, 0, 0],
    [0, 255, 0],
    [0, 0, 255],
];
| <--- Expect the cursor to end up at the correct indentation depth.

Version of Vim

9.1.1244

Environment

Operating System: Debian GNU/Linux 13 x86_64
Vim included patches: 1-948, 950-1230, 1242, 1244

Logs and stack traces


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18974@github.com>

Pebble Real

unread,
Dec 19, 2025, 5:42:06 PM (20 hours ago) Dec 19
to vim/vim, Subscribed
Pebble8969 left a comment (vim/vim#18974)

Forgot to include this in the issue opening, but here is a video of the bug (its not exactly the same code as in the examples because i expanded it since recording it)

https://github.com/user-attachments/assets/d967e100-20aa-4e4b-b3ec-b056507e5597


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18974/3676910418@github.com>

Christian Brabandt

unread,
11:59 AM (1 hour ago) 11:59 AM
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#18974)

cannot reproduce using vim --clean


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18974/3677957831@github.com>

Pebble Real

unread,
12:33 PM (1 hour ago) 12:33 PM
to vim/vim, Subscribed
Pebble8969 left a comment (vim/vim#18974)

weird, I tried using it with vim --clean and its still happening. Mind trying it on the global.rs file (line 60) at https://codeberg.org/Pebble8969/common-text-editor/ ?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18974/3677980458@github.com>

Reply all
Reply to author
Forward
0 new messages