runtime(rustfmt): Recover accidentally deleted code, don't hide rustfmt error

Commit: 
https://github.com/vim/vim/commit/ad0dd7cd1ef405086e8266f8f62221a307a72fe9
Author: Arkissa <[email protected]>
Date:   Sun Jan 25 15:42:24 2026 +0000

    runtime(rustfmt): Recover accidentally deleted code, don't hide rustfmt 
error
    
    closes: https://github.com/vim/vim/issues/19251
    
    Signed-off-by: Arkissa <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/runtime/autoload/rustfmt.vim b/runtime/autoload/rustfmt.vim
index 268a1c02c..3d905296a 100644
--- a/runtime/autoload/rustfmt.vim
+++ b/runtime/autoload/rustfmt.vim
@@ -1,7 +1,8 @@
 " Author: Stephen Sugden <[email protected]>
 " Last Modified: 2023-09-11
 " Last Change:
-" 2025 Oct 27 by Vim project don't use rustfmt as 'formatprg' by default
+" 2025 Oct 27 by Vim project: don't use rustfmt as 'formatprg' by default
+" 2026 Jan 25 by Vim project: don't hide rustfmt errors, restore default var
 "
 "
 " Adapted from https://github.com/fatih/vim-go
@@ -69,6 +70,12 @@ function! s:RustfmtWriteMode()
 endfunction
 
 function! s:RustfmtConfigOptions()
+    let default = '--edition 2018'
+
+    if !get(g:, 'rustfmt_find_toml', 0)
+        return default
+    endif
+
     let l:rustfmt_toml = findfile('rustfmt.toml', expand('%:p:h') . ';')
     if l:rustfmt_toml !=# ''
         return '--config-path '.shellescape(fnamemodify(l:rustfmt_toml, ":p"))
@@ -199,7 +206,7 @@ function! s:RunRustfmt(command, tmpname, from_writepre)
             echo "rust.vim: was not able to parse rustfmt messages. Here is 
the raw output:"
             echo "
"
             for l:line in l:stderr
-                echo l:line
+                echomsg l:line
             endfor
         endif
 
@@ -218,7 +225,10 @@ function! s:RunRustfmt(command, tmpname, from_writepre)
 
     " Open lwindow after we have changed back to the previous directory
     if l:open_lwindow == 1
+        try
         lwindow
+        catch /^Vim\%((\S\+)\)\=:E776:/
+        endtry
     endif
 
     call winrestview(l:view)
diff --git a/runtime/doc/ft_rust.txt b/runtime/doc/ft_rust.txt
index b1789b814..7426caad6 100644
--- a/runtime/doc/ft_rust.txt
+++ b/runtime/doc/ft_rust.txt
@@ -166,6 +166,13 @@ g:rustfmt_detect_version~
        Disabled by default for performance reasons
 >
            let g:rustfmt_detect_version = 1
+<
+                                                       *g:rustfmt_find_toml*
+g:rustfmt_find_toml~
+    When set to 1, will try to find `rustfmt.toml` file by searching from
+    current path upwards.  Disabled by default for performance reasons
+>
+        let g:rustfmt_find_toml = 1
 <
                                                           *g:rust_playpen_url*
 g:rust_playpen_url~
diff --git a/runtime/doc/tags b/runtime/doc/tags
index a049f7002..cafe489a7 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -7975,6 +7975,7 @@ g:rustfmt_command ft_rust.txt     /*g:rustfmt_command*
 g:rustfmt_detect_version       ft_rust.txt     /*g:rustfmt_detect_version*
 g:rustfmt_emit_files   ft_rust.txt     /*g:rustfmt_emit_files*
 g:rustfmt_fail_silently        ft_rust.txt     /*g:rustfmt_fail_silently*
+g:rustfmt_find_toml    ft_rust.txt     /*g:rustfmt_find_toml*
 g:rustfmt_options      ft_rust.txt     /*g:rustfmt_options*
 g:statusline_winid     options.txt     /*g:statusline_winid*
 g:syntax_on    syntax.txt      /*g:syntax_on*

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1vk2Wy-00DGzf-FT%40256bit.org.

Raspunde prin e-mail lui