feature: client: modules: edit-file-vim: migrate to ESM

This commit is contained in:
coderiaser 2026-02-03 01:07:24 +02:00
parent 327ac9dee6
commit c9f57c5f20
2 changed files with 13 additions and 12 deletions

View file

@ -121,7 +121,7 @@ export default {
'cloudcmd': `${dir}/cloudcmd.mjs`,
[`${modules}/edit`]: `${dirModules}/edit.mjs`,
[`${modules}/edit-file`]: `${dirModules}/edit-file.js`,
[`${modules}/edit-file-vim`]: `${dirModules}/edit-file-vim.js`,
[`${modules}/edit-file-vim`]: `${dirModules}/edit-file-vim.mjs`,
[`${modules}/edit-names`]: `${dirModules}/edit-names.js`,
[`${modules}/edit-names-vim`]: `${dirModules}/edit-names-vim.mjs`,
[`${modules}/menu`]: `${dirModules}/menu/index.mjs`,

View file

@ -1,9 +1,12 @@
'use strict';
import * as Events from '#dom/events';
/* global CloudCmd */
CloudCmd.EditFileVim = exports;
const {CloudCmd} = globalThis;
const Events = require('#dom/events');
CloudCmd.EditFileVim = {
init,
show,
hide,
};
const {Key} = CloudCmd;
@ -15,11 +18,11 @@ const ConfigView = {
},
};
module.exports.init = async () => {
export async function init() {
await CloudCmd.EditFile();
};
}
module.exports.show = async () => {
export async function show() {
Events.addKey(listener);
const editFile = await CloudCmd.EditFile.show(ConfigView);
@ -27,11 +30,9 @@ module.exports.show = async () => {
editFile
.getEditor()
.setKeyMap('vim');
};
}
module.exports.hide = hide;
function hide() {
export function hide() {
CloudCmd.Edit.hide();
}