Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[yokurang] Added a zipper implementation and integrated it into interactive_viewer.ml accompanied with unit tests and an mli file. #23

Closed
wants to merge 5 commits into from

Conversation

yokurang
Copy link
Collaborator

@yokurang yokurang commented Mar 5, 2024

Solution to issues #4 and #6

Run

dune clean && dune build

and test using

dune exec -- diffcessible diff.example

One concern I have is that I am unsure whether my implementation of using the zipper accomplished the task of a more efficient experience for very large diff files. Is there a way for me to check this? I tried manually traversing a large diff file and comparing using my changes and the old changes, but perhaps my diff file wasn't large enough to feel the difference?

Any recommendations or thought would be appreciated. Thank you !

On a further note, I added a helper function for navigating between Next and Prev patches. This navigation has a built in check to ensure that we only navigate Next or Prev if there are elements to navigate to. Note the if statements in the code snippet below. This is my solution to issue #4

let navigate direction zipper_of_patches =
  let z = Lwd.peek zipper_of_patches in
  match direction with
  | `Next ->
      if List.length z.after > 0 then begin
        Lwd.set zipper_of_patches (next_zipper z);
        Lwd.set index_v ((Lwd.peek index_v) + 1)
      end
  | `Prev ->
      if List.length z.before > 0 then begin
        Lwd.set zipper_of_patches (prev_zipper z);
        Lwd.set index_v ((Lwd.peek index_v) - 1)
      end

@Julow @panglesd

@yokurang yokurang closed this by deleting the head repository Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant