$Col tool parameter counts expanded tabs

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
nuapete
Posts: 1
Joined: Thu Feb 14, 2008 1:37 pm

$Col tool parameter counts expanded tabs

Post by nuapete »

Hi,
If I set tab spacing to 8, add a line to a doc "\t\t\tfindme", then with the cursor at the end of the line, send $Col to a tool, it says I am on col 31. I want to find the characters immediately to the left of the cursor for an autocomplete tool, so I want to find my cursors byte position in the string.

Is there any way to get the byte position of the cursor in the tool? If I used the same tab spacing for all files, I could just hardcode something to expand each tab byte to 8 cols, but I use different tab indents for different file types, but then if a word preceding a tab exceeds the tab spacing in length, the next tab will be compressed and won't take up 8 cols. :(

I can't see the tab indents stored in the registry unless it's in the binary TabStops or Properties keys. Am I missing something obvious.

Thanks for any help.

(I thought I had it there for a minute, that I could substract the count of non-tabs in a line from $Col and divide the remaining cols by the count of tabs, but of course that only works if the cursor is at the end of a line :( )
Post Reply