Open linlexing opened 8 years ago
What did you input? In your pasted content, there are no tabs, only spaces. Are you talking about the fact that the 'b c' on the second line is slightly more indented than those on the first line? If so, that's because the '中' is wider than an 'a' in your font, and CodeMirror tabs are represented as a (column-dependent) set of spaces.
i modify the previous post,i see the textarea represented correct.
Yes, that's a limitation of the way CodeMirror draws spaces. Fixing this would require measuring the content before each tab in advance, which would be prohibitively slow (by causing lots of browser relayouts).
The last part of an endeavor is the hardest to finish.
If you use a fixed-width Chinese font like font-family: MingLiU
, it seems like the chinese characters always take up 2 spaces and the roman characters always take up one space:
I wonder if there is a way in the code to check if a letter is a chinese or roman letter, and in that case reduce the number of spaces to indent accordingly?
input: