|
101 | 101 | @keyup.arrow-left.exact="setCursorPosition($refs.queryRef.selectionStart)"
|
102 | 102 | @keyup.arrow-right.exact="setCursorPosition($refs.queryRef.selectionStart)"
|
103 | 103 | @keyup.end.exact="setCursorPosition($refs.queryRef.selectionStart)"
|
104 |
| - @keyup.enter.exact="submit">': {{ local.query }} |
| 104 | + @keyup.enter.exact="submit">': {{ reverseISearchMatch }} |
105 | 105 | </div>
|
106 | 106 | </div>
|
107 | 107 | </template>
|
@@ -165,6 +165,7 @@ const multilineQueryRefs = ref(null)
|
165 | 165 | const placeholder = ref('')
|
166 | 166 | const reverseISearch = ref('')
|
167 | 167 | const reverseISearchRef = ref(null)
|
| 168 | +const reverseISearchMatch = ref('') |
168 | 169 | const reverseISearchStatus = ref('reverse-i-search')
|
169 | 170 | const queryRef = ref(null)
|
170 | 171 |
|
@@ -314,6 +315,14 @@ const resizeReverseISearch = () => {
|
314 | 315 | }
|
315 | 316 | // Cancels the current query or multiline query and creates a new query
|
316 | 317 | 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 | +
|
317 | 326 | if (isEmpty(multilineQueries)) {
|
318 | 327 | // "setQuery" would overwrite the parent query while we only need to
|
319 | 328 | // overwrite the locale one
|
@@ -413,6 +422,7 @@ const unwatchReverseISearch = watch(reverseISearch, () => {
|
413 | 422 | for (const dispatchedQuery of terminal.value.dispatchedQueries) {
|
414 | 423 | if (dispatchedQuery.startsWith(reverseISearch.value)) {
|
415 | 424 | setQuery(dispatchedQuery)
|
| 425 | + reverseISearchMatch.value = dispatchedQuery |
416 | 426 |
|
417 | 427 | // Reset status if dispatched query has been found
|
418 | 428 | reverseISearchStatus.value = 'reverse-i-search'
|
|
0 commit comments