Skip to content

Commit

Permalink
Fix adding new tables. Closes #2679
Browse files Browse the repository at this point in the history
  • Loading branch information
HelioGuilherme66 committed Jan 6, 2024
1 parent 29951f9 commit 11622fc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/robotide/lib/robot/writer/filewriters.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,12 @@

def table_sorter(tables: list) -> list:
sorted_tables = []
prev_tab_line = 0
for idx, tab in enumerate(tables):
sorted_tables.append((tab._lineno, tab))
print(f"DEBUG: filewriters.py table_sorter {sorted_tables[:]}")
current_tab_line = tab._lineno if tab._lineno is not None else prev_tab_line + 1
sorted_tables.append((current_tab_line, tab))
prev_tab_line = current_tab_line
# print(f"DEBUG: filewriters.py table_sorter {sorted_tables[:]}")
sorted_result = sorted(sorted_tables)
sorted_tables = [z[1] for z in sorted_result]
return sorted_tables
Expand Down
2 changes: 1 addition & 1 deletion src/robotide/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
# limitations under the License.
#
# Automatically generated by `tasks.py`.
VERSION = 'v2.1dev1'
VERSION = 'v2.1dev2'

0 comments on commit 11622fc

Please sign in to comment.