[BUG]: hotkeys don't work inside code files
What the essence of your question
@Falcion thank you for such an excellent tool as UNITADE.
Here: https://github.com/Falcion/UNITADE.md/issues/168#issuecomment-3938730093 it was mentioned
I use "code editor" mode for this, because it implements VS Code for your chosen extensions/files. If you are familliar with it, in this "codeview" you can just search+replace and work with many basic features of editor for VS Code.
However, by default, when UNITADE 3.2.7 is installed with a fresh instance of Obsidian 1.12.7, with txt included in Extensions and "Enable code editor module" set to on (Use default extensions set to on also), some hotkeys do not work with .txt files as listed here: https://github.com/Falcion/UNITADE.md/wiki/Hotkeys
Specifically:
"Find" CTRL+F "Find and Replace" CTRL+H "Comment Line(s)" CTRL+/ "Toggle word wrap" ALT+Z
... do not work even if the native corresponding Obsidian hotkeys are deactivated and there are no conflicting hotkeys from other plugins either.
"Insert Line After" CTRL+Enter "Copy Line Down" CTRL+D
... do work, but only after deactivating the corresponding native Obsidian hotkeys.
"Outdent Lines" CTRL+[ "Indent Lines" CTRL+]
... work with no changes needed.
What steps are needed to get them all working with .txt files?
Code of conduct
- [x] I agree to follow this project's code of conduct
Issue policy
- [x] I agree to follow this project's issue policy
They are indented to work, but I checked and they aren't. I'm converting this issue as bug-report, thanks for opening the issue!
Could you sent some information about your Obsidian's vault and UNITADE's config if possible?
Thanks @Falcion . This issue was experienced with a fairly simple vault (about 30 txt files and Omnisearch 1.27.2 also installed). UNITADE is configured very basically to utilize txt files, with settings left as default.
Hello, sorry for the long time without any answers and updates, had some time required for university and finishing diploma.
Could you try using hotkeys like "Ctrl+Alt+F" for "Search" action and etc.?
// this is keymap from source code, you can try Ctrl+Alt with all of them
const KEYMAP = new Map<string, string>([
['f', 'actions.find'],
['h', 'editor.action.startFindReplaceAction'],
['/', 'editor.action.commentLine'],
['Enter', 'editor.action.insertLineAfter'],
['[', 'editor.action.outdentLines'],
[']', 'editor.action.indentLines'],
['d', 'editor.action.copyLinesDownAction'],
]);
I accidentally caused hotkeys to work with Ctrl+Alt+KeyCode, so I want to check with you - does this combination of keys work.
@Falcion Sorry for the long delay!
Yes, CTRL+ALT+F works for search; CTRL+ALT+H works for replace, etc.
Given this, does it seem that the normal CTRL+F or CTRL+H might work in the future?
No problems with long delay, plugin was freezed in some maintenance base canathonic state, — currently plugin has some problems with vanilla Ctrl+C and Ctrl+V (copy+paste actions), so I was planning on reworking hotkey actions with new OBSIDIAN's updates. Some of updates are implemented in release v3.2.7, but plugin in constant race with some update of monaco-editor (reason of why Ctrl+C/Ctrl+V was disabled is safety release in monaco-editor) and OBSIDIAN private API.
I had in plan to "force" actions and hooks with clipboard API directly, so, I think it is possible, yeah.