From 2528533d7877ecf99d880650e1c81c78190ca25d Mon Sep 17 00:00:00 2001 From: Paul Steckler Date: Fri, 19 Jan 2018 16:43:14 -0500 Subject: update location on tab switch, issue 6624 --- ide/ideutils.ml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'ide/ideutils.ml') diff --git a/ide/ideutils.ml b/ide/ideutils.ml index 0977a18906..9c5b06a0dc 100644 --- a/ide/ideutils.ml +++ b/ide/ideutils.ml @@ -69,6 +69,12 @@ let insert_xml ?(mark = `INSERT) ?(tags = []) (buf : #GText.buffer_skel) msg = let set_location = ref (function s -> failwith "not ready") +let display_location ins = + let line = ins#line + 1 in + let off = ins#line_offset + 1 in + let msg = Printf.sprintf "Line: %5d Char: %3d" line off in + !set_location msg + (** A utf8 char is either a single byte (ascii char, 0xxxxxxx) or multi-byte (with a leading byte 11xxxxxx and extra bytes 10xxxxxx) *) @@ -465,4 +471,3 @@ let browse_keyword prerr text = let u = Lazy.force url_for_keyword text in browse prerr (doc_url() ^ u) with Not_found -> prerr ("No documentation found for \""^text^"\".\n") - -- cgit v1.2.3