文本编辑器,它告诉光标位置的索引 [英] Text Editor which tells the index of the cursor position

查看:235
本文介绍了文本编辑器,它告诉光标位置的索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个文本编辑器,该编辑器告诉我光标的位置(以便我可以确定文本范围,然后将其加载到字符串中).不幸的是,我曾尝试过的文本编辑器(TextWrangler,Aquamacs,EditPad)仅告诉我光标所在的行号以及该行的字符索引.我需要从文件开头到该点的索引-即绝对索引.可以告诉我有关编辑的任何建议(或者我已经缺乏编辑器中的技术)吗?

I need a text editor which tells me the position of the cursor (so I can determine ranges of text to then load into strings). Unfortunately the text editors ive tried (TextWrangler, Aquamacs, EditPad) only tell me the line number the cursor is on, and the character index on that line. I need the index from the beginning of the file to that point - ie the absolute index. Any recommendations for an editor (or a technique im missing in the editors ive already got) which can tell me this?

推荐答案

如果您在TextWrangler中选择了一些文本,则会在屏幕右下角找到3个数字. 第一个说选择了多少个字符,第二个说了多少个单词,最后一个说了多少行. 如果您选择从文件开头到感兴趣位置的所有内容,则第一个数字将为您提供所需的内容.

If you select some text in TextWrangler you will find 3 numbers at the bottom right of the screen. The first says how many characters are selected, the second how many words and the last how many lines. If you select everything from the beginning of the file until the position you are interested in, the first number will give you what you want.

这篇关于文本编辑器,它告诉光标位置的索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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