Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The screen blinks when I use MatchupWhereAmI?? #375

Open
0BananaBig0 opened this issue Jan 7, 2025 · 0 comments
Open

The screen blinks when I use MatchupWhereAmI?? #375

0BananaBig0 opened this issue Jan 7, 2025 · 0 comments
Labels

Comments

@0BananaBig0
Copy link

Explain the issue

My .vimrc

" for vim-matchup plugin
let g:loaded_matchit = 1
" 去掉讨厌的有关vi一致性模式,避免以前版本的一些bug和局限
set nocompatible
" 开启256色支持
set t_Co=256
" 不少插件的信息更新都会需要这个时间
set updatetime=33
" 打开文件时进行解码的猜测列表
set fileencodings=utf-8,utf-16,utf-32,ucs-bom,shift-jis,gb18030,gbk,gb2312,cp936,big5,latin1
" 把当前文件转换为当前系统编码进行处理,这里为utf-8
set encoding=utf-8
scriptencoding utf-8
" 禁止生成临时文件
set nobackup
set nowritebackup
set noswapfile
let g:plug_url_format = 'https://githubfast.com/%s.git'
call plug#begin('~/.vim/plugged')
Plug 'andymass/vim-matchup'
call plug#end()

My vim version

VIM - Vi IMproved 9.0 (2022 Jun 28, compiled May 04 2023 10:24:44)
Included patches: 1-1378, 1499

Steps

gvim a cpp file
execute MatchupWhereAmI??
the screen blinks

Maybe my previous code can be a reference?

function! ShowCurrentModule()
let l:module_line = search('module', 'bnWz')
let l:module_name = getline(l:module_line)
let l:module_end_poisition = strridx(l:module_name, '(')
if(l:module_end_poisition > 0)
let l:module_name = strpart(l:module_name, 0, l:module_end_poisition)
endif
let l:module_name = strpart(l:module_name, stridx(l:module_name, 'module')+7)
while(strpart(l:module_name, 0 , 1) ==? ' ')
let l:module_name = strpart(l:module_name, 1)
endwhile
echo 'module -->' l:module_name
endfunction
function! ShowNearestClassOrStruct()
let l:class_line = search('\n'.'class', 'bnWz')
let l:struct_line = search('\n'.'struct', 'bnWz')
if(l:class_line > l:struct_line)
let l:nearest_name = getline(l:class_line+1)
elseif(l:class_line < l:struct_line)
let l:nearest_name = getline(l:struct_line+1)
else
let l:nearest_name = 'No class/struct can be find.'
endif
let l:nearest_end_poisition = strridx(l:nearest_name, '{')
if(l:nearest_end_poisition > 0)
let l:nearest_name = strpart(l:nearest_name, 0, l:nearest_end_poisition)
endif
echo l:nearest_name
endfunction

@0BananaBig0 0BananaBig0 added the bug label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant