• Highlight_Matching_Pair问题解决


    1 20_Highlight_Matching_Pair

    当我们在用vim打开一些文件时,会经常遇到一下面Error detected while processing function 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
    • 3
    • 4

    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
    • 3
    • 4

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

     26 /**
     27  * @file       xxx_main.c
     28  * @addtogroup xxx
     29  * @{
     30  */
    
    • 1
    • 2
    • 3
    • 4
    • 5

    2 解决办法

    当上网查看相关的词条时,可以看到有一条[https://github.com/vim/vim/issues/3280](https://github.com/vim/vim/issues/3280)描述了出现Error detected while processing function 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.
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9

    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
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7

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

  • 相关阅读:
    JavaBean 和 Spring Bean的区别
    Android Compose 文本输入框TextField使用详解
    配置iSCSI实现Linux的远程块存储
    jmeter接口自动化部署jenkins教程详解
    对组合模式的理解
    科罗廖夫年谱
    基于Spring Boot的职业生涯规划系统开题报告
    Unity程序员如何提升自己的能力
    第一个SpringBoot项目
    小程序经典案例
  • 原文地址:https://blog.csdn.net/u014100559/article/details/128183792