diff -crN ../vim71/Contents ./Contents *** ../vim71/Contents Sat May 12 12:18:49 2007 --- ./Contents Sat Aug 9 16:23:02 2008 *************** *** 9,18 **** messages, shows current file name in window title, on-line help, rectangular cut/paste, etc., etc., etc... ! Version 7.1. Also runs under UNIX, MSDOS and other systems. ! vim71rt.tgz contains the documentation and syntax files. ! vim71bin.tgz contains the binaries. ! vim71src.tgz contains the sources. Author: Bram Moolenaar et al. --- 9,18 ---- messages, shows current file name in window title, on-line help, rectangular cut/paste, etc., etc., etc... ! Version 7.2. Also runs under UNIX, MSDOS and other systems. ! vim72rt.tgz contains the documentation and syntax files. ! vim72bin.tgz contains the binaries. ! vim72src.tgz contains the sources. Author: Bram Moolenaar et al. diff -crN ../vim71/README_ami.txt ./README_ami.txt *** ../vim71/README_ami.txt Sat May 12 12:18:46 2007 --- ./README_ami.txt Sat Aug 9 16:22:59 2008 *************** *** 1,4 **** ! README_ami.txt for version 7.1 of Vim: Vi IMproved. This file explains the installation of Vim on Amiga systems. See README.txt for general information about Vim. --- 1,4 ---- ! README_ami.txt for version 7.2 of Vim: Vi IMproved. This file explains the installation of Vim on Amiga systems. See README.txt for general information about Vim. diff -crN ../vim71/README_amibin.txt ./README_amibin.txt *** ../vim71/README_amibin.txt Sat May 12 12:18:46 2007 --- ./README_amibin.txt Sat Aug 9 16:22:59 2008 *************** *** 1,4 **** ! README_amibin.txt for version 7.1 of Vim: Vi IMproved. See "README.txt" for general information about Vim. See "README_ami.txt" for installation instructions for the Amiga. --- 1,4 ---- ! README_amibin.txt for version 7.2 of Vim: Vi IMproved. See "README.txt" for general information about Vim. See "README_ami.txt" for installation instructions for the Amiga. diff -crN ../vim71/README_amisrc.txt ./README_amisrc.txt *** ../vim71/README_amisrc.txt Sat May 12 12:18:46 2007 --- ./README_amisrc.txt Sat Aug 9 16:22:59 2008 *************** *** 1,4 **** ! README_amisrc.txt for version 7.1 of Vim: Vi IMproved. See "README.txt" for general information about Vim. See "README_ami.txt" for installation instructions for the Amiga. --- 1,4 ---- ! README_amisrc.txt for version 7.2 of Vim: Vi IMproved. See "README.txt" for general information about Vim. See "README_ami.txt" for installation instructions for the Amiga. diff -crN ../vim71/README_bindos.txt ./README_bindos.txt *** ../vim71/README_bindos.txt Sat May 12 12:18:46 2007 --- ./README_bindos.txt Sat Aug 9 16:25:54 2008 *************** *** 1,19 **** ! README_bindos.txt for version 7.1 of Vim: Vi IMproved. See "README.txt" for general information about Vim. See "README_dos.txt" for installation instructions for MS-DOS and MS-Windows. ! These files are in the runtime archive (vim70rt.zip). There are several binary distributions of Vim for the PC. You would normally pick only one of them, but it's also possible to install several. These ones are available (the version number may differ): ! vim70d16.zip 16 bit DOS version ! vim70d32.zip 32 bit DOS version ! vim70w32.zip Windows 95/98/NT/etc. console version ! gvim70.zip Windows 95/98/NT/etc. GUI version ! gvim70ole.zip Windows 95/98/NT/etc. GUI version with OLE ! gvim70_s.zip Windows 3.1 GUI version ! You MUST also get the runtime archive (vim70rt.zip). ! The sources are also available (vim70src.zip). --- 1,19 ---- ! README_bindos.txt for version 7.2 of Vim: Vi IMproved. See "README.txt" for general information about Vim. See "README_dos.txt" for installation instructions for MS-DOS and MS-Windows. ! These files are in the runtime archive (vim72rt.zip). There are several binary distributions of Vim for the PC. You would normally pick only one of them, but it's also possible to install several. These ones are available (the version number may differ): ! vim72d16.zip 16 bit DOS version ! vim72d32.zip 32 bit DOS version ! vim72w32.zip Windows 95/98/NT/etc. console version ! gvim72.zip Windows 95/98/NT/etc. GUI version ! gvim72ole.zip Windows 95/98/NT/etc. GUI version with OLE ! gvim72_s.zip Windows 3.1 GUI version ! You MUST also get the runtime archive (vim72rt.zip). ! The sources are also available (vim72src.zip). diff -crN ../vim71/README_dos.txt ./README_dos.txt *** ../vim71/README_dos.txt Sat May 12 12:18:46 2007 --- ./README_dos.txt Sat Aug 9 16:26:11 2008 *************** *** 1,4 **** ! README_dos.txt for version 7.1 of Vim: Vi IMproved. This file explains the installation of Vim on MS-DOS and MS-Windows systems. See "README.txt" for general information about Vim. --- 1,4 ---- ! README_dos.txt for version 7.2 of Vim: Vi IMproved. This file explains the installation of Vim on MS-DOS and MS-Windows systems. See "README.txt" for general information about Vim. *************** *** 47,59 **** Binary and runtime Vim archives are normally unpacked in the same location, on top of each other. ! 2. Unpack the zip archives. This will create a new directory "vim\vim70", in which all the distributed Vim files are placed. Since the directory name includes the version number, it is unlikely that you overwrite existing files. Examples: ! pkunzip -d gvim70.zip ! unzip vim70w32.zip You need to unpack the runtime archive and at least one of the binary archives. When using more than one binary version, be careful not to --- 47,59 ---- Binary and runtime Vim archives are normally unpacked in the same location, on top of each other. ! 2. Unpack the zip archives. This will create a new directory "vim\vim72", in which all the distributed Vim files are placed. Since the directory name includes the version number, it is unlikely that you overwrite existing files. Examples: ! pkunzip -d gvim72.zip ! unzip vim72w32.zip You need to unpack the runtime archive and at least one of the binary archives. When using more than one binary version, be careful not to *************** *** 69,75 **** archive and follow the instructions in the documentation. 3. Change to the new directory: ! cd vim\vim70 Run the "install.exe" program. It will ask you a number of questions about how you would like to have your Vim setup. Among these are: - You can tell it to write a "_vimrc" file with your preferences in the --- 69,75 ---- archive and follow the instructions in the documentation. 3. Change to the new directory: ! cd vim\vim72 Run the "install.exe" program. It will ask you a number of questions about how you would like to have your Vim setup. Among these are: - You can tell it to write a "_vimrc" file with your preferences in the *************** *** 80,87 **** console or in a shell. You can select one of the directories in your $PATH. If you skip this, you can add Vim to the search path manually: The simplest is to add a line to your autoexec.bat. Examples: ! set path=%path%;C:\vim\vim70 ! set path=%path%;D:\editors\vim\vim70 - Create entries for Vim on the desktop and in the Start menu. That's it! --- 80,87 ---- console or in a shell. You can select one of the directories in your $PATH. If you skip this, you can add Vim to the search path manually: The simplest is to add a line to your autoexec.bat. Examples: ! set path=%path%;C:\vim\vim72 ! set path=%path%;D:\editors\vim\vim72 - Create entries for Vim on the desktop and in the Start menu. That's it! *************** *** 94,100 **** point to the top directory of your Vim files. Example: set VIM=C:\editors\vim Vim version 6.0 will look for your vimrc file in $VIM, and for the runtime ! files in $VIM/vim70. See ":help $VIM" for more information. - To avoid confusion between distributed files of different versions and your own modified vim scripts, it is recommended to use this directory layout: --- 94,100 ---- point to the top directory of your Vim files. Example: set VIM=C:\editors\vim Vim version 6.0 will look for your vimrc file in $VIM, and for the runtime ! files in $VIM/vim72. See ":help $VIM" for more information. - To avoid confusion between distributed files of different versions and your own modified vim scripts, it is recommended to use this directory layout: *************** *** 105,118 **** C:\vim\vimfiles\ftplugin\*.vim Filetype plugins C:\vim\... Other files you made. Distributed files: ! C:\vim\vim70\vim.exe The Vim version 6.0 executable. ! C:\vim\vim70\doc\*.txt The version 6.0 documentation files. ! C:\vim\vim70\bugreport.vim A Vim version 6.0 script. ! C:\vim\vim70\... Other version 6.0 distributed files. In this case the $VIM environment variable would be set like this: set VIM=C:\vim ! Then $VIMRUNTIME will automatically be set to "$VIM\vim70". Don't add ! "vim70" to $VIM, that won't work. - You can put your Vim executable anywhere else. If the executable is not with the other Vim files, you should set $VIM. The simplest is to add a line --- 105,118 ---- C:\vim\vimfiles\ftplugin\*.vim Filetype plugins C:\vim\... Other files you made. Distributed files: ! C:\vim\vim72\vim.exe The Vim version 6.0 executable. ! C:\vim\vim72\doc\*.txt The version 6.0 documentation files. ! C:\vim\vim72\bugreport.vim A Vim version 6.0 script. ! C:\vim\vim72\... Other version 6.0 distributed files. In this case the $VIM environment variable would be set like this: set VIM=C:\vim ! Then $VIMRUNTIME will automatically be set to "$VIM\vim72". Don't add ! "vim72" to $VIM, that won't work. - You can put your Vim executable anywhere else. If the executable is not with the other Vim files, you should set $VIM. The simplest is to add a line *************** *** 136,143 **** Select Properties. 5. In the Program tab, change the "Cmdline" to add "/c" and the name of the Vim executable. Examples: ! C:\command.com /c C:\vim\vim70\vim.exe ! C:\command.com /c D:\editors\vim\vim70\vim.exe 6. Select the font, window size, etc. that you like. If this isn't possible, select "Advanced" in the Program tab, and deselect "MS-DOS mode". --- 136,143 ---- Select Properties. 5. In the Program tab, change the "Cmdline" to add "/c" and the name of the Vim executable. Examples: ! C:\command.com /c C:\vim\vim72\vim.exe ! C:\command.com /c D:\editors\vim\vim72\vim.exe 6. Select the font, window size, etc. that you like. If this isn't possible, select "Advanced" in the Program tab, and deselect "MS-DOS mode". diff -crN ../vim71/README_extra.txt ./README_extra.txt *** ../vim71/README_extra.txt Sat May 12 12:18:46 2007 --- ./README_extra.txt Sat Aug 9 16:22:59 2008 *************** *** 1,4 **** ! README_extra.txt for version 7.1 of Vim: Vi IMproved. The extra archive of Vim is to be used in combination with the source archive (vim-7.0-src.tar.gz). The extra archive is useless without it. --- 1,4 ---- ! README_extra.txt for version 7.2 of Vim: Vi IMproved. The extra archive of Vim is to be used in combination with the source archive (vim-7.0-src.tar.gz). The extra archive is useless without it. diff -crN ../vim71/README_mac.txt ./README_mac.txt *** ../vim71/README_mac.txt Sat May 12 12:18:46 2007 --- ./README_mac.txt Sat Aug 9 16:22:59 2008 *************** *** 1,4 **** ! README_mac.txt for version 7.1 of Vim: Vi IMproved. This file explains the installation of Vim on Macintosh systems. See "README.txt" for general information about Vim. --- 1,4 ---- ! README_mac.txt for version 7.2 of Vim: Vi IMproved. This file explains the installation of Vim on Macintosh systems. See "README.txt" for general information about Vim. diff -crN ../vim71/README_ole.txt ./README_ole.txt *** ../vim71/README_ole.txt Sat May 12 12:18:46 2007 --- ./README_ole.txt Sat Aug 9 16:22:59 2008 *************** *** 1,4 **** ! README_ole.txt for version 7.1 of Vim: Vi IMproved. This archive contains gvim.exe with OLE interface and VisVim. This version of gvim.exe can also load a number of interface dynamically (you --- 1,4 ---- ! README_ole.txt for version 7.2 of Vim: Vi IMproved. This archive contains gvim.exe with OLE interface and VisVim. This version of gvim.exe can also load a number of interface dynamically (you diff -crN ../vim71/README_os2.txt ./README_os2.txt *** ../vim71/README_os2.txt Sat May 12 12:21:47 2007 --- ./README_os2.txt Sat Aug 9 16:26:30 2008 *************** *** 1,32 **** ! README_os2.txt for version 7.1 of Vim: Vi IMproved. This file explains the installation of Vim on OS/2 systems. See "README.txt" for general information about Vim. NOTE: You will need two archives: ! vim71rt.zip contains the runtime files (same as for the PC version) ! vim71os2.zip contains the OS/2 executables 1. Go to the directory where you want to put the Vim files. Examples: cd C:\ cd D:\editors ! 2. Unpack the zip archives. This will create a new directory "vim/vim71", in which all the distributed Vim files are placed. Since the directory name includes the version number, it is unlikely that you overwrite existing files. Examples: ! pkunzip -d vim71os2.zip ! unzip vim71os2.zip After you unpacked the files, you can still move the whole directory tree to another location. 3. Add the directory where vim.exe is to your path. The simplest is to add a line to your autoexec.bat. Examples: ! set path=%path%;C:\vim\vim71 ! set path=%path%;D:\editors\vim\vim71 That's it! --- 1,32 ---- ! README_os2.txt for version 7.2 of Vim: Vi IMproved. This file explains the installation of Vim on OS/2 systems. See "README.txt" for general information about Vim. NOTE: You will need two archives: ! vim72rt.zip contains the runtime files (same as for the PC version) ! vim72os2.zip contains the OS/2 executables 1. Go to the directory where you want to put the Vim files. Examples: cd C:\ cd D:\editors ! 2. Unpack the zip archives. This will create a new directory "vim/vim72", in which all the distributed Vim files are placed. Since the directory name includes the version number, it is unlikely that you overwrite existing files. Examples: ! pkunzip -d vim72os2.zip ! unzip vim72os2.zip After you unpacked the files, you can still move the whole directory tree to another location. 3. Add the directory where vim.exe is to your path. The simplest is to add a line to your autoexec.bat. Examples: ! set path=%path%;C:\vim\vim72 ! set path=%path%;D:\editors\vim\vim72 That's it! *************** *** 41,50 **** C:\vim\_viminfo Dynamic info for 'viminfo'. C:\vim\... Other files you made. Distributed files: ! C:\vim\vim71\vim.exe The Vim version 7.1 executable. ! C:\vim\vim71\doc\*.txt The version 7.1 documentation files. ! C:\vim\vim71\bugreport.vim A Vim version 7.1 script. ! C:\vim\vim71\... Other version 7.1 distributed files. In this case the $VIM environment variable would be set like this: set VIM=C:\vim --- 41,50 ---- C:\vim\_viminfo Dynamic info for 'viminfo'. C:\vim\... Other files you made. Distributed files: ! C:\vim\vim72\vim.exe The Vim version 7.1 executable. ! C:\vim\vim72\doc\*.txt The version 7.1 documentation files. ! C:\vim\vim72\bugreport.vim A Vim version 7.1 script. ! C:\vim\vim72\... Other version 7.1 distributed files. In this case the $VIM environment variable would be set like this: set VIM=C:\vim diff -crN ../vim71/README_os390.txt ./README_os390.txt *** ../vim71/README_os390.txt Sat May 12 12:18:46 2007 --- ./README_os390.txt Sat Aug 9 16:22:59 2008 *************** *** 1,4 **** ! README_os_390.txt for version 7.1 of Vim: Vi IMproved. Welcome to the OS/390 Unix port of VIM. --- 1,4 ---- ! README_os_390.txt for version 7.2 of Vim: Vi IMproved. Welcome to the OS/390 Unix port of VIM. diff -crN ../vim71/README_srcdos.txt ./README_srcdos.txt *** ../vim71/README_srcdos.txt Sat May 12 12:18:46 2007 --- ./README_srcdos.txt Sat Aug 9 16:26:43 2008 *************** *** 1,8 **** ! README_srcdos.txt for version 7.1 of Vim: Vi IMproved. See "README.txt" for general information about Vim. See "README_dos.txt" for installation instructions for MS-DOS and MS-Windows. ! These files are in the runtime archive (vim70rt.zip). The DOS source archive contains the files needed to compile Vim on MS-DOS or --- 1,8 ---- ! README_srcdos.txt for version 7.2 of Vim: Vi IMproved. See "README.txt" for general information about Vim. See "README_dos.txt" for installation instructions for MS-DOS and MS-Windows. ! These files are in the runtime archive (vim72rt.zip). The DOS source archive contains the files needed to compile Vim on MS-DOS or diff -crN ../vim71/README_vms.txt ./README_vms.txt *** ../vim71/README_vms.txt Sat May 12 12:18:46 2007 --- ./README_vms.txt Sat Aug 9 16:22:59 2008 *************** *** 1,4 **** ! README_vms.txt for version 7.1 of Vim: Vi IMproved. This file explains the installation of Vim on VMS systems. See "README.txt" in the runtime archive for information about Vim. --- 1,4 ---- ! README_vms.txt for version 7.2 of Vim: Vi IMproved. This file explains the installation of Vim on VMS systems. See "README.txt" in the runtime archive for information about Vim. diff -crN ../vim71/README_w32s.txt ./README_w32s.txt *** ../vim71/README_w32s.txt Sat May 12 12:18:46 2007 --- ./README_w32s.txt Sat Aug 9 16:22:59 2008 *************** *** 1,4 **** ! README_w32s.txt for version 7.1 of Vim: Vi IMproved. This archive contains the gvim.exe that was specifically compiled for use in the Win32s subsystem in MS-Windows 3.1 and 3.11. --- 1,4 ---- ! README_w32s.txt for version 7.2 of Vim: Vi IMproved. This archive contains the gvim.exe that was specifically compiled for use in the Win32s subsystem in MS-Windows 3.1 and 3.11. diff -crN ../vim71/nsis/gvim.nsi ./nsis/gvim.nsi *** ../vim71/nsis/gvim.nsi Sat May 12 12:18:49 2007 --- ./nsis/gvim.nsi Sat Aug 9 16:23:02 2008 *************** *** 22,28 **** !define HAVE_NLS !define VER_MAJOR 7 ! !define VER_MINOR 1 # ----------- No configurable settings below this line ----------- --- 22,28 ---- !define HAVE_NLS !define VER_MAJOR 7 ! !define VER_MINOR 2 # ----------- No configurable settings below this line ----------- *************** *** 139,145 **** Function .onInstSuccess WriteUninstaller vim${VER_MAJOR}${VER_MINOR}\uninstall-gui.exe MessageBox MB_YESNO|MB_ICONQUESTION \ ! "The installation process has been successfull. Happy Vimming! \ $\n$\n Do you want to see the README file now?" IDNO NoReadme Exec '$0\gvim.exe -R "$0\README.txt"' NoReadme: --- 139,145 ---- Function .onInstSuccess WriteUninstaller vim${VER_MAJOR}${VER_MINOR}\uninstall-gui.exe MessageBox MB_YESNO|MB_ICONQUESTION \ ! "The installation process has been successful. Happy Vimming! \ $\n$\n Do you want to see the README file now?" IDNO NoReadme Exec '$0\gvim.exe -R "$0\README.txt"' NoReadme: diff -crN ../vim71/runtime/doc/vim.man ./runtime/doc/vim.man *** ../vim71/runtime/doc/vim.man Tue Apr 11 22:36:42 2006 --- ./runtime/doc/vim.man Mon Jul 21 22:22:05 2008 *************** *** 135,143 **** Vim behave mostly like Vi, even though a .vimrc file exists. ! -d Start in diff mode. There should be two or three file name ! arguments. Vim will open all the files and show differ- ! ences between them. Works like vimdiff(1). -d {device} Open {device} for use as a terminal. Only on the Amiga. Example: "-d con:20/30/600/150". --- 135,143 ---- Vim behave mostly like Vi, even though a .vimrc file exists. ! -d Start in diff mode. There should be two, three or four ! file name arguments. Vim will open all the files and show ! differences between them. Works like vimdiff(1). -d {device} Open {device} for use as a terminal. Only on the Amiga. Example: "-d con:20/30/600/150". *************** *** 398,404 **** Script to detect the type of a file by its contents. See ":help 'filetype'". ! /usr/local/lib/vim/*.ps Files used for PostScript printing. For recent info read the VIM home page: --- 398,404 ---- Script to detect the type of a file by its contents. See ":help 'filetype'". ! /usr/local/lib/vim/print/*.ps Files used for PostScript printing. For recent info read the VIM home page: diff -crN ../vim71/runtime/doc/vimdiff.man ./runtime/doc/vimdiff.man *** ../vim71/runtime/doc/vimdiff.man Thu Jun 30 23:47:42 2005 --- ./runtime/doc/vimdiff.man Mon Jul 21 22:22:05 2008 *************** *** 3,21 **** NAME ! vimdiff - edit two or three versions of a file with Vim and show dif- ! ferences SYNOPSIS ! vimdiff [options] file1 file2 [file3] gvimdiff DESCRIPTION ! Vimdiff starts Vim on two (or three) files. Each file gets its own ! window. The differences between the files are highlighted. This is a ! nice way to inspect changes and to move changes from one version to ! another version of the same file. See vim(1) for details about Vim itself. --- 3,21 ---- NAME ! vimdiff - edit two, three or four versions of a file with Vim and show ! differences SYNOPSIS ! vimdiff [options] file1 file2 [file3 [file4]] gvimdiff DESCRIPTION ! Vimdiff starts Vim on two (or three or four) files. Each file gets its ! own window. The differences between the files are highlighted. This ! is a nice way to inspect changes and to move changes from one version ! to another version of the same file. See vim(1) for details about Vim itself. diff -crN ../vim71/runtime/doc/vimtutor.man ./runtime/doc/vimtutor.man *** ../vim71/runtime/doc/vimtutor.man Mon Jul 5 20:44:50 2004 --- ./runtime/doc/vimtutor.man Sun Apr 6 15:26:44 2008 *************** *** 6,12 **** vimtutor - the Vim tutor SYNOPSIS ! vimtutor [language] DESCRIPTION Vimtutor starts the Vim tutor. It copies the tutor file first, so that --- 6,12 ---- vimtutor - the Vim tutor SYNOPSIS ! vimtutor [-g] [language] DESCRIPTION Vimtutor starts the Vim tutor. It copies the tutor file first, so that *************** *** 15,20 **** --- 15,24 ---- The Vimtutor is useful for people that want to learn their first Vim commands. + The optional argument -g starts vimtutor with gvim rather than vim, if + the GUI version of vim is available, or falls back to Vim if gvim is + not found. + The optional [language] argument is the two-letter name of a language, like "it" or "es". If the [language] argument is missing, the language of the current locale will be used. If a tutor in this language is diff -crN ../vim71/src/GvimExt/GvimExt.reg ./src/GvimExt/GvimExt.reg *** ../vim71/src/GvimExt/GvimExt.reg Sat May 12 12:18:49 2007 --- ./src/GvimExt/GvimExt.reg Sat Aug 9 16:23:02 2008 *************** *** 15,20 **** [HKEY_LOCAL_MACHINE\Software\Vim\Gvim] "path"="gvim.exe" ! [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Vim 7.1] ! "DisplayName"="Vim 7.1: Edit with Vim popup menu entry" "UninstallString"="uninstal.exe" --- 15,20 ---- [HKEY_LOCAL_MACHINE\Software\Vim\Gvim] "path"="gvim.exe" ! [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Vim 7.2] ! "DisplayName"="Vim 7.2: Edit with Vim popup menu entry" "UninstallString"="uninstal.exe" diff -crN ../vim71/src/GvimExt/Makefile ./src/GvimExt/Makefile *** ../vim71/src/GvimExt/Makefile Sat May 5 12:47:27 2007 --- ./src/GvimExt/Makefile Tue Jul 10 16:18:18 2007 *************** *** 24,30 **** gvimext.obj: gvimext.h .cpp.obj: ! $(cc) $(cflags) -DFEAT_GETTEXT $(cvarsdll) $*.cpp gvimext.res: gvimext.rc $(rc) $(rcflags) $(rcvars) gvimext.rc --- 24,30 ---- gvimext.obj: gvimext.h .cpp.obj: ! $(cc) $(cflags) -DFEAT_GETTEXT $(cvarsmt) $*.cpp gvimext.res: gvimext.rc $(rc) $(rcflags) $(rcvars) gvimext.rc diff -crN ../vim71/src/GvimExt/gvimext.cpp ./src/GvimExt/gvimext.cpp *** ../vim71/src/GvimExt/gvimext.cpp Mon May 7 21:16:09 2007 --- ./src/GvimExt/gvimext.cpp Thu Jul 24 15:06:07 2008 *************** *** 69,82 **** // Registry didn't work, use the search path. if (name[0] == 0) ! strcpy(name, searchpath("gvim.exe")); if (!runtime) { // Only when looking for the executable, not the runtime dir, we can // search for the batch file or a name without a path. if (name[0] == 0) ! strcpy(name, searchpath("gvim.bat")); if (name[0] == 0) strcpy(name, "gvim"); // finds gvim.bat or gvim.exe --- 69,82 ---- // Registry didn't work, use the search path. if (name[0] == 0) ! strcpy(name, searchpath((char *)"gvim.exe")); if (!runtime) { // Only when looking for the executable, not the runtime dir, we can // search for the batch file or a name without a path. if (name[0] == 0) ! strcpy(name, searchpath((char *)"gvim.bat")); if (name[0] == 0) strcpy(name, "gvim"); // finds gvim.bat or gvim.exe *************** *** 152,160 **** FARPROC *ptr; } libintl_entry[] = { ! {"gettext", (FARPROC*)&dyn_libintl_gettext}, ! {"textdomain", (FARPROC*)&dyn_libintl_textdomain}, ! {"bindtextdomain", (FARPROC*)&dyn_libintl_bindtextdomain}, {NULL, NULL} }; --- 152,160 ---- FARPROC *ptr; } libintl_entry[] = { ! {(char *)"gettext", (FARPROC*)&dyn_libintl_gettext}, ! {(char *)"textdomain", (FARPROC*)&dyn_libintl_textdomain}, ! {(char *)"bindtextdomain", (FARPROC*)&dyn_libintl_bindtextdomain}, {NULL, NULL} }; *************** *** 205,217 **** } static char * ! null_libintl_bindtextdomain(const char *domainname, const char *dirname) { return NULL; } static char * ! null_libintl_textdomain(const char* domainname) { return NULL; } --- 205,217 ---- } static char * ! null_libintl_bindtextdomain(const char * /* domainname */, const char * /* dirname */) { return NULL; } static char * ! null_libintl_textdomain(const char* /* domainname */) { return NULL; } *************** *** 308,314 **** // DllMain //--------------------------------------------------------------------------- extern "C" int APIENTRY ! DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) { switch (dwReason) { --- 308,314 ---- // DllMain //--------------------------------------------------------------------------- extern "C" int APIENTRY ! DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /* lpReserved */) { switch (dwReason) { *************** *** 438,444 **** } ! STDMETHODIMP CShellExtClassFactory::LockServer(BOOL fLock) { return NOERROR; } --- 438,444 ---- } ! STDMETHODIMP CShellExtClassFactory::LockServer(BOOL /* fLock */) { return NOERROR; } *************** *** 520,528 **** // It could be a context menu or a property sheet. // ! STDMETHODIMP CShellExt::Initialize(LPCITEMIDLIST pIDFolder, LPDATAOBJECT pDataObj, ! HKEY hRegKey) { // Initialize can be called more than once if (m_pDataObj) --- 520,528 ---- // It could be a context menu or a property sheet. // ! STDMETHODIMP CShellExt::Initialize(LPCITEMIDLIST /* pIDFolder */, LPDATAOBJECT pDataObj, ! HKEY /* hRegKey */) { // Initialize can be called more than once if (m_pDataObj) *************** *** 562,569 **** STDMETHODIMP CShellExt::QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, ! UINT idCmdLast, ! UINT uFlags) { UINT idCmd = idCmdFirst; --- 562,569 ---- STDMETHODIMP CShellExt::QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, ! UINT /* idCmdLast */, ! UINT /* uFlags */) { UINT idCmd = idCmdFirst; *************** *** 718,728 **** return hr; } ! STDMETHODIMP CShellExt::PushToWindow(HWND hParent, ! LPCSTR pszWorkingDir, ! LPCSTR pszCmd, ! LPCSTR pszParam, ! int iShowCmd, int idHWnd) { HWND hWnd = m_hWnd[idHWnd]; --- 718,728 ---- return hr; } ! STDMETHODIMP CShellExt::PushToWindow(HWND /* hParent */, ! LPCSTR /* pszWorkingDir */, ! LPCSTR /* pszCmd */, ! LPCSTR /* pszParam */, ! int /* iShowCmd */, int idHWnd) { HWND hWnd = m_hWnd[idHWnd]; *************** *** 740,748 **** return NOERROR; } ! STDMETHODIMP CShellExt::GetCommandString(UINT_PTR idCmd, UINT uFlags, ! UINT FAR *reserved, LPSTR pszName, UINT cchMax) { --- 740,748 ---- return NOERROR; } ! STDMETHODIMP CShellExt::GetCommandString(UINT_PTR /* idCmd */, UINT uFlags, ! UINT FAR * /* reserved */, LPSTR pszName, UINT cchMax) { *************** *** 835,850 **** (LPTSTR)location) > (HINSTANCE)32) return location; } ! return ""; } # endif #endif STDMETHODIMP CShellExt::InvokeGvim(HWND hParent, ! LPCSTR pszWorkingDir, ! LPCSTR pszCmd, ! LPCSTR pszParam, ! int iShowCmd) { char m_szFileUserClickedOn[BUFSIZE]; char cmdStr[BUFSIZE]; --- 835,850 ---- (LPTSTR)location) > (HINSTANCE)32) return location; } ! return (char *)""; } # endif #endif STDMETHODIMP CShellExt::InvokeGvim(HWND hParent, ! LPCSTR /* pszWorkingDir */, ! LPCSTR /* pszCmd */, ! LPCSTR /* pszParam */, ! int /* iShowCmd */) { char m_szFileUserClickedOn[BUFSIZE]; char cmdStr[BUFSIZE]; *************** *** 911,920 **** STDMETHODIMP CShellExt::InvokeSingleGvim(HWND hParent, ! LPCSTR pszWorkingDir, ! LPCSTR pszCmd, ! LPCSTR pszParam, ! int iShowCmd, int useDiff) { char m_szFileUserClickedOn[BUFSIZE]; --- 911,920 ---- STDMETHODIMP CShellExt::InvokeSingleGvim(HWND hParent, ! LPCSTR /* pszWorkingDir */, ! LPCSTR /* pszCmd */, ! LPCSTR /* pszParam */, ! int /* iShowCmd */, int useDiff) { char m_szFileUserClickedOn[BUFSIZE]; diff -crN ../vim71/src/INSTALLpc.txt ./src/INSTALLpc.txt *** ../vim71/src/INSTALLpc.txt Sun Apr 30 17:30:49 2006 --- ./src/INSTALLpc.txt Wed Jul 2 22:59:18 2008 *************** *** 27,33 **** 8. Windows 3.1 9. MS-DOS ! The currently preferred method is using the free Visual C++ Toolkit 2003. 1. Microsoft Visual C++ --- 27,35 ---- 8. Windows 3.1 9. MS-DOS ! The currently preferred method is using the free Visual C++ Toolkit 2008 ! |msvc-2008-express|. If you need the executable to run on Windows 98 or ME, ! use the 2003 one |msvc-2003-toolkit|. 1. Microsoft Visual C++ *************** *** 36,42 **** Visual Studio ------------- ! Building with Visual Studio (VS 98, VS .NET, VS .NET 2003, and VS .NET 2005) is straightforward. (These instructions should also work for VS 4 and VS 5.) To build Vim from the command line with MSVC, use Make_mvc.mak. --- 38,44 ---- Visual Studio ------------- ! Building with Visual Studio (VS 98, VS .NET, VS .NET 2003, VS 2005, and VS 2008) is straightforward. (These instructions should also work for VS 4 and VS 5.) To build Vim from the command line with MSVC, use Make_mvc.mak. *************** *** 71,90 **** Ron Aaron; they have been tested. ! Visual C++ Toolkit 2003 ----------------------- ! You can download the Microsoft Visual C++ Toolkit 2003 from http://msdn.microsoft.com/visualc/vctoolkit2003/ This contains the command-line tools (compiler, linker, CRT headers, and libraries) for Visual Studio .NET 2003, but not the Visual Studio IDE. To compile and debug Vim with the VC2003 Toolkit, you will also need |ms-platform-sdk|, |dotnet-1.1-redist|, |dotnet-1.1-sdk|, and |windbg-download|. ! It's easier to download Visual C++ 2005 Express Edition, |msvc-2005-express|. ! The advantage of the VC 2003 Toolkit is that it will be freely available ! long after VC 2005 Express Edition stops being free in November 2006. The free Code::Blocks IDE works with the VC2003 Toolkit, as described at http://wiki.codeblocks.org/index.php?title=Integrating_Microsoft_Visual_Toolkit_2003_with_Code::Blocks_IDE --- 73,96 ---- Ron Aaron; they have been tested. ! Visual C++ Toolkit 2003 *msvc-2003-toolkit* ----------------------- ! You could download the Microsoft Visual C++ Toolkit 2003 from http://msdn.microsoft.com/visualc/vctoolkit2003/ + Unfortunately this URL is no longer valid. Inofficial downloads appear to be + available from links mentioned on these pages (use at your own risk): + http://www.filewatcher.com/m/VCToolkitSetup.exe.32952488.0.0.html + http://feargame.net/wiki/index.php?title=Building_Source_with_the_VC2003_Toolkit + This contains the command-line tools (compiler, linker, CRT headers, and libraries) for Visual Studio .NET 2003, but not the Visual Studio IDE. To compile and debug Vim with the VC2003 Toolkit, you will also need |ms-platform-sdk|, |dotnet-1.1-redist|, |dotnet-1.1-sdk|, and |windbg-download|. ! It's easier to download Visual C++ 2008 Express Edition, |msvc-2008-express|, ! which is freely available in perpetuity. The free Code::Blocks IDE works with the VC2003 Toolkit, as described at http://wiki.codeblocks.org/index.php?title=Integrating_Microsoft_Visual_Toolkit_2003_with_Code::Blocks_IDE *************** *** 140,146 **** is also available through the Platform SDK, |ms-platform-sdk|. ! Visual C++ 2005 Express Edition ------------------------------- Visual C++ 2005 Express Edition can be downloaded for free from: --- 146,152 ---- is also available through the Platform SDK, |ms-platform-sdk|. ! Visual C++ 2005 Express Edition *msvc-2005-express* ------------------------------- Visual C++ 2005 Express Edition can be downloaded for free from: *************** *** 152,157 **** --- 158,174 ---- http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/default.aspx + Visual C++ 2008 Express Edition *msvc-2008-express* + ------------------------------- + + Visual C++ 2008 Express Edition can be downloaded for free from: + http://www.microsoft.com/express/vc/Default.aspx + This includes the IDE and the debugger. + + To set the environment execute the msvc2008.bat script. You can then build + Vim with Make_mvc.mak. + + 2. MinGW ======== *************** *** 243,250 **** your Linux (or other unix) box. To do this, you need to follow a few steps: 1) Install the mingw32 cross-compiler. See http://www.libsdl.org/extras/win32/cross/README.txt ! 2) get the *unix* version of the vim sources ! 3) in 'Make_ming.mak', set 'CROSS' to '1' instead of '0'. 4) make -f Make_ming.mak gvim.exe Now you have created the Windows binary from your Linux box! Have fun... --- 260,268 ---- your Linux (or other unix) box. To do this, you need to follow a few steps: 1) Install the mingw32 cross-compiler. See http://www.libsdl.org/extras/win32/cross/README.txt ! 2) Get and unpack both the Unix sources and the extra archive ! 3) in 'Make_ming.mak', set 'CROSS' to 'yes' instead of 'no'. ! Make further changes to 'Make_ming.mak' as you wish. 4) make -f Make_ming.mak gvim.exe Now you have created the Windows binary from your Linux box! Have fun... diff -crN ../vim71/src/INSTALLvms.txt ./src/INSTALLvms.txt *** ../vim71/src/INSTALLvms.txt Mon May 7 21:34:12 2007 --- ./src/INSTALLvms.txt Sun Jan 6 14:15:29 2008 *************** *** 1,7 **** INSTALLvms.txt - Installation of Vim on OpenVMS Maintainer: Zoltan Arpadffy ! Last change: 2007 May 07 This file contains instructions for compiling Vim on Openvms. If you already have an executable version of Vim, you don't need this. --- 1,7 ---- INSTALLvms.txt - Installation of Vim on OpenVMS Maintainer: Zoltan Arpadffy ! Last change: 2008 Jan 06 This file contains instructions for compiling Vim on Openvms. If you already have an executable version of Vim, you don't need this. *************** *** 83,89 **** NORMAL - A default selection of features enabled BIG - Many features enabled, as rich as possible. (OpenVMS default) ! HUGE - All possible featues enabled. Uncommented - will default to BIG Default : MODEL = BIG --- 83,89 ---- NORMAL - A default selection of features enabled BIG - Many features enabled, as rich as possible. (OpenVMS default) ! HUGE - All possible features enabled. Uncommented - will default to BIG Default : MODEL = BIG diff -crN ../vim71/src/Make_cyg.mak ./src/Make_cyg.mak *** ../vim71/src/Make_cyg.mak Sun Apr 30 17:28:39 2006 --- ./src/Make_cyg.mak Sat Sep 29 13:09:34 2007 *************** *** 1,6 **** # # Makefile for VIM on Win32, using Cygnus gcc ! # Last updated by Dan Sharp. Last Change: 2006 Apr 30 # # Also read INSTALLpc.txt! # --- 1,6 ---- # # Makefile for VIM on Win32, using Cygnus gcc ! # Last updated by Dan Sharp. Last Change: 2007 Sep 29 # # Also read INSTALLpc.txt! # *************** *** 503,509 **** $(CC) -c $(CFLAGS) if_cscope.c -o $(OUTDIR)/if_cscope.o $(OUTDIR)/if_ole.o: if_ole.cpp $(INCL) ! $(CC) -c $(CFLAGS) -D__IID_DEFINED__ if_ole.cpp -o $(OUTDIR)/if_ole.o if_perl.c: if_perl.xs typemap $(PERL)/bin/perl `cygpath -d $(PERL)/lib/ExtUtils/xsubpp` \ --- 503,509 ---- $(CC) -c $(CFLAGS) if_cscope.c -o $(OUTDIR)/if_cscope.o $(OUTDIR)/if_ole.o: if_ole.cpp $(INCL) ! $(CC) -c $(CFLAGS) if_ole.cpp -o $(OUTDIR)/if_ole.o if_perl.c: if_perl.xs typemap $(PERL)/bin/perl `cygpath -d $(PERL)/lib/ExtUtils/xsubpp` \ diff -crN ../vim71/src/Make_ming.mak ./src/Make_ming.mak *** ../vim71/src/Make_ming.mak Mon May 7 21:48:44 2007 --- ./src/Make_ming.mak Sat Aug 11 14:52:11 2007 *************** *** 572,579 **** $(OUTDIR)/if_cscope.o: if_cscope.c $(INCL) if_cscope.h $(CC) -c $(CFLAGS) if_cscope.c -o $(OUTDIR)/if_cscope.o $(OUTDIR)/if_ole.o: if_ole.cpp $(INCL) ! $(CC) $(CFLAGS) -D__IID_DEFINED__ -c -o $(OUTDIR)/if_ole.o if_ole.cpp $(OUTDIR)/if_ruby.o: if_ruby.c $(INCL) ifeq (16, $(RUBY)) --- 572,580 ---- $(OUTDIR)/if_cscope.o: if_cscope.c $(INCL) if_cscope.h $(CC) -c $(CFLAGS) if_cscope.c -o $(OUTDIR)/if_cscope.o + # Remove -D__IID_DEFINED__ for newer versions of the w32api $(OUTDIR)/if_ole.o: if_ole.cpp $(INCL) ! $(CC) $(CFLAGS) -c -o $(OUTDIR)/if_ole.o if_ole.cpp $(OUTDIR)/if_ruby.o: if_ruby.c $(INCL) ifeq (16, $(RUBY)) diff -crN ../vim71/src/Make_mint.mak ./src/Make_mint.mak *** ../vim71/src/Make_mint.mak Mon Jun 7 16:32:28 2004 --- ./src/Make_mint.mak Sat Aug 18 14:01:51 2007 *************** *** 11,17 **** # Otherwise the postprocessing won't get done. # ! ### This Makefile has been succesfully tested on these systems. ### Check the (*) column for remarks, listed below. ### Later code changes may cause small problems, otherwise Vim is supposed to ### compile and run without problems. --- 11,17 ---- # Otherwise the postprocessing won't get done. # ! ### This Makefile has been successfully tested on these systems. ### Check the (*) column for remarks, listed below. ### Later code changes may cause small problems, otherwise Vim is supposed to ### compile and run without problems. diff -crN ../vim71/src/Make_mvc.mak ./src/Make_mvc.mak *** ../vim71/src/Make_mvc.mak Wed Feb 7 05:04:15 2007 --- ./src/Make_mvc.mak Thu Jul 24 15:06:07 2008 *************** *** 1,6 **** # 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), and VC8 (VS2005). # # To build using other Windows compilers, see INSTALLpc.txt # --- 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), ! # and VC9 (VS2008). # # To build using other Windows compilers, see INSTALLpc.txt # *************** *** 92,97 **** --- 93,100 ---- # Netbeans Debugging Support: NBDEBUG=[yes or no] (should be no, yes # doesn't work) # + # Visual C Version: MSVCVER=m.n (default derived from nmake if undefined) + # # You can combine any of these interfaces # # Example: To build the non-debug, GUI version with Perl interface: *************** *** 101,107 **** # This makefile gives a fineness of control which is not supported in # Visual C++ configuration files. Therefore, debugging requires a bit of # extra work. ! # Make_dvc.mak is a Visual C++ project to access that support. # To use Make_dvc.mak: # 1) Build Vim with Make_mvc.mak. # Use a "DEBUG=yes" argument to build Vim with debug support. --- 104,111 ---- # This makefile gives a fineness of control which is not supported in # Visual C++ configuration files. Therefore, debugging requires a bit of # extra work. ! # Make_dvc.mak is a Visual C++ project to access that support. It may be ! # badly out of date for the Visual C++ you are using... # To use Make_dvc.mak: # 1) Build Vim with Make_mvc.mak. # Use a "DEBUG=yes" argument to build Vim with debug support. *************** *** 189,214 **** CPU = i386 !endif # !PROCESSOR_ARCHITECTURE - !if ("$(CPU)" == "AMD64") || ("$(CPU)" == "IA64") - DEFINES=$(DEFINES) /Wp64 - !endif - # Build a retail version by default !if "$(DEBUG)" != "yes" NODEBUG = 1 !else MAKEFLAGS_GVIMEXT = DEBUG=yes !endif ! # Get all sorts of useful, standard macros from the SDK. (Note that ! # MSVC 2.2 does not install in the \msvc20\include ! # directory, but you can find it in \msvc20\include on the CD-ROM. ! # You may also need from the same place.) !include #>>>>> path of the compiler and linker; name of include and lib directories # PATH = c:\msvc20\bin;$(PATH) --- 193,217 ---- CPU = i386 !endif # !PROCESSOR_ARCHITECTURE # Build a retail version by default !if "$(DEBUG)" != "yes" NODEBUG = 1 !else + !undef NODEBUG MAKEFLAGS_GVIMEXT = DEBUG=yes !endif ! # Get all sorts of useful, standard macros from the Platform SDK. !include + # Turn on Win64 compatibility warnings for VC7.x and VC8. + # (/Wp64 is deprecated in VC9 and generates an obnoxious warning.) + !if ("$(MSVCVER)" == "7.0") || ("$(MSVCVER)" == "7.1") || ("$(MSVCVER)" == "8.0") + DEFINES=$(DEFINES) /Wp64 + !endif #>>>>> path of the compiler and linker; name of include and lib directories # PATH = c:\msvc20\bin;$(PATH) *************** *** 272,290 **** # Set which version of the CRT to use !if defined(USE_MSVCRT) ! CVARS = $(cvarsdll) # !elseif defined(MULTITHREADED) # CVARS = $(cvarsmt) !else # CVARS = $(cvars) ! CVARS = $(cvarsmt) !endif # need advapi32.lib for GetUserName() # need shell32.lib for ExtractIcon() # gdi32.lib and comdlg32.lib for printing support # ole32.lib and uuid.lib are needed for FEAT_SHORTCUT ! CON_LIB = advapi32.lib shell32.lib gdi32.lib comdlg32.lib ole32.lib uuid.lib !if "$(DELAYLOAD)" == "yes" CON_LIB = $(CON_LIB) /DELAYLOAD:comdlg32.dll /DELAYLOAD:ole32.dll DelayImp.lib !endif --- 275,294 ---- # Set which version of the CRT to use !if defined(USE_MSVCRT) ! # CVARS = $(cvarsdll) # !elseif defined(MULTITHREADED) # CVARS = $(cvarsmt) !else # CVARS = $(cvars) ! # CVARS = $(cvarsmt) !endif # need advapi32.lib for GetUserName() # need shell32.lib for ExtractIcon() # gdi32.lib and comdlg32.lib for printing support # ole32.lib and uuid.lib are needed for FEAT_SHORTCUT ! CON_LIB = oldnames.lib kernel32.lib advapi32.lib shell32.lib gdi32.lib \ ! comdlg32.lib ole32.lib uuid.lib /machine:$(CPU) /nodefaultlib !if "$(DELAYLOAD)" == "yes" CON_LIB = $(CON_LIB) /DELAYLOAD:comdlg32.dll /DELAYLOAD:ole32.dll DelayImp.lib !endif *************** *** 320,326 **** --- 324,374 ---- INTDIR=$(OBJDIR) OUTDIR=$(OBJDIR) + # Derive version of VC being used from nmake if not specified + !if "$(MSVCVER)" == "" + !if "$(_NMAKE_VER)" == "" + MSVCVER = 4.0 + !endif + !if "$(_NMAKE_VER)" == "162" + MSVCVER = 5.0 + !endif + !if "$(_NMAKE_VER)" == "6.00.8168.0" + MSVCVER = 6.0 + CPU = ix86 + !endif + !if "$(_NMAKE_VER)" == "7.00.9466" + MSVCVER = 7.0 + !endif + !if "$(_NMAKE_VER)" == "7.10.3077" + MSVCVER = 7.1 + !endif + !if "$(_NMAKE_VER)" == "8.00.50727.42" + MSVCVER = 8.0 + !endif + !if "$(_NMAKE_VER)" == "8.00.50727.762" + MSVCVER = 8.0 + !endif + !if "$(_NMAKE_VER)" == "9.00.20706.01" + MSVCVER = 9.0 + !endif + !if "$(_NMAKE_VER)" == "9.00.21022.08" + MSVCVER = 9.0 + !endif + !endif + + # Abort bulding VIM if version of VC is unrecognised. + !ifndef MSVCVER + !message *** ERROR + !message Cannot determine Visual C version being used. If you are using the + !message Windows SDK then you must have the environment variable MSVCVER set to + !message your version of the VC compiler. If you are not using the Express + !message version of Visual C, you can either set MSVCVER or update this makefile + !message to handle the new value for _NMAKE_VER, "$(_NMAKE_VER)". + !error Make aborted. + !endif + # Convert processor ID to MVC-compatible number + !if ("$(MSVCVER)" != "8.0") && ("$(MSVCVER)" != "9.0") !if "$(CPUNR)" == "i386" CPUARG = /G3 !elseif "$(CPUNR)" == "i486" *************** *** 334,339 **** --- 382,396 ---- !else CPUARG = !endif + !else + # VC8/9 only allows specifying SSE architecture + !if "$(CPUNR)" == "pentium4" + CPUARG = /arch:SSE2 + !endif + !endif + + LIBC = + DEBUGINFO = /Zi !ifdef NODEBUG VIM = vim *************** *** 344,384 **** !else # MAXSPEED OPTFLAG = /Ox !endif CFLAGS = $(CFLAGS) $(OPTFLAG) -DNDEBUG $(CPUARG) RCFLAGS = $(rcflags) $(rcvars) -DNDEBUG ! ifdef USE_MSVCRT ! CFLAGS = $(CFLAGS) -MD LIBC = msvcrt.lib - # CFLAGS = $(CFLAGS) $(cvarsdll) - # ! elseif defined(MULTITHREADED) - # LIBC = libcmt.lib - # CFLAGS = $(CFLAGS) $(cvarsmt) ! else - # LIBC = libc.lib LIBC = libcmt.lib ! # CFLAGS = $(CFLAGS) $(cvars) ! endif !else # DEBUG VIM = vimd CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /Od RCFLAGS = $(rcflags) $(rcvars) -D_DEBUG -DDEBUG # The /fixed:no is needed for Quantify. Assume not 4.? as unsupported in VC4.0. ! ! if "$(_NMAKE_VER)" == "" LIBC = ! else LIBC = /fixed:no ! endif ! ifdef USE_MSVCRT ! CFLAGS = $(CFLAGS) -MDd LIBC = $(LIBC) msvcrtd.lib - # CFLAGS = $(CFLAGS) $(cvarsdll) - # ! elseif defined(MULTITHREADED) - # LIBC = $(LIBC) libcmtd.lib - # CFLAGS = $(CFLAGS) $(cvarsmt) ! else - # LIBC = $(LIBC) libcd.lib LIBC = $(LIBC) libcmtd.lib ! # CFLAGS = $(CFLAGS) $(cvars) ! endif !endif # DEBUG --- 401,440 ---- !else # MAXSPEED OPTFLAG = /Ox !endif + !if ("$(MSVCVER)" == "8.0") || ("$(MSVCVER)" == "9.0") + # Use link time code generation if not worried about size + !if "$(OPTIMIZE)" != "SPACE" + OPTFLAG = $(OPTFLAG) /GL + !endif + !endif CFLAGS = $(CFLAGS) $(OPTFLAG) -DNDEBUG $(CPUARG) RCFLAGS = $(rcflags) $(rcvars) -DNDEBUG ! ifdef USE_MSVCRT ! CFLAGS = $(CFLAGS) /MD LIBC = msvcrt.lib ! else LIBC = libcmt.lib ! CFLAGS = $(CFLAGS) /Zl /MT ! endif !else # DEBUG VIM = vimd + ! if ("$(CPU)" == "i386") || ("$(CPU)" == "ix86") + DEBUGINFO = /ZI + ! endif CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /Od RCFLAGS = $(rcflags) $(rcvars) -D_DEBUG -DDEBUG # The /fixed:no is needed for Quantify. Assume not 4.? as unsupported in VC4.0. ! ! if "$(MSVCVER)" == "4.0" LIBC = ! else LIBC = /fixed:no ! endif ! ifdef USE_MSVCRT ! CFLAGS = $(CFLAGS) /MDd LIBC = $(LIBC) msvcrtd.lib ! else LIBC = $(LIBC) libcmtd.lib ! CFLAGS = $(CFLAGS) /Zl /MTd ! endif !endif # DEBUG *************** *** 488,494 **** $(OUTDIR)\gui_w32.obj \ $(OUTDIR)\os_w32exe.obj GUI_LIB = \ ! oldnames.lib kernel32.lib gdi32.lib version.lib $(IME_LIB) \ winspool.lib comctl32.lib advapi32.lib shell32.lib \ /machine:$(CPU) /nodefaultlib !else --- 544,550 ---- $(OUTDIR)\gui_w32.obj \ $(OUTDIR)\os_w32exe.obj GUI_LIB = \ ! gdi32.lib version.lib $(IME_LIB) \ winspool.lib comctl32.lib advapi32.lib shell32.lib \ /machine:$(CPU) /nodefaultlib !else *************** *** 681,696 **** # # Always generate the .pdb file, so that we get debug symbols that can be used # on a crash (doesn't add overhead to the executable). # ! CFLAGS = $(CFLAGS) /Zi /Fd$(OUTDIR)/ ! LINK_PDB = /PDB:$(VIM).pdb -debug # -debug:full -debugtype:cv,fixup # # End extra feature include # !message ! conflags = /nologo /subsystem:$(SUBSYSTEM) /incremental:no PATHDEF_SRC = $(OUTDIR)\pathdef.c --- 737,754 ---- # # Always generate the .pdb file, so that we get debug symbols that can be used # on a crash (doesn't add overhead to the executable). + # Generate edit-and-continue debug info when no optimization - allows to + # debug more conveniently (able to look at variables which are in registers) # ! CFLAGS = $(CFLAGS) /Fd$(OUTDIR)/ $(DEBUGINFO) ! LINK_PDB = /PDB:$(VIM).pdb -debug # # End extra feature include # !message ! conflags = /nologo /subsystem:$(SUBSYSTEM) PATHDEF_SRC = $(OUTDIR)\pathdef.c *************** *** 702,712 **** conflags = $(conflags) /map /mapinfo:lines !ENDIF ! LINKARGS1 = $(linkdebug) $(conflags) /nodefaultlib:libc LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(LIBC) $(OLE_LIB) user32.lib $(SNIFF_LIB) \ $(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(RUBY_LIB) \ $(TCL_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB) all: $(VIM).exe vimrun.exe install.exe uninstal.exe xxd/xxd.exe \ GvimExt/gvimext.dll --- 760,779 ---- conflags = $(conflags) /map /mapinfo:lines !ENDIF ! LINKARGS1 = $(linkdebug) $(conflags) LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(LIBC) $(OLE_LIB) user32.lib $(SNIFF_LIB) \ $(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(RUBY_LIB) \ $(TCL_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB) + # Report link time code generation progress if used. + !ifdef NODEBUG + !if ("$(MSVCVER)" == "8.0") || ("$(MSVCVER)" == "9.0") + !if "$(OPTIMIZE)" != "SPACE" + LINKARGS1 = $(LINKARGS1) /LTCG:STATUS + !endif + !endif + !endif + all: $(VIM).exe vimrun.exe install.exe uninstal.exe xxd/xxd.exe \ GvimExt/gvimext.dll *************** *** 794,800 **** # Create a default rule for transforming .c files to .obj files in $(OUTDIR) # Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later) ! !IF "$(_NMAKE_VER)" == "" .c{$(OUTDIR)/}.obj: !ELSE .c{$(OUTDIR)/}.obj:: --- 861,867 ---- # Create a default rule for transforming .c files to .obj files in $(OUTDIR) # Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later) ! !IF "$(MSVCVER)" == "4.0" .c{$(OUTDIR)/}.obj: !ELSE .c{$(OUTDIR)/}.obj:: *************** *** 803,809 **** # Create a default rule for transforming .cpp files to .obj files in $(OUTDIR) # Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later) ! !IF "$(_NMAKE_VER)" == "" .cpp{$(OUTDIR)/}.obj: !ELSE .cpp{$(OUTDIR)/}.obj:: --- 870,876 ---- # Create a default rule for transforming .cpp files to .obj files in $(OUTDIR) # Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later) ! !IF "$(MSVCVER)" == "4.0" .cpp{$(OUTDIR)/}.obj: !ELSE .cpp{$(OUTDIR)/}.obj:: diff -crN ../vim71/src/Make_os2.mak ./src/Make_os2.mak *** ../vim71/src/Make_os2.mak Fri Mar 24 18:03:33 2006 --- ./src/Make_os2.mak Sat Aug 18 14:01:51 2007 *************** *** 4,10 **** # Created by: Paul Slootman # ! ### This Makefile has been succesfully tested on these systems. ### Check the (*) column for remarks, listed below. ### Later code changes may cause small problems, otherwise Vim is supposed to ### compile and run without problems. --- 4,10 ---- # Created by: Paul Slootman # ! ### This Makefile has been successfully tested on these systems. ### Check the (*) column for remarks, listed below. ### Later code changes may cause small problems, otherwise Vim is supposed to ### compile and run without problems. diff -crN ../vim71/src/Make_vms.mms ./src/Make_vms.mms *** ../vim71/src/Make_vms.mms Mon May 7 21:49:51 2007 --- ./src/Make_vms.mms Mon Oct 22 21:13:08 2007 *************** *** 2,8 **** # Makefile for Vim on OpenVMS # # Maintainer: Zoltan Arpadffy ! # Last change: 2007 May 07 # # This has script been tested on VMS 6.2 to 8.2 on DEC Alpha, VAX and IA64 # with MMS and MMK --- 2,8 ---- # Makefile for Vim on OpenVMS # # Maintainer: Zoltan Arpadffy ! # Last change: 2007 Oct 22 # # This has script been tested on VMS 6.2 to 8.2 on DEC Alpha, VAX and IA64 # with MMS and MMK *************** *** 96,103 **** .IFDEF MMSVAX .IFDEF DECC # VAX with DECC ! CC_DEF = cc # /decc # some system requires this switch ! # but when it is not required /ver might fail PREFIX = /prefix=all .ELSE # VAX with VAXC CC_DEF = cc --- 96,102 ---- .IFDEF MMSVAX .IFDEF DECC # VAX with DECC ! CC_DEF = cc # /decc # some system requires this switch but when it is not required /ver might fail PREFIX = /prefix=all .ELSE # VAX with VAXC CC_DEF = cc diff -crN ../vim71/src/dosinst.c ./src/dosinst.c *** ../vim71/src/dosinst.c Mon May 7 21:15:43 2007 --- ./src/dosinst.c Tue Jul 10 16:07:16 2007 *************** *** 1365,1371 **** printf("Creating \"Edit with Vim\" popup menu entry\n"); ! fprintf(fd, "HKEY_CLASSES_ROOT\\CLSID\\%s\n", vim_ext_clsid); fprintf(fd, "@=\"%s\"\n", vim_ext_name); fprintf(fd, "[HKEY_CLASSES_ROOT\\CLSID\\%s\\InProcServer32]\n", vim_ext_clsid); --- 1365,1371 ---- printf("Creating \"Edit with Vim\" popup menu entry\n"); ! fprintf(fd, "[HKEY_CLASSES_ROOT\\CLSID\\%s]\n", vim_ext_clsid); fprintf(fd, "@=\"%s\"\n", vim_ext_name); fprintf(fd, "[HKEY_CLASSES_ROOT\\CLSID\\%s\\InProcServer32]\n", vim_ext_clsid); diff -crN ../vim71/src/gui_mac.c ./src/gui_mac.c *** ../vim71/src/gui_mac.c Mon May 7 21:50:09 2007 --- ./src/gui_mac.c Sat Aug 9 17:19:02 2008 *************** *** 59,65 **** --- 59,92 ---- #ifdef MACOS_CONVERT # define USE_CARBONKEYHANDLER + + static int im_is_active = FALSE; + #if 0 + /* TODO: Implement me! */ + static int im_start_row = 0; + static int im_start_col = 0; + #endif + + #define NR_ELEMS(x) (sizeof(x) / sizeof(x[0])) + + static TSMDocumentID gTSMDocument; + + static void im_on_window_switch(int active); static EventHandlerUPP keyEventHandlerUPP = NULL; + static EventHandlerUPP winEventHandlerUPP = NULL; + + static pascal OSStatus gui_mac_handle_window_activate( + EventHandlerCallRef nextHandler, EventRef theEvent, void *data); + + static pascal OSStatus gui_mac_handle_text_input( + EventHandlerCallRef nextHandler, EventRef theEvent, void *data); + + static pascal OSStatus gui_mac_update_input_area( + EventHandlerCallRef nextHandler, EventRef theEvent); + + static pascal OSStatus gui_mac_unicode_key_event( + EventHandlerCallRef nextHandler, EventRef theEvent); + #endif *************** *** 127,132 **** --- 154,162 ---- /* Keeping track of which scrollbar is being dragged */ static ControlHandle dragged_sb = NULL; + /* Vector of char_u --> control index for hotkeys in dialogs */ + static short *gDialogHotKeys; + static struct { FMFontFamily family; *************** *** 137,143 **** --- 167,177 ---- #ifdef MACOS_CONVERT # define USE_ATSUI_DRAWING + int p_macatsui_last; ATSUStyle gFontStyle; + # ifdef FEAT_MBYTE + ATSUStyle gWideFontStyle; + # endif Boolean gIsFontFallbackSet; #endif *************** *** 265,270 **** --- 299,309 ---- static WindowRef drawer = NULL; // TODO: put into gui.h #endif + #ifdef USE_ATSUI_DRAWING + static void gui_mac_set_font_attributes(GuiFont font); + static void gui_mac_dispose_atsui_style(void); + #endif + /* * ------------------------------------------------------------ * Conversion Utility *************** *** 446,452 **** CFMutableStringRef cleanedName; menuTitleLen = STRLEN(menu->dname); ! name = mac_enc_to_cfstring(menu->dname, menuTitleLen); if (name) { --- 485,491 ---- CFMutableStringRef cleanedName; menuTitleLen = STRLEN(menu->dname); ! name = (CFStringRef) mac_enc_to_cfstring(menu->dname, menuTitleLen); if (name) { *************** *** 1046,1051 **** --- 1085,1091 ---- { int i; char_u *p; + int fnum = -1; /* these are the initial files dropped on the Vim icon */ for (i = 0 ; i < numFiles; i++) *************** *** 1055,1060 **** --- 1095,1112 ---- mch_exit(2); else alist_add(&global_alist, p, 2); + if (fnum == -1) + fnum = GARGLIST[GARGCOUNT - 1].ae_fnum; + } + + /* If the file name was already in the buffer list we need to switch + * to it. */ + if (curbuf->b_fnum != fnum) + { + char_u cmd[30]; + + vim_snprintf((char *)cmd, 30, "silent %dbuffer", fnum); + do_cmdline_cmd(cmd); } /* Change directory to the location of the first file. */ *************** *** 1676,1688 **** /* TODO: NEEDED? */ clickIsPopup = FALSE; ! if ((gui.MacOSHaveCntxMenu) && (mouse_model_popup())) ! if (IsShowContextualMenuClick(theEvent)) ! { ! vimMouseButton = MOUSE_RIGHT; ! vimModifiers &= ~MOUSE_CTRL; ! clickIsPopup = TRUE; ! } /* Is it a double click ? */ dblClick = ((theEvent->when - lastMouseTick) < GetDblTime()); --- 1728,1739 ---- /* TODO: NEEDED? */ clickIsPopup = FALSE; ! if (mouse_model_popup() && IsShowContextualMenuClick(theEvent)) ! { ! vimMouseButton = MOUSE_RIGHT; ! vimModifiers &= ~MOUSE_CTRL; ! clickIsPopup = TRUE; ! } /* Is it a double click ? */ dblClick = ((theEvent->when - lastMouseTick) < GetDblTime()); *************** *** 1920,1943 **** WindowPtr whichWindow; whichWindow = (WindowPtr) event->message; ! if ((event->modifiers) & activeFlag) ! /* Activate */ ! gui_focus_change(TRUE); ! else { ! /* Deactivate */ ! gui_focus_change(FALSE); ! /* DON'T KNOW what the code below was doing ! found in the deactivate clause, but the ! clause writing TRUE into in_focus (BUG) ! */ ! ! #if 0 /* Removed by Dany as per above June 2001 */ ! a_bool = false; ! SetPreserveGlyph(a_bool); ! SetOutlinePreferred(a_bool); ! #endif } } --- 1971,1989 ---- WindowPtr whichWindow; whichWindow = (WindowPtr) event->message; ! /* Dim scrollbars */ ! if (whichWindow == gui.VimWindow) { ! ControlRef rootControl; ! GetRootControl(gui.VimWindow, &rootControl); ! if ((event->modifiers) & activeFlag) ! ActivateControl(rootControl); ! else ! DeactivateControl(rootControl); } + + /* Activate */ + gui_focus_change((event->modifiers) & activeFlag); } *************** *** 1969,1983 **** * Handle the key */ #ifdef USE_CARBONKEYHANDLER ! static int dialog_busy = FALSE; /* TRUE when gui_mch_dialog() wants the keys */ # define INLINE_KEY_BUFFER_SIZE 80 static pascal OSStatus ! gui_mac_doKeyEventCarbon( EventHandlerCallRef nextHandler, ! EventRef theEvent, ! void *data) { /* Multibyte-friendly key event handler */ OSStatus err = -1; --- 2015,2101 ---- * Handle the key */ #ifdef USE_CARBONKEYHANDLER + static pascal OSStatus + gui_mac_handle_window_activate( + EventHandlerCallRef nextHandler, + EventRef theEvent, + void *data) + { + UInt32 eventClass = GetEventClass(theEvent); + UInt32 eventKind = GetEventKind(theEvent); + + if (eventClass == kEventClassWindow) + { + switch (eventKind) + { + case kEventWindowActivated: + #if defined(USE_IM_CONTROL) + im_on_window_switch(TRUE); + #endif + return noErr; + + case kEventWindowDeactivated: + #if defined(USE_IM_CONTROL) + im_on_window_switch(FALSE); + #endif + return noErr; + } + } + + return eventNotHandledErr; + } + + static pascal OSStatus + gui_mac_handle_text_input( + EventHandlerCallRef nextHandler, + EventRef theEvent, + void *data) + { + UInt32 eventClass = GetEventClass(theEvent); + UInt32 eventKind = GetEventKind(theEvent); + + if (eventClass != kEventClassTextInput) + return eventNotHandledErr; + + if ((kEventTextInputUpdateActiveInputArea != eventKind) && + (kEventTextInputUnicodeForKeyEvent != eventKind) && + (kEventTextInputOffsetToPos != eventKind) && + (kEventTextInputPosToOffset != eventKind) && + (kEventTextInputGetSelectedText != eventKind)) + return eventNotHandledErr; + + switch (eventKind) + { + case kEventTextInputUpdateActiveInputArea: + return gui_mac_update_input_area(nextHandler, theEvent); + case kEventTextInputUnicodeForKeyEvent: + return gui_mac_unicode_key_event(nextHandler, theEvent); + + case kEventTextInputOffsetToPos: + case kEventTextInputPosToOffset: + case kEventTextInputGetSelectedText: + break; + } + + return eventNotHandledErr; + } + + static pascal + OSStatus gui_mac_update_input_area( + EventHandlerCallRef nextHandler, + EventRef theEvent) + { + return eventNotHandledErr; + } ! static int dialog_busy = FALSE; /* TRUE when gui_mch_dialog() wants the ! keys */ # define INLINE_KEY_BUFFER_SIZE 80 static pascal OSStatus ! gui_mac_unicode_key_event( EventHandlerCallRef nextHandler, ! EventRef theEvent) { /* Multibyte-friendly key event handler */ OSStatus err = -1; *************** *** 1993,1999 **** char_u *to = NULL; Boolean isSpecial = FALSE; int i; ! EventRef keyEvent; /* Mask the mouse (as per user setting) */ if (p_mh) --- 2111,2117 ---- char_u *to = NULL; Boolean isSpecial = FALSE; int i; ! EventRef keyEvent; /* Mask the mouse (as per user setting) */ if (p_mh) *************** *** 2001,2039 **** /* Don't use the keys when the dialog wants them. */ if (dialog_busy) ! return eventNotHandledErr; if (noErr != GetEventParameter(theEvent, kEventParamTextInputSendText, ! typeUnicodeText, NULL, 0, &actualSize, NULL)) ! return eventNotHandledErr; text = (UniChar *)alloc(actualSize); if (!text) ! return eventNotHandledErr; err = GetEventParameter(theEvent, kEventParamTextInputSendText, ! typeUnicodeText, NULL, actualSize, NULL, text); require_noerr(err, done); err = GetEventParameter(theEvent, kEventParamTextInputSendKeyboardEvent, ! typeEventRef, NULL, sizeof(EventRef), NULL, &keyEvent); require_noerr(err, done); err = GetEventParameter(keyEvent, kEventParamKeyModifiers, ! typeUInt32, NULL, sizeof(UInt32), NULL, &modifiers); require_noerr(err, done); err = GetEventParameter(keyEvent, kEventParamKeyCode, ! typeUInt32, NULL, sizeof(UInt32), NULL, &key_sym); require_noerr(err, done); err = GetEventParameter(keyEvent, kEventParamKeyMacCharCodes, ! typeChar, NULL, sizeof(char), NULL, &charcode); require_noerr(err, done); #ifndef USE_CMD_KEY if (modifiers & cmdKey) ! goto done; /* Let system handle Cmd+... */ #endif key_char = charcode; --- 2119,2157 ---- /* Don't use the keys when the dialog wants them. */ if (dialog_busy) ! return eventNotHandledErr; if (noErr != GetEventParameter(theEvent, kEventParamTextInputSendText, ! typeUnicodeText, NULL, 0, &actualSize, NULL)) ! return eventNotHandledErr; text = (UniChar *)alloc(actualSize); if (!text) ! return eventNotHandledErr; err = GetEventParameter(theEvent, kEventParamTextInputSendText, ! typeUnicodeText, NULL, actualSize, NULL, text); require_noerr(err, done); err = GetEventParameter(theEvent, kEventParamTextInputSendKeyboardEvent, ! typeEventRef, NULL, sizeof(EventRef), NULL, &keyEvent); require_noerr(err, done); err = GetEventParameter(keyEvent, kEventParamKeyModifiers, ! typeUInt32, NULL, sizeof(UInt32), NULL, &modifiers); require_noerr(err, done); err = GetEventParameter(keyEvent, kEventParamKeyCode, ! typeUInt32, NULL, sizeof(UInt32), NULL, &key_sym); require_noerr(err, done); err = GetEventParameter(keyEvent, kEventParamKeyMacCharCodes, ! typeChar, NULL, sizeof(char), NULL, &charcode); require_noerr(err, done); #ifndef USE_CMD_KEY if (modifiers & cmdKey) ! goto done; /* Let system handle Cmd+... */ #endif key_char = charcode; *************** *** 2041,2124 **** /* Find the special key (eg., for cursor keys) */ if (actualSize <= sizeof(UniChar) && ! ((text[0] < 0x20) || (text[0] == 0x7f))) { ! for (i = 0; special_keys[i].key_sym != (KeySym)0; ++i) ! if (special_keys[i].key_sym == key_sym) ! { ! key_char = TO_SPECIAL(special_keys[i].vim_code0, ! special_keys[i].vim_code1); ! key_char = simplify_key(key_char, ! (int *)&vimModifiers); ! isSpecial = TRUE; ! break; ! } } /* Intercept CMD-. and CTRL-c */ if (((modifiers & controlKey) && key_char == 'c') || ! ((modifiers & cmdKey) && key_char == '.')) ! got_int = TRUE; if (!isSpecial) { ! /* remove SHIFT for keys that are already shifted, e.g., ! * '(' and '*' */ ! if (key_char < 0x100 && !isalpha(key_char) && isprint(key_char)) ! vimModifiers &= ~MOD_MASK_SHIFT; ! ! /* remove CTRL from keys that already have it */ ! if (key_char < 0x20) ! vimModifiers &= ~MOD_MASK_CTRL; ! ! /* don't process unicode characters here */ ! if (!IS_SPECIAL(key_char)) ! { ! /* Following code to simplify and consolidate vimModifiers ! * taken liberally from gui_w48.c */ ! key_char = simplify_key(key_char, (int *)&vimModifiers); ! ! /* Interpret META, include SHIFT, etc. */ ! key_char = extract_modifiers(key_char, (int *)&vimModifiers); ! if (key_char == CSI) ! key_char = K_CSI; ! ! if (IS_SPECIAL(key_char)) ! isSpecial = TRUE; ! } } if (vimModifiers) { ! result[len++] = CSI; ! result[len++] = KS_MODIFIER; ! result[len++] = vimModifiers; } if (isSpecial && IS_SPECIAL(key_char)) { ! result[len++] = CSI; ! result[len++] = K_SECOND(key_char); ! result[len++] = K_THIRD(key_char); } else { ! encLen = actualSize; ! to = mac_utf16_to_enc(text, actualSize, &encLen); ! if (to) ! { ! /* This is basically add_to_input_buf_csi() */ ! for (i = 0; i < encLen && len < (INLINE_KEY_BUFFER_SIZE-1); ++i) ! { ! result[len++] = to[i]; ! if (to[i] == CSI) ! { ! result[len++] = KS_EXTRA; ! result[len++] = (int)KE_CSI; ! } ! } ! vim_free(to); ! } } add_to_input_buf(result, len); --- 2159,2242 ---- /* Find the special key (eg., for cursor keys) */ if (actualSize <= sizeof(UniChar) && ! ((text[0] < 0x20) || (text[0] == 0x7f))) { ! for (i = 0; special_keys[i].key_sym != (KeySym)0; ++i) ! if (special_keys[i].key_sym == key_sym) ! { ! key_char = TO_SPECIAL(special_keys[i].vim_code0, ! special_keys[i].vim_code1); ! key_char = simplify_key(key_char, ! (int *)&vimModifiers); ! isSpecial = TRUE; ! break; ! } } /* Intercept CMD-. and CTRL-c */ if (((modifiers & controlKey) && key_char == 'c') || ! ((modifiers & cmdKey) && key_char == '.')) ! got_int = TRUE; if (!isSpecial) { ! /* remove SHIFT for keys that are already shifted, e.g., ! * '(' and '*' */ ! if (key_char < 0x100 && !isalpha(key_char) && isprint(key_char)) ! vimModifiers &= ~MOD_MASK_SHIFT; ! ! /* remove CTRL from keys that already have it */ ! if (key_char < 0x20) ! vimModifiers &= ~MOD_MASK_CTRL; ! ! /* don't process unicode characters here */ ! if (!IS_SPECIAL(key_char)) ! { ! /* Following code to simplify and consolidate vimModifiers ! * taken liberally from gui_w48.c */ ! key_char = simplify_key(key_char, (int *)&vimModifiers); ! ! /* Interpret META, include SHIFT, etc. */ ! key_char = extract_modifiers(key_char, (int *)&vimModifiers); ! if (key_char == CSI) ! key_char = K_CSI; ! ! if (IS_SPECIAL(key_char)) ! isSpecial = TRUE; ! } } if (vimModifiers) { ! result[len++] = CSI; ! result[len++] = KS_MODIFIER; ! result[len++] = vimModifiers; } if (isSpecial && IS_SPECIAL(key_char)) { ! result[len++] = CSI; ! result[len++] = K_SECOND(key_char); ! result[len++] = K_THIRD(key_char); } else { ! encLen = actualSize; ! to = mac_utf16_to_enc(text, actualSize, &encLen); ! if (to) ! { ! /* This is basically add_to_input_buf_csi() */ ! for (i = 0; i < encLen && len < (INLINE_KEY_BUFFER_SIZE-1); ++i) ! { ! result[len++] = to[i]; ! if (to[i] == CSI) ! { ! result[len++] = KS_EXTRA; ! result[len++] = (int)KE_CSI; ! } ! } ! vim_free(to); ! } } add_to_input_buf(result, len); *************** *** 2128,2137 **** vim_free(text); if (err == noErr) { ! /* Fake event to wake up WNE (required to get ! * key repeat working */ ! PostEvent(keyUp, 0); ! return noErr; } return eventNotHandledErr; --- 2246,2255 ---- vim_free(text); if (err == noErr) { ! /* Fake event to wake up WNE (required to get ! * key repeat working */ ! PostEvent(keyUp, 0); ! return noErr; } return eventNotHandledErr; *************** *** 2327,2333 **** /* prevent that the vim window size changes if it's activated by a click into the tab pane */ if (whichWindow == drawer) ! return; #endif switch (thePart) --- 2445,2451 ---- /* prevent that the vim window size changes if it's activated by a click into the tab pane */ if (whichWindow == drawer) ! return; #endif switch (thePart) *************** *** 2426,2432 **** gui_mac_mouse_wheel(EventHandlerCallRef nextHandler, EventRef theEvent, void *data) { - EventRef bogusEvent; Point point; Rect bounds; UInt32 mod; --- 2544,2549 ---- *************** *** 2457,2472 **** if (mod & optionKey) vim_mod |= MOUSE_ALT; - /* post a bogus event to wake up WaitNextEvent */ - if (noErr != CreateEvent(NULL, kEventClassMouse, kEventMouseMoved, 0, - kEventAttributeNone, &bogusEvent)) - goto bail; - if (noErr != PostEventToQueue(GetMainEventQueue(), bogusEvent, - kEventPriorityLow)) - goto bail; - - ReleaseEvent(bogusEvent); - if (noErr == GetWindowBounds(gui.VimWindow, kWindowContentRgn, &bounds)) { point.h -= bounds.left; --- 2574,2579 ---- *************** *** 2476,2481 **** --- 2583,2591 ---- gui_send_mouse_event((delta > 0) ? MOUSE_4 : MOUSE_5, point.h, point.v, FALSE, vim_mod); + /* post a bogus event to wake up WaitNextEvent */ + PostEvent(keyUp, 0); + return noErr; bail: *************** *** 2559,2574 **** OSErr error; /* Handle contextual menu right now (if needed) */ ! if (gui.MacOSHaveCntxMenu) ! if (IsShowContextualMenuClick(event)) ! { # if 0 ! gui_mac_handle_contextual_menu(event); # else ! gui_mac_doMouseDownEvent(event); # endif ! return; ! } /* Handle normal event */ switch (event->what) --- 2669,2683 ---- OSErr error; /* Handle contextual menu right now (if needed) */ ! if (IsShowContextualMenuClick(event)) ! { # if 0 ! gui_mac_handle_contextual_menu(event); # else ! gui_mac_doMouseDownEvent(event); # endif ! return; ! } /* Handle normal event */ switch (event->what) *************** *** 2782,2795 **** (void) InstallAEHandlers(); #endif - if (Gestalt(gestaltContextualMenuAttr, &gestalt_rc) == noErr) - gui.MacOSHaveCntxMenu = BitTst(&gestalt_rc, 31-gestaltContextualMenuTrapAvailable); - else - gui.MacOSHaveCntxMenu = false; - - if (gui.MacOSHaveCntxMenu) - gui.MacOSHaveCntxMenu = (InitContextualMenus()==noErr); - pomme = NewMenu(256, "\p\024"); /* 0x14= = Apple Menu */ AppendMenu(pomme, "\pAbout VIM"); --- 2891,2896 ---- *************** *** 2834,2840 **** # else /* OSErr GetApplicationBundleFSSpec(FSSpecPtr theFSSpecPtr) * of TN2015 - * This technic remove the ../Contents/MacOS/etc part */ (void)GetCurrentProcess(&psn); /* if (err != noErr) return err; */ --- 2935,2940 ---- *************** *** 2933,2946 **** gui_mch_init(void) { /* TODO: Move most of this stuff toward gui_mch_init */ ! Rect windRect; ! MenuHandle pomme; ! long gestalt_rc; ! EventTypeSpec eventTypeSpec; EventHandlerRef mouseWheelHandlerRef; ! #ifdef USE_CARBONKEYHANDLER ! EventHandlerRef keyEventHandlerRef; ! #endif if (Gestalt(gestaltSystemVersion, &gMacSystemVersion) != noErr) gMacSystemVersion = 0x1000; /* TODO: Default to minimum sensible value */ --- 3033,3043 ---- gui_mch_init(void) { /* TODO: Move most of this stuff toward gui_mch_init */ ! Rect windRect; ! MenuHandle pomme; EventHandlerRef mouseWheelHandlerRef; ! EventTypeSpec eventTypeSpec; ! ControlRef rootControl; if (Gestalt(gestaltSystemVersion, &gMacSystemVersion) != noErr) gMacSystemVersion = 0x1000; /* TODO: Default to minimum sensible value */ *************** *** 2954,2968 **** (void) InstallAEHandlers(); #endif - /* Ctrl click */ - if (Gestalt(gestaltContextualMenuAttr, &gestalt_rc) == noErr) - gui.MacOSHaveCntxMenu = BitTst(&gestalt_rc, 31-gestaltContextualMenuTrapAvailable); - else - gui.MacOSHaveCntxMenu = false; - - if (gui.MacOSHaveCntxMenu) - gui.MacOSHaveCntxMenu = (InitContextualMenus()==noErr); - pomme = NewMenu(256, "\p\024"); /* 0x14= = Apple Menu */ AppendMenu(pomme, "\pAbout VIM"); --- 3051,3056 ---- *************** *** 2981,2986 **** --- 3069,3075 ---- gui.VimWindow = NewCWindow(nil, &windRect, "\pgVim on Macintosh", true, zoomDocProc, (WindowPtr)-1L, true, 0); + CreateRootControl(gui.VimWindow, &rootControl); InstallReceiveHandler((DragReceiveHandlerUPP)receiveHandler, gui.VimWindow, NULL); SetPortWindowPort(gui.VimWindow); *************** *** 3052,3067 **** } #ifdef USE_CARBONKEYHANDLER ! eventTypeSpec.eventClass = kEventClassTextInput; ! eventTypeSpec.eventKind = kEventUnicodeForKeyEvent; ! keyEventHandlerUPP = NewEventHandlerUPP(gui_mac_doKeyEventCarbon); ! if (noErr != InstallApplicationEventHandler(keyEventHandlerUPP, 1, ! &eventTypeSpec, NULL, &keyEventHandlerRef)) { - keyEventHandlerRef = NULL; DisposeEventHandlerUPP(keyEventHandlerUPP); keyEventHandlerUPP = NULL; } #endif /* --- 3141,3187 ---- } #ifdef USE_CARBONKEYHANDLER ! InterfaceTypeList supportedServices = { kUnicodeDocument }; ! NewTSMDocument(1, supportedServices, &gTSMDocument, 0); ! ! /* We don't support inline input yet, use input window by default */ ! UseInputWindow(gTSMDocument, TRUE); ! ! /* Should we activate the document by default? */ ! // ActivateTSMDocument(gTSMDocument); ! ! EventTypeSpec textEventTypes[] = { ! { kEventClassTextInput, kEventTextInputUpdateActiveInputArea }, ! { kEventClassTextInput, kEventTextInputUnicodeForKeyEvent }, ! { kEventClassTextInput, kEventTextInputPosToOffset }, ! { kEventClassTextInput, kEventTextInputOffsetToPos }, ! }; ! ! keyEventHandlerUPP = NewEventHandlerUPP(gui_mac_handle_text_input); ! if (noErr != InstallApplicationEventHandler(keyEventHandlerUPP, ! NR_ELEMS(textEventTypes), ! textEventTypes, NULL, NULL)) { DisposeEventHandlerUPP(keyEventHandlerUPP); keyEventHandlerUPP = NULL; } + + EventTypeSpec windowEventTypes[] = { + { kEventClassWindow, kEventWindowActivated }, + { kEventClassWindow, kEventWindowDeactivated }, + }; + + /* Install window event handler to support TSMDocument activate and + * deactivate */ + winEventHandlerUPP = NewEventHandlerUPP(gui_mac_handle_window_activate); + if (noErr != InstallWindowEventHandler(gui.VimWindow, + winEventHandlerUPP, + NR_ELEMS(windowEventTypes), + windowEventTypes, NULL, NULL)) + { + DisposeEventHandlerUPP(winEventHandlerUPP); + winEventHandlerUPP = NULL; + } #endif /* *************** *** 3117,3122 **** --- 3237,3255 ---- return OK; } + #ifdef USE_ATSUI_DRAWING + static void + gui_mac_dispose_atsui_style(void) + { + if (p_macatsui && gFontStyle) + ATSUDisposeStyle(gFontStyle); + #ifdef FEAT_MBYTE + if (p_macatsui && gWideFontStyle) + ATSUDisposeStyle(gWideFontStyle); + #endif + } + #endif + void gui_mch_exit(int rc) { *************** *** 3132,3139 **** DisposeEventHandlerUPP(mouseWheelHandlerUPP); #ifdef USE_ATSUI_DRAWING ! if (p_macatsui && gFontStyle) ! ATSUDisposeStyle(gFontStyle); #endif /* Exit to shell? */ --- 3265,3277 ---- DisposeEventHandlerUPP(mouseWheelHandlerUPP); #ifdef USE_ATSUI_DRAWING ! gui_mac_dispose_atsui_style(); ! #endif ! ! #ifdef USE_CARBONKEYHANDLER ! FixTSMDocument(gTSMDocument); ! DeactivateTSMDocument(gTSMDocument); ! DeleteTSMDocument(gTSMDocument); #endif /* Exit to shell? */ *************** *** 3171,3177 **** /* TODO: Should make sure the window is move within range * e.g.: y > ~16 [Menu bar], x > 0, x < screen width */ ! MoveWindow(gui.VimWindow, x, y, TRUE); } void --- 3309,3315 ---- /* TODO: Should make sure the window is move within range * e.g.: y > ~16 [Menu bar], x > 0, x < screen width */ ! MoveWindowStructure(gui.VimWindow, x, y); } void *************** *** 3273,3278 **** --- 3411,3436 ---- return selected_font; } + #ifdef USE_ATSUI_DRAWING + static void + gui_mac_create_atsui_style(void) + { + if (p_macatsui && gFontStyle == NULL) + { + if (ATSUCreateStyle(&gFontStyle) != noErr) + gFontStyle = NULL; + } + #ifdef FEAT_MBYTE + if (p_macatsui && gWideFontStyle == NULL) + { + if (ATSUCreateStyle(&gWideFontStyle) != noErr) + gWideFontStyle = NULL; + } + #endif + + p_macatsui_last = p_macatsui; + } + #endif /* * Initialise vim to use the font with the given name. Return FAIL if the font *************** *** 3290,3300 **** char_u used_font_name[512]; #ifdef USE_ATSUI_DRAWING ! if (p_macatsui && gFontStyle == NULL) ! { ! if (ATSUCreateStyle(&gFontStyle) != noErr) ! gFontStyle = NULL; ! } #endif if (font_name == NULL) --- 3448,3454 ---- char_u used_font_name[512]; #ifdef USE_ATSUI_DRAWING ! gui_mac_create_atsui_style(); #endif if (font_name == NULL) *************** *** 3358,3406 **** gui.char_height = font_info.ascent + font_info.descent + p_linespace; #ifdef USE_ATSUI_DRAWING - ATSUFontID fontID; - Fixed fontSize; - ATSStyleRenderingOptions fontOptions; - if (p_macatsui && gFontStyle) ! { ! fontID = font & 0xFFFF; ! fontSize = Long2Fix(font >> 16); ! ! /* No antialiasing by default (do not attempt to touch antialising ! * options on pre-Jaguar) */ ! fontOptions = ! (gMacSystemVersion >= 0x1020) ? ! kATSStyleNoAntiAliasing : ! kATSStyleNoOptions; ! ! ATSUAttributeTag attribTags[] = ! { ! kATSUFontTag, kATSUSizeTag, kATSUStyleRenderingOptionsTag, ! kATSUMaxATSUITagValue+1 ! }; ! ByteCount attribSizes[] = ! { ! sizeof(ATSUFontID), sizeof(Fixed), ! sizeof(ATSStyleRenderingOptions), sizeof font ! }; ! ATSUAttributeValuePtr attribValues[] = ! { ! &fontID, &fontSize, &fontOptions, &font ! }; ! ! /* Convert font id to ATSUFontID */ ! if (FMGetFontFromFontFamilyInstance(fontID, 0, &fontID, NULL) == noErr) ! { ! if (ATSUSetAttributes(gFontStyle, ! (sizeof attribTags)/sizeof(ATSUAttributeTag), ! attribTags, attribSizes, attribValues) != noErr) ! { ! ATSUDisposeStyle(gFontStyle); ! gFontStyle = NULL; ! } ! } ! } #endif return OK; --- 3512,3519 ---- gui.char_height = font_info.ascent + font_info.descent + p_linespace; #ifdef USE_ATSUI_DRAWING if (p_macatsui && gFontStyle) ! gui_mac_set_font_attributes(font); #endif return OK; *************** *** 3457,3462 **** --- 3570,3637 ---- } #endif + #ifdef USE_ATSUI_DRAWING + static void + gui_mac_set_font_attributes(GuiFont font) + { + ATSUFontID fontID; + Fixed fontSize; + Fixed fontWidth; + + fontID = font & 0xFFFF; + fontSize = Long2Fix(font >> 16); + fontWidth = Long2Fix(gui.char_width); + + ATSUAttributeTag attribTags[] = + { + kATSUFontTag, kATSUSizeTag, kATSUImposeWidthTag, + kATSUMaxATSUITagValue + 1 + }; + + ByteCount attribSizes[] = + { + sizeof(ATSUFontID), sizeof(Fixed), sizeof(fontWidth), + sizeof(font) + }; + + ATSUAttributeValuePtr attribValues[] = + { + &fontID, &fontSize, &fontWidth, &font + }; + + if (FMGetFontFromFontFamilyInstance(fontID, 0, &fontID, NULL) == noErr) + { + if (ATSUSetAttributes(gFontStyle, + (sizeof attribTags) / sizeof(ATSUAttributeTag), + attribTags, attribSizes, attribValues) != noErr) + { + # ifndef NDEBUG + fprintf(stderr, "couldn't set font style\n"); + # endif + ATSUDisposeStyle(gFontStyle); + gFontStyle = NULL; + } + + #ifdef FEAT_MBYTE + if (has_mbyte) + { + /* FIXME: we should use a more mbyte sensitive way to support + * wide font drawing */ + fontWidth = Long2Fix(gui.char_width * 2); + + if (ATSUSetAttributes(gWideFontStyle, + (sizeof attribTags) / sizeof(ATSUAttributeTag), + attribTags, attribSizes, attribValues) != noErr) + { + ATSUDisposeStyle(gWideFontStyle); + gWideFontStyle = NULL; + } + } + #endif + } + } + #endif + /* * Set the current text font. */ *************** *** 3466,3528 **** #ifdef USE_ATSUI_DRAWING GuiFont currFont; ByteCount actualFontByteCount; - ATSUFontID fontID; - Fixed fontSize; - ATSStyleRenderingOptions fontOptions; if (p_macatsui && gFontStyle) { /* Avoid setting same font again */ ! if (ATSUGetAttribute(gFontStyle, kATSUMaxATSUITagValue+1, sizeof font, ! &currFont, &actualFontByteCount) == noErr && ! actualFontByteCount == (sizeof font)) { if (currFont == font) return; } ! fontID = font & 0xFFFF; ! fontSize = Long2Fix(font >> 16); ! /* Respect p_antialias setting only for wide font. ! * The reason for doing this at the moment is a bit complicated, ! * but it's mainly because a) latin (non-wide) aliased fonts ! * look bad in OS X 10.3.x and below (due to a bug in ATS), and ! * b) wide multibyte input does not suffer from that problem. */ ! /*fontOptions = ! (p_antialias && (font == gui.wide_font)) ? ! kATSStyleNoOptions : kATSStyleNoAntiAliasing; ! */ ! /*fontOptions = kATSStyleAntiAliasing;*/ ! ! ATSUAttributeTag attribTags[] = ! { ! kATSUFontTag, kATSUSizeTag, kATSUStyleRenderingOptionsTag, ! kATSUMaxATSUITagValue+1 ! }; ! ByteCount attribSizes[] = ! { ! sizeof(ATSUFontID), sizeof(Fixed), ! sizeof(ATSStyleRenderingOptions), sizeof font ! }; ! ATSUAttributeValuePtr attribValues[] = ! { ! &fontID, &fontSize, &fontOptions, &font ! }; ! ! if (FMGetFontFromFontFamilyInstance(fontID, 0, &fontID, NULL) == noErr) ! { ! if (ATSUSetAttributes(gFontStyle, ! (sizeof attribTags)/sizeof(ATSUAttributeTag), ! attribTags, attribSizes, attribValues) != noErr) ! { ! # ifndef NDEBUG ! fprintf(stderr, "couldn't set font style\n"); ! # endif ! ATSUDisposeStyle(gFontStyle); ! gFontStyle = NULL; ! } ! } ! } if (p_macatsui && !gIsFontFallbackSet) --- 3641,3659 ---- #ifdef USE_ATSUI_DRAWING GuiFont currFont; ByteCount actualFontByteCount; if (p_macatsui && gFontStyle) { /* Avoid setting same font again */ ! if (ATSUGetAttribute(gFontStyle, kATSUMaxATSUITagValue + 1, ! sizeof(font), &currFont, &actualFontByteCount) == noErr ! && actualFontByteCount == (sizeof font)) { if (currFont == font) return; } ! gui_mac_set_font_attributes(font); } if (p_macatsui && !gIsFontFallbackSet) *************** *** 3546,3552 **** &fallbackFonts, NULL) == noErr) { ! ATSUSetFontFallbacks((sizeof fallbackFonts)/sizeof(ATSUFontID), &fallbackFonts, kATSUSequentialFallbacksPreferred); } /* ATSUAttributeValuePtr fallbackValues[] = { }; --- 3677,3685 ---- &fallbackFonts, NULL) == noErr) { ! ATSUSetFontFallbacks((sizeof fallbackFonts)/sizeof(ATSUFontID), ! &fallbackFonts, ! kATSUSequentialFallbacksPreferred); } /* ATSUAttributeValuePtr fallbackValues[] = { }; *************** *** 3931,3937 **** /* - ATSUI automatically antialiases text (Someone) * - for some reason it does not work... (Jussi) */ ! /* * When antialiasing we're using srcOr mode, we have to clear the block * before drawing the text. --- 4064,4073 ---- /* - ATSUI automatically antialiases text (Someone) * - for some reason it does not work... (Jussi) */ ! #ifdef MAC_ATSUI_DEBUG ! fprintf(stderr, "row = %d, col = %d, len = %d: '%c'\n", ! row, col, len, len == 1 ? s[0] : ' '); ! #endif /* * When antialiasing we're using srcOr mode, we have to clear the block * before drawing the text. *************** *** 3966,4000 **** } { - /* Use old-style, non-antialiased QuickDraw text rendering. */ TextMode(srcCopy); TextFace(normal); ! /* SelectFont(hdc, gui.currFont); */ ! if (flags & DRAW_TRANSP) { TextMode(srcOr); } MoveTo(TEXT_X(col), TEXT_Y(row)); - ATSUTextLayout textLayout; ! if (ATSUCreateTextLayoutWithTextPtr(tofree, ! kATSUFromTextBeginning, kATSUToTextEnd, ! utf16_len, ! (gFontStyle ? 1 : 0), &utf16_len, ! (gFontStyle ? &gFontStyle : NULL), ! &textLayout) == noErr) { ! ATSUSetTransientFontMatching(textLayout, TRUE); ! ATSUDrawText(textLayout, ! kATSUFromTextBeginning, kATSUToTextEnd, ! kATSUUseGrafPortPenLoc, kATSUUseGrafPortPenLoc); ATSUDisposeTextLayout(textLayout); } } if (flags & DRAW_UNDERC) --- 4102,4223 ---- } { TextMode(srcCopy); TextFace(normal); ! /* SelectFont(hdc, gui.currFont); */ if (flags & DRAW_TRANSP) { TextMode(srcOr); } MoveTo(TEXT_X(col), TEXT_Y(row)); ! if (gFontStyle && flags & DRAW_BOLD) { ! Boolean attValue = true; ! ATSUAttributeTag attribTags[] = { kATSUQDBoldfaceTag }; ! ByteCount attribSizes[] = { sizeof(Boolean) }; ! ATSUAttributeValuePtr attribValues[] = { &attValue }; ! ATSUSetAttributes(gFontStyle, 1, attribTags, attribSizes, attribValues); ! } ! ! #ifdef FEAT_MBYTE ! if (has_mbyte) ! { ! int n, width_in_cell, last_width_in_cell; ! UniCharArrayOffset offset = 0; ! UniCharCount yet_to_draw = 0; ! ATSUTextLayout textLayout; ! ATSUStyle textStyle; ! ! last_width_in_cell = 1; ! ATSUCreateTextLayout(&textLayout); ! ATSUSetTextPointerLocation(textLayout, tofree, ! kATSUFromTextBeginning, ! kATSUToTextEnd, utf16_len); ! /* ! ATSUSetRunStyle(textLayout, gFontStyle, ! kATSUFromTextBeginning, kATSUToTextEnd); */ + /* Compute the length in display cells. */ + for (n = 0; n < len; n += MB_BYTE2LEN(s[n])) + { + width_in_cell = (*mb_ptr2cells)(s + n); + + /* probably we are switching from single byte character + * to multibyte characters (which requires more than one + * cell to draw) */ + if (width_in_cell != last_width_in_cell) + { + #ifdef MAC_ATSUI_DEBUG + fprintf(stderr, "\tn = %2d, (%d-%d), offset = %d, yet_to_draw = %d\n", + n, last_width_in_cell, width_in_cell, offset, yet_to_draw); + #endif + textStyle = last_width_in_cell > 1 ? gWideFontStyle + : gFontStyle; + + ATSUSetRunStyle(textLayout, textStyle, offset, yet_to_draw); + offset += yet_to_draw; + yet_to_draw = 0; + last_width_in_cell = width_in_cell; + } + + yet_to_draw++; + } + + if (yet_to_draw) + { + #ifdef MAC_ATSUI_DEBUG + fprintf(stderr, "\tn = %2d, (%d-%d), offset = %d, yet_to_draw = %d\n", + n, last_width_in_cell, width_in_cell, offset, yet_to_draw); + #endif + /* finish the rest style */ + textStyle = width_in_cell > 1 ? gWideFontStyle : gFontStyle; + ATSUSetRunStyle(textLayout, textStyle, offset, kATSUToTextEnd); + } + + ATSUSetTransientFontMatching(textLayout, TRUE); + ATSUDrawText(textLayout, + kATSUFromTextBeginning, kATSUToTextEnd, + kATSUUseGrafPortPenLoc, kATSUUseGrafPortPenLoc); ATSUDisposeTextLayout(textLayout); } + else + #endif + { + ATSUTextLayout textLayout; + + if (ATSUCreateTextLayoutWithTextPtr(tofree, + kATSUFromTextBeginning, kATSUToTextEnd, + utf16_len, + (gFontStyle ? 1 : 0), &utf16_len, + (gFontStyle ? &gFontStyle : NULL), + &textLayout) == noErr) + { + ATSUSetTransientFontMatching(textLayout, TRUE); + + ATSUDrawText(textLayout, + kATSUFromTextBeginning, kATSUToTextEnd, + kATSUUseGrafPortPenLoc, kATSUUseGrafPortPenLoc); + + ATSUDisposeTextLayout(textLayout); + } + } + + /* drawing is done, now reset bold to normal */ + if (gFontStyle && flags & DRAW_BOLD) + { + Boolean attValue = false; + + ATSUAttributeTag attribTags[] = { kATSUQDBoldfaceTag }; + ByteCount attribSizes[] = { sizeof(Boolean) }; + ATSUAttributeValuePtr attribValues[] = { &attValue }; + + ATSUSetAttributes(gFontStyle, 1, attribTags, attribSizes, + attribValues); + } } if (flags & DRAW_UNDERC) *************** *** 4008,4013 **** --- 4231,4243 ---- gui_mch_draw_string(int row, int col, char_u *s, int len, int flags) { #if defined(USE_ATSUI_DRAWING) + if (p_macatsui == 0 && p_macatsui_last != 0) + /* switch from macatsui to nomacatsui */ + gui_mac_dispose_atsui_style(); + else if (p_macatsui != 0 && p_macatsui_last == 0) + /* switch from nomacatsui to macatsui */ + gui_mac_create_atsui_style(); + if (p_macatsui) draw_string_ATSUI(row, col, s, len, flags); else *************** *** 4238,4249 **** */ /* TODO: reduce wtime accordinly??? */ if (wtime > -1) ! sleeppyTick = 60*wtime/1000; else sleeppyTick = 32767; if (WaitNextEventWrp(mask, &event, sleeppyTick, dragRgn)) { ! gui_mac_handle_event(&event); if (input_available()) { allow_scrollbar = FALSE; --- 4468,4480 ---- */ /* TODO: reduce wtime accordinly??? */ if (wtime > -1) ! sleeppyTick = 60 * wtime / 1000; else sleeppyTick = 32767; + if (WaitNextEventWrp(mask, &event, sleeppyTick, dragRgn)) { ! gui_mac_handle_event(&event); if (input_available()) { allow_scrollbar = FALSE; *************** *** 5284,5289 **** --- 5515,5563 ---- SetDialogItemText(itemHandle, itemName); } + + /* ModalDialog() handler for message dialogs that have hotkey accelerators. + * Expects a mapping of hotkey char to control index in gDialogHotKeys; + * setting gDialogHotKeys to NULL disables any hotkey handling. + */ + static pascal Boolean + DialogHotkeyFilterProc ( + DialogRef theDialog, + EventRecord *event, + DialogItemIndex *itemHit) + { + char_u keyHit; + + if (event->what == keyDown || event->what == autoKey) + { + keyHit = (event->message & charCodeMask); + + if (gDialogHotKeys && gDialogHotKeys[keyHit]) + { + #ifdef DEBUG_MAC_DIALOG_HOTKEYS + printf("user pressed hotkey '%c' --> item %d\n", keyHit, gDialogHotKeys[keyHit]); + #endif + *itemHit = gDialogHotKeys[keyHit]; + + /* When handing off to StdFilterProc, pretend that the user + * clicked the control manually. Note that this is also supposed + * to cause the button to hilite briefly (to give some user + * feedback), but this seems not to actually work (or it's too + * fast to be seen). + */ + event->what = kEventControlSimulateHit; + + return true; /* we took care of it */ + } + + /* Defer to the OS's standard behavior for this event. + * This ensures that Enter will still activate the default button. */ + return StdFilterProc(theDialog, event, itemHit); + } + return false; /* Let ModalDialog deal with it */ + } + + /* TODO: There have been some crashes with dialogs, check your inbox * (Jussi) */ *************** *** 5309,5321 **** GrafPtr oldPort; short itemHit; char_u *buttonChar; Rect box; short button; short lastButton; short itemType; short useIcon; short width; ! short totalButtonWidth = 0; /* the width of all button together including spacing */ short widestButton = 0; short dfltButtonEdge = 20; /* gut feeling */ --- 5583,5597 ---- GrafPtr oldPort; short itemHit; char_u *buttonChar; + short hotKeys[256]; /* map of hotkey -> control ID */ + char_u aHotKey; Rect box; short button; short lastButton; short itemType; short useIcon; short width; ! short totalButtonWidth = 0; /* the width of all buttons together including spacing */ short widestButton = 0; short dfltButtonEdge = 20; /* gut feeling */ *************** *** 5336,5341 **** --- 5612,5619 ---- WindowRef theWindow; + ModalFilterUPP dialogUPP; + /* Check 'v' flag in 'guioptions': vertical button placement. */ vertical = (vim_strchr(p_go, GO_VERTICAL) != NULL); *************** *** 5375,5380 **** --- 5653,5661 ---- buttonChar = buttons; button = 0; + /* initialize the hotkey mapping */ + memset(hotKeys, 0, sizeof(hotKeys)); + for (;*buttonChar != 0;) { /* Get the name of the button */ *************** *** 5384,5390 **** --- 5665,5682 ---- { if (*buttonChar != DLG_HOTKEY_CHAR) name[++len] = *buttonChar; + else + { + aHotKey = (char_u)*(buttonChar+1); + if (aHotKey >= 'A' && aHotKey <= 'Z') + aHotKey = (char_u)((int)aHotKey + (int)'a' - (int)'A'); + hotKeys[aHotKey] = button; + #ifdef DEBUG_MAC_DIALOG_HOTKEYS + printf("### hotKey for button %d is '%c'\n", button, aHotKey); + #endif + } } + if (*buttonChar != 0) buttonChar++; name[0] = len; *************** *** 5453,5459 **** --- 5745,5757 ---- (void) C2PascalString(textfield, &name); SetDialogItemText(itemHandle, name); inputItm.width = StringWidth(name); + + /* Hotkeys don't make sense if there's a text field */ + gDialogHotKeys = NULL; } + else + /* Install hotkey table */ + gDialogHotKeys = (short *)&hotKeys; /* Set the and button. */ SetDialogDefaultItem(theDialog, dfltbutton); *************** *** 5505,5511 **** { macMoveDialogItem(theDialog, button, buttonItm.box.left, buttonItm.box.top, &box); ! /* With vertical, it's better to have all button the same lenght */ if (vertical) { macSizeDialogItem(theDialog, button, widestButton, 0); --- 5803,5809 ---- { macMoveDialogItem(theDialog, button, buttonItm.box.left, buttonItm.box.top, &box); ! /* With vertical, it's better to have all buttons the same length */ if (vertical) { macSizeDialogItem(theDialog, button, widestButton, 0); *************** *** 5542,5551 **** dialog_busy = TRUE; #endif /* Hang until one of the button is hit */ do { ! ModalDialog(nil, &itemHit); } while ((itemHit < 1) || (itemHit > lastButton)); #ifdef USE_CARBONKEYHANDLER --- 5840,5852 ---- dialog_busy = TRUE; #endif + /* Prepare the shortcut-handling filterProc for handing to the dialog */ + dialogUPP = NewModalFilterUPP(DialogHotkeyFilterProc); + /* Hang until one of the button is hit */ do { ! ModalDialog(dialogUPP, &itemHit); } while ((itemHit < 1) || (itemHit > lastButton)); #ifdef USE_CARBONKEYHANDLER *************** *** 5568,5573 **** --- 5869,5877 ---- /* Restore the original graphical port */ SetPort(oldPort); + /* Free the modal filterProc */ + DisposeRoutineDescriptor(dialogUPP); + /* Get ride of th edialog (free memory) */ DisposeDialog(theDialog); *************** *** 5578,5584 **** * SetDialogTracksCursor() : Get the I-beam cursor over input box * MoveDialogItem(): Probably better than SetDialogItem * SizeDialogItem(): (but is it Carbon Only?) ! * AutoSizeDialog(): Magic resize of dialog based on text lenght */ } #endif /* FEAT_DIALOG_GUI */ --- 5882,5888 ---- * SetDialogTracksCursor() : Get the I-beam cursor over input box * MoveDialogItem(): Probably better than SetDialogItem * SizeDialogItem(): (but is it Carbon Only?) ! * AutoSizeDialog(): Magic resize of dialog based on text length */ } #endif /* FEAT_DIALOG_GUI */ *************** *** 5762,5768 **** #ifdef MACOS_CONVERT windowTitleLen = STRLEN(title); ! windowTitle = mac_enc_to_cfstring(title, windowTitleLen); if (windowTitle) { --- 6066,6072 ---- #ifdef MACOS_CONVERT windowTitleLen = STRLEN(title); ! windowTitle = (CFStringRef)mac_enc_to_cfstring(title, windowTitleLen); if (windowTitle) { *************** *** 6041,6047 **** #endif } ! #if defined(USE_IM_CONTROL) || defined(PROTO) /* * Input Method Control functions. */ --- 6345,6351 ---- #endif } ! #if (defined(USE_IM_CONTROL) || defined(PROTO)) && defined(USE_CARBONKEYHANDLER) /* * Input Method Control functions. */ *************** *** 6052,6058 **** --- 6356,6426 ---- void im_set_position(int row, int col) { + #if 0 /* TODO: Implement me! */ + im_start_row = row; + im_start_col = col; + #endif + } + + static ScriptLanguageRecord gTSLWindow; + static ScriptLanguageRecord gTSLInsert; + static ScriptLanguageRecord gTSLDefault = { 0, 0 }; + + static Component gTSCWindow; + static Component gTSCInsert; + static Component gTSCDefault; + + static int im_initialized = 0; + + static void + im_on_window_switch(int active) + { + ScriptLanguageRecord *slptr = NULL; + OSStatus err; + + if (! gui.in_use) + return; + + if (im_initialized == 0) + { + im_initialized = 1; + + /* save default TSM component (should be U.S.) to default */ + GetDefaultInputMethodOfClass(&gTSCDefault, &gTSLDefault, + kKeyboardInputMethodClass); + } + + if (active == TRUE) + { + im_is_active = TRUE; + ActivateTSMDocument(gTSMDocument); + slptr = &gTSLWindow; + + if (slptr) + { + err = SetDefaultInputMethodOfClass(gTSCWindow, slptr, + kKeyboardInputMethodClass); + if (err == noErr) + err = SetTextServiceLanguage(slptr); + + if (err == noErr) + KeyScript(slptr->fScript | smKeyForceKeyScriptMask); + } + } + else + { + err = GetTextServiceLanguage(&gTSLWindow); + if (err == noErr) + slptr = &gTSLWindow; + + if (slptr) + GetDefaultInputMethodOfClass(&gTSCWindow, slptr, + kKeyboardInputMethodClass); + + im_is_active = FALSE; + DeactivateTSMDocument(gTSMDocument); + } } /* *************** *** 6061,6067 **** void im_set_active(int active) { ! KeyScript(active ? smKeySysScript : smKeyRoman); } /* --- 6429,6485 ---- void im_set_active(int active) { ! ScriptLanguageRecord *slptr = NULL; ! OSStatus err; ! ! if (! gui.in_use) ! return; ! ! if (im_initialized == 0) ! { ! im_initialized = 1; ! ! /* save default TSM component (should be U.S.) to default */ ! GetDefaultInputMethodOfClass(&gTSCDefault, &gTSLDefault, ! kKeyboardInputMethodClass); ! } ! ! if (active == TRUE) ! { ! im_is_active = TRUE; ! ActivateTSMDocument(gTSMDocument); ! slptr = &gTSLInsert; ! ! if (slptr) ! { ! err = SetDefaultInputMethodOfClass(gTSCInsert, slptr, ! kKeyboardInputMethodClass); ! if (err == noErr) ! err = SetTextServiceLanguage(slptr); ! ! if (err == noErr) ! KeyScript(slptr->fScript | smKeyForceKeyScriptMask); ! } ! } ! else ! { ! err = GetTextServiceLanguage(&gTSLInsert); ! if (err == noErr) ! slptr = &gTSLInsert; ! ! if (slptr) ! GetDefaultInputMethodOfClass(&gTSCInsert, slptr, ! kKeyboardInputMethodClass); ! ! /* restore to default when switch to normal mode, so than we could ! * enter commands easier */ ! SetDefaultInputMethodOfClass(gTSCDefault, &gTSLDefault, ! kKeyboardInputMethodClass); ! SetTextServiceLanguage(&gTSLDefault); ! ! im_is_active = FALSE; ! DeactivateTSMDocument(gTSMDocument); ! } } /* *************** *** 6070,6078 **** int im_get_status(void) { ! SInt32 script = GetScriptManagerVariable(smKeyScript); ! return (script != smRoman ! && script == GetScriptManagerVariable(smSysScript)) ? 1 : 0; } #endif /* defined(USE_IM_CONTROL) || defined(PROTO) */ --- 6488,6497 ---- int im_get_status(void) { ! if (! gui.in_use) ! return 0; ! ! return im_is_active; } #endif /* defined(USE_IM_CONTROL) || defined(PROTO) */ *************** *** 6094,6100 **** { get_tabline_label(page, FALSE); #ifdef MACOS_CONVERT ! return mac_enc_to_cfstring(NameBuff, STRLEN(NameBuff)); #else // TODO: check internal encoding? return CFStringCreateWithCString(kCFAllocatorDefault, (char *)NameBuff, --- 6513,6519 ---- { get_tabline_label(page, FALSE); #ifdef MACOS_CONVERT ! return (CFStringRef)mac_enc_to_cfstring(NameBuff, STRLEN(NameBuff)); #else // TODO: check internal encoding? return CFStringCreateWithCString(kCFAllocatorDefault, (char *)NameBuff, *************** *** 6128,6134 **** int numTabs = 0; for (tp = first_tabpage; tp != NULL; tp = tp->tp_next) ! ++numTabs; return numTabs; } --- 6547,6553 ---- int numTabs = 0; for (tp = first_tabpage; tp != NULL; tp = tp->tp_next) ! ++numTabs; return numTabs; } *************** *** 6136,6143 **** static OSStatus dbItemDataCallback(ControlRef browser, DataBrowserItemID itemID, ! DataBrowserPropertyID property /* column id */, ! DataBrowserItemDataRef itemData, Boolean changeValue) { OSStatus status = noErr; --- 6555,6562 ---- static OSStatus dbItemDataCallback(ControlRef browser, DataBrowserItemID itemID, ! DataBrowserPropertyID property /* column id */, ! DataBrowserItemDataRef itemData, Boolean changeValue) { OSStatus status = noErr; *************** *** 6180,6188 **** static void dbGetContextualMenuCallback(ControlRef browser, MenuRef *menu, ! UInt32 *helpType, CFStringRef *helpItemString, ! AEDesc *selection) { // on mac os 9: kCMHelpItemNoHelp, but it's not the same *helpType = kCMHelpItemRemoveHelp; // OS X only ;-) --- 6599,6607 ---- static void dbGetContextualMenuCallback(ControlRef browser, MenuRef *menu, ! UInt32 *helpType, CFStringRef *helpItemString, ! AEDesc *selection) { // on mac os 9: kCMHelpItemNoHelp, but it's not the same *helpType = kCMHelpItemRemoveHelp; // OS X only ;-) *************** *** 6405,6413 **** gui_mch_show_tabline(int showit) { if (showit == 0) ! CloseDrawer(drawer, true); else ! OpenDrawer(drawer, kWindowEdgeRight, true); } /* --- 6824,6832 ---- gui_mch_show_tabline(int showit) { if (showit == 0) ! CloseDrawer(drawer, true); else ! OpenDrawer(drawer, kWindowEdgeRight, true); } /* *************** *** 6435,6445 **** // adjust data browser if (tabLabels != NULL) { ! int i; ! for (i = 0; i < tabLabelsSize; ++i) ! CFRelease(tabLabels[i]); ! free(tabLabels); } tabLabels = (CFStringRef *)malloc(numTabs * sizeof(CFStringRef)); tabLabelsSize = numTabs; --- 6854,6864 ---- // adjust data browser if (tabLabels != NULL) { ! int i; ! for (i = 0; i < tabLabelsSize; ++i) ! CFRelease(tabLabels[i]); ! free(tabLabels); } tabLabels = (CFStringRef *)malloc(numTabs * sizeof(CFStringRef)); tabLabelsSize = numTabs; *************** *** 6448,6454 **** { if (tp == curtab) curtabidx = nr; ! tabLabels[nr-1] = getTabLabel(tp); } RemoveDataBrowserItems(dataBrowser, kDataBrowserNoItem, 0, NULL, --- 6867,6873 ---- { if (tp == curtab) curtabidx = nr; ! tabLabels[nr-1] = getTabLabel(tp); } RemoveDataBrowserItems(dataBrowser, kDataBrowserNoItem, 0, NULL, diff -crN ../vim71/src/gui_w32.c ./src/gui_w32.c *** ../vim71/src/gui_w32.c Thu May 10 22:03:22 2007 --- ./src/gui_w32.c Sat Jan 5 13:09:56 2008 *************** *** 23,28 **** --- 23,30 ---- * e.g., replace LONG with LONG_PTR, etc. */ + #include "vim.h" + /* * These are new in Windows ME/XP, only defined in recent compilers. */ *************** *** 182,189 **** # define BEVAL_TEXT_LEN MAXPATHL #if _MSC_VER < 1300 ! /* Work around old versions of basetsd.h which wrongly declare ! * UINT_PTR as unsigned long */ # define UINT_PTR UINT #endif --- 184,191 ---- # define BEVAL_TEXT_LEN MAXPATHL #if _MSC_VER < 1300 ! /* Work around old versions of basetsd.h which wrongly declares ! * UINT_PTR as unsigned long. */ # define UINT_PTR UINT #endif *************** *** 985,990 **** --- 987,997 ---- { LPNMTTDISPINFOW lpdi = (LPNMTTDISPINFOW)lParam; + /* Set the maximum width, this also enables using + * \n for line break. */ + SendMessage(lpdi->hdr.hwndFrom, TTM_SETMAXTIPWIDTH, + 0, 500); + tt_text = enc_to_ucs2(str, NULL); lpdi->lpszText = tt_text; /* can't show tooltip if failed */ *************** *** 994,999 **** --- 1001,1011 ---- { LPNMTTDISPINFO lpdi = (LPNMTTDISPINFO)lParam; + /* Set the maximum width, this also enables using + * \n for line break. */ + SendMessage(lpdi->hdr.hwndFrom, TTM_SETMAXTIPWIDTH, + 0, 500); + if (STRLEN(str) < sizeof(lpdi->szText) || ((tt_text = vim_strsave(str)) == NULL)) vim_strncpy(lpdi->szText, str, *************** *** 1051,1057 **** --- 1063,1071 ---- if (pMenu != NULL && pMenu->strings[MENU_INDEX_TIP] != 0 && GetMenuState(s_menuBar, pMenu->id, MF_BYCOMMAND) != -1) { + ++msg_hist_off; msg(pMenu->strings[MENU_INDEX_TIP]); + --msg_hist_off; setcursor(); out_flush(); did_menu_tip = TRUE; *************** *** 1430,1445 **** } } else ! /* Open toplevel window. */ s_hwnd = CreateWindow( ! szVimWndClass, "Vim MSWindows GUI", ! WS_OVERLAPPEDWINDOW, ! gui_win_x == -1 ? CW_USEDEFAULT : gui_win_x, ! gui_win_y == -1 ? CW_USEDEFAULT : gui_win_y, ! 100, /* Any value will do */ ! 100, /* Any value will do */ ! NULL, NULL, ! s_hinst, NULL); if (s_hwnd == NULL) return FAIL; --- 1444,1472 ---- } } else ! { ! /* If the provided windowid is not valid reset it to zero, so that it ! * is ignored and we open our own window. */ ! if (IsWindow((HWND)win_socket_id) <= 0) ! win_socket_id = 0; ! ! /* Create a window. If win_socket_id is not zero without border and ! * titlebar, it will be reparented below. */ s_hwnd = CreateWindow( ! szVimWndClass, "Vim MSWindows GUI", ! win_socket_id == 0 ? WS_OVERLAPPEDWINDOW : WS_POPUP, ! gui_win_x == -1 ? CW_USEDEFAULT : gui_win_x, ! gui_win_y == -1 ? CW_USEDEFAULT : gui_win_y, ! 100, /* Any value will do */ ! 100, /* Any value will do */ ! NULL, NULL, ! s_hinst, NULL); ! if (s_hwnd != NULL && win_socket_id != 0) ! { ! SetParent(s_hwnd, (HWND)win_socket_id); ! ShowWindow(s_hwnd, SW_SHOWMAXIMIZED); ! } ! } if (s_hwnd == NULL) return FAIL; *************** *** 2892,2897 **** --- 2919,2928 ---- (void)SetFocus(hwnd); if (dialog_default_button > IDCANCEL) (void)SetFocus(GetDlgItem(hwnd, dialog_default_button)); + else + /* We don't have a default, set focus on another element of the + * dialog window, probably the icon */ + (void)SetFocus(GetDlgItem(hwnd, DLG_NONBUTTON_CONTROL)); return FALSE; } *************** *** 4416,4422 **** * async request to debugger * 4) gui_mch_post_balloon (invoked from netbeans.c) creates tooltip control * and performs some actions to show it ASAP ! * 5) WM_NOTOFY:TTN_POP destroys created tooltip */ /* --- 4447,4453 ---- * async request to debugger * 4) gui_mch_post_balloon (invoked from netbeans.c) creates tooltip control * and performs some actions to show it ASAP ! * 5) WM_NOTIFY:TTN_POP destroys created tooltip */ /* *************** *** 4544,4554 **** SendMessage(beval->balloon, TTM_ADDTOOL, 0, (LPARAM)pti); /* Make tooltip appear sooner */ SendMessage(beval->balloon, TTM_SETDELAYTIME, TTDT_INITIAL, 10); /* * HACK: force tooltip to appear, because it'll not appear until * first mouse move. D*mn M$ */ ! mouse_event(MOUSEEVENTF_MOVE, 1, 1, 0, 0); mouse_event(MOUSEEVENTF_MOVE, (DWORD)-1, (DWORD)-1, 0, 0); vim_free(pti); } --- 4575,4589 ---- SendMessage(beval->balloon, TTM_ADDTOOL, 0, (LPARAM)pti); /* Make tooltip appear sooner */ SendMessage(beval->balloon, TTM_SETDELAYTIME, TTDT_INITIAL, 10); + /* I've performed some tests and it seems the longest possible life time + * of tooltip is 30 seconds */ + SendMessage(beval->balloon, TTM_SETDELAYTIME, TTDT_AUTOPOP, 30000); /* * HACK: force tooltip to appear, because it'll not appear until * first mouse move. D*mn M$ + * Amazingly moving (2, 2) and then (-1, -1) the mouse doesn't move. */ ! mouse_event(MOUSEEVENTF_MOVE, 2, 2, 0, 0); mouse_event(MOUSEEVENTF_MOVE, (DWORD)-1, (DWORD)-1, 0, 0); vim_free(pti); } *************** *** 4713,4724 **** cur_beval->showState = ShS_NEUTRAL; break; case TTN_GETDISPINFO: ! { ! /* if you get there then we have new common controls */ ! NMTTDISPINFO_NEW *info = (NMTTDISPINFO_NEW *)pnmh; ! info->lpszText = (LPSTR)info->lParam; ! info->uFlags |= TTF_DI_SETITEM; ! } break; } } --- 4748,4759 ---- cur_beval->showState = ShS_NEUTRAL; break; case TTN_GETDISPINFO: ! { ! /* if you get there then we have new common controls */ ! NMTTDISPINFO_NEW *info = (NMTTDISPINFO_NEW *)pnmh; ! info->lpszText = (LPSTR)info->lParam; ! info->uFlags |= TTF_DI_SETITEM; ! } break; } } diff -crN ../vim71/src/gui_w48.c ./src/gui_w48.c *** ../vim71/src/gui_w48.c Mon May 7 21:30:53 2007 --- ./src/gui_w48.c Thu Jul 24 15:06:07 2008 *************** *** 290,295 **** --- 290,300 ---- /* Local variables */ static int s_button_pending = -1; + + /* s_getting_focus is set when we got focus but didn't see mouse-up event yet, + * so don't reset s_button_pending. */ + static int s_getting_focus = FALSE; + static int s_x_pending; static int s_y_pending; static UINT s_kFlags_pending; *************** *** 486,495 **** /* * Convert Unicode character "ch" to bytes in "string[slen]". * Return the length. */ static int ! char_to_string(int ch, char_u *string, int slen) { int len; int i; --- 491,501 ---- /* * Convert Unicode character "ch" to bytes in "string[slen]". + * When "had_alt" is TRUE the ALT key was included in "ch". * Return the length. */ static int ! char_to_string(int ch, char_u *string, int slen, int had_alt) { int len; int i; *************** *** 522,529 **** --- 528,549 ---- * "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, 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, + string, slen, 0, NULL); + if (len == 1) /* safety check */ + string[0] |= 0x80; + } + } else { len = 1; *************** *** 573,579 **** char_u string[40]; int len = 0; ! len = char_to_string(ch, string, 40); if (len == 1 && string[0] == Ctrl_C && ctrl_c_interrupts) { trash_input_buf(); --- 593,599 ---- char_u string[40]; int len = 0; ! len = char_to_string(ch, string, 40, FALSE); if (len == 1 && string[0] == Ctrl_C && ctrl_c_interrupts) { trash_input_buf(); *************** *** 640,646 **** { /* Although the documentation isn't clear about it, we assume "ch" is * a Unicode character. */ ! len += char_to_string(ch, string + len, 40 - len); } add_to_input_buf(string, len); --- 660,666 ---- { /* Although the documentation isn't clear about it, we assume "ch" is * a Unicode character. */ ! len += char_to_string(ch, string + len, 40 - len, TRUE); } add_to_input_buf(string, len); *************** *** 656,661 **** --- 676,683 ---- { int vim_modifiers = 0x0; + s_getting_focus = FALSE; + if (keyFlags & MK_SHIFT) vim_modifiers |= MOUSE_SHIFT; if (keyFlags & MK_CONTROL) *************** *** 777,782 **** --- 799,805 ---- { int button; + s_getting_focus = FALSE; if (s_button_pending > -1) { /* Delayed action for mouse down event */ *************** *** 1775,1781 **** int len; /* Handle "key" as a Unicode character. */ ! len = char_to_string(key, string, 40); add_to_input_buf(string, len); } break; --- 1798,1804 ---- int len; /* Handle "key" as a Unicode character. */ ! len = char_to_string(key, string, 40, FALSE); add_to_input_buf(string, len); } break; *************** *** 1936,1943 **** allow_scrollbar = FALSE; /* Clear pending mouse button, the release event may have been ! * taken by the dialog window. */ ! s_button_pending = -1; return OK; } --- 1959,1968 ---- allow_scrollbar = FALSE; /* Clear pending mouse button, the release event may have been ! * taken by the dialog window. But don't do this when getting ! * focus, we need the mouse-up event then. */ ! if (!s_getting_focus) ! s_button_pending = -1; return OK; } *************** *** 2687,2692 **** --- 2712,2718 ---- HWND hwndOldFocus) { gui_focus_change(TRUE); + s_getting_focus = TRUE; (void)MyWindowProc(hwnd, WM_SETFOCUS, (WPARAM)hwndOldFocus, 0); } *************** *** 2696,2701 **** --- 2722,2728 ---- HWND hwndNewFocus) { gui_focus_change(FALSE); + s_getting_focus = FALSE; (void)MyWindowProc(hwnd, WM_KILLFOCUS, (WPARAM)hwndNewFocus, 0); } *************** *** 3127,3138 **** idc = MAKEINTRESOURCE(IDC_ARROW); else idc = mshape_idcs[shape]; ! #ifdef _WIN64 ! SetClassLongPtr(s_textArea, GCLP_HCURSOR, (LONG_PTR)LoadCursor(NULL, idc)); #else # ifdef WIN32 ! SetClassLong(s_textArea, GCL_HCURSOR, (LONG)LoadCursor(NULL, idc)); ! # else SetClassWord(s_textArea, GCW_HCURSOR, (WORD)LoadCursor(NULL, idc)); # endif #endif --- 3154,3165 ---- idc = MAKEINTRESOURCE(IDC_ARROW); else idc = mshape_idcs[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 *************** *** 3301,3311 **** SetFocus(s_hwnd); /* Shorten the file name if possible */ ! mch_dirname(IObuff, IOSIZE); ! p = shorten_fname((char_u *)fileBuf, IObuff); ! if (p == NULL) ! p = (char_u *)fileBuf; ! return vim_strsave(p); } # endif /* FEAT_MBYTE */ --- 3328,3334 ---- SetFocus(s_hwnd); /* Shorten the file name if possible */ ! return vim_strsave(shorten_fname1((char_u *)fileBuf)); } # endif /* FEAT_MBYTE */ *************** *** 3450,3460 **** SetFocus(s_hwnd); /* Shorten the file name if possible */ ! mch_dirname(IObuff, IOSIZE); ! p = shorten_fname((char_u *)fileBuf, IObuff); ! if (p == NULL) ! p = (char_u *)fileBuf; ! return vim_strsave(p); } #endif /* FEAT_BROWSE */ --- 3473,3479 ---- SetFocus(s_hwnd); /* Shorten the file name if possible */ ! return vim_strsave(shorten_fname1((char_u *)fileBuf)); } #endif /* FEAT_BROWSE */ diff -crN ../vim71/src/gvim.exe.mnf ./src/gvim.exe.mnf *** ../vim71/src/gvim.exe.mnf Sat May 5 14:00:35 2007 --- ./src/gvim.exe.mnf Fri Aug 8 22:03:23 2008 *************** *** 2,8 **** --- 2,8 ---- *************** *** 19,22 **** --- 19,32 ---- /> + + + + + + + + diff -crN ../vim71/src/if_ole.cpp ./src/if_ole.cpp *** ../vim71/src/if_ole.cpp Sun Aug 13 12:57:24 2006 --- ./src/if_ole.cpp Tue Sep 25 16:44:44 2007 *************** *** 34,39 **** --- 34,45 ---- extern HWND vim_parent_hwnd; } + #if _MSC_VER < 1300 + /* Work around old versions of basetsd.h which wrongly declares + * UINT_PTR as unsigned long */ + # define UINT_PTR UINT + #endif + #include "if_ole.h" // Interface definitions #include "iid_ole.c" // UUID definitions (compile here) *************** *** 107,113 **** STDMETHOD(SendKeys)(BSTR keys); STDMETHOD(Eval)(BSTR expr, BSTR *result); STDMETHOD(SetForeground)(void); ! STDMETHOD(GetHwnd)(UINT *result); private: // Constructor is private - create using CVim::Create() --- 113,119 ---- STDMETHOD(SendKeys)(BSTR keys); STDMETHOD(Eval)(BSTR expr, BSTR *result); STDMETHOD(SetForeground)(void); ! STDMETHOD(GetHwnd)(UINT_PTR *result); private: // Constructor is private - create using CVim::Create() *************** *** 288,296 **** } STDMETHODIMP ! CVim::GetHwnd(UINT *result) { ! *result = (UINT) s_hwnd; return S_OK; } --- 294,302 ---- } STDMETHODIMP ! CVim::GetHwnd(UINT_PTR *result) { ! *result = (UINT_PTR)s_hwnd; return S_OK; } diff -crN ../vim71/src/if_ole.h ./src/if_ole.h *** ../vim71/src/if_ole.h Mon Jun 7 16:32:26 2004 --- ./src/if_ole.h Tue Jul 10 16:21:18 2007 *************** *** 79,85 **** virtual HRESULT STDMETHODCALLTYPE SetForeground( void) = 0; virtual HRESULT STDMETHODCALLTYPE GetHwnd( ! /* [retval][out] */ UINT __RPC_FAR *result) = 0; }; --- 79,85 ---- virtual HRESULT STDMETHODCALLTYPE SetForeground( void) = 0; virtual HRESULT STDMETHODCALLTYPE GetHwnd( ! /* [retval][out] */ UINT_PTR __RPC_FAR *result) = 0; }; *************** *** 143,149 **** HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetHwnd )( IVim __RPC_FAR * This, ! /* [retval][out] */ UINT __RPC_FAR *result); END_INTERFACE } IVimVtbl; --- 143,149 ---- HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetHwnd )( IVim __RPC_FAR * This, ! /* [retval][out] */ UINT_PTR __RPC_FAR *result); END_INTERFACE } IVimVtbl; *************** *** 236,242 **** HRESULT STDMETHODCALLTYPE IVim_GetHwnd_Proxy( IVim __RPC_FAR * This, ! /* [retval][out] */ UINT __RPC_FAR *result); void __RPC_STUB IVim_GetHwnd_Stub( --- 236,242 ---- HRESULT STDMETHODCALLTYPE IVim_GetHwnd_Proxy( IVim __RPC_FAR * This, ! /* [retval][out] */ UINT_PTR __RPC_FAR *result); void __RPC_STUB IVim_GetHwnd_Stub( diff -crN ../vim71/src/if_ole.idl ./src/if_ole.idl *** ../vim71/src/if_ole.idl Mon Jun 7 16:32:26 2004 --- ./src/if_ole.idl Tue Jul 10 16:21:45 2007 *************** *** 20,26 **** HRESULT SendKeys([in]BSTR keys); HRESULT Eval([in]BSTR expr, [out, retval]BSTR* result); HRESULT SetForeground(void); ! HRESULT GetHwnd([out, retval]UINT* result); }; // Component and type library definitions --- 20,26 ---- HRESULT SendKeys([in]BSTR keys); HRESULT Eval([in]BSTR expr, [out, retval]BSTR* result); HRESULT SetForeground(void); ! HRESULT GetHwnd([out, retval]UINT_PTR* result); }; // Component and type library definitions diff -crN ../vim71/src/if_sniff.c ./src/if_sniff.c *** ../vim71/src/if_sniff.c Tue Mar 7 00:13:51 2006 --- ./src/if_sniff.c Sat Jun 21 20:51:35 2008 *************** *** 11,17 **** #ifdef WIN32 # include - # include # include "vimio.h" # include # include --- 11,16 ---- diff -crN ../vim71/src/iid_ole.c ./src/iid_ole.c *** ../vim71/src/iid_ole.c Mon Jun 7 16:32:26 2004 --- ./src/iid_ole.c Sat Aug 11 14:57:58 2007 *************** *** 16,24 **** extern "C"{ #endif #ifndef __IID_DEFINED__ ! #define __IID_DEFINED__ typedef struct _IID { --- 16,33 ---- extern "C"{ #endif + #ifdef __MINGW32__ + # include + + # if __W32API_MAJOR_VERSION == 3 && __W32API_MINOR_VERSION < 10 + /* This define is missing from older MingW versions of w32api, even though + * IID is defined. */ + # define __IID_DEFINED__ + # endif + #endif #ifndef __IID_DEFINED__ ! # define __IID_DEFINED__ typedef struct _IID { *************** *** 28,39 **** unsigned char c[8]; } IID; ! #endif // __IID_DEFINED__ #ifndef CLSID_DEFINED ! #define CLSID_DEFINED typedef IID CLSID; ! #endif // CLSID_DEFINED const IID IID_IVim = {0x0F0BFAE2,0x4C90,0x11d1,{0x82,0xD7,0x00,0x04,0xAC,0x36,0x85,0x19}}; --- 37,48 ---- unsigned char c[8]; } IID; ! #endif #ifndef CLSID_DEFINED ! # define CLSID_DEFINED typedef IID CLSID; ! #endif const IID IID_IVim = {0x0F0BFAE2,0x4C90,0x11d1,{0x82,0xD7,0x00,0x04,0xAC,0x36,0x85,0x19}}; diff -crN ../vim71/src/msvc2008.bat ./src/msvc2008.bat *** ../vim71/src/msvc2008.bat Thu Jan 1 01:00:00 1970 --- ./src/msvc2008.bat Tue Jun 24 16:57:09 2008 *************** *** 0 **** --- 1,5 ---- + rem To be used on MS-Windows for Visual C++ 2008 Express Edition + rem aka Microsoft Visual Studio 9.0. + rem See INSTALLpc.txt for information. + + call "%VS90COMNTOOLS%%vsvars32.bat" diff -crN ../vim71/src/os_amiga.c ./src/os_amiga.c *** ../vim71/src/os_amiga.c Mon May 7 21:28:50 2007 --- ./src/os_amiga.c Sat Jun 21 20:52:23 2008 *************** *** 19,28 **** # undef Window /* Amiga has its own Window definition */ #endif - #ifdef HAVE_FCNTL_H - # include - #endif - #undef TRUE /* will be redefined by exec/types.h */ #undef FALSE --- 19,24 ---- diff -crN ../vim71/src/os_mac.h ./src/os_mac.h *** ../vim71/src/os_mac.h Sun Apr 23 11:18:54 2006 --- ./src/os_mac.h Sat Jun 21 14:35:19 2008 *************** *** 109,114 **** --- 109,115 ---- # define HAVE_FCNTL_H # define HAVE_QSORT # define HAVE_ST_MODE /* have stat.st_mode */ + # define HAVE_MATH_H # if defined(__DATE__) && defined(__TIME__) # define HAVE_DATE_TIME *************** *** 217,226 **** */ #define CMDBUFFSIZE 1024 /* size of the command processing buffer */ ! #if defined(MACOS_X_UNIX) ! # define MAXPATHL 1024 ! # define BASENAMELEN (MAXNAMLEN - 5) /* length of base of filename */ ! #else # define MAXPATHL 256 /* Limited by the Pascal Strings */ # define BASENAMELEN (32-5-1) /* length of base of filename */ #endif --- 218,224 ---- */ #define CMDBUFFSIZE 1024 /* size of the command processing buffer */ ! #if !defined(MACOS_X_UNIX) # define MAXPATHL 256 /* Limited by the Pascal Strings */ # define BASENAMELEN (32-5-1) /* length of base of filename */ #endif diff -crN ../vim71/src/os_mac_conv.c ./src/os_mac_conv.c *** ../vim71/src/os_mac_conv.c Mon May 7 21:43:28 2007 --- ./src/os_mac_conv.c Tue Jun 24 13:24:39 2008 *************** *** 318,327 **** /* * Conversion from UTF-16 UniChars to 'encoding' */ char_u * mac_utf16_to_enc(from, fromLen, actualLen) ! UniChar *from; size_t fromLen; size_t *actualLen; { --- 318,329 ---- /* * Conversion from UTF-16 UniChars to 'encoding' + * The function signature uses the real type of UniChar (as typedef'ed in + * CFBase.h) to avoid clashes with X11 header files in the .pro file */ char_u * mac_utf16_to_enc(from, fromLen, actualLen) ! unsigned short *from; size_t fromLen; size_t *actualLen; { *************** *** 370,377 **** /* * Conversion from 'encoding' to UTF-16 UniChars */ ! UniChar * mac_enc_to_utf16(from, fromLen, actualLen) char_u *from; size_t fromLen; --- 372,381 ---- /* * Conversion from 'encoding' to UTF-16 UniChars + * The function return uses the real type of UniChar (as typedef'ed in + * CFBase.h) to avoid clashes with X11 header files in the .pro file */ ! unsigned short * mac_enc_to_utf16(from, fromLen, actualLen) char_u *from; size_t fromLen; *************** *** 428,435 **** /* * Converts from UTF-16 UniChars to CFString */ ! CFStringRef mac_enc_to_cfstring(from, fromLen) char_u *from; size_t fromLen; --- 432,440 ---- /* * Converts from UTF-16 UniChars to CFString + * The void * return type is actually a CFStringRef */ ! void * mac_enc_to_cfstring(from, fromLen) char_u *from; size_t fromLen; *************** *** 445,451 **** vim_free(utf16_str); } ! return result; } /* --- 450,456 ---- vim_free(utf16_str); } ! return (void *)result; } /* *************** *** 555,558 **** --- 560,584 ---- return result; } + + /* + * Sets LANG environment variable in Vim from Mac locale + */ + void + mac_lang_init() { + if (mch_getenv((char_u *)"LANG") == NULL) + { + char buf[20]; + if (LocaleRefGetPartString(NULL, + kLocaleLanguageMask | kLocaleLanguageVariantMask | + kLocaleRegionMask | kLocaleRegionVariantMask, + sizeof buf, buf) == noErr && *buf) + { + vim_setenv((char_u *)"LANG", (char_u *)buf); + # ifdef HAVE_LOCALE_H + setlocale(LC_ALL, ""); + # endif + } + } + } #endif /* MACOS_CONVERT */ diff -crN ../vim71/src/os_msdos.c ./src/os_msdos.c *** ../vim71/src/os_msdos.c Mon May 7 21:51:42 2007 --- ./src/os_msdos.c Sat Jun 21 21:59:58 2008 *************** *** 25,33 **** #include "vim.h" #include - #ifdef HAVE_FCNTL_H - # include - #endif /* * MS-DOS only code, not used for Win16. --- 25,30 ---- *************** *** 1629,1636 **** { added -= (tail - head); if (added != 0) ! mch_memmove(tail + 1 + added, tail + 1, ! STRLEN(tail + 1) + 1); STRCPY(head, fb.ff_name); tail += added; } --- 1626,1632 ---- { added -= (tail - head); if (added != 0) ! STRMOVE(tail + 1 + added, tail + 1); STRCPY(head, fb.ff_name); tail += added; } diff -crN ../vim71/src/os_msdos.h ./src/os_msdos.h *** ../vim71/src/os_msdos.h Fri Mar 24 19:37:34 2006 --- ./src/os_msdos.h Sun Apr 13 13:02:45 2008 *************** *** 35,40 **** --- 35,41 ---- #define HAVE_MEMSET #define HAVE_QSORT #define HAVE_ST_MODE /* have stat.st_mode */ + #define HAVE_MATH_H #if defined(__DATE__) && defined(__TIME__) # define HAVE_DATE_TIME #endif diff -crN ../vim71/src/os_mswin.c ./src/os_mswin.c *** ../vim71/src/os_mswin.c Mon May 7 21:39:15 2007 --- ./src/os_mswin.c Fri Aug 8 12:15:51 2008 *************** *** 25,33 **** #include "vimio.h" #include "vim.h" - #ifdef HAVE_FCNTL_H - # include - #endif #ifdef WIN16 # define SHORT_FNAME /* always 8.3 file name */ # include --- 25,30 ---- *************** *** 1731,1738 **** return colorref; } /*ARGSUSED*/ ! static BOOL CALLBACK PrintDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { #ifdef FEAT_GETTEXT --- 1728,1742 ---- return colorref; } + /* Attempt to make this work for old and new compilers */ + #if _MSC_VER < 1300 + # define PDP_RETVAL BOOL + #else + # define PDP_RETVAL INT_PTR + #endif + /*ARGSUSED*/ ! static PDP_RETVAL CALLBACK PrintDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { #ifdef FEAT_GETTEXT *************** *** 2128,2135 **** char_u *port_name = (char_u *)devname +devname->wOutputOffset; char_u *text = _("to %s on %s"); ! prt_name = alloc(STRLEN(printer_name) + STRLEN(port_name) ! + STRLEN(text)); if (prt_name != NULL) wsprintf(prt_name, text, printer_name, port_name); } --- 2132,2139 ---- char_u *port_name = (char_u *)devname +devname->wOutputOffset; char_u *text = _("to %s on %s"); ! prt_name = alloc((unsigned)(STRLEN(printer_name) + STRLEN(port_name) ! + STRLEN(text))); if (prt_name != NULL) wsprintf(prt_name, text, printer_name, port_name); } diff -crN ../vim71/src/os_vms.c ./src/os_vms.c *** ../vim71/src/os_vms.c Mon May 7 21:31:45 2007 --- ./src/os_vms.c Wed Aug 6 13:01:50 2008 *************** *** 397,403 **** * mch_expand_wildcards this code does wild-card pattern * matching NOT using the shell * ! * return OK for success, FAIL for error (you may loose some * memory) and put an error message in *file. * * num_pat number of input patterns --- 397,403 ---- * mch_expand_wildcards this code does wild-card pattern * matching NOT using the shell * ! * return OK for success, FAIL for error (you may lose some * memory) and put an error message in *file. * * num_pat number of input patterns diff -crN ../vim71/src/os_win16.c ./src/os_win16.c *** ../vim71/src/os_win16.c Mon Mar 6 09:59:15 2006 --- ./src/os_win16.c Sat Jun 21 20:52:46 2008 *************** *** 23,29 **** #include "vimio.h" #include "vim.h" - #include #include #include #include --- 23,28 ---- diff -crN ../vim71/src/os_win16.h ./src/os_win16.h *** ../vim71/src/os_win16.h Thu Jun 30 19:29:00 2005 --- ./src/os_win16.h Sun Apr 13 13:02:49 2008 *************** *** 27,32 **** --- 27,33 ---- #define HAVE_FCNTL_H #define HAVE_QSORT #define HAVE_ST_MODE /* have stat.st_mode */ + #define HAVE_MATH_H //#define USE_FNAME_CASE /* adjust case of file names */ #ifndef FEAT_CLIPBOARD # define FEAT_CLIPBOARD /* include clipboard support */ diff -crN ../vim71/src/os_win32.c ./src/os_win32.c *** ../vim71/src/os_win32.c Mon May 7 21:51:45 2007 --- ./src/os_win32.c Thu Jul 24 15:06:07 2008 *************** *** 27,35 **** # include "if_mzsch.h" #endif - #ifdef HAVE_FCNTL_H - # include - #endif #include #include #include --- 27,32 ---- *************** *** 1521,1527 **** --- 1518,1529 ---- #endif ) { + #ifdef FEAT_MBYTE + n = (*mb_char2bytes)(typeahead[typeaheadlen] | 0x80, + typeahead + typeaheadlen); + #else typeahead[typeaheadlen] |= 0x80; + #endif modifiers &= ~MOD_MASK_ALT; } *************** *** 2378,2384 **** char_u *s, int len) { ! char szUserName[MAX_COMPUTERNAME_LENGTH + 1]; DWORD cch = sizeof szUserName; if (GetUserName(szUserName, &cch)) --- 2380,2386 ---- char_u *s, int len) { ! char szUserName[256 + 1]; /* UNLEN is 256 */ DWORD cch = sizeof szUserName; if (GetUserName(szUserName, &cch)) *************** *** 2851,2857 **** windgoto((int)Rows - 1, 0); g_fForceExit = TRUE; ! sprintf((char *)IObuff, _("Vim: Caught %s event\n"), (dwCtrlType == CTRL_CLOSE_EVENT ? _("close") : dwCtrlType == CTRL_LOGOFF_EVENT --- 2853,2859 ---- windgoto((int)Rows - 1, 0); g_fForceExit = TRUE; ! vim_snprintf((char *)IObuff, IOSIZE, _("Vim: Caught %s event\n"), (dwCtrlType == CTRL_CLOSE_EVENT ? _("close") : dwCtrlType == CTRL_LOGOFF_EVENT *************** *** 3277,3288 **** { /* we use "command" or "cmd" to start the shell; slow but easy */ char_u *newcmd; ! ! newcmd = lalloc((long_u) ( #ifdef FEAT_GUI_W32 STRLEN(vimrun_path) + #endif ! STRLEN(p_sh) + STRLEN(p_shcf) + STRLEN(cmd) + 10), TRUE); if (newcmd != NULL) { char_u *cmdbase = (*cmd == '"' ? cmd + 1 : cmd); --- 3279,3291 ---- { /* we use "command" or "cmd" to start the shell; slow but easy */ char_u *newcmd; ! long_u cmdlen = ( #ifdef FEAT_GUI_W32 STRLEN(vimrun_path) + #endif ! STRLEN(p_sh) + STRLEN(p_shcf) + STRLEN(cmd) + 10); ! ! newcmd = lalloc(cmdlen, TRUE); if (newcmd != NULL) { char_u *cmdbase = (*cmd == '"' ? cmd + 1 : cmd); *************** *** 3368,3381 **** if (!s_dont_use_vimrun) /* Use vimrun to execute the command. It opens a console * window, which can be closed without killing Vim. */ ! sprintf((char *)newcmd, "%s%s%s %s %s", vimrun_path, (msg_silent != 0 || (options & SHELL_DOOUT)) ? "-s " : "", p_sh, p_shcf, cmd); else #endif ! sprintf((char *)newcmd, "%s %s %s", p_sh, p_shcf, cmd); x = mch_system((char *)newcmd, options); } vim_free(newcmd); --- 3371,3385 ---- if (!s_dont_use_vimrun) /* Use vimrun to execute the command. It opens a console * window, which can be closed without killing Vim. */ ! vim_snprintf((char *)newcmd, cmdlen, "%s%s%s %s %s", vimrun_path, (msg_silent != 0 || (options & SHELL_DOOUT)) ? "-s " : "", p_sh, p_shcf, cmd); else #endif ! vim_snprintf((char *)newcmd, cmdlen, "%s %s %s", ! p_sh, p_shcf, cmd); x = mch_system((char *)newcmd, options); } vim_free(newcmd); *************** *** 4659,4670 **** --- 4663,4691 ---- # endif ) { + # if defined(DEBUG) && _MSC_VER >= 1400 + /* Work around an annoying assertion in the Microsoft debug CRT + * when mode's text/binary setting doesn't match _get_fmode(). */ + char newMode = mode[strlen(mode) - 1]; + int oldMode = 0; + + _get_fmode(&oldMode); + if (newMode == 't') + _set_fmode(_O_TEXT); + else if (newMode == 'b') + _set_fmode(_O_BINARY); + # endif wn = enc_to_ucs2(name, NULL); wm = enc_to_ucs2(mode, NULL); if (wn != NULL && wm != NULL) f = _wfopen(wn, wm); vim_free(wn); vim_free(wm); + + # if defined(DEBUG) && _MSC_VER >= 1400 + _set_fmode(oldMode); + # endif + if (f != NULL) return f; /* Retry with non-wide function (for Windows 98). Can't use diff -crN ../vim71/src/os_win32.h ./src/os_win32.h *** ../vim71/src/os_win32.h Sun Jan 22 13:03:43 2006 --- ./src/os_win32.h Sun Apr 13 13:00:12 2008 *************** *** 28,33 **** --- 28,36 ---- #ifndef HAVE_STRING_H # define HAVE_STRING_H #endif + #ifndef HAVE_MATH_H + # define HAVE_MATH_H + #endif #define HAVE_STRCSPN #ifndef __GNUC__ #define HAVE_STRICMP diff -crN ../vim71/src/proto/os_mac_conv.pro ./src/proto/os_mac_conv.pro *** ../vim71/src/proto/os_mac_conv.pro Wed Mar 15 19:43:57 2006 --- ./src/proto/os_mac_conv.pro Sun Jun 22 21:15:06 2008 *************** *** 4,11 **** int enc2macroman __ARGS((char_u *from, size_t fromlen, char_u *to, int *tolenp, int maxtolen, char_u *rest, int *restlenp)); void mac_conv_init __ARGS((void)); void mac_conv_cleanup __ARGS((void)); ! char_u *mac_utf16_to_enc __ARGS((UniChar *from, size_t fromLen, size_t *actualLen)); ! UniChar *mac_enc_to_utf16 __ARGS((char_u *from, size_t fromLen, size_t *actualLen)); ! CFStringRef mac_enc_to_cfstring __ARGS((char_u *from, size_t fromLen)); char_u *mac_precompose_path __ARGS((char_u *decompPath, size_t decompLen, size_t *precompLen)); /* vim: set ft=c : */ --- 4,12 ---- int enc2macroman __ARGS((char_u *from, size_t fromlen, char_u *to, int *tolenp, int maxtolen, char_u *rest, int *restlenp)); void mac_conv_init __ARGS((void)); void mac_conv_cleanup __ARGS((void)); ! char_u *mac_utf16_to_enc __ARGS((unsigned short *from, size_t fromLen, size_t *actualLen)); ! unsigned short *mac_enc_to_utf16 __ARGS((char_u *from, size_t fromLen, size_t *actualLen)); ! void * mac_enc_to_cfstring __ARGS((char_u *from, size_t fromLen)); char_u *mac_precompose_path __ARGS((char_u *decompPath, size_t decompLen, size_t *precompLen)); + void mac_lang_init __ARGS((void)); /* vim: set ft=c : */ diff -crN ../vim71/src/testdir/Make_amiga.mak ./src/testdir/Make_amiga.mak *** ../vim71/src/testdir/Make_amiga.mak Sun Apr 30 13:06:36 2006 --- ./src/testdir/Make_amiga.mak Thu Jun 19 22:31:05 2008 *************** *** 25,31 **** test43.out test44.out test45.out test46.out test47.out \ test48.out test51.out test53.out test54.out test55.out \ test56.out test57.out test58.out test59.out test60.out \ ! test61.out test62.out .SUFFIXES: .in .out --- 25,31 ---- test43.out test44.out test45.out test46.out test47.out \ test48.out test51.out test53.out test54.out test55.out \ test56.out test57.out test58.out test59.out test60.out \ ! test61.out test62.out test63.out test64.out test65.out .SUFFIXES: .in .out *************** *** 107,109 **** --- 107,112 ---- test60.out: test60.in test61.out: test61.in test62.out: test62.in + test63.out: test63.in + test64.out: test64.in + test65.out: test65.in diff -crN ../vim71/src/testdir/Make_dos.mak ./src/testdir/Make_dos.mak *** ../vim71/src/testdir/Make_dos.mak Sun Apr 30 13:06:47 2006 --- ./src/testdir/Make_dos.mak Thu Jun 19 22:31:27 2008 *************** *** 19,32 **** test44.out test45.out test46.out test47.out \ test48.out test51.out test53.out test54.out \ test55.out test56.out test57.out test58.out test59.out \ ! test60.out test61.out test62.out SCRIPTS = test3.out test4.out test5.out test6.out test7.out \ test8.out test9.out test11.out test13.out test14.out \ test15.out test17.out test18.out test21.out test26.out \ test30.out test31.out test32.out test33.out test34.out \ test37.out test38.out test39.out test40.out test41.out \ ! test42.out test52.out SCRIPTS32 = test50.out --- 19,32 ---- test44.out test45.out test46.out test47.out \ test48.out test51.out test53.out test54.out \ test55.out test56.out test57.out test58.out test59.out \ ! test60.out test61.out test62.out test63.out test64.out SCRIPTS = test3.out test4.out test5.out test6.out test7.out \ test8.out test9.out test11.out test13.out test14.out \ test15.out test17.out test18.out test21.out test26.out \ test30.out test31.out test32.out test33.out test34.out \ test37.out test38.out test39.out test40.out test41.out \ ! test42.out test52.out test65.out SCRIPTS32 = test50.out *************** *** 51,69 **** clean: -del *.out ! -del test.ok ! -del small.vim ! -del tiny.vim ! -del mbyte.vim -del X* ! -del viminfo .in.out: copy $*.ok test.ok $(VIMPROG) -u dos.vim -U NONE --noplugin -s dotest.in $*.in diff test.out $*.ok ! -del $*.out rename test.out $*.out -del X* -del test.ok ! -del viminfo --- 51,69 ---- clean: -del *.out ! -if exist test.ok del test.ok ! -if exist small.vim del small.vim ! -if exist tiny.vim del tiny.vim ! -if exist mbyte.vim del mbyte.vim -del X* ! -if exist viminfo del viminfo .in.out: copy $*.ok test.ok $(VIMPROG) -u dos.vim -U NONE --noplugin -s dotest.in $*.in diff test.out $*.ok ! -if exist $*.out del $*.out rename test.out $*.out -del X* -del test.ok ! -if exist viminfo del viminfo diff -crN ../vim71/src/testdir/Make_os2.mak ./src/testdir/Make_os2.mak *** ../vim71/src/testdir/Make_os2.mak Sun Apr 30 13:06:53 2006 --- ./src/testdir/Make_os2.mak Thu Jun 19 22:31:36 2008 *************** *** 25,31 **** test43.out test44.out test45.out test46.out test47.out \ test48.out test51.out test53.out test54.out test55.out \ test56.out test57.out test58.out test59.out test60.out \ ! test61.out test62.out .SUFFIXES: .in .out --- 25,31 ---- test43.out test44.out test45.out test46.out test47.out \ test48.out test51.out test53.out test54.out test55.out \ test56.out test57.out test58.out test59.out test60.out \ ! test61.out test62.out test63.out test64.out test65.out .SUFFIXES: .in .out diff -crN ../vim71/src/testdir/Make_vms.mms ./src/testdir/Make_vms.mms *** ../vim71/src/testdir/Make_vms.mms Sun Apr 30 13:07:55 2006 --- ./src/testdir/Make_vms.mms Thu Jun 19 22:31:45 2008 *************** *** 4,10 **** # Authors: Zoltan Arpadffy, # Sandor Kopanyi, # ! # Last change: 2006 Apr 30 # # This has been tested on VMS 6.2 to 7.2 on DEC Alpha and VAX. # Edit the lines in the Configuration section below to select. --- 4,10 ---- # Authors: Zoltan Arpadffy, # Sandor Kopanyi, # ! # Last change: 2008 Jun 19 # # This has been tested on VMS 6.2 to 7.2 on DEC Alpha and VAX. # Edit the lines in the Configuration section below to select. *************** *** 59,65 **** test43.out test44.out test45.out test46.out \ test48.out test51.out test53.out test54.out test55.out \ test56.out test57.out test58.out test59.out test60.out \ ! test61.out test62.out .IFDEF WANT_GUI SCRIPT_GUI = test16.out --- 59,65 ---- test43.out test44.out test45.out test46.out \ test48.out test51.out test53.out test54.out test55.out \ test56.out test57.out test58.out test59.out test60.out \ ! test61.out test62.out test63.out test64.out test65.out .IFDEF WANT_GUI SCRIPT_GUI = test16.out diff -crN ../vim71/src/vim.def ./src/vim.def *** ../vim71/src/vim.def Sat May 12 12:18:49 2007 --- ./src/vim.def Sat Aug 9 16:23:02 2008 *************** *** 1,4 **** CODE PRELOAD EXECUTEONLY DATA MULTIPLE SHARED ! DESCRIPTION 'Vim 7.1' HEAPSIZE 0,0 --- 1,4 ---- CODE PRELOAD EXECUTEONLY DATA MULTIPLE SHARED ! DESCRIPTION 'Vim 7.2' HEAPSIZE 0,0 diff -crN ../vim71/src/vim.rc ./src/vim.rc *** ../vim71/src/vim.rc Mon Mar 6 09:59:15 2006 --- ./src/vim.rc Sun Jun 22 18:29:28 2008 *************** *** 52,58 **** // Type Library // #ifdef FEAT_OLE ! 1 TYPELIB "VIM.TLB" #endif // --- 52,58 ---- // Type Library // #ifdef FEAT_OLE ! 1 TYPELIB "vim.tlb" #endif // *************** *** 91,97 **** VALUE "FileDescription", "Vi Improved - A Text Editor\0" VALUE "FileVersion", VIM_VERSION_MAJOR_STR ", " VIM_VERSION_MINOR_STR ", " VIM_VERSION_BUILD_STR ", " VIM_VERSION_PATCHLEVEL_STR "\0" VALUE "InternalName", "VIM\0" ! VALUE "LegalCopyright", "Copyright \251 1996-2005\0" VALUE "LegalTrademarks", "Vim\0" VALUE "OriginalFilename", "VIM.EXE\0" VALUE "ProductName", "Vim\0" --- 91,97 ---- VALUE "FileDescription", "Vi Improved - A Text Editor\0" VALUE "FileVersion", VIM_VERSION_MAJOR_STR ", " VIM_VERSION_MINOR_STR ", " VIM_VERSION_BUILD_STR ", " VIM_VERSION_PATCHLEVEL_STR "\0" VALUE "InternalName", "VIM\0" ! VALUE "LegalCopyright", "Copyright \251 1996-2008\0" VALUE "LegalTrademarks", "Vim\0" VALUE "OriginalFilename", "VIM.EXE\0" VALUE "ProductName", "Vim\0" diff -crN ../vim71/src/vim16.def ./src/vim16.def *** ../vim71/src/vim16.def Sat May 12 12:18:49 2007 --- ./src/vim16.def Sat Aug 9 16:23:02 2008 *************** *** 1,5 **** CODE PRELOAD EXECUTEONLY DATA MULTIPLE SHARED ! DESCRIPTION 'Vim 7.1' STACKSIZE 16000 HEAPSIZE 10000 --- 1,5 ---- CODE PRELOAD EXECUTEONLY DATA MULTIPLE SHARED ! DESCRIPTION 'Vim 7.2' STACKSIZE 16000 HEAPSIZE 10000