'In sublime text 4, how to hide embeded code's symbols in the `go to symbol` panel when in a markdown file?
In sublime text 4, now go to symbol will show mixed symbols. For example. if I have a markdown file, and inside the file there is some go snippet code, go to symbol will show both markdown source’s symbol and go source’s symbol mixed, and the mixed mess make go to symbol help less to show the markdown’s structure.
So is there a way to restrict the go to symbol only show symbol from the main source? like inside a *.md file, only show markdown’s symbol? Like the old days?
Solution 1:[1]
See: https://forum.sublimetext.com/t/how-to-restrict-go-to-symbol-only-show-symbol-from-one-source/64066
There is a patch to do this: https://github.com/deathaxe/sublime-packages/blob/838d21fe511b993ccaff86daa7dac663b58ecf91/Markdown/Symbol%20List%20-%20Hide.tmPreferences
But it's not released yet. You can manually create a Symbol List - Hide.tmPreferences file under sublime text's Pacakges/Markdown/ folder with the content:
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>scope</key>
<string>
text.html.markdown markup.raw.code-fence,
text.html.markdown meta.toc-list.id
</string>
<key>settings</key>
<dict>
<key>showInSymbolList</key>
<integer>0</integer>
<key>showInIndexedSymbolList</key>
<integer>0</integer>
</dict>
</dict>
</plist>
To do this, you may need install PacakgeSourceViewer package, and extract the Markdown package first.
Solution 2:[2]
Just set the location (or location.href):
location = "/abc?name=test";
Since it's a relative URL, the protocol and host will be unchanged.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | unifreak |
| Solution 2 | T.J. Crowder |
