Skip to content

Commit

Permalink
popup: set height
Browse files Browse the repository at this point in the history
  • Loading branch information
Yatao Li committed Feb 15, 2020
1 parent c120939 commit 3c2d7c1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ViewModels/EditorViewModel.fs
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@ type EditorViewModel(GridId: int, ?parent: EditorViewModel, ?_gridsize: GridSize
m_popupmenu_vm.SetItems(items, startPos, cursorPos, m_glyphsize.Height, bounds, editorSize)
m_popupmenu_vm.Show <- true

let h = int(m_popupmenu_vm.Height / m_glyphsize.Height)
Model.SetPopupMenuHeight h

let redraw(cmd: RedrawCommand) =
//trace "%A" cmd
match cmd with
Expand Down
7 changes: 7 additions & 0 deletions model.fs
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,13 @@ let SelectPopupMenuItem (index: int) (insert: bool) (finish: bool) =
in ()
} |> ignore

let SetPopupMenuHeight (h: int) =
trace "SetPopupMenuHeight: h=%d" h
task {
let! _ = nvim.command (sprintf "call nvim_ui_pum_set_height(%d)" h)
in ()
} |> ignore

let OnFocusLost() =
task {
let! _ = nvim.command "if exists('#FocusLost') | doautocmd <nomodeline> FocusLost | endif"
Expand Down

0 comments on commit 3c2d7c1

Please sign in to comment.