mirror of
https://github.com/marktext/marktext.git
synced 2025-05-08 13:31:03 +08:00
Merge pull request #1612 from marktext/fix-1607
Match keyword not only from the beginning #1607
This commit is contained in:
commit
d19d22a643
@ -175,12 +175,12 @@ class QuickOpenCommand {
|
||||
_getInclusions = query => {
|
||||
// NOTE: This will fail on `foo.m` because we search for `foo.m.md`.
|
||||
if (MD_EXTENSION.test(query)) {
|
||||
return [query]
|
||||
return [`*${query}`]
|
||||
}
|
||||
|
||||
const inclusions = ['*.markdown', '*.mdown', '*.mkdn', '*.md', '*.mkd', '*.mdwn', '*.mdtxt', '*.mdtext', '*.text', '*.txt']
|
||||
for (let i = 0; i < inclusions.length; ++i) {
|
||||
inclusions[i] = `${query}` + inclusions[i]
|
||||
inclusions[i] = `*${query}` + inclusions[i]
|
||||
}
|
||||
return inclusions
|
||||
}
|
||||
|
@ -153,6 +153,9 @@ export default {
|
||||
}
|
||||
},
|
||||
handleInput (event) {
|
||||
if (event.isComposing) {
|
||||
return
|
||||
}
|
||||
// NOTE: We're using keyup to catch "enter" key but `ctrlKey`
|
||||
// etc doesn't work here.
|
||||
switch (event.key) {
|
||||
|
Loading…
Reference in New Issue
Block a user