04/06/03 22:21
カーソルの下にある文字列の長さを取得する関数を書いてみた。
function! UnderCursorStringLength()
let line = getline(".")
let cur = col(".")-1
let l = strlen(line)
let backward = strpart(line, 0, cur)
let forward = strpart(line, cur, l)
let b = strlen(matchstr(backward, ".*\""))-1
let e = cur + match(forward, "\"")
echo e-b-1
endfunction