The VSCodeVim team prioritizes issues based on reaction count.
Set-up: empty file, insert mode, trigger with multiple sections - example below
rnc), and press tab.Enter OR Tab to select the next snippet section.GIF of problem:

The characters I typed the second section would only occur in the second section.
The first character I typed in the second section is added to the first section, and is not typed in the second section
*_Snippet used: *_
"reactNativeComponent": {
"prefix": "rnc",
"body": [
"import * as React from 'react';",
"import { StyleSheet, Text, View } from 'react-native';",
"",
"interface I${1:componentName}Props {}",
"",
"class ${1:componentName} extends React.Component<I${1:componentName}Props, void> {",
"\tpublic render() {",
"\t\treturn (",
"\t\t\t<View style={styles.container}>",
"\t\t\t\t<Text>$0</Text>",
"\t\t\t</View>",
"\t\t);",
"\t}",
"}",
"",
"const styles = StyleSheet.create({",
"\tcontainer: {} as React.ViewStyle,",
"});",
"",
"export default ${1:componentName};"
],
"description": "Creates a React Native component with styles and props"
},
This should be fixed on master from #837
Thanks @xconverge, I'll wait for master to be pushed as a release and can verify this is fixed then.
This bug is actually much severe than expected and it's still not fixed. The reason that the first T gets injected into previous position is that while in Multi Cursor Mode, we don't ever update our internal cursor position in time. So once you use tab to switch the cursor, our extension's internal cursor position is out of date. Then you type T, as it's still Insert Mode, our InsertMode handler kicks in, and inserts text at old cursor position.
Another problem is, when you use tab to switch the cursor, Code will help select all the text you previously typed in that section of the snippet. And you can always keep pressing tab to switch between all sections. Currently our internal selectionChangeHandler has a hard time with it.
I've tried multiple ways to get rid of this issue this afternoon and finally came up with one solution that looks reasonable to me, which is delegating everything back to Code if it's in Insert Mode and Multi Cursor. Will send out that PR later.
hmm I partially fixed this...but it looks like I may have broke that when you start the snippet, everything is selected, let me see
Is this still an issue? I can't seem to replicate it.
I don't think this specifically is still an issue. Snippets are still rather wonky (#3005, for example), but will be fixed by #4570.
Most helpful comment
This bug is actually much severe than expected and it's still not fixed. The reason that the first
Tgets injected into previous position is that while in Multi Cursor Mode, we don't ever update our internal cursor position in time. So once you usetabto switch the cursor, our extension's internal cursor position is out of date. Then you typeT, as it's still Insert Mode, our InsertMode handler kicks in, and inserts text at old cursor position.Another problem is, when you use
tabto switch the cursor, Code will help select all the text you previously typed in that section of the snippet. And you can always keep pressingtabto switch between all sections. Currently our internal selectionChangeHandler has a hard time with it.I've tried multiple ways to get rid of this issue this afternoon and finally came up with one solution that looks reasonable to me, which is delegating everything back to Code if it's in Insert Mode and Multi Cursor. Will send out that PR later.