natvis - Add tabulator to output

110 views Asked by At

Is there a way to format the final output value string of the watch window with tabulators or other usually escaped symbols?

I have tried:

<Type Name="MyVector">
    <DisplayString Optional="true">x={myVal.x}, y={myVal.y}, z={myVal.z}</DisplayString>
</Type>

This results is:

enter image description here

I would like to have:

enter image description here

I have tried so far:

 {\t}
 \t
 {{\t}}

Sometimes things are quite hidden in the MSDN Doc or MSDN Code Blog. But in this instance, I cannot find a solution.

2

There are 2 answers

1
PfhorSlayer On

I've wanted to be able to do this for years, but no, I do not believe you can. Given that the font used in the autos/locals/watch windows are not fixed-width (and can not be changed, as far as I can tell), you'd still have trouble trying to line stuff up, even if you could add tabs.

0
Mandrake Root On

Try typing &#009; for tabs, like

    <Type Name="MyVector">
        <DisplayString Optional="true">x={myVal.x},&#009;y={myVal.y},&#009;z={myVal.z}\</DisplayString>
    </Type>