Skip to content

Commit

Permalink
Merge pull request #81 from jzoss/dev
Browse files Browse the repository at this point in the history
1.7.2 Bug Fix Release
  • Loading branch information
jzoss committed Aug 31, 2017
2 parents 903a582 + 3d69021 commit 49eff71
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 26 deletions.
2 changes: 1 addition & 1 deletion GitSccProvider/PendingChangesView.xaml
Expand Up @@ -179,7 +179,7 @@ xmlns:vsfx="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.Visual
Background="{DynamicResource {x:Static vsfx:VsBrushes.WindowKey}}">


<avalonEdit:TextEditor x:Name="DiffEditor" FontFamily="Consolas" FontSize="10pt" MouseDoubleClick="DiffEditor_MouseDoubleClick"/>
<avalonEdit:TextEditor IsReadOnly="True" x:Name="DiffEditor" FontFamily="Consolas" FontSize="10pt" MouseDoubleClick="DiffEditor_MouseDoubleClick"/>
<!--<ContentControl x:Name="DiffEditor" MouseDoubleClick="DiffEditor_MouseDoubleClick"></ContentControl>-->

<!--<TabControl Name="tabControl1">
Expand Down
20 changes: 20 additions & 0 deletions GitSccProvider/PendingChangesView.xaml.cs
Expand Up @@ -47,6 +47,9 @@ public partial class PendingChangesView : UserControl, IDisposable
private GridViewColumnHeader _currentSortedColumn;
private ListSortDirection _lastSortDirection;

//fix for Bug #79
FileSystemWatcher watcher;

public PendingChangesView(ToolWindowWithEditor<PendingChangesView> toolWindow)
{
InitializeComponent();
Expand All @@ -56,6 +59,9 @@ public PendingChangesView(ToolWindowWithEditor<PendingChangesView> toolWindow)
VSColorTheme.ThemeChanged += VSColorTheme_ThemeChanged;
CurrentTracker = RepositoryManager.Instance.ActiveTracker;
RepositoryManager.Instance.ActiveTrackerChanged += Instance_ActiveTrackerChanged;

//Fix for bug #78 : Commit comment text field shouldn't allow formatting
DataObject.AddPastingHandler(textBoxComments, new DataObjectPastingEventHandler(TextBoxPasting));
}


Expand Down Expand Up @@ -99,6 +105,7 @@ private void SetupTracker(GitRepository tracker)
private async void CurrentTracker_FileStatusUpdate(object sender, GitFilesStatusUpdateEventArgs e)
{
await Refresh(e.Files);
await SetDiffEditorText();
}

private async void Instance_ActiveTrackerChanged(object sender, GitRepositoryEvent e)
Expand Down Expand Up @@ -263,6 +270,7 @@ async delegate
});
}


private async Task SetDiffEditorText()
{
await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();
Expand Down Expand Up @@ -328,6 +336,16 @@ private void ClearEditor()
}


private void TextBoxPasting(object sender, DataObjectPastingEventArgs e)
{
if (sender is RichTextBox)
{
string lPastingText = e.DataObject.GetData(DataFormats.Text) as string;
(sender as RichTextBox).Document.ContentEnd.InsertTextInRun(lPastingText);
e.CancelCommand();
}
}

#endregion

#region Select File
Expand Down Expand Up @@ -481,7 +499,9 @@ private async System.Threading.Tasks.Task UpdateFileListUI(List<GitFile> changed
.Where(i => i.FileName == fn)
.FirstOrDefault();
if (item != null)
{
item.IsSelected = true;
}
});

ShowStatusMessage("");
Expand Down
38 changes: 13 additions & 25 deletions GitSccProvider/SccProviderService.cs
Expand Up @@ -318,20 +318,20 @@ private static string GetCaseSensitiveFileName(string fileName)
{
if (fileName == null) return fileName;

if (Directory.Exists(fileName) || File.Exists(fileName))
{
try
{
StringBuilder sb = new StringBuilder(1024);
GetShortPathName(fileName.ToUpper(), sb, 1024);
GetLongPathName(sb.ToString(), sb, 1024);
var fn = sb.ToString();
return string.IsNullOrWhiteSpace(fn) ? fileName : fn;
}
catch { }
}
return GetExactPathName(fileName);
}

return fileName;
private static string GetExactPathName(string pathName)
{
if (!(File.Exists(pathName) || Directory.Exists(pathName)))
return pathName;

var directoryInfo = new DirectoryInfo(pathName);

if (directoryInfo.Parent != null)
return Path.Combine(GetExactPathName(directoryInfo.Parent.FullName), directoryInfo.Parent.GetFileSystemInfos(directoryInfo.Name)[0].Name);
else
return directoryInfo.Name.ToUpper();
}

#endregion
Expand All @@ -354,18 +354,6 @@ private async Task<string> GetFileName(IVsHierarchy hierHierarchy, uint itemidNo
}
}



[DllImport("kernel32.dll")]
static extern uint GetShortPathName(string longpath, StringBuilder sb, int buffer);

[DllImport("kernel32.dll")]
static extern uint GetLongPathName(string shortpath, StringBuilder sb, int buffer);





/// <summary>
/// Gets the list of directly selected VSITEMSELECTION objects
/// </summary>
Expand Down
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -91,6 +91,9 @@ All you need to build the code is Visual Sudio 2015 with Visual Studio Extensibi
* Add more features to the status bar.
* Work on integrating gitflow.

**V1.7.2**
* Bug Fix: #74,#77,#78, #79

**V1.7.0**
* Updated solution to Visual Studio 2017
* Plugin now supports Visual Studio 2015 and 2017
Expand Down
4 changes: 4 additions & 0 deletions Readme.html
Expand Up @@ -86,6 +86,10 @@ <h2 id="change-logs-visual-studio-2015">Change Logs -- Visual Studio 2015</h2>
<li>Add more features to the status bar.</li>
<li>Work on integrating gitflow.</li>
</ul>
<p><strong>V1.7.2</strong></p>
<ul>
<li>Bug Fix: #74,#77,#78, #79</li>
</ul>
<p><strong>V1.7.0</strong></p>
<ul>
<li>Updated solution to Visual Studio 2017</li>
Expand Down
4 changes: 4 additions & 0 deletions history.html
Expand Up @@ -22,6 +22,10 @@ <h2 id="change-logs-visual-studio-2015">Change Logs -- Visual Studio 2015</h2>
<li class="task-list-item"><input disabled="disabled" type="checkbox" checked="checked" /> Updated to Reactive Extensions 3.0. Should fix bug #54</li>
<li class="task-list-item"><input disabled="disabled" type="checkbox" checked="checked" /> Solution refreshes all glyps on commit fixing #58</li>
</ul>
<p><strong>V1.7.2</strong></p>
<ul>
<li>Bug Fix: #74,#77,#78, #79</li>
</ul>
<p><strong>V1.7.0</strong></p>
<ul>
<li>Updated solution to Visual Studio 2017</li>
Expand Down
5 changes: 5 additions & 0 deletions history.md
Expand Up @@ -18,6 +18,11 @@
- [x] Solution refreshes all glyps on commit fixing #58


**V1.7.2**
* Bug Fix: #74,#77,#78, #79



**V1.7.0**
* Updated solution to Visual Studio 2017
* Plugin now supports Visual Studio 2015 and 2017
Expand Down

0 comments on commit 49eff71

Please sign in to comment.