I noticed recently that a lot of my code has a bunch of redundant tabs at the end of the line and I was sure I didn’t put them there I’ve tracked it down to a particular way of duplicating a line. (admittedly this is a bit of a bizarre way of duplicating a line but still)
Firstly, I should say I have the default settings of ‘Don’t replace tabs with spaces’ and have tabstop set to 4.
Take a line that is tabbed in two tabs from the left-hand edge. Press to go to the end of the line. Hold and press so that you select everything up to the beginning of the line but not the two tabs. to copy the line, to insert a blank line below and return the cursor to the far left edge, then to paste the new line. You should see that the line appears to have two tabs at the end of it. The number of tabs at the end is identical to the number of tabs at the beginning of the copied line.