1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
|
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0492
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------
Patch 8.1.0492
Problem: "Edit with existing Vim" list can get long.
Solution: Move the list to a submenu. (Ken Takata, closes #3561)
Files: src/GvimExt/gvimext.cpp
*** ../vim-8.1.0491/src/GvimExt/gvimext.cpp 2017-10-14 17:17:35.000000000 +0200
--- src/GvimExt/gvimext.cpp 2018-10-25 11:21:12.394638116 +0200
***************
*** 708,718 ****
--- 708,733 ----
m_edit_existing_off = 1;
}
+ HMENU hSubMenu = NULL;
+ if (m_cntOfHWnd > 1)
+ {
+ hSubMenu = CreatePopupMenu();
+ mii.fMask |= MIIM_SUBMENU;
+ mii.wID = idCmd;
+ mii.dwTypeData = _("Edit with existing Vim");
+ mii.cch = lstrlen(mii.dwTypeData);
+ mii.hSubMenu = hSubMenu;
+ InsertMenuItem(hMenu, indexMenu++, TRUE, &mii);
+ mii.fMask = mii.fMask & ~MIIM_SUBMENU;
+ mii.hSubMenu = NULL;
+ }
// Now display all the vim instances
for (int i = 0; i < m_cntOfHWnd; i++)
{
char title[BUFSIZE];
char temp[BUFSIZE];
+ int index;
+ HMENU hmenu;
// Obtain window title, continue if can not
if (GetWindowText(m_hWnd[i], title, BUFSIZE - 1) == 0)
***************
*** 726,740 ****
*pos = 0;
}
// Now concatenate
! strncpy(temp, _("Edit with existing Vim - "), BUFSIZE - 1);
! temp[BUFSIZE - 1] = '\0';
strncat(temp, title, BUFSIZE - 1 - strlen(temp));
temp[BUFSIZE - 1] = '\0';
mii.wID = idCmd++;
mii.dwTypeData = temp;
mii.cch = lstrlen(mii.dwTypeData);
! InsertMenuItem(hMenu, indexMenu++, TRUE, &mii);
}
// InsertMenu(hMenu, indexMenu++, MF_SEPARATOR|MF_BYPOSITION, 0, NULL);
--- 741,770 ----
*pos = 0;
}
// Now concatenate
! if (m_cntOfHWnd > 1)
! temp[0] = '\0';
! else
! {
! strncpy(temp, _("Edit with existing Vim - "), BUFSIZE - 1);
! temp[BUFSIZE - 1] = '\0';
! }
strncat(temp, title, BUFSIZE - 1 - strlen(temp));
temp[BUFSIZE - 1] = '\0';
mii.wID = idCmd++;
mii.dwTypeData = temp;
mii.cch = lstrlen(mii.dwTypeData);
! if (m_cntOfHWnd > 1)
! {
! hmenu = hSubMenu;
! index = i;
! }
! else
! {
! hmenu = hMenu;
! index = indexMenu++;
! }
! InsertMenuItem(hmenu, index, TRUE, &mii);
}
// InsertMenu(hMenu, indexMenu++, MF_SEPARATOR|MF_BYPOSITION, 0, NULL);
*** ../vim-8.1.0491/src/version.c 2018-10-23 21:42:55.449760330 +0200
--- src/version.c 2018-10-25 11:22:20.317530744 +0200
***************
*** 794,795 ****
--- 794,797 ----
{ /* Add new patch number below this line */
+ /**/
+ 492,
/**/
--
hundred-and-one symptoms of being an internet addict:
270. You are subscribed to a mailing list for every piece of software
you use.
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|