Open artm opened 13 years ago
What is the difference between apostrophes and single quotes? Apostrophes follow some alphanumeric character directly?
That could get tested for when looking for "opening"/starting single quotes maybe.
I'm not sure apostrophe can always be detected. (<-- there is one in the previous sentence).
'Single quotes' border on whitespace: opening one follows a whitespace and closing one precedes whitespace.
But some apostrophes are also like that: 'tis not uncommon to do that or this: neighbours' and then continue the sentence. The latter two are indistiguishable form single quotes by the simple means we have available, but the first one (in the middle of the word) we could detect.
You cannot really handle the 3rd example (easily).
But single quotes often are not surrounded by whitespace, e.g. in foo='bar'.'baz'
. But they are surrounded by non-alphanumeric characters / punctuation.
hmm, actually the conventions differ for plain text (e.g. comments) and code. In fact I would prefer to be able to not auto-close in comments and inside strings, and keep single quote handling in the rest of the code as it is now (there are no "apostrophes" in most programming languages except for may be transpose operator in matlab/octave).
Single quotes are treated specially: when a single quote follows alpha-numeric character it doesn't trigger insertion of a closing character - it's most probably an apostrophe. But when a free single quote is typed on a line already containing such an apostrophe it is not auto-closed because it's considered a closing counterpart of the apostrophe.
Example, when typing:
I expect the second single quote to be auto-closed.
But I'm not sure this is fixable (closing single quotes are difficult to distinguish from apostrophes).