Skip to content

Commit a995d52

Browse files
committed
fix: multiline query reverse i search
1 parent 3d1e031 commit a995d52

8 files changed

+17
-21
lines changed

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><!--[if IE]><link rel="icon" href="favicon.ico"><![endif]--><title>vue-command</title><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"><link href="css/app.9f8616ba.css" rel="preload" as="style"><link href="js/app.a1c525ca.js" rel="preload" as="script"><link href="js/chunk-vendors.779bea67.js" rel="preload" as="script"><link href="css/app.9f8616ba.css" rel="stylesheet"><link rel="icon" type="image/png" sizes="32x32" href="img/icons/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="img/icons/favicon-16x16.png"><link rel="manifest" href="manifest.json"><meta name="theme-color" content="#4DBA87"><meta name="apple-mobile-web-app-capable" content="no"><meta name="apple-mobile-web-app-status-bar-style" content="default"><meta name="apple-mobile-web-app-title" content="vue-command"><link rel="apple-touch-icon" href="img/icons/apple-touch-icon-152x152.png"><link rel="mask-icon" href="img/icons/safari-pinned-tab.svg" color="#4DBA87"><meta name="msapplication-TileImage" content="img/icons/msapplication-icon-144x144.png"><meta name="msapplication-TileColor" content="#000000"></head><body><noscript><strong>We're sorry but vue-command doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/chunk-vendors.779bea67.js"></script><script src="js/app.a1c525ca.js"></script></body></html>
1+
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><!--[if IE]><link rel="icon" href="favicon.ico"><![endif]--><title>vue-command</title><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"><link href="css/app.9f8616ba.css" rel="preload" as="style"><link href="js/app.dd926d09.js" rel="preload" as="script"><link href="js/chunk-vendors.779bea67.js" rel="preload" as="script"><link href="css/app.9f8616ba.css" rel="stylesheet"><link rel="icon" type="image/png" sizes="32x32" href="img/icons/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="img/icons/favicon-16x16.png"><link rel="manifest" href="manifest.json"><meta name="theme-color" content="#4DBA87"><meta name="apple-mobile-web-app-capable" content="no"><meta name="apple-mobile-web-app-status-bar-style" content="default"><meta name="apple-mobile-web-app-title" content="vue-command"><link rel="apple-touch-icon" href="img/icons/apple-touch-icon-152x152.png"><link rel="mask-icon" href="img/icons/safari-pinned-tab.svg" color="#4DBA87"><meta name="msapplication-TileImage" content="img/icons/msapplication-icon-144x144.png"><meta name="msapplication-TileColor" content="#000000"></head><body><noscript><strong>We're sorry but vue-command doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/chunk-vendors.779bea67.js"></script><script src="js/app.dd926d09.js"></script></body></html>

docs/js/app.a1c525ca.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

docs/js/app.a1c525ca.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/js/app.dd926d09.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/js/app.dd926d09.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/precache-manifest.2d11d017c9a823de31482a8a376e5725.js renamed to docs/precache-manifest.b2c41c1cb32c837ace862500387a0318.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
self.__precacheManifest = (self.__precacheManifest || []).concat([
22
{
3-
"revision": "c454a7972ab46f9f3645",
3+
"revision": "3966a74cc5c4d1d877da",
44
"url": "css/app.9f8616ba.css"
55
},
66
{
7-
"revision": "c38e5e49eb18183675f3b57271cd04de",
7+
"revision": "40a57a73fcc2154939c360782562a5f2",
88
"url": "index.html"
99
},
1010
{
11-
"revision": "c454a7972ab46f9f3645",
12-
"url": "js/app.a1c525ca.js"
11+
"revision": "3966a74cc5c4d1d877da",
12+
"url": "js/app.dd926d09.js"
1313
},
1414
{
1515
"revision": "c4b1b03856dcfd265d67",

docs/service-worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");
1515

1616
importScripts(
17-
"precache-manifest.2d11d017c9a823de31482a8a376e5725.js"
17+
"precache-manifest.b2c41c1cb32c837ace862500387a0318.js"
1818
);
1919

2020
workbox.core.setCacheNameDetails({prefix: "vue-command"});

src/components/VueCommandQuery.vue

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
@keyup.arrow-left.exact="setCursorPosition($refs.queryRef.selectionStart)"
102102
@keyup.arrow-right.exact="setCursorPosition($refs.queryRef.selectionStart)"
103103
@keyup.end.exact="setCursorPosition($refs.queryRef.selectionStart)"
104-
@keyup.enter.exact="submit">': {{ reverseISearchMatch }}
104+
@keyup.enter.exact="submit">': {{ lastQuery }}
105105
</div>
106106
</div>
107107
</template>
@@ -165,7 +165,6 @@ const multilineQueryRefs = ref(null)
165165
const placeholder = ref('')
166166
const reverseISearch = ref('')
167167
const reverseISearchRef = ref(null)
168-
const reverseISearchMatch = ref('')
169168
const reverseISearchStatus = ref('reverse-i-search')
170169
const queryRef = ref(null)
171170
@@ -315,14 +314,6 @@ const resizeReverseISearch = () => {
315314
}
316315
// Cancels the current query or multiline query and creates a new query
317316
const sigint = () => {
318-
if (isReverseISearch.value) {
319-
reverseISearchMatch.value = `${reverseISearchMatch.value}^C`
320-
// Invalidate current query
321-
isOutdated.value = true
322-
appendToHistory(createQuery())
323-
return
324-
}
325-
326317
if (isEmpty(multilineQueries)) {
327318
// "setQuery" would overwrite the parent query while we only need to
328319
// overwrite the locale one
@@ -421,8 +412,13 @@ const unwatchTerminalQuery = watch(
421412
const unwatchReverseISearch = watch(reverseISearch, () => {
422413
for (const dispatchedQuery of terminal.value.dispatchedQueries) {
423414
if (dispatchedQuery.startsWith(reverseISearch.value)) {
424-
setQuery(dispatchedQuery)
425-
reverseISearchMatch.value = dispatchedQuery
415+
if (isEmpty(multilineQueries)) {
416+
setQuery(dispatchedQuery)
417+
}
418+
419+
if (!isEmpty(multilineQueries)) {
420+
setLastMultilineQuery(dispatchedQuery)
421+
}
426422
427423
// Reset status if dispatched query has been found
428424
reverseISearchStatus.value = 'reverse-i-search'

0 commit comments

Comments
 (0)