vim-matchup
vim-matchup copied to clipboard
match of macro definition shows a false match
Explain the issue
in systemverilog file , when you define a macro('ifdef 'else)and appear “if” ,the macro of else can match if and also match the 'ifdef.
if(a) begin 'ifdef 'else 'endif end
about match_word =''if(\n)?def>:'else>:'endif>,'
What is the expectation?
I have opened file.sv as follows (did not customize match_words, using built-in vim).
if(a) begin
`ifdef
else
`endif
end
Match 1:
if(a)
else
Match 2:
begin
end
Match 3:
`ifdef
`endif
First of all ,thank you very much for taking time out of your busy schedule to answer my question! About this question ,may be you can try it that put a macro symbol before the "else" . you can see , “'else” can match “ if ”,can also match “'ifdef” .So I got the idea, how do I tie the symbol of the macro to the if so that it doesn't match the else.
if(a) begin 'ifdef 'else 'endif end
Match 1: 'ifdef 'else 'endif
Match 2: if (a) else
Please try it , thank you!