0
0
mirror of https://github.com/vim/vim.git synced 2025-07-04 23:07:33 -04:00

updated for version 7.2-150

This commit is contained in:
Bram Moolenaar 2009-04-22 11:08:26 +00:00
parent 798b30bdfd
commit 99133038dc
4 changed files with 177 additions and 154 deletions

View File

@ -20,6 +20,7 @@ static char THIS_FILE[] = __FILE__;
static BOOL g_bEnableVim = TRUE; // Vim enabled
static BOOL g_bDevStudioEditor = FALSE; // Open file in Dev Studio editor simultaneously
static BOOL g_bNewTabs = FALSE;
static int g_ChangeDir = CD_NONE; // CD after file open?
static void VimSetEnableState(BOOL bEnableState);
@ -93,8 +94,10 @@ void CCommands::SetApplicationObject (IApplication * pApplication)
{
g_bEnableVim = GetRegistryInt(hSectionKey, "EnableVim",
g_bEnableVim);
g_bDevStudioEditor = GetRegistryInt(hSectionKey,"DevStudioEditor",
g_bDevStudioEditor);
g_bDevStudioEditor = GetRegistryInt(hSectionKey,
"DevStudioEditor", g_bDevStudioEditor);
g_bNewTabs = GetRegistryInt(hSectionKey, "NewTabs",
g_bNewTabs);
g_ChangeDir = GetRegistryInt(hSectionKey, "ChangeDir",
g_ChangeDir);
RegCloseKey(hSectionKey);
@ -314,6 +317,7 @@ class CMainDialog : public CDialog
enum { IDD = IDD_ADDINMAIN };
int m_ChangeDir;
BOOL m_bDevStudioEditor;
BOOL m_bNewTabs;
//}}AFX_DATA
//{{AFX_VIRTUAL(CMainDialog)
@ -335,6 +339,7 @@ CMainDialog::CMainDialog (CWnd * pParent /* =NULL */ )
//{{AFX_DATA_INIT(CMainDialog)
m_ChangeDir = -1;
m_bDevStudioEditor = FALSE;
m_bNewTabs = FALSE;
//}}AFX_DATA_INIT
}
@ -344,6 +349,7 @@ void CMainDialog::DoDataExchange (CDataExchange * pDX)
//{{AFX_DATA_MAP(CMainDialog)
DDX_Radio(pDX, IDC_CD_SOURCE_PATH, m_ChangeDir);
DDX_Check(pDX, IDC_DEVSTUDIO_EDITOR, m_bDevStudioEditor);
DDX_Check(pDX, IDC_NEW_TABS, m_bNewTabs);
//}}AFX_DATA_MAP
}
@ -370,10 +376,12 @@ STDMETHODIMP CCommands::VisVimDialog ()
CMainDialog Dlg;
Dlg.m_bDevStudioEditor = g_bDevStudioEditor;
Dlg.m_bNewTabs = g_bNewTabs;
Dlg.m_ChangeDir = g_ChangeDir;
if (Dlg.DoModal() == IDOK)
{
g_bDevStudioEditor = Dlg.m_bDevStudioEditor;
g_bNewTabs = Dlg.m_bNewTabs;
g_ChangeDir = Dlg.m_ChangeDir;
// Save settings to registry HKEY_CURRENT_USER\Software\Vim\VisVim
@ -385,6 +393,8 @@ STDMETHODIMP CCommands::VisVimDialog ()
{
WriteRegistryInt(hSectionKey, "DevStudioEditor",
g_bDevStudioEditor);
WriteRegistryInt(hSectionKey, "NewTabs",
g_bNewTabs);
WriteRegistryInt(hSectionKey, "ChangeDir", g_ChangeDir);
RegCloseKey(hSectionKey);
}
@ -536,9 +546,17 @@ static BOOL VimOpenFile (BSTR& FileName, long LineNr)
// Make Vim open the file.
// In the filename convert all \ to /, put a \ before a space.
if (g_bNewTabs)
{
sprintf(VimCmd, ":tab drop ");
s = VimCmd + 11;
}
else
{
sprintf(VimCmd, ":drop ");
sprintf(FileNameTmp, "%S", (char *)FileName);
s = VimCmd + 6;
}
sprintf(FileNameTmp, "%S", (char *)FileName);
for (p = FileNameTmp; *p != '\0' && s < FileNameTmp + MAX_OLE_STR - 4;
++p)
if (*p == '\\')
@ -691,4 +709,3 @@ static void DebugMsg (char* Msg, char* Arg)
AfxMessageBox(Buf);
}
#endif

View File

@ -16,6 +16,7 @@
#define IDC_CD_SOURCE_PATH 1001
#define IDC_CD_SOURCE_PARENT 1002
#define IDC_CD_NONE 1003
#define IDC_NEW_TABS 1004
// Next default values for new objects
//

View File

@ -122,6 +122,9 @@ BEGIN
CONTROL "&Open file in DevStudio editor simultaneously",
IDC_DEVSTUDIO_EDITOR,"Button",BS_AUTOCHECKBOX | WS_GROUP |
WS_TABSTOP,7,7,153,10
CONTROL "Open files in new tabs",
IDC_NEW_TABS,"Button",BS_AUTOCHECKBOX | WS_GROUP |
WS_TABSTOP,7,21,153,10
GROUPBOX "Current directory",IDC_STATIC,7,35,164,58,WS_GROUP
CONTROL "Set to &source file path",IDC_CD_SOURCE_PATH,"Button",
BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,17,49,85,10

View File

@ -676,6 +676,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
150,
/**/
149,
/**/