Skip to content

The Table Editor improvements to new line adding (to be Excel-like) #661

@aik099

Description

@aik099

Currently, in table editor mode pressing ENTER at the cursor location in a cell:

  • does:
    • (good) add a new line in the current cell
    • (bad) add a new line in other cells of the same row
  • doesn't:
    • (bad) split cell content at cursor
    • (bad) preserve contents of other cells

Table before changes:

+------------------------------+-----------+-----------+
| heading 1                    | heading 2 | heading 3 |
+==============================+===========+===========+
| .. config-property::         | line 1    |           |
|    :name: TrimRequiredFields | line 2    | line 2    |
|    :type: int                | line 3    |           |
|                              | line 4    |           |
+------------------------------+-----------+-----------+
| .. config-property::         | line 1    | 200       |
|    :name: MenuFrameWidth     | line 2    |           |
|    :type: int                | line 3    |           |
+------------------------------+-----------+-----------+

Current behavior (pressing ENTER after "line 1" in the middle cell of the 1st row)

+------------------------------+-----------+-----------+
| heading 1                    | heading 2 | heading 3 |
+==============================+===========+===========+
| .. config-property::         | line 1    |           |
|                              |           |           |
|    :name: TrimRequiredFields | line 2    | line 2    |
|    :type: int                | line 3    |           |
|                              | line 4    |           |
+------------------------------+-----------+-----------+
| .. config-property::         | line 1    | 200       |
|    :name: MenuFrameWidth     | line 2    |           |
|    :type: int                | line 3    |           |
+------------------------------+-----------+-----------+

As you can see, the content of the 1st column was affected, but it shouldn't.

Proposed behavior (pressing ENTER after "line 1" in the middle cell of the 1st row)

+------------------------------+-----------+-----------+
| heading 1                    | heading 2 | heading 3 |
+==============================+===========+===========+
| .. config-property::         | line 1    |           |
|    :name: TrimRequiredFields |           |           |
|    :type: int                | line 2    | line 2    |
|                              | line 3    |           |
|                              | line 4    |           |
+------------------------------+-----------+-----------+
| .. config-property::         | line 1    | 200       |
|    :name: MenuFrameWidth     | line 2    |           |
|    :type: int                | line 3    |           |
+------------------------------+-----------+-----------+

Proposed behavior (pressing ENTER inside "line 1" in the middle cell of the 1st row)

+-----------------------------+-----------+-----------+
| heading 1                   | heading 2 | heading 3 |
+=============================+===========+===========+
| .. config-property::        | li        |           |
|    :name: TrimRequiredFields| ne 1      |           |
|    :type: int               | line 2    | line 2    |
|                             | line 3    |           |
|                             | line 4    |           |
+-----------------------------+-----------+-----------+
| .. config-property::        | line 1    | 200       |
|    :name: MenuFrameWidth    | line 2    |           |
|    :type: int               | line 3    |           |
+-----------------------------+-----------+-----------+

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions