File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,12 @@ function this.calculate_sign_and_linenr_width()
8080 return width
8181end
8282
83+ function this .window_offset_horizontal ()
84+ local offset = vim .fn .win_screenpos (vim .fn .win_getid ())
85+ local offset_horizontal = offset [2 ]
86+ return offset_horizontal - 1
87+ end
88+
8389function this .safe_redraw ()
8490 if vim .fn .has (' nvim-0.10' ) then
8591 vim .api .nvim__redraw ({
523529-- 根据某个正则表达式是否匹配,来调用既定的get_cmp_items,并执行complete()
524530function this .cmp_regex_handler (get_cmp_items , word )
525531 local should_redraw = false
526- local start_col = vim .fn .getcmdpos () - this .calculate_sign_and_linenr_width () - # word
532+ local start_col = vim .fn .getcmdpos ()
533+ - this .calculate_sign_and_linenr_width ()
534+ - # word
535+ - this .window_offset_horizontal ()
527536 cmdline_start_cmdpos = vim .fn .getcmdpos () - # word
528537 local ok , menu_items = pcall (get_cmp_items )
529538 if not ok then
You can’t perform that action at this time.
0 commit comments