If you use this macro instead of [[]], it wont be shown in the “backlinks” panel.
2. And I use tiddlywiki-vim plugin which cant recognize my own macro "<<ML xxx>>", which is very unconvenient for me.
Here is a little brainstorm of the issues you raise. I hope it helps
There are many ways to do this however given the code you shared there are ways to debug this,
Such as use {{$name$!!icon}} outside the transclude to see if it is returning the value you expect,
You can also expand your code to use intermediate steps.
<$set name=icon-tiddler value={{$name$!!icon}}> to get the value before you use it.
With additional intermediate steps its easier to display intermediate values and find out where it is breaking.
This is true but there are alternative ways to do this, is your key outcome being able to use the icon of the linked tiddler?
Perhaps a macro just to retrieve the icon?
Sorry I don’t use the vim plugin
I see why you may want to place icons automatically in links [[tiddlername]] however this is a fundamental part of tiddlywiki and altering that could have unforseen results, and a little complex.
So I suggest we step back and reconsider your needs
Search and other methods can find the tiddler title even if used inside transclusions and macros when can be included to complement the backlinks.
Requirements?
Ability to have internal links include the icon if one exists in the tiddler
Maintain the backlink functionality when using this solution
Keep in mind we can automate things somewhat with editor toolbar buttons, that wrap each line in a selection with the macro to invoke this.
Have you looked at the freelinks plugin perhaps this could be modified to also display the icon when highlining links for tiddler titles?
Some tips;
Try and always write macros to make use of the currentTiddler value