package patdiff
File Diff using the Patience Diff algorithm
Install
Dune Dependency
Authors
Maintainers
Sources
patdiff-v0.16.0.tar.gz
sha256=60661ffca35e4726c40c42901774976f2634ac6a4f993a5a13f2fa458571cf16
doc/src/patdiff.kernel/file_helpers.ml.html
Source file file_helpers.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
open! Core open! Import module Trailing_newline = struct type t = [ `Missing_trailing_newline | `With_trailing_newline ] [@@deriving sexp_of] end let lines_of_contents contents = let lines = Array.of_list (String.split_lines contents) in let has_trailing_newline = let length = String.length contents in if length = 0 || Char.equal contents.[length - 1] '\n' then `With_trailing_newline else `Missing_trailing_newline in lines, has_trailing_newline ;; let warn_if_no_trailing_newline ~warn_if_no_trailing_newline_in_both ~warn ~prev:(prev_file_newline, prev_file) ~next:(next_file_newline, next_file) = match prev_file_newline, next_file_newline with | `With_trailing_newline, `With_trailing_newline -> () | `With_trailing_newline, `Missing_trailing_newline -> warn next_file | `Missing_trailing_newline, `With_trailing_newline -> warn prev_file | `Missing_trailing_newline, `Missing_trailing_newline -> if warn_if_no_trailing_newline_in_both then ( warn prev_file; warn next_file) ;; let binary_different_message ~(config : Configuration.t) ~prev_file ~prev_is_binary ~next_file ~next_is_binary = match config.location_style with | Diff | None | Separator -> sprintf !"Files %{File_name#hum}%s and %{File_name#hum}%s differ" prev_file (if prev_is_binary then " (binary)" else "") next_file (if next_is_binary then " (binary)" else "") | Omake -> sprintf !"%s\n File \"%{File_name#hum}\"\n binary files differ\n" (Format.Location_style.omake_style_error_message_start ~file:(File_name.display_name prev_file) ~line:1) next_file ;;
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>