diff options
Diffstat (limited to 'lib/editorBuffer.ml')
| -rw-r--r-- | lib/editorBuffer.ml | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/editorBuffer.ml b/lib/editorBuffer.ml index e1706dd..c492b8b 100644 --- a/lib/editorBuffer.ml +++ b/lib/editorBuffer.ml | |||
| @@ -21,6 +21,18 @@ let empty = | |||
| 21 | rendered = push Sequence.empty empty; | 21 | rendered = push Sequence.empty empty; |
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | let kind b = b.kind | ||
| 25 | |||
| 26 | let string_of_kind = function | ||
| 27 | | No_name -> "[No Name]" | ||
| 28 | | Scratch -> "[Scratch]" | ||
| 29 | | File name -> name | ||
| 30 | |||
| 31 | let size e = | ||
| 32 | match e.content with | ||
| 33 | | Error _ -> (0, 0) | ||
| 34 | | Ok z -> (length z, apply_focus_or ~default:0 length z) | ||
| 35 | |||
| 24 | let render = | 36 | let render = |
| 25 | let open Sequence in | 37 | let open Sequence in |
| 26 | let tabsize = 8 in | 38 | let tabsize = 8 in |
| @@ -235,7 +247,7 @@ let unrendered_view x y h w b = | |||
| 235 | 247 | ||
| 236 | let rendered_view x y h w b = | 248 | let rendered_view x y h w b = |
| 237 | let window from len seq = Sequence.(take (drop_eagerly seq from) len) in | 249 | let window from len seq = Sequence.(take (drop_eagerly seq from) len) in |
| 238 | let cx, _ = cursor b in | 250 | let cx, _ = cursor ~rendered:false b in |
| 239 | context ~l:(cx - x) ~r:(x + h - cx) b.rendered | 251 | context ~l:(cx - x) ~r:(x + h - cx) b.rendered |
| 240 | |> to_seq | 252 | |> to_seq |
| 241 | |> Sequence.map ~f:(window y w) | 253 | |> Sequence.map ~f:(window y w) |
