Skip to content

Commit caca8d3

Browse files
authored
[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> ```
1 parent 4df364b commit caca8d3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

llvm/utils/vim/syntax/mir.vim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ if version >= 508 || !exists("did_c_syn_inits")
4343
endif
4444

4545
HiLink mirSpecialComment SpecialComment
46+
47+
delcommand HiLink
4648
endif
4749

4850
let b:current_syntax = "mir"

0 commit comments

Comments
 (0)