Skip to content

Commit

Permalink
[coqide] Fix off-by-one-error in Coq loc to GTK line loc conversion.
Browse files Browse the repository at this point in the history
  • Loading branch information
ejgallego committed Mar 14, 2023
1 parent e605fdf commit 40ee30d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ide/coqide/coqOps.ml
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ open SentenceId
(* Given a Coq loc, convert it to a pair of iterators start / end in
the buffer. *)
let coq_loc_to_gtk_offset (buffer : GText.buffer) loc =
buffer#get_iter_at_byte ~line:loc.Loc.line_nb (loc.bp - loc.bol_pos),
buffer#get_iter_at_byte ~line:loc.Loc.line_nb_last (loc.ep - loc.bol_pos_last)
buffer#get_iter_at_byte ~line:(loc.Loc.line_nb - 1) (loc.bp - loc.bol_pos),
buffer#get_iter_at_byte ~line:(loc.Loc.line_nb_last - 1) (loc.ep - loc.bol_pos_last)

(** increase [uni_off] by the number of bytes until [s_uni] This can
be used to convert a character offset to byte offset if we know a
Expand Down

0 comments on commit 40ee30d

Please sign in to comment.