fix(quick add magic): don't replace the prefix in every occurrence when it is present in the matched part
This commit is contained in:
@@ -109,7 +109,9 @@ const getItemsFromPrefix = (text: string, prefix: string): string[] => {
|
||||
return
|
||||
}
|
||||
|
||||
p = p.replace(prefix, '')
|
||||
if (p.substring(0, 1) === prefix) {
|
||||
p = p.substring(1)
|
||||
}
|
||||
|
||||
let itemText
|
||||
if (p.charAt(0) === '\'') {
|
||||
@@ -120,8 +122,8 @@ const getItemsFromPrefix = (text: string, prefix: string): string[] => {
|
||||
// Only until the next space
|
||||
itemText = p.split(' ')[0]
|
||||
}
|
||||
|
||||
if(itemText !== '') {
|
||||
|
||||
if (itemText !== '') {
|
||||
items.push(itemText)
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user