public void LoadVimRc1() { _globalSettings.VimRc = "invalid"; _globalSettings.VimRcPaths = "invalid"; _fileSystem.Setup(x => x.GetVimRcDirectories()).Returns(new string[] { }).Verifiable(); _fileSystem.Setup(x => x.LoadVimRcContents()).Returns(FSharpOption <FileContents> .None).Verifiable(); Assert.False(_vim.LoadVimRc()); _fileSystem.Verify(); Assert.Equal("", _globalSettings.VimRc); Assert.Equal("", _globalSettings.VimRcPaths); }
public void LoadVimRc1() { _settings.VimRc = "invalid"; _settings.VimRcPaths = "invalid"; _fileSystem.Setup(x => x.GetVimRcDirectories()).Returns(new string[] { }).Verifiable(); _fileSystem.Setup(x => x.LoadVimRc()).Returns(FSharpOption <Tuple <string, string[]> > .None).Verifiable(); Assert.IsFalse(_vim.LoadVimRc(FSharpFuncUtil.Create <Unit, ITextView>(_ => null))); _fileSystem.Verify(); Assert.AreEqual("", _settings.VimRc); Assert.AreEqual("", _settings.VimRcPaths); }
private void MaybeLoadVimRc() { if (!_vim.IsVimRcLoaded && String.IsNullOrEmpty(_vim.GlobalSettings.VimRcPaths)) { // Need to pass the LoadVimRc call a function to create an ITextView that // can be used to load the settings against. We don't want this ITextView // coming back through TextViewCreated so give it a ITextViewRole that won't // hit our filter if (!_vim.LoadVimRc()) { // If no VimRc file is loaded add a couple of sanity settings _vim.VimRcLocalSettings.AutoIndent = true; } } }
private void MaybeLoadVimRc() { if (!_vim.IsVimRcLoaded && String.IsNullOrEmpty(_vim.Settings.VimRcPaths)) { // Need to pass the LoadVimRc call a function to create an ITextView that // can be used to load the settings against. We don't want this ITextView // coming back through TextViewCreated so give it a ITextViewRole that won't // hit our filter Func <ITextView> createViewFunc = () => _editorFactoryService.CreateTextView( _bufferFactoryService.CreateTextBuffer(), _editorFactoryService.NoRoles); if (!_vim.LoadVimRc(_fileSystem, createViewFunc.ToFSharpFunc())) { // If no VimRc file is loaded add a couple of sanity settings _vim.VimRcLocalSettings.AutoIndent = true; } } }