weirongxu / coc-explorer

📁 Explorer for coc.nvim
MIT License
1.14k stars 45 forks source link

[Feature] Is it possible to add a config variable like "explorer.renameWithShorterMessage" ? #569

Closed JrmLg closed 12 months ago

JrmLg commented 1 year ago

When renaming a file the message displays the name of the original file twice, the first is displayed for purely indicative purposes, the second actually allows you to rename the file. This makes the message unclear and sometimes the newlines are made right in the name of the file to be edited.

By adding a configuration boolean variable like "explorer.renameWithShorterMessage", the user could choose between a message like:

  1. The original message : "Rename: ${node.fullpath} -> ${node.fullpath}"
  2. The sortest message: "Rename: ${node.fullpath}"

In my local files, I simply changed this code :

let targetPath;
targetPath = await input(
    `Rename: ${node.fullpath} ->`,
    node.fullpath,
    "file"
);

For this one :

let targetPath;
targetPath = await input(
    `Rename: `,
    node.fullpath,
    "file"
);
weirongxu commented 1 year ago

In fact, I would recommend using the shorter name directly as the default feature, rather than adding a configuration. And PR is welcome.