Compare commits

...

88 Commits

Author SHA1 Message Date
Bjorn Winckler af13572c16 Snapshot 61 2011-07-27 20:01:59 +02:00
Bjorn Winckler 62511ccb37 Merge branch 'lion' 2011-07-27 19:33:33 +02:00
Bjorn Winckler 9007fe7ea4 Rename MMFullscreenWindow -> MMFullScreenWindow 2011-07-27 18:58:26 +02:00
Bjorn Winckler 1435c84507 Use "full-screen" and [Ff]ullScreen consistently 2011-07-27 18:55:20 +02:00
Bjorn Winckler 8d255ed95a Avoid window animation on custom full-screen exit
This only applies when running Mac OS X 10.7+.
2011-07-27 18:31:25 +02:00
Bjorn Winckler 84bd7acdcb Final fix for open new window in full-screen
The original fix for opening a new window while in full-screen was
flawed.  This commit takes a new approach and corrects problems related
to opening a new window while MacVim was in full-screen as well as
problems with using "mvim" from a full-screen Terminal window.
2011-07-27 18:18:29 +02:00
Bjorn Winckler 871d6fb68d Fix window restore on enter full-screen failure 2011-07-27 16:59:02 +02:00
Bjorn Winckler 8b7a78a4ca Addendum to fix for open window in full-screen
Don't switch window to full-screen after presenting it if for some
reason the application is no longer in full-screen.  Seems to happen
sometimes when starting MacVim from a full-screen Terminal window.
2011-07-27 13:59:58 +02:00
Bjorn Winckler 98346d00d1 Add user default for native/custom full screen
The boolean user default MMNativeFullScreen can be used to control
whether to use native or custom full-screen.  Set to 0 for custom, set
to 1 for native full-screen, for example

    $ defaults write org.vim.MacVim MMNativeFullScreen 0

The default is to use native full-screen when available.  This user
default does nothing on pre-Lion Mac OS X.

Also conditionally call Lion APIs so that it is possible to compile with
10.7 SDK but still support 10.6 (nb. 10.5 and earlier SDKs are not
supported as of Xcode 4).  (Suggestion and initial patch by @splhack.)
2011-07-27 13:42:46 +02:00
Bjorn Winckler 7f8ed177e5 Handle screen parameter changes in full screen 2011-07-26 19:56:12 +02:00
Bjorn Winckler d01ee9a02b Use correct presentation option API 2011-07-26 19:53:54 +02:00
Bjorn Winckler 4fbdea5683 Fix for opening new window while in full screen 2011-07-26 16:42:44 +02:00
Bjorn Winckler bcfd3686d3 Maximize both directions in full screen by default
The default for 'fuopt' is now "maxhorz,maxvert".  Update help to
reflect this and add note that the background option of 'fuopt' is not
supported when using Mac OS X native full screen mode.
2011-07-26 14:51:50 +02:00
Bjorn Winckler 705cce16cb Support "set fu" in gvimrc for Lion full screen 2011-07-26 14:43:34 +02:00
Bjorn Winckler ec80934916 Map delete key to delete visual selection
Also update the help.  The delete key used to be hard coded in the
source but now it is mapped in MacVim's gvimrc file instead.
2011-07-26 13:10:15 +02:00
Bjorn Winckler 9dabefa342 Change toolbar style in full screen 2011-07-25 23:21:44 +02:00
Bjorn Winckler 19d9e88653 Fix visibility of toolbar in full screen
The toolbar will pop up when the mouse is moved to the top of the screen
in full screen mode if and only if it is visible outside of full screen
mode.

Bug: if the toolbar is toggled in full screen mode then sometimes it is
no longer possible to enable it after exiting full screen.
2011-07-25 23:05:07 +02:00
Bjorn Winckler f295c0db32 Keep full screen window centered, change animation
Keep the window centered in full screen when it changes size.  At the
moment the Lion full screen background is shown around the window,
meaning that the "background" option of 'fuopt' is ignored.

The animation when entering full screen is now a fade out of the
decorated window, followed by a fade in of the full screen window.  Any
attempts at making an animation of the window frame failed because of
the way content is drawn (by pushing drawing updates).  For this reason
I settled on a fade animation which is not exactly pretty, but at least
it is as objectionable as the default animation.

A side effect of implementing a custom animation is that the correct
window now gets focus when closing a full screen window.
2011-07-25 22:59:50 +02:00
Bjorn Winckler b8e2540fef Set proper animation behavior for window
This causes a window to animate when it opens just like windows in other
Lion apps do.
2011-07-24 21:35:29 +02:00
Bjorn Winckler 6f05829f7e Switch spaces when closing window in full screen
A remaining problem is that if there is another window open then it does
not get focus when the full screen window closes.
2011-07-24 21:33:47 +02:00
Bjorn Winckler 9e6a7b76b5 Clicking full screen button updates 'fu' option
This fixes a bug where the 'fu' option would not be updated when clicking
the full screen button in the top right corner of a window.
2011-07-24 18:40:16 +02:00
Bjorn Winckler aa86531f82 Snapshot 60 2011-07-22 20:17:04 +02:00
Bjorn Winckler e0f133cb14 Merge branch 'vim' 2011-07-22 19:51:20 +02:00
Bjorn Winckler 56390fac62 Fix for zsh causing freezes on Lion
Make sure tty is opened using the same flags as when opening the pty.
In particular, the O_NOCTTY was missing from the tty open call.  This
caused waitpid() to always return 0 and Vim would get stuck in an
endless loop waiting for the child to exit.
2011-07-22 19:46:58 +02:00
Bjorn Winckler c35d6d1d3c Addendum to emergency fix
Ensure vim_message() outputs an empty message when the Ruby string has
length 0.  Failing to do this will cause the message area not to clear
when it should.
2011-07-22 19:46:49 +02:00
Bjorn Winckler 27086e3b64 Emergency fix for Ruby problems
With optimizations enabled "alloca(len)" generates code which depends on
"len > 0".  If "len == 0" then the stack pointer becomes botched.  This
fix simply avoids a call to "alloca(len)" in the latter case.  The root
of this problem may be deeper than this, hence I am calling this an
"emergency fix" for now but at least it fixes the crashes in the Ruby
interface that appear when compiling on Mac OS X 10.7.
2011-07-22 19:46:36 +02:00
Bjorn Winckler df741b5f4e Fix for zsh causing freezes on Lion
Make sure tty is opened using the same flags as when opening the pty.
In particular, the O_NOCTTY was missing from the tty open call.  This
caused waitpid() to always return 0 and Vim would get stuck in an
endless loop waiting for the child to exit.
2011-07-22 19:26:13 +02:00
Bjorn Winckler 79ba4bcdc0 Addendum to emergency fix
Ensure vim_message() outputs an empty message when the Ruby string has
length 0.  Failing to do this will cause the message area not to clear
when it should.
2011-07-21 22:14:24 +02:00
Bjorn Winckler 6bd19ecf62 Emergency fix for Ruby problems
With optimizations enabled "alloca(len)" generates code which depends on
"len > 0".  If "len == 0" then the stack pointer becomes botched.  This
fix simply avoids a call to "alloca(len)" in the latter case.  The root
of this problem may be deeper than this, hence I am calling this an
"emergency fix" for now but at least it fixes the crashes in the Ruby
interface that appear when compiling on Mac OS X 10.7.
2011-07-21 21:57:33 +02:00
Bjorn Winckler df0c4d770c Fix compilation warnings in PSMTabBarControl
This also disables icon drawing code in tabs.  The reason being that the
code is unused, caused warnings and looked generally dangerous.
2011-07-21 15:00:59 +02:00
Bjorn Winckler 672bf1f0fc Fix open/save panel related compilation warnings 2011-07-21 14:36:23 +02:00
Bjorn Winckler 1c1b721b93 Update .gitignore 2011-07-21 12:34:40 +02:00
Bjorn Winckler 37741a0cb5 Use correct availability macros 2011-07-21 12:28:23 +02:00
Bram Moolenaar e967a23863 Added tag v7-3-260 for changeset cb4682b95909 2011-07-20 18:29:39 +02:00
Bram Moolenaar 851cd145ab updated for version 7.3.260
Problem:    CursorHold triggers on an incomplete mapping. (Will Gray)
Solution:   Don't trigger CursorHold when there is typeahead.
2011-07-20 18:29:39 +02:00
Bram Moolenaar 12011cfc3e Added tag v7-3-259 for changeset 59130cd78dfc 2011-07-20 17:58:20 +02:00
Bram Moolenaar 073aa81247 updated for version 7.3.259
Problem:    Equivalence classes only work for latin characters.
Solution:   Add the Unicode equivalence characters. (Dominique Pelle)
2011-07-20 17:58:20 +02:00
Bram Moolenaar 3f7b3209d8 Added tag v7-3-258 for changeset bdc3335bd72e 2011-07-20 17:27:25 +02:00
Bram Moolenaar d293bc15ca updated for version 7.3.258
Problem:    MS-Windows: The edit with existing vim context menu entries can be
	    unwanted.
Solution:   Let a registry entry disable them. (Jerome Vuarand)
2011-07-20 17:27:25 +02:00
Bram Moolenaar 136af5316e Added tag v7-3-257 for changeset 1fad9c73d77a 2011-07-20 16:37:24 +02:00
Bram Moolenaar e01174b1f3 updated for version 7.3.257
Problem:    Not all completions are available to user commands.
Solution:   Add "color", "compiler", "file_in_path" and "locale". (Dominique
	    Pelle)
2011-07-20 16:37:24 +02:00
Bram Moolenaar 103ac57ae2 Added tag v7-3-256 for changeset c296c225736e 2011-07-20 15:09:44 +02:00
Bram Moolenaar ac79fd3bee updated for version 7.3.256
Problem:    Javascript indenting not sufficiently tested.
Solution:   Add more tests. (Luc Deschenaux)  Mark the lines that are indented
	    wrong.
2011-07-20 15:09:43 +02:00
Bram Moolenaar fc6320cf98 Added tag v7-3-255 for changeset aa998de9f959 2011-07-20 15:04:59 +02:00
Bram Moolenaar 31ed9f1341 updated for version 7.3.255
Problem:    When editing a file such as "File[2010-08-15].vim" an E16 error is
	    given. (Manuel Stol)
Solution:   Don't give an error for failing to compile the regexp.
2011-07-20 15:04:58 +02:00
Bjorn Winckler 88b7b921be Use GCC instead of platform default
This is necessary since the Vim executable is built using GCC.  Using
LLVM for the frontend and GCC for the backend caused runtime errors in
distributed object calls.
2011-07-20 15:04:43 +02:00
Bjorn Winckler 35c355a085 Disable automatic relaunching on OS X 10.7 2011-07-20 15:04:43 +02:00
Bjorn Winckler 47e83bcd2e Use native Lion full screen functionality
On Lion use the full screen functionality built into the OS.  Also
change the shortcut to toggle full screen to Cmd-Ctrl-f.
2011-07-20 15:04:42 +02:00
Bram Moolenaar 1e4ca096eb Updated runtime files.
Add missing test82 files.
2011-07-18 19:40:27 +02:00
Bjorn Winckler 301fd4c3ac Merge branch 'vim'
Conflicts:
	src/auto/configure
2011-07-17 21:12:55 +02:00
Bjorn Winckler b5fae0ff3f Fix compiler warning 2011-07-16 15:48:33 +02:00
Bjorn Winckler d99c9c1101 Fix bug in swipe code 2011-07-16 15:46:38 +02:00
Bram Moolenaar 155ee7b0ca Added tag v7-3-254 for changeset 1eb805225de7 2011-07-15 21:24:12 +02:00
Bram Moolenaar c3d99f427d updated for version 7.3.254
Problem:    The coladd field is not reset when setting the line number for a
	    ":call" command.
Solution:   Reset it.
2011-07-15 21:24:11 +02:00
Bram Moolenaar cee4357a5b Added tag v7-3-253 for changeset c21429d7768c 2011-07-15 21:16:59 +02:00
Bram Moolenaar fa6185ce52 updated for version 7.3.253
Problem:    "echo 'abc' > ''" returns 0 or 1, depending on 'ignorecase'.
	    Checks in mb_strnicmp() for illegal and truncated bytes are
	    wrong.  Should not assume that byte length is equal before case
	    folding.
Solution:   Add utf_safe_read_char_adv() and utf_strnicmp(). Add a test for
	    this. (Ivan Krasilnikov)
2011-07-15 21:16:59 +02:00
Bram Moolenaar c9cf2496c7 Added tag v7-3-252 for changeset 0b4289bcf836 2011-07-15 17:56:16 +02:00
Bram Moolenaar 803d8bdfb4 updated for version 7.3.252
Problem:    Tests fail. (David Northfield)
Solution:   Add missing update for .ok file.
2011-07-15 17:56:16 +02:00
Bram Moolenaar 4616dfcd3a Added tag v7-3-251 for changeset fe6ad3fd8532 2011-07-15 17:51:34 +02:00
Bram Moolenaar 37573a22d4 updated for version 7.3.251
Problem:    "gH<Del>" deletes the current line, except when it's the last
	    line.
Solution:   Set the "include" flag to indicate the last line is to be deleted.
2011-07-15 17:51:34 +02:00
Bram Moolenaar 44d2f391c9 Added tag v7-3-250 for changeset f909f4f0f38c 2011-07-15 15:54:44 +02:00
Bram Moolenaar 187319ac73 updated for version 7.3.250
Problem:    Python: Errors in Unicode characters not handled nicely.
Solution:   Add the surrogateescape error handler. (lilydjwg)
2011-07-15 15:54:44 +02:00
Bram Moolenaar bea434d7ad Added tag v7-3-249 for changeset 9f71f5a526af 2011-07-15 14:12:31 +02:00
Bram Moolenaar ddc01469a8 updated for version 7.3.249
Problem:    Wrong indenting for array initializer.
Solution:   Detect '}' in a better way. (Lech Lorens)
2011-07-15 14:12:30 +02:00
Bram Moolenaar 1f1e41911e Added tag v7-3-248 for changeset 57a7998e0fa8 2011-07-15 13:52:04 +02:00
Bram Moolenaar 7c4547bf99 updated for version 7.3.248
Problem:    PC Install instructions missing install instructions.
Solution:   Step-by-step explanation. (Michael Soyka)
2011-07-15 13:52:04 +02:00
Bram Moolenaar 7322c3ba4b Added tag v7-3-247 for changeset 7fe2c092913e 2011-07-15 13:33:21 +02:00
Bram Moolenaar 9d86f0c543 updated for version 7.3.247
Problem:    Running tests changes the users viminfo file.  Test for patch
	    7.3.245 missing.
Solution:   Add "nviminfo" to the 'viminfo' option.  Include the test.
2011-07-15 13:33:21 +02:00
Bram Moolenaar be9bf38b00 Added tag v7-3-246 for changeset 3f1a4ed36d1b 2011-07-15 13:21:30 +02:00
Bram Moolenaar 78f1705c39 updated for version 7.3.246
Problem:    Repeating "f4" in "4444" skips one 4.
Solution:   Check the t_cmd flag. (Christian Brabandt)
2011-07-15 13:21:30 +02:00
Bram Moolenaar f752a1288f Added tag v7-3-245 for changeset 52512eddb876 2011-07-15 13:09:51 +02:00
Bram Moolenaar 5aa313472e updated for version 7.3.245
Problem:    Python 3.2 libraries not correctly detected.
Solution:   Add the suffix to the library name. (Niclas Zeising)
2011-07-15 13:09:51 +02:00
Bjorn Winckler b0625e5e96 Snapshot 59 2011-07-10 17:06:35 +02:00
Bjorn Winckler 8c1e930854 Use public API to toggle display of hidden files
Use public API (introduced in OS X 10.6) to toggle display of hidden
files in the open and save panels.  This fixes a bug where MacVim would
lock up or crash when using the open or save panels on OS X 10.7.
2011-07-09 19:54:35 +02:00
Bram Moolenaar ff3e697c62 Added tag v7-3-244 for changeset be6b65096362 2011-07-07 17:43:42 +02:00
Bram Moolenaar 9c42afa550 updated for version 7.3.244
Problem:    MS-Windows: Build problem with old compiler. (John Beckett)
Solution:   Only use HandleToLong() when available. (Mike Williams)
2011-07-07 17:43:41 +02:00
Bram Moolenaar cf1628689a Added tag v7-3-243 for changeset 512ddd87f1a8 2011-07-07 17:36:57 +02:00
Bram Moolenaar b70aad41ed updated for version 7.3.243
Problem:    Illegal memory access in readline().
Solution:   Swap the conditions. (Dominique Pelle)
2011-07-07 17:36:56 +02:00
Bram Moolenaar 8dd190f611 Added tag v7-3-242 for changeset 3d96ddbeb3b0 2011-07-07 17:15:33 +02:00
Bram Moolenaar b20d2575d0 updated for version 7.3.242
Problem:    Illegal memory access in after_pathsep().
Solution:   Check that the pointer is not at the start of the file name.
	    (Dominique Pelle)
2011-07-07 17:15:33 +02:00
Bram Moolenaar 195add0620 Added tag v7-3-241 for changeset 0a650db02653 2011-07-07 16:44:38 +02:00
Bram Moolenaar fd92d3e268 updated for version 7.3.241
Problem:    Using CTRL-R CTRL-W on the command line may insert only part of
	    the word.
Solution:   Use the cursor position instead of assuming it is at the end of
	    the command. (Tyru)
2011-07-07 16:44:37 +02:00
Bram Moolenaar a9c96dd4b4 Added tag v7-3-240 for changeset bf283e37792b 2011-07-07 16:20:52 +02:00
Bram Moolenaar 09fcb03138 updated for version 7.3.240
Problem:    External commands can't use pipes on MS-Windows.
Solution:   Implement pipes and use them when 'shelltemp' isn't set. (Vincent
	    Berthoux)
2011-07-07 16:20:52 +02:00
Bram Moolenaar dab1828e3d Added tag v7-3-239 for changeset 0bef86c5c985 2011-07-07 15:08:58 +02:00
Bram Moolenaar a732285db7 updated for version 7.3.239
Problem:    Python corrects the cursor column without taking 'virtualedit'
	    into account. (lilydjwg)
Solution:   Call check_cursor_col_win().
2011-07-07 15:08:58 +02:00
Bram Moolenaar f562b94b3f Added tag v7-3-238 for changeset f2c108f44f41 2011-07-07 15:04:52 +02:00
Bram Moolenaar 64379f252a updated for version 7.3.238
Problem:    Compiler warning for conversion.
Solution:   Add type cast. (Mike Williams)
2011-07-07 15:04:52 +02:00
94 changed files with 2701 additions and 606 deletions
+4
View File
@@ -3,6 +3,8 @@
src/MacVim/MacVim.xcodeproj/*.mode1
src/MacVim/MacVim.xcodeproj/*.mode1v3
src/MacVim/MacVim.xcodeproj/*.pbxuser
src/MacVim/MacVim.xcodeproj/project.xcworkspace
src/MacVim/MacVim.xcodeproj/xcuserdata
src/MacVim/icons/*.pyc
src/MacVim/icons/*.ttf
src/MacVim/icons/*.reg
@@ -16,6 +18,7 @@ src/MacVim/icons/makeicns/makeicns
src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/*.mode1
src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/*.mode1v3
src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/*.pbxuser
src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/xcuserdata
src/MacVim/PSMTabBarControl/build
src/MacVim/PSMTabBarControl/build
src/MacVim/build
@@ -35,3 +38,4 @@ src/po/*.mo
src/tags
src/xxd/xxd
src/xxd/xxd.dSYM
src/a.out.dSYM
+23
View File
@@ -1572,3 +1572,26 @@ b67d3a44262a97e7b3ae212fcffb36926b5f53f4 v7-3-232
441d364773dc53264b5f26042f8fc6f8b77c8044 v7-3-235
c1733ef5b6e87dde521d0d85a1e5e62259854ac1 v7-3-236
e3bb93df6c34da672244bce5695c1426da139614 v7-3-237
f2c108f44f415c7cfe92862e791a01cc542ac378 v7-3-238
0bef86c5c985218a9448fa16d935b913e67af8d5 v7-3-239
bf283e37792b4b557a2b9081e4fdb0e10acb9655 v7-3-240
0a650db0265381b540df8ca6bd716c4b2d47dfc9 v7-3-241
3d96ddbeb3b0003de29b736f63b76675909f133c v7-3-242
512ddd87f1a817749c8362bd043682a7bbd87014 v7-3-243
be6b6509636242cd7e6fab9a4b8772e97fc9a0db v7-3-244
52512eddb876f64399e98d12643233a87c9f2823 v7-3-245
3f1a4ed36d1b520a1ad5aa6cbf50d68bc8b9c7a5 v7-3-246
7fe2c092913e84e6717782da1f1a220069eebbe7 v7-3-247
57a7998e0fa8854a7a8c3946df1d4c9b1ee220e5 v7-3-248
9f71f5a526aff4f1e0eefe1068d9534aee427afa v7-3-249
f909f4f0f38c71594266b3595d31ce04d4ebe3ec v7-3-250
fe6ad3fd85322b394824a5c495a78061a747b074 v7-3-251
0b4289bcf8364854dd5f94c42d0252504103e5b9 v7-3-252
c21429d7768cd4b834a086dd47881d01bca74e8c v7-3-253
1eb805225de7750c03af7b0f7ac2f5dd18d032be v7-3-254
aa998de9f9592426c17396b60c5db9170a234024 v7-3-255
c296c225736e4489706c62c95752a0c4788be1d3 v7-3-256
1fad9c73d77a0030586704cccab1b1a7aba8b58b v7-3-257
bdc3335bd72eea207b28fcf8af90a73c855c8847 v7-3-258
59130cd78dfc73bd04f22d201b8f7c0772d98e79 v7-3-259
cb4682b959098e486977eb4b5969c9eb07d2798e v7-3-260
+4 -3
View File
@@ -1,4 +1,4 @@
*eval.txt* For Vim version 7.3. Last change: 2011 Jun 19
*eval.txt* For Vim version 7.3. Last change: 2011 Jul 13
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2277,7 +2277,8 @@ char2nr({expr}) *char2nr()*
< The current 'encoding' is used. Example for "utf-8": >
char2nr("á") returns 225
char2nr("á"[0]) returns 195
< |nr2char()| does the opposite.
< A combining character is a separate character.
|nr2char()| does the opposite.
cindent({lnum}) *cindent()*
Get the amount of indent for line {lnum} according the C
@@ -5968,7 +5969,7 @@ virtcol({expr}) *virtcol()*
When 'virtualedit' is used {expr} can be [lnum, col, off], where
"off" is the offset in screen columns from the start of the
character. E.g., a position within a <Tab> or after the last
character.
character. When "off" is omitted zero is used.
When Virtual editing is active in the current mode, a position
beyond the end of the line can be returned. |'virtualedit'|
The accepted positions are:
+11 -4
View File
@@ -1,4 +1,4 @@
*gui_mac.txt* For Vim version 7.3. Last change: 2010 Dec 28
*gui_mac.txt* For Vim version 7.3. Last change: 2011 Jul 26
VIM REFERENCE MANUAL by Bjorn Winckler
@@ -594,10 +594,17 @@ Alt-Up Move cursor one paragraph forward (see |alt-movement|).
Alt-Down Move cursor to the previous paragraph
(see |alt-movement|).
*delete-key* *macvim-<Backspace>*
Delete key Delete selection in visual mode. (This overrides the
default behavior of moving the cursor left.)
Note that the key labeled "delete" on a Mac keyboard
is known to Vim as <Backspace>.
*cmd-movement* *alt-movement*
The above mappings involving Cmd/Alt + arrow key are enabled by default in the
system gvimrc file "$VIM/gvimrc". You can quickly disable all of these by
adding the following lines to your "~/.vimrc" (not .gvimrc) file: >
The above mappings involving Cmd/Alt + arrow key (including the delete key)
are enabled by default in the system gvimrc file "$VIM/gvimrc". You can
disable all of these by adding the following lines to your "~/.vimrc" (not
.gvimrc) file: >
if has("gui_macvim")
let macvim_skip_cmd_opt_movement = 1
endif
+7 -5
View File
@@ -1,4 +1,4 @@
*indent.txt* For Vim version 7.3. Last change: 2011 May 31
*indent.txt* For Vim version 7.3. Last change: 2011 Jul 15
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -486,9 +486,10 @@ The examples below assume a 'shiftwidth' of 4.
) )
<
*java-cinoptions* *java-indenting* *cino-j*
jN Indent java anonymous classes correctly. The value 'N' is
currently unused but must be non-zero (e.g. 'j1'). 'j1' will
indent for example the following code snippet correctly: >
jN Indent Java anonymous classes correctly. Also works well for
Javascript. The value 'N' is currently unused but must be
non-zero (e.g. 'j1'). 'j1' will indent for example the
following code snippet correctly: >
object.add(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
@@ -499,7 +500,8 @@ The examples below assume a 'shiftwidth' of 4.
*javascript-cinoptions* *javascript-indenting* *cino-J*
JN Indent JavaScript object declarations correctly by not confusing
them with labels. The value 'N' is currently unused but must be
non-zero (e.g. 'J1'). >
non-zero (e.g. 'J1'). If you enable this you probably also want
to set |cino-j|. >
var bar = {
foo: {
+4
View File
@@ -1211,17 +1211,21 @@ completion can be enabled:
-complete=augroup autocmd groups
-complete=buffer buffer names
-complete=color color schemes
-complete=command Ex command (and arguments)
-complete=compiler compilers
-complete=cscope |:cscope| suboptions
-complete=dir directory names
-complete=environment environment variable names
-complete=event autocommand events
-complete=expression Vim expression
-complete=file file and directory names
-complete=file_in_path file and directory names in |'path'|
-complete=filetype filetype names |'filetype'|
-complete=function function name
-complete=help help subjects
-complete=highlight highlight groups
-complete=locale locale names (as output of locale -a)
-complete=mapping mapping name
-complete=menu menus
-complete=option options
+3 -3
View File
@@ -1,4 +1,4 @@
*mbyte.txt* For Vim version 7.3. Last change: 2011 Feb 01
*mbyte.txt* For Vim version 7.3. Last change: 2011 Jul 18
VIM REFERENCE MANUAL by Bram Moolenaar et al.
@@ -1306,8 +1306,8 @@ character. However, search patterns may not match on an overlong sequence.
character.) An exception is NUL (zero) which is displayed as "<00>".
In the file and buffer the full range of Unicode characters can be used (31
bits). However, displaying only works for 16 bit characters, and only for the
characters present in the selected font.
bits). However, displaying only works for the characters present in the
selected font.
Useful commands:
- "ga" shows the decimal, hexadecimal and octal value of the character under
+11 -9
View File
@@ -1,4 +1,4 @@
*options.txt* For Vim version 7.3. Last change: 2011 Jun 12
*options.txt* For Vim version 7.3. Last change: 2011 Jul 07
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -3308,7 +3308,7 @@ A jump table for the options with a short description can be found at |Q_op|.
XXX: Think about how 'fullscreen' and 'transparency' should interact.
*'fuoptions'* *'fuopt'*
'fuoptions' 'fuopt' string (default "maxvert")
'fuoptions' 'fuopt' string (default "maxvert,maxhorz")
global
{not in Vi}
{only in MacVim GUI}
@@ -3328,6 +3328,7 @@ A jump table for the options with a short description can be found at |Q_op|.
number of columns, it is restored to the value it had before
entering fullscreen.
background:color
{not supported in Mac OS X native full screen}
When entering fullscreen, 'color' defines the color of the part
of the screen that is not occupied by the Vim control. If
'color' is an 8-digit hexadecimal number preceded by '#',
@@ -3339,15 +3340,15 @@ A jump table for the options with a short description can be found at |Q_op|.
scheme.
Examples:
Don't change size of Vim when entering fullscreen: >
Don't change size when entering fullscreen: >
:set fuoptions=
< Maximize Vim when entering fullscreen: >
:set fuoptions=maxvert,maxhorz
< Maximize Vim only vertically when entering fullscreen, and color the
< Only maximize vertically when entering fullscreen: >
:set fuoptions=maxvert
< Maximize only vertically when entering fullscreen, and color the
background dark blue: >
:set fuoptions=maxvert,background:#FF003042
< Don't change the size of Vim when entering fullscreen, and color the
background like the current text background: >
< Don't change size when entering fullscreen, and color the background
like the current text background: >
:set fuoptions=background:Normal
<
XXX: what if the font size is changed? you probably never want to
@@ -6116,7 +6117,8 @@ A jump table for the options with a short description can be found at |Q_op|.
{not in Vi}
When on, use temp files for shell commands. When off use a pipe.
When using a pipe is not possible temp files are used anyway.
Currently a pipe is only supported on Unix. You can check it with: >
Currently a pipe is only supported on Unix and MS-Windows 2K and
later. You can check it with: >
:if has("filterpipe")
< The advantage of using a pipe is that nobody can read the temp file
and the 'shell' command does not need to support redirection.
+2 -4
View File
@@ -1036,11 +1036,9 @@ x A single character, with no special meaning, matches itself
These items only work for 8-bit characters.
*/[[=* *[==]*
- An equivalence class. This means that characters are matched that
have almost the same meaning, e.g., when ignoring accents. The form
is:
have almost the same meaning, e.g., when ignoring accents. This
only works for Unicode, latin1 and latin9. The form is:
[=a=]
Currently this is only implemented for latin1. Also works for the
latin1 characters in utf-8 and latin9.
*/[[.* *[..]*
- A collation element. This currently simply accepts a single
character in the form:
+11 -5
View File
@@ -1,4 +1,4 @@
*syntax.txt* For Vim version 7.3. Last change: 2011 May 06
*syntax.txt* For Vim version 7.3. Last change: 2011 Jul 18
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -866,13 +866,13 @@ used.
Detecting whether a file is csh or tcsh is notoriously hard. Some systems
symlink /bin/csh to /bin/tcsh, making it almost impossible to distinguish
between csh and tcsh. In case VIM guesses wrong you can set the
"filetype_csh" variable. For using csh: >
:let filetype_csh = "csh"
"filetype_csh" variable. For using csh: *g:filetype_csh*
>
:let g:filetype_csh = "csh"
For using tcsh: >
:let filetype_csh = "tcsh"
:let g:filetype_csh = "tcsh"
Any script with a tcsh extension or a standard tcsh filename (.tcshrc,
tcsh.tcshrc, tcsh.login) will have filetype tcsh. All other tcsh/csh scripts
@@ -2372,6 +2372,12 @@ This will make the syntax synchronization start 50 lines before the first
displayed line. The default value is 10. The disadvantage of using a larger
number is that redrawing can become slow.
Vim tries to guess what type a ".r" file is. If it can't be detected (from
comment lines), the default is "r". To make the default rexx add this line to
your .vimrc: *g:filetype_r*
>
:let g:filetype_r = "r"
RUBY *ruby.vim* *ft-ruby-syntax*
+5
View File
@@ -5149,6 +5149,7 @@ cpo-+ options.txt /*cpo-+*
cpo-- options.txt /*cpo--*
cpo-. options.txt /*cpo-.*
cpo-/ options.txt /*cpo-\/*
cpo-; options.txt /*cpo-;*
cpo-< options.txt /*cpo-<*
cpo-> options.txt /*cpo->*
cpo-A options.txt /*cpo-A*
@@ -5292,6 +5293,7 @@ definition-search tagsrch.txt /*definition-search*
definitions intro.txt /*definitions*
delete() eval.txt /*delete()*
delete-insert change.txt /*delete-insert*
delete-key gui_mac.txt /*delete-key*
delete-menus gui.txt /*delete-menus*
deleting change.txt /*deleting*
design-assumptions develop.txt /*design-assumptions*
@@ -5838,6 +5840,8 @@ g:decada.Error_Format ft_ada.txt /*g:decada.Error_Format*
g:decada.Make() ft_ada.txt /*g:decada.Make()*
g:decada.Make_Command ft_ada.txt /*g:decada.Make_Command*
g:decada.Unit_Name() ft_ada.txt /*g:decada.Unit_Name()*
g:filetype_csh syntax.txt /*g:filetype_csh*
g:filetype_r syntax.txt /*g:filetype_r*
g:gnat ft_ada.txt /*g:gnat*
g:gnat.Error_Format ft_ada.txt /*g:gnat.Error_Format*
g:gnat.Find() ft_ada.txt /*g:gnat.Find()*
@@ -6606,6 +6610,7 @@ mac-vimfile os_mac.txt /*mac-vimfile*
macintosh os_mac.txt /*macintosh*
macro map.txt /*macro*
macvim gui_mac.txt /*macvim*
macvim-<Backspace> gui_mac.txt /*macvim-<Backspace>*
macvim-backspace gui_mac.txt /*macvim-backspace*
macvim-clientserver remote.txt /*macvim-clientserver*
macvim-colors gui_mac.txt /*macvim-colors*
+25 -46
View File
@@ -1,4 +1,4 @@
*todo.txt* For Vim version 7.3. Last change: 2011 Jun 19
*todo.txt* For Vim version 7.3. Last change: 2011 Jul 15
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -40,52 +40,11 @@ Crash in autocomplete, valgrind log. (Greg Weber, 2011 Apr 22)
Discussion about canonicalization of Hebrew. (Ron Aaron, 2011 April 10)
Patch to fix gj with count. (James Vega, 2011 Jun 13)
Patch to disallow fork() when __APPLE__ is defined. (Hisashi T Fujinaka, 2010
Nov 25)
7 Output for ":scriptnames" and ":breaklist" should shorten the file names:
use "~/" when possible.
Patch by Jean-Rene David, 2011 May 1.
Cindent wrong after patch 7.3.202. (Lech Lorens, issue 9)
Patch for cindent fix with closing brace placement, including tests.
(Lech Lorens, issue 10, 2011 Jun 12)
Patch for better #if 0 syntax highlighting for C code. (Ben Schmidt, 2011 Jan
20)
Change to C syntax folding to make it work much faster, but a bit less
reliable. (Lech Lorens, 2009 Nov 9) Enable with an option?
Most time is spent in in_id_list().
Updated to merge both patches. (Ben Schmidt, 2011 May 2)
GTK: Patch to fix menu popping down. (Hong Xu, 2010 Dec 4, Dec 5)
Update 2011 Feb 3.
Patch to use pipes on Win32. (Vincent Berthoux, 2011 Feb 28)
Update Mar 1 using 'shelltemp'.
Patch to fix CTRL-R CTRL-W in the command line when the cursor is not at the
end. (Tyru, 2011 Jun 6)
Patch to support UTF-8 for Hangul. (Shawn Y.H. Kim, 2011 May 1)
Needs more work.
Patch to make ";" not get stuck on "t" command. (Christian Brabandt, 2011 May
23)
Patch to do more testing of Javascript indenting. Some items are srong.
(Luc Deschenaux, 2011 Jun 14)
"gh<Del>" deletes the current line, except when it's the last line.
Hint by Christian Brabandt, 2011 Mar 22
"echo 'abc' > ''" returns 0 or 1, depending on 'ignorecase'.
mb_strnicmp() checks for illegal and truncated bytes are wrong.
Should also not assume that byte length is equal before case folding.
Patch by Ivan Krasilnikov, 2011 May 27.
With "unamedplus" in 'clipboard' pasting in Visual mode causes error for empty
register. (Michael Seiwald, 2011 Jun 28)
The :z command doesn't work exactly as it should. (ChangZhuo Chen, 2011 Mar 2)
Compare with how old Vi works and with posix spec. terminal is 80 x 24,
@@ -94,6 +53,7 @@ Compare with how old Vi works and with posix spec. terminal is 80 x 24,
'cursorline' is displayed too short when there are concealed characters and
'list' is set. (Dennis Preiser)
Patch 7.3.116 was the wrong solution.
Christian Brabandt has another incomplete patch. (2011 Jul 13)
With concealed text mouse click doesn't put the cursor in the right position.
(Herb Sitz) Fix by Christian Brabandt, 2011 Jun 16. Doesn't work properly,
@@ -119,8 +79,13 @@ Bug in repeating Visual "u". (Lawrence Kesteloot, 2010 Dec 20)
Patch to automatically get version number into NSIS. (Guopeng Wen, 2011 May
27)
Patch to add more command completions (Dominique Pelle, 2011 Jun 25)
Patch to have GvimExt not use "edit with existing Vim" entries.
(Jerome Vuarand, 2011 Jun 22)
Patch to make character classes work with multi-byte characters.
(Dominique Pelle, 2011 May 31)
(Dominique Pelle, 2011 May 31, update July 11)
In GTK Gvim, setting 'lines' and 'columns' to 99999 causes a crash (Tony
Mechelynck, 2011 Apr 25). Can reproduce the crash sometimes:
@@ -143,6 +108,9 @@ Need for CursorHold that retriggers. Use a key that doesn't do anything, or a
function that resets did_cursorhold.
Patch by Christian Brabandt, 2011 May 6.
popup completion menu closes quickly when there is a fold in the buffer. (Jan
Christoph Ebersbach, 2011 Jul 3)
CursorHold repeats typed key when it's the start of a mapping.
(Will Gray, 2011 Mar 23)
Christian Brabandt: problem is that OP_PENDING isn't set.
@@ -192,6 +160,10 @@ Bug in try/catch: return with invalid compare throws error that isn't caught.
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?
When setting a local option value from the global value, add a script ID that
indicates this, so that ":verbose set" can give a hint. Check with options in
the help file.
After patch 7.3.097 still get E15. (Yukihiro Nakadaira, 2011 Jan 18)
Also for another example (ZyX, 2011 Jan 24)
@@ -251,6 +223,9 @@ New esperanto spell file can't be processed. (Dominique Pelle, 2011 Jan 30)
"L'Italie" noted as a spell error at start of the sentence. (Dominique Pelle,
2011 Feb 27)
Patch to fail if configure can't find an interface, such as Python.
(Shlomi Fish, 2011 Jul 11)
Copy/paste between Vim and Google chrome doesn't work well for multi-byte
characters. (Ben Haskell, 2010 Sep 17)
When putting text in the cut buffer (when exiting) and conversion doesn't work
@@ -341,7 +316,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)
(Jakson A. Aquino, 2010 Jul 30, again 2011 Jul 2)
Patch to make more characters work in dialogs. (Yankwei Jia, 2010 Aug 4)
@@ -429,6 +404,9 @@ characters. (2010 Aug 14, bootleq)
Problem with stop directory in findfile(). (Adam Simpkins, 2009 Aug 26)
Using ']' as the end of a range in a pattern requires double escaping:
/[@-\\]] (Andy Wokula, 2011 Jun 28)
Undo problem: line not removed as expected when using setline() from Insert
mode. (Israel Chauca, 2010 May 13, more in second msg)
Break undo when CTRL-R = changes the text? Or save more lines?
@@ -1525,6 +1503,7 @@ Awaiting updated patches:
- Patch for 'breakindent' option: repeat indent for wrapped line. (Vaclav
Smilauer, 2004 Sep 13, fix Oct 31, update 2007 May 30)
Version for latest MacVim: Tobia Conforto, 2009 Nov 23
More recent version: https://retracile.net/wiki/VimBreakIndent
8 Add a few more command names to the menus. Patch from Jiri Brezina
(28 feb 2002). Will mess the translations...
7 ATTENTION dialog choices are more logical when "Delete it' appears
+8 -3
View File
@@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2011 Jun 13
" Last Change: 2011 Jul 17
" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
@@ -1588,8 +1588,13 @@ func! s:FTr()
endif
endfor
" Nothing recognized, assume Rexx
setf rexx
" Nothing recognized, use user default or assume Rexx
if exists("g:filetype_r")
exe "setf " . g:filetype_r
else
" Rexx used to be the default, but R appears to be much more popular.
setf r
endif
endfunc
" Remind
+4 -1
View File
@@ -13,7 +13,10 @@ set cpo&vim
let b:undo_ftplugin = "setl fo< tw< cole< cocu<"
setlocal formatoptions+=tcroql textwidth=78 cole=2 cocu=nc
setlocal formatoptions+=tcroql textwidth=78
if has("conceal")
setlocal cole=2 cocu=nc
endif
if has("gui_macvim")
" Use swipe gesture to navigate back/forward
+2 -2
View File
@@ -1,7 +1,7 @@
" Vim indent file
" Language: DTD (Document Type Definition for XML)
" Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2010-09-21
" Latest Revision: 2011-07-08
let s:cpo_save = &cpo
set cpo&vim
@@ -52,7 +52,7 @@ function s:indent_to_innermost_parentheses(line, end)
let end = a:end
let parentheses = [end - 1]
while token != ""
let [token, end] = s:lex(a:line, end, '^\%([(),|]\|[A-Za-z0-9_-]\+\|#PCDATA\|%[A-Za-z0-9_-]\+;\)[?*+]\=')
let [token, end] = s:lex(a:line, end, '^\%([(),|]\|[A-Za-z0-9_-]\+\|#P\=CDATA\|%[A-Za-z0-9_-]\+;\)[?*+]\=')
if token[0] == '('
call add(parentheses, end - 1)
elseif token[0] == ')'
+1 -1
View File
@@ -1215,7 +1215,7 @@ if has("gui_macvim")
macm Window.Minimize\ All key=<D-M-m> action=miniaturizeAll: alt=YES
macm Window.Zoom key=<D-C-z> action=performZoom:
macm Window.Zoom\ All key=<D-M-C-z> action=zoomAll: alt=YES
macm Window.Toggle\ Full\ Screen\ Mode key=<D-F>
macm Window.Toggle\ Full\ Screen\ Mode key=<D-C-f>
macm Window.Select\ Next\ Tab key=<D-}>
macm Window.Select\ Previous\ Tab key=<D-{>
macm Window.Bring\ All\ To\ Front action=arrangeInFront:
+8 -8
View File
@@ -1,13 +1,13 @@
" Vim syntax file
" Language: BIND zone files (RFC1035)
" Language: BIND zone files (RFC 1035)
" Maintainer: Julian Mehnle <julian@mehnle.net>
" URL: http://www.mehnle.net/source/odds+ends/vim/syntax/
" Last Change: Thu 2006-04-20 12:30:45 UTC
" Last Change: Thu 2011-07-16 20:42:00 UTC
"
" Based on an earlier version by Вячеслав Горбанев (Slava Gorbanev), with
" heavy modifications.
"
" $Id: bindzone.vim,v 1.2 2006/04/20 22:06:21 vimboss Exp $
" $Id: bindzone.vim 12 2011-07-16 21:09:57Z julian $
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
@@ -23,7 +23,7 @@ syn case match
syn region zoneRRecord start=/^/ end=/$/ contains=zoneOwnerName,zoneSpecial,zoneTTL,zoneClass,zoneRRType,zoneComment,zoneUnknown
syn match zoneDirective /^\$ORIGIN\s\+/ nextgroup=zoneOrigin,zoneUnknown
syn match zoneDirective /^\$TTL\s\+/ nextgroup=zoneNumber,zoneUnknown
syn match zoneDirective /^\$TTL\s\+/ nextgroup=zoneTTL,zoneUnknown
syn match zoneDirective /^\$INCLUDE\s\+/ nextgroup=zoneText,zoneUnknown
syn match zoneDirective /^\$GENERATE\s/
@@ -34,9 +34,9 @@ syn match zoneOrigin contained /[^[:space:]!"#$%&'()*+,\/:;<=>?@[\]\
syn match zoneDomain contained /[^[:space:]!"#$%&'()*+,\/:;<=>?@[\]\^`{|}~]\+\(\s\|;\|$\)\@=/
syn match zoneSpecial contained /^[@*.]\s/
syn match zoneTTL contained /\<\d[0-9HhWwDd]*\>/ nextgroup=zoneClass,zoneRRType skipwhite
syn keyword zoneClass contained IN CHAOS nextgroup=zoneRRType,zoneTTL skipwhite
syn keyword zoneRRType contained A AAAA CNAME HINFO MX NS PTR SOA SRV TXT nextgroup=zoneRData skipwhite
syn match zoneTTL contained /\s\@<=\d[0-9WwDdHhMmSs]*\(\s\|$\)\@=/ nextgroup=zoneClass,zoneRRType skipwhite
syn keyword zoneClass contained IN CHAOS nextgroup=zoneRRType,zoneTTL skipwhite
syn keyword zoneRRType contained A AAAA CNAME DNAME HINFO MX NS PTR SOA SRV TXT SPF nextgroup=zoneRData skipwhite
syn match zoneRData contained /[^;]*/ contains=zoneDomain,zoneIPAddr,zoneIP6Addr,zoneText,zoneNumber,zoneParen,zoneUnknown
syn match zoneIPAddr contained /\<[0-9]\{1,3}\(\.[0-9]\{1,3}\)\{,3}\>/
@@ -66,7 +66,7 @@ syn match zoneNumber contained /\<[0-9]\+\(\s\|;\|$\)\@=/
syn match zoneSerial contained /\<[0-9]\{9,10}\(\s\|;\|$\)\@=/
syn match zoneErrParen /)/
syn region zoneParen contained start="(" end=")" contains=zoneSerial,zoneNumber,zoneComment
syn region zoneParen contained start="(" end=")" contains=zoneSerial,zoneTTL,zoneNumber,zoneComment
syn match zoneComment /;.*/
" Define the default highlighting.
+36 -17
View File
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: C
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2009 Nov 17
" Last Change: 2011 May 2
" Quit when a (custom) syntax file was already loaded
if exists("b:current_syntax")
@@ -72,7 +72,7 @@ endif
" This should be before cErrInParen to avoid problems with #define ({ xxx })
if exists("c_curly_error")
syntax match cCurlyError "}"
syntax region cBlock start="{" end="}" contains=ALLBUT,cCurlyError,@cParenGroup,cErrInParen,cCppParen,cErrInBracket,cCppBracket,cCppString,@Spell fold
syntax region cBlock start="{" end="}" contains=ALLBUT,cBadBlock,cCurlyError,@cParenGroup,cErrInParen,cCppParen,cErrInBracket,cCppBracket,cCppString,@Spell fold
else
syntax region cBlock start="{" end="}" transparent fold
endif
@@ -80,31 +80,33 @@ endif
"catch errors caused by wrong parenthesis and brackets
" also accept <% for {, %> for }, <: for [ and :> for ] (C99)
" But avoid matching <::.
syn cluster cParenGroup contains=cParenError,cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserCont,cUserLabel,cBitField,cOctalZero,cCppOut,cCppOut2,cCppSkip,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom
syn cluster cParenGroup contains=cParenError,cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserCont,cUserLabel,cBitField,cOctalZero,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom
if exists("c_no_curly_error")
syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cCppString,@Spell
syn region cParen transparent start='(' end=')' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cCppParen,cCppString,@Spell
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
syn match cParenError display ")"
syn match cErrInParen display contained "^[{}]\|^<%\|^%>"
elseif exists("c_no_bracket_error")
syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cCppString,@Spell
syn region cParen transparent start='(' end=')' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cCppParen,cCppString,@Spell
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
syn match cParenError display ")"
syn match cErrInParen display contained "[{}]\|<%\|%>"
else
syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cErrInBracket,cCppBracket,cCppString,@Spell
syn region cParen transparent start='(' end=')' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cCppParen,cErrInBracket,cCppBracket,cCppString,@Spell
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cErrInBracket,cParen,cBracket,cString,@Spell
syn match cParenError display "[\])]"
syn match cErrInParen display contained "[\]{}]\|<%\|%>"
syn region cBracket transparent start='\[\|<::\@!' end=']\|:>' contains=ALLBUT,@cParenGroup,cErrInParen,cCppParen,cCppBracket,cCppString,@Spell
syn region cBracket transparent start='\[\|<::\@!' end=']\|:>' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cErrInParen,cCppParen,cCppBracket,cCppString,@Spell
" cCppBracket: same as cParen but ends at end-of-line; used in cDefine
syn region cCppBracket transparent start='\[\|<::\@!' skip='\\$' excludenl end=']\|:>' end='$' contained contains=ALLBUT,@cParenGroup,cErrInParen,cParen,cBracket,cString,@Spell
syn match cErrInBracket display contained "[);{}]\|<%\|%>"
endif
syntax region cBadBlock keepend extend start="{" end="}" contained containedin=cParen,cBracket,cBadBlock transparent fold
"integer number, or floating point number without a dot and with "f".
syn case ignore
syn match cNumbers display transparent "\<\d\|\.\d" contains=cNumber,cFloat,cOctalError,cOctal
@@ -270,27 +272,39 @@ if !exists("c_no_c99") " ISO C99
endif
" Accept %: for # (C99)
syn region cPreCondit start="^\s*\(%:\|#\)\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" keepend contains=cComment,cCommentL,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError
syn match cPreCondit display "^\s*\(%:\|#\)\s*\(else\|endif\)\>"
syn region cPreCondit start="^\s*\(%:\|#\)\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" keepend contains=cComment,cCommentL,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError
syn match cPreConditMatch display "^\s*\(%:\|#\)\s*\(else\|endif\|elif\)\>"
if !exists("c_no_if0")
syn cluster cCppOutInGroup contains=cCppInIf,cCppInElse,cCppInElse2,cCppOutIf,cCppOutIf2,cCppOutElse,cCppInSkip,cCppOutSkip
syn region cCppOutWrapper start="^\s*\(%:\|#\)\s*if\s\+0\+\s*\($\|//\|/\*\|&\)" end=".\@=\|$" contains=cCppOutIf,cCppOutElse
syn region cCppOutIf contained start="0\+" matchgroup=cCppOutWrapper end="^\s*\(%:\|#\)\s*endif\>" contains=cCppOutIf2,cCppOutElse
if !exists("c_no_if0_fold")
syn region cCppOut start="^\s*\(%:\|#\)\s*if\s\+0\+\>" end=".\@=\|$" contains=cCppOut2 fold
syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0\+\s*\($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip
else
syn region cCppOut start="^\s*\(%:\|#\)\s*if\s\+0\+\>" end=".\@=\|$" contains=cCppOut2
syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0\+\s*\($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip fold
endif
syn region cCppOut2 contained start="0" end="^\s*\(%:\|#\)\s*\(endif\>\|else\>\|elif\>\)" contains=cSpaceError,cCppSkip
syn region cCppSkip contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppSkip
syn region cCppOutElse contained matchgroup=cCppOutWrapper start="^\s*\(%:\|#\)\s*\(else\|elif\)" end="^\s*\(%:\|#\)\s*endif\>"me=s-1 contains=TOP,cPreCondit
syn region cCppInWrapper start="^\s*\(%:\|#\)\s*if\s\+0*[1-9]\d*\s*\($\|//\|/\*\||\)" end=".\@=\|$" contains=cCppInIf,cCppInElse
syn region cCppInIf contained matchgroup=cCppInWrapper start="\d\+" end="^\s*\(%:\|#\)\s*endif\>" contains=TOP,cPreCondit
if !exists("c_no_if0_fold")
syn region cCppInElse contained start="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 fold
else
syn region cCppInElse contained start="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2
endif
syn region cCppInElse2 contained matchgroup=cCppInWrapper start="^\s*\(%:\|#\)\s*\(else\|elif\)\([^/]\|/[^/*]\)*" end="^\s*\(%:\|#\)\s*endif\>"me=s-1 contains=cSpaceError,cCppOutSkip
syn region cCppOutSkip contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppOutSkip
syn region cCppInSkip contained matchgroup=cCppInWrapper start="^\s*\(%:\|#\)\s*\(if\s\+\(\d\+\s*\($\|//\|/\*\||\|&\)\)\@!\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" containedin=cCppOutElse,cCppInIf,cCppInSkip contains=TOP,cPreProc
endif
syn region cIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+
syn match cIncluded display contained "<[^>]*>"
syn match cInclude display "^\s*\(%:\|#\)\s*include\>\s*["<]" contains=cIncluded
"syn match cLineSkip "\\$"
syn cluster cPreProcGroup contains=cPreCondit,cIncluded,cInclude,cDefine,cErrInParen,cErrInBracket,cUserLabel,cSpecial,cOctalZero,cCppOut,cCppOut2,cCppSkip,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cString,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cParen,cBracket,cMulti
syn cluster cPreProcGroup contains=cPreCondit,cIncluded,cInclude,cDefine,cErrInParen,cErrInBracket,cUserLabel,cSpecial,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cString,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cParen,cBracket,cMulti
syn region cDefine start="^\s*\(%:\|#\)\s*\(define\|undef\)\>" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell
syn region cPreProc start="^\s*\(%:\|#\)\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell
" Highlight User Labels
syn cluster cMultiGroup contains=cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserCont,cUserLabel,cBitField,cOctalZero,cCppOut,cCppOut2,cCppSkip,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cCppParen,cCppBracket,cCppString
syn cluster cMultiGroup contains=cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserCont,cUserLabel,cBitField,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cCppParen,cCppBracket,cCppString
syn region cMulti transparent start='?' skip='::' end=':' contains=ALLBUT,@cMultiGroup,@Spell
" Avoid matching foo::bar() in C++ by requiring that the next char is not ':'
syn cluster cLabelGroup contains=cUserLabel
@@ -354,6 +368,9 @@ hi def link cDefine Macro
hi def link cIncluded cString
hi def link cError Error
hi def link cStatement Statement
hi def link cCppInWrapper cCppOutWrapper
hi def link cCppOutWrapper cPreCondit
hi def link cPreConditMatch cPreCondit
hi def link cPreCondit PreCondit
hi def link cType Type
hi def link cConstant Constant
@@ -365,8 +382,10 @@ hi def link cComment Comment
hi def link cSpecial SpecialChar
hi def link cTodo Todo
hi def link cBadContinuation Error
hi def link cCppSkip cCppOut
hi def link cCppOut2 cCppOut
hi def link cCppOutSkip cCppOutIf2
hi def link cCppInElse2 cCppOutIf2
hi def link cCppOutIf2 cCppOut2 " Old syntax group for #if 0 body
hi def link cCppOut2 cCppOut " Old syntax group for #if of #if 0
hi def link cCppOut Comment
let b:current_syntax = "c"
+2 -2
View File
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: dnsmasq(8) configuration file
" Maintainer: Thilo Six <T.Six@gmx.de>
" Last Change: 17 May 2011
" Last Change: 2011 Jul 14
" Credits: This file is a mix of cfg.vim, wget.vim and xf86conf.vim, credits go to:
" Igor N. Prischepoff
" Doug Kearns
@@ -58,7 +58,7 @@ syn match DnsmasqString "'.*'"
syn match DnsmasqComment "^#.*$" contains=DnsmasqTodo
syn match DnsmasqComment "\s#.*$" contains=DnsmasqTodo
syn keyword DnsmasqTodo FIXME TODO XXX NOT contained
syn keyword DnsmasqTodo FIXME TODO XXX NOTE contained
syn match DnsmasqKeywordSpecial "\<set\>:"me=e-1
syn match DnsmasqKeywordSpecial "\<tag\>:"me=e-1
+3 -2
View File
@@ -3,7 +3,8 @@
" Version Info: @(#)dosini.vim 1.6 97/12/15 08:54:12
" Author: Sean M. McKee <mckee@misslink.net>
" Maintainer: Nima Talebi <nima@it.net.au>
" Last Change: Mon, 26 Jun 2006 22:07:28 +1000
" Updated By: Hong Xu
" Last Change: 2011 Jul 16
" For version 5.x: Clear all syntax items
@@ -19,7 +20,7 @@ syn case ignore
syn match dosiniLabel "^.\{-}="
syn region dosiniHeader start="^\[" end="\]"
syn match dosiniComment "^;.*$"
syn match dosiniComment "^[#;].*$"
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
+2 -1
View File
@@ -2,7 +2,7 @@
" Language: gnash(1) configuration files
" http://www.gnu.org/software/gnash/manual/gnashuser.html#gnashrc
" Maintainer: Thilo Six <T.Six@gmx.de>
" Last Change: 17 May 2011
" Last Change: 2011 Jul 02
" Credidts: derived from readline.vim
" Nikolai Weibull
"
@@ -32,6 +32,7 @@ syn case match
syn match GnashSet '^\s*set\>'
syn match GnashSet '^\s*append\>'
syn case ignore
syn match GnashKeyword '\<CertDir\>'
syn match GnashKeyword '\<ASCodingErrorsVerbosity\>'
syn match GnashKeyword '\<CertFile\>'
+13 -4
View File
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: Vim help file
" Maintainer: Bram Moolenaar (Bram@vim.org)
" Last Change: 2010 Nov 03
" Last Change: 2011 Jul 11
" Quit when a (custom) syntax file was already loaded
if exists("b:current_syntax")
@@ -21,8 +21,13 @@ else
syn match helpHyperTextEntry "\*[#-)!+-~]\+\*\s"he=e-1 contains=helpStar
syn match helpHyperTextEntry "\*[#-)!+-~]\+\*$" contains=helpStar
endif
syn match helpBar contained "|" conceal
syn match helpStar contained "\*" conceal
if has("conceal")
syn match helpBar contained "|" conceal
syn match helpStar contained "\*" conceal
else
syn match helpBar contained "|"
syn match helpStar contained "\*"
endif
syn match helpNormal "|.*====*|"
syn match helpNormal ":|vim:|" " for :help modeline
syn match helpVim "Vim version [0-9.a-z]\+"
@@ -31,7 +36,11 @@ syn match helpOption "'[a-z]\{2,\}'"
syn match helpOption "'t_..'"
syn match helpHeader "\s*\zs.\{-}\ze\s\=\~$" nextgroup=helpIgnore
syn match helpGraphic ".* \ze`$" nextgroup=helpIgnore
syn match helpIgnore "." contained conceal
if has("conceal")
syn match helpIgnore "." contained conceal
else
syn match helpIgnore "." contained
endif
syn keyword helpNote note Note NOTE note: Note: NOTE: Notes Notes:
syn match helpSpecial "\<N\>"
syn match helpSpecial "\<N\.$"me=e-1
+11 -11
View File
@@ -1,5 +1,5 @@
===============================================================================
= B i e n v e n u e dans le T u t o r i e l de V I M - Version 1.7.fr.2 =
= B i e n v e n u e dans l e T u t o r i e l de V I M - Version 1.7 =
===============================================================================
Vim est un éditeur très puissant qui a trop de commandes pour pouvoir
@@ -67,7 +67,7 @@ NOTE : Les touches fl
4. Si vous avez mémorisé ces étapes et êtes confiant, effectuez les étapes
1 à 3 pour sortir puis rentrer dans l'éditeur.
NOTE : :q! <Entrée> annule tous les changements que vous avez fait. Dans
NOTE : :q! <Entrée> annule tous les changements que vous avez faits. Dans
quelques leçons, vous apprendrez à enregistrer les changements.
5. Déplacez le curseur à la Leçon 1.3.
@@ -260,7 +260,7 @@ NOTE : La lettre d appara
Une courte liste de mouvements :
w - jusqu'au début du prochain mot, en EXCLUANT son premier caractère.
e - jusqu'à la fin du mot courant, en EXCLUANT son denier caractère.
e - jusqu'à la fin du mot courant, en EXCLUANT son dernier caractère.
$ - jusqu'à la fin de la ligne, en INCLUANT son dernier caractère.
Ainsi, taper de va effacer depuis le curseur jusqu'à la fin du mot.
@@ -299,7 +299,7 @@ NOTE : Le seul appui d'un mouvement en mode Normal, sans commande, d
Outre la combinaison de l'opérateur d'effacement avec un déplacement
mentionné ci-dessus, vous pouvez insérer un nombre (quantificateur)
pour effacez encore plus :
pour effacer encore plus :
d nombre déplacement
1. Déplacez le curseur vers le premier mot en MAJUSCULES dans la ligne
@@ -704,7 +704,7 @@ NOTE : Si vous quittez Vim et le red
3. Appuyez : . En bas de l'écran :'<,'> va apparaître.
4. Tapez w TEST , où TEST est un nom de fichier qui n'existe pas.
Vérifiez que vous voyez :'<,'>w TEST avant de d'appuyer sur Entrée.
Vérifiez que vous voyez :'<,'>w TEST avant de d'appuyer sur <Entrée>.
5. Vim va enregistrer les lignes sélectionnées dans le fichier TEST.
Utilisez :!dir ou !ls pour le voir. Ne l'effacez pas encore !
@@ -725,7 +725,7 @@ NOTE : L'appui de v d
1. Placez le curseur juste au-dessus de cette ligne.
NOTE : Après avoir exécuté l'étape 2 vous verrez du texte de la Leçon 5.3.
Puis déplacez vous vers le bas pour voir cette leçon à nouveau.
Puis déplacez-vous vers le bas pour voir cette leçon à nouveau.
2. Maintenant récupérez votre fichier TEST en utilisant la commande :r TEST
où TEST est le nom de votre fichier.
@@ -854,7 +854,7 @@ NOTE : Le mode Remplacement est comme le mode Insertion, mais tous les
5. Tapez p pour coller le texte. Puis tapez : un second <Échap> .
6. Utilisez le mode Visuel pour sélectionner "élément", copiez le avec y ,
déplacez vous à la fin de la ligne suivant avec j$ et collez le texte
déplacez-vous à la fin de la ligne suivant avec j$ et collez le texte
à cet endroit avec p .
---> a) ceci est le premier élément.
@@ -1012,8 +1012,8 @@ NOTE : Le compl
Ceci conclut le Tutoriel Vim. Le but était de vous donner un bref aperçu de
l'éditeur Vim, juste assez pour vous permettre d'utiliser l'éditeur
relativement facilement. Il est loin d'être complet, vu que Vim a beaucoup
beaucoup plus de commandes. Un Manuel de l'utilisateur est disponible en
anglais : :help user-manual .
plus de commandes. Un Manuel de l'utilisateur est disponible en anglais :
:help user-manual
Pour continuer à découvrir et à apprendre Vim, il existe un livre traduit en
français. Il parle plus de Vi que de Vim, mais pourra vous être utile.
@@ -1030,9 +1030,9 @@ NOTE : Le compl
Université d'État du Colorado. E-mail : bware@mines.colorado.edu.
Modifié pour Vim par Bram Moolenar.
Traduit en Français par Adrien Beau, en avril 2001.
Traduit en français par Adrien Beau, en avril 2001.
Dernières mises à jour par Dominique Pellé.
E-mail : dominique.pelle@gmail.com
Last Change : 2010 May 23
Last Change : 2011 Jun 25
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+11 -11
View File
@@ -1,5 +1,5 @@
===============================================================================
= B i e n v e n u e dans le T u t o r i e l de V I M - Version 1.7.fr.2 =
= B i e n v e n u e dans l e T u t o r i e l de V I M - Version 1.7 =
===============================================================================
Vim est un éditeur très puissant qui a trop de commandes pour pouvoir
@@ -67,7 +67,7 @@ NOTE : Les touches fléchées devraient également fonctionner. Mais en utilisan
4. Si vous avez mémorisé ces étapes et êtes confiant, effectuez les étapes
1 à 3 pour sortir puis rentrer dans l'éditeur.
NOTE : :q! <Entrée> annule tous les changements que vous avez fait. Dans
NOTE : :q! <Entrée> annule tous les changements que vous avez faits. Dans
quelques leçons, vous apprendrez à enregistrer les changements.
5. Déplacez le curseur à la Leçon 1.3.
@@ -260,7 +260,7 @@ NOTE : La lettre d apparaîtra sur la dernière ligne de l'écran lors de
Une courte liste de mouvements :
w - jusqu'au début du prochain mot, en EXCLUANT son premier caractère.
e - jusqu'à la fin du mot courant, en EXCLUANT son denier caractère.
e - jusqu'à la fin du mot courant, en EXCLUANT son dernier caractère.
$ - jusqu'à la fin de la ligne, en INCLUANT son dernier caractère.
Ainsi, taper de va effacer depuis le curseur jusqu'à la fin du mot.
@@ -299,7 +299,7 @@ NOTE : Le seul appui d'un mouvement en mode Normal, sans commande, déplace le
Outre la combinaison de l'opérateur d'effacement avec un déplacement
mentionné ci-dessus, vous pouvez insérer un nombre (quantificateur)
pour effacez encore plus :
pour effacer encore plus :
d nombre déplacement
1. Déplacez le curseur vers le premier mot en MAJUSCULES dans la ligne
@@ -704,7 +704,7 @@ NOTE : Si vous quittez Vim et le redémarrez de nouveau avec le fichier TEST,
3. Appuyez : . En bas de l'écran :'<,'> va apparaître.
4. Tapez w TEST , où TEST est un nom de fichier qui n'existe pas.
Vérifiez que vous voyez :'<,'>w TEST avant de d'appuyer sur Entrée.
Vérifiez que vous voyez :'<,'>w TEST avant de d'appuyer sur <Entrée>.
5. Vim va enregistrer les lignes sélectionnées dans le fichier TEST.
Utilisez :!dir ou !ls pour le voir. Ne l'effacez pas encore !
@@ -725,7 +725,7 @@ NOTE : L'appui de v démarre la sélection Visuelle. Vous pouvez déplacer le
1. Placez le curseur juste au-dessus de cette ligne.
NOTE : Après avoir exécuté l'étape 2 vous verrez du texte de la Leçon 5.3.
Puis déplacez vous vers le bas pour voir cette leçon à nouveau.
Puis déplacez-vous vers le bas pour voir cette leçon à nouveau.
2. Maintenant récupérez votre fichier TEST en utilisant la commande :r TEST
où TEST est le nom de votre fichier.
@@ -854,7 +854,7 @@ NOTE : Le mode Remplacement est comme le mode Insertion, mais tous les
5. Tapez p pour coller le texte. Puis tapez : un second <Échap> .
6. Utilisez le mode Visuel pour sélectionner "élément", copiez le avec y ,
déplacez vous à la fin de la ligne suivant avec j$ et collez le texte
déplacez-vous à la fin de la ligne suivant avec j$ et collez le texte
à cet endroit avec p .
---> a) ceci est le premier élément.
@@ -1012,8 +1012,8 @@ NOTE : Le complètement fonctionne pour de nombreuses commandes. Essayez
Ceci conclut le Tutoriel Vim. Le but était de vous donner un bref aperçu de
l'éditeur Vim, juste assez pour vous permettre d'utiliser l'éditeur
relativement facilement. Il est loin d'être complet, vu que Vim a beaucoup
beaucoup plus de commandes. Un Manuel de l'utilisateur est disponible en
anglais : :help user-manual .
plus de commandes. Un Manuel de l'utilisateur est disponible en anglais :
:help user-manual
Pour continuer à découvrir et à apprendre Vim, il existe un livre traduit en
français. Il parle plus de Vi que de Vim, mais pourra vous être utile.
@@ -1030,9 +1030,9 @@ NOTE : Le complètement fonctionne pour de nombreuses commandes. Essayez
Université d'État du Colorado. E-mail : bware@mines.colorado.edu.
Modifié pour Vim par Bram Moolenar.
Traduit en Français par Adrien Beau, en avril 2001.
Traduit en français par Adrien Beau, en avril 2001.
Dernières mises à jour par Dominique Pellé.
E-mail : dominique.pelle@gmail.com
Last Change : 2010 May 23
Last Change : 2011 Jun 25
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+17 -2
View File
@@ -586,8 +586,23 @@ STDMETHODIMP CShellExt::QueryContextMenu(HMENU hMenu,
// Initialize m_cntOfHWnd to 0
m_cntOfHWnd = 0;
// Retrieve all the vim instances
EnumWindows(EnumWindowsProc, (LPARAM)this);
HKEY keyhandle;
bool showExisting = true;
// Check whether "Edit with existing Vim" entries are disabled.
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\Vim\\Gvim", 0,
KEY_READ, &keyhandle) == ERROR_SUCCESS)
{
if (RegQueryValueEx(keyhandle, "DisableEditWithExisting", 0, NULL,
NULL, NULL) == ERROR_SUCCESS)
showExisting = false;
RegCloseKey(keyhandle);
}
// Retrieve all the vim instances, unless disabled.
if (showExisting)
EnumWindows(EnumWindowsProc, (LPARAM)this);
if (cbFiles > 1)
{
+64 -5
View File
@@ -11,9 +11,9 @@ The file "feature.h" can be edited to match your preferences. You can skip
this, then you will get the default behavior as is documented, which should
be fine for most people.
With the exception of the last two sections (Windows 3.1 and MS-DOS),
this document assumes that you are building Vim for Win32
(Windows NT/2000/XP/2003/Vista and Windows 95/98/Me)
With the exception of two sections (Windows 3.1 and MS-DOS), this document
assumes that you are building Vim for Win32 or later.
(Windows 95/98/Me/NT/2000/XP/2003/Vista/7)
Contents:
@@ -27,6 +27,9 @@ Contents:
8. Windows 3.1
9. MS-DOS
10. Installing after building from sources
The currently preferred method is using the free Visual C++ Toolkit 2008
|msvc-2008-express|, the produced binary runs on most MS-Windows systems. If
you need the executable to run on Windows 98 or ME, use the 2003 one
@@ -407,5 +410,61 @@ Windows exe (GUI or console mode), or a 16-bit MS-DOS version.
NOTE: multi-byte support is broken in the Borland libraries, not everything
will work properly! Esp. handling multi-byte file names.
If you get all kinds of strange error messages when compiling, try adding
changing the file format from "unix" to "dos".
If you get all kinds of strange error messages when compiling, try changing
the file format from "unix" to "dos".
10. Installing after building from sources
==========================================
[provided by Michael Soyka]
After you've built the Vim binaries as described above, you're ready to
install Vim on your system. However, if you've obtained the Vim sources
using Mercurial or by downloading them as a unix tar file, you must first
create a "vim73" directory. If you instead downloaded the sources as
zip files, you can skip this setup as the zip archives already have the
correct directory structure.
A. Create a Vim "runtime" subdirectory named "vim73"
-----------------------------------------------------
If you obtained your Vim sources as zip files, you can skip this step.
Otherwise, continue reading.
Go to the directory that contains the Vim "src" and "runtime"
directories and create a new subdirectory named "vim73".
Copy the "runtime" files into "vim73":
copy runtime\* vim73
B. Copy the new binaries into the "vim73" directory
----------------------------------------------------
Regardless of how you installed the Vim sources, you need to copy the
new binaries you created above into "vim73":
copy src\*.exe vim73
copy src\GvimExt\gvimext.dll vim73
copy src\xxd\xxd.exe vim73
C. Move the "vim73" directory into the Vim installation subdirectory
---------------------------------------------------------------------
Move the "vim73" subdirectory into the subdirectory where you want Vim
to be installed. Typically, this subdirectory will be named "vim".
If you already have a "vim73" subdirectory in "vim", delete it first
by running its uninstal.exe program.
D. Install Vim
---------------
"cd" to your Vim installation subdirectory "vim\vim73" and run the
"install.exe" program. It will ask you a number of questions about
how you would like to have your Vim setup. Among these are:
- You can tell it to write a "_vimrc" file with your preferences in the
parent directory.
- It can also install an "Edit with Vim" entry in the Windows Explorer
popup menu.
- You can have it create batch files, so that you can run Vim from the
console or in a shell. You can select one of the directories in your
PATH or add the directory to PATH using the Windows Control Panel.
- Create entries for Vim on the desktop and in the Start menu.
Happy Vimming!
+1 -1
View File
@@ -1232,7 +1232,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>58</string>
<string>61</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
+41 -4
View File
@@ -223,6 +223,7 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
[NSNumber numberWithBool:YES], MMUseInlineImKey,
#endif // INCLUDE_OLD_IM_CODE
[NSNumber numberWithBool:NO], MMSuppressTerminationAlertKey,
[NSNumber numberWithBool:YES], MMNativeFullScreenKey,
nil];
[[NSUserDefaults standardUserDefaults] registerDefaults:dict];
@@ -241,6 +242,12 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
{
if (!(self = [super init])) return nil;
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
// Disable automatic relaunching
if ([NSApp respondsToSelector:@selector(disableRelaunchOnLogin)])
[NSApp disableRelaunchOnLogin];
#endif
vimControllers = [NSMutableArray new];
cachedVimControllers = [NSMutableArray new];
preloadPid = -1;
@@ -1065,10 +1072,40 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
NSOpenPanel *panel = [NSOpenPanel openPanel];
[panel setAllowsMultipleSelection:YES];
[panel setAccessoryView:showHiddenFilesView()];
#if (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6)
// NOTE: -[NSOpenPanel runModalForDirectory:file:types:] is deprecated on
// 10.7 but -[NSOpenPanel setDirectoryURL:] requires 10.6 so jump through
// the following hoops on 10.6+.
dir = [dir stringByExpandingTildeInPath];
if (dir) {
NSURL *dirURL = [NSURL fileURLWithPath:dir isDirectory:YES];
if (dirURL)
[panel setDirectoryURL:dirURL];
}
int result = [panel runModalForDirectory:dir file:nil types:nil];
if (NSOKButton == result)
[self application:NSApp openFiles:[panel filenames]];
NSInteger result = [panel runModal];
#else
NSInteger result = [panel runModalForDirectory:dir file:nil types:nil];
#endif
if (NSOKButton == result) {
// NOTE: -[NSOpenPanel filenames] is deprecated on 10.7 so use
// -[NSOpenPanel URLs] instead. The downside is that we have to check
// that each URL is really a path first.
NSMutableArray *filenames = [NSMutableArray array];
NSArray *urls = [panel URLs];
NSUInteger i, count = [urls count];
for (i = 0; i < count; ++i) {
NSURL *url = [urls objectAtIndex:i];
if ([url isFileURL]) {
NSString *path = [url path];
if (path)
[filenames addObject:path];
}
}
if ([filenames count] > 0)
[self application:NSApp openFiles:filenames];
}
}
- (IBAction)selectNextWindow:(id)sender
@@ -1410,7 +1447,7 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
// 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
// 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
+3 -3
View File
@@ -131,9 +131,9 @@ extern NSTimeInterval MMBalloonEvalInternalDelay;
- (int)lookupColorWithKey:(NSString *)key;
- (BOOL)hasSpecialKeyWithValue:(char_u *)value;
- (void)enterFullscreen:(int)fuoptions background:(int)bg;
- (void)leaveFullscreen;
- (void)setFullscreenBackgroundColor:(int)color;
- (void)enterFullScreen:(int)fuoptions background:(int)bg;
- (void)leaveFullScreen;
- (void)setFullScreenBackgroundColor:(int)color;
- (void)setAntialias:(BOOL)antialias;
+7 -6
View File
@@ -1150,27 +1150,27 @@ extern GuiFont gui_mch_retain_font(GuiFont font);
return NO;
}
- (void)enterFullscreen:(int)fuoptions background:(int)bg
- (void)enterFullScreen:(int)fuoptions background:(int)bg
{
NSMutableData *data = [NSMutableData data];
[data appendBytes:&fuoptions length:sizeof(int)];
bg = MM_COLOR(bg);
[data appendBytes:&bg length:sizeof(int)];
[self queueMessage:EnterFullscreenMsgID data:data];
[self queueMessage:EnterFullScreenMsgID data:data];
}
- (void)leaveFullscreen
- (void)leaveFullScreen
{
[self queueMessage:LeaveFullscreenMsgID data:nil];
[self queueMessage:LeaveFullScreenMsgID data:nil];
}
- (void)setFullscreenBackgroundColor:(int)color
- (void)setFullScreenBackgroundColor:(int)color
{
NSMutableData *data = [NSMutableData data];
color = MM_COLOR(color);
[data appendBytes:&color length:sizeof(int)];
[self queueMessage:SetFullscreenColorMsgID data:data];
[self queueMessage:SetFullScreenColorMsgID data:data];
}
- (void)setAntialias:(BOOL)antialias
@@ -1819,6 +1819,7 @@ static void netbeansReadCallback(CFSocketRef s,
[NSNumber numberWithInt:p_mh], @"p_mh",
[NSNumber numberWithBool:mmta], @"p_mmta",
[NSNumber numberWithInt:numTabs], @"numTabs",
[NSNumber numberWithInt:fuoptions_flags], @"fullScreenOptions",
nil];
// Put the state before all other messages.
@@ -14,7 +14,7 @@
@class MMVimView;
@interface MMFullscreenWindow : NSWindow {
@interface MMFullScreenWindow : NSWindow {
NSWindow *target;
MMVimView *view;
NSPoint oldPosition;
@@ -22,7 +22,7 @@
int options;
int state;
// These are only valid in fullscreen mode and store pre-fu vim size
// These are only valid in full-screen mode and store pre-fu vim size
int nonFuRows, nonFuColumns;
// These store the size vim had right after entering fu mode
@@ -32,14 +32,15 @@
int startFuFlags;
}
- (MMFullscreenWindow *)initWithWindow:(NSWindow *)t view:(MMVimView *)v
- (MMFullScreenWindow *)initWithWindow:(NSWindow *)t view:(MMVimView *)v
backgroundColor:(NSColor *)back;
- (void)setOptions:(int)opt;
- (void)enterFullscreen;
- (void)leaveFullscreen;
- (void)enterFullScreen;
- (void)leaveFullScreen;
- (void)centerView;
- (BOOL)canBecomeKeyWindow;
- (BOOL)canBecomeMainWindow;
- (void)applicationDidChangeScreenParameters:(NSNotification *)notification;
@end
@@ -8,7 +8,7 @@
* See README.txt for an overview of the Vim source code.
*/
/*
* MMFullscreenWindow
* MMFullScreenWindow
*
* A window without any decorations which covers an entire screen.
*
@@ -23,7 +23,7 @@
* Author: Nico Weber
*/
#import "MMFullscreenWindow.h"
#import "MMFullScreenWindow.h"
#import "MMTextView.h"
#import "MMVimController.h"
#import "MMVimView.h"
@@ -45,18 +45,17 @@ enum {
};
@interface MMFullscreenWindow (Private)
@interface MMFullScreenWindow (Private)
- (BOOL)isOnPrimaryScreen;
- (void)windowDidBecomeMain:(NSNotification *)notification;
- (void)windowDidResignMain:(NSNotification *)notification;
- (void)windowDidMove:(NSNotification *)notification;
- (void)applicationDidChangeScreenParameters:(NSNotification *)notification;
- (void)resizeVimView;
@end
@implementation MMFullscreenWindow
@implementation MMFullScreenWindow
- (MMFullscreenWindow *)initWithWindow:(NSWindow *)t view:(MMVimView *)v
- (MMFullScreenWindow *)initWithWindow:(NSWindow *)t view:(MMVimView *)v
backgroundColor:(NSColor *)back
{
NSScreen* screen = [t screen];
@@ -103,11 +102,6 @@ enum {
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];
@@ -131,9 +125,9 @@ enum {
options = opt;
}
- (void)enterFullscreen
- (void)enterFullScreen
{
ASLogDebug(@"Enter full screen now");
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:).
@@ -186,18 +180,18 @@ enum {
// focus gained message
[self setDelegate:delegate];
// Store view dimension used before entering full screen, then resize the
// 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.
// Store options used when entering full-screen so that we can restore
// dimensions when exiting full-screen.
startFuFlags = options;
#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
// 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];
@@ -223,7 +217,7 @@ enum {
state = InFullScreen;
}
- (void)leaveFullscreen
- (void)leaveFullScreen
{
// fade to black
Boolean didBlend = NO;
@@ -272,10 +266,10 @@ enum {
id delegate = [self delegate];
[self setDelegate:nil];
// move text view back to original window, hide fullscreen window,
// move text view back to original window, hide fullScreen window,
// show original window
// do this _after_ resetting delegate and window controller, so the
// window controller doesn't get a focus lost message from the fullscreen
// window controller doesn't get a focus lost message from the fullScreen
// window.
[view removeFromSuperviewWithoutNeedingDisplay];
[[target contentView] addSubview:view];
@@ -290,15 +284,30 @@ enum {
#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
// 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
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
// HACK! On Mac OS X 10.7 windows animate when makeKeyAndOrderFront: is
// called. This is distracting here, so disable the animation and restore
// animation behavior after calling makeKeyAndOrderFront:.
NSWindowAnimationBehavior a = NSWindowAnimationBehaviorNone;
if ([target respondsToSelector:@selector(animationBehavior)]) {
a = [target animationBehavior];
[target setAnimationBehavior:NSWindowAnimationBehaviorNone];
}
#endif
[target makeKeyAndOrderFront:self];
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
// HACK! Restore animation behavior.
if (NSWindowAnimationBehaviorNone != a)
[target setAnimationBehavior:a];
#endif
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
// Restore collection behavior (see hack above).
[target setCollectionBehavior:wcb];
@@ -318,7 +327,7 @@ enum {
[self autorelease]; // Balance the above retain
state = LeftFullScreen;
ASLogDebug(@"Left full screen");
ASLogDebug(@"Left full-screen");
}
// Title-less windows normally don't receive key presses, override this
@@ -328,12 +337,40 @@ enum {
}
// Title-less windows normally can't become main which means that another
// non-fullscreen window will have the "active" titlebar in expose. Bad, fix it.
// non-full-screen window will have the "active" titlebar in expose. Bad, fix
// it.
- (BOOL)canBecomeMainWindow
{
return YES;
}
- (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)centerView
{
NSRect outer = [self frame], inner = [view frame];
@@ -370,12 +407,12 @@ enum {
return YES;
}
@end // MMFullscreenWindow
@end // MMFullScreenWindow
@implementation MMFullscreenWindow (Private)
@implementation MMFullScreenWindow (Private)
- (BOOL)isOnPrimaryScreen
{
@@ -393,13 +430,13 @@ enum {
{
// Hide menu and dock, both appear on demand.
//
// Another way to deal with several fullscreen windows would be to hide/
// reveal the dock only when the first fullscreen window is created and
// Another way to deal with several full-screen windows would be to hide/
// reveal the dock only when the first full-screen window is created and
// show it again after the last one has been closed, but toggling on each
// focus gain/loss works better with Spaces. The downside is that the
// menu bar flashes shortly when switching between two fullscreen windows.
// menu bar flashes shortly when switching between two full-screen windows.
// XXX: If you have a fullscreen window on a secondary monitor and unplug
// XXX: If you have a full-screen window on a secondary monitor and unplug
// the monitor, this will probably not work right.
if ([self isOnPrimaryScreen]) {
@@ -421,41 +458,14 @@ enum {
return;
// Window may move as a result of being dragged between Spaces.
ASLogDebug(@"Full screen window moved, ensuring it covers the screen...");
ASLogDebug(@"Full-screen window moved, ensuring it covers the screen...");
// Ensure the full screen window is still covering the entire screen and
// 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
@@ -503,9 +513,9 @@ enum {
}
// 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
// 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;
@@ -513,4 +523,4 @@ enum {
[self centerView];
}
@end // MMFullscreenWindow (Private)
@end // MMFullScreenWindow (Private)
+2 -2
View File
@@ -809,12 +809,12 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
#endif
imControl = enable;
ASLogInfo(@"IM control %sabled", enable ? "en" : "dis");
ASLogDebug(@"IM control %sabled", enable ? "en" : "dis");
}
- (void)activateIm:(BOOL)enable
{
ASLogInfo(@"Activate IM=%d", enable);
ASLogDebug(@"Activate IM=%d", enable);
// HACK: If there is marked text when switching IM it will be inserted as
// normal text. To avoid this we abandon the marked text before switching.
+3
View File
@@ -27,8 +27,11 @@
id backendProxy;
NSMenu *mainMenu;
NSMutableArray *popupMenuItems;
// TODO: Move all toolbar code to window controller?
NSToolbar *toolbar;
NSMutableDictionary *toolbarItemDict;
int pid;
NSString *serverName;
NSDictionary *vimState;
+46 -9
View File
@@ -34,6 +34,7 @@
#import "MMWindowController.h"
#import "Miscellaneous.h"
#import "MMCoreTextView.h"
#import "MMWindow.h"
static NSString *MMDefaultToolbarImageName = @"Attention";
@@ -765,15 +766,15 @@ static BOOL isUnsafeMessage(int msgid);
encoding:NSUTF8StringEncoding];
[self setServerName:name];
[name release];
} else if (EnterFullscreenMsgID == msgid) {
} else if (EnterFullScreenMsgID == msgid) {
const void *bytes = [data bytes];
int fuoptions = *((int*)bytes); bytes += sizeof(int);
int bg = *((int*)bytes);
NSColor *back = [NSColor colorWithArgbInt:bg];
[windowController enterFullscreen:fuoptions backgroundColor:back];
} else if (LeaveFullscreenMsgID == msgid) {
[windowController leaveFullscreen];
[windowController enterFullScreen:fuoptions backgroundColor:back];
} else if (LeaveFullScreenMsgID == msgid) {
[windowController leaveFullScreen];
} else if (SetBuffersModifiedMsgID == msgid) {
const void *bytes = [data bytes];
// state < 0 <-> some buffer modified
@@ -805,11 +806,11 @@ static BOOL isUnsafeMessage(int msgid);
}
} else if (CloseWindowMsgID == msgid) {
[self scheduleClose];
} else if (SetFullscreenColorMsgID == msgid) {
} else if (SetFullScreenColorMsgID == msgid) {
const int *bg = (const int*)[data bytes];
NSColor *color = [NSColor colorWithRgbInt:*bg];
[windowController setFullscreenBackgroundColor:color];
[windowController setFullScreenBackgroundColor:color];
} else if (ShowFindReplaceDialogMsgID == msgid) {
NSDictionary *dict = [NSDictionary dictionaryWithData:data];
if (dict) {
@@ -886,7 +887,12 @@ static BOOL isUnsafeMessage(int msgid);
- (void)savePanelDidEnd:(NSSavePanel *)panel code:(int)code
context:(void *)context
{
NSString *path = (code == NSOKButton) ? [panel filename] : nil;
NSString *path = nil;
if (code == NSOKButton) {
NSURL *url = [panel URL];
if ([url isFileURL])
path = [url path];
}
ASLogDebug(@"Open/save panel path=%@", path);
// NOTE! This causes the sheet animation to run its course BEFORE the rest
@@ -1378,6 +1384,12 @@ static BOOL isUnsafeMessage(int msgid);
dir = [vimState objectForKey:@"pwd"];
}
#if (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6)
// 10.6+ APIs uses URLs instead of paths
dir = [dir stringByExpandingTildeInPath];
NSURL *dirURL = dir ? [NSURL fileURLWithPath:dir isDirectory:YES] : nil;
#endif
if (saving) {
NSSavePanel *panel = [NSSavePanel savePanel];
@@ -1387,22 +1399,47 @@ static BOOL isUnsafeMessage(int msgid);
[panel setDelegate:self];
if ([panel isExpanded])
[panel setAccessoryView:showHiddenFilesView()];
#if (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6)
// NOTE: -[NSSavePanel beginSheetForDirectory::::::] is deprecated on
// 10.6 but -[NSSavePanel setDirectoryURL:] requires 10.6 so jump
// through the following hoops on 10.6+.
if (dirURL)
[panel setDirectoryURL:dirURL];
[panel beginSheetModalForWindow:[windowController window]
completionHandler:^(NSInteger result) {
[self savePanelDidEnd:panel code:result context:nil];
}];
#else
[panel beginSheetForDirectory:dir file:nil
modalForWindow:[windowController window]
modalDelegate:self
didEndSelector:@selector(savePanelDidEnd:code:context:)
contextInfo:NULL];
#endif
} else {
NSOpenPanel *panel = [NSOpenPanel openPanel];
[panel setAllowsMultipleSelection:NO];
[panel setAccessoryView:showHiddenFilesView()];
#if (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6)
// NOTE: -[NSOpenPanel beginSheetForDirectory:::::::] is deprecated on
// 10.6 but -[NSOpenPanel setDirectoryURL:] requires 10.6 so jump
// through the following hoops on 10.6+.
if (dirURL)
[panel setDirectoryURL:dirURL];
[panel beginSheetModalForWindow:[windowController window]
completionHandler:^(NSInteger result) {
[self savePanelDidEnd:panel code:result context:nil];
}];
#else
[panel beginSheetForDirectory:dir file:nil types:nil
modalForWindow:[windowController window]
modalDelegate:self
didEndSelector:@selector(savePanelDidEnd:code:context:)
contextInfo:NULL];
#endif
}
}
@@ -1593,8 +1630,8 @@ isUnsafeMessage(int msgid)
ExecuteActionMsgID, // Impossible to predict
ShowPopupMenuMsgID, // Enters modal loop
ActivateMsgID, // ?
EnterFullscreenMsgID, // Modifies delegate of window controller
LeaveFullscreenMsgID, // Modifies delegate of window controller
EnterFullScreenMsgID, // Modifies delegate of window controller
LeaveFullScreenMsgID, // Modifies delegate of window controller
CloseWindowMsgID, // See note below
BrowseForFileMsgID, // Enters modal loop
ShowDialogMsgID, // Enters modal loop
+3
View File
@@ -29,4 +29,7 @@
- (void)setContentMaxSize:(NSSize)size;
- (void)setContentSize:(NSSize)size;
- (IBAction)toggleFullScreen:(id)sender;
- (IBAction)realToggleFullScreen:(id)sender;
@end
+20
View File
@@ -152,4 +152,24 @@
[[self delegate] performSelector:@selector(zoom:) withObject:sender];
}
- (IBAction)toggleFullScreen:(id)sender
{
// HACK! This is an NSWindow method used to enter full-screen on OS X 10.7.
// We override it so that we can interrupt and pass this on to Vim first.
// An alternative hack would be to reroute the action message sent by the
// full-screen button in the top right corner of a window, but there could
// be other places where this action message is sent from.
// To get to the original method (and enter Lion full-screen) we need to
// call realToggleFullScreen: defined below.
// (Use performSelector:: to avoid compilation warning.)
[[self delegate] performSelector:@selector(invFullScreen:) withObject:nil];
}
- (IBAction)realToggleFullScreen:(id)sender
{
// HACK! See toggleFullScreen: comment above.
[super toggleFullScreen:sender];
}
@end // MMWindow
+11 -6
View File
@@ -13,7 +13,7 @@
@class MMWindow;
@class MMFullscreenWindow;
@class MMFullScreenWindow;
@class MMVimController;
@class MMVimView;
@@ -31,15 +31,19 @@
BOOL shouldRestoreUserTopLeft;
int updateToolbarFlag;
BOOL keepOnScreen;
BOOL fullscreenEnabled;
NSString *windowAutosaveKey;
MMFullscreenWindow *fullscreenWindow;
BOOL fullScreenEnabled;
MMFullScreenWindow *fullScreenWindow;
int fullScreenOptions;
BOOL delayEnterFullScreen;
NSRect preFullScreenFrame;
MMWindow *decoratedWindow;
NSString *lastSetTitle;
int userRows;
int userCols;
NSPoint userTopLeft;
NSPoint defaultTopLeft;
NSToolbar *toolbar;
}
- (id)initWithVimController:(MMVimController *)controller;
@@ -75,9 +79,10 @@
- (void)liveResizeWillStart;
- (void)liveResizeDidEnd;
- (void)enterFullscreen:(int)fuoptions backgroundColor:(NSColor *)back;
- (void)leaveFullscreen;
- (void)setFullscreenBackgroundColor:(NSColor *)back;
- (void)enterFullScreen:(int)fuoptions backgroundColor:(NSColor *)back;
- (void)leaveFullScreen;
- (void)setFullScreenBackgroundColor:(NSColor *)back;
- (void)invFullScreen:(id)sender;
- (void)setBufferModified:(BOOL)mod;
- (void)setTopLeft:(NSPoint)pt;
+388 -72
View File
@@ -44,7 +44,7 @@
* YES & YES => NO
*
*
* Resizing in full-screen mode:
* Resizing in custom full-screen mode:
*
* The window never resizes since it fills the screen, however the vim view may
* change size, e.g. when the user types ":set lines=60", or when a scrollbar
@@ -52,13 +52,19 @@
*
* It is ensured that the vim view never becomes larger than the screen size
* and that it always stays in the center of the screen.
*
*
* Resizing in native full-screen mode (Mac OS X 10.7+):
*
* The window is always kept centered and resizing works more or less the same
* way as in windowed mode.
*
*/
#import "MMAppController.h"
#import "MMAtsuiTextView.h"
#import "MMFindReplaceController.h"
#import "MMFullscreenWindow.h"
#import "MMFullScreenWindow.h"
#import "MMTextView.h"
#import "MMTypesetter.h"
#import "MMVimController.h"
@@ -69,6 +75,12 @@
#import <PSMTabBarControl/PSMTabBarControl.h>
// These have to be the same as in option.h
#define FUOPT_MAXVERT 0x001
#define FUOPT_MAXHORZ 0x002
#define FUOPT_BGCOLOR_HLGROUP 0x004
@interface MMWindowController (Private)
- (NSSize)contentSize;
@@ -82,6 +94,9 @@
- (void)hideTablineSeparator:(BOOL)hide;
- (void)doFindNext:(BOOL)next;
- (void)updateToolbar;
- (void)maximizeWindow:(int)options;
- (void)applicationDidChangeScreenParameters:(NSNotification *)notification;
- (void)enterNativeFullScreen;
@end
@@ -181,6 +196,24 @@
if ([win respondsToSelector:@selector(_setContentHasShadow:)])
[win _setContentHasShadow:NO];
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
// Building on Mac OS X 10.7 or greater.
// This puts the full-screen button in the top right of each window
if ([win respondsToSelector:@selector(setCollectionBehavior:)])
[win setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
// This makes windows animate when opened
if ([win respondsToSelector:@selector(setAnimationBehavior:)])
[win setAnimationBehavior:NSWindowAnimationBehaviorDocumentWindow];
#endif
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(applicationDidChangeScreenParameters:)
name:NSApplicationDidChangeScreenParametersNotification
object:NSApp];
return self;
}
@@ -191,6 +224,7 @@
[decoratedWindow release]; decoratedWindow = nil;
[windowAutosaveKey release]; windowAutosaveKey = nil;
[vimView release]; vimView = nil;
[toolbar release]; toolbar = nil;
[super dealloc];
}
@@ -226,16 +260,20 @@
- (void)cleanup
{
ASLogDebug(@"%@ %s", [self className], _cmd);
ASLogDebug(@"");
if (fullscreenEnabled) {
// If we are closed while still in fullscreen, end fullscreen mode,
// NOTE: Must set this before possibly leaving full-screen.
setupDone = NO;
[[NSNotificationCenter defaultCenter] removeObserver:self];
if (fullScreenEnabled) {
// If we are closed while still in full-screen, end full-screen mode,
// release ourselves (because this won't happen in MMWindowController)
// and perform close operation on the original window.
[self leaveFullscreen];
[self leaveFullScreen];
}
setupDone = NO;
vimController = nil;
[vimView removeFromSuperviewWithoutNeedingDisplay];
@@ -277,17 +315,32 @@
[self updateResizeConstraints];
[self resizeWindowToFitContentSize:[vimView desiredSize]
keepOnScreen:YES];
[[self window] makeKeyAndOrderFront:self];
[decoratedWindow makeKeyAndOrderFront:self];
// HACK! Calling makeKeyAndOrderFront: may cause Cocoa to force the window
// into native full-screen mode (this happens e.g. if a new window is
// opened when MacVim is already in full-screen). In this case we don't
// want the decorated window to pop up before the animation into
// full-screen, so set its alpha to 0.
if (fullScreenEnabled && !fullScreenWindow)
[decoratedWindow setAlphaValue:0];
// Flag that the window is now placed on screen. From now on it is OK for
// code to depend on the screen state. (Such as constraining views etc.)
windowPresented = YES;
if (fullscreenWindow) {
// Delayed entering of full screen happens here (a ":set fu" in a
if (fullScreenWindow) {
// Delayed entering of full-screen happens here (a ":set fu" in a
// GUIEnter auto command could cause this).
[fullscreenWindow enterFullscreen];
fullscreenEnabled = YES;
[fullScreenWindow enterFullScreen];
fullScreenEnabled = YES;
} else if (delayEnterFullScreen) {
// Set alpha to zero so that the decorated window doesn't pop up
// before we enter full-screen.
[decoratedWindow setAlphaValue:0];
[self enterNativeFullScreen];
}
return YES;
@@ -352,12 +405,12 @@
return;
[decoratedWindow setTitle:title];
if (fullscreenEnabled) {
[fullscreenWindow setTitle:title];
if (fullScreenWindow) {
[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];
[NSApp changeWindowsItem:fullScreenWindow title:title filename:NO];
}
}
@@ -372,12 +425,17 @@
filename = @"";
[decoratedWindow setRepresentedFilename:filename];
[fullscreenWindow setRepresentedFilename:filename];
[fullScreenWindow setRepresentedFilename:filename];
}
- (void)setToolbar:(NSToolbar *)toolbar
- (void)setToolbar:(NSToolbar *)theToolbar
{
// The full-screen window has no toolbar.
if (theToolbar != toolbar) {
[toolbar release];
toolbar = [theToolbar retain];
}
// NOTE: Toolbar must be set here or it won't work to show it later.
[decoratedWindow setToolbar:toolbar];
// HACK! Redirect the pill button so that we can ask Vim to hide the
@@ -429,8 +487,8 @@
// flag on the window here (should be faster if the window is opaque).
BOOL isOpaque = [back alphaComponent] == 1.0f;
[decoratedWindow setOpaque:isOpaque];
if (fullscreenEnabled)
[fullscreenWindow setOpaque:isOpaque];
if (fullScreenWindow)
[fullScreenWindow setOpaque:isOpaque];
[vimView setDefaultColorsBackground:back foreground:fore];
}
@@ -477,25 +535,26 @@
toSize:contentSize];
[vimView setFrameSize:contentSize];
if (fullscreenEnabled) {
// NOTE! Don't mark the fullscreen content view as needing an
if (fullScreenWindow) {
// NOTE! Don't mark the full-screen content view as needing an
// update unless absolutely necessary since when it is updated the
// entire screen is cleared. This may cause some parts of the Vim
// view to be cleared but not redrawn since Vim does not realize
// that we've erased part of the view.
if (!NSEqualSizes(originalSize, contentSize)) {
[[fullscreenWindow contentView] setNeedsDisplay:YES];
[fullscreenWindow centerView];
[[fullScreenWindow contentView] setNeedsDisplay:YES];
[fullScreenWindow centerView];
}
} else {
[self resizeWindowToFitContentSize:contentSize
keepOnScreen:keepOnScreen];
if (windowAutosaveKey && rows > 0 && cols > 0) {
if (!fullScreenEnabled && windowAutosaveKey && rows > 0 &&
cols > 0) {
// Autosave rows and columns now that they should have been
// constrained to fit on screen. We only do this for the
// window which also autosaves window position and we avoid
// autosaving when in fullscreen since the rows usually won't
// autosaving when in full-screen since the rows usually won't
// fit when in windowed mode.
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
[ud setInteger:rows forKey:MMAutosaveRowsKey];
@@ -515,10 +574,9 @@
// Showing the tabline may result in the tabline separator being hidden or
// shown; this does not apply to full-screen mode.
if (!on) {
NSToolbar *toolbar = [decoratedWindow toolbar];
if (([decoratedWindow styleMask] & NSTexturedBackgroundWindowMask)
== 0) {
[self hideTablineSeparator:![toolbar isVisible]];
[self hideTablineSeparator:![decoratedWindow toolbar]];
} else {
[self hideTablineSeparator:NO];
}
@@ -534,7 +592,6 @@
- (void)showToolbar:(BOOL)on size:(int)size mode:(int)mode
{
NSToolbar *toolbar = [decoratedWindow toolbar];
if (!toolbar) return;
[toolbar setSizeMode:size];
@@ -633,58 +690,95 @@
}
}
- (void)enterFullscreen:(int)fuoptions backgroundColor:(NSColor *)back
- (void)enterFullScreen:(int)fuoptions backgroundColor:(NSColor *)back
{
if (fullscreenEnabled) return;
if (fullScreenEnabled) return;
// fullscreenWindow could be nil here if this is called multiple times
// during startup.
[fullscreenWindow release];
BOOL useNativeFullScreen = [[NSUserDefaults standardUserDefaults]
boolForKey:MMNativeFullScreenKey];
// Make sure user is not trying to use native full-screen on systems that
// do not support it.
if (![NSWindow instancesRespondToSelector:@selector(toggleFullScreen:)])
useNativeFullScreen = NO;
fullscreenWindow = [[MMFullscreenWindow alloc]
initWithWindow:decoratedWindow view:vimView backgroundColor:back];
[fullscreenWindow setOptions:fuoptions];
[fullscreenWindow setRepresentedFilename:
[decoratedWindow representedFilename]];
// NOTE: Do not enter full screen until the window has been presented since
// we don't actually know which screen to use before then.
if (windowPresented) {
[fullscreenWindow enterFullscreen];
fullscreenEnabled = YES;
// The resize handle disappears so the vim view needs to update the
// scrollbars.
shouldResizeVimView = YES;
if (useNativeFullScreen) {
// Enter native full-screen mode. Only supported on Mac OS X 10.7+.
fullScreenOptions = fuoptions;
if (windowPresented) {
[self enterNativeFullScreen];
} else {
delayEnterFullScreen = YES;
}
} else {
ASLogDebug(@"Delay enter full screen");
// Enter custom full-screen mode. Always supported.
ASLogInfo(@"Enter custom full-screen");
// fullScreenWindow could be non-nil here if this is called multiple
// times during startup.
[fullScreenWindow release];
fullScreenWindow = [[MMFullScreenWindow alloc]
initWithWindow:decoratedWindow view:vimView backgroundColor:back];
[fullScreenWindow setOptions:fuoptions];
[fullScreenWindow setRepresentedFilename:
[decoratedWindow representedFilename]];
// NOTE: Do not enter full-screen until the window has been presented
// since we don't actually know which screen to use before then. (The
// custom full-screen can appear on any screen, as opposed to native
// full-screen which always uses the main screen.)
if (windowPresented) {
[fullScreenWindow enterFullScreen];
fullScreenEnabled = YES;
// The resize handle disappears so the vim view needs to update the
// scrollbars.
shouldResizeVimView = YES;
}
}
}
- (void)leaveFullscreen
- (void)leaveFullScreen
{
if (!fullscreenEnabled) return;
if (!fullScreenEnabled) return;
fullscreenEnabled = NO;
[fullscreenWindow leaveFullscreen];
[fullscreenWindow release];
fullscreenWindow = nil;
ASLogInfo(@"Exit full-screen");
// The vim view may be too large to fit the screen, so update it.
shouldResizeVimView = YES;
fullScreenEnabled = NO;
if (fullScreenWindow) {
// Using custom full-screen
[fullScreenWindow leaveFullScreen];
[fullScreenWindow release];
fullScreenWindow = nil;
// The vim view may be too large to fit the screen, so update it.
shouldResizeVimView = YES;
} else {
// Using native full-screen
// NOTE: fullScreenEnabled is used to detect if we enter full-screen
// programatically and so must be set before calling
// realToggleFullScreen:.
NSParameterAssert(fullScreenEnabled == NO);
[decoratedWindow realToggleFullScreen:self];
}
}
- (void)setFullscreenBackgroundColor:(NSColor *)back
- (void)setFullScreenBackgroundColor:(NSColor *)back
{
if (fullscreenWindow)
[fullscreenWindow setBackgroundColor:back];
if (fullScreenWindow)
[fullScreenWindow setBackgroundColor:back];
}
- (void)invFullScreen:(id)sender
{
[vimController addVimInput:@"<C-\\><C-N>:set invfu<CR>"];
}
- (void)setBufferModified:(BOOL)mod
{
// NOTE: We only set the document edited flag on the decorated window since
// the full-screen window has no close button anyway. (It also saves us
// from keeping track of the flag in two different places.)
// the custom full-screen window has no close button anyway. (It also
// saves us from keeping track of the flag in two different places.)
[decoratedWindow setDocumentEdited:mod];
}
@@ -855,7 +949,7 @@
if (!setupDone)
return;
if (fullscreenEnabled) {
if (fullScreenEnabled) {
// 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
@@ -884,7 +978,7 @@
- (void)windowDidResize:(id)sender
{
if (!setupDone || fullscreenEnabled) return;
if (!setupDone || fullScreenEnabled) return;
// NOTE: Since we have no control over when the window may resize (Cocoa
// may resize automatically) we simply set the view to fill the entire
@@ -994,6 +1088,146 @@
return NO;
}
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
// -- Full-screen delegate ---------------------------------------------------
- (NSApplicationPresentationOptions)window:(NSWindow *)window
willUseFullScreenPresentationOptions:(NSApplicationPresentationOptions)opt
{
return opt | NSApplicationPresentationAutoHideToolbar;
}
- (NSArray *)customWindowsToEnterFullScreenForWindow:(NSWindow *)window
{
return [NSArray arrayWithObject:decoratedWindow];
}
- (void)window:(NSWindow *)window
startCustomAnimationToEnterFullScreenWithDuration:(NSTimeInterval)duration
{
// Fade out window, remove title bar and maximize, then fade back in.
// (There is a small delay before window is maximized but usually this is
// not noticeable on a relatively modern Mac.)
[NSAnimationContext runAnimationGroup:^(NSAnimationContext *context) {
[context setDuration:0.5*duration];
[[window animator] setAlphaValue:0];
} completionHandler:^{
[window setStyleMask:([window styleMask] | NSFullScreenWindowMask)];
[[vimView tabBarControl] setStyleNamed:@"Unified"];
[self maximizeWindow:fullScreenOptions];
[NSAnimationContext runAnimationGroup:^(NSAnimationContext *context) {
[context setDuration:0.5*duration];
[[window animator] setAlphaValue:1];
} completionHandler:^{
// Do nothing
}];
}];
}
- (void)windowWillEnterFullScreen:(NSNotification *)notification
{
// Store window frame and use it when exiting full-screen.
preFullScreenFrame = [decoratedWindow frame];
// ASSUMPTION: fullScreenEnabled always reflects the state of Vim's 'fu'.
if (!fullScreenEnabled) {
ASLogDebug(@"Full-screen out of sync, tell Vim to set 'fu'");
// NOTE: If we get here it means that Cocoa has somehow entered
// full-screen without us getting to set the 'fu' option first, so Vim
// and the GUI are out of sync. The following code (eventually) gets
// them back into sync. A problem is that the full-screen options have
// not been set, so we have to cache that state and grab it here.
fullScreenOptions = [[vimController objectForVimStateKey:
@"fullScreenOptions"] intValue];
fullScreenEnabled = YES;
[self invFullScreen:self];
}
}
- (void)windowDidFailToEnterFullScreen:(NSWindow *)window
{
// NOTE: This message can be called without
// window:startCustomAnimationToEnterFullScreenWithDuration: ever having
// been called so any state to store before entering full-screen must be
// stored in windowWillEnterFullScreen: which always gets called.
ASLogNotice(@"Failed to ENTER full-screen, restoring window frame...");
fullScreenEnabled = NO;
[window setAlphaValue:1];
[window setStyleMask:([window styleMask] & ~NSFullScreenWindowMask)];
[[vimView tabBarControl] setStyleNamed:@"Metal"];
[window setFrame:preFullScreenFrame display:YES];
}
- (NSArray *)customWindowsToExitFullScreenForWindow:(NSWindow *)window
{
return [NSArray arrayWithObject:decoratedWindow];
}
- (void)window:(NSWindow *)window
startCustomAnimationToExitFullScreenWithDuration:(NSTimeInterval)duration
{
if (!setupDone) {
// HACK! The window has closed but Cocoa still brings it back to life
// and shows a grey box the size of the window unless we explicitly
// hide it by setting its alpha to 0 here.
[window setAlphaValue:0];
return;
}
// Fade out window, add back title bar and restore window frame, then fade
// back in. (There is a small delay before window contents is drawn after
// the window frame is set but usually this is not noticeable on a
// relatively modern Mac.)
[NSAnimationContext runAnimationGroup:^(NSAnimationContext *context) {
[context setDuration:0.5*duration];
[[window animator] setAlphaValue:0];
} completionHandler:^{
[window setStyleMask:([window styleMask] & ~NSFullScreenWindowMask)];
[[vimView tabBarControl] setStyleNamed:@"Metal"];
[window setFrame:preFullScreenFrame display:YES];
[NSAnimationContext runAnimationGroup:^(NSAnimationContext *context) {
[context setDuration:0.5*duration];
[[window animator] setAlphaValue:1];
} completionHandler:^{
// Do nothing
}];
}];
}
- (void)windowWillExitFullScreen:(NSNotification *)notification
{
// ASSUMPTION: fullScreenEnabled always reflects the state of Vim's 'fu'.
if (fullScreenEnabled) {
ASLogDebug(@"Full-screen out of sync, tell Vim to clear 'fu'");
// NOTE: If we get here it means that Cocoa has somehow exited
// full-screen without us getting to clear the 'fu' option first, so
// Vim and the GUI are out of sync. The following code (eventually)
// gets them back into sync.
fullScreenEnabled = NO;
[self invFullScreen:self];
}
}
- (void)windowDidFailToExitFullScreen:(NSWindow *)window
{
// TODO: Is this the correct way to deal with this message? Are we still
// in full-screen at this point?
ASLogNotice(@"Failed to EXIT full-screen, maximizing window...");
fullScreenEnabled = YES;
[window setAlphaValue:1];
[window setStyleMask:([window styleMask] | NSFullScreenWindowMask)];
[[vimView tabBarControl] setStyleNamed:@"Unified"];
[self maximizeWindow:fullScreenOptions];
}
#endif // (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
@end // MMWindowController
@@ -1029,13 +1263,13 @@
shouldRestoreUserTopLeft = NO;
}
if (onScreen && [decoratedWindow screen]) {
NSScreen *screen = [decoratedWindow screen];
if (onScreen && screen) {
// Ensure that the window fits inside the visible part of the screen.
// If there are more than one screen the window will be moved to fit
// entirely in the screen that most of it occupies.
// NOTE: Not called in full-screen mode so use "visibleFrame' instead
// of "frame".
NSRect maxFrame = [[decoratedWindow screen] visibleFrame];
NSRect maxFrame = fullScreenEnabled ? [screen frame]
: [screen visibleFrame];
maxFrame = [self constrainFrame:maxFrame];
if (newFrame.size.width > maxFrame.size.width) {
@@ -1057,6 +1291,15 @@
newFrame.origin.x = NSMaxX(maxFrame) - newFrame.size.width;
}
if (fullScreenEnabled && screen) {
// Keep window centered when in native full-screen.
NSRect screenFrame = [screen frame];
newFrame.origin.y = screenFrame.origin.y +
round(0.5*(screenFrame.size.height - newFrame.size.height));
newFrame.origin.x = screenFrame.origin.x +
round(0.5*(screenFrame.size.width - newFrame.size.width));
}
[decoratedWindow setFrame:newFrame display:YES];
NSPoint oldTopLeft = { frame.origin.x, NSMaxY(frame) };
@@ -1083,7 +1326,7 @@
// NOTE: This may be called in both windowed and full-screen mode. The
// "visibleFrame" method does not overlap menu and dock so should not be
// used in full-screen.
NSRect screenRect = fullscreenEnabled ? [[win screen] frame]
NSRect screenRect = fullScreenEnabled ? [[win screen] frame]
: [[win screen] visibleFrame];
NSRect rect = [win contentRectForFrameRect:screenRect];
@@ -1203,12 +1446,11 @@
- (void)updateToolbar
{
NSToolbar *toolbar = [decoratedWindow toolbar];
if (nil == toolbar || 0 == updateToolbarFlag) return;
// Positive flag shows toolbar, negative hides it.
BOOL on = updateToolbarFlag > 0 ? YES : NO;
[toolbar setVisible:on];
[decoratedWindow setToolbar:(on ? toolbar : nil)];
if (([decoratedWindow styleMask] & NSTexturedBackgroundWindowMask) == 0) {
if (!on) {
@@ -1227,4 +1469,78 @@
updateToolbarFlag = 0;
}
- (void)maximizeWindow:(int)options
{
int currRows, currColumns;
[[vimView textView] getMaxRows:&currRows columns:&currColumns];
// NOTE: Do not use [NSScreen visibleFrame] when determining the screen
// size since it compensates for menu and dock.
int maxRows, maxColumns;
NSSize size = [[NSScreen mainScreen] frame].size;
[vimView constrainRows:&maxRows columns:&maxColumns toSize:size];
ASLogDebug(@"max: %dx%d curr: %dx%d",
maxRows, maxColumns, currRows, currColumns);
// Compute current fu size
int fuRows = currRows, fuColumns = currColumns;
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 vimController];
[vc sendMessage:msgid data:data];
[[vimView textView] setMaxRows:fuRows columns:fuColumns];
}
}
- (void)applicationDidChangeScreenParameters:(NSNotification *)notification
{
if (fullScreenWindow) {
[fullScreenWindow applicationDidChangeScreenParameters:notification];
} else if (fullScreenEnabled) {
ASLogDebug(@"Re-maximizing full-screen window...");
[self maximizeWindow:fullScreenOptions];
}
}
- (void)enterNativeFullScreen
{
if (fullScreenEnabled)
return;
ASLogInfo(@"Enter native full-screen");
fullScreenEnabled = YES;
// NOTE: fullScreenEnabled is used to detect if we enter full-screen
// programatically and so must be set before calling realToggleFullScreen:.
NSParameterAssert(fullScreenEnabled == YES);
[decoratedWindow realToggleFullScreen:self];
}
@end // MMWindowController (Private)
+6 -3
View File
@@ -22,6 +22,9 @@
#ifndef MAC_OS_X_VERSION_10_6
# define MAC_OS_X_VERSION_10_6 1060
#endif
#ifndef MAC_OS_X_VERSION_10_7
# define MAC_OS_X_VERSION_10_7 1070
#endif
//
@@ -156,8 +159,8 @@ enum {
AdjustLinespaceMsgID,
ActivateMsgID,
SetServerNameMsgID,
EnterFullscreenMsgID,
LeaveFullscreenMsgID,
EnterFullScreenMsgID,
LeaveFullScreenMsgID,
SetBuffersModifiedMsgID,
AddInputMsgID,
SetPreEditPositionMsgID,
@@ -169,7 +172,7 @@ enum {
SetDocumentFilenameMsgID,
OpenWithArgumentsMsgID,
CloseWindowMsgID,
SetFullscreenColorMsgID,
SetFullScreenColorMsgID,
ShowFindReplaceDialogMsgID,
FindReplaceMsgID,
ActivateKeyScriptMsgID,
+3 -3
View File
@@ -66,8 +66,8 @@ char *MessageStrings[] =
"AdjustLinespaceMsgID",
"ActivateMsgID",
"SetServerNameMsgID",
"EnterFullscreenMsgID",
"LeaveFullscreenMsgID",
"EnterFullScreenMsgID",
"LeaveFullScreenMsgID",
"SetBuffersModifiedMsgID",
"AddInputMsgID",
"SetPreEditPositionMsgID",
@@ -79,7 +79,7 @@ char *MessageStrings[] =
"SetDocumentFilenameMsgID",
"OpenWithArgumentsMsgID",
"CloseWindowMsgID",
"SetFullscreenColorMsgID",
"SetFullScreenColorMsgID",
"ShowFindReplaceDialogMsgID",
"FindReplaceMsgID",
"ActivateKeyScriptMsgID",
+4 -2
View File
@@ -622,7 +622,7 @@
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 58;
CURRENT_PROJECT_VERSION = 61;
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 = 58;
CURRENT_PROJECT_VERSION = 61;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
@@ -679,6 +679,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
GCC_VERSION = 4.2;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
@@ -691,6 +692,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
GCC_VERSION = 4.2;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
+5
View File
@@ -53,6 +53,7 @@ extern NSString *MMLastWindowClosedBehaviorKey;
extern NSString *MMUseInlineImKey;
#endif // INCLUDE_OLD_IM_CODE
extern NSString *MMSuppressTerminationAlertKey;
extern NSString *MMNativeFullScreenKey;
// Enum for MMUntitledWindowKey
@@ -95,7 +96,11 @@ enum {
@interface NSSavePanel (MMExtras)
- (void)hiddenFilesButtonToggled:(id)sender;
#if (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6)
// This method is a part of a public API as of Mac OS X 10.6. Only use this
// hack for earlier versions of Mac OS X.
- (void)setShowsHiddenFiles:(BOOL)show;
#endif
@end
+6 -1
View File
@@ -45,6 +45,7 @@ NSString *MMLastWindowClosedBehaviorKey = @"MMLastWindowClosedBehavior";
NSString *MMUseInlineImKey = @"MMUseInlineIm";
#endif // INCLUDE_OLD_IM_CODE
NSString *MMSuppressTerminationAlertKey = @"MMSuppressTerminationAlert";
NSString *MMNativeFullScreenKey = @"MMNativeFullScreen";
@@ -99,6 +100,9 @@ NSString *MMSuppressTerminationAlertKey = @"MMSuppressTerminationAlert";
[self setShowsHiddenFiles:[sender intValue]];
}
#if (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6)
// This method is a part of a public API as of Mac OS X 10.6. Only use this
// hack for earlier versions of Mac OS X.
- (void)setShowsHiddenFiles:(BOOL)show
{
// This is undocumented stuff, so be careful. This does the same as
@@ -120,6 +124,7 @@ NSString *MMSuppressTerminationAlertKey = @"MMSuppressTerminationAlert";
[invocation setArgument:&show atIndex:2];
[invocation invoke];
}
#endif
@end // NSSavePanel (MMExtras)
@@ -215,7 +220,7 @@ NSString *MMSuppressTerminationAlertKey = @"MMSuppressTerminationAlert";
- (NSToolbarItem *)itemAtIndex:(NSUInteger)idx
{
NSArray *items = [self items];
if (idx < 0 || idx >= [items count])
if (idx >= [items count])
return nil;
return [items objectAtIndex:idx];
@@ -417,7 +417,11 @@
isa = PBXProject;
buildConfigurationList = C056398B08A954F8003078D8 /* Build configuration list for PBXProject "PSMTabBarControl" */;
compatibilityVersion = "Xcode 2.4";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
en,
);
mainGroup = 0259C574FE90428111CA0C5A /* PSMTabBarControl */;
projectDirPath = "";
projectRoot = "";
@@ -547,6 +551,7 @@
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h";
GCC_VERSION = 4.2;
INFOPLIST_FILE = "PSMTabBarControlFramework-Info.plist";
INSTALL_PATH = "@executable_path/../Frameworks";
ONLY_ACTIVE_ARCH = YES;
@@ -568,6 +573,7 @@
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h";
GCC_VERSION = 4.2;
INFOPLIST_FILE = "PSMTabBarControlFramework-Info.plist";
INSTALL_PATH = "@executable_path/../Frameworks";
ONLY_ACTIVE_ARCH = YES;
@@ -418,6 +418,7 @@
labelPosition += closeButtonSize.width + kPSMTabBarCellPadding;
}
#if 0 // MacVim: disable this code. It is unused and calling 'content' on the represented object's identifier seems dangerous at best.
// icon
if([cell hasIcon]){
NSRect iconRect = [self iconRectForTabCell:cell];
@@ -430,7 +431,8 @@
// scoot label over
labelPosition += iconRect.size.width + kPSMTabBarCellPadding;
}
#endif
// object counter
if([cell count] > 0){
[[NSColor colorWithCalibratedWhite:0.3 alpha:0.45] set];
@@ -451,8 +453,7 @@
counterStringRect.origin.y = myRect.origin.y + ((myRect.size.height - counterStringRect.size.height) / 2.0) + 0.5;
[counterString drawInRect:counterStringRect];
}
// label rect
NSRect labelRect;
labelRect.origin.x = labelPosition;
@@ -402,7 +402,8 @@ void MyNSDrawWindowBackground(NSRect rect)
// scoot label over
labelPosition += closeButtonSize.width + kPSMTabBarCellPadding;
}
#if 0 // MacVim: disable this code. It is unused and calling 'content' on the represented object's identifier seems dangerous at best.
// icon
if([cell hasIcon]){
NSRect iconRect = [self iconRectForTabCell:cell];
@@ -415,7 +416,8 @@ void MyNSDrawWindowBackground(NSRect rect)
// scoot label over
labelPosition += iconRect.size.width + kPSMTabBarCellPadding;
}
#endif
// object counter
if([cell count] > 0){
[[NSColor colorWithCalibratedWhite:0.3 alpha:0.6] set];
@@ -438,7 +440,7 @@ void MyNSDrawWindowBackground(NSRect rect)
counterStringRect.origin.y = myRect.origin.y + ((myRect.size.height - counterStringRect.size.height) / 2.0) + 0.5;
[counterString drawInRect:counterStringRect];
}
// label rect
NSRect labelRect;
labelRect.origin.x = labelPosition;
@@ -407,7 +407,7 @@
[[cell indicator] setHidden:YES];
if([item identifier] != nil){
if([[item identifier] respondsToSelector:@selector(content)]){
if([[[[cell representedObject] identifier] content] respondsToSelector:@selector(isProcessing)]){
if([[[[cell representedObject] identifier] performSelector:@selector(content)] respondsToSelector:@selector(isProcessing)]){
NSMutableDictionary *bindingOptions = [NSMutableDictionary dictionary];
[bindingOptions setObject:NSNegateBooleanTransformerName forKey:@"NSValueTransformerName"];
[[cell indicator] bind:@"animate" toObject:[item identifier] withKeyPath:@"selection.isProcessing" options:nil];
@@ -421,7 +421,7 @@
[cell setHasIcon:NO];
if([item identifier] != nil){
if([[item identifier] respondsToSelector:@selector(content)]){
if([[[[cell representedObject] identifier] content] respondsToSelector:@selector(icon)]){
if([[[[cell representedObject] identifier] performSelector:@selector(content)] respondsToSelector:@selector(icon)]){
NSMutableDictionary *bindingOptions = [NSMutableDictionary dictionary];
[bindingOptions setObject:NSIsNotNilTransformerName forKey:@"NSValueTransformerName"];
[cell bind:@"hasIcon" toObject:[item identifier] withKeyPath:@"selection.icon" options:bindingOptions];
@@ -434,7 +434,7 @@
[cell setCount:0];
if([item identifier] != nil){
if([[item identifier] respondsToSelector:@selector(content)]){
if([[[[cell representedObject] identifier] content] respondsToSelector:@selector(objectCount)]){
if([[[[cell representedObject] identifier] performSelector:@selector(content)] respondsToSelector:@selector(objectCount)]){
[cell bind:@"count" toObject:[item identifier] withKeyPath:@"selection.objectCount" options:nil];
[[item identifier] addObserver:self forKeyPath:@"selection.objectCount" options:0 context:nil];
}
@@ -398,7 +398,8 @@
// scoot label over
labelPosition += closeButtonSize.width + kPSMTabBarCellPadding;
}
#if 0 // MacVim: disable this code. It is unused and calling 'content' on the represented object's identifier seems dangerous at best.
// icon
if([cell hasIcon]){
NSRect iconRect = [self iconRectForTabCell:cell];
@@ -411,7 +412,8 @@
// scoot label over
labelPosition += iconRect.size.width + kPSMTabBarCellPadding;
}
#endif
// object counter
if([cell count] > 0){
[[NSColor colorWithCalibratedWhite:0.3 alpha:0.6] set];
@@ -433,7 +435,7 @@
counterStringRect.origin.y = myRect.origin.y + ((myRect.size.height - counterStringRect.size.height) / 2.0) + 0.5;
[counterString drawInRect:counterStringRect];
}
// label rect
NSRect labelRect;
labelRect.origin.x = labelPosition;
+3 -3
View File
@@ -1675,14 +1675,14 @@ gui_mch_toggle_tearoffs(int enable)
void
gui_mch_enter_fullscreen(int fuoptions_flags, guicolor_T bg)
{
[[MMBackend sharedInstance] enterFullscreen:fuoptions_flags background:bg];
[[MMBackend sharedInstance] enterFullScreen:fuoptions_flags background:bg];
}
void
gui_mch_leave_fullscreen()
{
[[MMBackend sharedInstance] leaveFullscreen];
[[MMBackend sharedInstance] leaveFullScreen];
}
@@ -1699,7 +1699,7 @@ gui_mch_fuopt_update()
bg = fuoptions_bgcolor;
}
[[MMBackend sharedInstance] setFullscreenBackgroundColor:bg];
[[MMBackend sharedInstance] setFullScreenBackgroundColor:bg];
}
+5 -1
View File
@@ -1,7 +1,7 @@
" System gvimrc file for MacVim
"
" Maintainer: Bjorn Winckler <bjorn.winckler@gmail.com>
" Last Change: Sun Aug 29 2009
" Last Change: Tue Jul 26 2011
"
" This is a work in progress. If you feel so inclined, please help me improve
" this file.
@@ -63,6 +63,10 @@ if !exists("macvim_skip_cmd_opt_movement")
imap <M-BS> <C-w>
imap <D-BS> <C-u>
" Make the 'delete' key delete selection in visual+select mode instead of
" moving cursor to the left.
vmap <Backspace> d
endif " !exists("macvim_skip_cmd_opt_movement")
+1 -1
View File
@@ -5814,7 +5814,7 @@ __:
eof
eval "`cd ${PYTHON3_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`"
rm -f -- "${tmp_mkf}"
vi_cv_path_python3_plibs="-L${PYTHON3_CONFDIR} -lpython${vi_cv_var_python3_version}"
vi_cv_path_python3_plibs="-L${PYTHON3_CONFDIR} -lpython${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}"
vi_cv_path_python3_plibs="${vi_cv_path_python3_plibs} ${python3_BASEMODLIBS} ${python3_LIBS} ${python3_SYSLIBS}"
vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-ltermcap//`
vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-lffi//`
+1 -1
View File
@@ -1100,7 +1100,7 @@ eof
dnl -- delete the lines from make about Entering/Leaving directory
eval "`cd ${PYTHON3_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`"
rm -f -- "${tmp_mkf}"
vi_cv_path_python3_plibs="-L${PYTHON3_CONFDIR} -lpython${vi_cv_var_python3_version}"
vi_cv_path_python3_plibs="-L${PYTHON3_CONFDIR} -lpython${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}"
vi_cv_path_python3_plibs="${vi_cv_path_python3_plibs} ${python3_BASEMODLIBS} ${python3_LIBS} ${python3_SYSLIBS}"
dnl remove -ltermcap, it can conflict with an earlier -lncurses
vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-ltermcap//`
+5 -2
View File
@@ -3430,6 +3430,9 @@ ex_call(eap)
{
curwin->w_cursor.lnum = lnum;
curwin->w_cursor.col = 0;
#ifdef FEAT_VIRTUALEDIT
curwin->w_cursor.coladd = 0;
#endif
}
arg = startarg;
if (get_func_tv(name, (int)STRLEN(name), &rettv, &arg,
@@ -11939,7 +11942,7 @@ f_has(argvars, rettv)
#ifdef FEAT_SEARCHPATH
"file_in_path",
#endif
#if defined(UNIX) && !defined(USE_SYSTEM)
#if (defined(UNIX) && !defined(USE_SYSTEM)) || defined(WIN3264)
"filterpipe",
#endif
#ifdef FEAT_FIND_ID
@@ -14338,7 +14341,7 @@ f_readfile(argvars, rettv)
tolist = 0;
for ( ; filtd < buflen || readlen <= 0; ++filtd)
{
if (buf[filtd] == '\n' || readlen <= 0)
if (readlen <= 0 || buf[filtd] == '\n')
{
/* In binary mode add an empty list item when the last
* non-empty line ends in a '\n'. */
+1 -1
View File
@@ -1107,7 +1107,7 @@ do_filter(line1, line2, eap, cmd, do_in, do_out)
if (do_out)
shell_flags |= SHELL_DOOUT;
#if !defined(USE_SYSTEM) && defined(UNIX)
#if (!defined(USE_SYSTEM) && defined(UNIX)) || defined(WIN3264)
if (!do_in && do_out && !p_stmp)
{
/* Use a pipe to fetch stdout of the command, do not use a temp file. */
+8 -1
View File
@@ -5315,7 +5315,9 @@ static struct
{
{EXPAND_AUGROUP, "augroup"},
{EXPAND_BUFFERS, "buffer"},
{EXPAND_COLORS, "color"},
{EXPAND_COMMANDS, "command"},
{EXPAND_COMPILER, "compiler"},
#if defined(FEAT_CSCOPE)
{EXPAND_CSCOPE, "cscope"},
#endif
@@ -5328,10 +5330,15 @@ static struct
{EXPAND_EVENTS, "event"},
{EXPAND_EXPRESSION, "expression"},
{EXPAND_FILES, "file"},
{EXPAND_FILES_IN_PATH, "file_in_path"},
{EXPAND_FILETYPE, "filetype"},
{EXPAND_FUNCTIONS, "function"},
{EXPAND_HELP, "help"},
{EXPAND_HIGHLIGHT, "highlight"},
#if (defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \
&& (defined(FEAT_GETTEXT) || defined(FEAT_MBYTE))
{EXPAND_LOCALES, "locale"},
#endif
{EXPAND_MAPPINGS, "mapping"},
{EXPAND_MENUS, "menu"},
{EXPAND_OWNSYNTAX, "syntax"},
@@ -7088,7 +7095,7 @@ alist_expand(fnum_list, fnum_len)
old_arg_count = GARGCOUNT;
if (expand_wildcards(old_arg_count, old_arg_files,
&new_arg_file_count, &new_arg_files,
EW_FILE|EW_NOTFOUND|EW_ADDSLASH) == OK
EW_FILE|EW_NOTFOUND|EW_ADDSLASH|EW_NOERROR) == OK
&& new_arg_file_count > 0)
{
alist_set(&global_alist, new_arg_file_count, new_arg_files,
+3 -3
View File
@@ -3057,7 +3057,7 @@ cmdline_paste(regname, literally, remcr)
int len;
/* Locate start of last word in the cmd buffer. */
for (w = ccline.cmdbuff + ccline.cmdlen; w > ccline.cmdbuff; )
for (w = ccline.cmdbuff + ccline.cmdpos; w > ccline.cmdbuff; )
{
#ifdef FEAT_MBYTE
if (has_mbyte)
@@ -3075,7 +3075,7 @@ cmdline_paste(regname, literally, remcr)
--w;
}
}
len = (int)((ccline.cmdbuff + ccline.cmdlen) - w);
len = (int)((ccline.cmdbuff + ccline.cmdpos) - w);
if (p_ic ? STRNICMP(w, arg, len) == 0 : STRNCMP(w, arg, len) == 0)
p += len;
}
@@ -5039,7 +5039,7 @@ ExpandRTDir(pat, num_file, file, dirnames)
*num_file = 0;
*file = NULL;
pat_len = STRLEN(pat);
pat_len = (int)STRLEN(pat);
ga_init2(&ga, (int)sizeof(char *), 10);
for (i = 0; dirnames[i] != NULL; ++i)
+6 -1
View File
@@ -9082,7 +9082,10 @@ trigger_cursorhold()
{
int state;
if (!did_cursorhold && has_cursorhold() && !Recording
if (!did_cursorhold
&& has_cursorhold()
&& !Recording
&& typebuf.tb_len == 0
#ifdef FEAT_INS_EXPAND
&& !ins_compl_active()
#endif
@@ -9973,6 +9976,8 @@ match_file_pat(pattern, prog, fname, sfname, tail, allow_dirs)
if ((c == ';' || c == '>') && match == FALSE)
{
*pattern = NUL; /* Terminate the string */
/* TODO: match with 'filetype' of buffer that "fname" comes
* from. */
match = mch_check_filetype(fname, type_start);
*pattern = c; /* Restore the terminator */
type_start = pattern + 1;
+4
View File
@@ -1574,6 +1574,10 @@ gui_mch_init(void)
#endif
#ifdef FEAT_EVAL
# if _MSC_VER < 1400
/* HandleToLong() only exists in compilers that can do 64 bit builds */
# define HandleToLong(h) ((long)(h))
# endif
/* set the v:windowid variable */
set_vim_var_nr(VV_WINDOWID, HandleToLong(s_hwnd));
#endif
+3 -7
View File
@@ -534,7 +534,6 @@ WindowSetattr(PyObject *self, char *name, PyObject *val)
{
long lnum;
long col;
long len;
if (!PyArg_Parse(val, "(ll)", &lnum, &col))
return -1;
@@ -549,18 +548,15 @@ WindowSetattr(PyObject *self, char *name, PyObject *val)
if (VimErrorCheck())
return -1;
/* When column is out of range silently correct it. */
len = (long)STRLEN(ml_get_buf(this->win->w_buffer, lnum, FALSE));
if (col > len)
col = len;
this->win->w_cursor.lnum = lnum;
this->win->w_cursor.col = col;
#ifdef FEAT_VIRTUALEDIT
this->win->w_cursor.coladd = 0;
#endif
update_screen(VALID);
/* When column is out of range silently correct it. */
check_cursor_col_win(this->win);
update_screen(VALID);
return 0;
}
else if (strcmp(name, "height") == 0)
+12 -4
View File
@@ -68,9 +68,16 @@
static void init_structs(void);
/* The "surrogateescape" error handler is new in Python 3.1 */
#if PY_VERSION_HEX >= 0x030100f0
# define CODEC_ERROR_HANDLER "surrogateescape"
#else
# define CODEC_ERROR_HANDLER NULL
#endif
#define PyInt Py_ssize_t
#define PyString_Check(obj) PyUnicode_Check(obj)
#define PyString_AsBytes(obj) PyUnicode_AsEncodedString(obj, (char *)ENC_OPT, NULL);
#define PyString_AsBytes(obj) PyUnicode_AsEncodedString(obj, (char *)ENC_OPT, CODEC_ERROR_HANDLER);
#define PyString_FreeBytes(obj) Py_XDECREF(bytes)
#define PyString_AsString(obj) PyBytes_AsString(obj)
#define PyString_Size(obj) PyBytes_GET_SIZE(bytes)
@@ -661,8 +668,9 @@ DoPy3Command(exarg_T *eap, const char *cmd)
/* PyRun_SimpleString expects a UTF-8 string. Wrong encoding may cause
* SyntaxError (unicode error). */
cmdstr = PyUnicode_Decode(cmd, strlen(cmd), (char *)ENC_OPT, NULL);
cmdbytes = PyUnicode_AsEncodedString(cmdstr, "utf-8", NULL);
cmdstr = PyUnicode_Decode(cmd, strlen(cmd),
(char *)ENC_OPT, CODEC_ERROR_HANDLER);
cmdbytes = PyUnicode_AsEncodedString(cmdstr, "utf-8", CODEC_ERROR_HANDLER);
Py_XDECREF(cmdstr);
PyRun_SimpleString(PyBytes_AsString(cmdbytes));
Py_XDECREF(cmdbytes);
@@ -1463,7 +1471,7 @@ LineToString(const char *str)
}
*p = '\0';
result = PyUnicode_Decode(tmp, len, (char *)ENC_OPT, NULL);
result = PyUnicode_Decode(tmp, len, (char *)ENC_OPT, CODEC_ERROR_HANDLER);
vim_free(tmp);
return result;
+12 -5
View File
@@ -765,11 +765,18 @@ static VALUE vim_message(VALUE self UNUSED, VALUE str)
char *buff, *p;
str = rb_obj_as_string(str);
buff = ALLOCA_N(char, RSTRING_LEN(str));
strcpy(buff, RSTRING_PTR(str));
p = strchr(buff, '\n');
if (p) *p = '\0';
MSG(buff);
if (RSTRING_LEN(str) > 0)
{
buff = ALLOCA_N(char, RSTRING_LEN(str));
strcpy(buff, RSTRING_PTR(str));
p = strchr(buff, '\n');
if (p) *p = '\0';
MSG(buff);
}
else
{
MSG("");
}
return Qnil;
}
+151 -42
View File
@@ -132,6 +132,7 @@ static int utf_ptr2cells_len __ARGS((char_u *p, int size));
static int dbcs_char2cells __ARGS((int c));
static int dbcs_ptr2cells_len __ARGS((char_u *p, int size));
static int dbcs_ptr2char __ARGS((char_u *p));
static int utf_safe_read_char_adv __ARGS((char_u **s, size_t *n));
/*
* Lookup table to quickly get the length in bytes of a UTF-8 character from
@@ -1700,6 +1701,66 @@ utf_ptr2char(p)
return p[0];
}
/*
* Convert a UTF-8 byte sequence to a wide character.
* String is assumed to be terminated by NUL or after "n" bytes, whichever
* comes first.
* The function is safe in the sense that it never accesses memory beyond the
* first "n" bytes of "s".
*
* On success, returns decoded codepoint, advances "s" to the beginning of
* next character and decreases "n" accordingly.
*
* If end of string was reached, returns 0 and, if "n" > 0, advances "s" past
* NUL byte.
*
* If byte sequence is illegal or incomplete, returns -1 and does not advance
* "s".
*/
static int
utf_safe_read_char_adv(s, n)
char_u **s;
size_t *n;
{
int c, k;
if (*n == 0) /* end of buffer */
return 0;
k = utf8len_tab_zero[**s];
if (k == 1)
{
/* ASCII character or NUL */
(*n)--;
return *(*s)++;
}
if ((size_t)k <= *n)
{
/* We have a multibyte sequence and it isn't truncated by buffer
* limits so utf_ptr2char() is safe to use. Or the first byte is
* illegal (k=0), and it's also safe to use utf_ptr2char(). */
c = utf_ptr2char(*s);
/* On failure, utf_ptr2char() returns the first byte, so here we
* check equality with the first byte. The only non-ASCII character
* which equals the first byte of its own UTF-8 representation is
* U+00C3 (UTF-8: 0xC3 0x83), so need to check that special case too.
* It's safe even if n=1, else we would have k=2 > n. */
if (c != (int)(**s) || (c == 0xC3 && (*s)[1] == 0x83))
{
/* byte sequence was successfully decoded */
*s += k;
*n -= k;
return c;
}
}
/* byte sequence is incomplete or illegal */
return -1;
}
/*
* Get character at **pp and advance *pp to the next character.
* Note: composing characters are skipped!
@@ -2667,7 +2728,8 @@ static convertStruct foldCase[] =
{0x10400,0x10427,1,40}
};
static int utf_convert(int a, convertStruct table[], int tableSize);
static int utf_convert __ARGS((int a, convertStruct table[], int tableSize));
static int utf_strnicmp __ARGS((char_u *s1, char_u *s2, size_t n1, size_t n2));
/*
* Generic conversion function for case operations.
@@ -3079,6 +3141,80 @@ utf_isupper(a)
return (utf_tolower(a) != a);
}
static int
utf_strnicmp(s1, s2, n1, n2)
char_u *s1, *s2;
size_t n1, n2;
{
int c1, c2, cdiff;
char_u buffer[6];
for (;;)
{
c1 = utf_safe_read_char_adv(&s1, &n1);
c2 = utf_safe_read_char_adv(&s2, &n2);
if (c1 <= 0 || c2 <= 0)
break;
if (c1 == c2)
continue;
cdiff = utf_fold(c1) - utf_fold(c2);
if (cdiff != 0)
return cdiff;
}
/* some string ended or has an incomplete/illegal character sequence */
if (c1 == 0 || c2 == 0)
{
/* some string ended. shorter string is smaller */
if (c1 == 0 && c2 == 0)
return 0;
return c1 == 0 ? -1 : 1;
}
/* Continue with bytewise comparison to produce some result that
* would make comparison operations involving this function transitive.
*
* If only one string had an error, comparison should be made with
* folded version of the other string. In this case it is enough
* to fold just one character to determine the result of comparison. */
if (c1 != -1 && c2 == -1)
{
n1 = utf_char2bytes(utf_fold(c1), buffer);
s1 = buffer;
}
else if (c2 != -1 && c1 == -1)
{
n2 = utf_char2bytes(utf_fold(c2), buffer);
s2 = buffer;
}
while (n1 > 0 && n2 > 0 && *s1 != NUL && *s2 != NUL)
{
cdiff = (int)(*s1) - (int)(*s2);
if (cdiff != 0)
return cdiff;
s1++;
s2++;
n1--;
n2--;
}
if (n1 > 0 && *s1 == NUL)
n1 = 0;
if (n2 > 0 && *s2 == NUL)
n2 = 0;
if (n1 == 0 && n2 == 0)
return 0;
return n1 == 0 ? -1 : 1;
}
/*
* Version of strnicmp() that handles multi-byte characters.
* Needed for Big5, Sjift-JIS and UTF-8 encoding. Other DBCS encodings can
@@ -3092,49 +3228,21 @@ mb_strnicmp(s1, s2, nn)
char_u *s1, *s2;
size_t nn;
{
int i, j, l;
int i, l;
int cdiff;
int incomplete = FALSE;
int n = (int)nn;
for (i = 0; i < n; i += l)
if (enc_utf8)
{
if (s1[i] == NUL && s2[i] == NUL) /* both strings end */
return 0;
if (enc_utf8)
{
l = utf_byte2len(s1[i]);
if (l > n - i)
{
l = n - i; /* incomplete character */
incomplete = TRUE;
}
/* Check directly first, it's faster. */
for (j = 0; j < l; ++j)
{
if (s1[i + j] != s2[i + j])
break;
if (s1[i + j] == 0)
/* Both stings have the same bytes but are incomplete or
* have illegal bytes, accept them as equal. */
l = j;
}
if (j < l)
{
/* If one of the two characters is incomplete return -1. */
if (incomplete || i + utf_byte2len(s2[i]) > n)
return -1;
/* Don't case-fold illegal bytes or truncated characters. */
if (utf_ptr2len(s1 + i) < l || utf_ptr2len(s2 + i) < l)
return -1;
cdiff = utf_fold(utf_ptr2char(s1 + i))
- utf_fold(utf_ptr2char(s2 + i));
if (cdiff != 0)
return cdiff;
}
}
else
return utf_strnicmp(s1, s2, nn, nn);
}
else
{
for (i = 0; i < n; i += l)
{
if (s1[i] == NUL && s2[i] == NUL) /* both strings end */
return 0;
l = (*mb_ptr2len)(s1 + i);
if (l <= 1)
{
@@ -3563,7 +3671,7 @@ dbcs_screen_tail_off(base, p)
void
mb_adjust_cursor()
{
mb_adjustpos(&curwin->w_cursor);
mb_adjustpos(curbuf, &curwin->w_cursor);
}
/*
@@ -3571,7 +3679,8 @@ mb_adjust_cursor()
* If it points to a tail byte it's moved backwards to the head byte.
*/
void
mb_adjustpos(lp)
mb_adjustpos(buf, lp)
buf_T *buf;
pos_T *lp;
{
char_u *p;
@@ -3582,7 +3691,7 @@ mb_adjustpos(lp)
#endif
)
{
p = ml_get(lp->lnum);
p = ml_get_buf(buf, lp->lnum, FALSE);
lp->col -= (*mb_head_off)(p, p + lp->col);
#ifdef FEAT_VIRTUALEDIT
/* Reset "coladd" when the cursor would be on the right half of a
+9 -6
View File
@@ -3187,10 +3187,10 @@ get_keystroke()
|| n == K_HOR_SCROLLBAR
# endif
# ifdef FEAT_GUI_MACVIM
|| K_SWIPELEFT
|| K_SWIPERIGHT
|| K_SWIPEUP
|| K_SWIPEDOWN
|| n == K_SWIPELEFT
|| n == K_SWIPERIGHT
|| n == K_SWIPEUP
|| n == K_SWIPEDOWN
# endif
#endif
)
@@ -7951,8 +7951,7 @@ term_again:
* If we're at the end of a block, skip to the start of
* that block.
*/
curwin->w_cursor.col = 0;
if (*cin_skipcomment(l) == '}'
if (find_last_paren(l, '{', '}')
&& (trypos = find_start_brace(ind_maxcomment))
!= NULL) /* XXX */
{
@@ -9050,8 +9049,12 @@ dos_expandpath(
}
/* compile the regexp into a program */
if (flags & EW_NOERROR)
++emsg_silent;
regmatch.rm_ic = TRUE; /* Always ignore case */
regmatch.regprog = vim_regcomp(pat, RE_MAGIC);
if (flags & EW_NOERROR)
--emsg_silent;
vim_free(pat);
if (regmatch.regprog == NULL)
+47 -18
View File
@@ -333,7 +333,7 @@ coladvance2(pos, addspaces, finetune, wcol)
#ifdef FEAT_MBYTE
/* prevent from moving onto a trail byte */
if (has_mbyte)
mb_adjustpos(pos);
mb_adjustpos(curbuf, pos);
#endif
if (col < wcol)
@@ -543,17 +543,27 @@ check_cursor_lnum()
*/
void
check_cursor_col()
{
check_cursor_col_win(curwin);
}
/*
* Make sure win->w_cursor.col is valid.
*/
void
check_cursor_col_win(win)
win_T *win;
{
colnr_T len;
#ifdef FEAT_VIRTUALEDIT
colnr_T oldcol = curwin->w_cursor.col;
colnr_T oldcoladd = curwin->w_cursor.col + curwin->w_cursor.coladd;
colnr_T oldcol = win->w_cursor.col;
colnr_T oldcoladd = win->w_cursor.col + win->w_cursor.coladd;
#endif
len = (colnr_T)STRLEN(ml_get_curline());
len = (colnr_T)STRLEN(ml_get_buf(win->w_buffer, win->w_cursor.lnum, FALSE));
if (len == 0)
curwin->w_cursor.col = 0;
else if (curwin->w_cursor.col >= len)
win->w_cursor.col = 0;
else if (win->w_cursor.col >= len)
{
/* Allow cursor past end-of-line when:
* - in Insert mode or restarting Insert mode
@@ -567,33 +577,33 @@ check_cursor_col()
|| (ve_flags & VE_ONEMORE)
#endif
|| virtual_active())
curwin->w_cursor.col = len;
win->w_cursor.col = len;
else
{
curwin->w_cursor.col = len - 1;
win->w_cursor.col = len - 1;
#ifdef FEAT_MBYTE
/* prevent cursor from moving on the trail byte */
/* Move the cursor to the head byte. */
if (has_mbyte)
mb_adjust_cursor();
mb_adjustpos(win->w_buffer, &win->w_cursor);
#endif
}
}
else if (curwin->w_cursor.col < 0)
curwin->w_cursor.col = 0;
else if (win->w_cursor.col < 0)
win->w_cursor.col = 0;
#ifdef FEAT_VIRTUALEDIT
/* If virtual editing is on, we can leave the cursor on the old position,
* only we must set it to virtual. But don't do it when at the end of the
* line. */
if (oldcol == MAXCOL)
curwin->w_cursor.coladd = 0;
win->w_cursor.coladd = 0;
else if (ve_flags == VE_ALL)
{
if (oldcoladd > curwin->w_cursor.col)
curwin->w_cursor.coladd = oldcoladd - curwin->w_cursor.col;
if (oldcoladd > win->w_cursor.col)
win->w_cursor.coladd = oldcoladd - win->w_cursor.col;
else
/* avoid weird number when there is a miscalculation or overflow */
curwin->w_cursor.coladd = 0;
win->w_cursor.coladd = 0;
}
#endif
}
@@ -2136,6 +2146,25 @@ ga_append(gap, c)
}
}
#if (defined(UNIX) && !defined(USE_SYSTEM)) || defined(WIN3264)
/*
* Append the text in "gap" below the cursor line and clear "gap".
*/
void
append_ga_line(gap)
garray_T *gap;
{
/* Remove trailing CR. */
if (gap->ga_len > 0
&& !curbuf->b_p_bin
&& ((char_u *)gap->ga_data)[gap->ga_len - 1] == CAR)
--gap->ga_len;
ga_append(gap, NUL);
ml_append(curwin->w_cursor.lnum++, gap->ga_data, 0, FALSE);
gap->ga_len = 0;
}
#endif
/************************************************************************
* functions that use lookup tables for various things, generally to do with
* special key codes.
@@ -3224,7 +3253,7 @@ get_real_state()
#if defined(FEAT_MBYTE) || defined(PROTO)
/*
* Return TRUE if "p" points to just after a path separator.
* Take care of multi-byte characters.
* Takes care of multi-byte characters.
* "b" must point to the start of the file name
*/
int
@@ -3232,7 +3261,7 @@ after_pathsep(b, p)
char_u *b;
char_u *p;
{
return vim_ispathsep(p[-1])
return p > b && vim_ispathsep(p[-1])
&& (!has_mbyte || (*mb_head_off)(b, p - 1) == 0);
}
#endif
+17 -9
View File
@@ -1795,17 +1795,25 @@ do_pending_operator(cap, old_col, gui_yank)
{
oap->inclusive = FALSE;
/* Try to include the newline, unless it's an operator
* that works on lines only */
if (*p_sel != 'o'
&& !op_on_lines(oap->op_type)
&& oap->end.lnum < curbuf->b_ml.ml_line_count)
* that works on lines only. */
if (*p_sel != 'o' && !op_on_lines(oap->op_type))
{
++oap->end.lnum;
oap->end.col = 0;
if (oap->end.lnum < curbuf->b_ml.ml_line_count)
{
++oap->end.lnum;
oap->end.col = 0;
# ifdef FEAT_VIRTUALEDIT
oap->end.coladd = 0;
oap->end.coladd = 0;
# endif
++oap->line_count;
++oap->line_count;
}
else
{
/* Cannot move below the last line, make the op
* inclusive to tell the operation to include the
* line break. */
oap->inclusive = TRUE;
}
}
}
}
@@ -8808,7 +8816,7 @@ unadjust_for_sel()
{
--pp->col;
#ifdef FEAT_MBYTE
mb_adjustpos(pp);
mb_adjustpos(curbuf, pp);
#endif
}
else if (pp->lnum > 1)
+32 -9
View File
@@ -1650,7 +1650,9 @@ op_delete(oap)
&& oap->line_count > 1
&& oap->op_type == OP_DELETE)
{
ptr = ml_get(oap->end.lnum) + oap->end.col + oap->inclusive;
ptr = ml_get(oap->end.lnum) + oap->end.col;
if (*ptr != NUL)
ptr += oap->inclusive;
ptr = skipwhite(ptr);
if (*ptr == NUL && inindent(0))
oap->motion_type = MLINE;
@@ -1920,11 +1922,20 @@ op_delete(oap)
curwin->w_cursor.coladd = 0;
}
#endif
(void)del_bytes((long)n, !virtual_op, oap->op_type == OP_DELETE
if (oap->inclusive && oap->end.lnum == curbuf->b_ml.ml_line_count
&& n > (int)STRLEN(ml_get(oap->end.lnum)))
{
/* Special case: gH<Del> deletes the last line. */
del_lines(1L, FALSE);
}
else
{
(void)del_bytes((long)n, !virtual_op, oap->op_type == OP_DELETE
#ifdef FEAT_VISUAL
&& !oap->is_VIsual
#endif
);
}
}
else /* delete characters between lines */
{
@@ -1941,17 +1952,29 @@ op_delete(oap)
++curwin->w_cursor.lnum;
del_lines((long)(oap->line_count - 2), FALSE);
/* delete from start of line until op_end */
curwin->w_cursor.col = 0;
(void)del_bytes((long)(oap->end.col + 1 - !oap->inclusive),
!virtual_op, oap->op_type == OP_DELETE
n = (oap->end.col + 1 - !oap->inclusive);
if (oap->inclusive && oap->end.lnum == curbuf->b_ml.ml_line_count
&& n > (int)STRLEN(ml_get(oap->end.lnum)))
{
/* Special case: gH<Del> deletes the last line. */
del_lines(1L, FALSE);
curwin->w_cursor = curpos; /* restore curwin->w_cursor */
if (curwin->w_cursor.lnum > 1)
--curwin->w_cursor.lnum;
}
else
{
/* delete from start of line until op_end */
curwin->w_cursor.col = 0;
(void)del_bytes((long)n, !virtual_op, oap->op_type == OP_DELETE
#ifdef FEAT_VISUAL
&& !oap->is_VIsual
#endif
);
curwin->w_cursor = curpos; /* restore curwin->w_cursor */
(void)do_join(2, FALSE, FALSE);
curwin->w_cursor = curpos; /* restore curwin->w_cursor */
}
if (curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count)
(void)do_join(2, FALSE, FALSE);
}
}
+1 -1
View File
@@ -1238,7 +1238,7 @@ static struct vimoption
{"fuoptions", "fuopt", P_STRING|P_COMMA|P_NODUP|P_VI_DEF,
#ifdef FEAT_FULLSCREEN
(char_u *)&p_fuoptions, PV_NONE,
{(char_u *)"maxvert", (char_u *)0L}
{(char_u *)"maxvert,maxhorz", (char_u *)0L}
#else
(char_u *)NULL, PV_NONE,
{(char_u *)NULL, (char_u *)0L}
+13 -25
View File
@@ -3666,27 +3666,6 @@ mch_new_shellsize()
/* Nothing to do. */
}
#ifndef USE_SYSTEM
static void append_ga_line __ARGS((garray_T *gap));
/*
* Append the text in "gap" below the cursor line and clear "gap".
*/
static void
append_ga_line(gap)
garray_T *gap;
{
/* Remove trailing CR. */
if (gap->ga_len > 0
&& !curbuf->b_p_bin
&& ((char_u *)gap->ga_data)[gap->ga_len - 1] == CAR)
--gap->ga_len;
ga_append(gap, NUL);
ml_append(curwin->w_cursor.lnum++, gap->ga_data, 0, FALSE);
gap->ga_len = 0;
}
#endif
int
mch_call_shell(cmd, options)
char_u *cmd;
@@ -3928,11 +3907,20 @@ mch_call_shell(cmd, options)
if (p_guipty && !(options & (SHELL_READ|SHELL_WRITE)))
{
pty_master_fd = OpenPTY(&tty_name); /* open pty */
if (pty_master_fd >= 0 && ((pty_slave_fd =
open(tty_name, O_RDWR | O_EXTRA, 0)) < 0))
if (pty_master_fd >= 0)
{
close(pty_master_fd);
pty_master_fd = -1;
#if !defined(MACOS) || defined(USE_CARBONIZED)
pty_slave_fd = open(tty_name, O_RDWR | O_EXTRA, 0);
#else
/* Leaving out O_NOCTTY may lead to waitpid() always returning
* 0 on Mac OS X 10.7 thereby causing freezes. */
pty_slave_fd = open(tty_name, O_RDWR | O_NOCTTY | O_EXTRA);
#endif
if (pty_slave_fd < 0)
{
close(pty_master_fd);
pty_master_fd = -1;
}
}
}
/*
+515 -5
View File
@@ -417,6 +417,11 @@ static PSNSECINFO pSetNamedSecurityInfo;
static PGNSECINFO pGetNamedSecurityInfo;
#endif
typedef BOOL (WINAPI *PSETHANDLEINFORMATION)(HANDLE, DWORD, DWORD);
static BOOL allowPiping = FALSE;
static PSETHANDLEINFORMATION pSetHandleInformation;
/*
* Set g_PlatformId to VER_PLATFORM_WIN32_NT (NT) or
* VER_PLATFORM_WIN32_WINDOWS (Win95).
@@ -467,6 +472,18 @@ PlatformId(void)
}
}
#endif
/*
* If we are on windows NT, try to load the pipe functions, only
* available from Win2K.
*/
if (g_PlatformId == VER_PLATFORM_WIN32_NT)
{
HANDLE kernel32 = GetModuleHandle("kernel32");
pSetHandleInformation = (PSETHANDLEINFORMATION)GetProcAddress(
kernel32, "SetHandleInformation");
allowPiping = pSetHandleInformation != NULL;
}
done = TRUE;
}
}
@@ -1635,7 +1652,7 @@ executable_exists(char *name)
}
#if ((defined(__MINGW32__) || defined (__CYGWIN32__)) && \
__MSVCRT_VERSION__ >= 0x800) || (defined(_MSC_VER) && _MSC_VER >= 1400)
__MSVCRT_VERSION__ >= 0x800) || (defined(_MSC_VER) && _MSC_VER >= 1400)
/*
* Bad parameter handler.
*
@@ -3210,7 +3227,7 @@ mch_set_winsize_now(void)
* 4. Prompt the user to press a key to close the console window
*/
static int
mch_system(char *cmd, int options)
mch_system_classic(char *cmd, int options)
{
STARTUPINFO si;
PROCESS_INFORMATION pi;
@@ -3315,6 +3332,498 @@ mch_system(char *cmd, int options)
return ret;
}
/*
* Thread launched by the gui to send the current buffer data to the
* process. This way avoid to hang up vim totally if the children
* process take a long time to process the lines.
*/
static DWORD WINAPI
sub_process_writer(LPVOID param)
{
HANDLE g_hChildStd_IN_Wr = param;
linenr_T lnum = curbuf->b_op_start.lnum;
DWORD len = 0;
DWORD l;
char_u *lp = ml_get(lnum);
char_u *s;
int written = 0;
for (;;)
{
l = (DWORD)STRLEN(lp + written);
if (l == 0)
len = 0;
else if (lp[written] == NL)
{
/* NL -> NUL translation */
WriteFile(g_hChildStd_IN_Wr, "", 1, &len, NULL);
}
else
{
s = vim_strchr(lp + written, NL);
WriteFile(g_hChildStd_IN_Wr, (char *)lp + written,
s == NULL ? l : (DWORD)(s - (lp + written)),
&len, NULL);
}
if (len == (int)l)
{
/* Finished a line, add a NL, unless this line should not have
* one. */
if (lnum != curbuf->b_op_end.lnum
|| !curbuf->b_p_bin
|| (lnum != curbuf->b_no_eol_lnum
&& (lnum != curbuf->b_ml.ml_line_count
|| curbuf->b_p_eol)))
{
WriteFile(g_hChildStd_IN_Wr, "\n", 1, &ignored, NULL);
}
++lnum;
if (lnum > curbuf->b_op_end.lnum)
break;
lp = ml_get(lnum);
written = 0;
}
else if (len > 0)
written += len;
}
/* finished all the lines, close pipe */
CloseHandle(g_hChildStd_IN_Wr);
ExitThread(0);
}
# define BUFLEN 100 /* length for buffer, stolen from unix version */
/*
* This function read from the children's stdout and write the
* data on screen or in the buffer accordingly.
*/
static void
dump_pipe(int options,
HANDLE g_hChildStd_OUT_Rd,
garray_T *ga,
char_u buffer[],
DWORD *buffer_off)
{
DWORD availableBytes = 0;
DWORD i;
int c;
char_u *p;
int ret;
DWORD len;
DWORD toRead;
int repeatCount;
/* we query the pipe to see if there is any data to read
* to avoid to perform a blocking read */
ret = PeekNamedPipe(g_hChildStd_OUT_Rd, /* pipe to query */
NULL, /* optional buffer */
0, /* buffe size */
NULL, /* number of read bytes */
&availableBytes, /* available bytes total */
NULL); /* byteLeft */
repeatCount = 0;
/* We got real data in the pipe, read it */
while (ret != 0 && availableBytes > 0 && availableBytes > 0)
{
repeatCount++;
toRead =
# ifdef FEAT_MBYTE
(DWORD)(BUFLEN - *buffer_off);
# else
(DWORD)BUFLEN;
# endif
toRead = availableBytes < toRead ? availableBytes : toRead;
ReadFile(g_hChildStd_OUT_Rd, buffer
# ifdef FEAT_MBYTE
+ *buffer_off, toRead
# else
, toRead
# endif
, &len, NULL);
/* If we haven't read anything, there is a problem */
if (len == 0)
break;
availableBytes -= len;
if (options & SHELL_READ)
{
/* Do NUL -> NL translation, append NL separated
* lines to the current buffer. */
for (i = 0; i < len; ++i)
{
if (buffer[i] == NL)
append_ga_line(ga);
else if (buffer[i] == NUL)
ga_append(ga, NL);
else
ga_append(ga, buffer[i]);
}
}
# ifdef FEAT_MBYTE
else if (has_mbyte)
{
int l;
len += *buffer_off;
buffer[len] = NUL;
/* Check if the last character in buffer[] is
* incomplete, keep these bytes for the next
* round. */
for (p = buffer; p < buffer + len; p += l)
{
l = mb_cptr2len(p);
if (l == 0)
l = 1; /* NUL byte? */
else if (MB_BYTE2LEN(*p) != l)
break;
}
if (p == buffer) /* no complete character */
{
/* avoid getting stuck at an illegal byte */
if (len >= 12)
++p;
else
{
*buffer_off = len;
return;
}
}
c = *p;
*p = NUL;
msg_puts(buffer);
if (p < buffer + len)
{
*p = c;
*buffer_off = (DWORD)((buffer + len) - p);
mch_memmove(buffer, p, *buffer_off);
return;
}
*buffer_off = 0;
}
# endif /* FEAT_MBYTE */
else
{
buffer[len] = NUL;
msg_puts(buffer);
}
windgoto(msg_row, msg_col);
cursor_on();
out_flush();
}
}
/*
* Version of system to use for windows NT > 5.0 (Win2K), use pipe
* for communication and doesn't open any new window.
*/
static int
mch_system_piped(char *cmd, int options)
{
STARTUPINFO si;
PROCESS_INFORMATION pi;
DWORD ret = 0;
HANDLE g_hChildStd_IN_Rd = NULL;
HANDLE g_hChildStd_IN_Wr = NULL;
HANDLE g_hChildStd_OUT_Rd = NULL;
HANDLE g_hChildStd_OUT_Wr = NULL;
char_u buffer[BUFLEN + 1]; /* reading buffer + size */
DWORD len;
/* buffer used to receive keys */
char_u ta_buf[BUFLEN + 1]; /* TypeAHead */
int ta_len = 0; /* valid bytes in ta_buf[] */
DWORD i;
int c;
int noread_cnt = 0;
garray_T ga;
int delay = 1;
# ifdef FEAT_MBYTE
DWORD buffer_off = 0; /* valid bytes in buffer[] */
# endif
SECURITY_ATTRIBUTES saAttr;
/* Set the bInheritHandle flag so pipe handles are inherited. */
saAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
saAttr.bInheritHandle = TRUE;
saAttr.lpSecurityDescriptor = NULL;
if ( ! CreatePipe(&g_hChildStd_OUT_Rd, &g_hChildStd_OUT_Wr, &saAttr, 0)
/* Ensure the read handle to the pipe for STDOUT is not inherited. */
|| ! pSetHandleInformation(g_hChildStd_OUT_Rd, HANDLE_FLAG_INHERIT, 0)
/* Create a pipe for the child process's STDIN. */
|| ! CreatePipe(&g_hChildStd_IN_Rd, &g_hChildStd_IN_Wr, &saAttr, 0)
/* Ensure the write handle to the pipe for STDIN is not inherited. */
|| ! pSetHandleInformation(g_hChildStd_IN_Wr, HANDLE_FLAG_INHERIT, 0) )
{
CloseHandle(g_hChildStd_IN_Rd);
CloseHandle(g_hChildStd_IN_Wr);
CloseHandle(g_hChildStd_OUT_Rd);
CloseHandle(g_hChildStd_OUT_Wr);
MSG_PUTS(_("\nCannot create pipes\n"));
}
si.cb = sizeof(si);
si.lpReserved = NULL;
si.lpDesktop = NULL;
si.lpTitle = NULL;
si.dwFlags = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES;
/* set-up our file redirection */
si.hStdError = g_hChildStd_OUT_Wr;
si.hStdOutput = g_hChildStd_OUT_Wr;
si.hStdInput = g_hChildStd_IN_Rd;
si.wShowWindow = SW_HIDE;
si.cbReserved2 = 0;
si.lpReserved2 = NULL;
if (options & SHELL_READ)
ga_init2(&ga, 1, BUFLEN);
/* Now, run the command */
CreateProcess(NULL, /* Executable name */
cmd, /* Command to execute */
NULL, /* Process security attributes */
NULL, /* Thread security attributes */
// this command can be litigeous, handle inheritence was
// deactivated for pending temp file, but, if we deactivate
// it, the pipes don't work for some reason.
TRUE, /* Inherit handles, first deactivated,
* but needed */
CREATE_DEFAULT_ERROR_MODE, /* Creation flags */
NULL, /* Environment */
NULL, /* Current directory */
&si, /* Startup information */
&pi); /* Process information */
/* Close our unused side of the pipes */
CloseHandle(g_hChildStd_IN_Rd);
CloseHandle(g_hChildStd_OUT_Wr);
if (options & SHELL_WRITE)
{
HANDLE thread =
CreateThread(NULL, /* security attributes */
0, /* default stack size */
sub_process_writer, /* function to be executed */
g_hChildStd_IN_Wr, /* parameter */
0, /* creation flag, start immediately */
NULL); /* we don't care about thread id */
CloseHandle(thread);
g_hChildStd_IN_Wr = NULL;
}
/* Keep updating the window while waiting for the shell to finish. */
for (;;)
{
MSG msg;
if (PeekMessage(&msg, (HWND)NULL, 0, 0, PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
/* write pipe information in the window */
if ((options & (SHELL_READ|SHELL_WRITE))
# ifdef FEAT_GUI
|| gui.in_use
# endif
)
{
len = 0;
if (!(options & SHELL_EXPAND)
&& ((options &
(SHELL_READ|SHELL_WRITE|SHELL_COOKED))
!= (SHELL_READ|SHELL_WRITE|SHELL_COOKED)
# ifdef FEAT_GUI
|| gui.in_use
# endif
)
&& (ta_len > 0 || noread_cnt > 4))
{
if (ta_len == 0)
{
/* Get extra characters when we don't have any. Reset the
* counter and timer. */
noread_cnt = 0;
# if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
gettimeofday(&start_tv, NULL);
# endif
len = ui_inchar(ta_buf, BUFLEN, 10L, 0);
}
if (ta_len > 0 || len > 0)
{
/*
* For pipes: Check for CTRL-C: send interrupt signal to
* child. Check for CTRL-D: EOF, close pipe to child.
*/
if (len == 1 && cmd != NULL)
{
if (ta_buf[ta_len] == Ctrl_C)
{
/* Learn what exit code is expected, for
* now put 9 as SIGKILL */
TerminateProcess(pi.hProcess, 9);
}
if (ta_buf[ta_len] == Ctrl_D)
{
CloseHandle(g_hChildStd_IN_Wr);
g_hChildStd_IN_Wr = NULL;
}
}
/* replace K_BS by <BS> and K_DEL by <DEL> */
for (i = ta_len; i < ta_len + len; ++i)
{
if (ta_buf[i] == CSI && len - i > 2)
{
c = TERMCAP2KEY(ta_buf[i + 1], ta_buf[i + 2]);
if (c == K_DEL || c == K_KDEL || c == K_BS)
{
mch_memmove(ta_buf + i + 1, ta_buf + i + 3,
(size_t)(len - i - 2));
if (c == K_DEL || c == K_KDEL)
ta_buf[i] = DEL;
else
ta_buf[i] = Ctrl_H;
len -= 2;
}
}
else if (ta_buf[i] == '\r')
ta_buf[i] = '\n';
# ifdef FEAT_MBYTE
if (has_mbyte)
i += (*mb_ptr2len_len)(ta_buf + i,
ta_len + len - i) - 1;
# endif
}
/*
* For pipes: echo the typed characters. For a pty this
* does not seem to work.
*/
for (i = ta_len; i < ta_len + len; ++i)
{
if (ta_buf[i] == '\n' || ta_buf[i] == '\b')
msg_putchar(ta_buf[i]);
# ifdef FEAT_MBYTE
else if (has_mbyte)
{
int l = (*mb_ptr2len)(ta_buf + i);
msg_outtrans_len(ta_buf + i, l);
i += l - 1;
}
# endif
else
msg_outtrans_len(ta_buf + i, 1);
}
windgoto(msg_row, msg_col);
out_flush();
ta_len += len;
/*
* Write the characters to the child, unless EOF has been
* typed for pipes. Write one character at a time, to
* avoid losing too much typeahead. When writing buffer
* lines, drop the typed characters (only check for
* CTRL-C).
*/
if (options & SHELL_WRITE)
ta_len = 0;
else if (g_hChildStd_IN_Wr != NULL)
{
WriteFile(g_hChildStd_IN_Wr, (char*)ta_buf,
1, &len, NULL);
// if we are typing in, we want to keep things reactive
delay = 1;
if (len > 0)
{
ta_len -= len;
mch_memmove(ta_buf, ta_buf + len, ta_len);
}
}
}
}
}
if (ta_len)
ui_inchar_undo(ta_buf, ta_len);
if (WaitForSingleObject(pi.hProcess, delay) != WAIT_TIMEOUT)
{
dump_pipe(options, g_hChildStd_OUT_Rd,
&ga, buffer, &buffer_off);
break;
}
++noread_cnt;
dump_pipe(options, g_hChildStd_OUT_Rd,
&ga, buffer, &buffer_off);
/* We start waiting for a very short time and then increase it, so
* that we respond quickly when the process is quick, and don't
* consume too much overhead when it's slow. */
if (delay < 50)
delay += 10;
}
/* Close the pipe */
CloseHandle(g_hChildStd_OUT_Rd);
if (g_hChildStd_IN_Wr != NULL)
CloseHandle(g_hChildStd_IN_Wr);
WaitForSingleObject(pi.hProcess, INFINITE);
/* Get the command exit code */
GetExitCodeProcess(pi.hProcess, &ret);
if (options & SHELL_READ)
{
if (ga.ga_len > 0)
{
append_ga_line(&ga);
/* remember that the NL was missing */
curbuf->b_no_eol_lnum = curwin->w_cursor.lnum;
}
else
curbuf->b_no_eol_lnum = 0;
ga_clear(&ga);
}
/* Close the handles to the subprocess, so that it goes away */
CloseHandle(pi.hThread);
CloseHandle(pi.hProcess);
return ret;
}
static int
mch_system(char *cmd, int options)
{
/* if we can pipe and the shelltemp option is off */
if (allowPiping && !p_stmp)
return mch_system_piped(cmd, options);
else
return mch_system_classic(cmd, options);
}
#else
# define mch_system(c, o) system(c)
@@ -3388,7 +3897,7 @@ mch_call_shell(
char_u *newcmd;
long_u cmdlen = (
#ifdef FEAT_GUI_W32
STRLEN(vimrun_path) +
(allowPiping && !p_stmp ? 0 : STRLEN(vimrun_path)) +
#endif
STRLEN(p_sh) + STRLEN(p_shcf) + STRLEN(cmd) + 10);
@@ -3497,7 +4006,7 @@ mch_call_shell(
MB_ICONWARNING);
need_vimrun_warning = FALSE;
}
if (!s_dont_use_vimrun)
if (!s_dont_use_vimrun && (!allowPiping || p_stmp))
/* Use vimrun to execute the command. It opens a console
* window, which can be closed without killing Vim. */
vim_snprintf((char *)newcmd, cmdlen, "%s%s%s %s %s",
@@ -3521,7 +4030,8 @@ mch_call_shell(
/* Print the return value, unless "vimrun" was used. */
if (x != 0 && !(options & SHELL_SILENT) && !emsg_silent
#if defined(FEAT_GUI_W32)
&& ((options & SHELL_DOOUT) || s_dont_use_vimrun)
&& ((options & SHELL_DOOUT) || s_dont_use_vimrun
|| (allowPiping && !p_stmp))
#endif
)
{
+97 -54
View File
@@ -23,8 +23,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Vim(Esperanto)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-01-26 22:14+0100\n"
"PO-Revision-Date: 2011-01-26 22:23+0200\n"
"POT-Creation-Date: 2011-06-21 17:23+0200\n"
"PO-Revision-Date: 2011-06-21 17:26+0200\n"
"Last-Translator: Dominique PELLÉ <dominique.pelle@gmail.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -575,6 +575,9 @@ msgstr "E725: Alvoko de funkcio dict sen Vortaro: %s"
msgid "E808: Number or Float required"
msgstr "E808: Nombro aŭ Glitpunktnombro bezonata"
msgid "add() argument"
msgstr "argumento de add()"
msgid "E699: Too many arguments"
msgstr "E699: Tro da argumentoj"
@@ -589,10 +592,19 @@ msgstr "E785: complete() uzeblas nur en Enmeta reĝimo"
msgid "&Ok"
msgstr "&Bone"
msgid "extend() argument"
msgstr "argumento de extend()"
#, c-format
msgid "E737: Key already exists: %s"
msgstr "E737: Ŝlosilo jam ekzistas: %s"
msgid "map() argument"
msgstr "argumento de map()"
msgid "filter() argument"
msgstr "argumento de filter()"
#, c-format
msgid "+-%s%3ld lines: "
msgstr "+-%s%3ld linioj: "
@@ -611,6 +623,9 @@ msgstr ""
msgid "called inputrestore() more often than inputsave()"
msgstr "alvokis inputrestore() pli ofte ol inputsave()"
msgid "insert() argument"
msgstr "argumento de insert()"
msgid "E786: Range not allowed"
msgstr "E786: Amplekso malpermesita"
@@ -636,12 +651,21 @@ msgstr "E241: Ne eblas sendi al %s"
msgid "E277: Unable to read a server reply"
msgstr "E277: Ne eblas legi respondon de servilo"
msgid "remove() argument"
msgstr "argumento de remove()"
msgid "E655: Too many symbolic links (cycle?)"
msgstr "E655: Tro da simbolaj ligiloj (ĉu estas ciklo?)"
msgid "reverse() argument"
msgstr "argumento de reverse()"
msgid "E258: Unable to send to client"
msgstr "E258: Ne eblas sendi al kliento"
msgid "sort() argument"
msgstr "argumento de sort()"
msgid "E702: Sort compare function failed"
msgstr "E702: Ordiga funkcio fiaskis"
@@ -675,14 +699,6 @@ msgstr "E731: uzo de Vortaro kiel Ĉeno"
msgid "E806: using Float as a String"
msgstr "E806: uzo de Glitpunktnombro kiel Ĉeno"
#, c-format
msgid "E704: Funcref variable name must start with a capital: %s"
msgstr "E704: Nomo de variablo Funcref ekendas per majusklo: %s"
#, c-format
msgid "E705: Variable name conflicts with existing function: %s"
msgstr "E705: Nomo de variablo konfliktas kun ekzistanta funkcio: %s"
#, c-format
msgid "E706: Variable type mismatch for: %s"
msgstr "E706: Nekongrua datumtipo de variablo: %s"
@@ -691,6 +707,14 @@ msgstr "E706: Nekongrua datumtipo de variablo: %s"
msgid "E795: Cannot delete variable %s"
msgstr "E795: Ne eblas forviŝi variablon %s"
#, c-format
msgid "E704: Funcref variable name must start with a capital: %s"
msgstr "E704: Nomo de variablo Funcref devas finiĝi per majusklo: %s"
#, c-format
msgid "E705: Variable name conflicts with existing function: %s"
msgstr "E705: Nomo de variablo konfliktas kun ekzistanta funkcio: %s"
#, c-format
msgid "E741: Value is locked: %s"
msgstr "E741: Valoro estas ŝlosita: %s"
@@ -1639,6 +1663,9 @@ msgstr "[NE konvertita]"
msgid "[converted]"
msgstr "[konvertita]"
msgid "[blowfish]"
msgstr "[blowfish]"
msgid "[crypted]"
msgstr "[ĉifrita]"
@@ -1816,6 +1843,7 @@ msgstr "1 signo"
msgid "%lld characters"
msgstr "%lld signoj"
#. Explicit typecast avoids warning on Mac OS X 10.6
#, c-format
msgid "%ld characters"
msgstr "%ld signoj"
@@ -2090,7 +2118,7 @@ msgstr "Anstataŭigi per:"
#. whole word only button
msgid "Match whole word only"
msgstr "Kongrui nur plenan vorton"
msgstr "Kongrui kun nur plena vorto"
#. match case button
msgid "Match case"
@@ -2654,7 +2682,7 @@ msgid "E273: unknown longjmp status %d"
msgstr "E273: nekonata stato de longjmp: %d"
msgid "Toggle implementation/definition"
msgstr "Baskuli realigon/difinon"
msgstr "Baskuligi realigon/difinon"
msgid "Show base class of"
msgstr "Vidigi bazan klason de"
@@ -2748,7 +2776,7 @@ msgid "invalid buffer number"
msgstr "nevalida numero de bufro"
msgid "not implemented yet"
msgstr "ne jam realigita"
msgstr "ankoraŭ ne realigita"
#. ???
msgid "cannot set line(s)"
@@ -3020,7 +3048,7 @@ msgid "-r\t\t\tList swap files and exit"
msgstr "-r\t\t\tListigi permutodosierojn .swp kaj eliri"
msgid "-r (with file name)\tRecover crashed session"
msgstr "-r (kun dosiernomo)\tRestaŭri kolapsitan seancon"
msgstr "-r (kun dosiernomo)\tRestaŭri kolapsintan seancon"
msgid "-L\t\t\tSame as -r"
msgstr "-L\t\t\tKiel -r"
@@ -3214,19 +3242,6 @@ msgstr "+reverse\t\tNe uzi inversan videon (ankaŭ: +rv)"
msgid "-xrm <resource>\tSet the specified resource"
msgstr "-xrm <rimedo>\tAgordi la specifitan <rimedo>-n"
msgid ""
"\n"
"Arguments recognised by gvim (RISC OS version):\n"
msgstr ""
"\n"
"Argumentoj agnoskitaj de gvim (versio RISC OS):\n"
msgid "--columns <number>\tInitial width of window in columns"
msgstr "--columns <nombro>\tKomenca larĝo de fenestro en kolumnoj"
msgid "--rows <number>\tInitial height of window in rows"
msgstr "--rows <nombro>\tKomenca alto de fenestro en vicoj"
msgid ""
"\n"
"Arguments recognised by gvim (GTK+ version):\n"
@@ -3634,7 +3649,7 @@ msgstr ""
" proceza ID: "
msgid " (still running)"
msgstr " (ankoraŭ rulas)"
msgstr " (ankoraŭ rulas)"
msgid ""
"\n"
@@ -3736,24 +3751,20 @@ msgstr " PLI NOVA ol permutodosiero .swp!\n"
#. * other languages.
msgid ""
"\n"
"(1) Another program may be editing the same file.\n"
" If this is the case, be careful not to end up with two\n"
" different instances of the same file when making changes.\n"
"(1) Another program may be editing the same file. If this is the case,\n"
" be careful not to end up with two different instances of the same\n"
" file when making changes."
msgstr ""
"\n"
"(1) Alia programo eble redaktas la saman dosieron.\n"
" Se jes, estu singarda por ne havi du malsamajn\n"
" aperojn de la sama dosiero, kiam vi faros ŝanĝojn.\n"
" aperojn de la sama dosiero, kiam vi faros ŝanĝojn."
msgid " Quit, or continue with caution.\n"
msgstr " Eliru, aŭ daŭrigu singarde.\n"
msgid " Quit, or continue with caution.\n"
msgstr " Eliru, aŭ daŭrigu singarde.\n"
msgid ""
"\n"
"(2) An edit session for this file crashed.\n"
msgstr ""
"\n"
"(2) Redakta seanco de tiu dosiero kolapsis.\n"
msgid "(2) An edit session for this file crashed.\n"
msgstr "(2) Redakta seanco de tiu dosiero kolapsis.\n"
msgid " If this is the case, use \":recover\" or \"vim -r "
msgstr " Se veras, uzu \":recover\" aŭ \"vim -r "
@@ -4094,8 +4105,9 @@ msgstr "E838: netbeans ne estas subtenata kun tiu grafika interfaco"
msgid "E511: netbeans already connected"
msgstr "E511: nebeans jam konektata"
msgid "E505: "
msgstr "E505: "
#, c-format
msgid "E505: %s is read-only (add ! to override)"
msgstr "E505: %s estas nurlegebla (aldonu ! por transpasi)"
msgid "E349: No identifier under cursor"
msgstr "E349: Neniu identigilo sub la kursoro"
@@ -4260,6 +4272,9 @@ msgstr "E519: Opcio ne subtenata"
msgid "E520: Not allowed in a modeline"
msgstr "E520: Ne permesita en reĝimlinio"
msgid "E846: Key code not set"
msgstr "E846: Klavkodo ne agordita"
msgid "E521: Number required after ="
msgstr "E521: Nombro bezonata malantaŭ ="
@@ -5183,6 +5198,9 @@ msgstr "Nekonata flago en %s linio %d: %s"
msgid "Ignored %d words with non-ASCII characters"
msgstr "Ignoris %d vorto(j)n kun neaskiaj signoj"
msgid "E845: Insufficient memory, word list will be incomplete"
msgstr "E845: Ne sufiĉe da memoro, vortlisto estos nekompleta."
#, c-format
msgid "Compressed %d of %d nodes; %d (%d%%) remaining"
msgstr "Densigis %d de %d nodoj; %d (%d%%) restantaj"
@@ -5373,6 +5391,9 @@ msgstr "E394: Ne trovis regionan elementon por %s"
msgid "E397: Filename required"
msgstr "E397: Dosiernomo bezonata"
msgid "E847: Too many syntax includes"
msgstr "E847: Tro da sintaksaj inkluzivoj"
#, c-format
msgid "E789: Missing ']': %s"
msgstr "E789: Mankas ']': %s"
@@ -5385,6 +5406,9 @@ msgstr "E398: Mankas '=': %s"
msgid "E399: Not enough arguments: syntax region %s"
msgstr "E399: Ne sufiĉaj argumentoj: sintaksa regiono %s"
msgid "E848: Too many syntax clusters"
msgstr "E848: Tro da sintaksaj grupoj"
msgid "E400: No cluster specified"
msgstr "E400: Neniu fasko specifita"
@@ -5488,6 +5512,9 @@ msgstr "E669: Nepresebla signo en nomo de grupo"
msgid "W18: Invalid character in group name"
msgstr "W18: Nevalida signo en nomo de grupo"
msgid "E849: Too many highlight and syntax groups"
msgstr "E849: Tro da emfazaj kaj sintaksaj grupoj"
msgid "E555: at bottom of tag stack"
msgstr "E555: ĉe subo de stako de etikedoj"
@@ -5662,7 +5689,7 @@ msgstr "Ne legas malfaran dosieron, posedanto malsamas: %s"
#, c-format
msgid "Reading undo file: %s"
msgstr "Legado de de malfara dosiero: %s"
msgstr "Legado de malfara dosiero: %s"
#, c-format
msgid "E822: Cannot open undo file for reading: %s"
@@ -5839,13 +5866,6 @@ msgstr ""
"\n"
"Versio Mak OS"
msgid ""
"\n"
"RISC OS version"
msgstr ""
"\n"
"Versio RISC operaciumo"
msgid ""
"\n"
"OpenVMS version"
@@ -6035,7 +6055,7 @@ msgid "type :help version7<Enter> for version info"
msgstr "tajpu :help version7<Enenklavo> por informo de versio"
msgid "Running in Vi compatible mode"
msgstr "Rulas en reĝimo kongrua kun Vi"
msgstr "Rulas en reĝimo kongrua kun Vi"
# DP: atentu al la spacetoj: ĉiuj ĉenoj devas havi la saman longon
msgid "type :set nocp<Enter> for Vim defaults"
@@ -6050,11 +6070,11 @@ msgid "menu Help->Orphans for information "
msgstr "menuo Help->Orfinoj por pliaj informoj "
msgid "Running modeless, typed text is inserted"
msgstr "Rulas senreĝime, tajpita teksto estas enmetita"
msgstr "Rulas senreĝime, tajpita teksto estas enmetita"
# DP: atentu al la spacetoj: ĉiuj ĉenoj devas havi la saman longon
msgid "menu Edit->Global Settings->Toggle Insert Mode "
msgstr "menuo Redakti->Mallokaj Agordoj->Baskuli Enmetan Reĝimon"
msgstr "menuo Redakti->Mallokaj Agordoj->Baskuligi Enmetan Reĝimon"
# DP: atentu al la spacetoj: ĉiuj ĉenoj devas havi la saman longon
msgid " for two modes "
@@ -6063,7 +6083,7 @@ msgstr " por du reĝimoj "
# DP: tiu ĉeno pli longas (mi ne volas igi ĉiujn aliajn ĉenojn
# pli longajn)
msgid "menu Edit->Global Settings->Toggle Vi Compatible"
msgstr "menuo Redakti->Mallokaj Agordoj->Baskuli Reĝimon Kongruan kun Vi"
msgstr "menuo Redakti->Mallokaj Agordoj->Baskuligi Reĝimon Kongruan kun Vi"
# DP: atentu al la spacetoj: ĉiuj ĉenoj devas havi la saman longon
msgid " for Vim defaults "
@@ -6500,6 +6520,9 @@ msgstr "E139: Dosiero estas ŝargita en alia bufro"
msgid "E764: Option '%s' is not set"
msgstr "E764: La opcio '%s' ne estas ŝaltita"
msgid "E850: Invalid register name"
msgstr "E850: Nevalida nomo de reĝistro"
msgid "search hit TOP, continuing at BOTTOM"
msgstr "serĉo atingis SUPRON, daŭrigonte al SUBO"
@@ -6545,3 +6568,23 @@ msgstr "ne estas tia fenestro"
msgid "attempt to refer to deleted buffer"
msgstr "provo de referenco al forviŝita bufro"
#~ msgid ""
#~ "\n"
#~ "Arguments recognised by gvim (RISC OS version):\n"
#~ msgstr ""
#~ "\n"
#~ "Argumentoj agnoskitaj de gvim (versio RISC OS):\n"
#~ msgid "--columns <number>\tInitial width of window in columns"
#~ msgstr "--columns <nombro>\tKomenca larĝo de fenestro en kolumnoj"
#~ msgid "--rows <number>\tInitial height of window in rows"
#~ msgstr "--rows <nombro>\tKomenca alto de fenestro en vicoj"
#~ msgid ""
#~ "\n"
#~ "RISC OS version"
#~ msgstr ""
#~ "\n"
#~ "Versio RISC operaciumo"
+98 -51
View File
@@ -15,8 +15,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Vim(Français)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-01-26 22:14+0100\n"
"PO-Revision-Date: 2011-10-27 19:41+0200\n"
"POT-Creation-Date: 2011-06-21 17:23+0200\n"
"PO-Revision-Date: 2011-06-21 17:26+0200\n"
"Last-Translator: Dominique Pellé <dominique.pelle@gmail.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -639,6 +639,9 @@ msgstr "E725: Appel d'une fonction
msgid "E808: Number or Float required"
msgstr "E808: Nombre ou Flottant requis"
msgid "add() argument"
msgstr "argument de add()"
msgid "E699: Too many arguments"
msgstr "E699: Trop d'arguments"
@@ -655,10 +658,19 @@ msgstr "E785: complete() n'est utilisable que dans le mode Insertion"
msgid "&Ok"
msgstr "&Ok"
msgid "extend() argument"
msgstr "argument de extend()"
#, c-format
msgid "E737: Key already exists: %s"
msgstr "E737: un mappage existe déjà pour %s"
msgid "map() argument"
msgstr "argument de map()"
msgid "filter() argument"
msgstr "argument de filter()"
#, c-format
msgid "+-%s%3ld lines: "
msgstr "+-%s%3ld lignes : "
@@ -679,6 +691,9 @@ msgstr ""
msgid "called inputrestore() more often than inputsave()"
msgstr "inputrestore() a été appelé plus de fois qu'inputsave()"
msgid "insert() argument"
msgstr "argument de insert()"
msgid "E786: Range not allowed"
msgstr "E786: Les plages ne sont pas autorisées"
@@ -707,13 +722,22 @@ msgstr "E241: L'envoi au serveur %s
msgid "E277: Unable to read a server reply"
msgstr "E277: Impossible de lire la réponse du serveur"
msgid "remove() argument"
msgstr "argument de remove()"
msgid "E655: Too many symbolic links (cycle?)"
msgstr "E655: Trop de liens symboliques (cycle ?)"
msgid "reverse() argument"
msgstr "argument de reverse()"
# AB - La version française est meilleure que la version anglaise.
msgid "E258: Unable to send to client"
msgstr "E258: La réponse n'a pas pu être envoyée au client"
msgid "sort() argument"
msgstr "argument de sort()"
msgid "E702: Sort compare function failed"
msgstr "E702: La fonction de comparaison de sort() a échoué"
@@ -747,14 +771,6 @@ msgstr "E731: Utilisation d'un Dictionnaire comme une Cha
msgid "E806: using Float as a String"
msgstr "E806: Utilisation d'un Flottant comme une Chaîne"
#, c-format
msgid "E704: Funcref variable name must start with a capital: %s"
msgstr "E704: Le nom d'une Funcref doit commencer par une majuscule : %s"
#, c-format
msgid "E705: Variable name conflicts with existing function: %s"
msgstr "E705: Le nom d'une variable entre en conflit avec la fonction %s"
# DB : On doit pouvoir trouver nettement mieux que ça.
#, c-format
msgid "E706: Variable type mismatch for: %s"
@@ -764,6 +780,14 @@ msgstr "E706: Type de variable incoh
msgid "E795: Cannot delete variable %s"
msgstr "E795: Impossible de supprimer la variable %s"
#, c-format
msgid "E704: Funcref variable name must start with a capital: %s"
msgstr "E704: Le nom d'une Funcref doit commencer par une majuscule : %s"
#, c-format
msgid "E705: Variable name conflicts with existing function: %s"
msgstr "E705: Le nom d'une variable entre en conflit avec la fonction %s"
#, c-format
msgid "E741: Value is locked: %s"
msgstr "E741: La valeur de %s est verrouillée"
@@ -1468,7 +1492,8 @@ msgid "E183: User defined commands must start with an uppercase letter"
msgstr "E183: Les commandes utilisateur doivent commencer par une majuscule"
msgid "E841: Reserved name, cannot be used for user defined command"
msgstr "E841: Nom réservé, ne peux pas être utilisé pour une commande utilisateur"
msgstr ""
"E841: Nom réservé, ne peux pas être utilisé pour une commande utilisateur"
#, c-format
msgid "E184: No such user-defined command: %s"
@@ -1760,7 +1785,7 @@ msgid "E199: Active window or buffer deleted"
msgstr "E199: Fenêtre ou tampon actif effacé"
msgid "E812: Autocommands changed buffer or buffer name"
msgstr "E812: Des autocommandes on changé le tampon ou le nom du tampon"
msgstr "E812: Des autocommandes ont changé le tampon ou le nom du tampon"
msgid "Illegal file name"
msgstr "Nom de fichier invalide"
@@ -1831,6 +1856,9 @@ msgstr "[NON converti]"
msgid "[converted]"
msgstr "[converti]"
msgid "[blowfish]"
msgstr "[blowfish]"
msgid "[crypted]"
msgstr "[chiffré]"
@@ -2018,6 +2046,7 @@ msgstr "1 caract
msgid "%lld characters"
msgstr "%lld caractères"
#. Explicit typecast avoids warning on Mac OS X 10.6
#, c-format
msgid "%ld characters"
msgstr "%ld caractères"
@@ -2170,7 +2199,7 @@ msgid "E220: Missing }."
msgstr "E220: } manquant."
msgid "E490: No fold found"
msgstr "E490: Aucune repli trouvé"
msgstr "E490: Aucun repli trouvé"
msgid "E350: Cannot create fold with current 'foldmethod'"
msgstr "E350: Impossible de créer un repli avec la 'foldmethod'e actuelle"
@@ -3441,19 +3470,6 @@ msgstr "+reverse\t\tNe pas utiliser de vid
msgid "-xrm <resource>\tSet the specified resource"
msgstr "-xrm <ressource>\tConfigurer la <ressource> spécifiée"
msgid ""
"\n"
"Arguments recognised by gvim (RISC OS version):\n"
msgstr ""
"\n"
"Arguments reconnus par gvim (version RISC OS) :\n"
msgid "--columns <number>\tInitial width of window in columns"
msgstr "--columns <nombre>\tNombre de colonnes initial de la fenêtre"
msgid "--rows <number>\tInitial height of window in rows"
msgstr "--rows <nombre>\tNombre de lignes initial de la fenêtre"
msgid ""
"\n"
"Arguments recognised by gvim (GTK+ version):\n"
@@ -3971,24 +3987,20 @@ msgstr " PLUS R
#. * other languages.
msgid ""
"\n"
"(1) Another program may be editing the same file.\n"
" If this is the case, be careful not to end up with two\n"
" different instances of the same file when making changes.\n"
"(1) Another program may be editing the same file. If this is the case,\n"
" be careful not to end up with two different instances of the same\n"
" file when making changes."
msgstr ""
"\n"
"(1) Un autre programme est peut-être en train d'éditer ce fichier.\n"
" Si c'est le cas, faites attention à ne pas vous retrouver avec\n"
" deux version différentes du même fichier en faisant des modifications.\n"
" deux versions différentes du même fichier en faisant des modifications."
msgid " Quit, or continue with caution.\n"
msgstr " Quittez, ou continuez prudemment.\n"
msgid " Quit, or continue with caution.\n"
msgstr " Quittez, ou continuez prudemment.\n"
msgid ""
"\n"
"(2) An edit session for this file crashed.\n"
msgstr ""
"\n"
"(2) Une session d'édition de ce fichier a planté.\n"
msgid "(2) An edit session for this file crashed.\n"
msgstr "(2) Une session d'édition de ce fichier a planté.\n"
msgid " If this is the case, use \":recover\" or \"vim -r "
msgstr " Si c'est le cas, utilisez \":recover\" ou \"vim -r "
@@ -4331,8 +4343,9 @@ msgstr "E838: netbeans n'est pas support
msgid "E511: netbeans already connected"
msgstr "E511: netbeans déjà connecté"
msgid "E505: "
msgstr "E505: "
#, c-format
msgid "E505: %s is read-only (add ! to override)"
msgstr "E505: %s est en lecture seule (ajoutez ! pour passer outre)"
msgid "E349: No identifier under cursor"
msgstr "E349: Aucun identifiant sous le curseur"
@@ -4500,6 +4513,9 @@ msgstr "E519: Option non support
msgid "E520: Not allowed in a modeline"
msgstr "E520: Non autorisé dans une ligne de mode"
msgid "E846: Key code not set"
msgstr "E846: Le code de touche n'est pas configuré"
msgid "E521: Number required after ="
msgstr "E521: Nombre requis après ="
@@ -5152,7 +5168,7 @@ msgid "All included files were found"
msgstr "Tous les fichiers inclus ont été trouvés"
msgid "No included files"
msgstr "Aucun fichiers inclus"
msgstr "Aucun fichier inclus"
msgid "E388: Couldn't find definition"
msgstr "E388: Impossible de trouver la définition"
@@ -5296,7 +5312,7 @@ msgstr ""
#, c-format
msgid "Duplicate affix in %s line %d: %s"
msgstr "Affixe dupliquée dans %s ligne %d : %s"
msgstr "Affixe dupliqué dans %s ligne %d : %s"
#, c-format
msgid ""
@@ -5431,6 +5447,9 @@ msgstr "Drapeaux non reconnus dans %s ligne %d : %s"
msgid "Ignored %d words with non-ASCII characters"
msgstr "%d mot(s) ignoré(s) avec des caractères non-ASCII"
msgid "E845: Insufficient memory, word list will be incomplete"
msgstr "E845: mémoire insuffisante, liste de mots peut-être incomplète"
#, c-format
msgid "Compressed %d of %d nodes; %d (%d%%) remaining"
msgstr "%d noeuds compressés sur %d ; %d (%d%%) restants "
@@ -5496,7 +5515,7 @@ msgstr "Mot ajout
msgid "E763: Word characters differ between spell files"
msgstr ""
"E763: Les caractères de mots diffèrent entre les fichier orthographiques"
"E763: Les caractères de mots diffèrent entre les fichiers orthographiques"
msgid "Sorry, no suggestions"
msgstr "Désolé, aucune suggestion"
@@ -5627,6 +5646,9 @@ msgstr "E394: Aucun
msgid "E397: Filename required"
msgstr "E397: Nom de fichier requis"
msgid "E847: Too many syntax includes"
msgstr "E847: Trop d'inclusions de syntaxe"
#, c-format
msgid "E789: Missing ']': %s"
msgstr "E789: ']' manquant : %s"
@@ -5639,6 +5661,9 @@ msgstr "E398: '=' manquant : %s"
msgid "E399: Not enough arguments: syntax region %s"
msgstr "E399: Pas assez d'arguments : syntax region %s"
msgid "E848: Too many syntax clusters"
msgstr "E848: Trop de grappes de syntaxe"
msgid "E400: No cluster specified"
msgstr "E400: Aucune grappe spécifiée"
@@ -5744,6 +5769,9 @@ msgstr "E669: Caract
msgid "W18: Invalid character in group name"
msgstr "W18: Caractère invalide dans un nom de groupe"
msgid "E849: Too many highlight and syntax groups"
msgstr "E849: Trop de groupes de surbrillance et de syntaxe"
msgid "E555: at bottom of tag stack"
msgstr "E555: En bas de la pile de marqueurs"
@@ -5899,7 +5927,7 @@ msgstr ""
#, c-format
msgid "Will not overwrite with undo file, cannot read: %s"
msgstr "Le fichier d'annulations de sera pas écrasé, impossible de lire : %s"
msgstr "Le fichier d'annulations ne sera pas écrasé, impossible de lire : %s"
#, c-format
msgid "Will not overwrite, this is not an undo file: %s"
@@ -6102,13 +6130,6 @@ msgstr ""
"\n"
"Version MacOS"
msgid ""
"\n"
"RISC OS version"
msgstr ""
"\n"
"Version RISC OS"
msgid ""
"\n"
"OpenVMS version"
@@ -6762,6 +6783,9 @@ msgstr "E139: Le fichier est charg
msgid "E764: Option '%s' is not set"
msgstr "E764: L'option '%s' n'est pas activée"
msgid "E850: Invalid register name"
msgstr "E850: Nom de registre invalide"
msgid "search hit TOP, continuing at BOTTOM"
msgstr "La recherche a atteint le HAUT, et continue en BAS"
@@ -6807,3 +6831,26 @@ msgstr "Cette fen
msgid "attempt to refer to deleted buffer"
msgstr "tentative de référencer un tampon effacé"
#~ msgid ""
#~ "\n"
#~ "Arguments recognised by gvim (RISC OS version):\n"
#~ msgstr ""
#~ "\n"
#~ "Arguments reconnus par gvim (version RISC OS) :\n"
#~ msgid "--columns <number>\tInitial width of window in columns"
#~ msgstr "--columns <nombre>\tNombre de colonnes initial de la fenêtre"
#~ msgid "--rows <number>\tInitial height of window in rows"
#~ msgstr "--rows <nombre>\tNombre de lignes initial de la fenêtre"
#~ msgid ""
#~ "\n"
#~ "RISC OS version"
#~ msgstr ""
#~ "\n"
#~ "Version RISC OS"
#~ msgid "E505: "
#~ msgstr "E505: "
+1 -1
View File
@@ -56,7 +56,7 @@ void utf_find_illegal __ARGS((void));
int utf_valid_string __ARGS((char_u *s, char_u *end));
int dbcs_screen_tail_off __ARGS((char_u *base, char_u *p));
void mb_adjust_cursor __ARGS((void));
void mb_adjustpos __ARGS((pos_T *lp));
void mb_adjustpos __ARGS((buf_T *buf, pos_T *lp));
char_u *mb_prevptr __ARGS((char_u *line, char_u *p));
int mb_charlen __ARGS((char_u *str));
int mb_charlen_len __ARGS((char_u *str, int len));
+2
View File
@@ -14,6 +14,7 @@ int decl __ARGS((pos_T *lp));
linenr_T get_cursor_rel_lnum __ARGS((win_T *wp, linenr_T lnum));
void check_cursor_lnum __ARGS((void));
void check_cursor_col __ARGS((void));
void check_cursor_col_win __ARGS((win_T *win));
void check_cursor __ARGS((void));
void adjust_cursor_col __ARGS((void));
int leftcol_changed __ARGS((void));
@@ -57,6 +58,7 @@ int ga_grow __ARGS((garray_T *gap, int n));
char_u *ga_concat_strings __ARGS((garray_T *gap));
void ga_concat __ARGS((garray_T *gap, char_u *s));
void ga_append __ARGS((garray_T *gap, int c));
void append_ga_line __ARGS((garray_T *gap));
int name_to_mod_mask __ARGS((int c));
int simplify_key __ARGS((int key, int *modifiers));
int handle_x_keys __ARGS((int key));
+236 -3
View File
@@ -666,8 +666,12 @@ static char_u *regnext __ARGS((char_u *));
static void regc __ARGS((int b));
#ifdef FEAT_MBYTE
static void regmbc __ARGS((int c));
# define REGMBC(x) regmbc(x);
# define CASEMBC(x) case x:
#else
# define regmbc(c) regc(c)
# define REGMBC(x)
# define CASEMBC(x)
#endif
static void reginsert __ARGS((int, char_u *));
static void reginsert_limits __ARGS((int, long, long, char_u *));
@@ -787,68 +791,295 @@ reg_equi_class(c)
switch (c)
{
case 'A': case '\300': case '\301': case '\302':
CASEMBC(0x100) CASEMBC(0x102) CASEMBC(0x104) CASEMBC(0x1cd)
CASEMBC(0x1de) CASEMBC(0x1e0) CASEMBC(0x1ea2)
case '\303': case '\304': case '\305':
regmbc('A'); regmbc('\300'); regmbc('\301');
regmbc('\302'); regmbc('\303'); regmbc('\304');
regmbc('\305');
REGMBC(0x100) REGMBC(0x102) REGMBC(0x104)
REGMBC(0x1cd) REGMBC(0x1de) REGMBC(0x1e0)
REGMBC(0x1ea2)
return;
case 'B': CASEMBC(0x1e02) CASEMBC(0x1e06)
regmbc('B'); REGMBC(0x1e02) REGMBC(0x1e06)
return;
case 'C': case '\307':
CASEMBC(0x106) CASEMBC(0x108) CASEMBC(0x10a) CASEMBC(0x10c)
regmbc('C'); regmbc('\307');
REGMBC(0x106) REGMBC(0x108) REGMBC(0x10a)
REGMBC(0x10c)
return;
case 'D': CASEMBC(0x10e) CASEMBC(0x110) CASEMBC(0x1e0a)
CASEMBC(0x1e0e) CASEMBC(0x1e10)
regmbc('D'); REGMBC(0x10e) REGMBC(0x110)
REGMBC(0x1e0a) REGMBC(0x1e0e) REGMBC(0x1e10)
return;
case 'E': case '\310': case '\311': case '\312': case '\313':
CASEMBC(0x112) CASEMBC(0x114) CASEMBC(0x116) CASEMBC(0x118)
CASEMBC(0x11a) CASEMBC(0x1eba) CASEMBC(0x1ebc)
regmbc('E'); regmbc('\310'); regmbc('\311');
regmbc('\312'); regmbc('\313');
REGMBC(0x112) REGMBC(0x114) REGMBC(0x116)
REGMBC(0x118) REGMBC(0x11a) REGMBC(0x1eba)
REGMBC(0x1ebc)
return;
case 'F': CASEMBC(0x1e1e)
regmbc('F'); REGMBC(0x1e1e)
return;
case 'G': CASEMBC(0x11c) CASEMBC(0x11e) CASEMBC(0x120)
CASEMBC(0x122) CASEMBC(0x1e4) CASEMBC(0x1e6) CASEMBC(0x1f4)
CASEMBC(0x1e20)
regmbc('G'); REGMBC(0x11c) REGMBC(0x11e)
REGMBC(0x120) REGMBC(0x122) REGMBC(0x1e4)
REGMBC(0x1e6) REGMBC(0x1f4) REGMBC(0x1e20)
return;
case 'H': CASEMBC(0x124) CASEMBC(0x126) CASEMBC(0x1e22)
CASEMBC(0x1e26) CASEMBC(0x1e28)
regmbc('H'); REGMBC(0x124) REGMBC(0x126)
REGMBC(0x1e22) REGMBC(0x1e26) REGMBC(0x1e28)
return;
case 'I': case '\314': case '\315': case '\316': case '\317':
CASEMBC(0x128) CASEMBC(0x12a) CASEMBC(0x12c) CASEMBC(0x12e)
CASEMBC(0x130) CASEMBC(0x1cf) CASEMBC(0x1ec8)
regmbc('I'); regmbc('\314'); regmbc('\315');
regmbc('\316'); regmbc('\317');
REGMBC(0x128) REGMBC(0x12a) REGMBC(0x12c)
REGMBC(0x12e) REGMBC(0x130) REGMBC(0x1cf)
REGMBC(0x1ec8)
return;
case 'J': CASEMBC(0x134)
regmbc('J'); REGMBC(0x134)
return;
case 'K': CASEMBC(0x136) CASEMBC(0x1e8) CASEMBC(0x1e30)
CASEMBC(0x1e34)
regmbc('K'); REGMBC(0x136) REGMBC(0x1e8)
REGMBC(0x1e30) REGMBC(0x1e34)
return;
case 'L': CASEMBC(0x139) CASEMBC(0x13b) CASEMBC(0x13d)
CASEMBC(0x13f) CASEMBC(0x141) CASEMBC(0x1e3a)
regmbc('L'); REGMBC(0x139) REGMBC(0x13b)
REGMBC(0x13d) REGMBC(0x13f) REGMBC(0x141)
REGMBC(0x1e3a)
return;
case 'M': CASEMBC(0x1e3e) CASEMBC(0x1e40)
regmbc('M'); REGMBC(0x1e3e) REGMBC(0x1e40)
return;
case 'N': case '\321':
CASEMBC(0x143) CASEMBC(0x145) CASEMBC(0x147) CASEMBC(0x1e44)
CASEMBC(0x1e48)
regmbc('N'); regmbc('\321');
REGMBC(0x143) REGMBC(0x145) REGMBC(0x147)
REGMBC(0x1e44) REGMBC(0x1e48)
return;
case 'O': case '\322': case '\323': case '\324': case '\325':
case '\326':
case '\326': case '\330':
CASEMBC(0x14c) CASEMBC(0x14e) CASEMBC(0x150) CASEMBC(0x1a0)
CASEMBC(0x1d1) CASEMBC(0x1ea) CASEMBC(0x1ec) CASEMBC(0x1ece)
regmbc('O'); regmbc('\322'); regmbc('\323');
regmbc('\324'); regmbc('\325'); regmbc('\326');
regmbc('\330');
REGMBC(0x14c) REGMBC(0x14e) REGMBC(0x150)
REGMBC(0x1a0) REGMBC(0x1d1) REGMBC(0x1ea)
REGMBC(0x1ec) REGMBC(0x1ece)
return;
case 'P': case 0x1e54: case 0x1e56:
regmbc('P'); REGMBC(0x1e54) REGMBC(0x1e56)
return;
case 'R': CASEMBC(0x154) CASEMBC(0x156) CASEMBC(0x158)
CASEMBC(0x1e58) CASEMBC(0x1e5e)
regmbc('R'); REGMBC(0x154) REGMBC(0x156) REGMBC(0x158)
REGMBC(0x1e58) REGMBC(0x1e5e)
return;
case 'S': CASEMBC(0x15a) CASEMBC(0x15c) CASEMBC(0x15e)
CASEMBC(0x160) CASEMBC(0x1e60)
regmbc('S'); REGMBC(0x15a) REGMBC(0x15c)
REGMBC(0x15e) REGMBC(0x160) REGMBC(0x1e60)
return;
case 'T': CASEMBC(0x162) CASEMBC(0x164) CASEMBC(0x166)
CASEMBC(0x1e6a) CASEMBC(0x1e6e)
regmbc('T'); REGMBC(0x162) REGMBC(0x164)
REGMBC(0x166) REGMBC(0x1e6a) REGMBC(0x1e6e)
return;
case 'U': case '\331': case '\332': case '\333': case '\334':
CASEMBC(0x168) CASEMBC(0x16a) CASEMBC(0x16c) CASEMBC(0x16e)
CASEMBC(0x170) CASEMBC(0x172) CASEMBC(0x1af) CASEMBC(0x1d3)
CASEMBC(0x1ee6)
regmbc('U'); regmbc('\331'); regmbc('\332');
regmbc('\333'); regmbc('\334');
REGMBC(0x168) REGMBC(0x16a) REGMBC(0x16c)
REGMBC(0x16e) REGMBC(0x170) REGMBC(0x172)
REGMBC(0x1af) REGMBC(0x1d3) REGMBC(0x1ee6)
return;
case 'V': CASEMBC(0x1e7c)
regmbc('V'); REGMBC(0x1e7c)
return;
case 'W': CASEMBC(0x174) CASEMBC(0x1e80) CASEMBC(0x1e82)
CASEMBC(0x1e84) CASEMBC(0x1e86)
regmbc('W'); REGMBC(0x174) REGMBC(0x1e80)
REGMBC(0x1e82) REGMBC(0x1e84) REGMBC(0x1e86)
return;
case 'X': CASEMBC(0x1e8a) CASEMBC(0x1e8c)
regmbc('X'); REGMBC(0x1e8a) REGMBC(0x1e8c)
return;
case 'Y': case '\335':
CASEMBC(0x176) CASEMBC(0x178) CASEMBC(0x1e8e) CASEMBC(0x1ef2)
CASEMBC(0x1ef6) CASEMBC(0x1ef8)
regmbc('Y'); regmbc('\335');
REGMBC(0x176) REGMBC(0x178) REGMBC(0x1e8e)
REGMBC(0x1ef2) REGMBC(0x1ef6) REGMBC(0x1ef8)
return;
case 'Z': CASEMBC(0x179) CASEMBC(0x17b) CASEMBC(0x17d)
CASEMBC(0x1b5) CASEMBC(0x1e90) CASEMBC(0x1e94)
regmbc('Z'); REGMBC(0x179) REGMBC(0x17b)
REGMBC(0x17d) REGMBC(0x1b5) REGMBC(0x1e90)
REGMBC(0x1e94)
return;
case 'a': case '\340': case '\341': case '\342':
case '\343': case '\344': case '\345':
CASEMBC(0x101) CASEMBC(0x103) CASEMBC(0x105) CASEMBC(0x1ce)
CASEMBC(0x1df) CASEMBC(0x1e1) CASEMBC(0x1ea3)
regmbc('a'); regmbc('\340'); regmbc('\341');
regmbc('\342'); regmbc('\343'); regmbc('\344');
regmbc('\345');
REGMBC(0x101) REGMBC(0x103) REGMBC(0x105)
REGMBC(0x1ce) REGMBC(0x1df) REGMBC(0x1e1)
REGMBC(0x1ea3)
return;
case 'b': CASEMBC(0x1e03) CASEMBC(0x1e07)
regmbc('b'); REGMBC(0x1e03) REGMBC(0x1e07)
return;
case 'c': case '\347':
CASEMBC(0x107) CASEMBC(0x109) CASEMBC(0x10b) CASEMBC(0x10d)
regmbc('c'); regmbc('\347');
REGMBC(0x107) REGMBC(0x109) REGMBC(0x10b)
REGMBC(0x10d)
return;
case 'd': CASEMBC(0x10f) CASEMBC(0x111) CASEMBC(0x1d0b)
CASEMBC(0x1e11)
regmbc('d'); REGMBC(0x10f) REGMBC(0x111)
REGMBC(0x1e0b) REGMBC(0x01e0f) REGMBC(0x1e11)
return;
case 'e': case '\350': case '\351': case '\352': case '\353':
CASEMBC(0x113) CASEMBC(0x115) CASEMBC(0x117) CASEMBC(0x119)
CASEMBC(0x11b) CASEMBC(0x1ebb) CASEMBC(0x1ebd)
regmbc('e'); regmbc('\350'); regmbc('\351');
regmbc('\352'); regmbc('\353');
REGMBC(0x113) REGMBC(0x115) REGMBC(0x117)
REGMBC(0x119) REGMBC(0x11b) REGMBC(0x1ebb)
REGMBC(0x1ebd)
return;
case 'f': CASEMBC(0x1e1f)
regmbc('f'); REGMBC(0x1e1f)
return;
case 'g': CASEMBC(0x11d) CASEMBC(0x11f) CASEMBC(0x121)
CASEMBC(0x123) CASEMBC(0x1e5) CASEMBC(0x1e7) CASEMBC(0x1f5)
CASEMBC(0x1e21)
regmbc('g'); REGMBC(0x11d) REGMBC(0x11f)
REGMBC(0x121) REGMBC(0x123) REGMBC(0x1e5)
REGMBC(0x1e7) REGMBC(0x1f5) REGMBC(0x1e21)
return;
case 'h': CASEMBC(0x125) CASEMBC(0x127) CASEMBC(0x1e23)
CASEMBC(0x1e27) CASEMBC(0x1e29) CASEMBC(0x1e96)
regmbc('h'); REGMBC(0x125) REGMBC(0x127)
REGMBC(0x1e23) REGMBC(0x1e27) REGMBC(0x1e29)
REGMBC(0x1e96)
return;
case 'i': case '\354': case '\355': case '\356': case '\357':
CASEMBC(0x129) CASEMBC(0x12b) CASEMBC(0x12d) CASEMBC(0x12f)
CASEMBC(0x1d0) CASEMBC(0x1ec9)
regmbc('i'); regmbc('\354'); regmbc('\355');
regmbc('\356'); regmbc('\357');
REGMBC(0x129) REGMBC(0x12b) REGMBC(0x12d)
REGMBC(0x12f) REGMBC(0x1d0) REGMBC(0x1ec9)
return;
case 'j': CASEMBC(0x135) CASEMBC(0x1f0)
regmbc('j'); REGMBC(0x135) REGMBC(0x1f0)
return;
case 'k': CASEMBC(0x137) CASEMBC(0x1e9) CASEMBC(0x1e31)
CASEMBC(0x1e35)
regmbc('k'); REGMBC(0x137) REGMBC(0x1e9)
REGMBC(0x1e31) REGMBC(0x1e35)
return;
case 'l': CASEMBC(0x13a) CASEMBC(0x13c) CASEMBC(0x13e)
CASEMBC(0x140) CASEMBC(0x142) CASEMBC(0x1e3b)
regmbc('l'); REGMBC(0x13a) REGMBC(0x13c)
REGMBC(0x13e) REGMBC(0x140) REGMBC(0x142)
REGMBC(0x1e3b)
return;
case 'm': CASEMBC(0x1e3f) CASEMBC(0x1e41)
regmbc('m'); REGMBC(0x1e3f) REGMBC(0x1e41)
return;
case 'n': case '\361':
CASEMBC(0x144) CASEMBC(0x146) CASEMBC(0x148) CASEMBC(0x149)
CASEMBC(0x1e45) CASEMBC(0x1e49)
regmbc('n'); regmbc('\361');
REGMBC(0x144) REGMBC(0x146) REGMBC(0x148)
REGMBC(0x149) REGMBC(0x1e45) REGMBC(0x1e49)
return;
case 'o': case '\362': case '\363': case '\364': case '\365':
case '\366':
case '\366': case '\370':
CASEMBC(0x14d) CASEMBC(0x14f) CASEMBC(0x151) CASEMBC(0x1a1)
CASEMBC(0x1d2) CASEMBC(0x1eb) CASEMBC(0x1ed) CASEMBC(0x1ecf)
regmbc('o'); regmbc('\362'); regmbc('\363');
regmbc('\364'); regmbc('\365'); regmbc('\366');
regmbc('\370');
REGMBC(0x14d) REGMBC(0x14f) REGMBC(0x151)
REGMBC(0x1a1) REGMBC(0x1d2) REGMBC(0x1eb)
REGMBC(0x1ed) REGMBC(0x1ecf)
return;
case 'p': CASEMBC(0x1e55) CASEMBC(0x1e57)
regmbc('p'); REGMBC(0x1e55) REGMBC(0x1e57)
return;
case 'r': CASEMBC(0x155) CASEMBC(0x157) CASEMBC(0x159)
CASEMBC(0x1e59) CASEMBC(0x1e5f)
regmbc('r'); REGMBC(0x155) REGMBC(0x157) REGMBC(0x159)
REGMBC(0x1e59) REGMBC(0x1e5f)
return;
case 's': CASEMBC(0x15b) CASEMBC(0x15d) CASEMBC(0x15f)
CASEMBC(0x161) CASEMBC(0x1e61)
regmbc('s'); REGMBC(0x15b) REGMBC(0x15d)
REGMBC(0x15f) REGMBC(0x161) REGMBC(0x1e61)
return;
case 't': CASEMBC(0x163) CASEMBC(0x165) CASEMBC(0x167)
CASEMBC(0x1e6b) CASEMBC(0x1e6f) CASEMBC(0x1e97)
regmbc('t'); REGMBC(0x163) REGMBC(0x165) REGMBC(0x167)
REGMBC(0x1e6b) REGMBC(0x1e6f) REGMBC(0x1e97)
return;
case 'u': case '\371': case '\372': case '\373': case '\374':
CASEMBC(0x169) CASEMBC(0x16b) CASEMBC(0x16d) CASEMBC(0x16f)
CASEMBC(0x171) CASEMBC(0x173) CASEMBC(0x1b0) CASEMBC(0x1d4)
CASEMBC(0x1ee7)
regmbc('u'); regmbc('\371'); regmbc('\372');
regmbc('\373'); regmbc('\374');
REGMBC(0x169) REGMBC(0x16b) REGMBC(0x16d)
REGMBC(0x16f) REGMBC(0x171) REGMBC(0x173)
REGMBC(0x1b0) REGMBC(0x1d4) REGMBC(0x1ee7)
return;
case 'v': CASEMBC(0x1e7d)
regmbc('v'); REGMBC(0x1e7d)
return;
case 'w': CASEMBC(0x175) CASEMBC(0x1e81) CASEMBC(0x1e83)
CASEMBC(0x1e85) CASEMBC(0x1e87) CASEMBC(0x1e98)
regmbc('w'); REGMBC(0x175) REGMBC(0x1e81)
REGMBC(0x1e83) REGMBC(0x1e85) REGMBC(0x1e87)
REGMBC(0x1e98)
return;
case 'x': CASEMBC(0x1e8b) CASEMBC(0x1e8d)
regmbc('x'); REGMBC(0x1e8b) REGMBC(0x1e8d)
return;
case 'y': case '\375': case '\377':
CASEMBC(0x177) CASEMBC(0x1e8f) CASEMBC(0x1e99)
CASEMBC(0x1ef3) CASEMBC(0x1ef7) CASEMBC(0x1ef9)
regmbc('y'); regmbc('\375'); regmbc('\377');
REGMBC(0x177) REGMBC(0x1e8f) REGMBC(0x1e99)
REGMBC(0x1ef3) REGMBC(0x1ef7) REGMBC(0x1ef9)
return;
case 'z': CASEMBC(0x17a) CASEMBC(0x17c) CASEMBC(0x17e)
CASEMBC(0x1b6) CASEMBC(0x1e91) CASEMBC(0x1e95)
regmbc('z'); REGMBC(0x17a) REGMBC(0x17c)
REGMBC(0x17e) REGMBC(0x1b6) REGMBC(0x1e91)
REGMBC(0x1e95)
return;
}
#endif
@@ -2468,6 +2699,8 @@ regc(b)
regmbc(c)
int c;
{
if (!has_mbyte && c > 0xff)
return;
if (regcode == JUST_CALC_SIZE)
regsize += (*mb_char2len)(c);
else
@@ -2588,7 +2821,7 @@ regtail(p, val)
else
offset = (int)(val - scan);
/* When the offset uses more than 16 bits it can no longer fit in the two
* bytes avaliable. Use a global flag to avoid having to check return
* bytes available. Use a global flag to avoid having to check return
* values in too many places. */
if (offset > 0xffff)
reg_toolong = TRUE;
+1 -1
View File
@@ -1594,7 +1594,7 @@ searchc(cap, t_cmd)
/* Force a move of at least one char, so ";" and "," will move the
* cursor, even if the cursor is right in front of char we are looking
* at. */
if (vim_strchr(p_cpo, CPO_SCOLON) == NULL && count == 1)
if (vim_strchr(p_cpo, CPO_SCOLON) == NULL && count == 1 && t_cmd)
stop = FALSE;
}
+2 -1
View File
@@ -29,7 +29,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
test66.out test67.out test68.out test69.out test70.out \
test71.out test72.out test73.out test74.out test75.out \
test76.out test77.out test78.out test79.out test80.out \
test81.out
test81.out test82.out
.SUFFIXES: .in .out
@@ -130,3 +130,4 @@ test78.out: test78.in
test79.out: test79.in
test80.out: test80.in
test81.out: test81.in
test82.out: test82.in
+1 -1
View File
@@ -29,7 +29,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
test42.out test52.out test65.out test66.out test67.out \
test68.out test69.out test71.out test72.out test73.out \
test74.out test75.out test76.out test77.out test78.out \
test79.out test80.out test81.out
test79.out test80.out test81.out test82.out
SCRIPTS32 = test50.out test70.out
+1 -1
View File
@@ -49,7 +49,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
test42.out test52.out test65.out test66.out test67.out \
test68.out test69.out test71.out test72.out test73.out \
test74.out test75.out test76.out test77.out test78.out \
test79.out test80.out test81.out
test79.out test80.out test81.out test82.out
SCRIPTS32 = test50.out test70.out
+1 -1
View File
@@ -29,7 +29,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
test66.out test67.out test68.out test69.out test70.out \
test71.out test72.out test73.out test74.out test75.out \
test76.out test77.out test78.out test79.out test80.out \
test81.out
test81.out test82.out
.SUFFIXES: .in .out
+3 -2
View File
@@ -4,7 +4,7 @@
# Authors: Zoltan Arpadffy, <arpadffy@polarhome.com>
# Sandor Kopanyi, <sandor.kopanyi@mailbox.hu>
#
# Last change: 2011 Jun 26
# Last change: 2011 Jul 15
#
# This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
# Edit the lines in the Configuration section below to select.
@@ -75,7 +75,8 @@ SCRIPT = test1.out test2.out test3.out test4.out test5.out \
test61.out test62.out test63.out test64.out test65.out \
test66.out test67.out test68.out test69.out \
test71.out test72.out test74.out test75.out test76.out \
test77.out test78.out test79.out test80.out test81.out
test77.out test78.out test79.out test80.out test81.out \
test82.out
# Known problems:
# Test 30: a problem around mac format - unknown reason
+1 -1
View File
@@ -26,7 +26,7 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
test64.out test65.out test66.out test67.out test68.out \
test69.out test70.out test71.out test72.out test73.out \
test74.out test75.out test76.out test77.out test78.out \
test79.out test80.out test81.out
test79.out test80.out test81.out test82.out
SCRIPTS_GUI = test16.out
+170 -1
View File
@@ -1450,6 +1450,36 @@ void func3(void)
printf("Don't you dare indent this line incorrectly!\n);
}
STARTTEST
:set cino&
:set cino+=l1
2kdd=][
ENDTEST
void func(void)
{
int tab[] =
{
1, 2, 3,
4, 5, 6};
printf("Indent this line correctly!\n");
switch (foo)
{
case bar:
printf("bar");
break;
case baz: {
printf("baz");
break;
}
case quux:
printf("But don't break the indentation of this instruction\n");
break;
}
}
STARTTEST
:set cino&
2kdd=][
@@ -1562,7 +1592,7 @@ NAMESPACEEND
STARTTEST
:set cino=J1
:set cino=j1,J1
/^JSSTART
=/^JSEND
ENDTEST
@@ -1582,6 +1612,145 @@ x: 4,
}
JSEND
STARTTEST
:set cino=j1,J1
/^JSSTART
=/^JSEND
ENDTEST
JSSTART
var foo = [
1, // indent 8 more
2,
3
]; // indent 8 less
JSEND
STARTTEST
:set cino=j1,J1
/^JSSTART
=/^JSEND
ENDTEST
JSSTART
function bar() {
var foo = [
1,
2,
3
]; // indent 16 less
}
JSEND
STARTTEST
:set cino=j1,J1
/^JSSTART
=/^JSEND
ENDTEST
JSSTART
(function($){
var class_name='myclass';
function private_method() {
}
var public_method={
method: function(options,args){
private_method();
}
}
function init(options) {
$(this).data(class_name+'_public',$.extend({},{
foo: 'bar',
bar: 2, // indent 8 more
foobar: [ // indent 8 more
1, // indent 8 more
2, // indent 16 more
3 // indent 16 more
],
callback: function(){ // indent 8 more
return true; // indent 8 more
} // indent 8 more
}, options||{}));
}
$.fn[class_name]=function() {
var _arguments=arguments;
return this.each(function(){
var options=$(this).data(class_name+'_public');
if (!options) {
init.apply(this,_arguments);
} else {
var method=public_method[_arguments[0]];
if (typeof(method)!='function') {
console.log(class_name+' has no method "'+_arguments[0]+'"');
return false;
}
_arguments[0]=options;
method.apply(this,_arguments);
}
});
}
})(jQuery);
JSEND
STARTTEST
:set cino=j1,J1
/^JSSTART
=/^JSEND
ENDTEST
JSSTART
function init(options) {
$(this).data(class_name+'_public',$.extend({},{
foo: 'bar',
bar: 2,
foobar: [
1, // indent 8 more
2, // indent 8 more
3 // indent 8 more
],
callback: function(){
return true;
}
}, options||{}));
}
JSEND
STARTTEST
:set cino=j1,J1
/^JSSTART
=/^JSEND
ENDTEST
JSSTART
(function($){
function init(options) {
$(this).data(class_name+'_public',$.extend({},{
foo: 'bar',
bar: 2, // indent 8 more
foobar: [ // indent 8 more
1, // indent 8 more
2, // indent 16 more
3 // indent 16 more
],
callback: function(){ // indent 8 more
return true; // indent 8 more
} // indent 8 more
}, options||{}));
}
})(jQuery);
JSEND
STARTTEST
:g/^STARTTEST/.,/^ENDTEST/d
:1;/start of AUTO/,$wq! test.out
+139
View File
@@ -1308,6 +1308,31 @@ void func3(void)
}
void func(void)
{
int tab[] =
{
1, 2, 3,
4, 5, 6};
printf("Indent this line correctly!\n");
switch (foo)
{
case bar:
printf("bar");
break;
case baz: {
printf("baz");
break;
}
case quux:
printf("But don't break the indentation of this instruction\n");
break;
}
}
void func(void)
{
cout << "a"
@@ -1418,3 +1443,117 @@ var bar = {
}
JSEND
JSSTART
var foo = [
1, // indent 8 more
2,
3
]; // indent 8 less
JSEND
JSSTART
function bar() {
var foo = [
1,
2,
3
]; // indent 16 less
}
JSEND
JSSTART
(function($){
var class_name='myclass';
function private_method() {
}
var public_method={
method: function(options,args){
private_method();
}
}
function init(options) {
$(this).data(class_name+'_public',$.extend({},{
foo: 'bar',
bar: 2, // indent 8 more
foobar: [ // indent 8 more
1, // indent 8 more
2, // indent 16 more
3 // indent 16 more
],
callback: function(){ // indent 8 more
return true; // indent 8 more
} // indent 8 more
}, options||{}));
}
$.fn[class_name]=function() {
var _arguments=arguments;
return this.each(function(){
var options=$(this).data(class_name+'_public');
if (!options) {
init.apply(this,_arguments);
} else {
var method=public_method[_arguments[0]];
if (typeof(method)!='function') {
console.log(class_name+' has no method "'+_arguments[0]+'"');
return false;
}
_arguments[0]=options;
method.apply(this,_arguments);
}
});
}
})(jQuery);
JSEND
JSSTART
function init(options) {
$(this).data(class_name+'_public',$.extend({},{
foo: 'bar',
bar: 2,
foobar: [
1, // indent 8 more
2, // indent 8 more
3 // indent 8 more
],
callback: function(){
return true;
}
}, options||{}));
}
JSEND
JSSTART
(function($){
function init(options) {
$(this).data(class_name+'_public',$.extend({},{
foo: 'bar',
bar: 2, // indent 8 more
foobar: [ // indent 8 more
1, // indent 8 more
2, // indent 16 more
3 // indent 16 more
],
callback: function(){ // indent 8 more
return true; // indent 8 more
} // indent 8 more
}, options||{}));
}
})(jQuery);
JSEND
+4
View File
@@ -27,6 +27,8 @@ x/[\u4f7f\u5929]\+
x/\%U12345678
x/[\U1234abcd\u1234\uabcd]
x/\%d21879b
x/ [[=A=]]* [[=B=]]* [[=C=]]* [[=D=]]* [[=E=]]* [[=F=]]* [[=G=]]* [[=H=]]* [[=I=]]* [[=J=]]* [[=K=]]* [[=L=]]* [[=M=]]* [[=N=]]* [[=O=]]* [[=P=]]* [[=Q=]]* [[=R=]]* [[=S=]]* [[=T=]]* [[=U=]]* [[=V=]]* [[=W=]]* [[=X=]]* [[=Y=]]* [[=Z=]]*/e
x/ [[=a=]]* [[=b=]]* [[=c=]]* [[=d=]]* [[=e=]]* [[=f=]]* [[=g=]]* [[=h=]]* [[=i=]]* [[=j=]]* [[=k=]]* [[=l=]]* [[=m=]]* [[=n=]]* [[=o=]]* [[=p=]]* [[=q=]]* [[=r=]]* [[=s=]]* [[=t=]]* [[=u=]]* [[=v=]]* [[=w=]]* [[=x=]]* [[=y=]]* [[=z=]]*/e
x:?^1?,$w! test.out
:e! test.out
G:put =matchstr(\"×בגד\", \".\", 0, 2) " ב
@@ -53,3 +55,5 @@ d 天使x
e ü’…™¸y
f ü’Нz
g aå•·bb
h AÀÁÂÃÄÅĀĂĄǍǞǠẢ BḂḆ CÇĆĈĊČ DĎĐḊḎḐ EÈÉÊËĒĔĖĘĚẺẼ FḞ GĜĞĠĢǤǦǴḠ HĤĦḢḦḨ IÌÍÎÏĨĪĬĮİǏỈ JĴ KĶǨḰḴ LĹĻĽĿŁḺ MḾṀ NÑŃŅŇṄṈ OÒÓÔÕÖØŌŎŐƠǑǪǬỎ PṔṖ Q RŔŖŘṘṞ SŚŜŞŠṠ TŢŤŦṪṮ UÙÚÛÜŨŪŬŮŰŲƯǓỦ VṼ WŴẀẂẄẆ XẊẌ YÝŶŸẎỲỶỸ ZŹŻŽƵẐẔ
i aàáâãäåāăąǎǟǡả bḃḇ cçćĉċč dďđḋḏḑ eèéêëēĕėęěẻẽ fḟ gĝğġģǥǧǵḡ hĥħḣḧḩẖ iìíîïĩīĭįǐỉ jĵǰ kķǩḱḵ lĺļľŀłḻ mḿṁ nñńņňʼnṅṉ oòóôõöøōŏőơǒǫǭỏ pṕṗ q rŕŗřṙṟ sśŝşšṡ tţťŧṫṯẗ uùúûüũūŭůűųưǔủ vṽ wŵẁẃẅẇẘ xẋẍ yýÿŷẏẙỳỷỹ zźżžƶẑẕ
+2
View File
@@ -14,6 +14,8 @@ d 使x
e y
f z
g abb
h AÀÁÂÃÄÅĀĂĄǍǞǠẢ BḂḆ CÇĆĈĊČ DĎĐḊḎḐ EÈÉÊËĒĔĖĘĚẺẼ FḞ GĜĞĠĢǤǦǴḠ HĤĦḢḦḨ IÌÍÎÏĨĪĬĮİǏỈ JĴ KĶǨḰḴ LĹĻĽĿŁḺ MḾṀ NÑŃŅŇṄṈ OÒÓÔÕÖØŌŎŐƠǑǪǬỎ PṔṖ Q RŔŖŘṘṞ SŚŜŞŠṠ TŢŤŦṪṮ UÙÚÛÜŨŪŬŮŰŲƯǓỦ VṼ WŴẀẂẄẆ XẊẌ YÝŶŸẎỲỶỸ ZŹŻŽƵẐ
i aàáâãäåāăąǎǟǡả bḃḇ cçćĉċč dďđḋḏḑ eèéêëēĕėęěẻẽ fḟ gĝğġģǥǧǵḡ hĥħḣḧḩẖ iìíîïĩīĭįǐỉ jĵǰ kķǩḱḵ lĺļľŀłḻ mḿṁ nñńņňʼnṅṉ oòóôõöøōŏőơǒǫǭỏ pṕṗ q rŕŗřṙṟ sśŝşšṡ tţťŧṫṯẗ uùúûüũūŭůűųưǔủ vṽ wŵẁẃẅẇẘ xẋẍ yýÿŷẏẙỳỷỹ zźżžƶẑ
ב
בג
א
+1 -1
View File
@@ -6,7 +6,7 @@ blocks.
STARTTEST
:so small.vim
:set nocp fileformat=unix undolevels=-1
:set nocp fileformat=unix undolevels=-1 viminfo+=nviminfo
:e! Xtest
ggdG
:let text = "\tabcdefghijklmnoparstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnoparstuvwxyz0123456789"
+5 -1
View File
@@ -1,10 +1,12 @@
Test for t movement command and 'cpo-;' setting
STARTTEST
:set nocompatible
:set nocompatible viminfo+=nviminfo
:set cpo-=;
/firstline/
j0tt;D
0fz;D
$Fy;D
$Ty;D:set cpo+=;
j0tt;;D
$Ty;;D:?firstline?+1,$w! test.out
@@ -13,6 +15,8 @@ ENDTEST
firstline
aaa two three four
zzz
yyy
bbb yee yoo four
ccc two three four
ddd yee yoo four
+2
View File
@@ -1,4 +1,6 @@
aaa two
z
y
bbb y
ccc
ddd yee y
+93
View File
@@ -0,0 +1,93 @@
Tests for case-insensitive UTF-8 comparisons (utf_strnicmp() in mbyte.c)
STARTTEST
:so small.vim
:if !has("multi_byte")
: e! test.ok
: w! test.out
: qa!
:endif
:set enc=utf8
ggdG
:
:function! Ch(a, op, b, expected)
: if eval(printf('"%s" %s "%s"', a:a, a:op, a:b)) != a:expected
: call append(line('$'), printf('"%s" %s "%s" should return %d', a:a, a:op, a:b, a:expected))
: else
: let b:passed += 1
: endif
:endfunction
:
:function! Chk(a, b, result)
: if a:result == 0
: call Ch(a:a, '==?', a:b, 1)
: call Ch(a:a, '!=?', a:b, 0)
: call Ch(a:a, '<=?', a:b, 1)
: call Ch(a:a, '>=?', a:b, 1)
: call Ch(a:a, '<?', a:b, 0)
: call Ch(a:a, '>?', a:b, 0)
: elseif a:result > 0
: call Ch(a:a, '==?', a:b, 0)
: call Ch(a:a, '!=?', a:b, 1)
: call Ch(a:a, '<=?', a:b, 0)
: call Ch(a:a, '>=?', a:b, 1)
: call Ch(a:a, '<?', a:b, 0)
: call Ch(a:a, '>?', a:b, 1)
: else
: call Ch(a:a, '==?', a:b, 0)
: call Ch(a:a, '!=?', a:b, 1)
: call Ch(a:a, '<=?', a:b, 1)
: call Ch(a:a, '>=?', a:b, 0)
: call Ch(a:a, '<?', a:b, 1)
: call Ch(a:a, '>?', a:b, 0)
: endif
:endfunction
:
:function! Check(a, b, result)
: call Chk(a:a, a:b, a:result)
: call Chk(a:b, a:a, -a:result)
:endfunction
:
:function! LT(a, b)
: call Check(a:a, a:b, -1)
:endfunction
:
:function! GT(a, b)
: call Check(a:a, a:b, 1)
:endfunction
:
:function! EQ(a, b)
: call Check(a:a, a:b, 0)
:endfunction
:
:let b:passed=0
:call EQ('', '')
:call LT('', 'a')
:call EQ('abc', 'abc')
:call EQ('Abc', 'abC')
:call LT('ab', 'abc')
:call LT('AB', 'abc')
:call LT('ab', 'aBc')
:call EQ('\xd0\xb9\xd1\x86\xd1\x83\xd0\xba\xd0\xb5\xd0\xbd', '\xd0\xb9\xd0\xa6\xd0\xa3\xd0\xba\xd0\x95\xd0\xbd')
:call LT('\xd0\xb9\xd1\x86\xd1\x83\xd0\xba\xd0\xb5\xd0\xbd', '\xd0\xaf\xd1\x86\xd1\x83\xd0\xba\xd0\xb5\xd0\xbd')
:call EQ('\xe2\x84\xaa', 'k')
:call LT('\xe2\x84\xaa', 'kkkkkk')
:call EQ('\xe2\x84\xaa\xe2\x84\xaa\xe2\x84\xaa', 'kkk')
:call LT('kk', '\xe2\x84\xaa\xe2\x84\xaa\xe2\x84\xaa')
:call EQ('\xe2\x84\xaa\xe2\x84\xa6k\xe2\x84\xaak\xcf\x89', 'k\xcf\x89\xe2\x84\xaakk\xe2\x84\xa6')
:call EQ('Abc\x80', 'AbC\x80')
:call LT('Abc\x80', 'AbC\x81')
:call LT('Abc', 'AbC\x80')
:call LT('abc\x80DEF', 'abc\x80def') " case folding stops at the first bad character
:call LT('\xc3XYZ', '\xc3xyz')
:call EQ('\xef\xbc\xba', '\xef\xbd\x9a') " FF3A (upper), FF5A (lower)
:call GT('\xef\xbc\xba', '\xef\xbc\xff') " first string is ok and equals \xef\xbd\x9a after folding, second string is illegal and was left unchanged, then the strings were bytewise compared
:call LT('\xc3', '\xc3\x83')
:call EQ('\xc3\xa3xYz', '\xc3\x83XyZ')
:for n in range(0x60, 0xFF) | call LT(printf('xYz\x%.2X', n-1), printf('XyZ\x%.2X', n)) | endfor
:for n in range(0x80, 0xBF) | call EQ(printf('xYz\xc2\x%.2XUvW', n), printf('XyZ\xc2\x%.2XuVw', n)) | endfor
:for n in range(0xC0, 0xFF) | call LT(printf('xYz\xc2\x%.2XUvW', n), printf('XyZ\xc2\x%.2XuVw', n)) | endfor
:call append(0, printf('%d checks passed', b:passed))
:wq! test.out
ENDTEST
+2
View File
@@ -0,0 +1,2 @@
3732 checks passed
+1 -1
View File
@@ -58,7 +58,7 @@ ui_write(s, len)
#endif
}
#if defined(UNIX) || defined(VMS) || defined(PROTO)
#if defined(UNIX) || defined(VMS) || defined(PROTO) || defined(WIN3264)
/*
* When executing an external program, there may be some typed characters that
* are not consumed by it. Give them back to ui_inchar() and they are stored
+46
View File
@@ -724,6 +724,52 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
260,
/**/
259,
/**/
258,
/**/
257,
/**/
256,
/**/
255,
/**/
254,
/**/
253,
/**/
252,
/**/
251,
/**/
250,
/**/
249,
/**/
248,
/**/
247,
/**/
246,
/**/
245,
/**/
244,
/**/
243,
/**/
242,
/**/
241,
/**/
240,
/**/
239,
/**/
238,
/**/
237,
/**/
+1
View File
@@ -818,6 +818,7 @@ extern char *(*dyn_libintl_textdomain)(const char *domainname);
#define EW_EXEC 0x40 /* executable files */
#define EW_PATH 0x80 /* search in 'path' too */
#define EW_ICASE 0x100 /* ignore case */
#define EW_NOERROR 0x200 /* no error for bad regexp */
/* Note: mostly EW_NOTFOUND and EW_SILENT are mutually exclusive: EW_NOTFOUND
* is used when executing commands and EW_SILENT for interactive expanding. */