需要有关通过按键宏格式化 C 注释的方法的建议
为了可视化,假设“_”实际上是一个空白。
考虑以下内容
/*!
____This_is_a_comment_about_a_function
____and_its_purpose
____and_arguments
____and_things_of_that_ilk
*/
我想做的是选择该文本块,按下按钮,然后哇哦! 就改成这样的形式了。
/*!____________________________________
____This_is_a_comment_about_a_function_
____and_its_purpose____________________
____and_arguments______________________
____and_things_of_that_ilk_____________
_____________________________________*/
为什么我需要这个?第二种形式可以缓解我在检查代码时的眼睛疲劳。对我来说,问题已经足够了,应该做点什么。
到目前为止我尝试过什么?主要是在谷歌上搜索宏示例。没有任何迹象表明可能有成效的方向。尝试理解宏IDE有点困难。有些人在这里搜索
我的问题是什么?
你能给我指向链接吗?给我一个提示吗?猜猜看?我需要研究什么才能弄清楚如何做到这一点。
感谢您的关注。
邪恶的。
for visualization, pretend the '_' is actually a blank.
Consider the following
/*!
____This_is_a_comment_about_a_function
____and_its_purpose
____and_arguments
____and_things_of_that_ilk
*/
What I would like to do is select that chunk of text, press a button, and whammo!
It is changed to this form.
/*!____________________________________
____This_is_a_comment_about_a_function_
____and_its_purpose____________________
____and_arguments______________________
____and_things_of_that_ilk_____________
_____________________________________*/
Why do I want this? The second form easies my eye strain when reviewing code. For me, it is enough of a problem that something should be done.
What have I tried so far? Mostly Googling for macro examples. Nothing has popped up which suggests a direction that might be productive. A bit of struggling to try to understand the macro ide. Some searching here on SO
What is my question?
Can you point me to links? Give me a hint? Take a guess? on what I need to study to figure out how to do this.
Thank you for your attention.
Evil.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否寻找过使用宏获取和替换选定文本的宏示例,以及相当于 字符串填充?我认为这三件事可以结合起来,在每行上循环来构建最终的字符串来替换原始选择。
伪代码:
Have you looked for macro examples of getting and replacing selected text using a macro, and the macro equivalent of string padding? I would think those three things could be combined, with a loop over each line to construct the final string to replace the original selection.
Psuedocode:
这就是我的成果。
感谢贾里德为我指明了富有成效的方向。
This is what I worked out.
Thanks to Jared for pointing me in a productive direction.