diff --git a/Scripts/build.sh b/Scripts/build.sh index fe37c587bf..d13d93193a 100755 --- a/Scripts/build.sh +++ b/Scripts/build.sh @@ -1,12 +1,12 @@ echo "Downloading Mono" -wget --quiet https://download.visualstudio.microsoft.com/download/pr/5b7dcb51-3035-46f7-a8cb-efe3a1da351c/dcba976cd3257636b6b2828575d29d3c/monoframework-mdk-6.4.0.208.macos10.xamarin.universal.pkg +wget --quiet https://download.visualstudio.microsoft.com/download/pr/2516b6e5-6965-4f5b-af68-d1959a446e7a/443346a56436b5e2682b7c5b5b25e990/monoframework-mdk-6.12.0.125.macos10.xamarin.universal.pkg -sudo installer -pkg monoframework-mdk-6.4.0.208.macos10.xamarin.universal.pkg -target / +sudo installer -pkg monoframework-mdk-6.12.0.125.macos10.xamarin.universal.pkg -target / echo "Downloading VSMac" -wget --quiet https://download.visualstudio.microsoft.com/download/pr/82f53c42-6dc7-481b-82e1-c899bb15a753/df08f05921d42cc6b3b02e9cb082841f/visualstudioformac-8.4.0.2350.dmg +wget --quiet https://download.visualstudio.microsoft.com/download/pr/e5b7cb77-1248-4fb7-a3fe-532ca3335f78/777b586636b0cdba9db15d69bf8d8b1f/visualstudioformac-8.9.7.8.dmg -sudo hdiutil attach visualstudioformac-8.4.0.2350.dmg +sudo hdiutil attach visualstudioformac-8.9.7.8.dmg echo "Removing pre-installed VSMac" sudo rm -rf "/Applications/Visual Studio.app" @@ -19,7 +19,7 @@ rm -rf ~/Library/Preferences/Xamarin/ rm -rf ~/Library/Developer/Xamarin rm -rf ~/Library/Application\ Support/VisualStudio -echo "Installing VSMac 8.4" +echo "Installing VSMac 8.9" ditto -rsrc "/Volumes/Visual Studio/" /Applications/ msbuild /p:Configuration=ReleaseMac /p:Platform="Any CPU" /t:Restore /t:Build diff --git a/Src/VimMac/Properties/AddinInfo.cs b/Src/VimMac/Properties/AddinInfo.cs index b5a3aa5e82..9e7551f91b 100644 --- a/Src/VimMac/Properties/AddinInfo.cs +++ b/Src/VimMac/Properties/AddinInfo.cs @@ -5,7 +5,7 @@ [assembly: Addin( "VsVim", Namespace = "Vim.Mac", - Version = "2.8.0.8" + Version = "2.8.0.11" )] [assembly: AddinName("VsVim")] diff --git a/Src/VimMac/ShellWildcardSearchScope.cs b/Src/VimMac/ShellWildcardSearchScope.cs deleted file mode 100644 index 1740266290..0000000000 --- a/Src/VimMac/ShellWildcardSearchScope.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.Collections.Generic; -using System.Collections.Immutable; -using System.Linq; -using MonoDevelop.Core; -using MonoDevelop.Ide.FindInFiles; -using Provider = MonoDevelop.Ide.FindInFiles.FileProvider; - -namespace Vim.Mac -{ - internal class ShellWildcardSearchScope : Scope - { - private ImmutableArray files; - - public ShellWildcardSearchScope(string workingDirectory, string wildcard) - { - files = ShellWildcardExpansion.ExpandWildcard(wildcard, workingDirectory, enumerateDirectories: true) - .Select(f => new Provider(f)) - .ToImmutableArray(); - } - - public override string GetDescription(FilterOptions filterOptions, string pattern, string replacePattern) - { - return "Vim wildcard search scope"; - } - - public override IEnumerable GetFiles(ProgressMonitor monitor, FilterOptions filterOptions) - { - return files; - } - - public override int GetTotalWork(FilterOptions filterOptions) - { - return files.Length; - } - - } -} diff --git a/Src/VimMac/VimHost.cs b/Src/VimMac/VimHost.cs index 491c43f1ce..3e684ec716 100644 --- a/Src/VimMac/VimHost.cs +++ b/Src/VimMac/VimHost.cs @@ -265,26 +265,6 @@ private void EnsureLinePointVisible(ITextView textView, SnapshotPoint point) public void FindInFiles(string pattern, bool matchCase, string filesOfType, VimGrepFlags flags, FSharpFunc action) { - var find = new FindReplace(); - - var options = new FilterOptions - { - CaseSensitive = matchCase, - RegexSearch = true, - }; - var scope = new ShellWildcardSearchScope(_vim.VimData.CurrentDirectory, filesOfType); - - using (var monitor = IdeApp.Workbench.ProgressMonitors.GetSearchProgressMonitor(true)) - { - var results = find.FindAll(scope, monitor, pattern, null, options, System.Threading.CancellationToken.None); - foreach (var result in results) - { - //TODO: Cancellation? - monitor.ReportResult(result); - } - } - - action.Invoke(null); } public void FormatLines(ITextView textView, SnapshotLineRange range) diff --git a/Src/VimMac/VimKeyProcessor.cs b/Src/VimMac/VimKeyProcessor.cs index eb2917b1e2..fc7db648f2 100644 --- a/Src/VimMac/VimKeyProcessor.cs +++ b/Src/VimMac/VimKeyProcessor.cs @@ -75,9 +75,32 @@ public override void KeyDown(KeyEventArgs e) // Attempt to map the key information into a KeyInput value which can be processed // by Vim. If this works and the key is processed then the input is considered // to be handled + if (_keyUtil.TryConvertSpecialToKeyInput(e.Event, out KeyInput keyInput)) { + var bufferedKeyInputsWasEmpty = VimBuffer.BufferedKeyInputs.IsEmpty; + handled = TryProcess(keyInput); + + if (handled + && BufferedKeysWasEmptyAndIsEmpty() + && oldMode == ModeKind.Insert + && CharTriggersCompletion(keyInput.Char) + && !_completionBroker.IsCompletionActive(VimBuffer.TextView)) + { + // Because VsVim handled the key press for us in insert mode, + // we need to trigger the completion window to open. + _completionBroker.TriggerCompletion(VimBuffer.TextView); + } + + bool BufferedKeysWasEmptyAndIsEmpty() + { + // We don't want the completion window to appear if we + // have something like `inoremap fd ` + // and we just typed the first 'f' or the 'd' + return bufferedKeyInputsWasEmpty + && VimBuffer.BufferedKeyInputs.IsEmpty; + } } } @@ -94,6 +117,11 @@ public override void KeyDown(KeyEventArgs e) e.Handled = handled; } + private bool CharTriggersCompletion(char c) + { + return c == '_' || c == '.' || char.IsLetterOrDigit(c); + } + /// /// Try and process the given KeyInput with the IVimBuffer. This is overridable by /// derived classes in order for them to prevent any KeyInput from reaching the