Highlight_Matching_Pair问题解决

1 20_Highlight_Matching_Pair

当我们在用vim打开一些文件时,会经常遇到一下面Error detected while processing function <SNR>20_Highlight_Matching_Pair:的问题

1.1 提示的问题

Error detected while processing function <SNR>20_Highlight_Matching_Pair:
line   72:
E475: Invalid argument: 0
Press ENTER or type command to continue

1.2 出发问题出现的条件

1.2.1 访问到“()”时会出现

  7  * Licensed under the Apache License, Version 2.0 (the "License"). You
  8  * may not reproduce, modify or distribute this software except in
  9  * compliance with the License. You may obtain a copy of the License
 10  * at: http://www.apache.org/licenses/LICENSE-2.0

1.2.1 访问到不成对的“{}”时会出现

 26 /**
 27  * @file       xxx_main.c
 28  * @addtogroup xxx
 29  * @{
 30  */

2 解决办法

当上网查看相关的词条时,可以看到有一条[https://github.com/vim/vim/issues/3280](https://github.com/vim/vim/issues/3280)描述了出现Error detected while processing function <SNR>39_Highlight_Matching_Pair: in bash file #3280时的解决办法,
在这里插入图片描述

2.1 首先确认matchparen.vim是否最新

下面的这段解释就是让我们去检查matchparen.vim文件的时间戳,确认一下是否是最新的版本,

Please make sure that the updated matchparen.vim script is loaded.
If you execute vim without installing, old version of the script might be loaded.

To check which file is loaded, you can use the :scriptnames command.

Error detected while processing function <SNR>39_Highlight_Matching_Pair:

The message says <SNR>39, so you should check the 39th scripts in the result of :scriptnames.
If the Last Change date of the script is not 2018 Jul 3, your script is old.

vim的matchparen.vim的最新版本(或者整个runtime的最新版本)可以去https://github.com/vim/vim/tree/01164a6546b4c635daf96a1f17d1cb2d07f32a66上去查看确认。

2.2 将vim更新到最新的版本

在ubuntu上更新vim版本的方法如下所示:

sudo add-apt-repository ppa:jonathonf/vim
 
sudo apt update

sudo apt upgrade
 
sudo apt install vim

通过上面的方法我解决了Error detected while processing function <SNR>20_Highlight_Matching_Pair:的问题,当我再打开存在非对称“{}”以及在注释中含有“()”的文件时不再报该问题。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值