I take class notes on my laptop in Markdown and organize them in a locally-hosted blog. Last week was the first week I used TextMate instead of BBEdit for this, and I was occassionaly getting an extra level of indentation while typing in code blocks. For example, in one section of my notes I typed this:
| #include<vector> | | vector<int> v; // vector of zero elements | vector<int> v(250); // vector of 250 elements, initialized to zero | vector<time24> t(10); // 10 elements, all set to 00:00
Each line is indented by four spaces (the pipe characters are meant to represent the left margin), which Markdown will wrap in <pre> and <code> tags. I have TM (version 1.5 [906]) set to use soft tabs of 2 characters each.
I found that hitting the Return key after each of these lines (other than the blank one) would put the cursor on the next line with an indentation of 6 spaces instead of 4. This may be a red herring, but the extra indentation seemed to occur only after lines that had an angle-bracked pair, like <xxx>, in them. So in this excerpt
| #include<iostream> | #include<vector> | #include "d_random.h" | using namespace std;
the extra indentation occurred after the first two lines, but not after the second two.
Can anyone tell me why this is happening and what I can do to fix it?
-- Dr. Drang