VI中调用自定义函数(如Do_CsTag)后,屏幕字符消失/白屏

关键字:.vimrc, call Do_CsTag(),silent! execute "!ctags -R --c-types=+p" 

如果你在vimrc文件中某个函数里(如Do_CsTag()函数)使用了:

silent execute

或者 silent! execute

则在vim中调用Do_CsTag()函数后,屏幕像被clear了一样所有字符都消失了,打开的代码也不见了。上下移动光标或许也刷出一些原来的代码,退出再进vim则又正常了。

问题出在silent函数上,你可以尝试去掉silent和silent!,则解决字符消失的问题。但新问题是每个excute命令后都要你按键确认,如果你的函数中调用了N次excute,这简直让人疯掉。

还有一种用call system(' your commands ')来替代silent! execute " your commands "的方案,不过据说使用system命令会禁掉屏幕的scrapped(废弃?)功能,因而不推荐采纳。


推荐的解决办法是在调用Do_CsTag()或你的函数后在vim 中执行:

: redraw!

消失的字符又回来了。

当然,更好的办法是把这个命令插到出问题的那个函数体的最后一句的位置上:

execute "redraw!"

class "NXOpen::CoordinateSystemCollection" 没有成员 "FindObject"“#ifndef NXOpen_ARCCOLLECTION_HXX_INCLUDED #define NXOpen_ARCCOLLECTION_HXX_INCLUDED //-------------------------------------------------------------------------- // Copyright 2024 Siemens //-------------------------------------------------------------------------- // Header for C++ interface to JA API //-------------------------------------------------------------------------- // // Source File: // ArcCollection.ja // // Generated by: // apiwrap // // WARNING: // This file is automatically generated - do not edit by hand // #ifdef _MSC_VER #pragma once #endif #include <NXOpen/NXDeprecation.hxx> #include <iterator> #include <vector> #include <NXOpen/NXString.hxx> #include <NXOpen/Callback.hxx> #include <NXOpen/TaggedObjectCollection.hxx> #include <NXOpen/TaggedObject.hxx> #include <NXOpen/libnxopencpp_exports.hxx> #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable:4996) #endif #ifdef __GNUC__ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #endif namespace NXOpen { class ArcCollection; class BasePart; class Arc; class ArcCollectionImpl; /** Represents a collection of arcs. <br> To obtain an instance of this class, refer to @link NXOpen::BasePart NXOpen::BasePart @endlink <br> <br> Created in NX3.0.0. <br> */ class NXOPENCPPEXPORT ArcCollection : public NXOpen::TaggedObjectCollection { private: ArcCollectionImpl * m_arccollection_impl; private: NXOpen::BasePart* m_owner; /// \cond NX_NO_DOC public: explicit ArcCollection(NXOpen::BasePart *owner); /// \endcond public: /**Returns the tag of this object. */ tag_t Tag() const; public: ~ArcCollection(); /** Iterator for accessing the contents of the collection. */ //lint -sem(NXOpen::ArcCollection::iterator::copy,initializer) class iterator : public std::iterator<std::forward_iterator_tag, NXOpen::Arc *> { public: /** Default constructor */ iterator() : m_context(nullptr), m_current(NULL_TAG) { // coverity[uninit_member] } //lint !e1401 m_state is not initialized /// \cond NX_NO_DOC explicit iterator(NXOpen::ArcCollection *context) : m_context(context), m_current(NULL_TAG) { // coverity[uninit_member] }//lint !e1401 m_state is not initialized /// \endcond /** Copy constructor */ iterator(const iterator &other): m_context(nullptr), m_current(NULL_TAG) { copy(other); } /** Copy constructor */ iterator &operator =(const iterator &other) { if (&other != this) copy(other); return *this; } /** Tests if the iterator objects on the left side and the right side of the operator are equal. */ bool operator ==(const iterator &other) const { return m_current == other.m_current && m_context == other.m_context; } /** Tests if the iterator objects on the left side and the right side of the operator are not equal. */ bool operator !=(const iterator &other) const { return !operator == (other); } /** Return the element currently pointed to by the iterator. */ NXOPENCPPEXPORT value_type operator * () const; /** Points the iterator to next element. */ iterator & operator ++() { next(); return *this; } /** Points the iterator to next element. */ iterator operator ++(int) { iterator tmp(*this); ++*this; return tmp; } private: void copy(const iterator &other) { m_context = other.m_context; m_current = other.m_current; for (int i = 0; i < sizeof(m_state)/sizeof(m_state[0]); i++) m_state[i] = other.m_state[i]; } NXOPENCPPEXPORT void next(); NXOpen::ArcCollection *m_context; tag_t m_current; unsigned int m_state[8]; }; /** Returns an iterator addressing the first element. */ iterator begin(); /** Returns an iterator addressing one past the last element. */ iterator end() { return iterator(this); } /** Finds the @link NXOpen::Arc NXOpen::Arc @endlink with the given identifier as recorded in a journal. An object may not return the same value as its JournalIdentifier in different versions of the software. However newer versions of the software should find the same object when FindObject is passed older versions of its journal identifier. In general, this method should not be used in handwritten code and exists to support record and playback of journals. An exception will be thrown if no object can be found with the given journal identifier. @return <br> Created in NX3.0.0. <br> <br> License requirements : None */ public: NXOpen::Arc * FindObject ( const NXString & journalIdentifier /** Journal identifier of the arc */ ); /** Finds the @link NXOpen::Arc NXOpen::Arc @endlink with the given identifier as recorded in a journal. An object may not return the same value as its JournalIdentifier in different versions of the software. However newer versions of the software should find the same object when FindObject is passed older versions of its journal identifier. In general, this method should not be used in handwritten code and exists to support record and playback of journals. An exception will be thrown if no object can be found with the given journal identifier. @return <br> Created in NX3.0.0. <br> <br> License requirements : None */ NXOpen::Arc * FindObject ( const char * journalIdentifier /** Journal identifier of the arc */ ); }; //lint !e1712 default constructor not defined for class } #ifdef _MSC_VER #pragma warning(pop) #endif #ifdef __GNUC__ #ifndef NX_NO_GCC_DEPRECATION_WARNINGS #pragma GCC diagnostic warning "-Wdeprecated-declarations" #endif #endif #undef EXPORTLIBRARY #endif ”
最新发布
10-23
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值