When the caret is in a list at end-of-file, and the user presses Shift + ENTER, the list is automatically finalized. Before attempting a fix, please add unit tests to reproduce this scenario.