[llvm] caca8d3 - [vim] Fix command already exists on opening multiple mir buffers (#82410)

via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 28 13:37:43 PST 2024


Author: Joe Nash
Date: 2024-02-28T16:37:39-05:00
New Revision: caca8d33a9d5e6fe75980c4ae1cb13de2e460590

URL: https://github.com/llvm/llvm-project/commit/caca8d33a9d5e6fe75980c4ae1cb13de2e460590
DIFF: https://github.com/llvm/llvm-project/commit/caca8d33a9d5e6fe75980c4ae1cb13de2e460590.diff

LOG: [vim] Fix command already exists on opening multiple mir buffers (#82410)

When using the vim syntax for mir, an error occurs in nvim  when opening
multiple .mir buffers. delcommand HiLink in the mir syntax file to avoid
the issue.

To reproduce:
Open an .mir file, for example
llvm/test/Codegen/X86/expand-post-ra-pseudo.mir
Open another mir file from within nvim, for example peephole.mir
```
Error detected while processing function 335[30]..<SNR>43_callback[25]..function 335[30]..<SNR>43_callback:                                                                                                                      
line   23:                                                                                                                                                                                                                       
Vim(command):E174: Command already exists: add ! to replace it: HiLink hi def link <args>   
```

Added: 
    

Modified: 
    llvm/utils/vim/syntax/mir.vim

Removed: 
    


################################################################################
diff  --git a/llvm/utils/vim/syntax/mir.vim b/llvm/utils/vim/syntax/mir.vim
index 51ac4982b7c95e..024a795a23c54c 100644
--- a/llvm/utils/vim/syntax/mir.vim
+++ b/llvm/utils/vim/syntax/mir.vim
@@ -43,6 +43,8 @@ if version >= 508 || !exists("did_c_syn_inits")
   endif
 
   HiLink mirSpecialComment SpecialComment
+
+  delcommand HiLink
 endif
 
 let b:current_syntax = "mir"


        


More information about the llvm-commits mailing list