Text Editor which tells the index of the cursor po

2019-08-07 08:28发布

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?

2条回答
放我归山
2楼-- · 2019-08-07 08:38

Emacs and Vim tell you. If you have Aquamacs, it's probably just as case of setting it up to show in your modeline:

enter image description here

As you can see - my modeline shows that the caret is on line 3, column 8 -> the (3,8)

查看更多
放荡不羁爱自由
3楼-- · 2019-08-07 08:57

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.

TextWrangler bottom right

查看更多
登录 后发表回答