daeyun / vim-matlab

Neovim plugin for MATLAB
Mozilla Public License 2.0
104 stars 19 forks source link

Matrix transpose + inline comment #6

Closed tdy closed 8 years ago

tdy commented 8 years ago

comment_pattern = re.compile(r"(^(?:[^'%]|'[^']*')*)(%.*)$") gets hung up with single apostrophes.

Raw code:

%%
A = sqrtm(B) \ C.'; % foo
Z = A * Y;          % bar

Run code:

,A = sqrtm(B) \ C.'; % foo,Z = A * Y;

Not sure if there's a regex to handle comment markers + string apostrophes + transpose apostrophes.

Thought about switching ','.join(lines) to "\n".join, but that seems to create side effects like line continuation issues (in other code, not in this example).

daeyun commented 8 years ago

Thanks for the bug report. 👍✨ Patched in 1dcee6e. Did this fix the issue?

tdy commented 8 years ago

Nice, works on my end 👍