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

tablemode fixes for restruturedtext tables #315

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions ReText/tablemode.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,11 @@ def _getTableLines(doc, pos, markupClass):
row.separatorline = True
row.paddingchar = '-'
elif markupClass == ReStructuredTextMarkup:
for i, row in enumerate(rows):
if i & 1 == 0: # i is even
for row in rows:
if row.text.strip().startswith(('+-','+=')):
row.separatorline = True
row.paddingchar = '=' if (i == 2) else '-'
row.paddingchar = row.text.strip()[1]
row.text = row.text.replace('+', '|')

return rows, editedlineindex, offset

def _sortaUndoEdit(rows, editedlineindex, editsize):
Expand Down