[wingide-users] Tab key behaviour is odd

Hugh Gibson hgibson at cix.co.uk
Wed Oct 27 04:32:00 EDT 2004


> > Hmm, we could change tab to detect if the line is already indented 
> > properly and if the cursor is in a comment to indent the text to 
> > match the last line in the comment. 
> 
> Don't make it too smart. For example, I want to put comments at the end 
> of lines of code and also line these up at a set column. So I would be 
> pressing tab without any comment, and want three spaces.

I guess this didn't make the cut. It's a bit too smart at the moment...

Just to summarize: if you detect that it's the start of a line, then tab 
should insert sufficient spaces for the current code indent level (or 
whatever you determine the indent level should be).

In all other cases it should insert sufficient spaces so that the cursor 
is at the next column which is divisible by the number of spaces in a tab 
stop.

So if you have tabs set to 8 spaces, and the cursor is on position 5, you 
should insert 3 spaces to bring it up to 8 spaces. If you press tab again 
you would insert 8 spaces to bring it up to 16 spaces.

Hugh


More information about the wingide-users mailing list