MarkdownTableFormatter icon indicating copy to clipboard operation
MarkdownTableFormatter copied to clipboard

Cursor moves location when running command without selection

Open JonathanHolvey opened this issue 8 years ago • 2 comments

When running the format table command on the whole document, the cursor location moves to the start of the first table. Ideally, the cursor would not move from its original location when the command is run.

JonathanHolvey avatar Feb 05 '18 02:02 JonathanHolvey

I think this is caused by a typo in a comparison operator in markdown_table_formatter.py:

https://github.com/bitwiser73/MarkdownTableFormatter/blob/a49c7755413870066cf42c38523091abfa66eba4/markdown_table_formatter.py#L72

I've created a pull request to fix this. https://github.com/bitwiser73/MarkdownTableFormatter/pull/14

JonathanHolvey avatar Feb 06 '18 11:02 JonathanHolvey

This is the behavior I expected (no typo). It could be improved but it is not so easy to correctly update the cursor position if it is inside a formatted table. I have modified a little this behavior in another branch while cleaning this code and added a TODO.

bitwiser73 avatar Jan 20 '19 18:01 bitwiser73