Compare commits

...

46 Commits

Author SHA1 Message Date
Bjorn Winckler 6e6fac588c Snapshot 57 2011-01-29 15:49:40 +01:00
Bjorn Winckler 20ded53831 Fix compilation problems caused by patch 7.3.102 2011-01-29 15:22:20 +01:00
Bjorn Winckler 5e544c5abe Merge branch 'vim' 2011-01-29 15:08:23 +01:00
Bjorn Winckler f19b66ea39 Refactor MRU code
Only add to MRU in GUI mode and limit number of files added to the
maximum that Cocoa will display.
2011-01-23 13:02:01 +01:00
Bram Moolenaar 38b167abc5 updated for version 7.3.107
Problem:    Year number for :undolist can be confused with month or day.
Solution:   Change "%y" to "%Y".
2011-01-22 21:25:11 +01:00
Bram Moolenaar ade0ce2c47 updated for version 7.3.106
Problem:    When 'cursorbind' is set another window may scroll unexpectedly
	    when 'scrollbind' is also set. (Xavier Wang)
Solution:   Don't call update_topline() if 'scrollbind' is set.
2011-01-22 21:05:07 +01:00
Bjorn Winckler 7bcc5932e0 Fix for 'set fu' in gvimrc
It is now possible to enter full screen on startup by setting the option
'fullscreen' in gvimrc.
2011-01-22 18:41:40 +01:00
Bram Moolenaar 43592906a0 updated for version 7.3.105
Problem:    Can't get the value of "b:changedtick" with getbufvar().
Solution:   Make it work. (Christian Brabandt)
2011-01-22 01:13:39 +01:00
Bram Moolenaar dba2afde7d updated for version 7.3.104
Problem:    Conceal: using Tab for cchar causes problems. (ZyX)
Solution:   Do not accept a control character for cchar.
2011-01-22 00:58:20 +01:00
Bram Moolenaar 9285b887ec updated for version 7.3.103
Problem:    Changing 'fileformat' and then using ":w" in an empty file sets
	    the 'modified' option.
Solution:   In unchanged() don't ignore 'ff' for an empty file.
2011-01-22 00:11:50 +01:00
Bjorn Winckler dfa2561d7d Add --nomru switch
Use this switch from the command line to skip adding file to MRU list
(Most Recently Used files).  This may be useful when setting e.g.
$EDITOR to avoid temporary files from being added to the MRU.
2011-01-20 21:44:23 +01:00
Bjorn Winckler 506b335894 Add files opened from command line to MRU
Only files opened from the command line is added to the MRU (Most
Recently Used files).  Files opened from inside Vim (using :e, etc.) are
not added to the MRU.
2011-01-20 21:41:27 +01:00
Bjorn Winckler 16895bea46 Raise correct window on file open
This fixes a regression introduced in commit 210a71b4cb where
double-clicking a file in Finder that was already open would not cause
the window/tab containing that file to be raised.
2011-01-20 17:46:34 +01:00
Bjorn Winckler 4a85f40d23 Change heuristic to determine cell width
Some fonts (e.g. Monaco:h9) looked way too tight with the old heuristic
and the Core Text renderer.  Now the Core Text renderer uses the same
heuristic as the default renderer.
2011-01-18 22:00:31 +01:00
Bram Moolenaar b8e65930d2 updated for version 7.3.102
Problem:    When using ":make", typing the next command and then getting the
	    "reload" prompt the next command is (partly) eaten by the reload
	    prompt.
Solution:   Accept ':' as a special character at the reload prompt to accept
	    the default choice and execute the command.
2011-01-17 20:08:11 +01:00
Bram Moolenaar f2cfab95d8 updated for version 7.3.101
Problem:    ino_t defined with wrong size.
Solution:   Move including auto/config.h before other includes. (Marius
	    Geminas)
2011-01-17 19:53:27 +01:00
Bram Moolenaar b434a909e6 updated for version 7.3.100
Problem:    When using :normal v:count isn't set.
Solution:   Call normal_cmd() with toplevel set to TRUE.
2011-01-17 19:50:06 +01:00
Bjorn Winckler f6dc8d2962 Fix untitled window opening regression
This fixes a regression that caused two windows to open when a file was
opened from Xcode (one window holding the file, the other empty).
2011-01-17 19:12:55 +01:00
Bjorn Winckler 210a71b4cb Fix open from Xcode with selection range
This is an initial attempt to fix a problem where double clicking a
search result in Xcode would select an incorrect range of characters
when the file opened in MacVim.  It only works the file uses an 8 bit
encoding.
2011-01-17 18:00:30 +01:00
Bjorn Winckler 00936cdd77 Merge branch 'vim'
Conflicts:
	runtime/doc/eval.txt
2011-01-09 16:16:35 +01:00
Bjorn Winckler 75ca477625 Add suppression tick box to termination alert
This will disable the warning about multiple window and tabs.  Tiger
users can access this functionality by setting the user default
MMSuppressTerminationAlert to 1.
2011-01-09 16:10:16 +01:00
Bjorn Winckler 7ec523f4a8 Delete obsolete README-repo.txt 2011-01-09 13:56:19 +01:00
Bjorn Winckler 9109c9355a Hide Dock before entering full screen
This avoids the hide animation from playing after fading to black when
entering full screen.
2011-01-09 13:04:56 +01:00
Bjorn Winckler 353b836087 No partially grey window when leaving full screen 2011-01-09 12:37:37 +01:00
Bjorn Winckler 6863b04a52 Avoid switching Spaces when leaving full screen
This fixes a bug where if the full screen window was moved to another
Space a Space switch would occur when leaving full screen.
2011-01-08 19:12:29 +01:00
Bjorn Winckler 8ca9999ea6 Fix for dragging full screen window in Spaces
Ensure the full screen window is still covering the screen after having
dragged it in Spaces (or moved it in any other manner).
2011-01-08 19:04:53 +01:00
Bram Moolenaar fa35c64041 Updated runtime files. 2011-01-08 16:06:37 +01:00
Bram Moolenaar 72050cce91 updated for version 7.3.099
Problem:    Crash when splitting a window with zero height. (Yukihiro
	    Nakadaira)
Solution:   Don't set the fraction in a window with zero height.
2011-01-08 14:46:03 +01:00
Bram Moolenaar fa57d270bb updated for version 7.3.098
Problem:    Function that ignores error still causes called_emsg to be set.
	    E.g. when expand() fails the status line is disabled.
Solution:   Move check for emsg_not_now() up. (James Vega)
2011-01-04 19:25:50 +01:00
Bram Moolenaar 5e2f13cc52 updated for version 7.3.097
Problem:    Using ":call" inside "if 0" does not see that a function returns a
	    Dict and gives error for "." as string concatenation.
Solution:   Use eval0() to skip over the expression.  (Yasuhiro Matsumoto)
2011-01-04 19:03:27 +01:00
Bram Moolenaar a14d5d9f66 updated for version 7.3.096
Problem:    "gvim -nb" is not interruptable.  Leaking file descriptor on
	    netbeans connection error.
Solution:   Check for CTRL-C typed.  Free file descriptor.  (Xavier de Gaye)
2011-01-04 18:11:43 +01:00
Bram Moolenaar 60a00567b5 updated for version 7.3.095
Problem:    Win32: In Chinese tear-off menu doesn't work. (Weasley)
Solution:   Use menu_name_equal().  (Alex Jakushev)
2011-01-04 17:49:32 +01:00
Bjorn Winckler 0e9b4e11b0 Handle resolution changes while in full screen
If the screen resolution changes (either due to an external monitor
being unplugged or because the settings were changed manually) the full
screen window is now resized to match the new resolution.  Before this
commit full screen was exited on such an event.

This fixes a bug where the full screen option got out of sync after the
resolution changed.
2010-12-31 23:02:15 +01:00
Bjorn Winckler fa41b4a850 Fix compilation problems on OS X 10.4 2010-12-31 11:06:42 +01:00
Bjorn Winckler 3bcd07d562 Avoid switching Spaces when entering full screen
This fixes a bug where MacVim would switch Space when entering full
screen (which only occurred when MacVim was assigned to a specific
Space in the System Preferences).
2010-12-30 21:23:13 +01:00
Bjorn Winckler 1cb9a4ffb9 Fix file open problem in full screen with Spaces
This fixes a problem when a full screen window was on another Space and
files were set to open in the topmost window.  Previously, this caused a
new window to open on the current Space instead of opening the file in
the full screen window on the other Space.
2010-12-30 15:31:22 +01:00
Bjorn Winckler deb3e9a368 Add full screen window title to "Window" menu 2010-12-30 15:20:08 +01:00
Bram Moolenaar d593ffe24c updated for version 7.3.094
Problem:    Using abs() requires type cast to int.
Solution:   Use labs() so that the value remains long. (Hong Xu)
2010-12-30 14:57:08 +01:00
Bram Moolenaar 1fcd6cf86c updated for version 7.3.093
Problem:    New DLL dependencies in MingW with gcc 4.5.0.
Solution:   Add STATIC_STDCPLUS, LDFLAGS and split up WINDRES. (Guopeng Wen)
2010-12-30 14:50:52 +01:00
Bram Moolenaar 9faca9f9ea updated for version 7.3.092
Problem:    Resizing the window when exiting.
Solution:   Don't resize when exiting.
2010-12-30 14:47:36 +01:00
Bram Moolenaar 6b0175c466 updated for version 7.3.091
Problem:    "vim -w foo" writes special key codes for removed escape
	    sequences. (Josh Triplett)
Solution:   Don't write K_IGNORE codes.
2010-12-30 12:30:31 +01:00
Bram Moolenaar 9d282c465a updated for version 7.3.090
Problem:    Wrong help text for Cscope.
Solution:   Adjust the help text for "t". (Dominique Pelle)
2010-12-30 11:41:09 +01:00
Bjorn Winckler 3a2e09f42d Update help file 2010-12-28 21:48:57 +01:00
Bjorn Winckler 57975f6dad Update Mac specific README files 2010-12-24 15:09:30 +01:00
Bram Moolenaar ecb97f5d05 updated for version 7.3.089
Problem:    Compiler warning on 64 bit MS-Windows.
Solution:   Add type cast. (Mike Williams)
2010-12-24 14:00:17 +01:00
Bram Moolenaar a65917abf4 updated for version 7.3.088
Problem:    Ruby can't load Gems sometimes, may cause a crash.
Solution:   Undefine off_t.  Use ruby_process_options(). (Yasuhiro Matsumoto)
2010-12-24 13:39:35 +01:00
83 changed files with 1024 additions and 541 deletions
+8
View File
@@ -42,3 +42,11 @@ gvimext.lib
*.mo
*.swp
*~
# Generated by "make test"
src/po/*.ck
src/testdir/mbyte.vim
src/testdir/mzscheme.vim
src/testdir/small.vim
src/testdir/tiny.vim
src/testdir/test*.out
+4 -2
View File
@@ -22,8 +22,10 @@ src/os_beos.* Files for the BeOS port.
src/os_msdos.*
src/os_dos.* Files for the MS-DOS port.
src/gui_mac.*
src/os_mac.* Files for the Mac port.
src/gui_mac.* Carbon GUI (not used)
src/os_mac* Shared files for the different Mac ports.
src/MacVim/* Files for the MacVim port.
src/os_mint.8 Files for the Atari Mint port.
+31 -2
View File
@@ -1,8 +1,37 @@
README_mac.txt for version 7.3 of Vim: Vi IMproved.
This file explains the installation of Vim on Macintosh systems.
This file explains the installation of MacVim.
See "README.txt" for general information about Vim.
See "src/MacVim/README" for an overview of the MacVim specific source code.
MacVim uses the usual configure/make steps to build the binary but instead of
"make install" you just drag the app bundle into the directory you wish to
install in (usually `/Applications').
Sorry, this text still needs to be written!
How to build and install
========================
Run `./configure` in the `src/` directory with the flags you want, e.g.:
$ cd src
$ ./configure --with-features=huge \
--enable-rubyinterp \
--enable-pythoninterp \
--enable-perlinterp \
--enable-cscope
Now build the project using `make`:
$ make
The resulting app bundle will reside under `MacVim/build/Release`. To try it
out quickly, type:
$ open MacVim/build/Release/MacVim.app
To install MacVim, type
$ open MacVim/build/Release
and drag the MacVim icon into your `Applications` folder.
+25 -13
View File
@@ -1,6 +1,6 @@
" Vim autoload file for the tohtml plugin.
" Maintainer: Ben Fritz <fritzophrenic@gmail.com>
" Last Change: 2010 Oct 07
" Last Change: 2011 Jan 05
"
" Additional contributors:
"
@@ -600,18 +600,18 @@ func! tohtml#GetUserSettings() "{{{
endif
" get current option settings with appropriate defaults {{{
call tohtml#GetOption(user_settings, 'no_progress', !has("statusline") )
call tohtml#GetOption(user_settings, 'diff_one_file', 0 )
call tohtml#GetOption(user_settings, 'number_lines', &number )
call tohtml#GetOption(user_settings, 'use_css', 1 )
call tohtml#GetOption(user_settings, 'ignore_conceal', 0 )
call tohtml#GetOption(user_settings, 'ignore_folding', 0 )
call tohtml#GetOption(user_settings, 'dynamic_folds', 0 )
call tohtml#GetOption(user_settings, 'no_foldcolumn', 0 )
call tohtml#GetOption(user_settings, 'hover_unfold', 0 )
call tohtml#GetOption(user_settings, 'no_pre', 0 )
call tohtml#GetOption(user_settings, 'whole_filler', 0 )
call tohtml#GetOption(user_settings, 'use_xhtml', 0 )
call tohtml#GetOption(user_settings, 'no_progress', !has("statusline") )
call tohtml#GetOption(user_settings, 'diff_one_file', 0 )
call tohtml#GetOption(user_settings, 'number_lines', &number )
call tohtml#GetOption(user_settings, 'use_css', 1 )
call tohtml#GetOption(user_settings, 'ignore_conceal', 0 )
call tohtml#GetOption(user_settings, 'ignore_folding', 0 )
call tohtml#GetOption(user_settings, 'dynamic_folds', 0 )
call tohtml#GetOption(user_settings, 'no_foldcolumn', 0 )
call tohtml#GetOption(user_settings, 'hover_unfold', 0 )
call tohtml#GetOption(user_settings, 'no_pre', 0 )
call tohtml#GetOption(user_settings, 'whole_filler', 0 )
call tohtml#GetOption(user_settings, 'use_xhtml', 0 )
" }}}
" override those settings that need it {{{
@@ -643,6 +643,18 @@ func! tohtml#GetUserSettings() "{{{
let user_settings.no_pre = 1
endif "}}}
" set up expand_tabs option after all the overrides so we know the
" appropriate defaults {{{
if user_settings.no_pre == 0
call tohtml#GetOption(user_settings,
\ 'expand_tabs',
\ &expandtab || &ts != 8 || user_settings.number_lines ||
\ (user_settings.dynamic_folds && !user_settings.no_foldcolumn))
else
let user_settings.expand_tabs = 1
endif
" }}}
if exists("g:html_use_encoding") "{{{
" user specified the desired MIME charset, figure out proper
" 'fileencoding' from it or warn the user if we cannot
+3 -3
View File
@@ -1,4 +1,4 @@
*debug.txt* For Vim version 7.3. Last change: 2010 Sep 14
*debug.txt* For Vim version 7.3. Last change: 2010 Dec 22
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -21,8 +21,8 @@ When Vim crashes in one of the test files, and you are using gcc for
compilation, here is what you can do to find out exactly where Vim crashes.
This also applies when using the MingW tools.
1. Compile Vim with the "-g" option (there is a line in the Makefile for this,
which you can uncomment). Also make sure "strip" is disabled (do not
1. Compile Vim with the "-g" option (there is a line in the src/Makefile for
this, which you can uncomment). Also make sure "strip" is disabled (do not
install it, or use the line "STRIP = /bin/true").
2. Execute these commands (replace "11" with the test that fails): >
+12 -12
View File
@@ -6133,17 +6133,17 @@ cmdline_compl Compiled with |cmdline-completion| support.
cmdline_hist Compiled with |cmdline-history| support.
cmdline_info Compiled with 'showcmd' and 'ruler' support.
comments Compiled with |'comments'| support.
compatible Compiled to be very Vi compatible.
cryptv Compiled with encryption support |encryption|.
cscope Compiled with |cscope| support.
compatible Compiled to be very Vi compatible.
debug Compiled with "DEBUG" defined.
dialog_con Compiled with console dialog support.
dialog_gui Compiled with GUI dialog support.
diff Compiled with |vimdiff| and 'diff' support.
digraphs Compiled with support for digraphs.
dnd Compiled with support for the "~ register |quote_~|.
dos32 32 bits DOS (DJGPP) version of Vim.
dos16 16 bits DOS version of Vim.
dos32 32 bits DOS (DJGPP) version of Vim.
ebcdic Compiled on a machine with ebcdic character set.
emacs_tags Compiled with support for Emacs tags.
eval Compiled with expression evaluation support. Always
@@ -6167,16 +6167,16 @@ fullscreen Compiled with 'fullscreen' support.
gettext Compiled with message translation |multi-lang|
gui Compiled with GUI enabled.
gui_athena Compiled with Athena GUI.
gui_gnome Compiled with Gnome support (gui_gtk is also defined).
gui_gtk Compiled with GTK+ GUI (any version).
gui_gtk2 Compiled with GTK+ 2 GUI (gui_gtk is also defined).
gui_gnome Compiled with Gnome support (gui_gtk is also defined).
gui_mac Compiled with Macintosh GUI.
gui_macvim Compiled with MacVim GUI.
gui_motif Compiled with Motif GUI.
gui_photon Compiled with Photon GUI.
gui_running Vim is running in the GUI, or it will start soon.
gui_win32 Compiled with MS Windows Win32 GUI.
gui_win32s idem, and Win32s system being used (Windows 3.1)
gui_running Vim is running in the GUI, or it will start soon.
hangul_input Compiled with Hangul input support. |hangul|
iconv Can use iconv() for conversion.
insert_expand Compiled with support for CTRL-X expansion commands in
@@ -6198,20 +6198,20 @@ menu Compiled with support for |:menu|.
mksession Compiled with support for |:mksession|.
modify_fname Compiled with file name modifiers. |filename-modifiers|
mouse Compiled with support mouse.
mouseshape Compiled with support for 'mouseshape'.
mouse_dec Compiled with support for Dec terminal mouse.
mouse_gpm Compiled with support for gpm (Linux console mouse)
mouse_netterm Compiled with support for netterm mouse.
mouse_pterm Compiled with support for qnx pterm mouse.
mouse_sysmouse Compiled with support for sysmouse (*BSD console mouse)
mouse_xterm Compiled with support for xterm mouse.
mouseshape Compiled with support for 'mouseshape'.
multi_byte Compiled with support for 'encoding'
multi_byte_encoding 'encoding' is set to a multi-byte encoding.
multi_byte_ime Compiled with support for IME input method.
multi_lang Compiled with support for multiple languages.
mzscheme Compiled with MzScheme interface |mzscheme|.
netbeans_intg Compiled with support for |netbeans|.
netbeans_enabled Compiled with support for |netbeans| and connected.
netbeans_intg Compiled with support for |netbeans|.
odbeditor Compiled with |odbeditor| support.
ole Compiled with OLE automation support for Win32.
os2 OS/2 version of Vim.
@@ -6233,11 +6233,11 @@ showcmd Compiled with 'showcmd' support.
signs Compiled with |:sign| support.
smartindent Compiled with 'smartindent' support.
sniff Compiled with SNiFF interface support.
spell Compiled with spell checking support |spell|.
startuptime Compiled with |--startuptime| support.
statusline Compiled with support for 'statusline', 'rulerformat'
and special formats of 'titlestring' and 'iconstring'.
sun_workshop Compiled with support for Sun |workshop|.
spell Compiled with spell checking support |spell|.
syntax Compiled with syntax highlighting support |syntax|.
syntax_items There are active syntax highlighting items for the
current buffer.
@@ -6259,9 +6259,9 @@ toolbar Compiled with support for |gui-toolbar|.
transparency Compiled with 'transparency' support.
unix Unix version of Vim.
user_commands User-defined commands.
viminfo Compiled with viminfo support.
vim_starting True while initial source'ing takes place. |startup|
vertsplit Compiled with vertically split windows |:vsplit|.
vim_starting True while initial source'ing takes place. |startup|
viminfo Compiled with viminfo support.
virtualedit Compiled with 'virtualedit' option.
visual Compiled with Visual mode.
visualextra Compiled with extra Visual mode commands.
@@ -6270,13 +6270,13 @@ vms VMS version of Vim.
vreplace Compiled with |gR| and |gr| commands.
wildignore Compiled with 'wildignore' option.
wildmenu Compiled with 'wildmenu' option.
windows Compiled with support for more than one window.
winaltkeys Compiled with 'winaltkeys' option.
win16 Win16 version of Vim (MS-Windows 3.1).
win32 Win32 version of Vim (MS-Windows 95/98/ME/NT/2000/XP).
win64 Win64 version of Vim (MS-Windows 64 bit).
win32unix Win32 version of Vim, using Unix files (Cygwin)
win64 Win64 version of Vim (MS-Windows 64 bit).
win95 Win32 version for MS-Windows 95/98/ME.
winaltkeys Compiled with 'winaltkeys' option.
windows Compiled with support for more than one window.
writebackup Compiled with 'writebackup' default on.
xfontset Compiled with X fontset support |xfontset|.
xim Compiled with X input method support |xim|.
+14 -18
View File
@@ -1,4 +1,4 @@
*gui_mac.txt* For Vim version 7.3. Last change: 2010 Sep 17
*gui_mac.txt* For Vim version 7.3. Last change: 2010 Dec 28
VIM REFERENCE MANUAL by Bjorn Winckler
@@ -212,7 +212,7 @@ pressed. This feature can be enabled from the Advanced preferences pane (it
is disabled by default). Note that this setting does not affect the speed
with which windows open when using the |mvim| command.
Note that any changes to runtime files that are kept in an non-standard
Note that any changes to runtime files that are kept in a non-standard
location (i.e. not in ~/.vim) will not be picked up for the first window that
opens after any changes. Also, there are some issues related to reading and
writing of the |viminfo| file which can lead to the command line history
@@ -238,8 +238,8 @@ is sent back to the server application.
3. Preferences *macvim-prefs* *macvim-preferences*
Some settings are global to the MacVim application and would not make sense as
Vim options. These settings are stored in a user default database and can be
accessed via the "MacVim.Preferences..." menu item.
Vim options. These settings are stored in the user defaults database and can
be accessed via the "MacVim.Preferences..." menu item.
*macvim-user-defaults*
Not all entries in the user defaults database are exposed via the preference
@@ -506,24 +506,20 @@ outline.
==============================================================================
8. System services *macvim-services*
MacVim supports a few system services. These can be accessed from the MacVim
submenu in the Services menu. For services to work, MacVim.app should be
located in the /Applications folder. (You might have to logout and then login
again before Mac OS X detects the MacVim services.)
MacVim supports two system services. These can be accessed from the MacVim
submenu in the Services menu or by right-clicking a selection. For services
to work, MacVim.app should be located in the /Applications folder. (You might
have to logout and then login again before Mac OS X detects the MacVim
services.)
These are the currently supported services:
* New Document Containing Selection: Open a new window and paste the
* New MacVim Buffer With Selection: Create a new buffer and paste the
currently selected text.
* New Document Here: Open a new window and set the current directory
to that of the selected text. This is intended to be used from a
Finder window to open an empty document in the currently selected
folder.
* Open Selected File: If the selected text represents a file name,
then the corresponding file is opened in a new window.
* New MacVim Buffer Here: Create a new buffer and set the current
directory to the file or folder that is selected in the Finder.
If new files are set to open in the current window (in the General preference
pane) then the above services will also reuse the topmost window, instead of
opening a new window.
The services respect the "Open files from applications" setting in the general
preferences.
==============================================================================
9. mvim:// URL handler *mvim://* *macvim-url-handler*
+4 -2
View File
@@ -1,4 +1,4 @@
*gui_w32.txt* For Vim version 7.3. Last change: 2007 Aug 30
*gui_w32.txt* For Vim version 7.3. Last change: 2010 Dec 19
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -293,7 +293,9 @@ Normally, Vim waits for a command to complete before continuing (this makes
sense for most shell commands which produce output for Vim to use). If you
want Vim to start a program and return immediately, you can use the following
syntax on W95 & NT: >
:!start {command}
:!start [/min] {command}
The optional "/min" causes the window to be minimized.
On Win32s, you will have to go to another window instead. Don't forget that
you must tell Windows 3.1x to keep executing a DOS command in the background
while you switch back to Vim.
+9 -4
View File
@@ -1,4 +1,4 @@
*index.txt* For Vim version 7.3. Last change: 2010 Jul 21
*index.txt* For Vim version 7.3. Last change: 2011 Jan 04
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -29,7 +29,7 @@ For a complete listing of all help items see |help-tags|.
==============================================================================
1. Insert mode *insert-index*
tag char action ~
tag char action in Insert mode ~
-----------------------------------------------------------------------
|i_CTRL-@| CTRL-@ insert previously inserted text and stop
insert
@@ -459,7 +459,7 @@ tag char note action in Normal mode ~
These can be used after an operator or in Visual mode to select an object.
tag command action in Normal mode ~
tag command action in op-pending and Visual mode ~
------------------------------------------------------------------------------
|v_aquote| a" double quoted string
|v_a'| a' single quoted string
@@ -721,6 +721,7 @@ tag char note action in Normal mode ~
|gJ| gJ 2 join lines without inserting space
|gP| ["x]gP 2 put the text [from register x] before the
cursor N times, leave the cursor after it
|gQ| gQ switch to "Ex" mode with Vim editing
|gR| gR 2 enter Virtual Replace mode
|gU| gU{motion} 2 make Nmove text uppercase
|gV| gV don't reselect the previous Visual area
@@ -951,11 +952,13 @@ Normal characters are inserted at the current cursor position.
"Completion" below refers to context-sensitive completion. It will complete
file names, tags, commands etc. as appropriate.
tag command action in Command-line editing mode ~
------------------------------------------------------------------------------
CTRL-@ not used
|c_CTRL-A| CTRL-A do completion on the pattern in front of the
cursor and insert all matches
|c_CTRL-B| CTRL-B cursor to begin of command-line
|c_CTRL-C| CTRL-C same as <ESC>
|c_CTRL-C| CTRL-C same as <Esc>
|c_CTRL-D| CTRL-D list completions that match the pattern in
front of the cursor
|c_CTRL-E| CTRL-E cursor to end of command-line
@@ -1046,6 +1049,8 @@ This is a brief but complete listing of all the ":" commands, without
mentioning any arguments. The optional part of the command name is inside [].
The commands are sorted on the non-optional part of their name.
tag command action ~
------------------------------------------------------------------------------
|:!| :! filter lines or execute an external command
|:!!| :!! repeat last ":!" command
|:#| :# same as ":number"
+2 -2
View File
@@ -1,4 +1,4 @@
*mlang.txt* For Vim version 7.3. Last change: 2010 Jul 20
*mlang.txt* For Vim version 7.3. Last change: 2010 Dec 11
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -68,7 +68,7 @@ use of "-" and "_".
With the "ctype" argument the language used for
character encoding is set. This affects the libraries
that Vim was linked with. It's unusual to set this to
a different value from 'encoding'. This sets
a different value from 'encoding' or "C". This sets
$LC_CTYPE.
With the "time" argument the language used for time
and date messages is set. This affects strftime().
+4 -4
View File
@@ -1033,20 +1033,20 @@ The maximum number of entries is fixed at 100.
For example, after three jump commands you have this jump list:
jump line col file/line ~
jump line col file/text ~
3 1 0 some text ~
2 70 0 another line ~
1 1154 23 end. ~
> ~
The "file/line" column shows the file name, or the text at the jump if it is
The "file/text" column shows the file name, or the text at the jump if it is
in the current file (an indent is removed and a long line is truncated to fit
in the window).
You are currently in line 1167. If you then use the CTRL-O command, the
cursor is put in line 1154. This results in:
jump line col file/line ~
jump line col file/text ~
2 1 0 some text ~
1 70 0 another line ~
> 0 1154 23 end. ~
@@ -1076,7 +1076,7 @@ command. You can explicitly add a jump by setting the ' mark.
After the CTRL-O command that got you into line 1154 you could give another
jump command (e.g., "G"). The jump list would then become:
jump line col file/line ~
jump line col file/text ~
4 1 0 some text ~
3 70 0 another line ~
2 1167 0 foo bar ~
+2 -2
View File
@@ -1,4 +1,4 @@
*options.txt* For Vim version 7.3. Last change: 2010 Dec 08
*options.txt* For Vim version 7.3. Last change: 2010 Dec 11
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2867,7 +2867,7 @@ A jump table for the options with a short description can be found at |Q_op|.
When 'binary' is set, the value of 'fileformats' is not used.
Note that when Vim starts up with an empty buffer this option is not
use. Set 'fileformat' in your .vimrc instead.
used. Set 'fileformat' in your .vimrc instead.
For systems with a Dos-like <EOL> (<CR><NL>), when reading files that
are ":source"ed and for vimrc files, automatic <EOL> detection may be
+2 -1
View File
@@ -1,4 +1,4 @@
*os_win32.txt* For Vim version 7.3. Last change: 2010 Jul 20
*os_win32.txt* For Vim version 7.3. Last change: 2010 Dec 19
VIM REFERENCE MANUAL by George Reilly
@@ -313,6 +313,7 @@ A. When using :! to run an external command, you can run it with "start": >
with :!start do not get passed Vim's open file handles, which means they do
not have to be closed before Vim.
To avoid this special treatment, use ":! start".
The optional "/min" argument causes the window to be minimized.
Q. I'm using Win32s, and when I try to run an external command like "make",
Vim doesn't wait for it to finish! Help!
+9 -5
View File
@@ -1,4 +1,4 @@
*repeat.txt* For Vim version 7.3. Last change: 2009 Nov 04
*repeat.txt* For Vim version 7.3. Last change: 2011 Jan 06
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -102,7 +102,7 @@ To abort this type CTRL-C twice.
q{0-9a-zA-Z"} Record typed characters into register {0-9a-zA-Z"}
(uppercase to append). The 'q' command is disabled
while executing a register, and it doesn't work inside
a mapping. {Vi: no recording}
a mapping and |:normal|. {Vi: no recording}
q Stops recording. (Implementation note: The 'q' that
stops recording is not stored in the register, unless
@@ -112,9 +112,13 @@ q Stops recording. (Implementation note: The 'q' that
@{0-9a-z".=*} Execute the contents of register {0-9a-z".=*} [count]
times. Note that register '%' (name of the current
file) and '#' (name of the alternate file) cannot be
used. For "@=" you are prompted to enter an
expression. The result of the expression is then
executed. See also |@:|. {Vi: only named registers}
used.
The register is executed like a mapping, that means
that the difference between 'wildchar' and 'wildcharm'
applies.
For "@=" you are prompted to enter an expression. The
result of the expression is then executed.
See also |@:|. {Vi: only named registers}
*@@* *E748*
@@ Repeat the previous @{0-9a-z":*} [count] times.
+20
View File
@@ -475,6 +475,26 @@ risk of making some things look a bit different, use: >
This will use <br> at the end of each line and use "&nbsp;" for repeated
spaces.
If you do use the "<pre>" tags, <Tab> characters in the text are included in
the generated output if they will have no effect on the appearance of the
text and it looks like they are in the document intentionally. This allows for
the HTML output to be copied and pasted from a browser without losing the
actual whitespace used in the document.
Specifically, <Tab> characters will be included if the 'tabstop' option is set
to the default of 8, 'expandtab' is not set, and if neither the foldcolumn nor
the line numbers are included in the HTML output (see options above). When any
of these conditions are not met, any <Tab> characters in the text are expanded
to the appropriate number of spaces in the HTML output.
When "<pre>" is included, you can force |:TOhtml| to keep the tabs even if the
other conditions are not met with: >
:let g:html_expand_tabs = 0
Note that this can easily break text alignment and indentation in the HTML.
Force tabs to be expanded even when they would be kept using: >
:let g:html_expand_tabs = 1
For diff mode on a single file (with g:html_diff_one_file) a sequence of more
than 3 filler lines is displayed as three lines with the middle line
mentioning the total number of inserted lines. If you prefer to see all the
+5 -5
View File
@@ -115,7 +115,7 @@ CTRL-T Jump to [count] older entry in the tag stack
The output of ":tags" looks like this:
# TO tag FROM line in file/line
# TO tag FROM line in file/text
1 1 main 1 harddisk2:text/vim/test
> 2 2 FuncA 58 i = FuncA(10);
3 1 FuncC 357 harddisk2:text/vim/src/amiga.c
@@ -135,7 +135,7 @@ you were before the tag command. The line number will be correct, also when
deleting/inserting lines, unless this was done by another program (e.g.
another instance of Vim).
For the current file, the "file/line" column shows the text at the position.
For the current file, the "file/text" column shows the text at the position.
An indent is removed and a long line is truncated to fit in the window.
You can jump to previously used tags with several commands. Some examples:
@@ -164,9 +164,9 @@ entry was not at the bottom, the entries below the last used one are
deleted. This means that an old branch in the call graph is lost. After the
commands explained above the tag stack will look like this:
# TO tag FROM line in file
1 main 1 harddisk2:text/vim/test
2 FuncB 59 harddisk2:text/vim/src/main.c
# TO tag FROM line in file/text
1 1 main 1 harddisk2:text/vim/test
2 1 FuncB 59 harddisk2:text/vim/src/main.c
*E73*
When you try to use the tag stack while it doesn't contain anything you will
+54 -23
View File
@@ -1,4 +1,4 @@
*todo.txt* For Vim version 7.3. Last change: 2010 Dec 08
*todo.txt* For Vim version 7.3. Last change: 2011 Jan 07
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -33,6 +33,9 @@ be worked on, but only if you sponsor Vim development. See |sponsor|.
'cursorline' is displayed too short when there are concealed characters and
'list' is set, 'listchars' at default value. (Dennis Preiser, 2010 Aug 15)
When running external command with ":make", cursor line is redrawn on top of
external output.
Conceal: using Tab for cchar causes problems. Should reject it. (ZyX, 2010
Aug 25)
@@ -44,6 +47,8 @@ Syntax region with 'concealends' and a 'cchar' value, 'conceallevel' set to 2,
only one of the two ends gets the cchar displayed. (Brett Stahlman, 2010 Aug
21, Ben Fritz, 2010 Sep 14)
Bug in repeating Visual "u". (Lawrence Kesteloot, 2010 Dec 20)
Windows keys not set properly on Windows 7? (cncyber, 2010 Aug 26)
This line hangs Vim, because of syntax HL:
@@ -52,11 +57,6 @@ call append(line, "INFO ....12....18....24....30....36....42....48....54....60.
Building the MingW version without clipboard but with multi-byte doesn't
work. (Bill Lam, 2010 Sep 18)
When reading from stdin, don't enable signals before finishing reading?
Otherwise the program producing the text may get killed by SIGWINCH.
(Benjamin R. Haskell) Xavier: It's because reading from stdin returns -1.
Patch from Xavier de Gaye, 2010 Dec 7. More generic solution?
Bug: E685 error for func_unref(). (ZyX, 2010 Aug 5)
Using ":break" or something else that stops executing commands inside a
@@ -65,6 +65,13 @@ Using ":break" or something else that stops executing commands inside a
Vim using lots of memory when joining lines. (John Little, 2010 Dec 3)
On 64 bit MS-Windows "long" is only 32 bits, but we sometimes need to store a
64 bits value. Change all number options to use nropt_T and define it to the
right type.
Patch to improve mf_hash, dynamic sizing. (Ivan Krasilnikov, 2010 Dec 17)
Needs tests.
string() can't parse back "inf" and "nan". Fix documentation or fix code?
(ZyX, 2010 Aug 23)
@@ -74,9 +81,15 @@ mapping, how to restore the script ID?
Patch to fix \%V item in regexp. (Christian Brabandt, 2010 Nov 8)
Update Nov 19. James Vega: still not right. Christian: it's difficult.
Patch to add up to 99 match groups. (Christian Brabandt, 2010 Dec 22)
Also add named groups: \%{name}(re) and \%{name}g
Highlighting stops working after changing it many times. Script to reproduce
it: Pablo Contreras, 2010 Oct 12 Windows XP and 7. Font is never freed?
Loading autoload script even when usage is inside "if 0". (Christian Brabandt,
2010 Dec 18)
When 'cursorcolumn' is set locally to a window, ":new" opens a window with the
same highlighting but 'cursorcolumn' is empty. (Tyru, 2010 Nov 15)
@@ -100,15 +113,7 @@ do?
Searching mixed with Visual mode doesn't redraw properly. (James Vega, 2010 Nov
22)
Win32: When using Chinese tear-off menu doesn't work. (Weasley, 2010 Oct 31)
Patch by Alex Jakushev, 2010 Nov 2.
Using ":call" inside "if 0" does not see that a function returns a Dict and
gives error for "." as string concatenation. (Yasuhiro Matsumoto, 2010 Oct 20)
Patch: Oct 20.
Patch to move check for emsg_not_now() up to avoid statusline not being
updated. (James Vega, 2010 Nov 4)
Patch to support ":!start /b cmd". (Xaizek, 2010 Dec 22)
Copy/paste between Vim and Google chrome doesn't work well for multi-byte
characters. (Ben Haskell, 2010 Sep 17)
@@ -128,6 +133,9 @@ Nov 25)
GTK: Patch to fix menu popping down. (Hong Xu, 2010 Dec 4, Dec 5)
Python: Adding line to buffer other than the current one doesn't work
correctly. (Rozbujnik, 2010 Dec 19)
Patch to add 'systemencoding', convert between 'encoding' and this for file
names, shell commands and the like. (Kikuchan, 2010 Oct 14)
Assume the system converts between the actual encoding of the filesystem to
@@ -171,11 +179,17 @@ mkdir().
'cindent' not correct when 'list' is set. (Zdravi Korusef, 2010 Apr 15)
When 'paste' is changed with 'pastetoggle', the ruler doesn't reflect this
right away. (Samuel Ferencik, 2010 Dec 7)
Windows installer: licence text should not use indent, causes bad word wrap.
(Benjamin Fritz, 2010 Aug 16)
Mac with X11: clipboard doesn't work properly. (Raf, 2010 Aug 16)
Using CompilerSet doesn't record where an option was set from. E.g., in the
gcc compiler plugin. (Gary Johnson, 2010 Dec 13)
":helpgrep" does not put the cursor in the correct column when preceded by
accented character. (Tony Mechelynck, 2010 Apr 15)
@@ -188,6 +202,9 @@ Echo starts in the wrong column:
Patch for GVimExt to show an icon. (Dominik Riebeling, 2010 Nov 7)
When writing a file > 2Gbyte, the reported number of bytes is negative.
(Antonio Colombo, 2010 Dec 18)
Patch: Let rare word highlighting overrule good word highlighting.
(Jakson A. Aquino, 2010 Jul 30)
@@ -200,9 +217,16 @@ instead of one. (Constantin Pan, 2010 Sep 10)
Crash in setqflist(). (Benoit Mortgat, 2010 Nov 18)
Patch to handle resizing when tab is opened, when at full size. (Yukihiro
Nakadaira, 2010 Jan 6)
Writing nested List and Dict in viminfo gives error message and can't be read
back. (Yukihiro Nakadaira, 2010 Nov 13)
Can 'undolevels' be a buffer-local option? Helps for making big changes in
one file only, set 'ul' to -1 only for that buffer.
Patch by Christian Brabandt, 2010 Dec 17. Needs test.
Dos uninstal may delete vim.bat from the wrong directory (e.g., when someone
makes his own wrapper). Add a magic string with the version number to the
.bat file and check for it in the uninstaller. E.g.
@@ -258,6 +282,9 @@ Check if there are new reported defects: http://scan.coverity.com/rung2.html
Patch to support :undo absolute jump to file save number. (Christian Brabandt,
2010 Nov 5)
Patch to use 'foldnextmax' also for "marker" foldmethod. (Arnaud Lacombe, 2011
Jan 7)
When setting 'undofile' while the file is already loaded, but unchanged, try
to read the undo file. Requires computing a checksum of the text. (Andy
Wokula)
@@ -297,6 +324,10 @@ Jun 1)
Cannot use getchar() inside :normal and using an expression mapping. Is this
supposed to work? (XyX, 2010 Sep 22)
When using an expression mapping with a multi-byte character each byte is
converted to a utf-8 character. (ZyX, 2011 Jan 4)
Patch for possible solution. (Yukihiro Nakadaira, 2011 Jan 5)
When a:base in 'completefunc' starts with a number it's passed as a number,
not a string. (Sean Ma) Need to add flag to call_func_retlist() to force a
string value.
@@ -458,18 +489,17 @@ Session file generates error upon loading, cause bu --remote-silent-tab.
Using ~ works OK on 'a' with composing char, but not on 0x0418 with composing
char 0x0301. (Tony Mechelynck, 2009 Mar 4)
A function on a dictionary is not profiled. (Zyx, 2010 Dec 25)
Inconsistent: starting with $LANG set to es_ES.utf-8 gives Spanish
messages, even though locale is not supported. But ":lang messages
es_ES.utf-8" gives an error and doesn't switch messages. (Dominique Pelle,
2009 Jan 26)
When $HOME contains special characters, sich as a comma, escape them when used
When $HOME contains special characters, such as a comma, escape them when used
in an option. (Michael Hordijk, 2009 May 5)
Turn "esc" argument of expand_env_esc() into string of chars to be escaped.
Can 'undolevels' be a buffer-local option? Helps for making big changes in
one file only, set 'ul' to -1 only for that buffer.
Should make 'ignorecase' global-local, so that it makes sense setting it from
a modeline.
@@ -841,6 +871,9 @@ go to Insert mode and add a few lines. Then backspacing every other time
moves the cursor instead of deleting. (Chris Kaiser, 2007 Sep 25)
Patch to use Modern UI 2.0 for the Nsis installer. (Guopeng Wen, 2010 Jul 30)
8 Windows install with NSIS: make it possible to do a silent install, see
http://nsis.sourceforge.net/Docs/Chapter4.html#4.12
Version from Guopeng Wen that does this (2010 Dec 27)
Changes for Win32 makefile. (Mike Williams, 2007 Jan 22, Alexei Alexandrov,
2007 Feb 8)
@@ -1566,8 +1599,6 @@ Win32 GUI known bugs:
scroll?
7 Scrollbar width doesn't change when selecting other windows appearance.
Also background color of Toolbar and rectangle below vert. scrollbar.
7 "!start /min cmd" should run in a minimized window, instead of using
"/min" as the command name. (Rogall)
6 Drawing text transparently doesn't seem to work (when drawing part cursor).
8 CTRL key doesn't always work in combination with ALT key. It does work
for function keys, not for alphabetic characters. Perhaps this is because
@@ -2330,8 +2361,6 @@ Help:
User Friendlier:
8 Windows install with NSIS: make it possible to do a silent install, see
http://nsis.sourceforge.net/Docs/Chapter4.html#4.12
8 Windows install with install.exe: Use .exe instead of .bat files for
links, so that command line arguments are passed on unmodified? (Walter
Briscoe)
@@ -4455,6 +4484,8 @@ Various improvements:
7 Instead of filtering errors with a shell script it should be possible to
do this with Vim script. A function that filters the raw text that comes
from the 'makeprg'?
9 Add %F to 'errorformat': file name without spaces. Useful on Unix to
avoid matching something up to a time 11:22:33.
- Add %b to 'errorformat': buffer number. (Yegappan Lakshmanan / Suresh
Govindachar)
7 Add a command that goes back to the position from before jumping to the
+12 -5
View File
@@ -1,4 +1,4 @@
*undo.txt* For Vim version 7.3. Last change: 2010 Oct 21
*undo.txt* For Vim version 7.3. Last change: 2010 Dec 19
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -125,16 +125,23 @@ This is explained in the user manual: |usr_32.txt|.
*:undol* *:undolist*
:undol[ist] List the leafs in the tree of changes. Example:
number changes time saved ~
4 10 10:34:11
18 4 11:01:46 7
number changes when saved ~
88 88 2010/01/04 14:25:53
108 107 08/07 12:47:51
136 46 13:33:01 7
166 164 3 seconds ago
The "number" column is the change number. This number
continuously increases and can be used to identify a
specific undo-able change, see |:undo|.
The "changes" column is the number of changes to this
leaf from the root of the tree.
The "time" column is the time this change was made.
The "when" column is the date and time when this
change was made. The four possible formats are:
N seconds ago
HH:MM:SS hour, minute, seconds
MM/DD HH:MM:SS idem, with month and day
YYYY/MM/DD HH:MM:SS idem, with year
The "saved" column specifies, if this change was
written to disk and which file write it was. This can
be used with the |:later| and |:earlier| commands.
+11 -2
View File
@@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2010 Sep 29
" Last Change: 2010 Dec 17
" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
@@ -1614,7 +1614,16 @@ au BufNewFile,BufRead *.rtf setf rtf
au BufNewFile,BufRead .irbrc,irbrc setf ruby
" Ruby
au BufNewFile,BufRead *.rb,*.rbw,*.gem,*.gemspec setf ruby
au BufNewFile,BufRead *.rb,*.rbw setf ruby
" RubyGems
au BufNewFile,BufRead *.gemspec setf ruby
" Rackup
au BufNewFile,BufRead *.ru setf ruby
" Bundler
au BufNewFile,BufRead Gemfile setf ruby
" Ruby on Rails
au BufNewFile,BufRead *.builder,*.rxml,*.rjs setf ruby
+15 -8
View File
@@ -1,25 +1,32 @@
" Vim plugin for converting a syntax highlighted file to HTML.
" Maintainer: Ben Fritz <fritzophrenic@gmail.com>
" Last Change: 2010 Oct 28
" Last Change: 2011 Jan 06
"
" The core of the code is in $VIMRUNTIME/autoload/tohtml.vim and
" $VIMRUNTIME/syntax/2html.vim
"
" TODO:
" * Patch to leave tab characters in when noexpandtab set (Andy Spencer)
" * Make folds show up when using a range and dynamic folding
" * Remove fold column when there are no folds and using dynamic folding
" * Explicitly trigger IE8+ Standards Mode?
" * Make it so deleted lines in a diff don't create side-scrolling
" * Restore open/closed folds and cursor position after processing each file
" with option not to restore for speed increase
" * Add extra meta info (generation time, etc.)
" * Tidy up so we can use strict doctype in even more situations?
" * Undercurl support via dotted bottom border?
" * Add extra meta info (generation time, etc.)?
" * Tidy up so we can use strict doctype in even more situations
" * Implementation detail: add threshold for writing the lines to the html
" buffer before we're done (5000 or so lines should do it)
" * TODO comments for code cleanup scattered throughout
"
"
" Changelog:
" 7.3_v7 (this version): see betas released on vim_dev below:
" 7.3_v8 (this version): Add html_expand_tabs option to allow leaving tab
" characters in generated output (Andy Spencer). Escape
" text that looks like a modeline so Vim doesn't use
" anything in the converted HTML as a modeline.
" Bugfixes: Fix folding when a fold starts before the
" conversion range. Remove fold column when there are
" no folds.
" 7.3_v7 (840c3cadb842): see betas released on vim_dev below:
" 7.3_v7b3: Fixed bug, convert Unicode to UTF-8 all the way.
" 7.3_v7b2: Remove automatic detection of encodings that are not
" supported by all major browsers according to
@@ -54,7 +61,7 @@
if exists('g:loaded_2html_plugin')
finish
endif
let g:loaded_2html_plugin = 'vim7.3_v7'
let g:loaded_2html_plugin = 'vim7.3_v8'
" Define the :TOhtml command when:
" - 'compatible' is not set
+98 -32
View File
@@ -1,6 +1,6 @@
" Vim syntax support file
" Maintainer: Ben Fritz <fritzophrenic@gmail.com>
" Last Change: 2010 Sep 04
" Last Change: 2011 Jan 06
"
" Additional contributors:
"
@@ -124,7 +124,18 @@ function! s:HtmlFormat(text, style_name, diff_style_name)
let l:style_name = a:style_name . (a:diff_style_name == '' ? '' : ' ') . a:diff_style_name
" Replace the reserved html characters
let formatted = substitute(substitute(substitute(substitute(substitute(formatted, '&', '\&amp;', 'g'), '<', '\&lt;', 'g'), '>', '\&gt;', 'g'), '"', '\&quot;', 'g'), "\x0c", '<hr class="PAGE-BREAK">', 'g')
let formatted = substitute(formatted, '&', '\&amp;', 'g')
let formatted = substitute(formatted, '<', '\&lt;', 'g')
let formatted = substitute(formatted, '>', '\&gt;', 'g')
let formatted = substitute(formatted, '"', '\&quot;', 'g')
" TODO: Use &apos; for "'"?
" Replace a "form feed" character with HTML to do a page break
let formatted = substitute(formatted, "\x0c", '<hr class="PAGE-BREAK">', 'g')
" Mangle modelines so Vim doesn't try to use HTML text as a modeline if
" editing this file in the future
let formatted = substitute(formatted, '\v(\s+%(vim?|ex)):', '\1\&#0058;', 'g')
" Replace double spaces, leading spaces, and trailing spaces if needed
if ' ' != s:HtmlSpace
@@ -558,9 +569,6 @@ if s:settings.dynamic_folds
" level, so subtract 2 from index of first non-dash after the dashes
" in order to get the fold level of the current fold
let s:level = match(foldtextresult(s:lnum), '+-*\zs[^-]') - 2
if s:level+1 > s:foldcolumn
let s:foldcolumn = s:level+1
endif
" store fold info for later use
let s:newfold = {'firstline': s:lnum, 'lastline': foldclosedend(s:lnum), 'level': s:level,'type': "closed-fold"}
call add(s:allfolds, s:newfold)
@@ -590,9 +598,6 @@ if s:settings.dynamic_folds
" level, so subtract 2 from index of first non-dash after the dashes
" in order to get the fold level of the current fold
let s:level = match(foldtextresult(s:lnum), '+-*\zs[^-]') - 2
if s:level+1 > s:foldcolumn
let s:foldcolumn = s:level+1
endif
let s:newfold = {'firstline': s:lnum, 'lastline': foldclosedend(s:lnum), 'level': s:level,'type': "closed-fold"}
" only add the fold if we don't already have it
if empty(s:allfolds) || index(s:allfolds, s:newfold) == -1
@@ -622,6 +627,48 @@ if s:settings.dynamic_folds
" close all folds again so we can get the fold text as we go
silent! %foldclose!
for afold in s:allfolds
let removed = 0
if exists("g:html_start_line") && exists("g:html_end_line")
if afold.firstline < g:html_start_line
if afold.lastline < g:html_end_line && afold.lastline > g:html_start_line
" if a fold starts before the range to convert but stops within the
" range, we need to include it. Make it start on the first converted
" line.
let afold.firstline = g:html_start_line
else
" if the fold lies outside the range or the start and stop enclose
" the entire range, don't bother parsing it
call remove(s:allfolds, index(s:allfolds, afold))
let removed = 1
endif
elseif afold.firstline > g:html_end_line
" If the entire fold lies outside the range we need to remove it.
call remove(s:allfolds, index(s:allfolds, afold))
let removed = 1
endif
elseif exists("g:html_start_line")
if afold.firstline < g:html_start_line
" if there is no last line, but there is a first line, the end of the
" fold will always lie within the region of interest, so keep it
let afold.firstline = g:html_start_line
endif
elseif exists("g:html_end_line")
" if there is no first line we default to the first line in the buffer so
" the fold start will always be included if the fold itself is included.
" If however the entire fold lies outside the range we need to remove it.
if afold.firstline > g:html_end_line
call remove(s:allfolds, index(s:allfolds, afold))
let removed = 1
endif
endif
if !removed
if afold.level+1 > s:foldcolumn
let s:foldcolumn = afold.level+1
endif
endif
endfor
endif
" Now loop over all lines in the original text to convert to html.
@@ -669,6 +716,13 @@ endif
let s:foldId = 0
if !s:settings.expand_tabs
" If keeping tabs, add them to printable characters so we keep them when
" formatting text (strtrans() doesn't replace printable chars)
let s:old_isprint = &isprint
setlocal isprint+=9
endif
while s:lnum <= s:end
" If there are filler lines for diff mode, show these above the line.
@@ -747,7 +801,7 @@ while s:lnum <= s:end
call remove(s:foldstack, 0)
endwhile
" Now insert an opening any new folds that start on this line
" Now insert an opening for any new folds that start on this line
let s:firstfold = 1
while !empty(s:allfolds) && get(s:allfolds,0).firstline == s:lnum
let s:foldId = s:foldId + 1
@@ -884,30 +938,32 @@ while s:lnum <= s:end
endif
if s:settings.ignore_conceal || !s:concealinfo[0]
" Expand tabs
" Expand tabs if needed
let s:expandedtab = strpart(s:line, s:startcol - 1, s:col - s:startcol)
let s:offset = 0
let s:idx = stridx(s:expandedtab, "\t")
while s:idx >= 0
if has("multi_byte_encoding")
if s:startcol + s:idx == 1
let s:i = &ts
else
if s:idx == 0
let s:prevc = matchstr(s:line, '.\%' . (s:startcol + s:idx + s:offset) . 'c')
else
let s:prevc = matchstr(s:expandedtab, '.\%' . (s:idx + 1) . 'c')
endif
let s:vcol = virtcol([s:lnum, s:startcol + s:idx + s:offset - len(s:prevc)])
let s:i = &ts - (s:vcol % &ts)
endif
let s:offset -= s:i - 1
else
let s:i = &ts - ((s:idx + s:startcol - 1) % &ts)
endif
let s:expandedtab = substitute(s:expandedtab, '\t', repeat(' ', s:i), '')
if s:settings.expand_tabs
let s:offset = 0
let s:idx = stridx(s:expandedtab, "\t")
endwhile
while s:idx >= 0
if has("multi_byte_encoding")
if s:startcol + s:idx == 1
let s:i = &ts
else
if s:idx == 0
let s:prevc = matchstr(s:line, '.\%' . (s:startcol + s:idx + s:offset) . 'c')
else
let s:prevc = matchstr(s:expandedtab, '.\%' . (s:idx + 1) . 'c')
endif
let s:vcol = virtcol([s:lnum, s:startcol + s:idx + s:offset - len(s:prevc)])
let s:i = &ts - (s:vcol % &ts)
endif
let s:offset -= s:i - 1
else
let s:i = &ts - ((s:idx + s:startcol - 1) % &ts)
endif
let s:expandedtab = substitute(s:expandedtab, '\t', repeat(' ', s:i), '')
let s:idx = stridx(s:expandedtab, "\t")
endwhile
end
" get the highlight group name to use
let s:id = synIDtrans(s:id)
@@ -1073,7 +1129,7 @@ endif
" Cleanup
%s:\s\+$::e
" Restore old settings
" Restore old settings (new window first)
let &l:foldenable = s:old_fen
let &l:foldmethod = s:old_fdm
let &report = s:old_report
@@ -1083,11 +1139,20 @@ let &paste = s:old_paste
let &magic = s:old_magic
let @/ = s:old_search
let &more = s:old_more
" switch to original window to restore those settings
exe s:orgwin . "wincmd w"
if !s:settings.expand_tabs
let &l:isprint = s:old_isprint
endif
let &l:stl = s:origwin_stl
let &l:et = s:old_et
let &l:scrollbind = s:old_bind
" and back to the new window again to end there
exe s:newwin . "wincmd w"
let &l:stl = s:newwin_stl
exec 'resize' s:old_winheight
let &l:winfixheight = s:old_winfixheight
@@ -1098,6 +1163,7 @@ let &ls=s:ls
unlet s:htmlfont
unlet s:old_et s:old_paste s:old_icon s:old_report s:old_title s:old_search
unlet s:old_magic s:old_more s:old_fdm s:old_fen s:old_winheight
unlet! s:old_isprint
unlet s:whatterm s:idlist s:lnum s:end s:margin s:fgc s:bgc s:old_winfixheight
unlet! s:col s:id s:attr s:len s:line s:new s:expandedtab s:concealinfo
unlet! s:orgwin s:newwin s:orgbufnr s:idx s:i s:offset s:ls s:origwin_stl
+44 -42
View File
@@ -1,10 +1,11 @@
" Vim syntax file
" Language: XQuery
" Author: Jean-Marc Vanel <http://jmvanel.free.fr/>
" Last Change: mar jui 12 18:04:05 CEST 2005
" Author: René Neumann <necoro@necoro.eu>
" Author: Steve Spigarelli <http://spig.net/>
" Original Author: Jean-Marc Vanel <http://jmvanel.free.fr/>
" Last Change: December 11, 2010
" Filenames: *.xq
" URL: http://jmvanel.free.fr/vim/xquery.vim
" $Id: xquery.vim,v 1.1 2005/07/18 21:44:56 vimboss Exp $
" REFERENCES:
" [1] http://www.w3.org/TR/xquery/
@@ -14,22 +15,26 @@ if exists("b:current_syntax")
finish
endif
" - is allowed in keywords
setlocal iskeyword+=-
runtime syntax/xml.vim
syn case match
" From XQuery grammar:
syn keyword xqueryStatement ancestor ancestor-or-self and as ascending at attribute base-uri by case cast castable child collation construction declare default descendant descendant-or-self descending div document element else empty encoding eq every except external following following-sibling for function ge greatest gt idiv if import in inherit-namespaces instance intersect is le least let lt mod module namespace ne no of or order ordered ordering parent preceding preceding-sibling preserve return satisfies schema self some stable strip then to treat typeswitch union unordered validate variable version where xmlspace xquery yes
syn keyword xqStatement ancestor ancestor-or-self and as ascending at attribute base-uri boundary-space by case cast castable child collation construction declare default descendant descendant-or-self descending div document element else empty encoding eq every except external following following-sibling for function ge greatest gt idiv if import in inherit-namespaces instance intersect is le least let lt mod module namespace ne no of or order ordered ordering parent preceding preceding-sibling preserve return satisfies schema self some stable strip then to treat typeswitch union unordered validate variable version where xmlspace xquery yes
" TODO contains clashes with vim keyword
syn keyword xqueryFunction abs adjust-date-to-timezone adjust-date-to-timezone adjust-dateTime-to-timezone adjust-dateTime-to-timezone adjust-time-to-timezone adjust-time-to-timezone avg base-uri base-uri boolean ceiling codepoint-equal codepoints-to-string collection collection compare concat count current-date current-dateTime current-time data dateTime day-from-date day-from-dateTime days-from-duration deep-equal deep-equal default-collation distinct-values distinct-values doc doc-available document-uri empty ends-with ends-with error error error error escape-uri exactly-one exists false floor hours-from-dateTime hours-from-duration hours-from-time id id idref idref implicit-timezone in-scope-prefixes index-of index-of insert-before lang lang last local-name local-name local-name-from-QName lower-case matches matches max max min min minutes-from-dateTime minutes-from-duration minutes-from-time month-from-date month-from-dateTime months-from-duration name name namespace-uri namespace-uri namespace-uri-for-prefix namespace-uri-from-QName nilled node-name normalize-space normalize-space normalize-unicode normalize-unicode not number number one-or-more position prefix-from-QName QName remove replace replace resolve-QName resolve-uri resolve-uri reverse root root round round-half-to-even round-half-to-even seconds-from-dateTime seconds-from-duration seconds-from-time starts-with starts-with static-base-uri string string string-join string-length string-length string-to-codepoints subsequence subsequence substring substring substring-after substring-after substring-before substring-before sum sum timezone-from-date timezone-from-dateTime timezone-from-time tokenize tokenize trace translate true unordered upper-case year-from-date year-from-dateTime years-from-duration zero-or-one
syn keyword xqFunction abs adjust-date-to-timezone adjust-date-to-timezone adjust-dateTime-to-timezone adjust-dateTime-to-timezone adjust-time-to-timezone adjust-time-to-timezone avg base-uri base-uri boolean ceiling codepoint-equal codepoints-to-string collection collection compare concat count current-date current-dateTime current-time data dateTime day-from-date day-from-dateTime days-from-duration deep-equal deep-equal default-collation distinct-values distinct-values doc doc-available document-uri empty ends-with ends-with error error error error escape-uri exactly-one exists false floor hours-from-dateTime hours-from-duration hours-from-time id id idref idref implicit-timezone in-scope-prefixes index-of index-of insert-before lang lang last local-name local-name local-name-from-QName lower-case matches matches max max min min minutes-from-dateTime minutes-from-duration minutes-from-time month-from-date month-from-dateTime months-from-duration name name namespace-uri namespace-uri namespace-uri-for-prefix namespace-uri-from-QName nilled node-name normalize-space normalize-space normalize-unicode normalize-unicode not number number one-or-more position prefix-from-QName QName remove replace replace resolve-QName resolve-uri resolve-uri reverse root root round round-half-to-even round-half-to-even seconds-from-dateTime seconds-from-duration seconds-from-time starts-with starts-with static-base-uri string string string-join string-length string-length string-to-codepoints subsequence subsequence substring substring substring-after substring-after substring-before substring-before sum sum timezone-from-date timezone-from-dateTime timezone-from-time tokenize tokenize trace translate true unordered upper-case year-from-date year-from-dateTime years-from-duration zero-or-one
syn keyword xqueryOperator add-dayTimeDuration-to-date add-dayTimeDuration-to-dateTime add-dayTimeDuration-to-time add-dayTimeDurations add-yearMonthDuration-to-date add-yearMonthDuration-to-dateTime add-yearMonthDurations base64Binary-equal boolean-equal boolean-greater-than boolean-less-than concatenate date-equal date-greater-than date-less-than dateTime-equal dateTime-greater-than dateTime-less-than dayTimeDuration-equal dayTimeDuration-greater-than dayTimeDuration-less-than divide-dayTimeDuration divide-dayTimeDuration-by-dayTimeDuration divide-yearMonthDuration divide-yearMonthDuration-by-yearMonthDuration except gDay-equal gMonth-equal gMonthDay-equal gYear-equal gYearMonth-equal hexBinary-equal intersect is-same-node multiply-dayTimeDuration multiply-yearMonthDuration node-after node-before NOTATION-equal numeric-add numeric-divide numeric-equal numeric-greater-than numeric-integer-divide numeric-less-than numeric-mod numeric-multiply numeric-subtract numeric-unary-minus numeric-unary-plus QName-equal subtract-dates-yielding-dayTimeDuration subtract-dateTimes-yielding-dayTimeDuration subtract-dayTimeDuration-from-date subtract-dayTimeDuration-from-dateTime subtract-dayTimeDuration-from-time subtract-dayTimeDurations subtract-times subtract-yearMonthDuration-from-date subtract-yearMonthDuration-from-dateTime subtract-yearMonthDurations time-equal time-greater-than time-less-than to union yearMonthDuration-equal yearMonthDuration-greater-than yearMonthDuration-less-than
syn keyword xqOperator add-dayTimeDuration-to-date add-dayTimeDuration-to-dateTime add-dayTimeDuration-to-time add-dayTimeDurations add-yearMonthDuration-to-date add-yearMonthDuration-to-dateTime add-yearMonthDurations base64Binary-equal boolean-equal boolean-greater-than boolean-less-than concatenate date-equal date-greater-than date-less-than dateTime-equal dateTime-greater-than dateTime-less-than dayTimeDuration-equal dayTimeDuration-greater-than dayTimeDuration-less-than divide-dayTimeDuration divide-dayTimeDuration-by-dayTimeDuration divide-yearMonthDuration divide-yearMonthDuration-by-yearMonthDuration except gDay-equal gMonth-equal gMonthDay-equal gYear-equal gYearMonth-equal hexBinary-equal intersect is-same-node multiply-dayTimeDuration multiply-yearMonthDuration node-after node-before NOTATION-equal numeric-add numeric-divide numeric-equal numeric-greater-than numeric-integer-divide numeric-less-than numeric-mod numeric-multiply numeric-subtract numeric-unary-minus numeric-unary-plus QName-equal subtract-dates-yielding-dayTimeDuration subtract-dateTimes-yielding-dayTimeDuration subtract-dayTimeDuration-from-date subtract-dayTimeDuration-from-dateTime subtract-dayTimeDuration-from-time subtract-dayTimeDurations subtract-times subtract-yearMonthDuration-from-date subtract-yearMonthDuration-from-dateTime subtract-yearMonthDurations time-equal time-greater-than time-less-than to union yearMonthDuration-equal yearMonthDuration-greater-than yearMonthDuration-less-than
syn match xqType "xs:\(\|Datatype\|primitive\|string\|boolean\|float\|double\|decimal\|duration\|dateTime\|time\|date\|gYearMonth\|gYear\|gMonthDay\|gDay\|gMonth\|hexBinary\|base64Binary\|anyURI\|QName\|NOTATION\|\|normalizedString\|token\|language\|IDREFS\|ENTITIES\|NMTOKEN\|NMTOKENS\|Name\|NCName\|ID\|IDREF\|ENTITY\|integer\|nonPositiveInteger\|negativeInteger\|long\|int\|short\|byte\|nonNegativeInteger\|unsignedLong\|unsignedInt\|unsignedShort\|unsignedByte\|positiveInteger\)"
syn match xqueryType "xs:\(\|Datatype\|primitive\|string\|boolean\|float\|double\|decimal\|duration\|dateTime\|time\|date\|gYearMonth\|gYear\|gMonthDay\|gDay\|gMonth\|hexBinary\|base64Binary\|anyURI\|QName\|NOTATION\|\|normalizedString\|token\|language\|IDREFS\|ENTITIES\|NMTOKEN\|NMTOKENS\|Name\|NCName\|ID\|IDREF\|ENTITY\|integer\|nonPositiveInteger\|negativeInteger\|long\|int\|short\|byte\|nonNegativeInteger\|unsignedLong\|unsignedInt\|unsignedShort\|unsignedByte\|positiveInteger\)"
" From XPath grammar:
syn keyword xqueryXPath some every in in satisfies if then else to div idiv mod union intersect except instance of treat castable cast eq ne lt le gt ge is child descendant attribute self descendant-or-self following-sibling following namespace parent ancestor preceding-sibling preceding ancestor-or-self void item node document-node text comment processing-instruction attribute schema-attribute schema-element
syn keyword xqXPath some every in in satisfies if then else to div idiv mod union intersect except instance of treat castable cast eq ne lt le gt ge is child descendant attribute self descendant-or-self following-sibling following namespace parent ancestor preceding-sibling preceding ancestor-or-self void item node document-node text comment processing-instruction attribute schema-attribute schema-element
" eXist extensions
syn match xqExist "&="
@@ -37,44 +42,41 @@ syn match xqExist "&="
" XQdoc
syn match XQdoc contained "@\(param\|return\|author\)\>"
highlight def link xqueryStatement Statement
highlight def link xqueryFunction Function
highlight def link xqueryOperator Operator
highlight def link xqueryType Type
highlight def link xqueryXPath Operator
highlight def link XQdoc Special
highlight def link xqExist Operator
" floating point number, with dot, optional exponent
syn match xqFloat "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\="
" floating point number, starting with a dot, optional exponent
syn match xqFloat "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
" floating point number, without dot, with exponent
syn match xqFloat "\d\+e[-+]\=\d\+[fl]\=\>"
syn match xqNumber "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
syn match xqNumber "\<\d\+\>"
syn region xqString start=+"+ end=+"+
syn region xqComment start='(:' excludenl end=':)' contains=XQdoc
"floating point number, with dot, optional exponent
syn match cFloat "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\="
"floating point number, starting with a dot, optional exponent
syn match cFloat "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
"floating point number, without dot, with exponent
syn match cFloat "\d\+e[-+]\=\d\+[fl]\=\>"
syn match cNumber "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
syn match cNumber "\<\d\+\>"
highlight def link cNumber Number
highlight def link cFloat Number
syn region xqComment start='(:' excludenl end=':)' contains=XQdoc
highlight def link xqComment Comment
" syntax match xqVariable "$\w\+"
syntax match xqVariable +$\<[a-zA-Z:_][-.0-9a-zA-Z0-9:_]*\>+
highlight def link xqVariable Identifier
" Redefine the default XML highlighting:
highlight def link xmlTag Structure
highlight def link xmlTagName Structure
highlight def link xmlEndTag Structure
syntax match xqSeparator ",\|;"
highlight link xqSeparator Operator
syn region xqCode transparent contained start='{' excludenl end='}' contains=xmlRegionBis,xqComment,xqueryStatement,xmlString,xqSeparator,cNumber,xqVariable keepend extend
syn match xqVariable "$\<[a-zA-Z:_][-.0-9a-zA-Z0-9:_]*\>"
syn match xqSeparator ",\|;"
syn region xqCode transparent contained start='{' excludenl end='}' contains=xqFunction,xqCode,xmlRegionBis,xqComment,xqStatement,xmlString,xqSeparator,xqNumber,xqVariable,xqString keepend extend
syn region xmlRegionBis start=+<\z([^ /!?<>"']\+\)+ skip=+<!--\_.\{-}-->+ end=+</\z1\_\s\{-}>+ end=+/>+ fold contains=xmlTag,xmlEndTag,xmlCdata,xmlRegionBis,xmlComment,xmlEntity,xmlProcessing,xqCode keepend extend
syn region List transparent start='(' excludenl end=')' contains=xqCode,xmlRegion,xqComment,xqSeparator,xqueryStatement,xqVariable,xqueryType keepend extend
hi def link xqNumber Number
hi def link xqFloat Number
hi def link xqString String
hi def link xqVariable Identifier
hi def link xqComment Comment
hi def link xqSeparator Operator
hi def link xqStatement Statement
hi def link xqFunction Function
hi def link xqOperator Operator
hi def link xqType Type
hi def link xqXPath Operator
hi def link XQdoc Special
hi def link xqExist Operator
" override the xml highlighting
"hi link xmlTag Structure
"hi link xmlTagName Structure
"hi link xmlEndTag Structure
let b:current_syntax = "xquery"
+16 -3
View File
@@ -17,6 +17,17 @@ CROSS = no
# check also the executables
MINGWOLD = no
# Link against the shared versions of libgcc/libstdc++ by default. Set
# STATIC_STDCPLUS to "yes" to link against static versions instead.
STATIC_STDCPLUS=no
#STATIC_STDCPLUS=yes
# Note: -static-libstdc++ is not available until gcc 4.5.x.
LDFLAGS += -shared
ifeq (yes, $(STATIC_STDCPLUS))
LDFLAGS += -static-libgcc -static-libstdc++
endif
ifeq ($(CROSS),yes)
DEL = rm
ifeq ($(MINGWOLD),yes)
@@ -33,7 +44,9 @@ DEL = del
endif
endif
CXX := $(CROSS_COMPILE)g++
WINDRES := $(CROSS_COMPILE)windres --preprocessor="$(CXX) -E -xc" -DRC_INVOKED
WINDRES := $(CROSS_COMPILE)windres
WINDRES_CXX = $(CXX)
WINDRES_FLAGS = --preprocessor="$(WINDRES_CXX) -E -xc" -DRC_INVOKED
LIBS := -luuid
RES := gvimext.res
DEFFILE = gvimext_ming.def
@@ -46,7 +59,7 @@ DLL := gvimext.dll
all: all-before $(DLL) all-after
$(DLL): $(OBJ) $(RES) $(DEFFILE)
$(CXX) -shared $(CXXFLAGS) -s -o $@ \
$(CXX) $(LDFLAGS) $(CXXFLAGS) -s -o $@ \
-Wl,--enable-auto-image-base \
-Wl,--enable-auto-import \
-Wl,--whole-archive \
@@ -58,7 +71,7 @@ gvimext.o: gvimext.cpp
$(CXX) $(CXXFLAGS) -DFEAT_GETTEXT -c $? -o $@
$(RES): gvimext_ming.rc
$(WINDRES) --input-format=rc --output-format=coff -DMING $? -o $@
$(WINDRES) $(WINDRES_FLAGS) --input-format=rc --output-format=coff -DMING $? -o $@
clean: clean-custom
-$(DEL) $(OBJ) $(RES) $(DLL)
+1 -1
View File
@@ -1202,7 +1202,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>56</string>
<string>57</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
+90 -70
View File
@@ -222,6 +222,7 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
#ifdef INCLUDE_OLD_IM_CODE
[NSNumber numberWithBool:YES], MMUseInlineImKey,
#endif // INCLUDE_OLD_IM_CODE
[NSNumber numberWithBool:NO], MMSuppressTerminationAlertKey,
nil];
[[NSUserDefaults standardUserDefaults] registerDefaults:dict];
@@ -509,7 +510,8 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
reply = NSTerminateCancel;
[alert release];
} else {
} else if (![[NSUserDefaults standardUserDefaults]
boolForKey:MMSuppressTerminationAlertKey]) {
// No unmodified buffers, but give a warning if there are multiple
// windows and/or tabs open.
int numWindows = [vimControllers count];
@@ -530,6 +532,9 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
[alert setMessageText:NSLocalizedString(
@"Are you sure you want to quit MacVim?",
@"Quit dialog with no changed buffers, title")];
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
[alert setShowsSuppressionButton:YES];
#endif
NSString *info = nil;
if (numWindows > 1) {
@@ -559,6 +564,13 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
if ([alert runModal] != NSAlertFirstButtonReturn)
reply = NSTerminateCancel;
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
if ([[alert suppressionButton] state] == NSOnState) {
[[NSUserDefaults standardUserDefaults]
setBool:YES forKey:MMSuppressTerminationAlertKey];
}
#endif
[alert release];
}
}
@@ -869,10 +881,6 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
// a) filter out any already open files
// b) open any remaining files
//
// A file is opened in an untitled window if there is one (it may be
// currently launching, or it may already be visible), otherwise a new
// window is opened.
//
// Each launching Vim process has a dictionary of arguments that are passed
// to the process when in checks in (via connectBackend:pid:). The
// arguments for each launching process can be looked up by its PID (in the
@@ -887,29 +895,9 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
// a) Filter out any already open files
//
NSString *firstFile = [filenames objectAtIndex:0];
MMVimController *firstController = nil;
NSDictionary *openFilesDict = nil;
filenames = [self filterOpenFiles:filenames openFilesDict:&openFilesDict];
// Pass arguments to vim controllers that had files open.
id key;
NSEnumerator *e = [openFilesDict keyEnumerator];
// (Indicate that we do not wish to open any files at the moment.)
[arguments setObject:[NSNumber numberWithBool:YES] forKey:@"dontOpen"];
while ((key = [e nextObject])) {
NSArray *files = [openFilesDict objectForKey:key];
[arguments setObject:files forKey:@"filenames"];
MMVimController *vc = [key pointerValue];
[vc passArguments:arguments];
// If this controller holds the first file, then remember it for later.
if ([files containsObject:firstFile])
firstController = vc;
}
// The meaning of "layout" is defined by the WIN_* defines in main.c.
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
int layout = [ud integerForKey:MMOpenLayoutKey];
@@ -921,29 +909,46 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
if (layout < 0 || (layout > MMLayoutTabs && openInCurrentWindow))
layout = MMLayoutTabs;
if ([filenames count] == 0) {
// Raise the window containing the first file that was already open,
// and make sure that the tab containing that file is selected. Only
// do this when there are no more files to open, otherwise sometimes
// the window with 'firstFile' will be raised, other times it might be
// the window that will open with the files in the 'filenames' array.
firstFile = [firstFile stringByEscapingSpecialFilenameCharacters];
// Pass arguments to vim controllers that had files open.
id key;
NSEnumerator *e = [openFilesDict keyEnumerator];
NSString *bufCmd = @"tab sb";
switch (layout) {
case MMLayoutHorizontalSplit: bufCmd = @"sb"; break;
case MMLayoutVerticalSplit: bufCmd = @"vert sb"; break;
case MMLayoutArglist: bufCmd = @"b"; break;
// (Indicate that we do not wish to open any files at the moment.)
[arguments setObject:[NSNumber numberWithBool:YES] forKey:@"dontOpen"];
while ((key = [e nextObject])) {
MMVimController *vc = [key pointerValue];
NSArray *files = [openFilesDict objectForKey:key];
[arguments setObject:files forKey:@"filenames"];
if ([filenames count] == 0 && [files containsObject:firstFile]) {
// Raise the window containing the first file that was already
// open, and make sure that the tab containing that file is
// selected. Only do this when there are no more files to open,
// otherwise sometimes the window with 'firstFile' will be raised,
// other times it might be the window that will open with the files
// in the 'filenames' array.
//
// NOTE: Raise window before passing arguments, otherwise the
// selection will be lost when selectionRange is set.
firstFile = [firstFile stringByEscapingSpecialFilenameCharacters];
NSString *bufCmd = @"tab sb";
switch (layout) {
case MMLayoutHorizontalSplit: bufCmd = @"sb"; break;
case MMLayoutVerticalSplit: bufCmd = @"vert sb"; break;
case MMLayoutArglist: bufCmd = @"b"; break;
}
NSString *input = [NSString stringWithFormat:@"<C-\\><C-N>"
":let oldswb=&swb|let &swb=\"useopen,usetab\"|"
"%@ %@|let &swb=oldswb|unl oldswb|"
"cal foreground()<CR>", bufCmd, firstFile];
[vc addVimInput:input];
}
NSString *input = [NSString stringWithFormat:@"<C-\\><C-N>"
":let oldswb=&swb|let &swb=\"useopen,usetab\"|"
"%@ %@|let &swb=oldswb|unl oldswb|"
"cal foreground()<CR>", bufCmd, firstFile];
[firstController addVimInput:input];
return YES;
[vc passArguments:arguments];
}
// Add filenames to "Recent Files" menu, unless they are being edited
@@ -953,6 +958,9 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
noteNewRecentFilePaths:filenames];
}
if ([filenames count] == 0)
return YES; // No files left to open (all were already open)
//
// b) Open any remaining files
//
@@ -1390,7 +1398,16 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
- (MMVimController *)topmostVimController
{
// Find the topmost visible window which has an associated vim controller.
// Find the topmost visible window which has an associated vim controller
// as follows:
//
// 1. Search through ordered windows as determined by NSApp. Unfortunately
// this method can fail, e.g. if a full screen window is on another
// "Space" (in this case NSApp returns no windows at all), so we have to
// fall back on ...
// 2. Search through all Vim controllers and return the first visible
// window.
NSEnumerator *e = [[NSApp orderedWindows] objectEnumerator];
id window;
while ((window = [e nextObject]) && [window isVisible]) {
@@ -1402,6 +1419,14 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
}
}
unsigned i, count = [vimControllers count];
for (i = 0; i < count; ++i) {
MMVimController *vc = [vimControllers objectAtIndex:i];
if ([[[vc windowController] window] isVisible]) {
return vc;
}
}
return nil;
}
@@ -1446,18 +1471,12 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
// The 'pidArguments' dictionary keeps arguments to be passed to the
// process when it connects (this is in contrast to arguments which are
// passed on the command line, like '-f' and '-g').
// If this method is called with nil arguments we take this as a hint
// that this is an "untitled window" being launched and add a null
// object to the 'pidArguments' dictionary. This way we can detect if
// an untitled window is being launched by looking for null objects in
// this dictionary.
// If this method is called with non-nil arguments then it is assumed
// that the caller takes care of adding items to 'pidArguments' as
// necessary (only some arguments are passed on connect, e.g. files to
// open).
if (!args)
[pidArguments setObject:[NSNull null]
forKey:[NSNumber numberWithInt:pid]];
// NOTE: If there are no arguments to pass we still add a null object
// so that we can use this dictionary to check if there are any
// processes loading.
NSNumber *pidKey = [NSNumber numberWithInt:pid];
if (![pidArguments objectForKey:pidKey])
[pidArguments setObject:[NSNull null] forKey:pidKey];
} else {
ASLogWarn(@"Failed to launch Vim process: args=%@, useLoginShell=%d",
args, useLoginShell);
@@ -1728,9 +1747,10 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
sr->unused2, sr->theDate);
if (sr->lineNum < 0) {
// Should select a range of lines.
// Should select a range of characters.
range.location = sr->startRange + 1;
range.length = sr->endRange - sr->startRange + 1;
range.length = sr->endRange > sr->startRange
? sr->endRange - sr->startRange : 1;
} else {
// Should only move cursor to a line.
range.location = sr->lineNum + 1;
@@ -2242,12 +2262,11 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
[vc passArguments:args];
// HACK! MacVim does not get activated if it is launched from the
// terminal, so we forcibly activate here unless it is an untitled
// window opening. Untitled windows are treated differently, else
// MacVim would steal the focus if another app was activated while the
// untitled window was loading.
if (!args || args != [NSNull null])
[self activateWhenNextWindowOpens];
// terminal, so we forcibly activate here. Note that each process
// launched from MacVim has an entry in the pidArguments dictionary,
// which is how we detect if the process was launched from the
// terminal.
if (!args) [self activateWhenNextWindowOpens];
if (args)
[pidArguments removeObjectForKey:pidKey];
@@ -2309,11 +2328,12 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
NSRange r = NSRangeFromString(rangeString);
[a addObject:@"-c"];
if (r.length > 0) {
// Select given range.
[a addObject:[NSString stringWithFormat:@"norm %dGV%dGz.0",
NSMaxRange(r), r.location]];
// Select given range of characters.
// TODO: This only works for encodings where 1 byte == 1 character
[a addObject:[NSString stringWithFormat:@"norm %dgov%dgo",
r.location, NSMaxRange(r)-1]];
} else {
// Position cursor on start of range.
// Position cursor on line at start of range.
[a addObject:[NSString stringWithFormat:@"norm %dGz.0",
r.location]];
}
+2
View File
@@ -162,6 +162,8 @@ extern NSTimeInterval MMBalloonEvalInternalDelay;
- (void)setLastToolTip:(NSString *)toolTip;
#endif
- (void)addToMRU:(NSArray *)filenames;
@end
+12 -5
View File
@@ -1712,6 +1712,12 @@ static void netbeansReadCallback(CFSocketRef s,
}
#endif
- (void)addToMRU:(NSArray *)filenames
{
[self queueMessage:AddToMRUMsgID properties:
[NSDictionary dictionaryWithObject:filenames forKey:@"filenames"]];
}
@end // MMBackend
@@ -2626,7 +2632,7 @@ static void netbeansReadCallback(CFSocketRef s,
// filenames list of filenames
// dontOpen don't open files specified in above argument
// layout which layout to use to open files
// selectionRange range of lines to select
// selectionRange range of characters to select
// searchText string to search for
// cursorLine line to position the cursor on
// cursorColumn column to position the cursor on
@@ -2811,13 +2817,14 @@ static void netbeansReadCallback(CFSocketRef s,
NSString *rangeString = [args objectForKey:@"selectionRange"];
if (rangeString) {
// Build a command line string that will select the given range of
// lines. If range.length == 0, then position the cursor on the given
// line but do not select.
// characters. If range.length == 0, then position the cursor on the
// line at start of range but do not select.
NSRange range = NSRangeFromString(rangeString);
NSString *cmd;
if (range.length > 0) {
cmd = [NSString stringWithFormat:@"<C-\\><C-N>%dGV%dGz.0",
NSMaxRange(range), range.location];
// TODO: This only works for encodings where 1 byte == 1 character
cmd = [NSString stringWithFormat:@"<C-\\><C-N>%dgov%dgo",
range.location, NSMaxRange(range)-1];
} else {
cmd = [NSString stringWithFormat:@"<C-\\><C-N>%dGz.0",
range.location];
+11 -43
View File
@@ -94,29 +94,17 @@ defaultLineHeightForFont(NSFont *font)
}
static double
defaultAdvanceForFont(CTFontRef fontRef)
defaultAdvanceForFont(NSFont *font)
{
// We measure the default advance of a font as the advance of its glyph for
// 'm'.
double advance = 0.0;
UniChar characters[] = { 'm' };
int count = 1;
CGGlyph glyphs[] = { 0 };
// NOTE: Previously we used CTFontGetAdvancesForGlyphs() to get the advance
// for 'm' but this sometimes returned advances that were too small making
// the font spacing look too tight.
// Instead use the same method to query the width of 'm' as MMTextStorage
// uses to make things consistent across renderers.
if (CTFontGetGlyphsForCharacters(fontRef, characters, glyphs, count)) {
advance = CTFontGetAdvancesForGlyphs(fontRef,
kCTFontDefaultOrientation,
glyphs,
NULL,
count);
}
if (advance < 1.0) {
ASLogWarn(@"Could not determine default advance for current font");
advance = 10.0f;
}
return advance;
NSDictionary *a = [NSDictionary dictionaryWithObject:font
forKey:NSFontAttributeName];
return [@"m" sizeWithAttributes:a].width;
}
@implementation MMCoreTextView
@@ -274,34 +262,15 @@ defaultAdvanceForFont(CTFontRef fontRef)
- (void)setFont:(NSFont *)newFont
{
#if 0
if (newFont && font != newFont) {
[font release];
font = [newFont retain];
float em = 7.0; //[newFont widthOfString:@"m"];
float cellWidthMultiplier = [[NSUserDefaults standardUserDefaults]
floatForKey:MMCellWidthMultiplierKey];
// NOTE! Even though NSFontFixedAdvanceAttribute is a float, it will
// only render at integer sizes. Hence, we restrict the cell width to
// an integer here, otherwise the window width and the actual text
// width will not match.
cellSize.width = ceilf(em * cellWidthMultiplier);
cellSize.height = linespace + 15.0; //[newFont defaultLineHeightForFont];
}
#else
if (!(newFont && font != newFont))
return;
double em = round(defaultAdvanceForFont((CTFontRef)newFont));
double em = round(defaultAdvanceForFont(newFont));
double pt = round([newFont pointSize]);
NSDictionary *attr = [NSDictionary dictionaryWithObjectsAndKeys:
[newFont displayName], (NSString*)kCTFontNameAttribute,
[NSNumber numberWithFloat:pt], (NSString*)kCTFontSizeAttribute,
//[NSNumber numberWithFloat:em], (NSString*)kCTFontFixedAdvanceAttribute,
nil];
[NSNumber numberWithFloat:pt], (NSString*)kCTFontSizeAttribute, nil];
CTFontDescriptorRef desc = CTFontDescriptorCreateWithAttributes(
(CFDictionaryRef)attr);
CTFontRef fontRef = CTFontCreateWithFontDescriptor(desc, pt, NULL);
@@ -321,7 +290,6 @@ defaultAdvanceForFont(CTFontRef fontRef)
cellSize.height = linespace + defaultLineHeightForFont(font);
fontDescent = ceil(CTFontGetDescent(fontRef));
#endif
}
- (void)setWideFont:(NSFont *)newFont
+1
View File
@@ -20,6 +20,7 @@
NSPoint oldPosition;
NSString *oldTabBarStyle;
int options;
int state;
// These are only valid in fullscreen mode and store pre-fu vim size
int nonFuRows, nonFuColumns;
+177 -66
View File
@@ -37,11 +37,21 @@
#define FUOPT_MAXHORZ 0x002
#define FUOPT_BGCOLOR_HLGROUP 0x004
// Used for 'state' variable
enum {
BeforeFullScreen = 0,
InFullScreen,
LeftFullScreen
};
@interface MMFullscreenWindow (Private)
- (BOOL)isOnPrimaryScreen;
- (void)handleWindowDidBecomeMainNotification:(NSNotification *)notification;
- (void)handleWindowDidResignMainNotification:(NSNotification *)notification;
- (void)windowDidBecomeMain:(NSNotification *)notification;
- (void)windowDidResignMain:(NSNotification *)notification;
- (void)windowDidMove:(NSNotification *)notification;
- (void)applicationDidChangeScreenParameters:(NSNotification *)notification;
- (void)resizeVimView;
@end
@implementation MMFullscreenWindow
@@ -77,18 +87,27 @@
[self setBackgroundColor:back];
[self setReleasedWhenClosed:NO];
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(handleWindowDidBecomeMainNotification:)
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
[nc addObserver:self
selector:@selector(windowDidBecomeMain:)
name:NSWindowDidBecomeMainNotification
object:self];
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(handleWindowDidResignMainNotification:)
[nc addObserver:self
selector:@selector(windowDidResignMain:)
name:NSWindowDidResignMainNotification
object:self];
[nc addObserver:self
selector:@selector(windowDidMove:)
name:NSWindowDidMoveNotification
object:self];
[nc addObserver:self
selector:@selector(applicationDidChangeScreenParameters:)
name:NSApplicationDidChangeScreenParametersNotification
object:NSApp];
// NOTE: Vim needs to process mouse moved events, so enable them here.
[self setAcceptsMouseMovedEvents:YES];
@@ -116,6 +135,11 @@
{
ASLogDebug(@"Enter full screen now");
// Hide Dock and menu bar now to avoid the hide animation from playing
// after the fade to black (see also windowDidBecomeMain:).
if ([self isOnPrimaryScreen])
SetSystemUIMode(kUIModeAllSuppressed, 0);
// fade to black
Boolean didBlend = NO;
CGDisplayFadeReservationToken token;
@@ -148,84 +172,55 @@
// NOTE: Calling setTitle:nil causes an exception to be raised (and it is
// possible that 'target' has no title when we get here).
if ([target title])
if ([target title]) {
[self setTitle:[target title]];
// NOTE: Cocoa does not add borderless windows to the "Window" menu so
// we have to do it manually.
[NSApp changeWindowsItem:self title:[target title] filename:NO];
}
[self setOpaque:[target isOpaque]];
// don't set this sooner, so we don't get an additional
// focus gained message
[self setDelegate:delegate];
// resize vim view according to options
int currRows, currColumns;
[[view textView] getMaxRows:&currRows columns:&currColumns];
int fuRows = currRows, fuColumns = currColumns;
// NOTE: Do not use [NSScreen visibleFrame] when determining the screen
// size since it compensates for menu and dock.
int maxRows, maxColumns;
NSSize size = [[self screen] frame].size;
[view constrainRows:&maxRows columns:&maxColumns toSize:size];
// Store current pre-fu vim size
nonFuRows = currRows;
nonFuColumns = currColumns;
// Compute current fu size
if (options & FUOPT_MAXVERT)
fuRows = maxRows;
if (options & FUOPT_MAXHORZ)
fuColumns = maxColumns;
// Store view dimension used before entering full screen, then resize the
// view to match 'fuopt'.
[[view textView] getMaxRows:&nonFuRows columns:&nonFuColumns];
[self resizeVimView];
// Store options used when entering full screen so that we can restore
// dimensions when exiting full screen.
startFuFlags = options;
// if necessary, resize vim to target fu size
if (currRows != fuRows || currColumns != fuColumns) {
// The size sent here is queued and sent to vim when it's in
// event processing mode again. Make sure to only send the values we
// care about, as they override any changes that were made to 'lines'
// and 'columns' after 'fu' was set but before the event loop is run.
NSData *data = nil;
int msgid = 0;
if (currRows != fuRows && currColumns != fuColumns) {
int newSize[2] = { fuRows, fuColumns };
data = [NSData dataWithBytes:newSize length:2*sizeof(int)];
msgid = SetTextDimensionsMsgID;
} else if (currRows != fuRows) {
data = [NSData dataWithBytes:&fuRows length:sizeof(int)];
msgid = SetTextRowsMsgID;
} else if (currColumns != fuColumns) {
data = [NSData dataWithBytes:&fuColumns length:sizeof(int)];
msgid = SetTextColumnsMsgID;
}
NSParameterAssert(data != nil && msgid != 0);
MMVimController *vimController =
[[self windowController] vimController];
[vimController sendMessage:msgid data:data];
[[view textView] setMaxRows:fuRows columns:fuColumns];
}
startFuRows = fuRows;
startFuColumns = fuColumns;
// move vim view to the window's center
[self centerView];
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
// HACK! Put window on all Spaces to avoid Spaces (available on OS X 10.5
// and later) from moving the full screen window to a separate Space from
// the one the decorated window is occupying. The collection behavior is
// restored further down.
NSWindowCollectionBehavior wcb = [self collectionBehavior];
[self setCollectionBehavior:NSWindowCollectionBehaviorCanJoinAllSpaces];
#endif
// make us visible and target invisible
[target orderOut:self];
[self makeKeyAndOrderFront:self];
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
// Restore collection behavior (see hack above).
[self setCollectionBehavior:wcb];
#endif
// fade back in
if (didBlend) {
CGDisplayFade(token, .25, kCGDisplayBlendSolidColor,
kCGDisplayBlendNormal, .0, .0, .0, false);
CGReleaseDisplayFadeReservation(token);
}
state = InFullScreen;
}
- (void)leaveFullscreen
@@ -292,8 +287,23 @@
// button on the tabline steals the first responder status.
[target setInitialFirstResponder:[view textView]];
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
// HACK! Put decorated window on all Spaces (available on OS X 10.5 and
// later) so that the decorated window stays on the same Space as the full
// screen window (they may occupy different Spaces e.g. if the full screen
// window was dragged to another Space). The collection behavior is
// restored further down.
NSWindowCollectionBehavior wcb = [target collectionBehavior];
[target setCollectionBehavior:NSWindowCollectionBehaviorCanJoinAllSpaces];
#endif
[target makeKeyAndOrderFront:self];
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
// Restore collection behavior (see hack above).
[target setCollectionBehavior:wcb];
#endif
// ...but we don't want a focus gained message either, so don't set this
// sooner
[target setDelegate:delegate];
@@ -306,6 +316,9 @@
}
[self autorelease]; // Balance the above retain
state = LeftFullScreen;
ASLogDebug(@"Left full screen");
}
// Title-less windows normally don't receive key presses, override this
@@ -376,7 +389,7 @@
return [self screen] == [screens objectAtIndex:0];
}
- (void)handleWindowDidBecomeMainNotification:(NSNotification *)notification
- (void)windowDidBecomeMain:(NSNotification *)notification
{
// Hide menu and dock, both appear on demand.
//
@@ -394,7 +407,7 @@
}
}
- (void)handleWindowDidResignMainNotification:(NSNotification *)notification
- (void)windowDidResignMain:(NSNotification *)notification
{
// order menu and dock back in
if ([self isOnPrimaryScreen]) {
@@ -402,4 +415,102 @@
}
}
- (void)windowDidMove:(NSNotification *)notification
{
if (state != InFullScreen)
return;
// Window may move as a result of being dragged between Spaces.
ASLogDebug(@"Full screen window moved, ensuring it covers the screen...");
// Ensure the full screen window is still covering the entire screen and
// then resize view according to 'fuopt'.
[self setFrame:[[self screen] frame] display:NO];
[self resizeVimView];
}
- (void)applicationDidChangeScreenParameters:(NSNotification *)notification
{
if (state != InFullScreen)
return;
// This notification is sent when screen resolution may have changed (e.g.
// due to a monitor being unplugged or the resolution being changed
// manually) but it also seems to get called when the Dock is
// hidden/displayed.
ASLogDebug(@"Screen unplugged / resolution changed");
NSScreen *screen = [target screen];
if (!screen) {
// Paranoia: if window we originally used for full screen is gone, try
// screen window is on now, and failing that (not sure this can happen)
// use main screen.
screen = [self screen];
if (!screen)
screen = [NSScreen mainScreen];
}
// Ensure the full screen window is still covering the entire screen and
// then resize view according to 'fuopt'.
[self setFrame:[screen frame] display:NO];
[self resizeVimView];
}
- (void)resizeVimView
{
// Resize vim view according to options
int currRows, currColumns;
[[view textView] getMaxRows:&currRows columns:&currColumns];
int fuRows = currRows, fuColumns = currColumns;
// NOTE: Do not use [NSScreen visibleFrame] when determining the screen
// size since it compensates for menu and dock.
int maxRows, maxColumns;
NSSize size = [[self screen] frame].size;
[view constrainRows:&maxRows columns:&maxColumns toSize:size];
// Compute current fu size
if (options & FUOPT_MAXVERT)
fuRows = maxRows;
if (options & FUOPT_MAXHORZ)
fuColumns = maxColumns;
// if necessary, resize vim to target fu size
if (currRows != fuRows || currColumns != fuColumns) {
// The size sent here is queued and sent to vim when it's in
// event processing mode again. Make sure to only send the values we
// care about, as they override any changes that were made to 'lines'
// and 'columns' after 'fu' was set but before the event loop is run.
NSData *data = nil;
int msgid = 0;
if (currRows != fuRows && currColumns != fuColumns) {
int newSize[2] = { fuRows, fuColumns };
data = [NSData dataWithBytes:newSize length:2*sizeof(int)];
msgid = SetTextDimensionsMsgID;
} else if (currRows != fuRows) {
data = [NSData dataWithBytes:&fuRows length:sizeof(int)];
msgid = SetTextRowsMsgID;
} else if (currColumns != fuColumns) {
data = [NSData dataWithBytes:&fuColumns length:sizeof(int)];
msgid = SetTextColumnsMsgID;
}
NSParameterAssert(data != nil && msgid != 0);
MMVimController *vc = [[self windowController] vimController];
[vc sendMessage:msgid data:data];
[[view textView] setMaxRows:fuRows columns:fuColumns];
}
// The new view dimensions are stored and then consulted when attempting to
// restore the windowed view dimensions when leaving full screen.
// NOTE: Store them here and not only in enterFullscreen, otherwise the
// windowed view dimensions will not be restored if the full screen was on
// a screen that later was unplugged.
startFuRows = fuRows;
startFuColumns = fuColumns;
[self centerView];
}
@end // MMFullscreenWindow (Private)
+11 -1
View File
@@ -271,6 +271,10 @@ static BOOL isUnsafeMessage(int msgid);
nil];
[self sendMessage:DropFilesMsgID data:[args dictionaryAsData]];
// Add dropped files to the "Recent Files" menu.
[[NSDocumentController sharedDocumentController]
noteNewRecentFilePaths:filenames];
}
- (void)file:(NSString *)filename draggedToTabAtIndex:(NSUInteger)tabIndex
@@ -861,6 +865,12 @@ static BOOL isUnsafeMessage(int msgid);
NSNumber *delay = dict ? [dict objectForKey:@"delay"] : nil;
if (delay)
[self setToolTipDelay:[delay floatValue]];
} else if (AddToMRUMsgID == msgid) {
NSDictionary *dict = [NSDictionary dictionaryWithData:data];
NSArray *filenames = dict ? [dict objectForKey:@"filenames"] : nil;
if (filenames)
[[NSDocumentController sharedDocumentController]
noteNewRecentFilePaths:filenames];
// IMPORTANT: When adding a new message, make sure to update
// isUnsafeMessage() if necessary!
@@ -897,7 +907,7 @@ static BOOL isUnsafeMessage(int msgid);
// are opened/saved from a :browse command are added to this menu).
if (path)
[[NSDocumentController sharedDocumentController]
noteNewRecentFilePath:path];
noteNewRecentFilePath:path];
}
@catch (NSException *ex) {
ASLogDebug(@"Exception: pid=%d id=%d reason=%@", pid, identifier, ex);
+13 -5
View File
@@ -360,8 +360,17 @@
- (void)setTitle:(NSString *)title
{
if (title)
[decoratedWindow setTitle:title];
if (!title)
return;
[decoratedWindow setTitle:title];
if (fullscreenEnabled) {
[fullscreenWindow setTitle:title];
// NOTE: Cocoa does not update the "Window" menu for borderless windows
// so we have to do it manually.
[NSApp changeWindowsItem:fullscreenWindow title:title filename:NO];
}
}
- (void)setDocumentFilename:(NSString *)filename
@@ -846,11 +855,10 @@
return;
if (fullscreenEnabled) {
// HACK! The full-screen is not supposed to be able to be moved. If we
// NOTE: The full-screen is not supposed to be able to be moved. If we
// do get here while in full-screen something unexpected happened (e.g.
// the full-screen window was on an external display that got
// unplugged) and we handle this situation by leaving full-screen.
[self leaveFullscreen];
// unplugged).
return;
}
+1
View File
@@ -188,6 +188,7 @@ enum {
SetTooltipMsgID,
SetTooltipDelayMsgID,
GestureMsgID,
AddToMRUMsgID,
LastMsgID // NOTE: MUST BE LAST MESSAGE IN ENUM!
};
+1
View File
@@ -98,6 +98,7 @@ char *MessageStrings[] =
"SetTooltipMsgID",
"SetTooltipDelayMsgID",
"GestureMsgID",
"AddToMRUMsgID",
"END OF MESSAGE IDs" // NOTE: Must be last!
};
+2 -2
View File
@@ -622,7 +622,7 @@
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 56;
CURRENT_PROJECT_VERSION = 57;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
@@ -652,7 +652,7 @@
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 56;
CURRENT_PROJECT_VERSION = 57;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
+1
View File
@@ -52,6 +52,7 @@ extern NSString *MMLastWindowClosedBehaviorKey;
#ifdef INCLUDE_OLD_IM_CODE
extern NSString *MMUseInlineImKey;
#endif // INCLUDE_OLD_IM_CODE
extern NSString *MMSuppressTerminationAlertKey;
// Enum for MMUntitledWindowKey
+1
View File
@@ -44,6 +44,7 @@ NSString *MMLastWindowClosedBehaviorKey = @"MMLastWindowClosedBehavior";
#ifdef INCLUDE_OLD_IM_CODE
NSString *MMUseInlineImKey = @"MMUseInlineIm";
#endif // INCLUDE_OLD_IM_CODE
NSString *MMSuppressTerminationAlertKey = @"MMSuppressTerminationAlert";
-20
View File
@@ -1,20 +0,0 @@
MacVim is a port of the text editor Vim to Mac OS X. More information can be
found on the [project webpage][gcode]. The file `src/MacVim/README` gives an
overview of the MacVim source code.
### Branches ###
`master`
: MacVim and core Vim sources
`vim`
: Core Vim sources pulled from the SVN repository with the latest runtime
: files from the Vim FTP included
`stable`
: Used to build the Stable binary distribution
_Note:_ Branches starting with `feat/` are experimental and will be rebased
against master occasionally (other branches will not be rebased).
[gcode]: http://code.google.com/p/macvim/
+60 -16
View File
@@ -24,6 +24,13 @@ int use_gui_macvim_draw_string = 1;
static int use_graphical_sign = 0;
// Max number of files to add to MRU in one go (this matches the maximum that
// Cocoa displays in the MRU -- if this changes in Cocoa then update this
// number as well).
static int MMMaxMRU = 10;
// Enabled when files passed on command line should not be added to MRU.
static BOOL MMNoMRU = NO;
static NSString *MMDefaultFontName = @"Menlo Regular";
static int MMDefaultFontSize = 11;
static int MMMinFontSize = 6;
@@ -87,28 +94,45 @@ macvim_early_init()
void
gui_mch_prepare(int *argc, char **argv)
{
int i;
for (i = 0; i < *argc; ++i) {
if (strncmp(argv[i], "--mmwaitforack", 14) == 0) {
[[MMBackend sharedInstance] setWaitForAck:YES];
--*argc;
if (*argc > i)
mch_memmove(&argv[i], &argv[i+1], (*argc-i) * sizeof(char*));
break;
}
}
// NOTE! Vim expects this method to remove args that it handles from the
// arg list but if the process then forks then these arguments will not
// reach the child process due to the way forking is handled on Mac OS X.
//
// Thus, only delete arguments that imply that no forking is done.
//
// If you add an argument that does not imply no forking, then do not
// delete it from the arg list. Such arguments must be ignored in main.c
// command_line_scan() or Vim will issue an error on startup when that
// argument is used.
int i = 0;
while (i < *argc) {
BOOL delarg = NO;
if (strncmp(argv[i], "--mmwaitforack", 14) == 0) {
// Implies -f (only called from front end)
[[MMBackend sharedInstance] setWaitForAck:YES];
delarg = YES;
}
#ifdef FEAT_NETBEANS_INTG
for (i = 0; i < *argc; ++i) {
if (strncmp(argv[i], "-nb", 3) == 0) {
else if (strncmp(argv[i], "-nb", 3) == 0) {
// TODO: Can this be used without -f? If so, should not del arg.
netbeansArg = argv[i];
delarg = YES;
}
#endif
else if (strncmp(argv[i], "--nomru", 7) == 0) {
// Can be used without -f, do not delete from arg list!
MMNoMRU = YES;
}
if (delarg) {
// NOTE: See comment above about when to delete arguments!
--*argc;
if (*argc > i)
mch_memmove(&argv[i], &argv[i+1], (*argc-i) * sizeof(char*));
break;
}
} else
++i;
}
#endif
}
@@ -208,6 +232,25 @@ gui_mch_init(void)
// in [g]vimrc.
gui_mch_adjust_charheight();
if (!MMNoMRU && GARGCOUNT > 0) {
// Add files passed on command line to MRU.
NSMutableArray *filenames = [NSMutableArray array];
int i, count = GARGCOUNT > MMMaxMRU ? MMMaxMRU : GARGCOUNT;
for (i = 0; i < count; ++i) {
char_u *fname = GARGLIST[i].ae_fname;
if (!fname) continue;
// Expand to a full file name (including the full path).
char_u *ffname = fix_fname(fname);
if (!ffname) continue;
[filenames addObject:[NSString stringWithVimString:ffname]];
vim_free(ffname);
}
[[MMBackend sharedInstance] addToMRU:filenames];
}
return OK;
}
@@ -1388,7 +1431,8 @@ gui_mch_dialog(
char_u *message,
char_u *buttons,
int dfltbutton,
char_u *textfield)
char_u *textfield,
int ex_cmd) // UNUSED
{
ASLogDebug(@"type=%d title='%s' message='%s' buttons='%s' dfltbutton=%d "
"textfield='%s'", type, title, message, buttons, dfltbutton,
+17 -4
View File
@@ -56,6 +56,12 @@ CSCOPE=yes
NETBEANS=$(GUI)
# Link against the shared version of libstdc++ by default. Set
# STATIC_STDCPLUS to "yes" to link against static version instead.
ifndef STATIC_STDCPLUS
STATIC_STDCPLUS=no
endif
# If the user doesn't want gettext, undefine it.
ifeq (no, $(GETTEXT))
GETTEXT=
@@ -309,12 +315,14 @@ DIRSLASH = \\
endif
endif
CC := $(CROSS_COMPILE)gcc
WINDRES := $(CROSS_COMPILE)windres --preprocessor="$(CC) -E -xc" -DRC_INVOKED
WINDRES := $(CROSS_COMPILE)windres
WINDRES_CC = $(CC)
#>>>>> end of choices
###########################################################################
CFLAGS = -Iproto $(DEFINES) -pipe -w -march=$(ARCH) -Wall
WINDRES_FLAGS = --preprocessor="$(WINDRES_CC) -E -xc" -DRC_INVOKED
ifdef GETTEXT
DEFINES += -DHAVE_GETTEXT -DHAVE_LOCALE_H
@@ -577,8 +585,13 @@ endif
endif
ifeq (yes, $(OLE))
LIB += -loleaut32 -lstdc++
LIB += -loleaut32
OBJ += $(OUTDIR)/if_ole.o
ifeq (yes, $(STATIC_STDCPLUS))
LIB += -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
else
LIB += -lstdc++
endif
endif
ifeq (yes, $(MBYTE))
@@ -656,10 +669,10 @@ $(OUTDIR)/%.o : %.c $(INCL)
$(CC) -c $(CFLAGS) $< -o $@
$(OUTDIR)/vimres.res: vim.rc version.h gui_w32_rc.h
$(WINDRES) $(DEFINES) vim.rc $(OUTDIR)/vimres.res
$(WINDRES) $(WINDRES_FLAGS) $(DEFINES) vim.rc $(OUTDIR)/vimres.res
$(OUTDIR)/vimrc.o: $(OUTDIR)/vimres.res
$(WINDRES) $(OUTDIR)/vimres.res $(OUTDIR)/vimrc.o
$(WINDRES) $(WINDRES_FLAGS) $(OUTDIR)/vimres.res $(OUTDIR)/vimrc.o
$(OUTDIR):
$(MKDIR) $(OUTDIR)
+16 -2
View File
@@ -3335,6 +3335,15 @@ ex_call(eap)
int failed = FALSE;
funcdict_T fudi;
if (eap->skip)
{
/* trans_function_name() doesn't work well when skipping, use eval0()
* instead to skip to any following command, e.g. for:
* :if 0 | call dict.foo().bar() | endif */
eval0(eap->arg, &rettv, &eap->nextcmd, FALSE);
return;
}
tofree = trans_function_name(&arg, eap->skip, TFN_INT, &fudi);
if (fudi.fd_newkey != NULL)
{
@@ -9315,7 +9324,7 @@ f_confirm(argvars, rettv)
if (!error)
rettv->vval.v_number = do_dialog(type, NULL, message, buttons,
def, NULL);
def, NULL, FALSE);
#endif
}
@@ -10858,6 +10867,11 @@ f_getbufvar(argvars, rettv)
if (*varname == '&') /* buffer-local-option */
get_option_tv(&varname, rettv, TRUE);
else if (STRCMP(varname, "changedtick") == 0)
{
rettv->v_type = VAR_NUMBER;
rettv->vval.v_number = curbuf->b_changedtick;
}
else
{
if (*varname == NUL)
@@ -12755,7 +12769,7 @@ f_inputdialog(argvars, rettv)
IObuff[0] = NUL;
if (message != NULL && defstr != NULL
&& do_dialog(VIM_QUESTION, NULL, message,
(char_u *)_("&OK\n&Cancel"), 1, IObuff) == 1)
(char_u *)_("&OK\n&Cancel"), 1, IObuff, FALSE) == 1)
rettv->vval.v_string = vim_strsave(IObuff);
else
{
+2 -2
View File
@@ -1501,7 +1501,7 @@ vim_dialog_save_changes(buf)
(buf->b_fname != NULL)
? (char_u *)_("&Save\n&Cancel\n&Don't Save")
: (char_u *)_("&Save...\n&Cancel\n&Don't Save"),
1, NULL))
1, NULL, FALSE))
{
case 1: return VIM_YES;
case 3: return VIM_NO;
@@ -1528,7 +1528,7 @@ vim_dialog_save_all_changes(buf)
"them."),
(char_u *)_("&Save\n&Don't Save\nS&ave All\nD&iscard All\n"
"&Cancel"),
1, NULL))
1, NULL, FALSE))
{
case 1: return VIM_YES;
case 2: return VIM_NO;
+1 -1
View File
@@ -9330,7 +9330,7 @@ exec_normal_cmd(cmd, remap, silent)
&& !got_int)
{
update_topline_cursor();
normal_cmd(&oa, FALSE); /* execute a Normal mode cmd */
normal_cmd(&oa, TRUE); /* execute a Normal mode cmd */
}
}
#endif
+2 -2
View File
@@ -7031,7 +7031,7 @@ buf_check_timestamp(buf, focus)
{
switch (do_dialog(VIM_WARNING, (char_u *)_("Warning"), tbuf,
(char_u *)_("&OK\n&Load File\nLoad &All\n&Ignore All"),
1, NULL))
1, NULL, TRUE))
{
case 3:
default_reload_choice = 2;
@@ -7045,7 +7045,7 @@ buf_check_timestamp(buf, focus)
}
# else
if (do_dialog(VIM_WARNING, (char_u *)_("Warning"), tbuf,
(char_u *)_("&OK\n&Load File"), 1, NULL) == 2)
(char_u *)_("&OK\n&Load File"), 1, NULL, TRUE) == 2)
reload = TRUE;
# endif
}
+14 -15
View File
@@ -1506,9 +1506,6 @@ updatescript(c)
}
}
#define KL_PART_KEY -1 /* keylen value for incomplete key-code */
#define KL_PART_MAP -2 /* keylen value for incomplete mapping */
/*
* Get the next input character.
* Can return a special key or a multi-byte character.
@@ -2171,7 +2168,7 @@ vgetorpeek(advance)
if (!timedout)
{
/* break at a partly match */
keylen = KL_PART_MAP;
keylen = KEYLEN_PART_MAP;
break;
}
}
@@ -2192,7 +2189,7 @@ vgetorpeek(advance)
/* If no partly match found, use the longest full
* match. */
if (keylen != KL_PART_MAP)
if (keylen != KEYLEN_PART_MAP)
{
mp = mp_match;
keylen = mp_match_len;
@@ -2230,7 +2227,7 @@ vgetorpeek(advance)
}
/* Need more chars for partly match. */
if (mlen == typebuf.tb_len)
keylen = KL_PART_KEY;
keylen = KEYLEN_PART_KEY;
else if (max_mlen < mlen)
/* no match, may have to check for termcode at
* next character */
@@ -2238,7 +2235,7 @@ vgetorpeek(advance)
}
if ((mp == NULL || max_mlen >= mp_match_len)
&& keylen != KL_PART_MAP)
&& keylen != KEYLEN_PART_MAP)
{
int save_keylen = keylen;
@@ -2264,8 +2261,8 @@ vgetorpeek(advance)
/* If no termcode matched but 'pastetoggle'
* matched partially it's like an incomplete key
* sequence. */
if (keylen == 0 && save_keylen == KL_PART_KEY)
keylen = KL_PART_KEY;
if (keylen == 0 && save_keylen == KEYLEN_PART_KEY)
keylen = KEYLEN_PART_KEY;
/*
* When getting a partial match, but the last
@@ -2302,7 +2299,7 @@ vgetorpeek(advance)
continue;
}
if (*s == NUL) /* need more characters */
keylen = KL_PART_KEY;
keylen = KEYLEN_PART_KEY;
}
if (keylen >= 0)
#endif
@@ -2339,7 +2336,8 @@ vgetorpeek(advance)
if (keylen > 0) /* full matching terminal code */
{
#if defined(FEAT_GUI) && defined(FEAT_MENU)
if (typebuf.tb_buf[typebuf.tb_off] == K_SPECIAL
if (typebuf.tb_len >= 2
&& typebuf.tb_buf[typebuf.tb_off] == K_SPECIAL
&& typebuf.tb_buf[typebuf.tb_off + 1]
== KS_MENU)
{
@@ -2381,7 +2379,7 @@ vgetorpeek(advance)
/* Partial match: get some more characters. When a
* matching mapping was found use that one. */
if (mp == NULL || keylen < 0)
keylen = KL_PART_KEY;
keylen = KEYLEN_PART_KEY;
else
keylen = mp_match_len;
}
@@ -2553,7 +2551,8 @@ vgetorpeek(advance)
#endif
&& typebuf.tb_maplen == 0
&& (State & INSERT)
&& (p_timeout || (keylen == KL_PART_KEY && p_ttimeout))
&& (p_timeout
|| (keylen == KEYLEN_PART_KEY && p_ttimeout))
&& (c = inchar(typebuf.tb_buf + typebuf.tb_off
+ typebuf.tb_len, 3, 25L,
typebuf.tb_change_cnt)) == 0)
@@ -2783,9 +2782,9 @@ vgetorpeek(advance)
? 0
: ((typebuf.tb_len == 0
|| !(p_timeout || (p_ttimeout
&& keylen == KL_PART_KEY)))
&& keylen == KEYLEN_PART_KEY)))
? -1L
: ((keylen == KL_PART_KEY && p_ttm >= 0)
: ((keylen == KEYLEN_PART_KEY && p_ttm >= 0)
? p_ttm
: p_tm)), typebuf.tb_change_cnt);
+1 -1
View File
@@ -4969,7 +4969,7 @@ display_errors()
if (STRLEN(p) > 2000)
STRCPY(p + 2000 - 14, "...(truncated)");
(void)do_dialog(VIM_ERROR, (char_u *)_("Error"),
p, (char_u *)_("&Ok"), 1, NULL);
p, (char_u *)_("&Ok"), 1, NULL, FALSE);
break;
}
ga_clear(&error_ga);
+2 -1
View File
@@ -2117,13 +2117,14 @@ dialog_wm_handler(w, client_data, event, dum)
}
int
gui_mch_dialog(type, title, message, buttons, dfltbutton, textfield)
gui_mch_dialog(type, title, message, buttons, dfltbutton, textfield, ex_cmd)
int type UNUSED;
char_u *title;
char_u *message;
char_u *buttons;
int dfltbutton UNUSED;
char_u *textfield;
int ex_cmd UNUSED;
{
char_u *buts;
char_u *p, *next;
+2 -1
View File
@@ -1268,7 +1268,8 @@ gui_mch_dialog(int type, /* type of dialog */
char_u *message, /* message text */
char_u *buttons, /* names of buttons */
int def_but, /* default button */
char_u *textfield) /* text for textfield or NULL */
char_u *textfield, /* text for textfield or NULL */
int ex_cmd UNUSED)
{
GtkWidget *dialog;
GtkWidget *entry = NULL;
+2 -1
View File
@@ -5583,7 +5583,8 @@ gui_mch_dialog(
char_u *message,
char_u *buttons,
int dfltbutton,
char_u *textfield)
char_u *textfield,
int ex_cmd)
{
Handle buttonDITL;
Handle iconDITL;
+2 -1
View File
@@ -2549,13 +2549,14 @@ create_pixmap_label(parent, name, data, args, arg)
#endif
int
gui_mch_dialog(type, title, message, button_names, dfltbutton, textfield)
gui_mch_dialog(type, title, message, button_names, dfltbutton, textfield, ex_cmd)
int type UNUSED;
char_u *title;
char_u *message;
char_u *button_names;
int dfltbutton;
char_u *textfield; /* buffer of size IOSIZE */
int ex_cmd UNUSED;
{
char_u *buts;
char_u *p, *next;
+2 -1
View File
@@ -1502,7 +1502,8 @@ gui_mch_dialog(
char_u *message,
char_u *buttons,
int default_button,
char_u *textfield)
char_u *textfield,
int ex_cmd)
{
char_u *str;
char_u **button_array;
+2 -1
View File
@@ -1098,7 +1098,8 @@ gui_mch_dialog(
char_u *message,
char_u *buttons,
int dfltbutton,
char_u *textfield)
char_u *textfield,
int ex_cmd)
{
FARPROC dp;
LPWORD p, pnumitems;
+2 -1
View File
@@ -3005,7 +3005,8 @@ gui_mch_dialog(
char_u *message,
char_u *buttons,
int dfltbutton,
char_u *textfield)
char_u *textfield,
int ex_cmd)
{
WORD *p, *pdlgtemplate, *pnumitems;
DWORD *dwp;
+2 -2
View File
@@ -688,7 +688,7 @@ do_choice(Widget w,
do_dialog(VIM_ERROR,
(char_u *)_("Error"),
(char_u *)_("Invalid font specification"),
(char_u *)_("&Dismiss"), 1, NULL);
(char_u *)_("&Dismiss"), 1, NULL, FALSE);
return True;
}
@@ -807,7 +807,7 @@ ok_callback(Widget w UNUSED,
do_dialog(VIM_ERROR,
(char_u *)_("Error"),
(char_u *)_("Invalid font specification"),
(char_u *)_("&Dismiss"), 1, NULL);
(char_u *)_("&Dismiss"), 1, NULL, FALSE);
XFreeFontNames(name);
}
else
+2 -2
View File
@@ -1346,7 +1346,7 @@ cs_help(eap)
" g: Find this definition\n"
" i: Find files #including this file\n"
" s: Find this C symbol\n"
" t: Find assignments to\n"));
" t: Find this text string\n"));
cmdp++;
}
@@ -1657,7 +1657,7 @@ cs_kill_execute(i, cname)
/*
* PRIVATE: cs_make_vim_style_matches
*
* convert the cscope output into into a ctags style entry (as might be found
* convert the cscope output into a ctags style entry (as might be found
* in a ctags tags file). there's one catch though: cscope doesn't tell you
* the type of the tag you are looking for. for example, in Darren Hiebert's
* ctags (the one that comes with vim), #define's use a line number to find the
+2 -3
View File
@@ -9,12 +9,11 @@
* See README.txt for an overview of the Vim source code.
*/
#include <stdio.h>
#include <string.h>
#include "vim.h"
#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>
#include "vim.h"
/* Only do the following when the feature is enabled. Needed for "make
* depend". */
+17 -19
View File
@@ -11,13 +11,13 @@
* See README.txt for an overview of the Vim source code.
*/
#include <stdio.h>
#include <string.h>
#ifdef HAVE_CONFIG_H
# include "auto/config.h"
#endif
#include <stdio.h>
#include <string.h>
#ifdef _WIN32
# if !defined(DYNAMIC_RUBY_VER) || (DYNAMIC_RUBY_VER < 18)
# define NT
@@ -94,6 +94,7 @@
# include <ruby/encoding.h>
#endif
#undef off_t /* ruby defines off_t as _int64, Mingw uses long */
#undef EXTERN
#undef _
@@ -233,10 +234,10 @@ static void ruby_vim_init(void);
# define rb_enc_find_index dll_rb_enc_find_index
# define rb_enc_find dll_rb_enc_find
# define rb_enc_str_new dll_rb_enc_str_new
# define rb_intern2 dll_rb_intern2
# define rb_const_remove dll_rb_const_remove
# define rb_sprintf dll_rb_sprintf
# define rb_require dll_rb_require
# define ruby_init_stack dll_ruby_init_stack
# define ruby_process_options dll_ruby_process_options
#endif
/*
@@ -323,11 +324,10 @@ static void (*dll_ruby_script) (const char*);
static int (*dll_rb_enc_find_index) (const char*);
static rb_encoding* (*dll_rb_enc_find) (const char*);
static VALUE (*dll_rb_enc_str_new) (const char*, long, rb_encoding*);
static ID (*dll_rb_intern2) (const char*, long);
static void (*dll_Init_prelude) (void);
static VALUE (*dll_rb_const_remove) (VALUE, ID);
static VALUE (*dll_rb_sprintf) (const char*, ...);
static VALUE (*dll_rb_require) (const char*);
static void (*ruby_init_stack)(VALUE*);
static void* (*ruby_process_options)(int, char**);
#endif
#ifdef RUBY19_OR_LATER
@@ -434,10 +434,10 @@ static struct
{"rb_enc_find_index", (RUBY_PROC*)&dll_rb_enc_find_index},
{"rb_enc_find", (RUBY_PROC*)&dll_rb_enc_find},
{"rb_enc_str_new", (RUBY_PROC*)&dll_rb_enc_str_new},
{"rb_intern2", (RUBY_PROC*)&dll_rb_intern2},
{"rb_const_remove", (RUBY_PROC*)&dll_rb_const_remove},
{"rb_sprintf", (RUBY_PROC*)&dll_rb_sprintf},
{"rb_require", (RUBY_PROC*)&dll_rb_require},
{"ruby_init_stack", (RUBY_PROC*)&dll_ruby_init_stack},
{"ruby_process_options", (RUBY_PROC*)&dll_ruby_process_options},
#endif
{"", NULL},
};
@@ -667,18 +667,16 @@ static int ensure_ruby_initialized(void)
ruby_init();
}
#ifdef RUBY19_OR_LATER
{
int dummy_argc = 2;
char *dummy_argv[] = {"vim-ruby", "-e0"};
ruby_process_options(dummy_argc, dummy_argv);
}
ruby_script("vim-ruby");
#endif
#else
ruby_init_loadpath();
ruby_io_init();
#ifdef RUBY19_OR_LATER
rb_enc_find_index("encdb");
/* This avoids the error "Encoding::ConverterNotFoundError: code
* converter not found (UTF-16LE to ASCII-8BIT)". */
rb_define_module("Gem");
rb_const_remove(rb_cObject, rb_intern2("TMP_RUBY_PREFIX", 15));
#endif
ruby_io_init();
ruby_vim_init();
ruby_initialized = 1;
#ifdef DYNAMIC_RUBY
+12 -6
View File
@@ -23,7 +23,7 @@
# include <limits.h>
#endif
#if FEAT_GUI_MACVIM
#ifdef FEAT_GUI_MACVIM
#include <objc/objc-runtime.h> /* for objc_*() and sel_*() */
#endif
@@ -173,7 +173,7 @@ main
int i;
#endif
#if FEAT_GUI_MACVIM
#ifdef FEAT_GUI_MACVIM
// Cocoa needs an NSAutoreleasePool in place or it will leak memory.
// This particular pool will hold autorelease objects created during
// initialization.
@@ -1001,7 +1001,7 @@ main
TIME_MSG("before starting main loop");
#if FEAT_GUI_MACVIM
#ifdef FEAT_GUI_MACVIM
// The autorelease pool might have filled up quite a bit during
// initialization, so purge it before entering the main loop.
objc_msgSend(autoreleasePool, sel_getUid("release"));
@@ -1024,7 +1024,7 @@ main
mzscheme_main();
#endif
#if FEAT_GUI_MACVIM
#ifdef FEAT_GUI_MACVIM
objc_msgSend(autoreleasePool, sel_getUid("release"));
#endif
@@ -1091,7 +1091,7 @@ main_loop(cmdwin, noexmode)
#endif
)
{
#if FEAT_GUI_MACVIM
#ifdef FEAT_GUI_MACVIM
// Cocoa needs an NSAutoreleasePool in place or it will leak memory.
// This particular pool gets released once every loop.
id autoreleasePool = objc_msgSend(objc_msgSend(
@@ -1328,7 +1328,7 @@ main_loop(cmdwin, noexmode)
else
normal_cmd(&oa, TRUE);
#if FEAT_GUI_MACVIM
#ifdef FEAT_GUI_MACVIM
// TODO! Make sure there are no continue statements that will cause
// this not to be called or MacVim will leak memory!
objc_msgSend(autoreleasePool, sel_getUid("release"));
@@ -1915,6 +1915,12 @@ command_line_scan(parmp)
{
/* already processed, skip */
}
#endif
#ifdef FEAT_GUI_MACVIM
else if (STRNICMP(argv[0] + argv_idx, "nomru", 5) == 0)
{
/* processed in gui_macvim.m, skip */
}
#endif
else
{
+1 -1
View File
@@ -4516,7 +4516,7 @@ findswapname(buf, dirp, old_fname)
process_still_running
? (char_u *)_("&Open Read-Only\n&Edit anyway\n&Recover\n&Quit\n&Abort") :
# endif
(char_u *)_("&Open Read-Only\n&Edit anyway\n&Recover\n&Delete it\n&Quit\n&Abort"), 1, NULL);
(char_u *)_("&Open Read-Only\n&Edit anyway\n&Recover\n&Delete it\n&Quit\n&Abort"), 1, NULL, FALSE);
# if defined(UNIX) || defined(__EMX__) || defined(VMS)
if (process_still_running && choice >= 4)
+3 -3
View File
@@ -1518,8 +1518,8 @@ menu_name_equal(name, menu)
{
#ifdef FEAT_MULTI_LANG
if (menu->en_name != NULL
&& (menu_namecmp(name,menu->en_name)
|| menu_namecmp(name,menu->en_dname)))
&& (menu_namecmp(name, menu->en_name)
|| menu_namecmp(name, menu->en_dname)))
return TRUE;
#endif
return menu_namecmp(name, menu->name) || menu_namecmp(name, menu->dname);
@@ -2366,7 +2366,7 @@ gui_find_menu(path_name)
while (menu != NULL)
{
if (STRCMP(name, menu->name) == 0 || STRCMP(name, menu->dname) == 0)
if (menu_name_equal(name, menu))
{
if (menu->children == NULL)
{
+18 -9
View File
@@ -569,6 +569,10 @@ emsg(s)
int severe;
#endif
/* Skip this if not giving error messages at the moment. */
if (emsg_not_now())
return TRUE;
called_emsg = TRUE;
ex_exitval = 1;
@@ -581,10 +585,6 @@ emsg(s)
emsg_severe = FALSE;
#endif
/* Skip this if not giving error messages at the moment. */
if (emsg_not_now())
return TRUE;
if (!emsg_off || vim_strchr(p_debug, 't') != NULL)
{
#ifdef FEAT_EVAL
@@ -3319,7 +3319,7 @@ msg_advance(col)
* different letter.
*/
int
do_dialog(type, title, message, buttons, dfltbutton, textfield)
do_dialog(type, title, message, buttons, dfltbutton, textfield, ex_cmd)
int type UNUSED;
char_u *title UNUSED;
char_u *message;
@@ -3327,6 +3327,8 @@ do_dialog(type, title, message, buttons, dfltbutton, textfield)
int dfltbutton;
char_u *textfield UNUSED; /* IObuff for inputdialog(), NULL
otherwise */
int ex_cmd; /* when TRUE pressing : accepts default and starts
Ex command */
{
int oldState;
int retval = 0;
@@ -3345,7 +3347,7 @@ do_dialog(type, title, message, buttons, dfltbutton, textfield)
if (gui.in_use && vim_strchr(p_go, GO_CONDIALOG) == NULL)
{
c = gui_mch_dialog(type, title, message, buttons, dfltbutton,
textfield);
textfield, ex_cmd);
/* avoid a hit-enter prompt without clearing the cmdline */
need_wait_return = FALSE;
emsg_on_display = FALSE;
@@ -3392,6 +3394,13 @@ do_dialog(type, title, message, buttons, dfltbutton, textfield)
default: /* Could be a hotkey? */
if (c < 0) /* special keys are ignored here */
continue;
if (c == ':' && ex_cmd)
{
retval = dfltbutton;
ins_char_typebuf(':');
break;
}
/* Make the character lowercase, as chars in "hotkeys" are. */
c = MB_TOLOWER(c);
retval = 1;
@@ -3665,7 +3674,7 @@ vim_dialog_yesno(type, title, message, dflt)
if (do_dialog(type,
title == NULL ? (char_u *)_("Question") : title,
message,
(char_u *)_("&Yes\n&No"), dflt, NULL) == 1)
(char_u *)_("&Yes\n&No"), dflt, NULL, FALSE) == 1)
return VIM_YES;
return VIM_NO;
}
@@ -3680,7 +3689,7 @@ vim_dialog_yesnocancel(type, title, message, dflt)
switch (do_dialog(type,
title == NULL ? (char_u *)_("Question") : title,
message,
(char_u *)_("&Yes\n&No\n&Cancel"), dflt, NULL))
(char_u *)_("&Yes\n&No\n&Cancel"), dflt, NULL, FALSE))
{
case 1: return VIM_YES;
case 2: return VIM_NO;
@@ -3699,7 +3708,7 @@ vim_dialog_yesnoallcancel(type, title, message, dflt)
title == NULL ? (char_u *)"Question" : title,
message,
(char_u *)_("&Yes\n&No\nSave &All\n&Discard All\n&Cancel"),
dflt, NULL))
dflt, NULL, FALSE))
{
case 1: return VIM_YES;
case 2: return VIM_NO;
+5 -4
View File
@@ -2919,7 +2919,7 @@ unchanged(buf, ff)
buf_T *buf;
int ff; /* also reset 'fileformat' */
{
if (buf->b_changed || (ff && file_ff_differs(buf)))
if (buf->b_changed || (ff && file_ff_differs(buf, FALSE)))
{
buf->b_changed = 0;
ml_setflags(buf);
@@ -3114,10 +3114,11 @@ get_keystroke()
&& (!p_ttimeout || waited * 100L < (p_ttm < 0 ? p_tm : p_ttm)))
continue;
/* found a termcode: adjust length */
if (n > 0)
if (n == KEYLEN_REMOVED) /* key code removed */
continue;
if (n > 0) /* found a termcode: adjust length */
len = n;
if (len == 0) /* nothing typed yet */
if (len == 0) /* nothing typed yet */
continue;
/* Handle modifier and/or special key code. */
+4 -2
View File
@@ -2882,9 +2882,11 @@ do_check_cursorbind()
if (has_mbyte)
mb_adjust_cursor();
# endif
redraw_later(VALID);
update_topline();
/* Only scroll when 'scrollbind' hasn't done this. */
if (!curwin->w_p_scb)
update_topline();
# ifdef FEAT_WINDOWS
curwin->w_redr_status = TRUE;
# endif
+9 -9
View File
@@ -343,6 +343,7 @@ netbeans_connect(char *params, int doabort)
{
nbdebug(("error in gethostbyname() in netbeans_connect()\n"));
PERROR("gethostbyname() in netbeans_connect()");
sock_close(sd);
goto theend;
}
memcpy((char *)&server.sin_addr, host->h_addr, host->h_length);
@@ -392,15 +393,12 @@ netbeans_connect(char *params, int doabort)
|| (errno == EINTR)))
{
nbdebug(("retrying...\n"));
sleep(5);
if (!doabort)
mch_delay(3000L, TRUE);
ui_breakcheck();
if (got_int)
{
ui_breakcheck();
if (got_int)
{
errno = EINTR;
break;
}
errno = EINTR;
break;
}
if (connect(sd, (struct sockaddr *)&server,
sizeof(server)) == 0)
@@ -415,6 +413,7 @@ netbeans_connect(char *params, int doabort)
/* Get here when the server can't be found. */
nbdebug(("Cannot connect to Netbeans #2\n"));
PERROR(_("Cannot connect to Netbeans #2"));
sock_close(sd);
if (doabort)
getout(1);
goto theend;
@@ -425,6 +424,7 @@ netbeans_connect(char *params, int doabort)
{
nbdebug(("Cannot connect to Netbeans\n"));
PERROR(_("Cannot connect to Netbeans"));
sock_close(sd);
if (doabort)
getout(1);
goto theend;
@@ -829,7 +829,7 @@ netbeans_read()
* -> gui event loop or select loop
* -> netbeans_read()
*/
save((char_u *)DETACH_MSG, strlen(DETACH_MSG));
save((char_u *)DETACH_MSG, (int)strlen(DETACH_MSG));
nb_close_socket();
if (len < 0)
+7 -4
View File
@@ -7759,7 +7759,7 @@ set_bool_option(opt_idx, varp, value, opt_flags)
#ifdef FEAT_FULLSCREEN
/* when 'fullscreen' changes, forward it to the gui */
else if ((int *)varp == &p_fullscreen && gui.in_use)
else if ((int *)varp == &p_fullscreen && (gui.in_use || gui.starting))
{
if (p_fullscreen && !old_value)
{
@@ -11438,16 +11438,19 @@ save_file_ff(buf)
* from when editing started (save_file_ff() called).
* Also when 'endofline' was changed and 'binary' is set, or when 'bomb' was
* changed and 'binary' is not set.
* Don't consider a new, empty buffer to be changed.
* When "ignore_empty" is true don't consider a new, empty buffer to be
* changed.
*/
int
file_ff_differs(buf)
file_ff_differs(buf, ignore_empty)
buf_T *buf;
int ignore_empty;
{
/* In a buffer that was never loaded the options are not valid. */
if (buf->b_flags & BF_NEVERLOADED)
return FALSE;
if ((buf->b_flags & BF_NEW)
if (ignore_empty
&& (buf->b_flags & BF_NEW)
&& buf->b_ml.ml_line_count == 1
&& *ml_get_buf(buf, (linenr_T)1, FALSE) == NUL)
return FALSE;
+1 -1
View File
@@ -593,7 +593,7 @@ display_errors()
gui.starting ? (char_u *)_("Message") :
#endif
(char_u *)_("Error"),
p, (char_u *)_("&Ok"), 1, NULL);
p, (char_u *)_("&Ok"), 1, NULL, FALSE);
break;
}
ga_clear(&error_ga);
+1 -1
View File
@@ -27,5 +27,5 @@ void gui_mch_destroy_scrollbar __ARGS((scrollbar_T *sb));
void gui_mch_set_scrollbar_colors __ARGS((scrollbar_T *sb));
Window gui_x11_get_wid __ARGS((void));
char_u *gui_mch_browse __ARGS((int saving, char_u *title, char_u *dflt, char_u *ext, char_u *initdir, char_u *filter));
int gui_mch_dialog __ARGS((int type, char_u *title, char_u *message, char_u *buttons, int dfltbutton, char_u *textfield));
int gui_mch_dialog __ARGS((int type, char_u *title, char_u *message, char_u *buttons, int dfltbutton, char_u *textfield, int ex_cmd));
/* vim: set ft=c : */
+1 -1
View File
@@ -13,7 +13,7 @@ void gui_mch_create_scrollbar __ARGS((scrollbar_T *sb, int orient));
void gui_mch_destroy_scrollbar __ARGS((scrollbar_T *sb));
char_u *gui_mch_browse __ARGS((int saving, char_u *title, char_u *dflt, char_u *ext, char_u *initdir, char_u *filter));
char_u *gui_mch_browsedir __ARGS((char_u *title, char_u *initdir));
int gui_mch_dialog __ARGS((int type, char_u *title, char_u *message, char_u *buttons, int def_but, char_u *textfield));
int gui_mch_dialog __ARGS((int type, char_u *title, char_u *message, char_u *buttons, int def_but, char_u *textfield, int ex_cmd));
void gui_mch_show_popupmenu __ARGS((vimmenu_T *menu));
void gui_make_popup __ARGS((char_u *path_name, int mouse_pos));
void gui_mch_find_dialog __ARGS((exarg_T *eap));
+1 -1
View File
@@ -81,7 +81,7 @@ int gui_mch_get_mouse_x __ARGS((void));
int gui_mch_get_mouse_y __ARGS((void));
void gui_mch_setmouse __ARGS((int x, int y));
void gui_mch_show_popupmenu __ARGS((vimmenu_T *menu));
int gui_mch_dialog __ARGS((int type, char_u *title, char_u *message, char_u *buttons, int dfltbutton, char_u *textfield));
int gui_mch_dialog __ARGS((int type, char_u *title, char_u *message, char_u *buttons, int dfltbutton, char_u *textfield, int ex_cmd));
char_u *gui_mch_browse __ARGS((int saving, char_u *title, char_u *dflt, char_u *ext, char_u *initdir, char_u *filter));
void gui_mch_set_foreground __ARGS((void));
void gui_mch_show_tabline __ARGS((int showit));
+2 -2
View File
@@ -105,7 +105,8 @@ gui_mch_dialog(
char_u *message,
char_u *buttons,
int dfltbutton,
char_u *textfield);
char_u *textfield,
int ex_cmd);
void
gui_mch_draw_hollow_cursor(guicolor_T color);
void
@@ -233,4 +234,3 @@ gui_mch_register_sign(char_u *signfile);
void
gui_mch_destroy_sign(void *sign);
+1 -1
View File
@@ -29,7 +29,7 @@ void gui_mch_destroy_scrollbar __ARGS((scrollbar_T *sb));
void gui_mch_set_scrollbar_colors __ARGS((scrollbar_T *sb));
Window gui_x11_get_wid __ARGS((void));
char_u *gui_mch_browse __ARGS((int saving, char_u *title, char_u *dflt, char_u *ext, char_u *initdir, char_u *filter));
int gui_mch_dialog __ARGS((int type, char_u *title, char_u *message, char_u *button_names, int dfltbutton, char_u *textfield));
int gui_mch_dialog __ARGS((int type, char_u *title, char_u *message, char_u *button_names, int dfltbutton, char_u *textfield, int ex_cmd));
void gui_mch_enable_footer __ARGS((int showit));
void gui_mch_set_footer __ARGS((char_u *s));
void gui_mch_show_toolbar __ARGS((int showit));
+1 -1
View File
@@ -8,7 +8,7 @@ void gui_mch_exit __ARGS((int rc));
void gui_mch_update __ARGS((void));
int gui_mch_wait_for_chars __ARGS((int wtime));
char_u *gui_mch_browse __ARGS((int saving, char_u *title, char_u *default_name, char_u *ext, char_u *initdir, char_u *filter));
int gui_mch_dialog __ARGS((int type, char_u *title, char_u *message, char_u *buttons, int default_button, char_u *textfield));
int gui_mch_dialog __ARGS((int type, char_u *title, char_u *message, char_u *buttons, int default_button, char_u *textfield, int ex_cmd));
int gui_mch_get_winpos __ARGS((int *x, int *y));
void gui_mch_set_winpos __ARGS((int x, int y));
void gui_mch_set_shellsize __ARGS((int width, int height, int min_width, int min_height, int base_width, int base_height, int direction));
+1 -1
View File
@@ -74,6 +74,6 @@ void gui_make_popup __ARGS((char_u *path_name, int mouse_pos));
void gui_mch_add_menu_item __ARGS((vimmenu_T *menu, int idx));
void gui_mch_destroy_menu __ARGS((vimmenu_T *menu));
void gui_mch_menu_grey __ARGS((vimmenu_T *menu, int grey));
int gui_mch_dialog __ARGS((int type, char_u *title, char_u *message, char_u *buttons, int dfltbutton, char_u *textfield));
int gui_mch_dialog __ARGS((int type, char_u *title, char_u *message, char_u *buttons, int dfltbutton, char_u *textfield, int ex_cmd));
void gui_mch_set_foreground __ARGS((void));
/* vim: set ft=c : */
+1 -1
View File
@@ -81,7 +81,7 @@ void gui_make_tearoff __ARGS((char_u *path_name));
void gui_mch_add_menu_item __ARGS((vimmenu_T *menu, int idx));
void gui_mch_destroy_menu __ARGS((vimmenu_T *menu));
void gui_mch_menu_grey __ARGS((vimmenu_T *menu, int grey));
int gui_mch_dialog __ARGS((int type, char_u *title, char_u *message, char_u *buttons, int dfltbutton, char_u *textfield));
int gui_mch_dialog __ARGS((int type, char_u *title, char_u *message, char_u *buttons, int dfltbutton, char_u *textfield, int ex_cmd));
void gui_mch_set_foreground __ARGS((void));
void gui_mch_drawsign __ARGS((int row, int col, int typenr));
void *gui_mch_register_sign __ARGS((char_u *signfile));
+1 -1
View File
@@ -64,7 +64,7 @@ void verbose_stop __ARGS((void));
int verbose_open __ARGS((void));
void give_warning __ARGS((char_u *message, int hl));
void msg_advance __ARGS((int col));
int do_dialog __ARGS((int type, char_u *title, char_u *message, char_u *buttons, int dfltbutton, char_u *textfield));
int do_dialog __ARGS((int type, char_u *title, char_u *message, char_u *buttons, int dfltbutton, char_u *textfield, int ex_cmd));
void display_confirm_msg __ARGS((void));
int vim_dialog_yesno __ARGS((int type, char_u *title, char_u *message, int dflt));
int vim_dialog_yesnocancel __ARGS((int type, char_u *title, char_u *message, int dflt));
+1 -1
View File
@@ -54,6 +54,6 @@ void change_compatible __ARGS((int on));
int option_was_set __ARGS((char_u *name));
int can_bs __ARGS((int what));
void save_file_ff __ARGS((buf_T *buf));
int file_ff_differs __ARGS((buf_T *buf));
int file_ff_differs __ARGS((buf_T *buf, int ignore_empty));
int check_ff_value __ARGS((char_u *p));
/* vim: set ft=c : */
+2 -3
View File
@@ -2317,7 +2317,7 @@ fold_line(wp, fold_count, foldinfo, lnum, row)
num = (long)lnum;
else
/* 'relativenumber', don't use negative numbers */
num = (long)abs((int)get_cursor_rel_lnum(wp, lnum));
num = labs((long)get_cursor_rel_lnum(wp, lnum));
sprintf((char *)buf, "%*ld ", w, num);
#ifdef FEAT_RIGHTLEFT
@@ -3475,8 +3475,7 @@ win_line(wp, lnum, startrow, endrow, nochange)
num = (long)lnum;
else
/* 'relativenumber', don't use negative numbers */
num = (long)abs((int)get_cursor_rel_lnum(wp,
lnum));
num = labs((long)get_cursor_rel_lnum(wp, lnum));
sprintf((char *)extra, "%*ld ",
number_width(wp), num);
+7
View File
@@ -4537,6 +4537,13 @@ get_syn_options(arg, opt, conceal_char)
;
#endif
}
#ifdef FEAT_CONCEAL
if (!vim_isprintc_strict(*conceal_char))
{
EMSG(_("E844: invalid cchar value"));
return NULL;
}
#endif
arg = skipwhite(arg + 7);
}
else
+17 -5
View File
@@ -3053,10 +3053,13 @@ shell_resized_check()
int old_Rows = Rows;
int old_Columns = Columns;
(void)ui_get_shellsize();
check_shellsize();
if (old_Rows != Rows || old_Columns != Columns)
shell_resized();
if (!exiting)
{
(void)ui_get_shellsize();
check_shellsize();
if (old_Rows != Rows || old_Columns != Columns)
shell_resized();
}
}
/*
@@ -3828,6 +3831,7 @@ set_mouse_topline(wp)
* Check from typebuf.tb_buf[typebuf.tb_off] to typebuf.tb_buf[typebuf.tb_off
* + max_offset].
* Return 0 for no match, -1 for partial match, > 0 for full match.
* Return KEYLEN_REMOVED when a key code was deleted.
* With a match, the match is removed, the replacement code is inserted in
* typebuf.tb_buf[] and the number of characters in typebuf.tb_buf[] is
* returned.
@@ -3845,6 +3849,7 @@ check_termcode(max_offset, buf, buflen)
int slen = 0; /* init for GCC */
int modslen;
int len;
int retval = 0;
int offset;
char_u key_name[2];
int modifiers;
@@ -4940,6 +4945,13 @@ check_termcode(max_offset, buf, buflen)
#endif
string[new_slen++] = key_name[1];
}
else if (new_slen == 0 && key_name[0] == KS_EXTRA
&& key_name[1] == KE_IGNORE)
{
/* Do not put K_IGNORE into the buffer, do return KEYLEN_REMOVED
* to indicate what happened. */
retval = KEYLEN_REMOVED;
}
else
{
string[new_slen++] = K_SPECIAL;
@@ -4976,7 +4988,7 @@ check_termcode(max_offset, buf, buflen)
(size_t)(buflen - offset));
mch_memmove(buf + offset, string, (size_t)new_slen);
}
return (len + extra + offset);
return retval == 0 ? (len + extra + offset) : retval;
}
return 0; /* no match found */
+3 -3
View File
@@ -2884,7 +2884,7 @@ u_add_time(buf, buflen, tt)
(void)strftime((char *)buf, buflen, "%m/%d %H:%M:%S", curtime);
else
/* long ago */
(void)strftime((char *)buf, buflen, "%y/%m/%d %H:%M:%S", curtime);
(void)strftime((char *)buf, buflen, "%Y/%m/%d %H:%M:%S", curtime);
}
else
#endif
@@ -3304,7 +3304,7 @@ bufIsChanged(buf)
#ifdef FEAT_QUICKFIX
!bt_dontwrite(buf) &&
#endif
(buf->b_changed || file_ff_differs(buf));
(buf->b_changed || file_ff_differs(buf, TRUE));
}
int
@@ -3314,7 +3314,7 @@ curbufIsChanged()
#ifdef FEAT_QUICKFIX
!bt_dontwrite(curbuf) &&
#endif
(curbuf->b_changed || file_ff_differs(curbuf));
(curbuf->b_changed || file_ff_differs(curbuf, TRUE));
}
#if defined(FEAT_EVAL) || defined(PROTO)
+40
View File
@@ -729,6 +729,46 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
107,
/**/
106,
/**/
105,
/**/
104,
/**/
103,
/**/
102,
/**/
101,
/**/
100,
/**/
99,
/**/
98,
/**/
97,
/**/
96,
/**/
95,
/**/
94,
/**/
93,
/**/
92,
/**/
91,
/**/
90,
/**/
89,
/**/
88,
/**/
87,
/**/
+4
View File
@@ -2214,4 +2214,8 @@ typedef int VimClipboard; /* This is required for the prototypes. */
#define MSCR_LEFT -1
#define MSCR_RIGHT -2
#define KEYLEN_PART_KEY -1 /* keylen value for incomplete key-code */
#define KEYLEN_PART_MAP -2 /* keylen value for incomplete mapping */
#define KEYLEN_REMOVED 9999 /* keylen value for removed sequence */
#endif /* VIM__H */
+2 -1
View File
@@ -986,7 +986,8 @@ win_split_ins(size, flags, newwin, dir)
/* Set w_fraction now so that the cursor keeps the same relative
* vertical position. */
set_fraction(oldwin);
if (oldwin->w_height > 0)
set_fraction(oldwin);
wp->w_fraction = oldwin->w_fraction;
#ifdef FEAT_VERTSPLIT