learn-ocaml icon indicating copy to clipboard operation
learn-ocaml copied to clipboard

Unexpected editing behaviour on "struct" keyword

Open Melr0k opened this issue 4 years ago • 1 comments
trafficstars

On v. 0.12 the editor cut the struct keyword into stru and ct, concatenated with the next word. It still works if we replace the end keyword of my examples by anything. It doesn't work if it's the first or the last token (nothing else than blank before or after), and in some other cases like on my third example.

  1. Press Enter in the place of the symbol Ø:
    module Mod =
    structØ end
    
    module Mod =
      stru
        ctend
    
  2. Press the spacebar selecting the newline after struct:
    module Mod =
    struct¶
    end
    
    module Mod =
      stru ctend
    
  3. In this configuration the bug doesn't occur:
    let f = function
      | [] -> struct end
      | a::b -> g
    

Melr0k avatar Feb 11 '21 15:02 Melr0k

Looks like the automatic reindentation taking place at the wrong time, and messing up the cursor position before the character is inserted. It might be a bug in the indentation code or in Ace itself.

AltGr avatar Jul 20 '21 14:07 AltGr