本文整理汇总了C#中IVimTextBuffer类的典型用法代码示例。如果您正苦于以下问题:C# IVimTextBuffer类的具体用法?C# IVimTextBuffer怎么用?C# IVimTextBuffer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IVimTextBuffer类属于命名空间,在下文中一共展示了IVimTextBuffer类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: CreateVimBufferData
/// <summary>
/// This is not technically a Mock but often we want to create it with mocked
/// backing values
/// </summary>
/// <returns></returns>
public static VimBufferData CreateVimBufferData(
IVimTextBuffer vimTextBuffer,
ITextView textView,
IJumpList jumpList = null,
IStatusUtil statusUtil = null,
IUndoRedoOperations undoRedoOperations = null,
IVimWindowSettings windowSettings = null,
IWordUtil wordUtil = null,
MockRepository factory = null)
{
factory = factory ?? new MockRepository(MockBehavior.Strict);
statusUtil = statusUtil ?? factory.Create<IStatusUtil>().Object;
undoRedoOperations = undoRedoOperations ?? factory.Create<IUndoRedoOperations>().Object;
jumpList = jumpList ?? factory.Create<IJumpList>().Object;
wordUtil = wordUtil ?? factory.Create<IWordUtil>().Object;
windowSettings = windowSettings ?? factory.Create<IVimWindowSettings>().Object;
return new VimBufferData(
jumpList,
textView,
statusUtil,
undoRedoOperations,
vimTextBuffer,
windowSettings,
wordUtil);
}
开发者ID:sehe,项目名称:VsVim,代码行数:30,代码来源:MockObjectFactory.cs
示例2: CreateVimBufferData
/// <summary>
/// Create a new instance of VimBufferData. Centralized here to make it easier to
/// absorb API changes in the Unit Tests
/// </summary>
protected IVimBufferData CreateVimBufferData(
IVimTextBuffer vimTextBuffer,
ITextView textView,
IStatusUtil statusUtil = null,
IJumpList jumpList = null,
IUndoRedoOperations undoRedoOperations = null,
IVimWindowSettings windowSettings = null,
IWordUtil wordUtil = null)
{
jumpList = jumpList ?? new JumpList(textView, _bufferTrackingService);
statusUtil = statusUtil ?? new StatusUtil();
undoRedoOperations = undoRedoOperations ?? CreateUndoRedoOperations(statusUtil);
windowSettings = windowSettings ?? new WindowSettings(vimTextBuffer.GlobalSettings);
wordUtil = wordUtil ?? WordUtilFactory.GetWordUtil(vimTextBuffer.TextBuffer);
return new VimBufferData(
vimTextBuffer,
textView,
windowSettings,
jumpList,
statusUtil,
undoRedoOperations,
wordUtil);
}
开发者ID:cloudstrifegit,项目名称:VsVim,代码行数:27,代码来源:VimTestBase.cs
示例3: CreateVimBufferData
/// <summary>
/// Create a new instance of VimBufferData. Centralized here to make it easier to
/// absorb API changes in the Unit Tests
/// </summary>
protected IVimBufferData CreateVimBufferData(
IVimTextBuffer vimTextBuffer,
ITextView textView,
IStatusUtil statusUtil = null,
IJumpList jumpList = null,
IVimWindowSettings windowSettings = null,
IWordUtil wordUtil = null)
{
jumpList = jumpList ?? new JumpList(textView, BufferTrackingService);
statusUtil = statusUtil ?? new StatusUtil();
windowSettings = windowSettings ?? new WindowSettings(vimTextBuffer.GlobalSettings);
wordUtil = wordUtil ?? WordUtil;
return new VimBufferData(
vimTextBuffer,
textView,
windowSettings,
jumpList,
statusUtil,
wordUtil);
}
开发者ID:Deleriumdoll,项目名称:VsVim,代码行数:24,代码来源:VimTestBase.cs
示例4: BufferInfo
internal BufferInfo(IVimTextBuffer vimTextBuffer, string name = "<unnamed>")
{
_vimTextBuffer = vimTextBuffer;
_name = name;
}
开发者ID:jaredswarts55,项目名称:VsVim,代码行数:5,代码来源:ViewInfo.cs
示例5: Create
protected void Create(params string[] lines)
{
_vimHost = (MockVimHost)Vim.VimHost;
_textView = CreateTextView(lines);
_textBuffer = _textView.TextBuffer;
_vimTextBuffer = Vim.CreateVimTextBuffer(_textBuffer);
_localSettings = _vimTextBuffer.LocalSettings;
var foldManager = CreateFoldManager(_textView);
_factory = new MockRepository(MockBehavior.Loose);
_statusUtil = _factory.Create<IStatusUtil>();
_bulkOperations = new TestableBulkOperations();
var vimBufferData = CreateVimBufferData(
_vimTextBuffer,
_textView,
statusUtil: _statusUtil.Object);
_jumpList = vimBufferData.JumpList;
_windowSettings = vimBufferData.WindowSettings;
_vimData = Vim.VimData;
_macroRecorder = Vim.MacroRecorder;
_globalSettings = Vim.GlobalSettings;
var operations = CreateCommonOperations(vimBufferData);
_motionUtil = new MotionUtil(vimBufferData, operations);
_commandUtil = new CommandUtil(
vimBufferData,
_motionUtil,
operations,
foldManager,
new InsertUtil(vimBufferData, operations),
_bulkOperations);
}
开发者ID:soundarmoorthy,项目名称:VsVim,代码行数:35,代码来源:CommandUtilTest.cs
示例6: Create
private void Create(KeyRemapMode countKeyRemapMode, params string[] lines)
{
_textView = CreateTextView(lines);
_vimTextBuffer = Vim.CreateVimTextBuffer(_textView.TextBuffer);
_registerMap = Vim.RegisterMap;
var vimBufferData = CreateVimBufferData(
_vimTextBuffer,
_textView);
_commandUtil = CreateCommandUtil(vimBufferData);
var incrementalSearch = new IncrementalSearch(
vimBufferData,
CommonOperationsFactory.GetCommonOperations(vimBufferData));
var motionCapture = new MotionCapture(vimBufferData, incrementalSearch);
_runnerRaw = new CommandRunner(
_textView,
_registerMap,
motionCapture,
vimBufferData.LocalSettings,
_commandUtil,
new StatusUtil(),
VisualKind.Character,
countKeyRemapMode);
_runner = _runnerRaw;
}
开发者ID:aesire,项目名称:VsVim,代码行数:25,代码来源:CommandRunnerTest.cs
示例7: Create
public void Create(params string[] lines)
{
_context = new TestableSynchronizationContext();
SynchronizationContext.SetSynchronizationContext(_context);
_textView = CreateTextView(lines);
_textBuffer = _textView.TextBuffer;
_vimBuffer = Vim.CreateVimBuffer(_textView);
_vimBuffer.SwitchMode(ModeKind.Normal, ModeArgument.None);
_vimTextBuffer = _vimBuffer.VimTextBuffer;
_registerMap = _vimBuffer.RegisterMap;
_globalSettings = _vimBuffer.LocalSettings.GlobalSettings;
Assert.IsTrue(_context.IsEmpty);
// Need to make sure it's focused so macro recording will work
((MockVimHost)_vimBuffer.Vim.VimHost).FocusedTextView = _textView;
}
开发者ID:davislg,项目名称:VsVim,代码行数:16,代码来源:VisualModeIntegrationTest.cs
示例8: Create
protected void Create(ITextView textView)
{
_textView = textView;
_textBuffer = textView.TextBuffer;
_snapshot = _textBuffer.CurrentSnapshot;
_textBuffer.Changed += delegate { _snapshot = _textBuffer.CurrentSnapshot; };
_vimTextBuffer = Vim.CreateVimTextBuffer(_textBuffer);
_statusUtil = new Mock<IStatusUtil>(MockBehavior.Strict);
var vimBufferData = CreateVimBufferData(_vimTextBuffer, _textView, statusUtil: _statusUtil.Object);
_globalSettings = vimBufferData.LocalSettings.GlobalSettings;
_localSettings = vimBufferData.LocalSettings;
_markMap = vimBufferData.Vim.MarkMap;
_vimData = vimBufferData.Vim.VimData;
_search = vimBufferData.Vim.SearchService;
var wordNavigator = CreateTextStructureNavigator(_textView.TextBuffer, WordKind.NormalWord);
_motionUtil = new MotionUtil(vimBufferData);
}
开发者ID:kcprogrammer,项目名称:VsVim,代码行数:18,代码来源:MotionUtilTest.cs
示例9: Create
protected virtual void Create(params string[] lines)
{
_textView = CreateTextView(lines);
_textBuffer = _textView.TextBuffer;
_vimBuffer = Vim.CreateVimBuffer(_textView);
_vimBuffer.ErrorMessage +=
(_, message) =>
{
if (_assertOnErrorMessage)
{
throw new Exception("Error Message: " + message.Message);
}
};
_vimBuffer.WarningMessage +=
(_, message) =>
{
if (_assertOnWarningMessage)
{
throw new Exception("Warning Message: " + message.Message);
}
};
_vimBufferData = _vimBuffer.VimBufferData;
_vimTextBuffer = _vimBuffer.VimTextBuffer;
_normalMode = _vimBuffer.NormalMode;
_keyMap = _vimBuffer.Vim.KeyMap;
_localSettings = _vimBuffer.LocalSettings;
_globalSettings = _localSettings.GlobalSettings;
_windowSettings = _vimBuffer.WindowSettings;
_jumpList = _vimBuffer.JumpList;
_vimHost = (MockVimHost)_vimBuffer.Vim.VimHost;
_vimHost.BeepCount = 0;
_vimData = Vim.VimData;
_foldManager = FoldManagerFactory.GetFoldManager(_textView);
_clipboardDevice = (TestableClipboardDevice)CompositionContainer.GetExportedValue<IClipboardDevice>();
// Many of the operations operate on both the visual and edit / text snapshot
// simultaneously. Ensure that our setup code is producing a proper IElisionSnapshot
// for the Visual portion so we can root out any bad mixing of instances between
// the two
Assert.True(_textView.VisualSnapshot is IElisionSnapshot);
Assert.True(_textView.VisualSnapshot != _textView.TextSnapshot);
}
开发者ID:Deleriumdoll,项目名称:VsVim,代码行数:42,代码来源:NormalModeIntegrationTest.cs
示例10: Create
protected void Create(params string[] lines)
{
_statusUtil = new TestableStatusUtil();
_vimData = Vim.VimData;
_vimBufferData = CreateVimBufferData(
CreateTextView(lines),
statusUtil: _statusUtil);
_vimBuffer = CreateVimBuffer(_vimBufferData);
_vimTextBuffer = _vimBufferData.VimTextBuffer;
_localSettings = _vimBufferData.LocalSettings;
_globalSettings = _localSettings.GlobalSettings;
_textBuffer = _vimBufferData.TextBuffer;
_textView = _vimBufferData.TextView;
_interpreter = new global::Vim.Interpreter.Interpreter(
_vimBuffer,
CommonOperationsFactory.GetCommonOperations(_vimBufferData),
FoldManagerFactory.GetFoldManager(_vimBufferData.TextView),
new FileSystem(),
BufferTrackingService);
_keyMap = Vim.KeyMap;
}
开发者ID:ultonis,项目名称:VsVim,代码行数:21,代码来源:InterpreterTest.cs
示例11: Create
public void Create(params string[] lines)
{
var tuple = EditorUtil.CreateTextViewAndEditorOperations(lines);
_textView = tuple.Item1;
_textBuffer = _textView.TextBuffer;
var service = EditorUtil.FactoryService;
_vimBuffer = service.Vim.CreateVimBuffer(_textView);
_vimBuffer.ErrorMessage +=
(_, message) =>
{
if (_assertOnErrorMessage)
{
Assert.Fail("Error Message: " + message);
}
};
_vimBuffer.WarningMessage +=
(_, message) =>
{
if (_assertOnWarningMessage)
{
Assert.Fail("Warning Message: " + message);
}
};
_vimTextBuffer = _vimBuffer.VimTextBuffer;
_keyMap = _vimBuffer.Vim.KeyMap;
_globalSettings = _vimBuffer.LocalSettings.GlobalSettings;
_jumpList = _vimBuffer.JumpList;
_vimHost = (MockVimHost)_vimBuffer.Vim.VimHost;
_vimHost.BeepCount = 0;
_vimData = service.Vim.VimData;
_foldManager = EditorUtil.FactoryService.FoldManagerFactory.GetFoldManager(_textView);
// Many of the operations operate on both the visual and edit / text snapshot
// simultaneously. Ensure that our setup code is producing a proper IElisionSnapshot
// for the Visual portion so we can root out any bad mixing of instances between
// the two
Assert.IsTrue(_textView.VisualSnapshot is IElisionSnapshot);
Assert.IsTrue(_textView.VisualSnapshot != _textView.TextSnapshot);
}
开发者ID:GunioRobot,项目名称:VsVim,代码行数:39,代码来源:NormalModeIntegrationTest.cs
示例12: Create
private void Create(params string[] lines)
{
_vimHost = (MockVimHost)Vim.VimHost;
_textView = CreateTextView(lines);
_textBuffer = _textView.TextBuffer;
_vimTextBuffer = Vim.CreateVimTextBuffer(_textBuffer);
_localSettings = _vimTextBuffer.LocalSettings;
_foldManager = FoldManagerFactory.GetFoldManager(_textView);
_factory = new MockRepository(MockBehavior.Loose);
_statusUtil = _factory.Create<IStatusUtil>();
_smartIdentationService = _factory.Create<ISmartIndentationService>();
var vimBufferData = CreateVimBufferData(
_vimTextBuffer,
_textView,
statusUtil: _statusUtil.Object);
_jumpList = vimBufferData.JumpList;
_windowSettings = vimBufferData.WindowSettings;
_vimData = Vim.VimData;
_macroRecorder = Vim.MacroRecorder;
_registerMap = Vim.RegisterMap;
_globalSettings = Vim.GlobalSettings;
var operations = CommonOperationsFactory.GetCommonOperations(vimBufferData);
_motionUtil = new MotionUtil(vimBufferData);
_commandUtil = new CommandUtil(
vimBufferData,
_motionUtil,
operations,
_smartIdentationService.Object,
_foldManager,
new InsertUtil(vimBufferData, operations));
}
开发者ID:philipmat,项目名称:VsVim,代码行数:36,代码来源:CommandUtilTest.cs
示例13: Create
public void Create(params string[] lines)
{
_context = new TestableSynchronizationContext();
SynchronizationContext.SetSynchronizationContext(_context);
var tuple = EditorUtil.CreateTextViewAndEditorOperations(lines);
_textView = tuple.Item1;
_textBuffer = _textView.TextBuffer;
var service = EditorUtil.FactoryService;
_buffer = service.Vim.CreateVimBuffer(_textView);
_buffer.SwitchMode(ModeKind.Normal, ModeArgument.None);
_vimTextBuffer = _buffer.VimTextBuffer;
_registerMap = _buffer.RegisterMap;
_globalSettings = _buffer.LocalSettings.GlobalSettings;
Assert.IsTrue(_context.IsEmpty);
// Need to make sure it's focused so macro recording will work
((MockVimHost)_buffer.Vim.VimHost).FocusedTextView = _textView;
}
开发者ID:sehe,项目名称:VsVim,代码行数:18,代码来源:VisualModeIntegrationTest.cs
示例14: Create
private void Create(params string[] lines)
{
_vimTextBuffer = CreateVimTextBuffer(lines);
_textBuffer = _vimTextBuffer.TextBuffer;
}
开发者ID:kcprogrammer,项目名称:VsVim,代码行数:5,代码来源:VimTextBufferTest.cs
示例15: Create
private void Create(params string[] lines)
{
_textView = CreateTextView(lines);
_vimTextBuffer = Vim.CreateVimTextBuffer(_textView.TextBuffer);
_registerMap = Vim.RegisterMap;
var vimBufferData = CreateVimBufferData(
_vimTextBuffer,
_textView);
_commandUtil = VimUtil.CreateCommandUtil(vimBufferData);
var motionCapture = VimUtil.CreateMotionCapture(vimBufferData);
_runnerRaw = new CommandRunner(
_textView,
_registerMap,
motionCapture,
_commandUtil,
new StatusUtil(),
VisualKind.Character);
_runner = _runnerRaw;
}
开发者ID:GunioRobot,项目名称:VsVim,代码行数:20,代码来源:CommandRunnerTest.cs
示例16: Create
private void Create(params string[] lines)
{
_textView = CreateTextView(lines);
_textBuffer = _textView.TextBuffer;
var vimBufferData = CreateVimBufferData(_textView);
_vimTextBuffer = vimBufferData.VimTextBuffer;
_rangeUtil = new RangeUtil(vimBufferData);
}
开发者ID:sehe,项目名称:VsVim,代码行数:8,代码来源:RangeUtilTest.cs
注:本文中的IVimTextBuffer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论