Skip to content

Commit

Permalink
parse_grid_line: handle wrap #263
Browse files Browse the repository at this point in the history
neovim 0.92 added this to the event. This appears to be useful for the
TUI only, so for now let's just fix the pattern matching.
  • Loading branch information
meluskyc committed Sep 18, 2023
1 parent 2e4087d commit 70c4c53
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions def.fs
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ type GridLine =
row: int
col_start: int
cells: GridCell[]
wrap: bool
}

[<Struct>]
Expand Down Expand Up @@ -624,8 +625,11 @@ let parse_grid_cell (x: obj) =

let parse_grid_line (x: obj) =
match x with
| ObjArray [| (Integer32 grid); (Integer32 row) ; (Integer32 col_start) ; P(parse_grid_cell)cells |]
-> Some {grid = grid; row=row; col_start=col_start; cells=cells}
| ObjArray [| (Integer32 grid); (Integer32 row) ; (Integer32 col_start) ; P(parse_grid_cell)cells ; (Bool wrap) |]
-> Some {grid = grid; row=row; col_start=col_start; cells=cells; wrap=wrap}
// neovim < 0.92 doesn't pass wrap
| ObjArray [| (Integer32 grid); (Integer32 row) ; (Integer32 col_start) ; P(parse_grid_cell)cells |]
-> Some {grid = grid; row=row; col_start=col_start; cells=cells; wrap=false}
| _ -> None

let parse_win_pos (x: obj) =
Expand Down

0 comments on commit 70c4c53

Please sign in to comment.