mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 10:30:05 +08:00
fix(vimchat): fix mouse position
This commit is contained in:
parent
af243de9a7
commit
d1926518d0
@ -115,10 +115,10 @@ function! chat#windows#open() abort
|
||||
call s:enter()
|
||||
elseif char ==# "\<LeftMouse>"
|
||||
let mouse_left_lnum = v:mouse_lnum
|
||||
let mouse_left_col = v:mouse_col
|
||||
let mouse_left_col = getmousepos().column
|
||||
elseif char ==# "\<LeftRelease>" || char ==# "\x80\xfd-"
|
||||
let mouse_left_release_lnum = v:mouse_lnum
|
||||
let mouse_left_relsese_col = v:mouse_col
|
||||
let mouse_left_relsese_col = getmousepos().column
|
||||
let selected_text = s:high_pso(mouse_left_lnum, mouse_left_col, mouse_left_release_lnum, mouse_left_relsese_col)
|
||||
elseif char ==# "\<C-c>"
|
||||
" copy select text
|
||||
@ -270,8 +270,8 @@ endfunction
|
||||
function! s:high_pso(l, c, rl, rc) abort
|
||||
let l = a:l
|
||||
let rl = a:rl
|
||||
let c = strlen(strcharpart(getline(l), 0, a:c)) + 1
|
||||
let rc = strlen(strcharpart(getline(rl), 0, a:rc)) + 1
|
||||
let c = strlen(strpart(getline(l), 0, a:c)) + 1
|
||||
let rc = strlen(strpart(getline(rl), 0, a:rc)) + 1
|
||||
call clearmatches()
|
||||
let selected_text = []
|
||||
if l ==# rl && c == rc
|
||||
|
Loading…
Reference in New Issue
Block a user