OCamlPro / ocaml-top

A simple cross-platform OCaml code editor built for top-level evaluation.
http://typerex.org/ocaml-top.html
GNU General Public License v3.0
64 stars 8 forks source link

error message caret is not aligned properly #36

Closed edwintorok closed 11 years ago

edwintorok commented 11 years ago

Type this into ocaml-top then press Run:

let () = Printf.printf "test: %s %d" 4 "test";;

This is what is printed (the caret points to the 't' in printf):

# let () = Printf.printf "test: %s %d" 4 "test"

Characters 37-38:  let () = Printf.printf "test: %s %d" 4 "test";;
                                       ^
Error: This expression has type int but an expression was expected of type
         string

If I open ocaml on the console it works correctly (caret points to '4'), note that the ocaml code is printed on a 2nd line, while in ocaml-top its on the same line.

       OCaml version 4.00.1

# let () = Printf.printf "test: %s %d" 4 "test";;
Characters 37-38:
  let () = Printf.printf "test: %s %d" 4 "test";;
                                       ^
Error: This expression has type int but an expression was expected of type
         string
AltGr commented 11 years ago

Right ; I guess I was thinking that the expression in your source should be highlighted so that you don't have to look at the caret. I'll probably remove it from the message (or replace it with some nicer highlighting).

Thanks for reporting !