mirror of
https://github.com/phishingclub/phishingclub.git
synced 2026-10-12 01:58:53 +02:00
hacky vim copy mode
Signed-off-by: Ronni Skansing <rskansing@gmail.com>
This commit is contained in:
1 parent
027ea3158d
commit
1dd66074fc
3 files changed
+92
No files matched your search
@@ -4,6 +4,10 @@
|
||||
import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker';
|
||||
import jsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker';
|
||||
import { vimModeEnabled } from '$lib/store/vimMode.js';
|
||||
import {
|
||||
setupVimClipboardIntegration,
|
||||
destroyVimClipboardIntegration
|
||||
} from '$lib/utils/vimClipboard.js';
|
||||
|
||||
export let value = '';
|
||||
export let height = 'medium';
|
||||
@@ -119,6 +123,9 @@
|
||||
.then((vimModule) => {
|
||||
const statusNode = vimStatusBar;
|
||||
vimModeInstance = vimModule.initVimMode(editor, statusNode);
|
||||
|
||||
// integrate system clipboard with vim registers
|
||||
setupVimClipboardIntegration(editor, vimModeInstance, localVimMode, monaco);
|
||||
})
|
||||
.catch(() => {
|
||||
console.warn('vim mode not available - monaco-vim package not installed');
|
||||
@@ -129,6 +136,9 @@
|
||||
const destroyVimMode = () => {
|
||||
if (vimModeInstance) {
|
||||
try {
|
||||
// cleanup clipboard integration first
|
||||
destroyVimClipboardIntegration(vimModeInstance);
|
||||
|
||||
// use official monaco-vim dispose method
|
||||
vimModeInstance.dispose();
|
||||
} catch (e) {
|
||||
|
||||
Reference in new issue
Block a user