iets3.opensource icon indicating copy to clipboard operation
iets3.opensource copied to clipboard

Cannot add TopLevelContents at the end of a Chunk

Open eugenschindler opened this issue 2 years ago • 3 comments

How to reproduce:

  • Create a toplevel item, such as a KernelF library
  • Add an item in the contents nlist of the library, e.g. constant: val a = 1
  • Now try to press Enter after this newly added item

What happens: you cannot add an item. Worst case, it may add a multiplication to a value or do other weird stuff.

Expected behavior: you should be able to add an item after the end.

Suggested solution direction: this quirk happens due to the projectional editor of MPS. It can be solved (or at least worked around) in the same way mbeddr did for its functions: by simply adding a read-only element at the end of a TopLevel content (like the "end function" in mbeddr), e.g.:

library A end library A <-- add this as a read-only constant, then adding new contents to the contents nlist of the TopLevelContents holder will be possible.

eugenschindler avatar Oct 07 '22 18:10 eugenschindler

I don't understand what you mean. After you enter an item, you can press enter to insert one or multiple empty lines:

https://user-images.githubusercontent.com/88385944/194805645-7ed43f9e-d146-45d7-93a2-22a4fa6138c0.mov

alexanderpann avatar Oct 10 '22 05:10 alexanderpann

I observed similar behavior using Units:

Bildschirmfoto 2023-06-26 um 10 44 06

A hotfix could be to provide an intention or allow CTRL+Enter at the end of UnitReference to create a new empty line.

heikob2 avatar Jun 26 '23 08:06 heikob2

I observed similar behavior using Units:

Bildschirmfoto 2023-06-26 um 10 44 06 A hotfix could be to provide an intention or allow _CTRL+Enter_ at the end of `UnitReference` to create a new empty line.

The behavior for units is partilaly improved in PR #676. Can you check whether you can add a new line with the changes from the PR (by selecting the new grey bar as the EOL)?

HeikoBecker avatar Jun 27 '23 05:06 HeikoBecker