MARKERTYPE.MARKER_READONLY禁用整个文件的替换 [英] MARKERTYPE.MARKER_READONLY disables Replace for the whole file
问题描述
我正在为Visual Studio 2010进行扩展. 我正在使用该功能
I'm working on an extension for Visual Studio 2010. I'm using the function
IVsTextLines.CreateLineMarker((int)MARKERTYPE.MARKER_READONLY,...
IVsTextLines.CreateLineMarker((int)MARKERTYPE.MARKER_READONLY, ...
使文本缓冲区中的某些语法元素为只读. 导致了一个问题:查找并替换"命令认为整个文件是只读的. 在查找和替换"对话框中,替换和替换所有"按钮被禁用.
to make some syntax elements in a text buffer read-only. This causes a problem: it makes the Find and Replace command think that the entire file is read-only. In the Find and Replace dialog, the Replace and Replace All buttons are disabled.
要验证我是否正确创建了标记:我使用了MARKER_BOOKMARK而不是只读标记. 该类型不会对查找并替换"造成任何问题.
To verify that I was creating the markers correctly: instead of read-only markers, I used MARKER_BOOKMARK. That type did not cause any problem with Find and Replace.
有人见过这个问题,和/或有解决办法吗?
Has anybody seen this problem, and/or have a solution?
(要在这样的缓冲区中进行替换,您必须采取一些技巧,例如在选区"或所有文件"中进行替换.)
(To Replace in a buffer like this, you have to resort to tricks like replacing in a Selection, or in All Files.)
推荐答案
在CreateLineMarker中,行/索引范围要传递什么?
What are you passing for your line/index spans in CreateLineMarker?
Ryan
这篇关于MARKERTYPE.MARKER_READONLY禁用整个文件的替换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!