summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--runtime/doc/gui_w32.txt35
-rw-r--r--runtime/doc/os_win32.txt150
-rw-r--r--runtime/doc/todo.txt12
-rw-r--r--src/GvimExt/Makefile2
-rw-r--r--src/Make_mvc.mak20
-rw-r--r--src/evalfunc.c2
-rw-r--r--src/ex_cmds.c14
-rw-r--r--src/ex_docmd.c9
-rw-r--r--src/gui_w32.c552
-rw-r--r--src/if_cscope.c21
-rw-r--r--src/misc1.c5
-rw-r--r--src/misc2.c8
-rw-r--r--src/option.c10
-rw-r--r--src/os_mswin.c90
-rw-r--r--src/os_win32.c706
-rw-r--r--src/os_win32.h13
-rw-r--r--src/proto/os_mswin.pro1
-rw-r--r--src/proto/os_win32.pro1
-rw-r--r--src/version.c26
19 files changed, 377 insertions, 1300 deletions
diff --git a/runtime/doc/gui_w32.txt b/runtime/doc/gui_w32.txt
index e4f790e721..ec69442053 100644
--- a/runtime/doc/gui_w32.txt
+++ b/runtime/doc/gui_w32.txt
@@ -49,10 +49,6 @@ If you want Vim to start with a maximized window, add this command to your
vimrc or gvimrc file: >
au GUIEnter * simalt ~x
<
- *gui-w32s*
-There is a specific version of gvim.exe that runs under the Win32s subsystem
-of Windows 3.1 or 3.11. See |win32s|.
-
Using Vim as a plugin *gui-w32-windowid*
@@ -100,9 +96,10 @@ when you have got a new version):
You can also install Vim in the "Send To" menu:
1. Start a Windows Explorer
2. Navigate to your sendto directory:
- Windows 95: %windir%\sendto (e.g. "c:\windows\sendto")
Windows NT: %windir%\profiles\%user%\sendto (e.g.
- "c:\winnt\profiles\mattha\sendto").
+ "c:\winnt\profiles\mattha\sendto")
+ Windows XP: C:\Documents and Settings\%user%\SendTo
+ Windows Vista: C:\Users\%user%\AppData\Roaming\Microsoft\Windows\SendTo .
3. Right-click in the file pane and select New->Shortcut
4. Follow the shortcut wizard, using the full path to VIM/GVIM.
@@ -274,35 +271,17 @@ WARNING: If you close this window with the "X" button, and confirm the
question if you really want to kill the application, Vim may be killed too!
(This does not apply to commands run asynchronously with ":!start".)
-In Windows 95, the window in which the commands are executed is always 25x80
-characters, to be as DOS compatible as possible (this matters!). The default
-system font is used. On NT, the window will be the default you have set up for
-"Console" in Control Panel. On Win32s, the properties of the DOS box are
-determined by _default.pif in the windows directory.
-
- *msdos-mode*
-If you get a dialog that says "This program is set to run in MS-DOS mode..."
-when you run an external program, you can solve this by changing the
-properties of the associated shortcut:
-- Use a Windows Explorer to find the command.com that is used. It can be
- c:\command.com, c:\dos\command.com, c:\windows\command.com, etc.
-- With the right mouse button, select properties of this command.com.
-- In the Program tab select "Advanced".
-- Unselect "MS-DOS mode".
-- Click "OK" twice.
+The window in which the commands are executed will be the default you have set
+up for "Console" in Control Panel.
*win32-!start*
Normally, Vim waits for a command to complete before continuing (this makes
sense for most shell commands which produce output for Vim to use). If you
want Vim to start a program and return immediately, you can use the following
-syntax on W95 & NT: >
+syntax: >
:!start [/min] {command}
The optional "/min" causes the window to be minimized.
-On Win32s, you will have to go to another window instead. Don't forget that
-you must tell Windows 3.1x to keep executing a DOS command in the background
-while you switch back to Vim.
-
==============================================================================
5. Special colors *win32-colors*
@@ -311,7 +290,7 @@ On Win32, the normal DOS colors can be used. See |dos-colors|.
Additionally the system configured colors can also be used. These are known
by the names Sys_XXX, where XXX is the appropriate system color name, from the
following list (see the Win32 documentation for full descriptions). Case is
-ignored. Note: On Win32s not all of these colors are supported.
+ignored.
Sys_3DDKShadow Sys_3DFace Sys_BTNFace
Sys_3DHilight Sys_3DHighlight Sys_BTNHilight
diff --git a/runtime/doc/os_win32.txt b/runtime/doc/os_win32.txt
index 8bbee89501..7357542828 100644
--- a/runtime/doc/os_win32.txt
+++ b/runtime/doc/os_win32.txt
@@ -1,4 +1,4 @@
-*os_win32.txt* For Vim version 8.0. Last change: 2016 Aug 28
+*os_win32.txt* For Vim version 8.0. Last change: 2016 Oct 12
VIM REFERENCE MANUAL by George Reilly
@@ -7,20 +7,18 @@
*win32* *Win32* *MS-Windows*
This file documents the idiosyncrasies of the Win32 version of Vim.
-The Win32 version of Vim works on Windows NT, 95, 98, ME, XP, Vista and
-Windows 7. There are both console and GUI versions.
+The Win32 version of Vim works on Windows XP, Vista, 7, 8 and 10. There are
+both console and GUI versions.
The 32 bit version also runs on 64 bit MS-Windows systems.
-There is GUI version for use in the Win32s subsystem in Windows 3.1[1]. You
-can also use the 32-bit DOS version of Vim instead. See |os_msdos.txt|.
-
1. Known problems |win32-problems|
2. Startup |win32-startup|
3. Restore screen contents |win32-restore|
4. Using the mouse |win32-mouse|
-5. Running under Windows 3.1 |win32-win3.1|
-6. Win32 mini FAQ |win32-faq|
+5. Running under Windows 95 |win32-win95|
+6. Running under Windows 3.1 |win32-win3.1|
+7. Win32 mini FAQ |win32-faq|
Additionally, there are a number of common Win32 and DOS items:
File locations |dos-locations|
@@ -43,20 +41,7 @@ The GUI version was made by George V. Reilly and Robert Webb.
For compiling see "src/INSTALLpc.txt". *win32-compiling*
==============================================================================
-1. Known problems *windows95* *win32-problems*
-
-There are a few known problems with running in a console on Windows 95. As
-far as we know, this is the same in Windows 98 and Windows ME.
-
-Comments from somebody working at Microsoft: "Win95 console support has always
-been and will always be flaky".
-1. Dead key support doesn't work.
-2. Resizing the window with ":set columns=nn lines=nn" works, but executing
- external commands MAY CAUSE THE SYSTEM TO HANG OR CRASH.
-3. Screen updating is slow, unless you change 'columns' or 'lines' to a
- non-DOS value. But then the second problem applies!
-
-If this bothers you, use the 32 bit MS-DOS version or the Win32 GUI version.
+1. Known problems *win32-problems*
When doing file name completion, Vim also finds matches for the short file
name. But Vim will still find and use the corresponding long file name. For
@@ -141,60 +126,20 @@ When the mouse doesn't work, try disabling the "Quick Edit Mode" feature of
the console.
==============================================================================
-5. Running under Windows 3.1 *win32-win3.1*
+5. Running under Windows 95 *win32-win95*
+ *windows95* *windows98* *windowsme*
+Windows 95/98/ME support was removed in patch 8.0.0029 If you want to use it
+you will need to get a version older than that.
- *win32s* *windows-3.1*
+==============================================================================
+6. Running under Windows 3.1 *win32-win3.1*
+
+ *win32s* *windows-3.1* *gui-w32s*
There was a special version of Gvim that runs under Windows 3.1 and 3.11.
Support was removed in patch 7.4.1363.
==============================================================================
-6. Win32 mini FAQ *win32-faq*
-
-Q. Why does the Win32 version of Vim update the screen so slowly on Windows 95?
-A. The support for Win32 console mode applications is very buggy in Win95.
- For some unknown reason, the screen updates very slowly when Vim is run at
- one of the standard resolutions (80x25, 80x43, or 80x50) and the 16-bit DOS
- version updates the screen much more quickly than the Win32 version.
- However, if the screen is set to some other resolution, such as by ":set
- columns=100" or ":set lines=40", screen updating becomes about as fast as
- it is with the 16-bit version.
-
- WARNING: Changing 'columns' may make Windows 95 crash while updating the
- window (complaints --> Microsoft). Since this mostly works, this has not
- been disabled, but be careful with changing 'columns'.
-
- Changing the screen resolution makes updates faster, but it brings
- additional problems. External commands (e.g., ":!dir") can cause Vim to
- freeze when the screen is set to a non-standard resolution, particularly
- when 'columns' is not equal to 80. It is not possible for Vim to reliably
- set the screen resolution back to the value it had upon startup before
- running external commands, so if you change the number of 'lines' or
- 'columns', be very, very careful. In fact, Vim will not allow you to
- execute external commands when 'columns' is not equal to 80, because it is
- so likely to freeze up afterwards.
-
- None of the above applies on Windows NT. Screen updates are fast, no
- matter how many 'lines' or 'columns' the window has, and external commands
- do not cause Vim to freeze.
-
-Q. So if the Win32 version updates the screen so slowly on Windows 95 and the
- 16-bit DOS version updates the screen quickly, why would I want to run the
- Win32 version?
-A. Firstly, the Win32 version isn't that slow, especially when the screen is
- set to some non-standard number of 'lines' or 'columns'. Secondly, the
- 16-bit DOS version has some severe limitations: It can't do big changes and
- it doesn't know about long file names. The Win32 version doesn't have these
- limitations and it's faster overall (the same is true for the 32-bit DJGPP
- DOS version of Vim). The Win32 version is smarter about handling the
- screen, the mouse, and the keyboard than the DJGPP version is.
-
-Q. And what about the 16-bit DOS version versus the Win32 version on NT?
-A. There are no good reasons to run the 16-bit DOS version on NT. The Win32
- version updates the screen just as fast as the 16-bit version does when
- running on NT. All of the above disadvantages apply. Finally, DOS
- applications can take a long time to start up and will run more slowly. On
- non-Intel NT platforms, the DOS version is almost unusably slow, because it
- runs on top of an 80x86 emulator.
+7. Win32 mini FAQ *win32-faq*
Q. How do I change the font?
A. In the GUI version, you can use the 'guifont' option. Example: >
@@ -202,47 +147,6 @@ A. In the GUI version, you can use the 'guifont' option. Example: >
< In the console version, you need to set the font of the console itself.
You cannot do this from within Vim.
-Q. When I change the size of the console window with ':set lines=xx' or
- similar, the font changes! (Win95)
-A. You have the console font set to 'Auto' in Vim's (or your MS-DOS prompt's)
- properties. This makes W95 guess (badly!) what font is best. Set an explicit
- font instead.
-
-Q. Why can't I paste into Vim when running Windows 95?
-A. In the properties dialog box for the MS-DOS window, go to "MS-DOS
- Prompt/Misc/Fast pasting" and make sure that it is NOT checked. You should
- also do ":set paste" in Vim to avoid unexpected effects. |'paste'|
-
-Q. How do I type dead keys on Windows 95, in the console version?
- (A dead key is an accent key, such as acute, grave, or umlaut, that doesn't
- produce a character by itself, but when followed by another key, produces
- an accented character, such as a-acute, e-grave, u-umlaut, n-tilde, and so
- on. Very useful for most European languages. English-language keyboard
- layouts don't use dead keys, as far as we know.)
-A. You don't. The console mode input routines simply do not work correctly in
- Windows 95, and I have not been able to work around them. In the words
- of a senior developer at Microsoft:
- Win95 console support has always been and will always be flaky.
-
- The flakiness is unavoidable because we are stuck between the world of
- MS-DOS keyboard TSRs like KEYB (which wants to cook the data;
- important for international) and the world of Win32.
-
- So keys that don't "exist" in MS-DOS land (like dead keys) have a
- very tenuous existence in Win32 console land. Keys that act
- differently between MS-DOS land and Win32 console land (like
- capslock) will act flaky.
-
- Don't even _mention_ the problems with multiple language keyboard
- layouts...
-
- You may be able to fashion some sort of workaround with the digraphs
- mechanism. |digraphs|
-
- The best solution is to use the Win32 GUI version gvim.exe. Alternatively,
- you can try one of the DOS versions of Vim where dead keys reportedly do
- work.
-
Q. How do I type dead keys on Windows NT?
A. Dead keys work on NT 3.51. Just type them as you would in any other
application.
@@ -349,28 +253,6 @@ A. You have two possible solutions depending on what you want:
< The first command runs notepad minimized and the second one runs it
normally.
-Q. I'm using Win32s, and when I try to run an external command like "make",
- Vim doesn't wait for it to finish! Help!
-A. The problem is that a 32-bit application (Vim) can't get notification from
- Windows that a 16-bit application (your DOS session) has finished. Vim
- includes a work-around for this, but you must set up your DOS commands to
- run in a window, not full-screen. Unfortunately the default when you
- install Windows is full-screen. To change this:
- 1) Start PIF editor (in the Main program group).
- 2) Open the file "_DEFAULT.PIF" in your Windows directory.
- 3) Changes the display option from "Full Screen" to "Windowed".
- 4) Save and exit.
-
- To test, start Vim and type >
- :!dir C:\<CR>".
-< You should see a DOS box window appear briefly with the directory listing.
-
-Q. I use Vim under Win32s and NT. In NT, I can define the console to default to
- 50 lines, so that I get a 80x50 shell when I ':sh'. Can I do the same in
- W3.1x, or am I stuck with 80x25?
-A. Edit SYSTEM.INI and add 'ScreenLines=50' to the [NonWindowsApp] section. DOS
- prompts and external DOS commands will now run in a 50-line window.
-
*windows-icon*
Q. I don't like the Vim icon, can I change it?
A. Yes, place your favorite icon in bitmaps/vim.ico in a directory of
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index 694545cf4b..e966361e77 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt* For Vim version 8.0. Last change: 2016 Oct 09
+*todo.txt* For Vim version 8.0. Last change: 2016 Oct 12
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -34,10 +34,6 @@ not be repeated below, unless there is extra information.
*known-bugs*
-------------------- Known bugs and current work -----------------------
-After 8.0 is released:
-- Drop support for older MS-Windows systems, before XP.
- Patch from Ken Takata, updated 2016 Sep 12.
-
+channel:
- Problem with stderr on Windows? (Vincent Rischmann, 2016 Aug 31, #1026)
- Add 'cwd' argument to start_job(): directory to change to in the child.
@@ -1809,10 +1805,6 @@ popup menu over it, first draw the new popup menu, remember its position and
size and then redraw the text, skipping the characters under the popup menu.
This should avoid flicker. Other solution by A.Politz, 2007 Aug 22.
-Windows 98: pasting from the clipboard with text from another application has
-a trailing NUL. (Joachim Hofmann) Perhaps the length specified for CF_TEXT
-isn't right?
-
When a register contains illegal bytes, writing viminfo in utf-8 and reading
it back doesn't result in utf-8. (Devin Bayer)
@@ -2418,8 +2410,6 @@ GTK+ GUI known bugs:
Win32 GUI known bugs:
- Win32: tearoff menu window should have a scrollbar when it's taller than
the screen.
-8 On Windows 98 the unicows library is needed to support functions with UCS2
- file names. Can we load unicows.dll dynamically?
8 The -P argument doesn't work very well with many MDI applications.
The last argument of CreateWindowEx() should be used, see MSDN docs.
Tutorial: http://win32assembly.online.fr/tut32.html
diff --git a/src/GvimExt/Makefile b/src/GvimExt/Makefile
index 361c229322..798efd204a 100644
--- a/src/GvimExt/Makefile
+++ b/src/GvimExt/Makefile
@@ -3,7 +3,7 @@
# DEBUG=yes Build debug version (for VC7 and maybe later)
#
-TARGETOS=BOTH
+TARGETOS=WINNT
!ifndef APPVER
APPVER=5.0
!endif
diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak
index 91ae25a071..435f56dd0d 100644
--- a/src/Make_mvc.mak
+++ b/src/Make_mvc.mak
@@ -1,7 +1,7 @@
-# Makefile for Vim on Win32 (Windows NT/2000/XP/2003 and Windows 95/98/Me)
-# and Win64, using the Microsoft Visual C++ compilers. Known to work with
-# VC5, VC6 (VS98), VC7.0 (VS2002), VC7.1 (VS2003), VC8 (VS2005),
-# VC9 (VS2008), VC10 (VS2010) and VC11 (VS2012)
+# Makefile for Vim on Win32 (Windows XP/2003/Vista/7/8/10) and Win64,
+# using the Microsoft Visual C++ compilers. Known to work with VC5, VC6 (VS98),
+# VC7.0 (VS2002), VC7.1 (VS2003), VC8 (VS2005), VC9 (VS2008), VC10 (VS2010),
+# VC11 (VS2012), VC12 (VS2013) and VC14 (VS2015)
#
# To build using other Windows compilers, see INSTALLpc.txt
#
@@ -119,7 +119,7 @@
# yes: Write a normal mapfile.
# lines: Write a mapfile with line numbers (only for VC6 and later)
#
-# Static Code Analysis: ANALYZE=yes (works with VS2012 only)
+# Static Code Analysis: ANALYZE=yes (works with VS2012 or later)
#
# You can combine any of these interfaces
#
@@ -162,9 +162,9 @@
# you can set DEFINES on the command line, e.g.,
# nmake -f Make_mvc.mvc "DEFINES=-DEMACS_TAGS"
-# Build on both Windows NT/XP and Windows 9x
+# Build on Windows NT/XP
-TARGETOS = BOTH
+TARGETOS = WINNT
# Select one of eight object code directories, depends on GUI, OLE, DEBUG and
# interfaces.
@@ -436,13 +436,7 @@ CFLAGS = -c /W3 /nologo $(CVARS) -I. -Iproto -DHAVE_PATHDEF -DWIN32 \
#>>>>> end of choices
###########################################################################
-!ifdef OS
-OS_TYPE = winnt
DEL_TREE = rmdir /s /q
-!else
-OS_TYPE = win95
-DEL_TREE = deltree /y
-!endif
INTDIR=$(OBJDIR)
OUTDIR=$(OBJDIR)
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 84eaa8cbeb..9fa8f1c9ee 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -6017,7 +6017,7 @@ f_has(typval_T *argvars, typval_T *rettv)
#endif
#if defined(WIN3264)
else if (STRICMP(name, "win95") == 0)
- n = mch_windows95();
+ n = FALSE; /* Win9x is no more supported. */
#endif
#ifdef FEAT_NETBEANS_INTG
else if (STRICMP(name, "netbeans_enabled") == 0)
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 6535de11b2..5b6a44a18c 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -1175,14 +1175,6 @@ do_filter(
if (*cmd == NUL) /* no filter command */
return;
-#ifdef WIN3264
- /*
- * Check if external commands are allowed now.
- */
- if (can_end_termcap_mode(TRUE) == FALSE)
- return;
-#endif
-
cursor_save = curwin->w_cursor;
linecount = line2 - line1 + 1;
curwin->w_cursor.lnum = line1;
@@ -1460,12 +1452,6 @@ do_shell(
#ifdef MSWIN
/*
- * Check if external commands are allowed now.
- */
- if (can_end_termcap_mode(TRUE) == FALSE)
- return;
-
- /*
* Check if ":!start" is used.
*/
if (cmd != NULL)
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 09b9019963..ac7beb7c5b 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -7611,14 +7611,7 @@ ex_stop(exarg_T *eap)
/*
* Disallow suspending for "rvim".
*/
- if (!check_restricted()
-#ifdef WIN3264
- /*
- * Check if external commands are allowed now.
- */
- && can_end_termcap_mode(TRUE)
-#endif
- )
+ if (!check_restricted())
{
if (!eap->forceit)
autowrite_all();
diff --git a/src/gui_w32.c b/src/gui_w32.c
index 75d600fcb2..be2158dc6d 100644
--- a/src/gui_w32.c
+++ b/src/gui_w32.c
@@ -319,7 +319,7 @@ static int destroying = FALSE; /* call DestroyWindow() ourselves */
#ifdef MSWIN_FIND_REPLACE
static UINT s_findrep_msg = 0; /* set in gui_w[16/32].c */
static FINDREPLACE s_findrep_struct;
-# if defined(FEAT_MBYTE) && defined(WIN3264)
+# ifdef FEAT_MBYTE
static FINDREPLACEW s_findrep_struct_w;
# endif
static HWND s_findrep_hwnd = NULL;
@@ -369,7 +369,7 @@ static int allow_scrollbar = FALSE;
# define MyTranslateMessage(x) TranslateMessage(x)
#endif
-#if (defined(WIN3264) && defined(FEAT_MBYTE)) || defined(GLOBAL_IME)
+#if defined(FEAT_MBYTE) || defined(GLOBAL_IME)
/* use of WindowProc depends on wide_WindowProc */
# define MyWindowProc vim_WindowProc
#else
@@ -473,10 +473,6 @@ static UINT s_wait_timer = 0; /* Timer for get char from user */
static int s_timed_out = FALSE;
static int dead_key = 0; /* 0: no dead key, 1: dead key pressed */
-#ifdef WIN3264
-static OSVERSIONINFO os_version; /* like it says. Init in gui_mch_init() */
-#endif
-
#ifdef FEAT_BEVAL
/* balloon-eval WM_NOTIFY_HANDLER */
static void Handle_WM_Notify(HWND hwnd, LPNMHDR pnmh);
@@ -695,61 +691,41 @@ char_to_string(int ch, char_u *string, int slen, int had_alt)
WCHAR wstring[2];
char_u *ws = NULL;
- if (os_version.dwPlatformId != VER_PLATFORM_WIN32_NT)
+ wstring[0] = ch;
+ len = 1;
+
+ /* "ch" is a UTF-16 character. Convert it to a string of bytes. When
+ * "enc_codepage" is non-zero use the standard Win32 function,
+ * otherwise use our own conversion function (e.g., for UTF-8). */
+ if (enc_codepage > 0)
{
- /* On Windows 95/98 we apparently get the character in the active
- * codepage, not in UCS-2. If conversion is needed convert it to
- * UCS-2 first. */
- if ((int)GetACP() == enc_codepage)
- len = 0; /* no conversion required */
- else
+ len = WideCharToMultiByte(enc_codepage, 0, wstring, len,
+ (LPSTR)string, slen, 0, NULL);
+ /* If we had included the ALT key into the character but now the
+ * upper bit is no longer set, that probably means the conversion
+ * failed. Convert the original character and set the upper bit
+ * afterwards. */
+ if (had_alt && len == 1 && ch >= 0x80 && string[0] < 0x80)
{
- string[0] = ch;
- len = MultiByteToWideChar(GetACP(), 0, (LPCSTR)string,
- 1, wstring, 2);
+ wstring[0] = ch & 0x7f;
+ len = WideCharToMultiByte(enc_codepage, 0, wstring, len,
+ (LPSTR)string, slen, 0, NULL);
+ if (len == 1) /* safety check */
+ string[0] |= 0x80;
}
}
else
{
- wstring[0] = ch;
len = 1;
- }
-
- if (len > 0)
- {
- /* "ch" is a UTF-16 character. Convert it to a string of bytes. When
- * "enc_codepage" is non-zero use the standard Win32 function,
- * otherwise use our own conversion function (e.g., for UTF-8). */
- if (enc_codepage > 0)
- {
- len = WideCharToMultiByte(enc_codepage, 0, wstring, len,
- (LPSTR)string, slen, 0, NULL);
- /* If we had included the ALT key into the character but now the
- * upper bit is no longer set, that probably means the conversion
- * failed. Convert the original character and set the upper bit
- * afterwards. */
- if (had_alt && len == 1 && ch >= 0x80 && string[0] < 0x80)
- {
- wstring[0] = ch & 0x7f;
- len = WideCharToMultiByte(enc_codepage, 0, wstring, len,
- (LPSTR)string, slen, 0, NULL);
- if (len == 1) /* safety check */
- string[0] |= 0x80;
- }
- }
+ ws = utf16_to_enc(wstring, &len);
+ if (ws == NULL)
+ len = 0;
else
{
- len = 1;
- ws = utf16_to_enc(wstring, &len);
- if (ws == NULL)
- len = 0;
- else
- {
- if (len > slen) /* just in case */
- len = slen;
- mch_memmove(string, ws, len);
- vim_free(ws);
- }
+ if (len > slen) /* just in case */
+ len = slen;
+ mch_memmove(string, ws, len);
+ vim_free(ws);
}
}
@@ -1079,7 +1055,7 @@ _OnMenu(
#endif
#ifdef MSWIN_FIND_REPLACE
-# if defined(FEAT_MBYTE) && defined(WIN3264)
+# ifdef FEAT_MBYTE
/*
* copy useful data from structure LPFINDREPLACE to structure LPFINDREPLACEW
*/
@@ -1127,11 +1103,10 @@ _OnFindRepl(void)
int flags = 0;
int down;
-# if defined(FEAT_MBYTE) && defined(WIN3264)
+# ifdef FEAT_MBYTE
/* If the OS is Windows NT, and 'encoding' differs from active codepage:
* convert text from wide string. */
- if (os_version.dwPlatformId == VER_PLATFORM_WIN32_NT
- && enc_codepage >= 0 && (int)GetACP() != enc_codepage)
+ if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
{
findrep_wtoa(&s_findrep_struct, &s_findrep_struct_w);
}
@@ -1279,7 +1254,7 @@ _TextAreaWndProc(
}
}
-#if (defined(WIN3264) && defined(FEAT_MBYTE)) \
+#if defined(FEAT_MBYTE) \
|| defined(GLOBAL_IME) \
|| defined(PROTO)
# ifdef PROTO
@@ -1586,10 +1561,9 @@ gui_mch_get_color(char_u *name)
static SysColorTable sys_table[] =
{
-#ifdef WIN3264
{"SYS_3DDKSHADOW", COLOR_3DDKSHADOW},
{"SYS_3DHILIGHT", COLOR_3DHILIGHT},
-#ifndef __MINGW32__
+#ifdef COLOR_3DHIGHLIGHT
{"SYS_3DHIGHLIGHT", COLOR_3DHIGHLIGHT},
#endif
{"SYS_BTNHILIGHT", COLOR_BTNHILIGHT},
@@ -1600,7 +1574,6 @@ gui_mch_get_color(char_u *name)
{"SYS_INFOBK", COLOR_INFOBK},
{"SYS_INFOTEXT", COLOR_INFOTEXT},
{"SYS_3DFACE", COLOR_3DFACE},
-#endif
{"SYS_BTNFACE", COLOR_BTNFACE},
{"SYS_BTNSHADOW", COLOR_BTNSHADOW},
{"SYS_ACTIVEBORDER", COLOR_ACTIVEBORDER},
@@ -2094,11 +2067,7 @@ gui_mch_wait_for_chars(int wtime)
if (s_need_activate)
{
-#ifdef WIN32
(void)SetForegroundWindow(s_hwnd);
-#else
- (void)SetActiveWindow(s_hwnd);
-#endif
s_need_activate = FALSE;
}
@@ -2421,7 +2390,6 @@ add_tabline_popup_menu_entry(HMENU pmenu, UINT item_id, char_u *item_text)
{
#ifdef FEAT_MBYTE
WCHAR *wn = NULL;
- int n;
if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
{
@@ -2438,11 +2406,8 @@ add_tabline_popup_menu_entry(HMENU pmenu, UINT item_id, char_u *item_text)
infow.fType = MFT_STRING;
infow.dwTypeData = wn;
infow.cch = (UINT)wcslen(wn);
- n = InsertMenuItemW(pmenu, item_id, FALSE, &infow);
+ InsertMenuItemW(pmenu, item_id, FALSE, &infow);
vim_free(wn);
- if (n == 0 && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
- /* Failed, try using non-wide function. */
- wn = NULL;
}
}
@@ -2563,7 +2528,7 @@ gui_mch_update_tabline(void)
if (s_tabhwnd == NULL)
return;
-#if defined(FEAT_MBYTE)
+#ifdef FEAT_MBYTE
# ifndef CCM_SETUNICODEFORMAT
/* For older compilers. We assume this never changes. */
# define CCM_SETUNICODEFORMAT 0x2005
@@ -2708,18 +2673,15 @@ set_window_title(HWND hwnd, char *title)
if (title != NULL && enc_codepage >= 0 && enc_codepage != (int)GetACP())
{
WCHAR *wbuf;
- int n;
/* Convert the title from 'encoding' to UTF-16. */
wbuf = (WCHAR *)enc_to_utf16((char_u *)title, NULL);
if (wbuf != NULL)
{
- n = SetWindowTextW(hwnd, wbuf);
+ SetWindowTextW(hwnd, wbuf);
vim_free(wbuf);
- if (n != 0 || GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
- return;
- /* Retry with non-wide function (for Windows 98). */
}
+ return;
}
#endif
(void)SetWindowText(hwnd, (LPCSTR)title);
@@ -2737,11 +2699,10 @@ gui_mch_find_dialog(exarg_T *eap)
if (!IsWindow(s_findrep_hwnd))
{
initialise_findrep(eap->arg);
-# if defined(FEAT_MBYTE) && defined(WIN3264)
+# ifdef FEAT_MBYTE
/* If the OS is Windows NT, and 'encoding' differs from active
* codepage: convert text and use wide function. */
- if (os_version.dwPlatformId == VER_PLATFORM_WIN32_NT
- && enc_codepage >= 0 && (int)GetACP() != enc_codepage)
+ if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
{
findrep_atow(&s_findrep_struct_w, &s_findrep_struct);
s_findrep_hwnd = FindTextW(
@@ -2774,9 +2735,8 @@ gui_mch_replace_dialog(exarg_T *eap)
if (!IsWindow(s_findrep_hwnd))
{
initialise_findrep(eap->arg);
-# if defined(FEAT_MBYTE) && defined(WIN3264)
- if (os_version.dwPlatformId == VER_PLATFORM_WIN32_NT
- && enc_codepage >= 0 && (int)GetACP() != enc_codepage)
+# ifdef FEAT_MBYTE
+ if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
{
findrep_atow(&s_findrep_struct_w, &s_findrep_struct);
s_findrep_hwnd = ReplaceTextW(
@@ -3466,11 +3426,7 @@ static LPCSTR mshape_idcs[] =
IDC_SIZEWE, /* leftright */
IDC_SIZEWE, /* lrsizing */
IDC_WAIT, /* busy */
-#ifdef WIN3264
IDC_NO, /* no */
-#else
- IDC_ICON, /* no */
-#endif
IDC_ARROW, /* crosshair */
IDC_ARROW, /* hand1 */
IDC_ARROW, /* hand2 */
@@ -3497,11 +3453,7 @@ mch_set_mouse_shape(int shape)
#ifdef SetClassLongPtr
SetClassLongPtr(s_textArea, GCLP_HCURSOR, (__int3264)(LONG_PTR)LoadCursor(NULL, idc));
#else
-# ifdef WIN32
SetClassLong(s_textArea, GCL_HCURSOR, (long_u)LoadCursor(NULL, idc));
-# else /* Win16 */
- SetClassWord(s_textArea, GCW_HCURSOR, (WORD)LoadCursor(NULL, idc));
-# endif
#endif
if (!p_mh)
{
@@ -3523,7 +3475,7 @@ mch_set_mouse_shape(int shape)
* Windows NT/2000/XP the "W" functions are used.
*/
-# if defined(FEAT_MBYTE) && defined(WIN3264)
+# ifdef FEAT_MBYTE
/*
* Wide version of convert_filter().
*/
@@ -3728,17 +3680,15 @@ gui_mch_browse(
char_u *initdir,
char_u *filter)
{
+# ifdef FEAT_MBYTE
+ return gui_mch_browseW(saving, title, dflt, ext, initdir, filter);
+# else
OPENFILENAME fileStruct;
char_u fileBuf[MAXPATHL];
char_u *initdirp = NULL;
char_u *filterp;
char_u *p;
-# if defined(FEAT_MBYTE) && defined(WIN3264)
- if (os_version.dwPlatformId == VER_PLATFORM_WIN32_NT)
- return gui_mch_browseW(saving, title, dflt, ext, initdir, filter);
-# endif
-
if (dflt == NULL)
fileBuf[0] = NUL;
else
@@ -3748,12 +3698,12 @@ gui_mch_browse(
filterp = convert_filter(filter);
vim_memset(&fileStruct, 0, sizeof(OPENFILENAME));
-#ifdef OPENFILENAME_SIZE_VERSION_400
+# ifdef OPENFILENAME_SIZE_VERSION_400
/* be compatible with Windows NT 4.0 */
fileStruct.lStructSize = OPENFILENAME_SIZE_VERSION_400;
-#else
+# else
fileStruct.lStructSize = sizeof(fileStruct);
-#endif
+# endif
fileStruct.lpstrTitle = (LPSTR)title;
fileStruct.lpstrDefExt = (LPSTR)ext;
@@ -3783,10 +3733,10 @@ gui_mch_browse(
* Don't use OFN_OVERWRITEPROMPT, Vim has its own ":confirm" dialog.
*/
fileStruct.Flags = (OFN_NOCHANGEDIR | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY);
-#ifdef FEAT_SHORTCUT
+# ifdef FEAT_SHORTCUT
if (curbuf->b_p_bin)
fileStruct.Flags |= OFN_NODEREFERENCELINKS;
-#endif
+# endif
if (saving)
{
if (!GetSaveFileName(&fileStruct))
@@ -3806,6 +3756,7 @@ gui_mch_browse(
/* Shorten the file name if possible */
return vim_strsave(shorten_fname1((char_u *)fileBuf));
+# endif
}
#endif /* FEAT_BROWSE */
@@ -3816,16 +3767,11 @@ _OnDropFiles(
HDROP hDrop)
{
#ifdef FEAT_WINDOWS
-#ifdef WIN3264
# define BUFPATHLEN _MAX_PATH
# define DRAGQVAL 0xFFFFFFFF
-#else
-# define BUFPATHLEN MAXPATHL
-# define DRAGQVAL 0xFFFF
-#endif
-#ifdef FEAT_MBYTE
+# ifdef FEAT_MBYTE
WCHAR wszFile[BUFPATHLEN];
-#endif
+# endif
char szFile[BUFPATHLEN];
UINT cFiles = DragQueryFile(hDrop, DRAGQVAL, NULL, 0);
UINT i;
@@ -3846,11 +3792,11 @@ _OnDropFiles(
if (fnames != NULL)
for (i = 0; i < cFiles; ++i)
{
-#ifdef FEAT_MBYTE
+# ifdef FEAT_MBYTE
if (DragQueryFileW(hDrop, i, wszFile, BUFPATHLEN) > 0)
fnames[i] = utf16_to_enc(wszFile, NULL);
else
-#endif
+# endif
{
DragQueryFile(hDrop, i, szFile, BUFPATHLEN);
fnames[i] = vim_strsave((char_u *)szFile);
@@ -3888,14 +3834,10 @@ _OnScroll(
long val;
int dragging = FALSE;
int dont_scroll_save = dont_scroll;
-#ifndef WIN3264
- int nPos;
-#else
SCROLLINFO si;
si.cbSize = sizeof(si);
si.fMask = SIF_POS;
-#endif
sb = gui_mswin_find_scrollbar(hwndCtl);
if (sb == NULL)
@@ -3960,13 +3902,8 @@ _OnScroll(
}
prev_code = code;
-#ifdef WIN3264
si.nPos = (sb->scroll_shift > 0) ? val >> sb->scroll_shift : val;
SetScrollInfo(hwndCtl, SB_CTL, &si, TRUE);
-#else
- nPos = (sb->scroll_shift > 0) ? val >> sb->scroll_shift : val;
- SetScrollPos(hwndCtl, SB_CTL, nPos, TRUE);
-#endif
/*
* When moving a vertical scrollbar, move the other vertical scrollbar too.
@@ -3976,11 +3913,7 @@ _OnScroll(
scrollbar_T *sba = sb->wp->w_scrollbars;
HWND id = sba[ (sb == sba + SBAR_LEFT) ? SBAR_RIGHT : SBAR_LEFT].id;
-#ifdef WIN3264
SetScrollInfo(id, SB_CTL, &si, TRUE);
-#else
- SetScrollPos(id, SB_CTL, nPos, TRUE);
-#endif
}
/* Don't let us be interrupted here by another message. */
@@ -4448,7 +4381,6 @@ static int dialog_default_button = -1;
/* Inte