如何在记事本++中对选定的文本进行URL编码/解码 [英] How to URL-encode/decode SELECTED text in Notepad++

查看:133
本文介绍了如何在记事本++中对选定的文本进行URL编码/解码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

堆栈溢出有一个问题可以回答我的部分问题(请参阅链接) https://stackoverflow.com/a/17431971/2461910

There is a question here on stack overflow that answers PART of my question (see link) https://stackoverflow.com/a/17431971/2461910

不幸的是,此解决方案很麻烦,因为它总是对整个当前文档进行编码/解码.

Unfortunately, this solution is cumbersome, because it always encodes/decodes the ENTIRE current document.

我的问题是:如何更改该解决方案中的JavaScript,以仅修改在当前文档中选择的任何文本?

My question is: How can I change the JavaScript in that solution to only modify whatever text is SELECTED in the current document?

我尝试使用Editor.currentView.selected,但是在脚本运行时抛出错误.如果只有我能找到描述所有功能对象和属性对jN插件可见的文档.我想这是另一个问题的话题.哦,很好.

I tried using Editor.currentView.selected, but that throws an error when the script runs. If only I could find a document describing what all functions objects and properties are visible to the jN plugin. I suppose that's a topic for another question. Oh well.

推荐答案

Arg.因此,我们常常发现,就像我们已经放弃了一样,我们正处于寻找自己答案的边缘.就是这种情况.为了回答我上面表示的两种好奇心:

Arg. So often we find that just as we had given up, we were on the verge of finding our own answer. So it was in this case. To answer both my curiosities expressed above:

1)可以在该项目的主页上找到属于jN pugin的对象及其成员的列表: http://jn-npp-plugin.googlecode.com/svn/wiki/API/api.xml

1) A list of the objects and their members that are part of the jN pugin can be found on that project's home page here: http://jn-npp-plugin.googlecode.com/svn/wiki/API/api.xml

2)要访问当前文档视图中的SELECTED文本,请使用Editor.currentView.selection,而不是Editor.currentView.selected.

2) To access the SELECTED text in the current document view, use Editor.currentView.selection, not Editor.currentView.selected.

剩下的唯一问题是如何在转换后重新选择编码/解码的文本.上面的链接文档没有提供用于选择/取消选择文本的方法或属性-仅用于获取/设置已选择的文本,而在设置/更改文本时未选择该文本.

The only question this leaves is how to make the encoded/decoded text REMAIN selected after the conversion. The linked document above provides no method or property for selecting/deselecting text--only for getting/setting what text is already selected, and it gets un-selected upon setting/changing it.

这篇关于如何在记事本++中对选定的文本进行URL编码/解码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆