PseudocodeEditor / editor

The codemirror 6 editor for CIE spec Pseudocode
https://editor.pseudonaja.app
21 stars 2 forks source link

No unindent after ELSE statement #8

Closed hugomarfani closed 2 years ago

hugomarfani commented 2 years ago

Describe the bug When typing ENDIF after an ELSE statement the code does not auto-unindent

To Reproduce Steps to reproduce the behavior:

  1. Type in the code:.
    IF ifFull() = TRUE THEN
        RETURN FALSE
    ELSE
        data[free] <- dataToAdd
        tempPointer <- pointers[free]
        pointers[free] <- head
        head <- free
        free <- tempPointer
        pointers[tail] <- free
        RETURN TRUE
        ENDIF
  2. Hit enter after ENDIF

Expected behavior The editor does not unindent after enter has been pressed

Screenshots CleanShot 2022-03-30 at 9 42 55

hugomarfani commented 2 years ago

@Coding-Cactus any idea what's going on?

Coding-Cactus commented 2 years ago

The auto indent check occurs once you type the word, rather than when you add whitespace after it. If you were to remove the F and retype it, it should indent.

Saim-Khan1 commented 2 years ago

Yep, works fine for me image

hugomarfani commented 2 years ago

Ah yes all good!