Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow disabling auto-align when traversing tables #625

Closed
nigredo-tori opened this issue Jul 21, 2021 · 3 comments
Closed

Allow disabling auto-align when traversing tables #625

nigredo-tori opened this issue Jul 21, 2021 · 3 comments

Comments

@nigredo-tori
Copy link
Contributor

nigredo-tori commented Jul 21, 2021

Expected Behavior

There should be an option to opt out of reformatting tables when moving between cells.

Actual Behavior

Moving between cells (TAB or S-TAB) realigns the whole table

Steps to Reproduce

  1. Create a markdown-mode buffer with this content (note that the table is not aligned):

    | foo | bar |
    | qux | quux |
  2. Put the cursor into any cell, and press TAB.

  3. Observe that the table was realigned.

Software Versions

  • Markdown Mode: markdown-mode, version 2.5-dev
  • Emacs: GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.23, cairo version 1.16.0) of 2021-01-18, modified by Debian
  • OS: Ubuntu Linux 21.04

Motivation

My workflow happens to include editing large markdown tables (containing descriptions of configuration files), versioned under Git. At the moment, adding new rows often leads to reformatting the whole table, which results in a diff that is larger than I would like. These diffs are annoying to review, since the diff shows that the whole table has changed, rather than a few rows. I think there should be a way to opt out of this behavior.

Possible implementation

Guarding the markdown-table-align calls in markdown-table-forward-cell and markdown-table-backward-cell with a flag should probably do the trick.

@syohex syohex mentioned this issue Jul 22, 2021
6 tasks
@syohex
Copy link
Collaborator

syohex commented Jul 22, 2021

@nigredo-tori Thanks for suggestion. How about #626 ?

@nigredo-tori
Copy link
Contributor Author

@nigredo-tori Thanks for suggestion. How about #626 ?

LGTM

@syohex
Copy link
Collaborator

syohex commented Jul 22, 2021

Thanks for checking. I have merged.

@syohex syohex closed this as completed Jul 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants