g_Git.m_CurrentDir=topdir;\r
\r
CString PathName=lpszPathName;\r
- PathName=PathName.Right(PathName.GetLength()-g_Git.m_CurrentDir.GetLength()-1);\r
+ if(topdir[topdir.GetLength()-1] == _T('\\'))\r
+ PathName=PathName.Right(PathName.GetLength()-g_Git.m_CurrentDir.GetLength());\r
+ else\r
+ PathName=PathName.Right(PathName.GetLength()-g_Git.m_CurrentDir.GetLength()-1);\r
+\r
CTGitPath path;\r
path.SetFromWin(PathName);\r
\r
UINT CTortoiseGitBlameView::m_FindDialogMessage;\r
\r
// CTortoiseGitBlameView\r
+IMPLEMENT_DYNAMIC(CSciEditBlame,CSciEdit)\r
\r
IMPLEMENT_DYNCREATE(CTortoiseGitBlameView, CView)\r
\r
#define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp))\r
#endif\r
\r
+class CSciEditBlame: public CSciEdit\r
+{\r
+ DECLARE_DYNAMIC(CSciEditBlame)\r
+public:\r
+ afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)\r
+ {\r
+ switch (nChar)\r
+ {\r
+ case (VK_ESCAPE):\r
+ {\r
+ if ((Call(SCI_AUTOCACTIVE)==0)&&(Call(SCI_CALLTIPACTIVE)==0))\r
+ {\r
+ ::SendMessage(::AfxGetApp()->GetMainWnd()->m_hWnd, WM_CLOSE, 0, 0);\r
+ return;\r
+ }\r
+ }\r
+ break;\r
+ }\r
+ CWnd::OnKeyDown(nChar, nRepCnt, nFlags);\r
+ }\r
+};\r
\r
class CTortoiseGitBlameView : public CView\r
{\r
void UpdateInfo();\r
void FocusOn(GitRev *pRev);\r
\r
- CSciEdit m_TextView;\r
+ CSciEditBlame m_TextView;\r
CBalloon m_ToolTip;\r
\r
HINSTANCE hInstance;\r
DWORD GetStyleAt(int pos) { return (DWORD)Call(SCI_GETSTYLEAT, pos) & 0x1f; }\r
bool IsUrl(const CStringA& sText);\r
\r
- afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);\r
+ virtual afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);\r
afx_msg void OnContextMenu(CWnd* /*pWnd*/, CPoint /*point*/);\r
DECLARE_MESSAGE_MAP()\r
};\r