HerringtonDarkholme / yats.vim

Yet Another TypeScript Syntax: The most advanced TypeScript Syntax Highlighting in Vim
Vim License
649 stars 68 forks source link

`set iskeyword+=:` breaks highlighting #253

Closed KonradHoeffner closed 2 years ago

KonradHoeffner commented 2 years ago

Steps to reproduce

  1. Put set iskeyword+=: in ~/.vimrc
  2. Save the following file as test.ts and open it in Vim or Neovim:
const x =
{
    onClickFunction: (event) => {
        const body = `${1+1}`;
        console.log("The rest of the file is highlighted incorrectly");
    }
}
x.onClickFunction(null);

Screenshot

Expected behaviour

The line thisFunctionIsShownAsLiteralButItIsntOne(); should be highlighted as a function but it is shown as a literal.

Details and Proposed Change

This issue was originally raised at https://github.com/vim/vim/issues/9772, where @lacygoill proposed a patch to resolve this issue.

HerringtonDarkholme commented 2 years ago

: is not keyword in TypeScript. I wonder why the config is added?

KonradHoeffner commented 2 years ago

To be honest this was only added to get easier word traversal with the 'w' key, mostly for LaTeX, to delete parts of labels more easily, and I probably should make this specific to certain file types, however I thought it better to still raise it here in case this effect is not intended and helps prevent future issues with similar causes.