Replies: 3 comments
-
Yes, the place and modification are correct. 👍 Only the part related to lexer has not been modified, so the outline cannot be displayed correctly. In order to speed up the scanning speed of outline, WindTerm allows you to set only certain lexered scopes to scan when scanning outline, so as to avoid scanning all characters again. This is the purpose of the {
"name": "prompt",
"scope": "prompt.line.linux",
"match": "(*UTF)(?m)^([^\\n\\$#\\x{e0b0}]*+[\\$#]|[^\\n]*?\\x{e0b0}) [ \\t]*+(?<command>(\\S[^\\n\\x{e0b0}]*+|(?!\\n)))$"
} The above configuration indicates that this outline item is scanned only in the scope where the scope is {
"begin": "(*UTF)(?m)^(?![-+])(?=[^\\n\\$#\\x{e0b0}]*+[\\$#\\x{e0b0}])[ \\t]*+\\S(?:[^\\n\\$#]*+([\\$#])|[^\\n]*?\\x{e0b0})(?= )",
"captures": {
"1": {
"name": "keyword.control.directive.diagnostic.linux"
}
},
"end": "\\n",
"name": "prompt.line.linux",
"patterns": [
{
"include": "#command"
},
...
] So you also need to modify "begin": "(*UTF)(?m)^(?![-+])(?=[^\\n\\$#\\x{e0b0}]*+[\\$#\\x{e0b0}])[ \\t]*+\\S(?:[^\\n\\$#]*+([\\$#])|[^\\n]*?\\x{e0b0})(?= )" to: "begin": "(*UTF)(?m)^(?![-+])(?=[^\\n\\$#>\\x{e0b0}]*+[\\$#>\\x{e0b0}])[ \\t]*+\\S(?:[^\\n\\$#>]*+([\\$#>])|[^\\n]*?\\x{e0b0})(?= )" In addition, finally, in order to color "command": {
"match": "(*UTF)(?-m)(?<=[\\|#\\$\\x{e0b0}])[ \\t]{0,99}(?!\\d++\\.)([\\w\\.-]++)(?=$|\\s)", to: "command": {
"match": "(*UTF)(?-m)(?<=[\\|#>\\$\\x{e0b0}])[ \\t]{0,99}(?!\\d++\\.)([\\w\\.-]++)(?=$|\\s)", I believe that after all the changes, you can use fish happily. 😄 |
Beta Was this translation helpful? Give feedback.
-
Thank you for the detailed response, works perfectly! I love that outline feature, I was almost at the point of switching back to bash haha. Thank you, love your work. |
Beta Was this translation helpful? Give feedback.
-
Anytime, I am very glad you like it. I have been working hard to prepare for the new version 2.1.0 these days, which includes X/Y/Z modem, so the reply was a bit late. WindTerm has good customization capabilities, but lacks detailed documentation. When the new features are almost developed, I will immediately invest in the preparation of the document. I believe that if there is a document, you can easily modify it yourself. 😃 |
Beta Was this translation helpful? Give feedback.
-
Hello :)
I noticed using fish that my commands don't show up in the outline. I tried modifying the regex in schemes/linux/linux.outline from:
"match": "(*UTF)(?m)^([^\\n\\$#\\x{e0b0}]*+[\\$#]|[^\\n]*?\\x{e0b0}) [ \\t]*+(?<command>(\\S[^\\n\\x{e0b0}]*+|(?!\\n)))$"
so that > is included alongside $ and #:
"match": "(*UTF)(?m)^([^\\n\\$#>\\x{e0b0}]*+[\\$#>]|[^\\n]*?\\x{e0b0}) [ \\t]*+(?<command>(\\S[^\\n\\x{e0b0}]*+|(?!\\n)))$"
but it didn't seem to work. Am I looking at the right place?
p.s. the fish prompt looks like this, though I don't know if there are some hidden bytes in there that need accounting for:
Beta Was this translation helpful? Give feedback.
All reactions