verilog_systemverilog.vim
verilog_systemverilog.vim copied to clipboard
Special instance indentation support
@lewis could you check how hard it would be to support the following indentation in instances?
my_module #(
.PARAM1 (VALUE1),
.PARAM2 (VALUE2),
)
u_my_instance(
`ifdef TEST
.port1 (wire1),
`endif
.port2 (wire2)
);
What's the current and what is the desired?
That's the desired. Try copying to Vim and open a new line after the instance, you will see that the indentation will match the offset introduced in the instance.
What config do you have with this?
I currently get:
my_module #(
.PARAM1 (VALUE1),
.PARAM2 (VALUE2)
)
u_my_instance(
.port1 (wire1),
.port2 (wire2)
);
logic a;
You need to keep the indentation of the instance exactly as I copied above and only indent after the instance.
Seems fine for me ~~if I set b:verilog_dont_deindent_eos~~.
my_module #(
.PARAM1 (VALUE1),
.PARAM2 (VALUE2)
)
u_my_instance(
.port1 (wire1),
.port2 (wire2)
);
logic a;
Ups! Needs an ifdef. I've edited my example above.
Sorry :)
This won't be easy at all. I have a feeling there be may be a bug here around preprocessor statements.