mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 00:47:01 +00:00
feature: client: modules: edit-names-vim: migrate to ESM
This commit is contained in:
parent
dfcbfd632e
commit
3cd3695be6
2 changed files with 14 additions and 12 deletions
|
|
@ -123,7 +123,7 @@ export default {
|
|||
[`${modules}/edit-file`]: `${dirModules}/edit-file.js`,
|
||||
[`${modules}/edit-file-vim`]: `${dirModules}/edit-file-vim.js`,
|
||||
[`${modules}/edit-names`]: `${dirModules}/edit-names.js`,
|
||||
[`${modules}/edit-names-vim`]: `${dirModules}/edit-names-vim.js`,
|
||||
[`${modules}/edit-names-vim`]: `${dirModules}/edit-names-vim.mjs`,
|
||||
[`${modules}/menu`]: `${dirModules}/menu/index.mjs`,
|
||||
[`${modules}/view`]: `${dirModules}/view/index.mjs`,
|
||||
[`${modules}/help`]: `${dirModules}/help.js`,
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
'use strict';
|
||||
import Events from '#dom/events';
|
||||
|
||||
/* global CloudCmd */
|
||||
CloudCmd.EditNamesVim = exports;
|
||||
const {CloudCmd} = globalThis;
|
||||
|
||||
const Events = require('#dom/events');
|
||||
CloudCmd.EditNamesVim = {
|
||||
init,
|
||||
show,
|
||||
hide,
|
||||
};
|
||||
const {Key} = CloudCmd;
|
||||
|
||||
const ConfigView = {
|
||||
|
|
@ -14,22 +17,20 @@ const ConfigView = {
|
|||
},
|
||||
};
|
||||
|
||||
module.exports.init = async () => {
|
||||
export async function init() {
|
||||
await CloudCmd.EditNames();
|
||||
};
|
||||
}
|
||||
|
||||
module.exports.show = () => {
|
||||
export function show() {
|
||||
Events.addKey(listener);
|
||||
|
||||
CloudCmd.EditNames
|
||||
.show(ConfigView)
|
||||
.getEditor()
|
||||
.setKeyMap('vim');
|
||||
};
|
||||
}
|
||||
|
||||
module.exports.hide = hide;
|
||||
|
||||
function hide() {
|
||||
export function hide() {
|
||||
CloudCmd.Edit.hide();
|
||||
}
|
||||
|
||||
|
|
@ -41,3 +42,4 @@ function listener(event) {
|
|||
hide();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue