mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-30 19:03:01 +01:00
Add hints to Modal for available Keybindings
This commit is contained in:
parent
b52cd85c76
commit
580f4aca23
1 changed files with 22 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
||||||
import { App, SuggestModal, Notice, request, MarkdownRenderer } from 'obsidian';
|
import { App, SuggestModal, Notice, request, MarkdownRenderer, Instruction, Platform } from 'obsidian';
|
||||||
import { KhojSetting } from 'src/settings';
|
import { KhojSetting } from 'src/settings';
|
||||||
import { getVaultAbsolutePath } from 'src/utils';
|
import { getVaultAbsolutePath } from 'src/utils';
|
||||||
|
|
||||||
|
@ -27,6 +27,27 @@ export class KhojModal extends SuggestModal<SearchResult> {
|
||||||
});
|
});
|
||||||
this.rerank = false
|
this.rerank = false
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Add Hints to Modal for available Keybindings
|
||||||
|
const modalInstructions: Instruction[] = [
|
||||||
|
{
|
||||||
|
command: '↑↓',
|
||||||
|
purpose: 'to navigate',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
command: '↵',
|
||||||
|
purpose: 'to open',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
command: Platform.isMacOS ? 'cmd ↵': 'ctrl ↵',
|
||||||
|
purpose: 'to rerank',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
command: 'esc',
|
||||||
|
purpose: 'to dismiss',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
this.setInstructions(modalInstructions);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getSuggestions(query: string): Promise<SearchResult[]> {
|
async getSuggestions(query: string): Promise<SearchResult[]> {
|
||||||
|
|
Loading…
Reference in a new issue