本文介绍了如何使用Jedit作为7zip的外部编辑器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Jedit 作为 7zip 的外部编辑器.

I am trying to use Jedit as an external editor to 7zip.

7zip 将 Jedit 作为外部编辑器打开,但只有在 Jedit 之前未运行时才会保存编辑.我可能应该将 -noserver 或 -newview 命令行参数作为外部编辑器传递给 Jedit,但是当我这样做时,7zip 会出现错误:无法启动编辑器".

7zip opens Jedit as external editor however edits are only saved back if Jedit was not running previously. I probably should pass -noserver or -newview command line arguments to Jedit as an external editor, but when I do that 7zip gives an error: 'Cannot start editor'.

如何使用 Jedit 作为 7zip 的外部编辑器,以便将编辑保存回来?

How could I use Jedit as an external editor to 7zip so that edits are saved back?

推荐答案

您不能为在 7-Zip 中配置的程序提供参数.

You cannot give arguments to the programs you configure in 7-Zip.

您需要做的是创建一个从 7-Zip 调用的批处理文件,该文件设置您想要的选项并转发所有其他参数.

What you need to do is to create a batch file that you call from 7-Zip that sets the options you want to have and that forwards all other arguments.

不想想要做的是,如果 jEdit 实例已经在运行,则使用 -noserver 选项而不使用 -settings 选项.当前,如果您在同一个设置目录中启动两个真正分离的实例,jEdit 的行为不会很好,因为第一个在第二个实例启动后写入特定设置文件拥有"它,而另一个不再保存它,所以您的位置、最近的文件、更改的设置等将不会被持久化,并且没有关于此的显着警告.

What you do NOT want to do is to use the -noserver option without a -settings option if a jEdit instance is already running. Currently jEdit does not behave nice if you start two really separated instances in the same settings directory, as the first that writes a specific settings file after the second instance is started "owns" it and the other just does not save it anymore, so your positions, recent files, changed settings etc. will not be persisted and there is no prominent warning about this.

应该想要做的是使用 -wait 选项,该选项恰好适用于这些情况.

What you DO want to do is to use the -wait option, that is present for exactly those cases.

因此创建一个文件 jedit-wait.bat(例如在 jEdit 安装目录中),内容为 @jedit -wait %*,然后将该批处理文件配置为 7-Zip 编辑器.这也是我设置它的方式,它的工作原理与预期完全一样.唯一有点不好的是,只要您编辑文件,就会有一个黑色的命令行窗口坐在那里,但这并不像听起来那么令人不安,至少对我来说是这样.

So create a file jedit-wait.bat (e. g. in the jEdit installation directory) with content @jedit -wait %* and then configure that batch file as 7-Zip editor. That is also how I have set it up and it works exactly like expected. The only slightly unnice thing is, that you will have a black command line window sitting there as long as you edit the file, but that is not as disturbing as it sounds, at least to me.

这篇关于如何使用Jedit作为7zip的外部编辑器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-24 12:21