droplet-editor / droplet

Block language reenvisioned as a text editor
http://droplet-editor.github.io
MIT License
225 stars 84 forks source link

Multiline sockets #56

Open sakagg opened 9 years ago

sakagg commented 9 years ago

I noticed that multiline sockets don't work. It forms a rectangle but with 3 sides. Error Message: 'Uncaught TypeError: Failed to execute 'fillRect' on 'CanvasRenderingContext2D': 4 arguments required, but only 3 present.' To recreate it - open example/example.html - with input -

for i in [1..1000]
  if i % 5 is 0
    see '''f
    i
    z
    z'''
  if i % 3 is 0
    see 'buzz'
  if i % 3 isnt 0 and i % 5 isnt 0
    see i

and try editing the socket with '''fizz'''

screenshot from 2015-05-30 17 12 20

sakagg commented 9 years ago

The multiline sockets seem to render now but there are still a couple of problems. 1) In case there is an empty line in the socket, the line numbers overlap. (4&5 in this example) droplet demo

2) The blocks don't reparse correctly. The last line is removed during a reparse. The cause may be that the last child is removed during the reparse. droplet demo-2