Open yuezk opened 5 years ago
If it helps here's another example that breaks syntax highlighting:
Something.prototype.generaterOutput = function(data) {
const text = `{1:F01${this.getText1()}0001000001}{2:I${this.getText2()}${this.getText3(data)}N}{3:${this.getText4()}}{4:${this.getText5()}\r\n-}`;
return text;
};
Another example, using the latest version (via vim-polyglot):
getEditURL = communication => `/communications/${this.props.contract.id}/${communication.id}`
Works fine without the newline, but as formatted by Prettier:
getEditURL = communication =>
`/communications/${this.props.contract.id}/${communication.id}`
breaks! Would love to contribute a fix, but Vim highlighting has always been a bit of a mystery to me :confused:
latest version works fine for me. See if you are using the plugin syntax highlight with the command:
:echo filter(split(execute(':scriptname'), "\n"), 'v:val =~? "javascript"')
The result might be like:
[' 29: ~/.vim/bundle/vim-javascript/ftdetect/flow.vim', ' 30: ~/..vim/bundle//vim-javascript/ftdetect/javascript.vim', '108: /usr/local/Cellar/vim/8.1.1900/share/vim/vim81/ftplugin/j
avascript.vim', '112: ~/.vim/bundle/vim-javascript/syntax/javascript.vim', '113: /usr/local/Cellar/vim/8.1.1900/share/vim/vim81/syntax/javascript.vim']
See if it lists vim-javascript
, if not, reload your .vimrc
or verify the installation.
The code syntax after a template string was highlighted as a string incorrectly. Below is the snapshot:
The minimal vim config
The test code: