lukstafi / navi-parens

VS Code extension: navigate structured code with keybindings. Markmacs: WYSIWYG for LaTeX via the preview pane.
https://marketplace.visualstudio.com/items?itemName=lukstafi.navi-parens
Other
4 stars 0 forks source link

[Flaky] In some contexts, `ctrl+alt+a` first jumps to end-of-outer-scope #13

Closed lukstafi closed 1 year ago

lukstafi commented 1 year ago

When jumping again from the same position, it behaves correctly. Using multicharacter delimiters in the outer scope -- try checking if misbehavior still happens after fixing #11 . Example of bad behavior:

let debug_navi_parens fmt dims ~indices =
  let ind1, ind2, ind3 =
    match indices with 
    | [ind1; ind2; ind3] -> ind1, ind2, ind3
    | _ -> assert false in
  let to1 = if ind1 = -1 then 0 else dims.(ind1) - 1 in
  let to2 = if ind2 = -1 then 0 else dims.(ind2) - 1 in
  let to3 = if ind3 = -1 then 0 else dims.(ind3) - 1 in
  let open Caml.Format in
  for i = 0 to to1 do
    for j = 0 to to2 do
      for k = 0 to to3 do
        if k <> to3 then (pp@_print_tab fmt (); fprintf fmt "|")
        else (
          (* FIXME: sort out if we need [pp_print_tbreak fmt 0 0]. *)

        )
      done
    done
  done;
  pp_print_newline fmt ()^

The target should be: if k <> to3 then (^pp@_print_tab fmt (); fprintf fmt "|")

lukstafi commented 1 year ago

This only happens in Semantic block mode, but also in JumpToBracket brackets mode: SEM/RAW and SEM/JTB. Therefore, it cannot be caused by multicharacter delimiters.

lukstafi commented 1 year ago

I believe this is fixed in version 1.2.0.