Compare commits

...

143 Commits

Author SHA1 Message Date
Kazuki Sakamoto b0f7e1f006 MacVim Snapshot 131
Binary targets macOS 10.8+

- Vim patch 8.0.0596
- Fix mvim script to allow symbolic link it properly
- Add MMShareFindPboard to control sharing search text to the Find Pasteboard

Script interfaces have compatibility with these versions

- Lua 5.2
- Perl 5.16
- Python2 2.7
- Python3 3.6.1
- Ruby 2.0
2017-05-04 19:52:22 -07:00
Kazuki Sakamoto e2090aa9fb Merge pull request #502 from macvim-dev/MMShareFindPboard
Control sharing the find pasteboard with defaults
2017-05-04 18:17:14 -07:00
Kazuki Sakamoto bbfa7164d7 Update gui_mac.txt for MMShareFindPboard 2017-05-04 18:16:34 -07:00
Kazuki Sakamoto fa3b48c6a5 Control sharing the find pasteboard with defaults
`MMShareFindPboard` default is `YES`.

    $ defaults write org.vim.MacVim MMShareFindPboard -bool NO
2017-05-04 13:18:02 -07:00
Kazuki Sakamoto 6458d0b6bd Update mvim script document 2017-05-03 16:18:29 -07:00
Kazuki Sakamoto 936eef5ed7 Use ln with -f option for creating mvim symbolic link 2017-05-03 08:22:58 -07:00
Kazuki Sakamoto 3dfad5901a Delete installing mvim scripts from Travis CI build 2017-05-03 07:56:44 -07:00
Kazuki Sakamoto d46539b451 mvim.sh is no longer needed 2017-05-03 07:56:09 -07:00
Kazuki Sakamoto bbfebc8793 Add build phase for copying mvim scripts 2017-05-03 07:54:33 -07:00
Kazuki Sakamoto dc708f3025 Emulate "readlink -f" to get real $0 2017-05-03 07:51:05 -07:00
Kazuki Sakamoto f0377b844a Use the new mvim script for binary release 2017-05-02 10:26:10 -07:00
Kazuki Sakamoto 3417d483e3 Add mvim script for MacVim.app/Contents/bin/mvim 2017-05-02 10:24:05 -07:00
Kazuki Sakamoto a5ebfbc999 Merge remote-tracking branch 'vim/master' 2017-05-01 15:01:30 -07:00
Bram Moolenaar 4475b62396 patch 8.0.0596: crash when complete() called after complete_add()
Problem:    Crash when complete() is called after complete_add() in
            'completefunc'. (Lifepillar)
Solution:   Bail out if compl_pattern is NULL. (closes #1668)
            Also avoid using freed memory.
2017-05-01 20:46:52 +02:00
Bram Moolenaar beb9cb19c6 patch 8.0.0595: Coverity warning for not checking return value
Problem:    Coverity warning for not checking return value of dict_add().
Solution:   Check the return value for FAIL.
2017-05-01 14:14:04 +02:00
Bram Moolenaar 66c0e70b80 patch 8.0.0594: build failure when windows feature is missing
Problem:    Build failure when windows feature is missing.
Solution:   Add #ifdef.
2017-04-30 20:46:32 +02:00
Bram Moolenaar 45cf6e910c patch 8.0.0593: duplication of code for adding a list or dict return value
Problem:    Duplication of code for adding a list or dict return value.
Solution:   Add rettv_dict_set() and rettv_list_set(). (Yegappan Lakshmanan)
2017-04-30 20:25:19 +02:00
Bram Moolenaar 29ae377ea7 patch 8.0.0592: if a job writes to a buffer screen is not updated
Problem:    If a job writes to a buffer and the user is typing a command, the
            screen isn't updated. When a message is displayed the changed
            buffer may cause it to be cleared. (Ramel Eshed)
Solution:   Update the screen and then the command line if the screen didn't
            scroll. Avoid inserting screen lines, as it clears any message.
            Update the status line when the buffer changed.
2017-04-30 19:39:39 +02:00
Bram Moolenaar 45d2cca1ea patch 8.0.0591: changes to eval functionality not documented
Problem:    Changes to eval functionality not documented.
Solution:   Include all the changes.
2017-04-30 16:36:05 +02:00
Bram Moolenaar 8f77c5a4ec patch 8.0.0590: cannot add a context to locations
Problem:    Cannot add a context to locations.
Solution:   Add the "context" entry in location entries. (Yegappan Lakshmanan,
            closes #1012)
2017-04-30 14:21:00 +02:00
Bram Moolenaar a21ccb7a97 patch 8.0.0589: :simalt still does not work
Problem:    :simalt still does not work.
Solution:   Use K_NOP instead of K_IGNORE. (Christian Brabandt)
2017-04-29 17:40:22 +02:00
Bram Moolenaar 1a9020d4cb patch 8.0.0588: job_stop() often assumes the channel will be closed
Problem:    job_stop() often assumes the channel will be closed, while the job
            may not actually be stopped. (Martin Gammelsæter)
Solution:   Only assume the job stops on "kill".  Don't send a signal if the
            job has already ended. (closes #1632)
2017-04-29 16:24:38 +02:00
Bram Moolenaar 0635ee6824 Runtime file updates 2017-04-28 20:32:33 +02:00
Bram Moolenaar 696cbd224b patch 8.0.0587: configure check for return value of tgetent skipped
Problem:    Configure check for return value of tgetent is skipped.
Solution:   Always perform the check. (Marvin Schmidt, closes #1664)
2017-04-28 15:45:46 +02:00
Kazuki Sakamoto 5b04c1386d Merge remote-tracking branch 'vim/master' 2017-04-23 21:27:02 -07:00
Bram Moolenaar b7637c44c2 patch 8.0.0586: no test for mapping timing out
Problem:    No test for mapping timing out.
Solution:   Add a test.
2017-04-23 18:49:36 +02:00
Bram Moolenaar 86e5792906 patch 8.0.0585: test_options fails when run in the GUI
Problem:    Test_options fails when run in the GUI.
Solution:   Also check the 'imactivatekey' value when the GUI is not running.
            Specify test values that work and that fail.
2017-04-23 18:44:26 +02:00
Bram Moolenaar 94237495c0 Updated runtime files. 2017-04-23 18:40:21 +02:00
Bram Moolenaar d788f6fe89 patch 8.0.0584: memory leak when executing quickfix tests
Problem:    Memory leak when executing quickfix tests.
Solution:   Free the list reference. (Yegappan Lakshmanan)
2017-04-23 17:19:43 +02:00
Bram Moolenaar b11c826ddc patch 8.0.0583: fold test hangs on MS-Windows
Problem:    Fold test hangs on MS-Windows.
Solution:   Avoid overflow in compare.
2017-04-23 16:48:20 +02:00
Kazuki Sakamoto 4638209904 Merge remote-tracking branch 'vim/master' 2017-04-22 20:32:50 -07:00
Bram Moolenaar 5b276aa80e patch 8.0.0582: illegal memory access with z= command
Problem:    Illegal memory access with z= command. (Dominique Pelle)
Solution:   Avoid case folded text to be longer than the original text.  Use
            MB_PTR2LEN() instead of MB_BYTE2LEN().
2017-04-22 23:49:52 +02:00
Bram Moolenaar 94be619e30 patch 8.0.0581: moving folded text is sometimes not correct
Problem:    Moving folded text is sometimes not correct.
Solution:   Bail out when "move_end" is zero. (Matthew Malcomson)
2017-04-22 22:40:11 +02:00
Bram Moolenaar f1d21c8cc8 patch 8.0.0580: cannot set the valid flag with setqflist()
Problem:    Cannot set the valid flag with setqflist().
Solution:   Add the "valid" argument. (Yegappan Lakshmanan, closes #1642)
2017-04-22 21:20:46 +02:00
Bram Moolenaar 9b77016545 patch 8.0.0579: duplicate test case for quickfix
Problem:    Duplicate test case for quickfix.
Solution:   Remove the function. (Yegappan Lakshmanan)
2017-04-22 15:42:53 +02:00
Bram Moolenaar 7a85b0f028 patch 8.0.0578: :simalt on MS-Windows does not work properly
Problem:    :simalt on MS-Windows does not work properly.
Solution:   Put something in the typeahead buffer. (Christian Brabandt)
2017-04-22 15:17:40 +02:00
Kazuki Sakamoto bfe75bfe0f make cmdidxs 2017-04-21 20:13:06 -07:00
Kazuki Sakamoto fb12ba89f7 Merge remote-tracking branch 'vim/master' 2017-04-21 20:04:41 -07:00
Bram Moolenaar 97db5541a6 patch 8.0.0577: warning for uninitialized variable
Problem:    Warning for uninitialized variable. (John Marriott)
Solution:   Initialize "indent".
2017-04-21 23:18:26 +02:00
Bram Moolenaar 1d4be82c7d patch 8.0.0576: can't build when configure choses "install-sh"
Problem:    Can't build when configure choses "install-sh". (Daniel Hahler)
Solution:   Always use install-sh.  Fix remaining use of mkinstalldirs.
            (closes #1647)
2017-04-21 23:00:02 +02:00
Bram Moolenaar a701b3b6f0 patch 8.0.0575: using freed memory when resetting 'indentexpr'
Problem:    Using freed memory when resetting 'indentexpr' while evaluating
            it. (Dominique Pelle)
Solution:   Make a copy of 'indentexpr'.
2017-04-20 22:57:27 +02:00
Bram Moolenaar 99895eac1c patch 8.0.0574: get only one quickfix list after :caddbuf
Problem:    Get only one quickfix list after :caddbuf.
Solution:   Reset qf_multiline. (Yegappan Lakshmanan)
2017-04-20 22:44:47 +02:00
Bram Moolenaar 91b6e4591a patch 8.0.0573: running parallel make after distclean fails
Problem:    Running parallel make after distclean fails. (Manuel Ortega)
Solution:   Instead of using targets "scratch config myself" use "reconfig".
2017-04-20 22:32:24 +02:00
Bram Moolenaar 6de5e12601 patch 8.0.0572: building the command table requires Perl
Problem:    Building the command table requires Perl.
Solution:   Use a Vim script solution. (Dominique Pelle, closes #1641)
2017-04-20 21:55:44 +02:00
Bram Moolenaar a364cdb648 patch 8.0.0571: negative line number when using :z^ in an empty buffer
Problem:    The cursor line number becomes negative when using :z^ in an empty
            buffer. (neovim #6557)
Solution:   Correct the line number.  Also reset the column.
2017-04-20 21:12:30 +02:00
Bram Moolenaar c03944151f patch 8.0.0570: can't run make with several jobs
Problem:    Can't run make with several jobs, creating directories has a race
            condition.
Solution:   Use the MKDIR_P autoconf mechanism. (Eric N. Vander Weele,
            closes #1639)
2017-04-20 20:20:23 +02:00
Bram Moolenaar 62cf09b5dc patch 8.0.0569: bracketed paste is still enabled in a shell command
Problem:    Bracketed paste is still enabled when executing a shell command.
            (Michael Smith)
Solution:   Disable brackted paste when going into cooked mode. (closes #1638)
2017-04-20 19:44:09 +02:00
Bram Moolenaar 60402d68da patch 8.0.0568: 1gd may hang
Problem:    "1gd" may hang.
Solution:   Don't get stuck in one position. (Christian Brabandt, closes #1643)
2017-04-20 18:54:50 +02:00
Kazuki Sakamoto 1afdb997de MacVim Snapshot 131
Binary targets macOS 10.8+

- Vim patch 8.0.0567
- Fix artifacts when entering full screen
- Fix flashing during window resizing

Script interfaces have compatibility with these versions

- Lua 5.2
- Perl 5.16
- Python2 2.7
- Python3 3.6.1
- Ruby 2.0
2017-04-18 20:37:38 -07:00
Kazuki Sakamoto 701ac80cae Merge remote-tracking branch 'vim/master' 2017-04-18 19:24:12 -07:00
Bram Moolenaar fc8f1118e7 patch 8.0.0567: call for requesting color and ambiwidth is too early
Problem:    Call for requesting color and ambiwidth is too early. (Hirohito
            Higashi)
Solution:   Move the call down to below resetting "starting".
2017-04-18 18:51:35 +02:00
Kazuki Sakamoto 52a9a472de Merge remote-tracking branch 'vim/master' 2017-04-15 21:50:24 -07:00
Bram Moolenaar 43d1ac6e81 patch 8.0.0566: setting nocompatible for the tiny version moves the cursor
Problem:    Setting nocompatible for the tiny version moves the cursor.
Solution:   Use another trick to skip commands when the +eval feature is
            present. (Christian Brabandt, closes #1630)
2017-04-15 15:37:25 +02:00
Bram Moolenaar 31bdd13c33 patch 8.0.0565: using freed memory in :caddbuf
Problem:    Using freed memory in :caddbuf after clearing quickfix list.
            (Dominique Pelle)
Solution:   Set qf_last to NULL.
2017-04-15 15:22:52 +02:00
Bram Moolenaar 39170e2d97 patch 8.0.0564: cannot detect Bazel BUILD files on some systems
Problem:    Cannot detect Bazel BUILD files on some systems.
Solution:   Check for BUILD after script checks. (Issue #1340)
2017-04-15 14:36:07 +02:00
Kazuki Sakamoto 957bedab9c Merge remote-tracking branch 'vim/master' 2017-04-11 22:51:13 -07:00
Bram Moolenaar 9f92886277 patch 8.0.0563: crash when getting the window position in tmux
Problem:    Crash when getting the window position in tmux. (Marvin Schmidt)
Solution:   Add t_GP to the list of terminal options. (closes #1627)
2017-04-11 22:44:05 +02:00
Kazuki Sakamoto 4f54a3d2c2 Merge remote-tracking branch 'vim/master' 2017-04-10 19:20:00 -07:00
Bram Moolenaar ea588154d0 patch 8.0.0562: not enough test coverage for syntax commands
Problem:    Not enough test coverage for syntax commands.
Solution:   Add a few more tests. (Dominique Pelle, closes #1624)
2017-04-10 22:45:30 +02:00
Bram Moolenaar 478af67dd6 patch 8.0.0561: undefined behavior when using backslash after empty line
Problem:    Undefined behavior when using backslash after empty line.
Solution:   Check for an empty line. (Dominique Pelle, closes #1631)
2017-04-10 22:22:42 +02:00
Bram Moolenaar 451a4a1cb7 patch 8.0.0560: :windo allows for ! but it's not supported
Problem:    :windo allows for ! but it's not supported.
Solution:   Disallow passing !. (Hirohito Higashi)
2017-04-10 21:46:38 +02:00
Kazuki Sakamoto 23c70e0101 Merge pull request #495 from s4y/s4y/fullscreen_contentSize
Fix changing font size in full screen.
2017-04-09 18:10:36 -07:00
Kazuki Sakamoto 487dd9d27b Merge remote-tracking branch 'vim/master' 2017-04-09 15:51:52 -07:00
Bram Moolenaar f803a76978 patch 8.0.0559: setting ttytype to xxx does not always fail
Problem:    Setting ttytype to xxx does not always fail as expected. (Marvin
            Schmidt)
Solution:   Catch both possible errors. (closes #1601)
2017-04-09 22:54:13 +02:00
Bram Moolenaar cd5c8f8250 Update runtime files. 2017-04-09 20:11:58 +02:00
Bram Moolenaar f8ec998613 patch 8.0.0558: :ownsyntax is not tested
Problem:    The :ownsyntax command is not tested.
Solution:   Add a test. (Dominique Pelle, closes #1622)
2017-04-09 15:41:31 +02:00
Bram Moolenaar 59053e1d9f patch 8.0.0557: GTK: using static gravities is not useful
Problem:    GTK: using static gravities is not useful.
Solution:   Remove setting static gravities. (Kazunobu Kuriyama)
2017-04-09 15:27:09 +02:00
Bram Moolenaar 7860bac57b patch 8.0.0556: getting window position fails if GUI and term possible
Problem:    Getting the window position fails if both the GUI and term
            code is built in.
Solution:   Return after getting the GUI window position. (Kazunobu Kuriyama)
2017-04-09 15:03:15 +02:00
Bram Moolenaar d2381a2cad patch 8.0.0555: toupper/tolower test fails on OSX without Darwin
Problem:    Toupper/tolower test fails on OSX without Darwin.
Solution:   Skip that part of the test also for OSX. (Kazunobu Kuriyama)
2017-04-09 14:58:15 +02:00
Bram Moolenaar 1cc482069a patch 8.0.0554: toupper and tolower don't work properly for Turkish
Problem:    Toupper and tolower don't work properly for Turkish when 'casemap'
            contains "keepascii". (Bjorn Linse)
Solution:   When 'casemap' contains "keepascii" use ASCII toupper/tolower.
2017-04-09 13:41:59 +02:00
Bram Moolenaar 9f4de1f543 patch 8.0.0553: toupper/tolower test fails on Mac
Problem:    Toupper/tolower test with Turkish locale fails on Mac.
Solution:   Skip the test on Mac.
2017-04-08 19:39:43 +02:00
Bram Moolenaar 3317d5ebbe patch 8.0.0552: toupper and tolower don't work properly for Turkish
Problem:    Toupper and tolower don't work properly for Turkish when 'casemap'
            is empty. (Bjorn Linse)
Solution:   Check the 'casemap' options when deciding how to upper/lower case.
2017-04-08 19:12:06 +02:00
Bram Moolenaar d34f9b1155 patch 8.0.0551: the typeahead buffer is reallocated too often
Problem:    The typeahead buffer is reallocated too often.
Solution:   Re-use the existing buffer if possible.
2017-04-08 18:41:13 +02:00
Bram Moolenaar 9585a1655b patch 8.0.0550: cannot parse some etags format tags file
Problem:    Some etags format tags file use 0x01, breaking the parsing.
Solution:   Use 0x02 for TAG_SEP. (James McCoy, closes #1614)
2017-04-07 20:30:29 +02:00
Bram Moolenaar 395b6bab33 patch 8.0.0549: no test for the 8g8 command
Problem:    No test for the 8g8 command.
Solution:   Add a test. (Dominique Pelle, closes #1615)
2017-04-07 20:09:51 +02:00
Bram Moolenaar d4863aa99e patch 8.0.0548: saving the redo buffer only works one time
Problem:    Saving the redo buffer only works one time, resulting in the "."
            command not working well for a function call inside another
            function call. (Ingo Karkat)
Solution:   Save the redo buffer at every user function call. (closes #1619)
2017-04-07 19:50:12 +02:00
Bram Moolenaar 52604f2454 patch 8.0.0547: extra line break in verbosefile
Problem:    Extra line break in verbosefile when using ":echomsg". (Ingo
            Karkat)
Solution:   Don't call msg_start(). (closes #1618)
2017-04-07 16:17:39 +02:00
Bram Moolenaar 3bab93998d patch 8.0.0546: swap file exists briefly when opening the command window
Problem:    Swap file exists briefly when opening the command window.
Solution:   Set the noswapfile command modifier before splitting the window.
            (James McCoy, closes #1620)
2017-04-07 15:42:25 +02:00
Bram Moolenaar 15ecbd6f3d patch 8.0.0545: edit test may fail on some systems
Problem:    Edit test may fail on some systems.
Solution:   If creating a directory with a very long path fails, bail out.
2017-04-07 14:10:48 +02:00
Bram Moolenaar 866c688610 patch 8.0.0544: cppcheck warnings
Problem:    Cppcheck warnings.
Solution:   Use temp variable. Change NUL to NULL. Swap conditions. (Dominique
            Pelle)
2017-04-07 14:02:01 +02:00
Bram Moolenaar ba6ec18297 patch 8.0.0543: test_edit causes older xfce4-terminal to close
Problem:    Test_edit causes older xfce4-terminal to close. (Dominique Pelle)
Solution:   Reduce number of columns to 2000.  Try to restore the window
            position.
2017-04-04 22:41:10 +02:00
Bram Moolenaar a1d5fa65bc patch 8.0.0542: getpos() can return a negative line number
Problem:    getpos() can return a negative line number. (haya14busa)
Solution:   Handle a zero topline and botline. (closes #1613)
2017-04-03 22:02:55 +02:00
Bram Moolenaar 04000560ca patch 8.0.0541: compiler warning on MS-Windows
Problem:    Compiler warning on MS-Windows.
Solution:   Add a type cast. (Mike Williams)
2017-04-03 21:35:42 +02:00
Sidney San Martín 6d2e8f8dca Choose how to resize the Vim view based on the full screen mode.
- Native full screen: Use the last externally-set window size. This lets
  Split View work without slowly growing or shrinking.

- Non-native full screen: Use the size of the full screen window.

- Not full screen: Use [vimView desiredSize] (unchanged).

This is somewhat nasty, but the different full screen code paths behave
differently enough that there doesn't seem to be one universally-correct
answer. It would be great to simplify them.
2017-04-03 14:31:00 -04:00
Bram Moolenaar a604429529 patch 8.0.0540: building unit tests fails
Problem:    Building unit tests fails.
Solution:   Move params outside of #ifdef.
2017-04-02 18:19:53 +02:00
Bram Moolenaar 08f88b139d patch 8.0.0539: startup test fails on Mac
Problem:    Startup test fails on Mac.
Solution:   Use another term name, "unknown" is known. Avoid a 2 second delay.
2017-04-02 17:21:16 +02:00
Bram Moolenaar 85045a73db patch 8.0.0538: no test for falling back to default term value
Problem:    No test for falling back to default term value.
Solution:   Add a test.
2017-04-02 16:54:09 +02:00
Bram Moolenaar fa0ad0bb0b patch 8.0.0537: illegal memory access with :z and large count
Problem:    Illegal memory access with :z and large count.
Solution:   Check for number overflow, using long instead of int. (Dominique
            Pelle, closes #1612)
2017-04-02 15:45:17 +02:00
Bram Moolenaar 69f40be645 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Problem:    Quickfix window not updated when freeing quickfix stack.
Solution:   Update the quickfix window. (Yegappan Lakshmanan)
2017-04-02 15:15:49 +02:00
Bram Moolenaar 6914c64ee5 patch 8.0.0535: memory leak when exiting from within a user function
Problem:    Memory leak when exiting from within a user function.
Solution:   Clear the function call stack on exit.
2017-04-01 21:21:30 +02:00
Bram Moolenaar 33ccb24cf7 patch 8.0.0534: defaults.vim does not work well with tiny features
Problem:    Defaults.vim does not work well with tiny features. (crd477)
Solution:   When the +eval feature is not available always reset 'compatible'.
2017-04-01 16:59:29 +02:00
Bram Moolenaar 878c263a48 patch 8.0.0533: abbreviation doesn't work after backspacing newline
Problem:    Abbreviation doesn't work after backspacing newline. (Hkonrk)
Solution:   Set the insert start column. (closes #1609)
2017-04-01 15:15:52 +02:00
Bram Moolenaar c77d675747 patch 8.0.0532: test with long directory name fails on Mac
Problem:    Test with long directory name fails on Mac.
Solution:   Skip the test on Mac systems.
2017-04-01 14:13:14 +02:00
Bram Moolenaar 9b81079ddd patch 8.0.0531: test with long directory name fails on non-unix systems
Problem:    Test with long directory name fails on non-unix systems.
Solution:   Skip the test on non-unix systems.
2017-03-31 23:32:53 +02:00
Bram Moolenaar 658a3a2caf patch 8.0.0530: buffer overflow when 'columns' is very big
Problem:    Buffer overflow when 'columns' is very big. (Nikolai Pavlov)
Solution:   Correctly compute where to truncate.  Fix translation.
            (closes #1600)
2017-03-31 22:27:12 +02:00
Kazuki Sakamoto 30f517fd68 Merge pull request #487 from s4y/s4y/fullscreen_flicker
Fix artifacts when entering full screen.
2017-03-31 13:24:05 -07:00
Kazuki Sakamoto 5daca9c5c6 Merge pull request #486 from s4y/s4y/resize_flicker
Fix flashing during window resizing.
2017-03-31 13:23:12 -07:00
Sidney San Martín 32e1fc9b2d Fix artifacts when entering full screen.
This changes MMFullScreenWindow to release the fade in a completion
handler for the current transaction, so that the app flushes updates
while the screen is black. It also fixes up the fadeReservationTime math
and bumps the slack to a full second so that a slightly slow draw
doesn't cause artifacts (in practice, the fade will be released as soon
as the window draws — the reservation time is just a failsafe).
2017-03-31 15:28:03 -04:00
Sidney San Martín 3fb41ccae8 Fix flashing during window resizing.
The root cause of flashing/flickering was that on each resize event,
AppKit called drawRect: on the MMCoreTextView, expecting it to fill an
empty, newly-sized buffer with content. It has nothing to draw, so the
view would show up as black until the BatchDrawMsgID reply arrived from
the backend and triggered another draw. (The MMCoreTextView was
display:ed twice for each resize).

This change does three things:

1. Implements -[MMCoreTextView setFrameSize:] to begin an
   NSAnimationContext grouping before calling super, which postpones
   display:/drawRect: until the grouping ends, and ends the grouping in
   performBatchDrawWithData:.

2. Makes *all* resize messages sent to the backend synchronous, with a
   1s timeout. This seems bad, but actually helps avoid spamming the
   backend with resize events, since the app only generates resize
   events as fast as we handle them (i.e. if we take time to process one
   resize, then the next resize event will have the current size of the
   window, potentially skipping a bunch in the middle that the backend
   never would have had time to handle).

3. Gets rid of some hacks resolved by 1 and 2, like MKVimController
   delaying the call to -[MMWindowController presentWindow:].
2017-03-31 14:06:00 -04:00
Bram Moolenaar 13489b9c41 patch 8.0.0529: line in test commented out
Problem:    Line in test commented out.
Solution:   Uncomment the lines for character classes that were failing before
            8.0.0519. (Dominique Pelle, closes #1599)
2017-03-30 22:20:29 +02:00
Bram Moolenaar ef8eb08978 patch 8.0.0528: highlight wrong text when 'wim' includes "longest"
Problem:    When 'wildmenu' is set and 'wildmode' has "longest" then the first
            file name is highlighted, even though the text shows the longest
            match.
Solution:   Do not highlight the first match. (LemonBoy, closes #1602)
2017-03-30 22:04:55 +02:00
Bram Moolenaar ce5c274201 patch 8.0.0527: leftover file from RISC OS
Problem:    RISC OS support was removed long ago, but one file is still
            included.
Solution:   Delete the file. (Thomas Dziedzic, closes #1603)
2017-03-30 21:51:31 +02:00
Bram Moolenaar 85325f839a patch 8.0.0526: Coverity complains about possible negative value
Problem:    Coverity complains about possible negative value.
Solution:   Check return value of ftell() not to be negative.
2017-03-30 21:18:45 +02:00
Kazuki Sakamoto 98496b9aa2 MacVim Snapshot 130
Binary targets macOS 10.8+

- Vim patch 8.0.0525
- Introduce columnspace (See :help columnspace)

Script interfaces have compatibility with these versions

- Lua 5.2
- Perl 5.16
- Python2 2.7
- Python3 3.6.1
- Ruby 2.0
2017-03-30 08:14:00 -07:00
Kazuki Sakamoto 547ad47ddc Update tags with gui_mac.txt 2017-03-30 08:13:27 -07:00
Kazuki Sakamoto ba14141413 Merge remote-tracking branch 'vim/master' 2017-03-29 21:28:31 -07:00
Bram Moolenaar a33ddbbd04 patch 8.0.0525: completion for user command argument not tested
Solution:   Completion for user command argument not tested.
Problem:    Add a test.
2017-03-29 21:30:04 +02:00
Bram Moolenaar 8da1e6cedf patch 8.0.0524: folds messed up
Problem:    Folds are messed up when 'encodin' is "utf-8".
Solution:   Also set the fold character when it's not multi-byte.
2017-03-29 20:38:59 +02:00
Bram Moolenaar bf3d58073f patch 8.0.0523: dv} deletes part of a multi-byte character.
Problem:    dv} deletes part of a multi-byte character. (Urtica Dioica)
Solution:   Include the whole character.
2017-03-29 19:48:11 +02:00
Bram Moolenaar 3fcfa35f82 patch 8.0.0522: Win32: when 'clipboard' is "unnamed" yyp does not work
Problem:    MS-Windows: when 'clipboard' is "unnamed" yyp does not work in a
            :global command.
Solution:   When setting the clipboard was postponed, do not clear the
            register.
2017-03-29 19:20:41 +02:00
Bram Moolenaar 99a6e8dd82 patch 8.0.0521: GtkForm handling is outdated
Problem:    GtkForm handling is outdated.
Solution:   Get rid of event filter functions.  Get rid of GtkForm.width and
            .height.  Eliminate gtk_widget_size_request() calls. (Kazunobu
            Kuriyama)
2017-03-29 18:07:40 +02:00
Bram Moolenaar ace95989ed patch 8.0.0520: using a function pointer while the function is known
Problem:    Using a function pointer instead of the actual function, which we
            know.
Solution:   Change mb_ functions to utf_ functions when already checked for
            Unicode. (Dominique Pelle, closes #1582)
2017-03-29 17:30:27 +02:00
Bram Moolenaar 0c078fc7db patch 8.0.0519: character classes are not well tested
Problem:    Character classes are not well tested. They can differ between
            platforms.
Solution:   Add tests.  In the documentation make clear which classes depend
            on what library function.  Only use :cntrl: and :graph: for ASCII.
            (Kazunobu Kuriyama, Dominique Pelle, closes #1560)
            Update the documentation.
2017-03-29 15:31:20 +02:00
Bram Moolenaar c6cd8409c2 patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Problem:    Storing a zero byte from a multi-byte character causes fold text
            to show up wrong.
Solution:   Avoid putting zero in ScreenLines. (Christian Brabandt,
            closes #1567)
2017-03-29 14:40:47 +02:00
Bram Moolenaar b6fa30ccc3 patch 8.0.0517: there is no way to remove quickfix lists
Problem:    There is no way to remove quickfix lists (for testing).
Solution:   Add the 'f' action to setqflist(). Add tests. (Yegappan
            Lakshmanan)
2017-03-29 14:19:25 +02:00
Bram Moolenaar e0720cbf63 Update runtime files. 2017-03-29 13:48:40 +02:00
Bram Moolenaar b1e04fca37 patch 8.0.0516: a large count on a normal command causes trouble
Problem:    A large count on a normal command causes trouble. (Dominique
            Pelle)
Solution:   Make "opcount" long.
2017-03-29 13:08:35 +02:00
Kazuki Sakamoto 1366a517ab Merge remote-tracking branch 'vim/master' 2017-03-28 19:34:55 -07:00
Bram Moolenaar d5d37537d1 patch 8.0.0515: ml_get errors in silent Ex mode
Problem:    ml_get errors in silent Ex mode. (Dominique Pelle)
Solution:   Clear valid flags when setting the cursor.  Set the topline when
            not in full screen mode.
2017-03-27 23:02:07 +02:00
Kazuki Sakamoto 1a53ab66f8 Merge remote-tracking branch 'vim/master' 2017-03-26 20:44:25 -07:00
Bram Moolenaar 980128c369 patch 8.0.0514: script for creating cmdidxs can be improved
Problem:    Script for creating cmdidxs can be improved.
Solution:   Count skipped lines instead of collecting the lines.  Add "const".
            (Dominique Pelle, closes #1594)
2017-03-26 21:46:28 +02:00
Bram Moolenaar c96272e30e patch 8.0.0513: getting name of cleared highlight group is wrong
Problem:    Getting name of cleared highlight group is wrong. (Matt Wozniski)
Solution:   Only skip over cleared names for completion. (closes #1592)
            Also fix that a cleared group causes duplicate completions.
2017-03-26 13:50:09 +02:00
Kazuki Sakamoto 46753d91c5 make cmdidxs 2017-03-25 20:46:31 -07:00
Kazuki Sakamoto d6d17c8f9f Merge remote-tracking branch 'vim/master' 2017-03-25 12:36:24 -07:00
Bram Moolenaar 1572e30607 patch 8.0.0512: check for available characters takes too long
Problem:    Check for available characters takes too long.
Solution:   Only check did_start_blocking if wtime is negative. (Daisuke
            Suzuki, closes #1591)
2017-03-25 20:16:28 +01:00
Bram Moolenaar a683ec44c3 patch 8.0.0511: message for skipping client-server tests is unclear
Problem:    Menuage for skipping client-server tests is unclear.
Solution:   Be more specific about what's missing (Hirohito Higashi, Kazunobu
            Kuriyama)
2017-03-25 20:14:34 +01:00
Kazuki Sakamoto fce3a430c3 Merge remote-tracking branch 'vim/master' 2017-03-25 11:17:49 -07:00
Bram Moolenaar 8a0141d4e7 patch 8.0.0510: typo in link to codecov.io results
Problem:    Typo in link to codecov.io results.
Solution:   Remove duplicate https:.
2017-03-25 18:10:31 +01:00
Bram Moolenaar dd00851e07 patch 8.0.0509: no link to codecov.io results
Problem:    No link to codecov.io results.
Solution:   Add a badge to the readme file.
2017-03-25 18:04:32 +01:00
Bram Moolenaar d722fd74d8 patch 8.0.0508: Coveralls no longer shows per-file coverage
Problem:    Coveralls no longer shows per-file coverage.
Solution:   Add coverage from codecov.io. (Christian Brabandt)
2017-03-25 17:46:59 +01:00
Bram Moolenaar a2845b8f5a patch 8.0.0507: client-server tests fail when $DISPLAY is not set
Problem:    Client-server tests fail when $DISPLAY is not set.
Solution:   Check for E240 before running the test.
2017-03-25 15:20:06 +01:00
Bram Moolenaar 6c0c1e8052 patch 8.0.0506: can't build with ANSI C
Problem:    Can't build with ANSI C.
Solution:   Move declarations to start of block.
2017-03-25 15:07:43 +01:00
Bram Moolenaar ba6ad17378 patch 8.0.0505: failed window split for :stag not handled
Problem:    Failed window split for :stag not handled. (Coverity CID 99204)
Solution:   If the split fails skip to the end. (bstaletic, closes #1577)
2017-03-25 15:03:45 +01:00
Bram Moolenaar e5e0fbcd42 patch 8.0.0504: looking up an Ex command is a bit slow
Problem:    Looking up an Ex command is a bit slow.
Solution:   Instead of just using the first letter, also use the second letter
            to skip ahead in the list of commands. Generate the table with a
            Perl script. (Dominique Pelle, closes #1589)
2017-03-25 14:51:01 +01:00
Kazuki Sakamoto 64fbbbb849 Merge remote-tracking branch 'vim/master' 2017-03-24 13:02:25 -07:00
Bram Moolenaar 9d20ce6970 patch 8.0.0503: endless loop in updating folds with 32 bit ints
Problem:    Endless loop in updating folds with 32 bit ints.
Solution:   Subtract from LHS instead of add to the RHS. (Matthew Malcomson)
2017-03-23 21:53:35 +01:00
Kazuki Sakamoto d057c8b909 Move columnspace under FEAT_GUI_MACVIM 2017-03-23 10:34:48 -07:00
Kazuki Sakamoto 6959bce946 Merge pull request #321 from tkonolige/master
Added columnspace
2017-03-23 10:20:08 -07:00
Tristan Konolige 08b0bdeb91 unnessisary FEAT_GUI_W32 2017-03-23 09:35:35 -07:00
Tristan Konolige 95620d6b49 Added columnspace 2017-03-23 09:35:35 -07:00
Kazuki Sakamoto 36d5d3059b Merge pull request #482 from ichizok/test/travis
Workaround: Skip Test_edit_MOUSE
2017-03-23 07:40:30 -07:00
ichizok a7b867189e Skip Test_edit_MOUSE 2017-03-23 16:03:56 +09:00
ichizok 6b7c0ef216 Revert "Workaround: Disable testgui"
This reverts commit d5c214c258.
2017-03-23 14:01:58 +09:00
149 changed files with 7075 additions and 1804 deletions
+2 -7
View File
@@ -36,19 +36,14 @@ script:
- grep -q -- "-DDYNAMIC_PYTHON_DLL=\\\\\"$vi_cv_dll_name_python\\\\\"" src/auto/config.mk
- grep -q -- "-DDYNAMIC_PYTHON3_DLL=\\\\\"$vi_cv_dll_name_python3\\\\\"" src/auto/config.mk
- make -j$NPROC
- BINPATH=src/MacVim/build/Release/MacVim.app/Contents/bin
- mkdir -p $BINPATH
- sed -e 's/^# VIM_APP_DIR=.*/if [ -L $0 ]; then VIM_APP_DIR=`dirname "$(readlink $0)"`\/..\/..\/..; else VIM_APP_DIR=`dirname "$0"`\/..\/..\/..; fi/' src/MacVim/mvim > $BINPATH/mvim
- chmod 755 $BINPATH/mvim
- (cd $BINPATH; for f in vim vimdiff view gvim gvimdiff gview mvimdiff mview; do ln -s mvim $f; done)
- rm -f result; $VIMCMD -g -f -c "redir>result" -c "lua print(\"Test\")" -c "redir END" -c q; cat result; echo; grep -q -w Test result
- rm -f result; $VIMCMD -g -f -c "redir>result" -c "perl VIM::Msg(\"Test\")" -c "redir END" -c q; cat result; echo; grep -q -w Test result
- rm -f result; $VIMCMD -g -f -c "redir>result" -c "py import sys; print(\"Test\")" -c "redir END" -c q; cat result; echo; grep -q -w Test result
- rm -f result; $VIMCMD -g -f -c "redir>result" -c "py3 import sys; print(\"Test\")" -c "redir END" -c q; cat result; echo; grep -q -w Test result
- rm -f result; $VIMCMD -g -f -c "redir>result" -c "ruby puts(\"Test\")" -c "redir END" -c q; cat result; echo; grep -q -w Test result
- make test
#- make -C src/testdir clean
#- make -C src testgui
- make -C src/testdir clean
- make -C src testgui
before_deploy:
- make -C src macvim-dmg
+3 -2
View File
@@ -24,6 +24,7 @@ SRC_ALL = \
src/edit.c \
src/eval.c \
src/evalfunc.c \
src/ex_cmdidxs.h \
src/ex_cmds.c \
src/ex_cmds.h \
src/ex_cmds2.c \
@@ -215,6 +216,7 @@ SRC_UNIX = \
src/config.mk.in \
src/configure \
src/configure.ac \
src/create_cmdidxs.vim \
src/gui_at_fs.c \
src/gui_at_sb.c \
src/gui_at_sb.h \
@@ -238,7 +240,7 @@ SRC_UNIX = \
src/link.sh \
src/installman.sh \
src/installml.sh \
src/mkinstalldirs \
src/install-sh \
src/os_unix.c \
src/os_unix.h \
src/os_unixx.h \
@@ -724,7 +726,6 @@ EXTRA = \
farsi/README.txt \
farsi/fonts/*/far-* \
runtime/vimlogo.xpm \
src/swis.s \
src/tee/Makefile \
src/tee/Make_mvc.mak \
src/tee/tee.c \
+15 -8
View File
@@ -1,7 +1,8 @@
" Vim compiler file
" Compiler: reStructuredText Documentation Format
" Compiler: sphinx >= 1.0.8, http://www.sphinx-doc.org
" Description: reStructuredText Documentation Format
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2006-04-19
" Latest Revision: 2017-03-31
if exists("current_compiler")
finish
@@ -11,12 +12,18 @@ let current_compiler = "rst"
let s:cpo_save = &cpo
set cpo&vim
setlocal errorformat=
\%f:%l:\ (%tEBUG/0)\ %m,
\%f:%l:\ (%tNFO/1)\ %m,
\%f:%l:\ (%tARNING/2)\ %m,
\%f:%l:\ (%tRROR/3)\ %m,
\%f:%l:\ (%tEVERE/3)\ %m,
if exists(":CompilerSet") != 2
command -nargs=* CompilerSet setlocal <args>
endif
CompilerSet errorformat=
\%f\\:%l:\ %tEBUG:\ %m,
\%f\\:%l:\ %tNFO:\ %m,
\%f\\:%l:\ %tARNING:\ %m,
\%f\\:%l:\ %tRROR:\ %m,
\%f\\:%l:\ %tEVERE:\ %m,
\%f\\:%s:\ %tARNING:\ %m,
\%f\\:%s:\ %tRROR:\ %m,
\%D%*\\a[%*\\d]:\ Entering\ directory\ `%f',
\%X%*\\a[%*\\d]:\ Leaving\ directory\ `%f',
\%DMaking\ %*\\a\ in\ %f
+7 -1
View File
@@ -1,7 +1,7 @@
" The default vimrc file.
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last change: 2017 Mar 08
" Last change: 2017 Apr 12
"
" This is loaded if no vimrc file was found.
" Except when Vim is run with "-u NONE" or "-C".
@@ -26,6 +26,12 @@ if &compatible
set nocompatible
endif
" When the +eval feature is missing, the set command above will be skipped.
" Use a trick to reset compatible only when the +eval feature is missing.
silent! while 0
set nocompatible
silent! endwhile
" Allow backspacing over everything in insert mode.
set backspace=indent,eol,start
+1
View File
@@ -33,6 +33,7 @@ DOCS = \
ft_rust.txt \
ft_sql.txt \
gui.txt \
gui_mac.txt \
gui_w32.txt \
gui_x11.txt \
hangulin.txt \
+2 -2
View File
@@ -1,4 +1,4 @@
*autocmd.txt* For Vim version 8.0. Last change: 2017 Jan 14
*autocmd.txt* For Vim version 8.0. Last change: 2017 Apr 07
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -621,7 +621,7 @@ FileChangedShell When Vim notices that the modification time of
to tell Vim what to do next.
NOTE: When this autocommand is executed, the
current buffer "%" may be different from the
buffer that was changed "<afile>".
buffer that was changed, which is in "<afile>".
NOTE: The commands must not change the current
buffer, jump to another buffer or delete a
buffer. *E246* *E811*
+8 -1
View File
@@ -1,4 +1,4 @@
*editing.txt* For Vim version 8.0. Last change: 2016 Nov 24
*editing.txt* For Vim version 8.0. Last change: 2017 Apr 10
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1558,6 +1558,13 @@ If you want to automatically reload a file when it has been changed outside of
Vim, set the 'autoread' option. This doesn't work at the moment you write the
file though, only when the file wasn't changed inside of Vim.
If you do not want to be asked or automatically reload the file, you can use
this: >
set buftype=nofile
Or, when starting gvim from a shell: >
gvim file.log -c "set buftype=nofile"
Note that if a FileChangedShell autocommand is defined you will not get a
warning message or prompt. The autocommand is expected to handle this.
+84 -30
View File
@@ -1,4 +1,4 @@
*eval.txt* For Vim version 8.0. Last change: 2017 Mar 21
*eval.txt* For Vim version 8.0. Last change: 2017 Apr 29
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -4379,12 +4379,14 @@ getcurpos() Get the position of the cursor. This is like getpos('.'), but
includes an extra item in the list:
[bufnum, lnum, col, off, curswant] ~
The "curswant" number is the preferred column when moving the
cursor vertically.
cursor vertically. Also see |getpos()|.
This can be used to save and restore the cursor position: >
let save_cursor = getcurpos()
MoveTheCursorAround
call setpos('.', save_cursor)
<
< Note that this only works within the window. See
|winrestview()| for restoring more state.
*getcwd()*
getcwd([{winnr} [, {tabnr}]])
The result is a String, which is the name of the current
@@ -4582,6 +4584,7 @@ getqflist([{what}]) *getqflist()*
If the optional {what} dictionary argument is supplied, then
returns only the items listed in {what} as a dictionary. The
following string items are supported in {what}:
context get the context stored with |setqflist()|
nr get information for this quickfix list; zero
means the current quickfix list
title get the list title
@@ -4593,6 +4596,7 @@ getqflist([{what}]) *getqflist()*
returned.
The returned dictionary contains the following entries:
context context information stored with |setqflist()|
nr quickfix list number
title quickfix list title text
winid quickfix |window-ID| (if opened)
@@ -4682,13 +4686,16 @@ gettabwinvar({tabnr}, {winnr}, {varname} [, {def}]) *gettabwinvar()*
<
*getwinposx()*
getwinposx() The result is a Number, which is the X coordinate in pixels of
the left hand side of the GUI Vim window. The result will be
-1 if the information is not available.
the left hand side of the GUI Vim window. Also works for an
xterm.
The result will be -1 if the information is not available.
The value can be used with `:winpos`.
*getwinposy()*
getwinposy() The result is a Number, which is the Y coordinate in pixels of
the top of the GUI Vim window. The result will be -1 if the
information is not available.
the top of the GUI Vim window. Also works for an xterm.
The result will be -1 if the information is not available.
The value can be used with `:winpos`.
getwininfo([{winid}]) *getwininfo()*
Returns information about windows as a List with Dictionaries.
@@ -5260,9 +5267,14 @@ job_stop({job} [, {how}]) *job_stop()*
0 if "how" is not supported on the system.
Note that even when the operation was executed, whether the
job was actually stopped needs to be checked with
job_status().
The status of the job isn't checked, the operation will even
be done when Vim thinks the job isn't running.
|job_status()|.
If the status of the job is "dead", the signal will not be
sent. This is to avoid to stop the wrong job (esp. on Unix,
where process numbers are recycled).
When using "kill" Vim will assume the job will die and close
the channel.
{only available when compiled with the |+job| feature}
@@ -5304,13 +5316,29 @@ json_decode({string}) *json_decode()*
in Vim values. See |json_encode()| for the relation between
JSON and Vim values.
The decoding is permissive:
- A trailing comma in an array and object is ignored.
- A trailing comma in an array and object is ignored, e.g.
"[1, 2, ]" is the same as "[1, 2]".
- More floating point numbers are recognized, e.g. "1." for
"1.0".
However, a duplicate key in an object is not allowed. *E938*
The result must be a valid Vim type:
- An empty object member name is not allowed.
- Duplicate object member names are not allowed.
"1.0", or "001.2" for "1.2". Special floating point values
"Infinity" and "NaN" (capitalization ignored) are accepted.
- Leading zeroes in integer numbers are ignored, e.g. "012"
for "12" or "-012" for "-12".
- Capitalization is ignored in literal names null, true or
false, e.g. "NULL" for "null", "True" for "true".
- Control characters U+0000 through U+001F which are not
escaped in strings are accepted, e.g. " " (tab
character in string) for "\t".
- Backslash in an invalid 2-character sequence escape is
ignored, e.g. "\a" is decoded as "a".
- A correct surrogate pair in JSON strings should normally be
a 12 character sequence such as "\uD834\uDD1E", but
json_decode() silently accepts truncated surrogate pairs
such as "\uD834" or "\uD834\u"
*E938*
A duplicate key in an object, valid in rfc7159, is not
accepted by json_decode() as the result must be a valid Vim
type, e.g. this fails: {"a":"b", "a":"c"}
json_encode({expr}) *json_encode()*
Encode {expr} as JSON and return this as a string.
@@ -5413,8 +5441,10 @@ line({expr}) The result is a Number, which is the line number of the file
$ the last line in the current buffer
'x position of mark x (if the mark is not set, 0 is
returned)
w0 first line visible in current window
w$ last line visible in current window
w0 first line visible in current window (one if the
display isn't updated, e.g. in silent Ex mode)
w$ last line visible in current window (this is one
less than "w0" if no lines are visible)
v In Visual mode: the start of the Visual area (the
cursor is the end). When not in Visual mode
returns the cursor position. Differs from |'<| in
@@ -6922,6 +6952,7 @@ setqflist({list} [, {action}[, {what}]]) *setqflist()*
nr error number
text description of the error
type single-character error type, 'E', 'W', etc.
valid recognized error message
The "col", "vcol", "nr", "type" and "text" entries are
optional. Either "lnum" or "pattern" entry can be used to
@@ -6931,21 +6962,26 @@ setqflist({list} [, {action}[, {what}]]) *setqflist()*
item will not be handled as an error line.
If both "pattern" and "lnum" are present then "pattern" will
be used.
If the "valid" entry is not supplied, then the valid flag is
set when "bufnr" is a valid buffer or "filename" exists.
If you supply an empty {list}, the quickfix list will be
cleared.
Note that the list is not exactly the same as what
|getqflist()| returns.
*E927*
If {action} is set to 'a', then the items from {list} are
added to the existing quickfix list. If there is no existing
list, then a new list is created.
{action} values: *E927*
'a' The items from {list} are added to the existing
quickfix list. If there is no existing list, then a
new list is created.
If {action} is set to 'r', then the items from the current
quickfix list are replaced with the items from {list}. This
can also be used to clear the list: >
:call setqflist([], 'r')
'r' The items from the current quickfix list are replaced
with the items from {list}. This can also be used to
clear the list: >
:call setqflist([], 'r')
<
'f' All the quickfix lists in the quickfix stack are
freed.
If {action} is not present or is set to ' ', then a new list
is created.
@@ -6953,6 +6989,7 @@ setqflist({list} [, {action}[, {what}]]) *setqflist()*
only the items listed in {what} are set. The first {list}
argument is ignored. The following items can be specified in
{what}:
context any Vim type can be stored as a context
nr list number in the quickfix stack
title quickfix list title text
Unsupported keys in {what} are ignored.
@@ -6967,7 +7004,7 @@ setqflist({list} [, {action}[, {what}]]) *setqflist()*
This function can be used to create a quickfix list
independent of the 'errorformat' setting. Use a command like
":cc 1" to jump to the first position.
`:cc 1` to jump to the first position.
*setreg()*
@@ -8469,9 +8506,9 @@ listcmds Compiled with commands for the buffer list |:files|
and the argument list |arglist|.
localmap Compiled with local mappings and abbr. |:map-local|
lua Compiled with Lua interface |Lua|.
mac Any Macintosh version of Vim.
macunix Compiled for OS X, with darwin
osx Compiled for OS X, with or without darwin
mac Any Macintosh version of Vim, but not all OS X.
macunix Compiled for OS X, with |mac-darwin-feature|
osx Compiled for OS X, with or w/o |mac-darwin-feature|
menu Compiled with support for |:menu|.
mksession Compiled with support for |:mksession|.
modify_fname Compiled with file name modifiers. |filename-modifiers|
@@ -10648,6 +10685,23 @@ missing: >
: echo "You will _never_ see this message"
:endif
To execute a command only when the |+eval| feature is disabled requires a trick,
as this example shows: >
silent! while 0
set history=111
silent! endwhile
When the |+eval| feature is available the command is skipped because of the
"while 0". Without the |+eval| feature the "while 0" is an error, which is
silently ignored, and the command is executed.
The "<CR>" here is a real CR character, type CTRL-V Enter to get it.
When the |+eval| feature is available the ":" is remapped to add a double
quote, which has the effect of commenting-out the command. Without the
|+eval| feature the nnoremap command is skipped and the command is executed.
==============================================================================
11. The sandbox *eval-sandbox* *sandbox* *E48*
+3 -3
View File
@@ -1,4 +1,4 @@
*filetype.txt* For Vim version 8.0. Last change: 2017 Mar 21
*filetype.txt* For Vim version 8.0. Last change: 2017 Mar 28
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -353,12 +353,12 @@ define yourself. There are a few ways to avoid this:
You need to define your own mapping before the plugin is loaded (before
editing a file of that type). The plugin will then skip installing the
default mapping.
*no_mail_maps*
3. Disable defining mappings for a specific filetype by setting a variable,
which contains the name of the filetype. For the "mail" filetype this
would be: >
:let no_mail_maps = 1
< *no_plugin_maps*
4. Disable defining mappings for all filetypes by setting a variable: >
:let no_plugin_maps = 1
<
+1 -1
View File
@@ -1,7 +1,7 @@
*ft_rust.txt* Filetype plugin for Rust
==============================================================================
CONTENTS *rust* *ft-rust*
CONTENTS *rust*
1. Introduction |rust-intro|
2. Settings |rust-settings|
+21 -39
View File
@@ -158,55 +158,36 @@ have files open in e.g. splits by changing the "Open files from applications"
option in the General preference pane). Finally, you can use Mac OS X System
Services to open files in MacVim, see |macvim-services|.
There are essentially two ways to start MacVim from Terminal: either call the
Vim binary with the -g switch >
/Applications/MacVim.app/Contents/MacOS/Vim -g file ...
or use the "open" command (this method can not be used to pass parameters to
Use |mvim| script to start MacVim from Terminal.
Or use the "open" command (this method can not be used to pass parameters to
Vim) >
open -a MacVim file ...
The advantage of using the latter method is that the settings relating to file
opening in the preferences panel are respected, and files open instantly if
|Quickstart| is enabled.
To save yourself from having to type the entire path to the Vim binary each
time you start MacVim, you could create an alias such as >
alias gvim='/Applications/MacVim.app/Contents/MacOS/Vim -g'
and add that to "~/.profile".
Note: Do NOT call the MacVim binary inside the app bundle to start MacVim.
*mvim*
A more flexible way to start MacVim is to use the shell script "mvim" which
comes bundled with MacVim. Put this script in a folder in your path and then
simply type "mvim" to start MacVim. This script will try to find MacVim.app
in various typical folders such as >
~/Applications ~/Applications/vim
/Applications /Applications/vim
/Applications/Utilities /Applications/Utilities/vim
If you would rather put MacVim.app in some other directory then that is also
possible, simply set the environment variable VIM_APP_DIR to whatever folder
you have placed MacVim.app in.
The "mvim" script can be symlinked to in order to start up MacVim in different
modes as follows (assuming you placed "mvim" in "/usr/local/bin"): >
* Diff: ln -s /usr/local/bin/mvim mvimdiff
* Read-only: ln -s /usr/local/bin/mvim mview
* Ex: ln -s /usr/local/bin/mvim mex
* Restricted: ln -s /usr/local/bin/mvim rmvim
If the symlink destination starts with "m" (or "g"), Vim will start in GUI
mode. Removing the initial "m" from the above destination names makes Vim
start without the GUI. (In the last case, the destination name can be
"rmvim", "rgvim" or "rvim".)
Note: Starting MacVim by creating a symlink to >
.../MacVim.app/Contents/MacOS/Vim
with 'ln -s' does not work.
Once in terminal Vim it is possible to start MacVim by using the following
command:
:gui [++opt] [+cmd] [-f|-b] [files...]
Note: Forking ("-b") currently does not work.
*mvim*
The "mvim" shell script bundled with MacVim. >
/Applications/MacVim.app/Contents/bin/mvim
This is a wrapper script to launch Vim executable in the bundle. Put this
folder >
/Applications/MacVim.app/Contents/bin
in your path and then simply type "mvim" to start MacVim from Terminal. >
$ mvim
You can also specify files to open with. >
$ mvim file ...
Also the bin folder has convenient scripts for diffing and opening file as the file is read-only. >
* Diff: mvimdiff
* Read-only: mview
You can use "vim", "vimdiff", and "view" if you want to use non-GUI Vim.
*Quickstart*
Quickstart ensures that new windows open instantaneously e.g. when <D-n> is
pressed. This feature can be enabled from the Advanced preferences pane (it
@@ -261,6 +242,7 @@ MMLoginShellArgument login shell parameter [string]
MMLoginShellCommand which shell to use to launch Vim [string]
MMNoFontSubstitution disable automatic font substitution [bool]
MMNoTitleBarWindow hide title bar [bool]
MMShareFindPboard share search text to Find Pasteboard [bool]
MMShowAddTabButton enable "add tab" button on tabline [bool]
MMTabMaxWidth maximum width of a tab [int]
MMTabMinWidth minimum width of a tab [int]
@@ -704,7 +686,7 @@ prominent bugs/missing features.
- The toolbar looks ugly and is not very useful.
If you find new bugs then please post your findings to the vim_mac mailing
list: *vim_mac* >
list: *vim_mac_group* >
http://groups.google.com/group/vim_mac
This is also the best place for making feature requests as well as for asking
+16 -16
View File
@@ -1,4 +1,4 @@
*index.txt* For Vim version 8.0. Last change: 2017 Feb 23
*index.txt* For Vim version 8.0. Last change: 2017 Apr 22
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -309,10 +309,10 @@ tag char note action in Normal mode ~
|B| B 1 cursor N WORDS backward
|C| ["x]C 2 change from the cursor position to the end
of the line, and N-1 more lines [into
buffer x]; synonym for "c$"
register x]; synonym for "c$"
|D| ["x]D 2 delete the characters under the cursor
until the end of the line and N-1 more
lines [into buffer x]; synonym for "d$"
lines [into register x]; synonym for "d$"
|E| E 1 cursor forward to the end of WORD N
|F| F{char} 1 cursor to the Nth occurrence of {char} to
the left
@@ -329,13 +329,13 @@ tag char note action in Normal mode ~
opposite direction
|O| O 2 begin a new line above the cursor and
insert text, repeat N times
|P| ["x]P 2 put the text [from buffer x] before the
|P| ["x]P 2 put the text [from register x] before the
cursor N times
|Q| Q switch to "Ex" mode
|R| R 2 enter replace mode: overtype existing
characters, repeat the entered text N-1
times
|S| ["x]S 2 delete N lines [into buffer x] and start
|S| ["x]S 2 delete N lines [into register x] and start
insert; synonym for "cc".
|T| T{char} 1 cursor till after Nth occurrence of {char}
to the left
@@ -343,8 +343,8 @@ tag char note action in Normal mode ~
|V| V start linewise Visual mode
|W| W 1 cursor N WORDS forward
|X| ["x]X 2 delete N characters before the cursor [into
buffer x]
|Y| ["x]Y yank N lines [into buffer x]; synonym for
register x]
|Y| ["x]Y yank N lines [into register x]; synonym for
"yy"
|ZZ| ZZ store current file if modified, and exit
|ZQ| ZQ exit current file always
@@ -367,12 +367,12 @@ tag char note action in Normal mode ~
|`}| `} 1 cursor to the end of the current paragraph
|a| a 2 append text after the cursor N times
|b| b 1 cursor N words backward
|c| ["x]c{motion} 2 delete Nmove text [into buffer x] and start
|c| ["x]c{motion} 2 delete Nmove text [into register x] and
start insert
|cc| ["x]cc 2 delete N lines [into register x] and start
insert
|cc| ["x]cc 2 delete N lines [into buffer x] and start
insert
|d| ["x]d{motion} 2 delete Nmove text [into buffer x]
|dd| ["x]dd 2 delete N lines [into buffer x]
|d| ["x]d{motion} 2 delete Nmove text [into register x]
|dd| ["x]dd 2 delete N lines [into register x]
|do| do 2 same as ":diffget"
|dp| dp 2 same as ":diffput"
|e| e 1 cursor forward to the end of word N
@@ -398,16 +398,16 @@ tag char note action in Normal mode ~
|q?| q? edit ? command-line in command-line window
|r| r{char} 2 replace N chars with {char}
|s| ["x]s 2 (substitute) delete N characters [into
buffer x] and start insert
register x] and start insert
|t| t{char} 1 cursor till before Nth occurrence of {char}
to the right
|u| u 2 undo changes
|v| v start characterwise Visual mode
|w| w 1 cursor N words forward
|x| ["x]x 2 delete N characters under and after the
cursor [into buffer x]
|y| ["x]y{motion} yank Nmove text [into buffer x]
|yy| ["x]yy yank N lines [into buffer x]
cursor [into register x]
|y| ["x]y{motion} yank Nmove text [into register x]
|yy| ["x]yy yank N lines [into register x]
|z| z{char} commands starting with 'z', see |z| below
|{| { 1 cursor N paragraphs backward
|bar| | 1 cursor to column N
+3 -2
View File
@@ -1,4 +1,4 @@
*insert.txt* For Vim version 8.0. Last change: 2016 Jan 31
*insert.txt* For Vim version 8.0. Last change: 2017 Apr 07
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -159,7 +159,8 @@ CTRL-R CTRL-R {0-9a-z"%#*+/:.-=} *i_CTRL-R_CTRL-R*
CTRL-R CTRL-O {0-9a-z"%#*+/:.-=} *i_CTRL-R_CTRL-O*
Insert the contents of a register literally and don't
auto-indent. Does the same as pasting with the mouse
|<MiddleMouse>|.
|<MiddleMouse>|. When the register is linewise this will
insert the text above the current line, like with `P`.
Does not replace characters!
The '.' register (last inserted text) is still inserted as
typed. {not in Vi}
+8 -1
View File
@@ -1,4 +1,4 @@
*message.txt* For Vim version 8.0. Last change: 2017 Jan 02
*message.txt* For Vim version 8.0. Last change: 2017 Mar 25
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -768,6 +768,13 @@ Example: >
You tried to execute a command that is neither an Ex command nor
a user-defined command.
*E943* >
Command table needs to be updated, run 'make cmdidxs'
This can only happen when changing the source code, when adding a command in
src/ex_cmds.h. The lookup table then needs to be updated, by running: >
make cmdidxs
==============================================================================
3. Messages *messages*
+14 -5
View File
@@ -1,4 +1,4 @@
*options.txt* For Vim version 8.0. Last change: 2017 Mar 09
*options.txt* For Vim version 8.0. Last change: 2017 Mar 22
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1700,6 +1700,16 @@ A jump table for the options with a short description can be found at |Q_op|.
:set columns=9999
< Minimum value is 12, maximum value is 10000.
*'columnspace'* *'csp'*
'columnspace' 'csp' number (default 0)
global
{not in Vi}
{only in the MacVim GUI}
Number of pixel columns inserted between characters. With some fonts
there can be too much room between characters. Then it makes sense
to set 'columnspace' to a negative value. This may cause display
problems though!
*'comments'* *'com'* *E524* *E525*
'comments' 'com' string (default
"s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-")
@@ -6672,8 +6682,7 @@ A jump table for the options with a short description can be found at |Q_op|.
Flag passed to the shell to execute "!" and ":!" commands; e.g.,
"bash.exe -c ls" or "command.com /c dir". For the MS-DOS-like
systems, the default is set according to the value of 'shell', to
reduce the need to set this option by the user. It's not used for
OS/2 (EMX figures this out itself).
reduce the need to set this option by the user.
On Unix it can have more than one flag. Each white space separated
part is passed as an argument to the shell command.
See |option-backslash| about including spaces and backslashes.
@@ -7992,7 +8001,7 @@ A jump table for the options with a short description can be found at |Q_op|.
'timeout' 'to' boolean (default on)
global
*'ttimeout'* *'nottimeout'*
'ttimeout' boolean (default off, set in |defaults.vim|))
'ttimeout' boolean (default off, set in |defaults.vim|)
global
{not in Vi}
These two options together determine the behavior when part of a
@@ -8027,7 +8036,7 @@ A jump table for the options with a short description can be found at |Q_op|.
global
{not in all versions of Vi}
*'ttimeoutlen'* *'ttm'*
'ttimeoutlen' 'ttm' number (default -1, set to 100 in |defaults.vim|))
'ttimeoutlen' 'ttm' number (default -1, set to 100 in |defaults.vim|)
global
{not in Vi}
The time in milliseconds that is waited for a key code or mapped key
+73 -10
View File
@@ -1,4 +1,4 @@
*os_mac.txt* For Vim version 8.0. Last change: 2006 Apr 30
*os_mac.txt* For Vim version 8.0. Last change: 2017 Apr 28
VIM REFERENCE MANUAL by Bram Moolenaar et al.
@@ -16,11 +16,13 @@ Carbon version of Vim here:
http://macvim.org/
1. Filename Convention |mac-filename|
2. .vimrc an .vim files |mac-vimfile|
3. FAQ |mac-faq|
4. Known Lack |mac-lack|
5. Mac Bug Report |mac-bug|
6. Compiling Vim |mac-compile|
2. .vimrc and .vim files |mac-vimfile|
3. Standard mappings |mac-standard-mappings|
4. FAQ |mac-faq|
5. Known Lack |mac-lack|
6. Mac Bug Report |mac-bug|
7. Compiling Vim |mac-compile|
8. The darwin feature |mac-darwin-feature|
There was a Mac port for version 3.0 of Vim. Here are the first few lines
from the old file:
@@ -76,7 +78,18 @@ the |'nocompatible'| option is set, otherwise it will only handle mac format
files.
==============================================================================
3. Mac FAQ *mac-faq*
3. Standard mappings *mac-standard-mappings*
The following mappings are available for cut/copy/paste from/to clipboard.
key Normal Visual Insert Description ~
Command-v "*P "-d"*P <C-R>* paste text *<D-v>*
Command-c "*y copy Visual text *<D-c>*
Command-x "*d cut Visual text *<D-x>*
Backspace "*d cut Visual text
==============================================================================
4. Mac FAQ *mac-faq*
On the internet: http://macvim.org/OSX/index.php#FAQ
@@ -99,13 +112,13 @@ A: The following trick works with most shells. Put it in your vimrc file.
let $PATH = matchstr(s:path, 'VIMPATH\zs.\{-}\ze\n')
==============================================================================
4. Mac Lack *mac-lack*
5. Mac Lack *mac-lack*
In a terminal CTRL-^ needs to be entered as Shift-Control-6. CTRL-@ as
Shift-Control-2.
==============================================================================
5. Mac Bug Report *mac-bug*
6. Mac Bug Report *mac-bug*
When reporting any Mac specific bug or feature change, please use the vim-mac
maillist |vim-mac|. However, you need to be subscribed. An alternative is to
@@ -114,9 +127,59 @@ send a message to the current MacVim maintainers:
mac@vim.org
==============================================================================
6. Compiling Vim *mac-compile*
7. Compiling Vim *mac-compile*
See the file "src/INSTALLmac.txt" that comes with the source files.
==============================================================================
8. The Darwin Feature *mac-darwin-feature*
If you have a Mac that isn't very old, you will be running OS X, also called
Darwin. The last pre-Darwin OS was Mac OS 9. The darwin feature makes Vim
use Darwin-specific properties.
What is accomplished with this feature is two-fold:
- Make Vim interoperable with the system clipboard.
- Incorporate into Vim a converter module that bridges the gap between some
character encodings specific to the platform and those known to Vim.
Needless to say, both are not to be missed for any decent text editor to work
nicely with other applications running on the same desktop environment.
As Vim is not an application dedicated only to macOS, we need an extra feature
to add in order for it to offer the same user experience that our users on
other platforms enjoy to people on macOS.
For brevity, the feature is referred to as "darwin" to signify it one of the
Vim features that are specific to that particular platform.
The feature is a configuration option. Accordingly, whether it is enabled or
not is determined at build time; once it is selected to be enabled, it is
compiled in and hence cannot be disabled at runtime.
The feature is enabled by default. For most macOS users, that should be
sufficient unless they have specific needs mentioned briefly below.
If you want to disable it, pass `--disable-darwin` to the configure script: >
./configure --disable-darwin <other options>
and then run `make` to build Vim. The order of the options doesn't matter.
To make sure at runtime whether or not the darwin feature is compiled in, you
can use `has('macunix')` which returns 1 if the feature is compiled in; 0
otherwise.
Notable use cases where `--disable-darwin` is turned out to be useful are:
- When you want to use |x11-selection| instead of the system clipboard.
- When you want to use |x11-clientserver|.
Since both have to make use of X11 inter-client communication for them to work
properly, and since the communication mechanism can come into conflict with
the system clipboard, the darwin feature should be disabled to prevent Vim
from hanging at runtime.
vim:tw=78:ts=8:ft=help:norl:
+1 -1
View File
@@ -1,4 +1,4 @@
*os_win32.txt* For Vim version 8.0. Last change: 2016 Oct 12
*os_win32.txt* For Vim version 8.0. Last change: 2017 Mar 21
VIM REFERENCE MANUAL by George Reilly
+27 -18
View File
@@ -1,4 +1,4 @@
*pattern.txt* For Vim version 8.0. Last change: 2017 Mar 05
*pattern.txt* For Vim version 8.0. Last change: 2017 Mar 29
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1085,25 +1085,27 @@ x A single character, with no special meaning, matches itself
- A character class expression is evaluated to the set of characters
belonging to that character class. The following character classes
are supported:
Name Contents ~
*[:alnum:]* [:alnum:] ASCII letters and digits
*[:alpha:]* [:alpha:] ASCII letters
*[:blank:]* [:blank:] space and tab characters
*[:cntrl:]* [:cntrl:] control characters
*[:digit:]* [:digit:] decimal digits
*[:graph:]* [:graph:] printable characters excluding space
*[:lower:]* [:lower:] lowercase letters (all letters when
Name Func Contents ~
*[:alnum:]* [:alnum:] isalnum ASCII letters and digits
*[:alpha:]* [:alpha:] isalpha ASCII letters
*[:blank:]* [:blank:] space and tab
*[:cntrl:]* [:cntrl:] iscntrl ASCII control characters
*[:digit:]* [:digit:] decimal digits '0' to '9'
*[:graph:]* [:graph:] isgraph ASCII printable characters excluding
space
*[:lower:]* [:lower:] (1) lowercase letters (all letters when
'ignorecase' is used)
*[:print:]* [:print:] printable characters including space
*[:punct:]* [:punct:] ASCII punctuation characters
*[:space:]* [:space:] whitespace characters
*[:upper:]* [:upper:] uppercase letters (all letters when
*[:print:]* [:print:] (2) printable characters including space
*[:punct:]* [:punct:] ispunct ASCII punctuation characters
*[:space:]* [:space:] whitespace characters: space, tab, CR,
NL, vertical tab, form feed
*[:upper:]* [:upper:] (3) uppercase letters (all letters when
'ignorecase' is used)
*[:xdigit:]* [:xdigit:] hexadecimal digits
*[:return:]* [:return:] the <CR> character
*[:tab:]* [:tab:] the <Tab> character
*[:escape:]* [:escape:] the <Esc> character
*[:backspace:]* [:backspace:] the <BS> character
*[:xdigit:]* [:xdigit:] hexadecimal digits: 0-9, a-f, A-F
*[:return:]* [:return:] the <CR> character
*[:tab:]* [:tab:] the <Tab> character
*[:escape:]* [:escape:] the <Esc> character
*[:backspace:]* [:backspace:] the <BS> character
The brackets in character class expressions are additional to the
brackets delimiting a collection. For example, the following is a
plausible pattern for a UNIX filename: "[-./[:alnum:]_~]\+" That is,
@@ -1114,6 +1116,13 @@ x A single character, with no special meaning, matches itself
regexp engine. See |two-engines|. In the future these items may
work for multi-byte characters. For now, to get all "alpha"
characters you can use: [[:lower:][:upper:]].
The "Func" column shows what library function is used. The
implementation depends on the system. Otherwise:
(1) Uses islower() for ASCII and Vim builtin rules for other
characters when built with the |+multi_byte| feature.
(2) Uses Vim builtin rules
(3) As with (1) but using isupper()
*/[[=* *[==]*
- An equivalence class. This means that characters are matched that
have almost the same meaning, e.g., when ignoring accents. This
+1
View File
@@ -645,6 +645,7 @@ Short explanation of each option: *option-list*
'cmdwinheight' 'cwh' height of the command-line window
'colorcolumn' 'cc' columns to highlight
'columns' 'co' number of columns in the display
'columnspace' 'csp' number of pixel columns to use between characters
'comments' 'com' patterns that can start a comment line
'commentstring' 'cms' template for comments; used for fold marker
'compatible' 'cp' behave Vi-compatible as much as possible
+17 -3
View File
@@ -141,6 +141,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
'cole' options.txt /*'cole'*
'colorcolumn' options.txt /*'colorcolumn'*
'columns' options.txt /*'columns'*
'columnspace' options.txt /*'columnspace'*
'com' options.txt /*'com'*
'comments' options.txt /*'comments'*
'commentstring' options.txt /*'commentstring'*
@@ -168,6 +169,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
'cscopetag' options.txt /*'cscopetag'*
'cscopetagorder' options.txt /*'cscopetagorder'*
'cscopeverbose' options.txt /*'cscopeverbose'*
'csp' options.txt /*'csp'*
'cspc' options.txt /*'cspc'*
'csprg' options.txt /*'csprg'*
'csqf' options.txt /*'csqf'*
@@ -791,7 +793,9 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
'pvh' options.txt /*'pvh'*
'pvw' options.txt /*'pvw'*
'pythondll' options.txt /*'pythondll'*
'pythonhome' options.txt /*'pythonhome'*
'pythonthreedll' options.txt /*'pythonthreedll'*
'pythonthreehome' options.txt /*'pythonthreehome'*
'pyx' options.txt /*'pyx'*
'pyxversion' options.txt /*'pyxversion'*
'qe' options.txt /*'qe'*
@@ -961,6 +965,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
't_F7' term.txt /*'t_F7'*
't_F8' term.txt /*'t_F8'*
't_F9' term.txt /*'t_F9'*
't_GP' term.txt /*'t_GP'*
't_IE' term.txt /*'t_IE'*
't_IS' term.txt /*'t_IS'*
't_K1' term.txt /*'t_K1'*
@@ -3308,6 +3313,9 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
<D-Right> gui_mac.txt /*<D-Right>*
<D-Up> gui_mac.txt /*<D-Up>*
<D-`> gui_mac.txt /*<D-`>*
<D-c> os_mac.txt /*<D-c>*
<D-v> os_mac.txt /*<D-v>*
<D-x> os_mac.txt /*<D-x>*
<Del> change.txt /*<Del>*
<Down> motion.txt /*<Down>*
<Drop> change.txt /*<Drop>*
@@ -4565,6 +4573,7 @@ E94 windows.txt /*E94*
E940 eval.txt /*E940*
E941 eval.txt /*E941*
E942 eval.txt /*E942*
E943 message.txt /*E943*
E95 message.txt /*E95*
E96 diff.txt /*E96*
E97 diff.txt /*E97*
@@ -6197,7 +6206,6 @@ ft-rst-syntax syntax.txt /*ft-rst-syntax*
ft-ruby-omni insert.txt /*ft-ruby-omni*
ft-ruby-syntax syntax.txt /*ft-ruby-syntax*
ft-rust filetype.txt /*ft-rust*
ft-rust ft_rust.txt /*ft-rust*
ft-scheme-syntax syntax.txt /*ft-scheme-syntax*
ft-sdl-syntax syntax.txt /*ft-sdl-syntax*
ft-sed-syntax syntax.txt /*ft-sed-syntax*
@@ -6684,7 +6692,7 @@ gui.txt gui.txt /*gui.txt*
gui_mac.txt gui_mac.txt /*gui_mac.txt*
gui_w32.txt gui_w32.txt /*gui_w32.txt*
gui_x11.txt gui_x11.txt /*gui_x11.txt*
guifontwide_gtk options.txt /*guifontwide_gtk*
guifontwide_gtk2 options.txt /*guifontwide_gtk2*
guifontwide_macvim options.txt /*guifontwide_macvim*
guifontwide_win_mbyte options.txt /*guifontwide_win_mbyte*
guioptions_a options.txt /*guioptions_a*
@@ -7237,9 +7245,11 @@ m` motion.txt /*m`*
mac os_mac.txt /*mac*
mac-bug os_mac.txt /*mac-bug*
mac-compile os_mac.txt /*mac-compile*
mac-darwin-feature os_mac.txt /*mac-darwin-feature*
mac-faq os_mac.txt /*mac-faq*
mac-filename os_mac.txt /*mac-filename*
mac-lack os_mac.txt /*mac-lack*
mac-standard-mappings os_mac.txt /*mac-standard-mappings*
mac-vimfile os_mac.txt /*mac-vimfile*
macintosh os_mac.txt /*macintosh*
macro map.txt /*macro*
@@ -7784,6 +7794,8 @@ nice todo.txt /*nice*
no-eval-feature eval.txt /*no-eval-feature*
no-type-checking eval.txt /*no-type-checking*
no_buffers_menu gui.txt /*no_buffers_menu*
no_mail_maps filetype.txt /*no_mail_maps*
no_plugin_maps filetype.txt /*no_plugin_maps*
non-greedy pattern.txt /*non-greedy*
non-zero-arg eval.txt /*non-zero-arg*
none-variable eval.txt /*none-variable*
@@ -8617,6 +8629,7 @@ t_F6 term.txt /*t_F6*
t_F7 term.txt /*t_F7*
t_F8 term.txt /*t_F8*
t_F9 term.txt /*t_F9*
t_GP term.txt /*t_GP*
t_IE term.txt /*t_IE*
t_IS term.txt /*t_IS*
t_K1 term.txt /*t_K1*
@@ -9299,7 +9312,8 @@ vim: options.txt /*vim:*
vim_announce intro.txt /*vim_announce*
vim_dev intro.txt /*vim_dev*
vim_did_enter-variable eval.txt /*vim_did_enter-variable*
vim_mac gui_mac.txt /*vim_mac*
vim_mac intro.txt /*vim_mac*
vim_mac_group gui_mac.txt /*vim_mac_group*
vim_starting eval.txt /*vim_starting*
vim_use intro.txt /*vim_use*
vimball pi_vimball.txt /*vimball*
+2 -1
View File
@@ -1,4 +1,4 @@
*term.txt* For Vim version 8.0. Last change: 2017 Feb 02
*term.txt* For Vim version 8.0. Last change: 2017 Apr 11
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -314,6 +314,7 @@ Added by Vim (there are no standard codes for these):
t_IS set icon text start *t_IS* *'t_IS'*
t_IE set icon text end *t_IE* *'t_IE'*
t_WP set window position (Y, X) in pixels *t_WP* *'t_WP'*
t_GP get window position (Y, X) in pixels *t_GP* *'t_GP'*
t_WS set window size (height, width) in characters *t_WS* *'t_WS'*
t_SI start insert mode (bar cursor shape) *t_SI* *'t_SI'*
t_SR start replace mode (underline cursor shape) *t_SR* *'t_SR'*
+38 -30
View File
@@ -1,4 +1,4 @@
*todo.txt* For Vim version 8.0. Last change: 2017 Mar 21
*todo.txt* For Vim version 8.0. Last change: 2017 Apr 28
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -35,7 +35,13 @@ entered there will not be repeated below, unless there is extra information.
*known-bugs*
-------------------- Known bugs and current work -----------------------
Remove the Farsi code?
+channel:
- job_stop() should not always close the channel, e.g. for "int".
(Martin Gammelsæter, 2017 Apr 11, #1632)
Only assume killed on "kill".
Check job->jv_status not to be JOB_ENDED.
- Try out background make plugin:
https://github.com/AndrewVos/vim-make-background
- Problem with stderr on Windows? (Vincent Rischmann, 2016 Aug 31, #1026)
@@ -105,13 +111,19 @@ Regexp problems:
- Difference between two engines: ".*\zs\/\@>\/" on text "///"
(Chris Paul, 2016 Nov 13) New engine not greedy enough?
With foldmethod=syntax and nofoldenable comment highlighting isn't removed.
(Marcin Szewczyk, 2017 Apr 26)
Running test_gui and test_gui_init with Motif sometimes kills the window
manager. Problem with Motif?
Memory leak in test97? The string is actually freed. Weird.
Patch to make "start" work better: Use ShellExecute in !start (Katsuya Hino,
#1570)
Patch for shellescape(). (Christian Brabandt, 2017 Apr 20, #1590)
Patch for flickering redraw. (Hirohito Higashi, 2017 Apr 23, #1637)
New value "uselast" for 'switchbuf'. (Lemonboy, 2017 Apr 23, #1652)
Add a toolbar in the terminal. Can be global, above all windows, or specific
for one window.
@@ -124,12 +136,6 @@ What if there is an invalid character?
Json string with trailing \u should be an error. (Lcd)
On MS-Windows with 'clipboard' set to "unnamed" this doesn't work to double
lines: :g/^/normal yyp On Unix it works OK. (Bryce Orgill, 2016 Nov 5)
Another example 2017 Mar 10.
Multi-byte bug: dv} splits char. (Urtica Dioica, 2017 Jan 9)
When session file has name in argument list but the buffer was deleted, the
buffer is not deleted when using the session file. (#1393)
Should add the buffer in hidden state.
@@ -137,10 +143,6 @@ Should add the buffer in hidden state.
When an item in the quickfix list has a file name that does not exist, behave
like the item was not a match for :cnext.
Patch to test regexp classes. (Dominique, 2017 Mar 13, #1560)
Do we need to adjust the implementation?
Make different classes that depend on the system and that don't.
Wrong diff highlighting with three files. (2016 Oct 20, #1186)
Also get E749 on exit.
Another example in #1309
@@ -148,9 +150,6 @@ Another example in #1309
Patch to change all use of &sw to shiftwidth(). (Tyru, 2017 Feb 19)
Wait until maintainers integrate it.
Completion for user-defined commands does not work if a few characters were
already typed. (Dominique, 2017 Jan 26)
When deleting a mark or register, leave a tombstone, so that it's also deleted
when writing viminfo (and the delete was the most recent action). #1339
@@ -207,6 +206,9 @@ Patch for restoring wide characters in the console buffer.
Patch to fix escaping of job arguments. (Yasuhiro Matsumoto, 2016 Oct 5)
Update Oct 14: https://gist.github.com/mattn/d47e7d3bfe5ade4be86062b565a4bfca
Characters deleted on completion. (Adrià Farrés, 2017 Apr 20, #1645)
Remarks from Christian Brabandt (Apr 21)
The TermResponse event is not triggered when a plugin has set 'eventignore' to
"all". Netrw does this. (Gary Johnson, 2017 Jan 24)
Postpone the event until 'eventignore' is reset.
@@ -214,6 +216,8 @@ Postpone the event until 'eventignore' is reset.
Patch to make urxvt mouse work better, recognize Esc[*M termcap code.
(Maurice Bos, 2017 Feb 17, #1486)
Expanding /**/ is slow. Idea by Luc Hermitte, 2017 Apr 14.
Once .exe with updated installer is available: Add remark to download page
about /S and /D options (Ken Takata, 2016 Apr 13)
Or point to nightly builds: https://github.com/vim/vim-win32-installer/releases
@@ -247,6 +251,9 @@ Does this also fix #1408 ?
Patch for 'cursorlinenr' option. (Ozaki Kiichi, 2016 Nov 30)
When 'completeopt' has "noselect" does not insert a newline. (Lifepillar, 2017
Apr 23, #1653)
Window resizing with 'winfixheight': With a vertical split the height changes
anyway. (Tommy allen, 2017 Feb 21, #1502)
@@ -291,11 +298,21 @@ Patch to add "cmdline" completion to getcompletion(). (Shougo, Oct 1, #1140)
Feature request: Complete members of a dictionary. (Luc Hermitte, 2017 Jan 4,
#1350)
Undo message is not always properly displayed. Patch by Ken Takata, 2013 oct
3. Doesn't work properly according to Yukihiro Nakadaira.
Also see #1635.
Patch for systemlist(), add empty item. (thinca, Sep 30, #1135)
Add an argument to choose binary or non-binary (like readfile()), when omitted
use the current behavior.
Include the test.
Patch to add tagfunc(). Cleaned up by Christian Brabandt, 2013 Jun 22.
New update 2017 Apr 10, #1628
Unnamed register only contains the last deleted text when appending deleted
text to a register. (Wolfgang Jeltsch, reproduced by Ben Fritz, 2017 Apr 10)
When 'keywordprg' starts with ":" the argument is still escaped as a shell
command argument. (Romain Lafourcade, 2016 Oct 16, #1175)
@@ -341,19 +358,15 @@ Jul 25, #948)
Patch to fix wrong encoding of error message on Cygwin/MSYS terminal.
(Ken Takata, 2016 Oct 4)
Patch to introduce 'cmdencoding'. (Ken Takata, Aug 18?)
Better help Aug 19.
Problem: applies to too many commands, such as :cbuffer.
Updated patch with three options, 2016 Sep 8.
Win32: When running ":make" and 'encoding' differs from the system locale,
the output should be converted. Esp. when 'encoding' is "utf-8". (Yongwei
Wu) Should we use 'termencoding' for this?
Patch to add 'systemencoding', convert between 'encoding' and this for file
names, shell commands and the like. (Kikuchan, 2010 Oct 14)
Assume the system converts between the actual encoding of the filesystem to
the system encoding (usually utf-8).
Using ":tab drop file" does not trigger BufEnter or TabEnter events.
(Andy Stewart, 2017 Apr 27, #1660)
Autocommands blocked in do_arg_all(). Supposed to happen later?
'hlsearch' interferes with a Conceal match. (Rom Grk, 2016 Aug 9)
Patch to add context information to quickfix/location list. (Yegappan
@@ -421,7 +434,7 @@ When doing "vi buf.md" a BufNew autocommand for *.md is not triggered.
Because of using the initial buffer? (Dun Peal, 2016 May 12)
Patch to add the :bvimgrep command. (Christian Brabandt, 2014 Nov 12)
Updated 2016 Jun 10, #858
Updated 2016 Jun 10, #858 Update 2017 Mar 28: use <buffer>
Add redrawtabline command. (Naruhiko Nishino, 2016 Jun 11)
@@ -917,9 +930,6 @@ Patch to handle integer overflow. (Aaron Burrow, 2013 Dec 12)
Patch to add "ntab" item in 'listchars' to repeat first character. (Nathaniel
Braun, pragm, 2013 Oct 13) A better solution 2014 Mar 5.
Undo message is not always properly displayed. Patch by Ken Takata, 2013 oct
3. Doesn't work properly according to Yukihiro Nakadaira.
/[b-a] gives error E16, should probably be E769.
7 Windows XP: When using "ClearType" for text smoothing, a column of yellow
@@ -1084,8 +1094,6 @@ MS-Windows resizing problems:
Patch to append regexp to tag commands to make it possible to select one out
of many matches. (Cody Cutler, 2013 Mar 28)
Patch to add tagfunc(). Cleaned up by Christian Brabandt, 2013 Jun 22.
The input map for CTRL-O in mswin.vim causes problems after CTRL-X CTRL-O.
Suggestion for another map. (Philip Mat, 2012 Jun 18)
But use "gi" instead of "a". Or use CTRL-\ CTRL-O.
+3 -3
View File
@@ -1,4 +1,4 @@
*usr_41.txt* For Vim version 8.0. Last change: 2017 Mar 18
*usr_41.txt* For Vim version 8.0. Last change: 2017 Mar 28
VIM USER MANUAL - by Bram Moolenaar
@@ -2277,8 +2277,8 @@ plugin for the mail filetype: >
endif
Two global variables are used:
no_plugin_maps disables mappings for all filetype plugins
no_mail_maps disables mappings for a specific filetype
|no_plugin_maps| disables mappings for all filetype plugins
|no_mail_maps| disables mappings for the "mail" filetype
USER COMMANDS
+3108 -1
View File
File diff suppressed because it is too large Load Diff
+15 -5
View File
@@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2017 Mar 13
" Last Change: 2017 Apr 20
" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
@@ -288,7 +288,8 @@ au BufNewFile,BufRead *.bib setf bib
au BufNewFile,BufRead *.bst setf bst
" BIND configuration
au BufNewFile,BufRead named.conf,rndc.conf setf named
" sudoedit uses namedXXXX.conf
au BufNewFile,BufRead named*.conf,rndc*.conf setf named
" BIND zone
au BufNewFile,BufRead named.root setf bindzone
@@ -309,9 +310,10 @@ au BufNewFile,BufRead *.bl setf blank
au BufNewFile,BufRead */etc/blkid.tab,*/etc/blkid.tab.old setf xml
" Bazel (http://bazel.io)
autocmd BufRead,BufNewFile *.bzl,WORKSPACE setfiletype bzl
autocmd BufRead,BufNewFile *.bzl,WORKSPACE setf bzl
if has("fname_case")
autocmd BufRead,BufNewFile BUILD setfiletype bzl
" There is another check for BUILD further below.
autocmd BufRead,BufNewFile BUILD setf bzl
endif
" C or lpc
@@ -2131,7 +2133,10 @@ au BufNewFile,BufRead ssh_config,*/.ssh/config setf sshconfig
au BufNewFile,BufRead sshd_config setf sshdconfig
" Stata
au BufNewFile,BufRead *.ado,*.class,*.do,*.imata,*.mata setf stata
au BufNewFile,BufRead *.ado,*.do,*.imata,*.mata setf stata
" Also *.class, but not when it's a Java bytecode file
au BufNewFile,BufRead *.class
\ if getline(1) !~ "^\xca\xfe\xba\xbe" | setf stata | endif
" SMCL
au BufNewFile,BufRead *.hlp,*.ihlp,*.smcl setf smcl
@@ -2601,6 +2606,11 @@ au BufNewFile,BufRead *asterisk*/*voicemail.conf* call s:StarSetf('asteriskvm')
" Bazaar version control
au BufNewFile,BufRead bzr_log.* setf bzr
" Bazel build file
if !has("fname_case")
au BufNewFile,BufRead BUILD setf bzl
endif
" BIND zone
au BufNewFile,BufRead */named/db.*,*/bind/db.* call s:StarSetf('bindzone')
+54 -19
View File
@@ -3,8 +3,8 @@
" Author: John Wellesz <John.wellesz (AT) teaser (DOT) fr>
" URL: http://www.2072productions.com/vim/indent/php.vim
" Home: https://github.com/2072/PHP-Indenting-for-VIm
" Last Change: 2015 September 8th
" Version: 1.60
" Last Change: 2017 March 12th
" Version: 1.62
"
"
" Type :help php-indent for available options
@@ -141,11 +141,13 @@ let s:PHP_validVariable = '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*'
let s:notPhpHereDoc = '\%(break\|return\|continue\|exit\|die\|else\)'
let s:blockstart = '\%(\%(\%(}\s*\)\=else\%(\s\+\)\=\)\=if\>\|\%(}\s*\)\?else\>\|do\>\|while\>\|switch\>\|case\>\|default\>\|for\%(each\)\=\>\|declare\>\|class\>\|trait\>\|use\>\|interface\>\|abstract\>\|final\>\|try\>\|\%(}\s*\)\=catch\>\|\%(}\s*\)\=finally\>\)'
let s:functionDecl = '\<function\>\%(\s\+'.s:PHP_validVariable.'\)\=\s*(.*'
let s:endline= '\s*\%(//.*\|#.*\|/\*.*\*/\s*\)\=$'
let s:endline = '\s*\%(//.*\|#.*\|/\*.*\*/\s*\)\=$'
let s:unstated = '\%(^\s*'.s:blockstart.'.*)\|\%(//.*\)\@<!\<e'.'lse\>\)'.s:endline
let s:terminated = '\%(\%(;\%(\s*\%(?>\|}\)\)\=\|<<<\s*[''"]\=\a\w*[''"]\=$\|^\s*}\|^\s*'.s:PHP_validVariable.':\)'.s:endline.'\)\|^[^''"`]*[''"`]$'
let s:terminated = '\%(\%(;\%(\s*\%(?>\|}\)\)\=\|<<<\s*[''"]\=\a\w*[''"]\=$\|^\s*}\|^\s*'.s:PHP_validVariable.':\)'.s:endline.'\)'
let s:PHP_startindenttag = '<?\%(.*?>\)\@!\|<script[^>]*>\%(.*<\/script>\)\@!'
let s:structureHead = '^\s*\%(' . s:blockstart . '\)\|'. s:functionDecl . s:endline . '\|\<new\s\+class\>'
@@ -214,10 +216,28 @@ function! GetLastRealCodeLNum(startline) " {{{
let lnum = lnum - 1
endwhile
elseif lastline =~ '^[^''"`]*[''"`][;,]'.s:endline
let tofind=substitute( lastline, '^.*\([''"`]\)[;,].*$', '^[^\1]\\+[\1]$', '')
while getline(lnum) !~? tofind && lnum > 1
let lnum = lnum - 1
let tofind=substitute( lastline, '^.*\([''"`]\)[;,].*$', '^[^\1]\\+[\1]$\\|^[^\1]\\+[=([]\\s*[\1]', '')
let trylnum = lnum
while getline(trylnum) !~? tofind && trylnum > 1
let trylnum = trylnum - 1
endwhile
if trylnum == 1
break
else
if lastline =~ ';'.s:endline
while getline(trylnum) !~? s:terminated && getline(trylnum) !~? '{'.s:endline && trylnum > 1
let trylnum = prevnonblank(trylnum - 1)
endwhile
if trylnum == 1
break
end
end
let lnum = trylnum
end
else
break
endif
@@ -262,7 +282,7 @@ function! FindOpenBracket(lnum, blockStarter) " {{{
while line > 1
let linec = getline(line)
if linec =~ s:terminated || linec =~ '^\s*\%(' . s:blockstart . '\)\|'. s:functionDecl . s:endline
if linec =~ s:terminated || linec =~ s:structureHead
break
endif
@@ -273,6 +293,20 @@ function! FindOpenBracket(lnum, blockStarter) " {{{
return line
endfun " }}}
let s:blockChars = {'{':1, '[': 1, '(': 1, ')':-1, ']':-1, '}':-1}
function! BalanceDirection (str)
let balance = 0
for c in split(a:str, '\zs')
if has_key(s:blockChars, c)
let balance += s:blockChars[c]
endif
endfor
return balance
endfun
function! FindTheIfOfAnElse (lnum, StopAfterFirstPrevElse) " {{{
if getline(a:lnum) =~# '^\s*}\s*else\%(if\)\=\>'
@@ -457,7 +491,7 @@ function! GetPhpIndent()
if synname!=""
if synname == "SpecStringEntrails"
let b:InPHPcode = -1
let b:InPHPcode = -1 " thumb down
let b:InPHPcode_tofind = ""
elseif synname != "phpHereDoc" && synname != "phpHereDocDelimiter"
let b:InPHPcode = 1
@@ -540,7 +574,7 @@ function! GetPhpIndent()
let b:InPHPcode_and_script = 1
endif
elseif last_line =~ '^[^''"`]\+[''"`]$'
elseif last_line =~ '^[^''"`]\+[''"`]$' " a string identifier with nothing after it and no other string identifier before
let b:InPHPcode = -1
let b:InPHPcode_tofind = substitute( last_line, '^.*\([''"`]\).*$', '^[^\1]*\1[;,]$', '')
elseif last_line =~? '<<<\s*[''"]\=\a\w*[''"]\=$'
@@ -660,7 +694,8 @@ function! GetPhpIndent()
let terminated = s:terminated
let unstated = '\%(^\s*'.s:blockstart.'.*)\|\%(//.*\)\@<!\<e'.'lse\>\)'.endline
let unstated = s:unstated
if ind != b:PHP_default_indenting && cline =~# '^\s*else\%(if\)\=\>'
let b:PHP_CurrentIndentLevel = b:PHP_default_indenting
@@ -673,7 +708,7 @@ function! GetPhpIndent()
while last_line_num > 1
if previous_line =~ terminated || previous_line =~ '^\s*\%(' . s:blockstart . '\)\|'. s:functionDecl . endline
if previous_line =~ terminated || previous_line =~ s:structureHead
let ind = indent(last_line_num)
@@ -689,7 +724,7 @@ function! GetPhpIndent()
endwhile
elseif last_line =~# unstated && cline !~ '^\s*);\='.endline
let ind = ind + s:sw()
let ind = ind + s:sw() " we indent one level further when the preceding line is not stated
return ind + addSpecial
elseif (ind != b:PHP_default_indenting || last_line =~ '^[)\]]' ) && last_line =~ terminated
@@ -699,7 +734,7 @@ function! GetPhpIndent()
let isSingleLineBlock = 0
while 1
if ! isSingleLineBlock && previous_line =~ '^\s*}\|;\s*}'.endline
if ! isSingleLineBlock && previous_line =~ '^\s*}\|;\s*}'.endline " XXX
call cursor(last_line_num, 1)
if previous_line !~ '^}'
@@ -780,10 +815,10 @@ function! GetPhpIndent()
if !LastLineClosed
if last_line =~# '[{(\[]'.endline || last_line =~? '\h\w*\s*(.*,$' && AntepenultimateLine !~ '[,(\[]'.endline
if last_line =~# '[{(\[]'.endline || last_line =~? '\h\w*\s*(.*,$' && AntepenultimateLine !~ '[,(\[]'.endline && BalanceDirection(last_line) > 0
let dontIndent = 0
if last_line =~ '\S\+\s*{'.endline && last_line !~ '^\s*)\s*{'.endline && last_line !~ '^\s*\%(' . s:blockstart . '\)\|'. s:functionDecl . s:endline
if last_line =~ '\S\+\s*{'.endline && last_line !~ '^\s*[)\]]\+\s*{'.endline && last_line !~ s:structureHead
let dontIndent = 1
endif
@@ -797,9 +832,9 @@ function! GetPhpIndent()
return ind + addSpecial
endif
elseif last_line =~ '\S\+\s*),'.endline
elseif last_line =~ '\S\+\s*),'.endline && BalanceDirection(last_line) < 0
call cursor(lnum, 1)
call search('),'.endline, 'W')
call search('),'.endline, 'W') " line never begins with ) so no need for 'c' flag
let openedparent = searchpair('(', '', ')', 'bW', 'Skippmatch()')
if openedparent != lnum
let ind = indent(openedparent)
@@ -809,7 +844,7 @@ function! GetPhpIndent()
let ind = ind + s:sw()
elseif AntepenultimateLine =~ '{'.endline || AntepenultimateLine =~ terminated || AntepenultimateLine =~# s:defaultORcase
elseif AntepenultimateLine =~ '{'.endline && AntepenultimateLine !~? '^\s*use\>' || AntepenultimateLine =~ terminated || AntepenultimateLine =~# s:defaultORcase
let ind = ind + s:sw()
endif
+14 -14
View File
@@ -274,7 +274,7 @@ function GetRIndent()
let nlnum = s:Get_prev_line(nlnum)
let nline = SanitizeRLine(getline(nlnum)) . nline
endwhile
if nline =~ '^\s*function\s*(' && indent(nlnum) == &sw
if nline =~ '^\s*function\s*(' && indent(nlnum) == shiftwidth()
return 0
endif
endif
@@ -285,7 +285,7 @@ function GetRIndent()
" line is an incomplete command:
if line =~ '\<\(if\|while\|for\|function\)\s*()$' || line =~ '\<else$' || line =~ '<-$' || line =~ '->$'
return indent(lnum) + &sw
return indent(lnum) + shiftwidth()
endif
" Deal with () and []
@@ -293,14 +293,14 @@ function GetRIndent()
let pb = s:Get_paren_balance(line, '(', ')')
if line =~ '^\s*{$' || line =~ '(\s*{' || (pb == 0 && (line =~ '{$' || line =~ '(\s*{$'))
return indent(lnum) + &sw
return indent(lnum) + shiftwidth()
endif
let s:curtabstop = repeat(' ', &tabstop)
if g:r_indent_align_args == 1
if pb > 0 && line =~ '{$'
return s:Get_last_paren_idx(line, '(', ')', pb) + &sw
return s:Get_last_paren_idx(line, '(', ')', pb) + shiftwidth()
endif
let bb = s:Get_paren_balance(line, '[', ']')
@@ -364,11 +364,11 @@ function GetRIndent()
if oline =~ g:r_indent_op_pattern && s:Get_paren_balance(line, "(", ")") == 0
return indent(lnum)
else
return indent(lnum) + &sw
return indent(lnum) + shiftwidth()
endif
else
if oline =~ g:r_indent_op_pattern && s:Get_paren_balance(line, "(", ")") == 0
return indent(lnum) - &sw
return indent(lnum) - shiftwidth()
endif
endif
endif
@@ -383,7 +383,7 @@ function GetRIndent()
let line = linepiece . line
endwhile
if line =~ '{$' && post_block == 0
return indent(lnum) + &sw
return indent(lnum) + shiftwidth()
endif
" Now we can do some tests again
@@ -393,19 +393,19 @@ function GetRIndent()
if post_block == 0
let newl = SanitizeRLine(line)
if newl =~ '\<\(if\|while\|for\|function\)\s*()$' || newl =~ '\<else$' || newl =~ '<-$'
return indent(lnum) + &sw
return indent(lnum) + shiftwidth()
endif
endif
endif
if cline =~ '^\s*else'
if line =~ '<-\s*if\s*()'
return indent(lnum) + &sw
return indent(lnum) + shiftwidth()
else
if line =~ '\<if\s*()'
return indent(lnum)
else
return indent(lnum) - &sw
return indent(lnum) - shiftwidth()
endif
endif
endif
@@ -474,12 +474,12 @@ function GetRIndent()
let ind = indent(lnum)
if g:r_indent_align_args == 0 && pb != 0
let ind += pb * &sw
let ind += pb * shiftwidth()
return ind
endif
if g:r_indent_align_args == 0 && bb != 0
let ind += bb * &sw
let ind += bb * shiftwidth()
return ind
endif
@@ -489,7 +489,7 @@ function GetRIndent()
let pind = 0
endif
if ind == pind || (ind == (pind + &sw) && pline =~ '{$' && ppost_else == 0)
if ind == pind || (ind == (pind + shiftwidth()) && pline =~ '{$' && ppost_else == 0)
return ind
endif
@@ -509,7 +509,7 @@ function GetRIndent()
let pbb = s:Get_paren_balance(pline, '[', ']')
endwhile
let pind = indent(plnum)
if ind == (pind + &sw) && pline =~ '{$'
if ind == (pind + shiftwidth()) && pline =~ '{$'
return ind
endif
endwhile
+1 -1
View File
@@ -82,7 +82,7 @@ function GetRHelpIndent()
let closeb = strlen(line2) - strlen(line3)
let bb = openb - closeb
let ind = indent(lnum) + (bb * &sw)
let ind = indent(lnum) + (bb * shiftwidth())
if line =~ '^\s*}\s*$'
let ind = indent(lnum)
+10 -2
View File
@@ -1,6 +1,6 @@
" Vim script to work like "less"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2015 Nov 15
" Last Change: 2017 Mar 31
" Avoid loading this file twice, allow the user to define his own script.
if exists("loaded_less")
@@ -81,6 +81,10 @@ fun! s:Help()
echo "\n"
echo "/pattern Search for pattern ?pattern Search backward for pattern"
echo "n next pattern match N Previous pattern match"
if &foldmethod != "manual"
echo "\n"
echo "zR open all folds zm increase fold level"
endif
echo "\n"
echo ":n<Enter> Next file :p<Enter> Previous file"
echo "\n"
@@ -96,7 +100,11 @@ map <C-F> <Space>
map <PageDown> <Space>
map <kPageDown> <Space>
map <S-Down> <Space>
map z <Space>
" If 'foldmethod' was changed keep the "z" commands, e.g. "zR" to open all
" folds.
if &foldmethod == "manual"
map z <Space>
endif
map <Esc><Space> <Space>
fun! s:NextPage()
if line(".") == line("$")
+2
View File
@@ -638,6 +638,8 @@ if has("gui")
endif
call append("$", "linespace\tnumber of pixel lines to use between characters")
call append("$", " \tset lsp=" . &lsp)
call append("$", "columnspace\tnumber of pixel columns to use between characters")
call append("$", " \tset csp=" . &csp)
if has("balloon_eval")
call append("$", "balloondelay\tdelay in milliseconds before a balloon may pop up")
call append("$", " \tset bdlay=" . &bdlay)
+15 -9
View File
@@ -1,7 +1,7 @@
" matchit.vim: (global plugin) Extended "%" matching
" Last Change: 2016 Aug 21
" Last Change: 2017 March 26
" Maintainer: Benji Fisher PhD <benji@member.AMS.org>
" Version: 1.13.2, for Vim 6.3+
" Version: 1.13.3, for Vim 6.3+
" Fix from Fernando Torres included.
" Improvement from Ken Takata included.
" URL: http://www.vim.org/script.php?script_id=39
@@ -89,12 +89,15 @@ let s:notslash = '\\\@<!\%(\\\\\)*'
function! s:Match_wrapper(word, forward, mode) range
" In s:CleanUp(), :execute "set" restore_options .
let restore_options = (&ic ? " " : " no") . "ignorecase"
if exists("b:match_ignorecase")
let restore_options = ""
if exists("b:match_ignorecase") && b:match_ignorecase != &ic
let restore_options .= (&ic ? " " : " no") . "ignorecase"
let &ignorecase = b:match_ignorecase
endif
let restore_options = " ve=" . &ve . restore_options
set ve=
if &ve != ''
let restore_options = " ve=" . &ve . restore_options
set ve=
endif
" If this function was called from Visual mode, make sure that the cursor
" is at the correct end of the Visual range:
if a:mode == "v"
@@ -287,7 +290,9 @@ endfun
" Restore options and do some special handling for Operator-pending mode.
" The optional argument is the tail of the matching group.
fun! s:CleanUp(options, mode, startline, startcol, ...)
execute "set" a:options
if strlen(a:options)
execute "set" a:options
endif
" Open folds, if appropriate.
if a:mode != "o"
if &foldopen =~ "percent"
@@ -639,8 +644,9 @@ fun! s:MultiMatch(spflag, mode)
if !exists("b:match_words") || b:match_words == ""
return ""
end
let restore_options = (&ic ? "" : "no") . "ignorecase"
if exists("b:match_ignorecase")
let restore_options = ""
if exists("b:match_ignorecase") && b:match_ignorecase != &ic
let restore_options .= (&ic ? " " : " no") . "ignorecase"
let &ignorecase = b:match_ignorecase
endif
let startline = line(".")
+8 -6
View File
@@ -2,7 +2,7 @@
" Language: AutoHotkey script file
" Maintainer: Michael Wong
" https://github.com/mmikeww/autohotkey.vim
" Latest Revision: 2017-01-23
" Latest Revision: 2017-04-03
" Previous Maintainers: SungHyun Nam <goweol@gmail.com>
" Nikolai Weibull <now@bitwi.se>
@@ -106,6 +106,7 @@ syn keyword autohotkeyCommand
\ FormatTime IfInString IfNotInString Sort StringCaseSense StringGetPos
\ StringLeft StringRight StringLower StringUpper StringMid StringReplace
\ StringSplit StringTrimLeft StringTrimRight StringLen
\ StrSplit StrReplace Throw
\ Control ControlClick ControlFocus ControlGet ControlGetFocus
\ ControlGetPos ControlGetText ControlMove ControlSend ControlSendRaw
\ ControlSetText Menu PostMessage SendMessage SetControlDelay
@@ -119,17 +120,18 @@ syn keyword autohotkeyCommand
\ SetCapsLockState SetNumLockState SetScrollLockState
syn keyword autohotkeyFunction
\ InStr RegExMatch RegExReplace StrLen SubStr Asc Chr
\ InStr RegExMatch RegExReplace StrLen SubStr Asc Chr Func
\ DllCall VarSetCapacity WinActive WinExist IsLabel OnMessage
\ Abs Ceil Exp Floor Log Ln Mod Round Sqrt Sin Cos Tan ASin ACos ATan
\ FileExist GetKeyState NumGet NumPut StrGet StrPut RegisterCallback
\ IsFunc Trim LTrim RTrim IsObject Object Array FileOpen
\ ComObjActive ComObjArray ComObjConnect ComObjCreate ComObjGet
\ ComObjError ComObjFlags ComObjQuery ComObjType ComObjValue ComObject
\ Format Exception
syn keyword autohotkeyStatement
\ Break Continue Exit ExitApp Gosub Goto OnExit Pause Return
\ Suspend Reload
\ Suspend Reload new class extends
syn keyword autohotkeyRepeat
\ Loop
@@ -138,7 +140,7 @@ syn keyword autohotkeyConditional
\ IfExist IfNotExist If IfEqual IfLess IfGreater Else
\ IfWinExist IfWinNotExist IfWinActive IfWinNotActive
\ IfNotEqual IfLessOrEqual IfGreaterOrEqual
\ while until for in
\ while until for in try catch finally
syn match autohotkeyPreProcStart
\ nextgroup=
@@ -178,7 +180,7 @@ syn keyword autohotkeyPreProc
\ Warn
syn keyword autohotkeyMatchClass
\ ahk_group ahk_class ahk_id ahk_pid
\ ahk_group ahk_class ahk_id ahk_pid ahk_exe
syn match autohotkeyNumbers
\ display
@@ -217,7 +219,7 @@ syn match autohotkeyHotkey
\ contains=autohotkeyKey,
\ autohotkeyHotkeyDelimiter
\ display
\ '^.\{-}::'
\ '^\s*\S*\%( Up\)\?::'
syn match autohotkeyKey
\ contained
+23 -27
View File
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: php PHP 3/4/5/7
" Maintainer: Jason Woofenden <jason@jasonwoof.com>
" Last Change: Dec 11, 2016
" Last Change: Apr 28, 2017
" URL: https://jasonwoof.com/gitweb/?p=vim-syntax.git;a=blob;f=php.vim;hb=HEAD
" Former Maintainers: Peter Hodge <toomuchphp-vim@yahoo.com>
" Debian VIM Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
@@ -11,32 +11,28 @@
" colourscheme, because elflord's colours will better highlight the break-points
" (Statements) in your code.
"
" Options: php_sql_query = 1 for SQL syntax highlighting inside strings
" php_htmlInStrings = 1 for HTML syntax highlighting inside strings
" php_baselib = 1 for highlighting baselib functions
" php_asp_tags = 1 for highlighting ASP-style short tags
" php_parent_error_close = 1 for highlighting parent error ] or )
" php_parent_error_open = 1 for skipping an php end tag, if there exists an open ( or [ without a closing one
" php_oldStyle = 1 for using old colorstyle
" php_noShortTags = 1 don't sync <? ?> as php
" php_folding = 1 for folding classes and functions
" php_folding = 2 for folding all { } regions
" php_sync_method = x
" x=-1 to sync by search ( default )
" x>0 to sync at least x lines backwards
" x=0 to sync from start
"
" Added by Peter Hodge On June 9, 2006:
" php_special_functions = 1|0 to highlight functions with abnormal behaviour
" php_alt_comparisons = 1|0 to highlight comparison operators in an alternate colour
" php_alt_assignByReference = 1|0 to highlight '= &' in an alternate colour
"
" Note: these all default to 1 (On), so you would set them to '0' to turn them off.
" E.g., in your .vimrc or _vimrc file:
" let php_special_functions = 0
" let php_alt_comparisons = 0
" let php_alt_assignByReference = 0
" Unletting these variables will revert back to their default (On).
" Options:
" Set to anything to enable:
" php_sql_query SQL syntax highlighting inside strings
" php_htmlInStrings HTML syntax highlighting inside strings
" php_baselib highlighting baselib functions
" php_asp_tags highlighting ASP-style short tags
" php_parent_error_close highlighting parent error ] or )
" php_parent_error_open skipping an php end tag, if there exists
" an open ( or [ without a closing one
" php_oldStyle use old colorstyle
" php_noShortTags don't sync <? ?> as php
" Set to a specific value:
" php_folding = 1 fold classes and functions
" php_folding = 2 fold all { } regions
" php_sync_method = x where x is an integer:
" -1 sync by search ( default )
" >0 sync at least x lines backwards
" 0 sync from start
" Set to 0 to _disable_: (Added by Peter Hodge On June 9, 2006)
" php_special_functions = 0 highlight functions with abnormal behaviour
" php_alt_comparisons = 0 comparison operators in an alternate colour
" php_alt_assignByReference = 0 '= &' in an alternate colour
"
"
" Note:
+145 -28
View File
@@ -5,10 +5,10 @@
" Tom Payne <tom@tompayne.org>
" Contributor: Johannes Ranke <jranke@uni-bremen.de>
" Homepage: https://github.com/jalvesaq/R-Vim-runtime
" Last Change: Thu Aug 25, 2016 08:52PM
" Last Change: Sat Apr 08, 2017 07:01PM
" Filenames: *.R *.r *.Rhistory *.Rt
"
" NOTE: The highlighting of R functions is defined in
" NOTE: The highlighting of R functions might be defined in
" runtime files created by a filetype plugin, if installed.
"
" CONFIGURATION:
@@ -18,7 +18,7 @@
"
" ROxygen highlighting can be turned off by
"
" let r_hl_roxygen = 0
" let r_syntax_hl_roxygen = 0
"
" Some lines of code were borrowed from Zhuojun Chen.
@@ -26,13 +26,25 @@ if exists("b:current_syntax")
finish
endif
syn iskeyword @,48-57,_,.
if has("patch-7.4.1142")
syn iskeyword @,48-57,_,.
else
setlocal iskeyword=@,48-57,_,.
endif
" The variables g:r_hl_roxygen and g:r_syn_minlines were renamed on April 8, 2017.
if exists("g:r_hl_roxygen")
let g:r_syntax_hl_roxygen = g:r_hl_roxygen
endif
if exists("g:r_syn_minlines")
let g:r_syntax_minlines = g:r_syn_minlines
endif
if exists("g:r_syntax_folding") && g:r_syntax_folding
setlocal foldmethod=syntax
endif
if !exists("g:r_hl_roxygen")
let g:r_hl_roxygen = 1
if !exists("g:r_syntax_hl_roxygen")
let g:r_syntax_hl_roxygen = 1
endif
syn case match
@@ -42,19 +54,106 @@ syn match rCommentTodo contained "\(BUG\|FIXME\|NOTE\|TODO\):"
syn match rComment contains=@Spell,rCommentTodo,rOBlock "#.*"
" Roxygen
if g:r_hl_roxygen
syn region rOBlock start="^\s*\n#\{1,2}' " start="\%^#\{1,2}' " end="^\(#\{1,2}'\)\@!" contains=rOTitle,rOKeyword,rOExamples,@Spell keepend
syn region rOTitle start="^\s*\n#\{1,2}' " start="\%^#\{1,2}' " end="^\(#\{1,2}'\s*$\)\@=" contained contains=rOCommentKey
syn match rOCommentKey "#\{1,2}'" containedin=rOTitle contained
if g:r_syntax_hl_roxygen
" A roxygen block can start at the beginning of a file (first version) and
" after a blank line (second version). It ends when a line that does not
" contain a roxygen comment. In the following comments, any line containing
" a roxygen comment marker (one or two hash signs # followed by a single
" quote ' and preceded only by whitespace) is called a roxygen line. A
" roxygen line containing only a roxygen comment marker, optionally followed
" by whitespace is called an empty roxygen line.
syn region rOExamples start="^#\{1,2}' @examples.*"rs=e+1,hs=e+1 end="^\(#\{1,2}' @.*\)\@=" end="^\(#\{1,2}'\)\@!" contained contains=rOKeyword
" First we match all roxygen blocks as containing only a title. In case an
" empty roxygen line ending the title or a tag is found, this will be
" overriden later by the definitions of rOBlock.
syn match rOTitleBlock "\%^\(\s*#\{1,2}' .*\n\)\{1,}" contains=rOCommentKey,rOTitleTag
syn match rOTitleBlock "^\s*\n\(\s*#\{1,2}' .*\n\)\{1,}" contains=rOCommentKey,rOTitleTag
syn match rOKeyword contained "@\(param\|return\|name\|rdname\|examples\|example\|include\|docType\)"
syn match rOKeyword contained "@\(S3method\|TODO\|aliases\|alias\|assignee\|author\|callGraphDepth\|callGraph\)"
syn match rOKeyword contained "@\(callGraphPrimitives\|concept\|exportClass\|exportMethod\|exportPattern\|export\|formals\)"
syn match rOKeyword contained "@\(format\|importClassesFrom\|importFrom\|importMethodsFrom\|import\|keywords\|useDynLib\)"
syn match rOKeyword contained "@\(method\|noRd\|note\|references\|seealso\|setClass\|slot\|source\|title\|usage\)"
syn match rOKeyword contained "@\(family\|template\|templateVar\|description\|details\|inheritParams\|field\)"
" When a roxygen block has a title and additional content, the title
" consists of one or more roxygen lines (as little as possible are matched),
" followed either by an empty roxygen line
syn region rOBlock start="\%^\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*$" end="^\s*\(#\{1,2}'\)\@!" contains=rOTitle,rOTag,rOExamples,@Spell keepend fold
syn region rOBlock start="^\s*\n\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*$" end="^\s*\(#\{1,2}'\)\@!" contains=rOTitle,rOTag,rOExamples,@Spell keepend fold
" or by a roxygen tag (we match everything starting with @ but not @@ which is used as escape sequence for a literal @).
syn region rOBlock start="\%^\(\s*#\{1,2}' .*\n\)\{-}\s*#\{1,2}' @\(@\)\@!" end="^\s*\(#\{1,2}'\)\@!" contains=rOTitle,rOTag,rOExamples,@Spell keepend fold
syn region rOBlock start="^\s*\n\(\s*#\{1,2}' .*\n\)\{-}\s*#\{1,2}' @\(@\)\@!" end="^\s*\(#\{1,2}'\)\@!" contains=rOTitle,rOTag,rOExamples,@Spell keepend fold
" If a block contains an @rdname, @describeIn tag, it may have paragraph breaks, but does not have a title
syn region rOBlockNoTitle start="\%^\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*\n\(\s*#\{1,2}'.*\n\)\{-}\s*#\{1,2}' @rdname" end="^\s*\(#\{1,2}'\)\@!" contains=rOTag,rOExamples,@Spell keepend fold
syn region rOBlockNoTitle start="^\s*\n\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*\n\(\s*#\{1,2}'.*\n\)\{-}\s*#\{1,2}' @rdname" end="^\s*\(#\{1,2}'\)\@!" contains=rOTag,rOExamples,@Spell keepend fold
syn region rOBlockNoTitle start="\%^\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*\n\(\s*#\{1,2}'.*\n\)\{-}\s*#\{1,2}' @describeIn" end="^\s*\(#\{1,2}'\)\@!" contains=rOTag,rOExamples,@Spell keepend fold
syn region rOBlockNoTitle start="^\s*\n\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*\n\(\s*#\{1,2}'.*\n\)\{-}\s*#\{1,2}' @describeIn" end="^\s*\(#\{1,2}'\)\@!" contains=rOTag,rOExamples,@Spell keepend fold
" A title as part of a block is always at the beginning of the block, i.e.
" either at the start of a file or after a completely empty line.
syn match rOTitle "\%^\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*$" contained contains=rOCommentKey,rOTitleTag
syn match rOTitle "^\s*\n\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*$" contained contains=rOCommentKey,rOTitleTag
syn match rOTitleTag contained "@title"
syn match rOCommentKey "#\{1,2}'" contained
syn region rOExamples start="^#\{1,2}' @examples.*"rs=e+1,hs=e+1 end="^\(#\{1,2}' @.*\)\@=" end="^\(#\{1,2}'\)\@!" contained contains=rOTag fold
" rOTag list generated from the lists in
" https://github.com/klutometis/roxygen/R/rd.R and
" https://github.com/klutometis/roxygen/R/namespace.R
" using s/^ \([A-Za-z0-9]*\) = .*/ syn match rOTag contained "@\1"/
" Plus we need the @include tag
" rd.R
syn match rOTag contained "@aliases"
syn match rOTag contained "@author"
syn match rOTag contained "@backref"
syn match rOTag contained "@concept"
syn match rOTag contained "@describeIn"
syn match rOTag contained "@description"
syn match rOTag contained "@details"
syn match rOTag contained "@docType"
syn match rOTag contained "@encoding"
syn match rOTag contained "@evalRd"
syn match rOTag contained "@example"
syn match rOTag contained "@examples"
syn match rOTag contained "@family"
syn match rOTag contained "@field"
syn match rOTag contained "@format"
syn match rOTag contained "@inherit"
syn match rOTag contained "@inheritParams"
syn match rOTag contained "@inheritDotParams"
syn match rOTag contained "@inheritSection"
syn match rOTag contained "@keywords"
syn match rOTag contained "@method"
syn match rOTag contained "@name"
syn match rOTag contained "@md"
syn match rOTag contained "@noMd"
syn match rOTag contained "@noRd"
syn match rOTag contained "@note"
syn match rOTag contained "@param"
syn match rOTag contained "@rdname"
syn match rOTag contained "@rawRd"
syn match rOTag contained "@references"
syn match rOTag contained "@return"
syn match rOTag contained "@section"
syn match rOTag contained "@seealso"
syn match rOTag contained "@slot"
syn match rOTag contained "@source"
syn match rOTag contained "@template"
syn match rOTag contained "@templateVar"
syn match rOTag contained "@title"
syn match rOTag contained "@usage"
" namespace.R
syn match rOTag contained "@export"
syn match rOTag contained "@exportClass"
syn match rOTag contained "@exportMethod"
syn match rOTag contained "@exportPattern"
syn match rOTag contained "@import"
syn match rOTag contained "@importClassesFrom"
syn match rOTag contained "@importFrom"
syn match rOTag contained "@importMethodsFrom"
syn match rOTag contained "@rawNamespace"
syn match rOTag contained "@S3method"
syn match rOTag contained "@useDynLib"
" other
syn match rOTag contained "@include"
endif
@@ -168,12 +267,28 @@ syn match rBraceError "[)}]" contained
syn match rCurlyError "[)\]]" contained
syn match rParenError "[\]}]" contained
if !exists("g:R_hi_fun")
let g:R_hi_fun = 1
" Use Nvim-R to highlight functions dynamically if it is installed
if !exists("g:r_syntax_fun_pattern")
let s:ff = split(substitute(globpath(&rtp, "R/functions.vim"), "functions.vim", "", "g"), "\n")
if len(s:ff) > 0
let g:r_syntax_fun_pattern = 0
else
let g:r_syntax_fun_pattern = 1
endif
endif
if g:R_hi_fun
" Nvim-R:
runtime R/functions.vim
" Only use Nvim-R to highlight functions if they should not be highlighted
" according to a generic pattern
if g:r_syntax_fun_pattern == 1
syn match rFunction '[0-9a-zA-Z_\.]\+\s*\ze('
else
if !exists("g:R_hi_fun")
let g:R_hi_fun = 1
endif
if g:R_hi_fun
" Nvim-R:
runtime R/functions.vim
endif
endif
syn match rDollar display contained "\$"
@@ -205,8 +320,8 @@ if &filetype == "rhelp"
syn match rhSection "\\dontrun\>"
endif
if exists("r_syn_minlines")
exe "syn sync minlines=" . r_syn_minlines
if exists("r_syntax_minlines")
exe "syn sync minlines=" . r_syntax_minlines
else
syn sync minlines=40
endif
@@ -243,15 +358,17 @@ hi def link rStatement Statement
hi def link rString String
hi def link rStrError Error
hi def link rType Type
if g:r_hl_roxygen
hi def link rOKeyword Title
hi def link rOBlock Comment
if g:r_syntax_hl_roxygen
hi def link rOTitleTag Operator
hi def link rOTag Operator
hi def link rOTitleBlock Title
hi def link rOBlock Comment
hi def link rOBlockNoTitle Comment
hi def link rOTitle Title
hi def link rOCommentKey Comment
hi def link rOExamples SpecialComment
endif
let b:current_syntax="r"
" vim: ts=8 sw=2
+66 -28
View File
@@ -1,17 +1,26 @@
" markdown Text with R statements
" Language: markdown with R code chunks
" Homepage: https://github.com/jalvesaq/R-Vim-runtime
" Last Change: Tue Jun 28, 2016 10:09AM
" Last Change: Sat Jan 28, 2017 10:06PM
"
" CONFIGURATION:
" To highlight chunk headers as R code, put in your vimrc:
" To highlight chunk headers as R code, put in your vimrc (e.g. .config/nvim/init.vim):
" let rmd_syn_hl_chunk = 1
"
" For highlighting pandoc extensions to markdown like citations and TeX and
" many other advanced features like folding of markdown sections, it is
" recommended to install the vim-pandoc filetype plugin as well as the
" vim-pandoc-syntax filetype plugin from https://github.com/vim-pandoc.
"
" TODO:
" - Provide highlighting for rmarkdown parameters in yaml header
if exists("b:current_syntax")
finish
endif
" load all of pandoc info
" load all of pandoc info, e.g. from
" https://github.com/vim-pandoc/vim-pandoc-syntax
runtime syntax/pandoc.vim
if exists("b:current_syntax")
let rmdIsPandoc = 1
@@ -22,28 +31,54 @@ else
if exists("b:current_syntax")
unlet b:current_syntax
endif
" load all of the yaml syntax highlighting rules into @yaml
syntax include @yaml syntax/yaml.vim
if exists("b:current_syntax")
unlet b:current_syntax
endif
" highlight yaml block commonly used for front matter
syntax region rmdYamlBlock matchgroup=rmdYamlBlockDelim start="^---" matchgroup=rmdYamlBlockDelim end="^---" contains=@yaml keepend fold
endif
" load all of the r syntax highlighting rules into @R
syntax include @R syntax/r.vim
if exists("b:current_syntax")
unlet b:current_syntax
endif
if exists("g:rmd_syn_hl_chunk")
" highlight R code inside chunk header
syntax match rmdChunkDelim "^[ \t]*```{r" contained
syntax match rmdChunkDelim "}$" contained
if !exists("g:rmd_syn_langs")
let g:rmd_syn_langs = ["r"]
else
syntax match rmdChunkDelim "^[ \t]*```{r.*}$" contained
let s:hasr = 0
for s:lng in g:rmd_syn_langs
if s:lng == "r"
let s:hasr = 1
endif
endfor
if s:hasr == 0
let g:rmd_syn_langs += ["r"]
endif
endif
syntax match rmdChunkDelim "^[ \t]*```$" contained
syntax region rmdChunk start="^[ \t]*``` *{r.*}$" end="^[ \t]*```$" contains=@R,rmdChunkDelim keepend fold
for s:lng in g:rmd_syn_langs
exe 'syntax include @' . toupper(s:lng) . ' syntax/'. s:lng . '.vim'
if exists("b:current_syntax")
unlet b:current_syntax
endif
exe 'syntax region rmd' . toupper(s:lng) . 'Chunk start="^[ \t]*``` *{\(' . s:lng . '\|r.*engine\s*=\s*["' . "']" . s:lng . "['" . '"]\).*}$" end="^[ \t]*```$" contains=@' . toupper(s:lng) . ',rmd' . toupper(s:lng) . 'ChunkDelim keepend fold'
if exists("g:rmd_syn_hl_chunk") && s:lng == "r"
" highlight R code inside chunk header
syntax match rmdRChunkDelim "^[ \t]*```{r" contained
syntax match rmdRChunkDelim "}$" contained
else
exe 'syntax match rmd' . toupper(s:lng) . 'ChunkDelim "^[ \t]*```{\(' . s:lng . '\|r.*engine\s*=\s*["' . "']" . s:lng . "['" . '"]\).*}$" contained'
endif
exe 'syntax match rmd' . toupper(s:lng) . 'ChunkDelim "^[ \t]*```$" contained'
endfor
" also match and syntax highlight in-line R code
syntax match rmdEndInline "`" contained
syntax match rmdBeginInline "`r " contained
syntax region rmdrInline start="`r " end="`" contains=@R,rmdBeginInline,rmdEndInline keepend
syntax region rmdrInline matchgroup=rmdInlineDelim start="`r " end="`" contains=@R containedin=pandocLaTeXRegion,yamlFlowString keepend
" I was not able to highlight rmdrInline inside a pandocLaTeXCommand, although
" highlighting works within pandocLaTeXRegion and yamlFlowString.
syntax cluster texMathZoneGroup add=rmdrInline
" match slidify special marker
syntax match rmdSlidifySpecial "\*\*\*"
@@ -56,8 +91,6 @@ if rmdIsPandoc == 0
if exists("b:current_syntax")
unlet b:current_syntax
endif
" Extend cluster
syn cluster texMathZoneGroup add=rmdrInline
" Inline
syntax match rmdLaTeXInlDelim "\$"
syntax match rmdLaTeXInlDelim "\\\$"
@@ -65,19 +98,24 @@ if rmdIsPandoc == 0
" Region
syntax match rmdLaTeXRegDelim "\$\$" contained
syntax match rmdLaTeXRegDelim "\$\$latex$" contained
syntax region rmdLaTeXRegion start="^\$\$" skip="\\\$" end="\$\$$" contains=@LaTeX,rmdLaTeXSt,rmdLaTeXRegDelim keepend
syntax region rmdLaTeXRegion2 start="^\\\[" end="\\\]" contains=@LaTeX,rmdLaTeXSt,rmdLaTeXRegDelim keepend
syntax match rmdLaTeXSt "\\[a-zA-Z]\+"
syntax region rmdLaTeXRegion start="^\$\$" skip="\\\$" end="\$\$$" contains=@LaTeX,rmdLaTeXRegDelim keepend
syntax region rmdLaTeXRegion2 start="^\\\[" end="\\\]" contains=@LaTeX,rmdLaTeXRegDelim keepend
hi def link rmdBlockQuote Comment
hi def link rmdLaTeXSt Statement
hi def link rmdLaTeXInlDelim Special
hi def link rmdLaTeXRegDelim Special
endif
syn sync match rmdSyncChunk grouphere rmdChunk "^[ \t]*``` *{r"
for s:lng in g:rmd_syn_langs
exe 'syn sync match rmd' . toupper(s:lng) . 'SyncChunk grouphere rmd' . toupper(s:lng) . 'Chunk /^[ \t]*``` *{\(' . s:lng . '\|r.*engine\s*=\s*["' . "']" . s:lng . "['" . '"]\)/'
endfor
hi def link rmdChunkDelim Special
hi def link rmdBeginInline Special
hi def link rmdEndInline Special
hi def link rmdBlockQuote Comment
hi def link rmdYamlBlockDelim Delim
for s:lng in g:rmd_syn_langs
exe 'hi def link rmd' . toupper(s:lng) . 'ChunkDelim Special'
endfor
hi def link rmdInlineDelim Special
hi def link rmdSlidifySpecial Special
let b:current_syntax = "rmd"
+240 -242
View File
@@ -1,262 +1,259 @@
" Vim syntax file
" Language: SAS
" Maintainer: James Kidd <james.kidd@covance.com>
" Last Change: 2012 Apr 20
" Corrected bug causing some keywords to appear as strings instead
" 18 Jul 2008 by Paulo Tanimoto <ptanimoto@gmail.com>
" Fixed comments with * taking multiple lines.
" Fixed highlighting of macro keywords.
" Added words to cases that didn't fit anywhere.
" 02 Jun 2003
" Added highlighting for additional keywords and such;
" Attempted to match SAS default syntax colors;
" Changed syncing so it doesn't lose colors on large blocks;
" Much thanks to Bob Heckel for knowledgeable tweaking.
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
" Language: SAS
" Maintainer: Zhen-Huan Hu <wildkeny@gmail.com>
" Original Maintainer: James Kidd <james.kidd@covance.com>
" Version: 3.0.0
" Last Change: Mar 10, 2017
"
" 2017 Mar 7
"
" Upgrade version number to 3.0. Improvements include:
" - Improve sync speed
" - Largely enhance precision
" - Update keywords in the latest SAS (as of Mar 2017)
" - Add syntaxes for date/time constants
" - Add syntax for data lines
" - Add (back) syntax for TODO in comments
"
" 2017 Feb 9
"
" Add syntax folding
"
" 2016 Oct 10
"
" Add highlighting for functions
"
" 2016 Sep 14
"
" Change the implementation of syntaxing
" macro function names so that macro parameters same
" as SAS keywords won't be highlighted
" (Thank Joug Raw for the suggestion)
" Add section highlighting:
" - Use /** and **/ to define a section
" - It functions the same as a comment but
" with different highlighting
"
" 2016 Jun 14
"
" Major changes so upgrade version number to 2.0
" Overhaul the entire script (again). Improvements include:
" - Higher precision
" - Faster synchronization
" - Separate color for control statements
" - Highlight hash and java objects
" - Highlight macro variables in double quoted strings
" - Update all syntaxes based on SAS 9.4
" - Add complete SAS/GRAPH and SAS/STAT procedure syntaxes
" - Add Proc TEMPLATE and GTL syntaxes
" - Add complete DS2 syntaxes
" - Add basic IML syntaxes
" - Many other improvements and bug fixes
" Drop support for VIM version < 600
if version < 600
syntax clear
elseif exists('b:current_syntax')
finish
endif
let s:cpo_save = &cpo
set cpo&vim
syn case ignore
syn region sasString start=+"+ skip=+\\\\\|\\"+ end=+"+
syn region sasString start=+'+ skip=+\\\\\|\\"+ end=+'+
" Basic SAS syntaxes
syn keyword sasOperator and eq ge gt in le lt ne not of or
syn keyword sasReserved _all_ _automatic_ _char_ _character_ _data_ _infile_ _last_ _n_ _name_ _null_ _num_ _numeric_ _temporary_ _user_ _webout_
" Strings
syn region sasString start=+'+ skip=+''+ end=+'+ contains=@Spell
syn region sasString start=+"+ skip=+""+ end=+"+ contains=sasMacroVariable,@Spell
" Constants
syn match sasNumber /\v<\d+%(\.\d+)=%(>|e[\-+]=\d+>)/ display
syn match sasDateTime /\v(['"])\d{2}%(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d{2}%(\d{2})=:\d{2}:\d{2}%(:\d{2})=%(am|pm)\1dt>/ display
syn match sasDateTime /\v(['"])\d{2}%(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d{2}%(\d{2})=\1d>/ display
syn match sasDateTime /\v(['"])\d{2}:\d{2}%(:\d{2})=%(am|pm)\1t>/ display
" Comments
syn keyword sasTodo todo tbd fixme contained
syn region sasComment start='/\*' end='\*/' contains=sasTodo
syn region sasComment start='\v%(^|;)\s*\zs\%=\*' end=';'me=s-1 contains=sasTodo
syn region sasSectLbl matchgroup=sasSectLblEnds start='/\*\*\s*' end='\s*\*\*/' concealends
" Macros
syn match sasMacroVariable '\v\&+\w+%(\.\w+)=' display
syn match sasMacroReserved '\v\%%(abort|by|copy|display|do|else|end|global|goto|if|include|input|let|list|local|macro|mend|put|return|run|symdel|syscall|sysexec|syslput|sysrput|then|to|until|window|while)>' display
syn region sasMacroFunction matchgroup=sasMacroFunctionName start='\v\%\w+\ze\(' end=')'he=s-1 contains=@sasBasicSyntax,sasMacroFunction
syn region sasMacroFunction matchgroup=sasMacroFunctionName start='\v\%q=sysfunc\ze\(' end=')'he=s-1 contains=@sasBasicSyntax,sasMacroFunction,sasDataStepFunction
" Syntax cluster for basic SAS syntaxes
syn cluster sasBasicSyntax contains=sasOperator,sasReserved,sasNumber,sasDateTime,sasString,sasComment,sasMacroReserved,sasMacroFunction,sasMacroVariable,sasSectLbl
" Want region from 'cards;' to ';' to be captured (Bob Heckel)
syn region sasCards start="^\s*CARDS.*" end="^\s*;\s*$"
syn region sasCards start="^\s*DATALINES.*" end="^\s*;\s*$"
" Formats
syn match sasFormat '\v\$\w+\.' display contained
syn match sasFormat '\v<\w+\.%(\d+>)=' display contained
syn region sasFormatContext start='.' end=';'me=s-1 contained contains=@sasBasicSyntax,sasFormat
syn match sasNumber "-\=\<\d*\.\=[0-9_]\>"
" Define global statements that can be accessed out of data step or procedures
syn keyword sasGlobalStatementKeyword catname dm endsas filename footnote footnote1 footnote2 footnote3 footnote4 footnote5 footnote6 footnote7 footnote8 footnote9 footnote10 missing libname lock ods options page quit resetline run sasfile skip sysecho title title1 title2 title3 title4 title5 title6 title7 title8 title9 title10 contained
syn keyword sasGlobalStatementODSKeyword chtml csvall docbook document escapechar epub epub2 epub3 exclude excel graphics html html3 html5 htmlcss imode listing markup output package path pcl pdf preferences phtml powerpoint printer proclabel proctitle ps results rtf select show tagsets trace usegopt verify wml contained
syn match sasGlobalStatement '\v%(^|;)\s*\zs\h\w*>' display transparent contains=sasGlobalStatementKeyword
syn match sasGlobalStatement '\v%(^|;)\s*\zsods>' display transparent contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
" Block comment
syn region sasComment start="/\*" end="\*/" contains=sasTodo
" Data step statements, 9.4
syn keyword sasDataStepFunctionName abs addr addrlong airy allcomb allperm anyalnum anyalpha anycntrl anydigit anyfirst anygraph anylower anyname anyprint anypunct anyspace anyupper anyxdigit arcos arcosh arsin arsinh artanh atan atan2 attrc attrn band beta betainv blackclprc blackptprc blkshclprc blkshptprc blshift bnot bor brshift bxor byte cat catq cats catt catx cdf ceil ceilz cexist char choosec choosen cinv close cmiss cnonct coalesce coalescec collate comb compare compbl compfuzz compged complev compound compress constant convx convxp cos cosh cot count countc countw csc css cumipmt cumprinc curobs cv daccdb daccdbsl daccsl daccsyd dacctab dairy datdif date datejul datepart datetime day dclose dcreate depdb depdbsl depsl depsyd deptab dequote deviance dhms dif digamma dim dinfo divide dnum dopen doptname doptnum dosubl dread dropnote dsname dsncatlgd dur durp effrate envlen erf erfc euclid exist exp fact fappend fclose fcol fcopy fdelete fetch fetchobs fexist fget fileexist filename fileref finance find findc findw finfo finv fipname fipnamel fipstate first floor floorz fmtinfo fnonct fnote fopen foptname foptnum fpoint fpos fput fread frewind frlen fsep fuzz fwrite gaminv gamma garkhclprc garkhptprc gcd geodist geomean geomeanz getoption getvarc getvarn graycode harmean harmeanz hbound hms holiday holidayck holidaycount holidayname holidaynx holidayny holidaytest hour htmldecode htmlencode ibessel ifc ifn index indexc indexw input inputc inputn int intcindex intck intcycle intfit intfmt intget intindex intnx intrr intseas intshift inttest intz iorcmsg ipmt iqr irr jbessel juldate juldate7 kurtosis lag largest lbound lcm lcomb left length lengthc lengthm lengthn lexcomb lexcombi lexperk lexperm lfact lgamma libname libref log log1px log10 log2 logbeta logcdf logistic logpdf logsdf lowcase lperm lpnorm mad margrclprc margrptprc max md5 mdy mean median min minute missing mod modexist module modulec modulen modz month mopen mort msplint mvalid contained
syn keyword sasDataStepFunctionName n netpv nliteral nmiss nomrate normal notalnum notalpha notcntrl notdigit note notfirst notgraph notlower notname notprint notpunct notspace notupper notxdigit npv nvalid nwkdom open ordinal pathname pctl pdf peek peekc peekclong peeklong perm pmt point poisson ppmt probbeta probbnml probbnrm probchi probf probgam probhypr probit probmc probnegb probnorm probt propcase prxchange prxmatch prxparen prxparse prxposn ptrlongadd put putc putn pvp qtr quantile quote ranbin rancau rand ranexp rangam range rank rannor ranpoi rantbl rantri ranuni rename repeat resolve reverse rewind right rms round rounde roundz saving savings scan sdf sec second sha256 sha256hex sha256hmachex sign sin sinh skewness sleep smallest soapweb soapwebmeta soapwipservice soapwipsrs soapws soapwsmeta soundex spedis sqrt squantile std stderr stfips stname stnamel strip subpad substr substrn sum sumabs symexist symget symglobl symlocal sysexist sysget sysmsg sysparm sysprocessid sysprocessname sysprod sysrc system tan tanh time timepart timevalue tinv tnonct today translate transtrn tranwrd trigamma trim trimn trunc tso typeof tzoneid tzonename tzoneoff tzones2u tzoneu2s uniform upcase urldecode urlencode uss uuidgen var varfmt varinfmt varlabel varlen varname varnum varray varrayx vartype verify vformat vformatd vformatdx vformatn vformatnx vformatw vformatwx vformatx vinarray vinarrayx vinformat vinformatd vinformatdx vinformatn vinformatnx vinformatw vinformatwx vinformatx vlabel vlabelx vlength vlengthx vname vnamex vtype vtypex vvalue vvaluex week weekday whichc whichn wto year yieldp yrdif yyq zipcity zipcitydistance zipfips zipname zipnamel zipstate contained
syn keyword sasDataStepCallRoutineName allcomb allcombi allperm cats catt catx compcost execute graycode is8601_convert label lexcomb lexcombi lexperk lexperm logistic missing module poke pokelong prxchange prxdebug prxfree prxnext prxposn prxsubstr ranbin rancau rancomb ranexp rangam rannor ranperk ranperm ranpoi rantbl rantri ranuni scan set sleep softmax sortc sortn stdize streaminit symput symputx system tanh tso vname vnext wto contained
syn region sasDataStepFunctionContext start='(' end=')' contained contains=@sasBasicSyntax,sasDataStepFunction
syn region sasDataStepFunctionFormatContext start='(' end=')' contained contains=@sasBasicSyntax,sasDataStepFunction,sasFormat
syn match sasDataStepFunction '\v<\w+\ze\(' contained contains=sasDataStepFunctionName,sasDataStepCallRoutineName nextgroup=sasDataStepFunctionContext
syn match sasDataStepFunction '\v%(input|put)\ze\(' contained contains=sasDataStepFunctionName nextgroup=sasDataStepFunctionFormatContext
syn keyword sasDataStepHashMethodName add check clear definedata definedone definekey delete do_over equals find find_next find_prev first has_next has_prev last next output prev ref remove removedup replace replacedup reset_dup setcur sum sumdup contained
syn region sasDataStepHashMethodContext start='(' end=')' contained contains=@sasBasicSyntax,sasDataStepFunction
syn match sasDataStepHashMethod '\v\.\w+\ze\(' contained contains=sasDataStepHashMethodName nextgroup=sasDataStepHashMethodContext
syn keyword sasDataStepHashAttributeName item_size num_items contained
syn match sasDataStepHashAttribute '\v\.\w+>\ze\_[^(]' display contained contains=sasDataStepHashAttributeName
syn keyword sasDataStepControl continue do end go goto if leave link otherwise over return select to until when while contained
syn keyword sasDataStepControl else then contained nextgroup=sasDataStepStatementKeyword skipwhite skipnl skipempty
syn keyword sasDataStepHashOperator _new_ contained
syn keyword sasDataStepStatementKeyword abort array attrib by call cards cards4 datalines datalines4 dcl declare delete describe display drop error execute file format infile informat input keep label length lines lines4 list lostcard merge modify output put putlog redirect remove rename replace retain set stop update where window contained
syn keyword sasDataStepStatementHashKeyword hash hiter javaobj contained
syn match sasDataStepStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasDataStepStatementKeyword,sasGlobalStatementKeyword
syn match sasDataStepStatement '\v%(^|;)\s*\zs%(dcl|declare)>' display contained contains=sasDataStepStatementKeyword nextgroup=sasDataStepStatementHashKeyword skipwhite skipnl skipempty
syn match sasDataStepStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
syn match sasDataStepStatement '\v%(^|;)\s*\zs%(format|informat|input|put)>' display contained contains=sasDataStepStatementKeyword nextgroup=sasFormatContext skipwhite skipnl skipempty
syn match sasDataStepStatement '\v%(^|;)\s*\zs%(cards|datalines|lines)4=\s*;' display contained contains=sasDataStepStatementKeyword nextgroup=sasDataLine skipwhite skipnl skipempty
syn region sasDataLine start='^' end='^;'me=s-1 contained
syn region sasDataStep matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsdata>' end='\v%(^|;)\s*%(run|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,@sasDataStepSyntax
syn cluster sasDataStepSyntax contains=sasDataStepFunction,sasDataStepHashOperator,sasDataStepHashAttribute,sasDataStepHashMethod,sasDataStepControl,sasDataStepStatement
" Ignore misleading //JCL SYNTAX... (Bob Heckel)
syn region sasComment start="[^/][^/]/\*" end="\*/" contains=sasTodo
" Procedures, base SAS, 9.4
syn keyword sasProcStatementKeyword abort age append array attrib audit block break by calid cdfplot change checkbox class classlev column compute contents copy create datarow dbencoding define delete deletefunc deletesubr delimiter device dialog dur endcomp exact exchange exclude explore fin fmtlib fontfile fontpath format formats freq function getnames guessingrows hbar hdfs histogram holidur holifin holistart holivar id idlabel informat inset invalue item key keylabel keyword label line link listfunc listsubr mapmiss mapreduce mean menu messages meta modify opentype outargs outdur outfin output outstart pageby partial picture pie pig plot ppplot printer probplot profile prompter qqplot radiobox ranks rbreak rbutton rebuild record remove rename repair report roptions save select selection separator source star start statistics struct submenu subroutine sum sumby table tables test text trantab truetype type1 types value var vbar ways weight where with write contained
syn match sasProcStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasProcStatementKeyword,sasGlobalStatementKeyword
syn match sasProcStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
syn match sasProcStatement '\v%(^|;)\s*\zs%(format|informat)>' display contained contains=sasProcStatementKeyword nextgroup=sasFormatContext skipwhite skipnl skipempty
syn region sasProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc%(\s+\h\w*)=>' end='\v%(^|;)\s*%(run|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepFunction,sasProcStatement
syn region sasProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+%(catalog|chart|datasets|document|plot)>' end='\v%(^|;)\s*%(quit|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepFunction,sasProcStatement
" Previous code for comments was written by Bob Heckel
" Comments with * may take multiple lines (Paulo Tanimoto)
syn region sasComment start=";\s*\*"hs=s+1 end=";" contains=sasTodo
" Procedures, SAS/GRAPH, 9.4
syn keyword sasGraphProcStatementKeyword add area axis bar block bubble2 byline cc ccopy cdef cdelete chart cmap choro copy delete device dial donut exclude flow format fs goptions gout grid group hbar hbar3d hbullet hslider htrafficlight id igout label legend list modify move nobyline note pattern pie pie3d plot plot2 preview prism quit rename replay select scatter speedometer star surface symbol tc tcopy tdef tdelete template tile toggle treplay vbar vbar3d vtrafficlight vbullet vslider where contained
syn match sasGraphProcStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasGraphProcStatementKeyword,sasGlobalStatementKeyword
syn match sasGraphProcStatement '\v%(^|;)\s*\zsformat>' display contained contains=sasGraphProcStatementKeyword nextgroup=sasFormatContext skipwhite skipnl skipempty
syn region sasGraphProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+%(g3d|g3grid|ganno|gcontour|gdevice|geocode|gfont|ginside|goptions|gproject|greduce|gremove|mapimport)>' end='\v%(^|;)\s*%(run|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepFunction,sasGraphProcStatement
syn region sasGraphProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+%(gareabar|gbarline|gchart|gkpi|gmap|gplot|gradar|greplay|gslide|gtile)>' end='\v%(^|;)\s*%(quit|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepFunction,sasGraphProcStatement
" Comments with * starting after a semicolon (Paulo Tanimoto)
syn region sasComment start="^\s*\*" end=";" contains=sasTodo
" Procedures, SAS/STAT, 14.1
syn keyword sasAnalyticalProcStatementKeyword absorb add array assess baseline bayes beginnodata bivar bootstrap bounds by cdfplot cells class cluster code compute condition contrast control coordinates copy cosan cov covtest coxreg der design determ deviance direct directions domain effect effectplot effpart em endnodata equality estimate exact exactoptions factor factors fcs filter fitindex format freq fwdlink gender grid group grow hazardratio height hyperprior id impjoint inset insetgroup invar invlink ippplot lincon lineqs lismod lmtests location logistic loglin lpredplot lsmeans lsmestimate manova matings matrix mcmc mean means missmodel mnar model modelaverage modeleffects monotone mstruct mtest multreg name nlincon nloptions oddsratio onecorr onesamplefreq onesamplemeans onewayanova outfiles output paired pairedfreq pairedmeans parameters parent parms partial partition path pathdiagram pcov performance plot population poststrata power preddist predict predpplot priors process probmodel profile prune pvar ram random ratio reference refit refmodel renameparm repeated replicate repweights response restore restrict retain reweight ridge rmsstd roc roccontrast rules samplesize samplingunit seed size scale score selection show simtests simulate slice std stderr store strata structeq supplementary table tables test testclass testfreq testfunc testid time transform treatments trend twosamplefreq twosamplemeans towsamplesurvival twosamplewilcoxon uds units univar var variance varnames weight where with zeromodel contained
syn match sasAnalyticalProcStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasAnalyticalProcStatementKeyword,sasGlobalStatementKeyword
syn match sasAnalyticalProcStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
syn match sasAnalyticalProcStatement '\v%(^|;)\s*\zsformat>' display contained contains=sasAnalyticalProcStatementKeyword nextgroup=sasFormatContext skipwhite skipnl skipempty
syn region sasAnalyticalProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+%(aceclus|adaptivereg|bchoice|boxplot|calis|cancorr|candisc|cluster|corresp|discrim|distance|factor|fastclus|fmm|freq|gam|gampl|gee|genmod|glimmix|glmmod|glmpower|glmselect|hpcandisc|hpfmm|hpgenselect|hplmixed|hplogistic|hpmixed|hpnlmod|hppls|hpprincomp|hpquantselect|hpreg|hpsplit|iclifetest|icphreg|inbreed|irt|kde|krige2d|lattice|lifereg|lifetest|loess|logistic|mcmc|mds|mi|mianalyze|mixed|modeclus|multtest|nested|nlin|nlmixed|npar1way|orthoreg|phreg|plm|pls|power|princomp|prinqual|probit|quantlife|quantreg|quantselect|robustreg|rsreg|score|seqdesign|seqtest|sim2d|simnormal|spp|stdize|stdrate|stepdisc|surveyfreq|surveyimpute|surveylogistic|surveymeans|surveyphreg|surveyreg|surveyselect|tpspline|transreg|tree|ttest|varclus|varcomp|variogram)>' end='\v%(^|;)\s*%(run|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepControl,sasDataStepFunction,sasAnalyticalProcStatement
syn region sasAnalyticalProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+%(anova|arima|catmod|factex|glm|model|optex|plan|reg)>' end='\v%(^|;)\s*%(quit|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepControl,sasDataStepFunction,sasAnalyticalProcStatement
" This line defines macro variables in code. "hi def link" at end of file
" defines the color scheme. Begin region with ampersand and end with
" any non-word character offset by -1; put ampersand in the skip list
" just in case it is used to concatenate macro variable values.
" Procedures, ODS graphics, 9.4
syn keyword sasODSGraphicsProcStatementKeyword band block bubble by colaxis compare dattrvar density dot dropline dynamic ellipse ellipseparm format fringe gradlegend hbar hbarbasic hbarparm hbox heatmap heatmapparm highlow histogram hline inset keylegend label lineparm loess matrix needle parent panelby pbspline plot polygon refline reg rowaxis scatter series spline step style styleattrs symbolchar symbolimage text vbar vbarbasic vbarparm vbox vector vline waterfall where xaxis x2axis yaxis y2axis yaxistable contained
syn match sasODSGraphicsProcStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasODSGraphicsProcStatementKeyword,sasGlobalStatementKeyword
syn match sasODSGraphicsProcStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
syn match sasODSGraphicsProcStatement '\v%(^|;)\s*\zsformat>' display contained contains=sasODSGraphicsProcStatementKeyword nextgroup=sasFormatContext skipwhite skipnl skipempty
syn region sasODSGraphicsProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+%(sgdesign|sgpanel|sgplot|sgrender|sgscatter)>' end='\v%(^|;)\s*%(run|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepFunction,sasODSGraphicsProcStatement
" Thanks to ronald höllwarth for this fix to an intra-versioning
" problem with this little feature
" Proc TEMPLATE, 9.4
syn keyword sasProcTemplateClause as into
syn keyword sasProcTemplateStatementKeyword block break cellstyle class close column compute continue define delete delstream do done dynamic edit else end eval flush footer header import iterate link list mvar ndent next nmvar notes open path put putl putlog putq putstream putvars replace set source stop style test text text2 text3 translate trigger unblock unset xdent contained
syn keyword sasProcTemplateStatementComplexKeyword cellvalue column crosstabs event footer header statgraph style table tagset contained
syn keyword sasProcTemplateGTLStatementKeyword axislegend axistable bandplot barchart barchartparm begingraph beginpolygon beginpolyline bihistogram3dparm blockplot boxplot boxplotparm bubbleplot continuouslegend contourplotparm dendrogram discretelegend drawarrow drawimage drawline drawoval drawrectangle drawtext dropline ellipse ellipseparm endgraph endinnermargin endlayout endpolygon endpolyline endsidebar entry entryfootnote entrytitle fringeplot heatmap heatmapparm highlowplot histogram histogramparm innermargin layout legenditem legendtextitems linechart lineparm loessplot mergedlegend modelband needleplot pbsplineplot polygonplot referenceline regressionplot scatterplot seriesplot sidebar stepplot surfaceplotparm symbolchar symbolimage textplot vectorplot waterfallchart contained
syn keyword sasProcTemplateGTLComplexKeyword datalattice datapanel globallegend gridded lattice overlay overlayequated overlay3d region contained
syn match sasProcTemplateStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasProcTemplateStatementKeyword,sasProcTemplateGTLStatementKeyword,sasGlobalStatementKeyword
syn match sasProcTemplateStatement '\v%(^|;)\s*\zsdefine>' display contained contains=sasProcTemplateStatementKeyword nextgroup=sasProcTemplateStatementComplexKeyword skipwhite skipnl skipempty
syn match sasProcTemplateStatement '\v%(^|;)\s*\zslayout>' display contained contains=sasProcTemplateGTLStatementKeyword nextgroup=sasProcTemplateGTLComplexKeyword skipwhite skipnl skipempty
syn match sasProcTemplateStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
syn region sasProcTemplate matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+template>' end='\v%(^|;)\s*%(run|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasProcTemplateClause,sasProcTemplateStatement
syn region sasMacroVar start="&" skip="[_&]" end="\W"he=e-1
" Proc SQL, 9.4
syn keyword sasProcSQLFunctionName avg count css cv freq max mean median min n nmiss prt range std stderr sum sumwgt t uss var contained
syn region sasProcSQLFunctionContext start='(' end=')' contained contains=@sasBasicSyntax,sasProcSQLFunction
syn match sasProcSQLFunction '\v<\w+\ze\(' contained contains=sasProcSQLFunctionName,sasDataStepFunctionName nextgroup=sasProcSQLFunctionContext
syn keyword sasProcSQLClause add asc between by calculated cascade case check connection constraint cross desc distinct drop else end escape except exists foreign from full group having in inner intersect into is join key left libname like modify natural newline notrim null on order outer primary references restrict right separated set then to trimmed union unique user using values when where contained
syn keyword sasProcSQLClause as contained nextgroup=sasProcSQLStatementKeyword skipwhite skipnl skipempty
syn keyword sasProcSQLStatementKeyword connect delete disconnect execute insert reset select update validate contained
syn keyword sasProcSQLStatementComplexKeyword alter create describe drop contained nextgroup=sasProcSQLStatementNextKeyword skipwhite skipnl skipempty
syn keyword sasProcSQLStatementNextKeyword index table view contained
syn match sasProcSQLStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasProcSQLStatementKeyword,sasGlobalStatementKeyword
syn match sasProcSQLStatement '\v%(^|;)\s*\zs%(alter|create|describe|drop)>' display contained contains=sasProcSQLStatementComplexKeyword nextgroup=sasProcSQLStatementNextKeyword skipwhite skipnl skipempty
syn match sasProcSQLStatement '\v%(^|;)\s*\zsvalidate>' display contained contains=sasProcSQLStatementKeyword nextgroup=sasProcSQLStatementKeyword,sasProcSQLStatementComplexKeyword skipwhite skipnl skipempty
syn match sasProcSQLStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
syn region sasProcSQL matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+sql>' end='\v%(^|;)\s*%(quit|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasProcSQLFunction,sasProcSQLClause,sasProcSQLStatement
" SAS/DS2, 9.4
syn keyword sasDS2FunctionName abs anyalnum anyalpha anycntrl anydigit anyfirst anygraph anylower anyname anyprint anypunct anyspace anyupper anyxdigit arcos arcosh arsin arsinh artanh atan atan2 band beta betainv blackclprc blackptprc blkshclprc blkshptprc blshift bnot bor brshift bxor byte cat cats catt catx ceil ceilz choosec choosen cmp cmpt coalesce coalescec comb compare compbl compfuzz compound compress constant convx convxp cos cosh count countc countw css cumipmt cumprinc cv datdif date datejul datepart datetime day dequote deviance dhms dif digamma dim divide dur durp effrate erf erfc exp fact find findc findw floor floorz fmtinfo fuzz gaminv gamma garkhclprc garkhptprc gcd geodist geomean geomeanz harmean harmeanz hbound hms holiday hour index indexc indexw inputc inputn int intcindex intck intcycle intdt intfit intget intindex intnest intnx intrr intseas intshift inttest intts intz ipmt iqr irr juldate juldate7 kcount kstrcat kstrip kupdate kupdates kurtosis lag largest lbound lcm left length lengthc lengthm lengthn lgamma log logbeta log10 log1px log2 lowcase mad margrclprc margrptprc max md5 mdy mean median min minute missing mod modz month mort n ndims netpv nmiss nomrate notalnum notalpha notcntrl notdigit notfirst notgraph notlower notname notprint notpunct notspace notupper notxdigit npv null nwkdom ordinal pctl perm pmt poisson power ppmt probbeta probbnml probbnrm probchi probdf probf probgam probhypr probit probmc probmed probnegb probnorm probt prxchange prxmatch prxparse prxposn put pvp qtr quote ranbin rancau rand ranexp rangam range rank rannor ranpoi rantbl rantri ranuni repeat reverse right rms round rounde roundz savings scan sec second sha256hex sha256hmachex sign sin sinh skewness sleep smallest sqlexec sqrt std stderr streaminit strip substr substrn sum sumabs tan tanh time timepart timevalue tinv to_date to_double to_time to_timestamp today translate transtrn tranwrd trigamma trim trimn trunc uniform upcase uss uuidgen var verify vformat vinarray vinformat vlabel vlength vname vtype week weekday whichc whichn year yieldp yrdif yyq contained
syn region sasDS2FunctionContext start='(' end=')' contained contains=@sasBasicSyntax,sasDS2Function
syn match sasDS2Function '\v<\w+\ze\(' contained contains=sasDS2FunctionName nextgroup=sasDS2FunctionContext
syn keyword sasDS2Control continue data dcl declare do drop else end enddata endpackage endthread from go goto if leave method otherwise package point return select then thread to until when while contained
syn keyword sasDS2StatementKeyword array by forward keep merge output put rename retain set stop vararray varlist contained
syn keyword sasDS2StatementComplexKeyword package thread contained
syn match sasDS2Statement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasDS2StatementKeyword,sasGlobalStatementKeyword
syn match sasDS2Statement '\v%(^|;)\s*\zs%(dcl|declare|drop)>' display contained contains=sasDS2StatementKeyword nextgroup=sasDS2StatementComplexKeyword skipwhite skipnl skipempty
syn match sasDS2Statement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
syn region sasDS2 matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+ds2>' end='\v%(^|;)\s*%(quit|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDS2Function,sasDS2Control,sasDS2Statement
" I dont think specific PROCs need to be listed if use this line (Bob Heckel).
syn match sasProc "^\s*PROC \w\+"
syn keyword sasStep RUN QUIT DATA
" SAS/IML, 14.1
syn keyword sasIMLFunctionName abs all allcomb allperm any apply armasim bin blankstr block branks bspline btran byte char choose col colvec concat contents convexit corr corr2cov countmiss countn countunique cov cov2corr covlag cshape cusum cuprod cv cvexhull datasets design designf det diag dif dimension distance do duration echelon eigval eigvec element exp expmatrix expandgrid fft forward froot full gasetup geomean ginv hadamard half hankel harmean hdir hermite homogen i ifft insert int inv invupdt isempty isskipped j jroot kurtosis lag length loc log logabsdet mad magic mahalanobis max mean median min mod moduleic modulein name ncol ndx2sub nleng norm normal nrow num opscal orpol parentname palette polyroot prod product pv quartile rancomb randdirichlet randfun randmultinomial randmvt randnormal randwishart ranperk ranperm range rank ranktie rates ratio remove repeat root row rowcat rowcatc rowvec rsubstr sample setdif shape shapecol skewness solve sparse splinev spot sqrsym sqrt sqrvech ssq standard std storage sub2ndx substr sum sweep symsqr t toeplitz trace trisolv type uniform union unique uniqueby value var vecdiag vech xmult xsect yield contained
syn keyword sasIMLCallRoutineName appcort armacov armalik bar box change comport delete eigen execute exportdatasettor exportmatrixtor farmacov farmafit farmalik farmasim fdif gaend gagetmem gagetval gainit gareeval garegen gasetcro gasetmut gasetobj gasetsel gblkvp gblkvpd gclose gdelete gdraw gdrawl geneig ggrid ginclude gopen gpie gpiexy gpoint gpoly gport gportpop gportstk gscale gscript gset gshow gsorth gstart gstop gstrlen gtext gvtext gwindow gxaxis gyaxis heatmapcont heatmapdisc histogram importdatasetfromr importmatrixfromr ipf itsolver kalcvf kalcvs kaldff kaldfs lav lcp lms lp lpsolve lts lupdt marg maxqform mcd milpsolve modulei mve nlpcg nlpdd nlpfdd nlpfea nlphqn nlplm nlpnms nlpnra nlpnrr nlpqn nlpqua nlptr ode odsgraph ortvec pgraf push qntl qr quad queue randgen randseed rdodt rupdt rename rupdt rzlind scatter seq seqscale seqshift seqscale seqshift series solvelin sort sortndx sound spline splinec svd tabulate tpspline tpsplnev tsbaysea tsdecomp tsmlocar tsmlomar tsmulmar tspears tspred tsroot tstvcar tsunimar valset varmacov varmalik varmasim vnormal vtsroot wavft wavget wavift wavprint wavthrsh contained
syn region sasIMLFunctionContext start='(' end=')' contained contains=@sasBasicSyntax,sasIMLFunction
syn match sasIMLFunction '\v<\w+\ze\(' contained contains=sasIMLFunctionName,sasDataStepFunction nextgroup=sasIMLFunctionContext
syn keyword sasIMLControl abort by do else end finish goto if link pause quit resume return run start stop then to until while contained
syn keyword sasIMLStatementKeyword append call close closefile create delete display edit file find force free index infile input list load mattrib print purge read remove replace reset save setin setout show sort store summary use window contained
syn match sasIMLStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasIMLStatementKeyword,sasGlobalStatementKeyword
syn match sasIMLStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
syn region sasIML matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+iml>' end='\v%(^|;)\s*%(quit|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasIMLFunction,sasIMLControl,sasIMLStatement
" Macro definition
syn region sasMacro start='\v\%macro>' end='\v\%mend>' fold keepend contains=@sasBasicSyntax,@sasDataStepSyntax,sasDataStep,sasProc,sasODSGraphicsProc,sasGraphProc,sasAnalyticalProc,sasProcTemplate,sasProcSQL,sasDS2,sasIML
" Base SAS Procs - version 8.1
syn keyword sasConditional DO ELSE END IF THEN UNTIL WHILE
syn keyword sasStatement ABORT ARRAY ATTRIB BY CALL CARDS CARDS4 CATNAME
syn keyword sasStatement CONTINUE DATALINES DATALINES4 DELETE DISPLAY
syn keyword sasStatement DM DROP ENDSAS ERROR FILE FILENAME FOOTNOTE
syn keyword sasStatement FORMAT GOTO INFILE INFORMAT INPUT KEEP
syn keyword sasStatement LABEL LEAVE LENGTH LIBNAME LINK LIST LOSTCARD
syn keyword sasStatement MERGE MISSING MODIFY OPTIONS OUTPUT PAGE
syn keyword sasStatement PUT REDIRECT REMOVE RENAME REPLACE RETAIN
syn keyword sasStatement RETURN SELECT SET SKIP STARTSAS STOP TITLE
syn keyword sasStatement UPDATE WAITSAS WHERE WINDOW X SYSTASK
" Keywords that are used in Proc SQL
" I left them as statements because SAS's enhanced editor highlights
" them the same as normal statements used in data steps (Jim Kidd)
syn keyword sasStatement ADD AND ALTER AS CASCADE CHECK CREATE
syn keyword sasStatement DELETE DESCRIBE DISTINCT DROP FOREIGN
syn keyword sasStatement FROM GROUP HAVING INDEX INSERT INTO IN
syn keyword sasStatement KEY LIKE MESSAGE MODIFY MSGTYPE NOT
syn keyword sasStatement NULL ON OR ORDER PRIMARY REFERENCES
syn keyword sasStatement RESET RESTRICT SELECT SET TABLE
syn keyword sasStatement UNIQUE UPDATE VALIDATE VIEW WHERE
" Match declarations have to appear one per line (Paulo Tanimoto)
syn match sasStatement "FOOTNOTE\d"
syn match sasStatement "TITLE\d"
" Match declarations have to appear one per line (Paulo Tanimoto)
syn match sasMacro "%BQUOTE"
syn match sasMacro "%NRBQUOTE"
syn match sasMacro "%CMPRES"
syn match sasMacro "%QCMPRES"
syn match sasMacro "%COMPSTOR"
syn match sasMacro "%DATATYP"
syn match sasMacro "%DISPLAY"
syn match sasMacro "%DO"
syn match sasMacro "%ELSE"
syn match sasMacro "%END"
syn match sasMacro "%EVAL"
syn match sasMacro "%GLOBAL"
syn match sasMacro "%GOTO"
syn match sasMacro "%IF"
syn match sasMacro "%INDEX"
syn match sasMacro "%INPUT"
syn match sasMacro "%KEYDEF"
syn match sasMacro "%LABEL"
syn match sasMacro "%LEFT"
syn match sasMacro "%LENGTH"
syn match sasMacro "%LET"
syn match sasMacro "%LOCAL"
syn match sasMacro "%LOWCASE"
syn match sasMacro "%MACRO"
syn match sasMacro "%MEND"
syn match sasMacro "%NRBQUOTE"
syn match sasMacro "%NRQUOTE"
syn match sasMacro "%NRSTR"
syn match sasMacro "%PUT"
syn match sasMacro "%QCMPRES"
syn match sasMacro "%QLEFT"
syn match sasMacro "%QLOWCASE"
syn match sasMacro "%QSCAN"
syn match sasMacro "%QSUBSTR"
syn match sasMacro "%QSYSFUNC"
syn match sasMacro "%QTRIM"
syn match sasMacro "%QUOTE"
syn match sasMacro "%QUPCASE"
syn match sasMacro "%SCAN"
syn match sasMacro "%STR"
syn match sasMacro "%SUBSTR"
syn match sasMacro "%SUPERQ"
syn match sasMacro "%SYSCALL"
syn match sasMacro "%SYSEVALF"
syn match sasMacro "%SYSEXEC"
syn match sasMacro "%SYSFUNC"
syn match sasMacro "%SYSGET"
syn match sasMacro "%SYSLPUT"
syn match sasMacro "%SYSPROD"
syn match sasMacro "%SYSRC"
syn match sasMacro "%SYSRPUT"
syn match sasMacro "%THEN"
syn match sasMacro "%TO"
syn match sasMacro "%TRIM"
syn match sasMacro "%UNQUOTE"
syn match sasMacro "%UNTIL"
syn match sasMacro "%UPCASE"
syn match sasMacro "%VERIFY"
syn match sasMacro "%WHILE"
syn match sasMacro "%WINDOW"
" SAS Functions
syn keyword sasFunction ABS ADDR AIRY ARCOS ARSIN ATAN ATTRC ATTRN
syn keyword sasFunction BAND BETAINV BLSHIFT BNOT BOR BRSHIFT BXOR
syn keyword sasFunction BYTE CDF CEIL CEXIST CINV CLOSE CNONCT COLLATE
syn keyword sasFunction COMPBL COMPOUND COMPRESS COS COSH CSS CUROBS
syn keyword sasFunction CV DACCDB DACCDBSL DACCSL DACCSYD DACCTAB
syn keyword sasFunction DAIRY DATE DATEJUL DATEPART DATETIME DAY
syn keyword sasFunction DCLOSE DEPDB DEPDBSL DEPDBSL DEPSL DEPSL
syn keyword sasFunction DEPSYD DEPSYD DEPTAB DEPTAB DEQUOTE DHMS
syn keyword sasFunction DIF DIGAMMA DIM DINFO DNUM DOPEN DOPTNAME
syn keyword sasFunction DOPTNUM DREAD DROPNOTE DSNAME ERF ERFC EXIST
syn keyword sasFunction EXP FAPPEND FCLOSE FCOL FDELETE FETCH FETCHOBS
syn keyword sasFunction FEXIST FGET FILEEXIST FILENAME FILEREF FINFO
syn keyword sasFunction FINV FIPNAME FIPNAMEL FIPSTATE FLOOR FNONCT
syn keyword sasFunction FNOTE FOPEN FOPTNAME FOPTNUM FPOINT FPOS
syn keyword sasFunction FPUT FREAD FREWIND FRLEN FSEP FUZZ FWRITE
syn keyword sasFunction GAMINV GAMMA GETOPTION GETVARC GETVARN HBOUND
syn keyword sasFunction HMS HOSTHELP HOUR IBESSEL INDEX INDEXC
syn keyword sasFunction INDEXW INPUT INPUTC INPUTN INT INTCK INTNX
syn keyword sasFunction INTRR IRR JBESSEL JULDATE KURTOSIS LAG LBOUND
syn keyword sasFunction LEFT LENGTH LGAMMA LIBNAME LIBREF LOG LOG10
syn keyword sasFunction LOG2 LOGPDF LOGPMF LOGSDF LOWCASE MAX MDY
syn keyword sasFunction MEAN MIN MINUTE MOD MONTH MOPEN MORT N
syn keyword sasFunction NETPV NMISS NORMAL NOTE NPV OPEN ORDINAL
syn keyword sasFunction PATHNAME PDF PEEK PEEKC PMF POINT POISSON POKE
syn keyword sasFunction PROBBETA PROBBNML PROBCHI PROBF PROBGAM
syn keyword sasFunction PROBHYPR PROBIT PROBNEGB PROBNORM PROBT PUT
syn keyword sasFunction PUTC PUTN QTR QUOTE RANBIN RANCAU RANEXP
syn keyword sasFunction RANGAM RANGE RANK RANNOR RANPOI RANTBL RANTRI
syn keyword sasFunction RANUNI REPEAT RESOLVE REVERSE REWIND RIGHT
syn keyword sasFunction ROUND SAVING SCAN SDF SECOND SIGN SIN SINH
syn keyword sasFunction SKEWNESS SOUNDEX SPEDIS SQRT STD STDERR STFIPS
syn keyword sasFunction STNAME STNAMEL SUBSTR SUM SYMGET SYSGET SYSMSG
syn keyword sasFunction SYSPROD SYSRC SYSTEM TAN TANH TIME TIMEPART
syn keyword sasFunction TINV TNONCT TODAY TRANSLATE TRANWRD TRIGAMMA
syn keyword sasFunction TRIM TRIMN TRUNC UNIFORM UPCASE USS VAR
syn keyword sasFunction VARFMT VARINFMT VARLABEL VARLEN VARNAME
syn keyword sasFunction VARNUM VARRAY VARRAYX VARTYPE VERIFY VFORMAT
syn keyword sasFunction VFORMATD VFORMATDX VFORMATN VFORMATNX VFORMATW
syn keyword sasFunction VFORMATWX VFORMATX VINARRAY VINARRAYX VINFORMAT
syn keyword sasFunction VINFORMATD VINFORMATDX VINFORMATN VINFORMATNX
syn keyword sasFunction VINFORMATW VINFORMATWX VINFORMATX VLABEL
syn keyword sasFunction VLABELX VLENGTH VLENGTHX VNAME VNAMEX VTYPE
syn keyword sasFunction VTYPEX WEEKDAY YEAR YYQ ZIPFIPS ZIPNAME ZIPNAMEL
syn keyword sasFunction ZIPSTATE
" Handy settings for using vim with log files
syn keyword sasLogMsg NOTE
syn keyword sasWarnMsg WARNING
syn keyword sasErrMsg ERROR
" Always contained in a comment (Bob Heckel)
syn keyword sasTodo TODO TBD FIXME contained
" These don't fit anywhere else (Bob Heckel).
" Added others that were missing.
syn keyword sasUnderscore _ALL_ _AUTOMATIC_ _CHARACTER_ _INFILE_ _N_ _NAME_ _NULL_ _NUMERIC_ _USER_ _WEBOUT_
" End of SAS Functions
" Define the default highlighting.
" Only when an item doesn't have highlighting yet
" Default sas enhanced editor color syntax
hi sComment term=bold cterm=NONE ctermfg=Green ctermbg=Black gui=NONE guifg=DarkGreen guibg=White
hi sCard term=bold cterm=NONE ctermfg=Black ctermbg=Yellow gui=NONE guifg=Black guibg=LightYellow
hi sDate_Time term=NONE cterm=bold ctermfg=Green ctermbg=Black gui=bold guifg=SeaGreen guibg=White
hi sKeyword term=NONE cterm=NONE ctermfg=Blue ctermbg=Black gui=NONE guifg=Blue guibg=White
hi sFmtInfmt term=NONE cterm=NONE ctermfg=LightGreen ctermbg=Black gui=NONE guifg=SeaGreen guibg=White
hi sString term=NONE cterm=NONE ctermfg=Magenta ctermbg=Black gui=NONE guifg=Purple guibg=White
hi sText term=NONE cterm=NONE ctermfg=White ctermbg=Black gui=bold guifg=Black guibg=White
hi sNumber term=NONE cterm=bold ctermfg=Green ctermbg=Black gui=bold guifg=SeaGreen guibg=White
hi sProc term=NONE cterm=bold ctermfg=Blue ctermbg=Black gui=bold guifg=Navy guibg=White
hi sSection term=NONE cterm=bold ctermfg=Blue ctermbg=Black gui=bold guifg=Navy guibg=White
hi mDefine term=NONE cterm=bold ctermfg=White ctermbg=Black gui=bold guifg=Black guibg=White
hi mKeyword term=NONE cterm=NONE ctermfg=Blue ctermbg=Black gui=NONE guifg=Blue guibg=White
hi mReference term=NONE cterm=bold ctermfg=White ctermbg=Black gui=bold guifg=Blue guibg=White
hi mSection term=NONE cterm=NONE ctermfg=Blue ctermbg=Black gui=bold guifg=Navy guibg=White
hi mText term=NONE cterm=NONE ctermfg=White ctermbg=Black gui=bold guifg=Black guibg=White
" Colors that closely match SAS log colors for default color scheme
hi lError term=NONE cterm=NONE ctermfg=Red ctermbg=Black gui=none guifg=Red guibg=White
hi lWarning term=NONE cterm=NONE ctermfg=Green ctermbg=Black gui=none guifg=Green guibg=White
hi lNote term=NONE cterm=NONE ctermfg=Cyan ctermbg=Black gui=none guifg=Blue guibg=White
" Special hilighting for the SAS proc section
hi def link sasComment sComment
hi def link sasConditional sKeyword
hi def link sasStep sSection
hi def link sasFunction sKeyword
hi def link sasMacro mKeyword
hi def link sasMacroVar NonText
hi def link sasNumber sNumber
hi def link sasStatement sKeyword
hi def link sasString sString
hi def link sasProc sProc
" (Bob Heckel)
hi def link sasTodo Todo
hi def link sasErrMsg lError
hi def link sasWarnMsg lWarning
hi def link sasLogMsg lNote
hi def link sasCards sCard
" (Bob Heckel)
hi def link sasUnderscore PreProc
" Define default highlighting
hi def link sasComment Comment
hi def link sasTodo Delimiter
hi def link sasSectLbl Title
hi def link sasSectLblEnds Comment
hi def link sasNumber Number
hi def link sasDateTime Constant
hi def link sasString String
hi def link sasDataStepControl Keyword
hi def link sasProcTemplateClause Keyword
hi def link sasProcSQLClause Keyword
hi def link sasDS2Control Keyword
hi def link sasIMLControl Keyword
hi def link sasOperator Operator
hi def link sasGlobalStatementKeyword Statement
hi def link sasGlobalStatementODSKeyword Statement
hi def link sasSectionKeyword Statement
hi def link sasDataStepFunctionName Function
hi def link sasDataStepCallRoutineName Function
hi def link sasDataStepStatementKeyword Statement
hi def link sasDataStepStatementHashKeyword Statement
hi def link sasDataStepHashOperator Operator
hi def link sasDataStepHashMethodName Function
hi def link sasDataStepHashAttributeName Identifier
hi def link sasProcStatementKeyword Statement
hi def link sasODSGraphicsProcStatementKeyword Statement
hi def link sasGraphProcStatementKeyword Statement
hi def link sasAnalyticalProcStatementKeyword Statement
hi def link sasProcTemplateStatementKeyword Statement
hi def link sasProcTemplateStatementComplexKeyword Statement
hi def link sasProcTemplateGTLStatementKeyword Statement
hi def link sasProcTemplateGTLComplexKeyword Statement
hi def link sasProcSQLFunctionName Function
hi def link sasProcSQLStatementKeyword Statement
hi def link sasProcSQLStatementComplexKeyword Statement
hi def link sasProcSQLStatementNextKeyword Statement
hi def link sasDS2FunctionName Function
hi def link sasDS2StatementKeyword Statement
hi def link sasIMLFunctionName Function
hi def link sasIMLCallRoutineName Function
hi def link sasIMLStatementKeyword Statement
hi def link sasMacroReserved PreProc
hi def link sasMacroVariable Define
hi def link sasMacroFunctionName Define
hi def link sasDataLine SpecialChar
hi def link sasFormat SpecialChar
hi def link sasReserved Special
" Syncronize from beginning to keep large blocks from losing
" syntax coloring while moving through code.
@@ -264,4 +261,5 @@ syn sync fromstart
let b:current_syntax = "sas"
" vim: ts=8
let &cpo = s:cpo_save
unlet s:cpo_save
+25 -201
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1255,7 +1255,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>129</string>
<string>132</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
+1
View File
@@ -234,6 +234,7 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
[NSNumber numberWithBool:YES], MMNativeFullScreenKey,
[NSNumber numberWithDouble:0.25], MMFullScreenFadeTimeKey,
[NSNumber numberWithBool:NO], MMUseCGLayerAlwaysKey,
[NSNumber numberWithBool:YES], MMShareFindPboardKey,
nil];
[[NSUserDefaults standardUserDefaults] registerDefaults:dict];
+1
View File
@@ -123,6 +123,7 @@ extern NSTimeInterval MMBalloonEvalInternalDelay;
- (void)startBlink;
- (void)stopBlink;
- (void)adjustLinespace:(int)linespace;
- (void)adjustColumnspace:(int)columnspace;
- (void)activate;
- (void)setPreEditRow:(int)row column:(int)col;
+7
View File
@@ -1095,6 +1095,13 @@ extern GuiFont gui_mch_retain_font(GuiFont font);
[self queueMessage:AdjustLinespaceMsgID data:data];
}
- (void)adjustColumnspace:(int)columnspace
{
NSMutableData *data = [NSMutableData data];
[data appendBytes:&columnspace length:sizeof(int)];
[self queueMessage:AdjustColumnspaceMsgID data:data];
}
- (void)activate
{
[self queueMessage:ActivateMsgID data:nil];
+3
View File
@@ -22,6 +22,7 @@
NSFont *font;
NSFont *fontWide;
float linespace;
float columnspace;
// From NSTextView
NSSize insetSize;
@@ -30,6 +31,7 @@
BOOL antialias;
BOOL ligatures;
BOOL thinStrokes;
BOOL drawPending;
NSMutableArray *drawData;
MMTextViewHelper *helper;
@@ -95,6 +97,7 @@
//
// NSTextView methods
//
- (void)setFrameSize:(NSSize)newSize;
- (void)keyDown:(NSEvent *)event;
- (void)insertText:(id)string;
- (void)doCommandBySelector:(SEL)selector;
+24 -6
View File
@@ -311,7 +311,7 @@ defaultAdvanceForFont(NSFont *font)
// only render at integer sizes. Hence, we restrict the cell width to
// an integer here, otherwise the window width and the actual text
// width will not match.
cellSize.width = ceil(em * cellWidthMultiplier);
cellSize.width = columnspace + ceil(em * cellWidthMultiplier);
cellSize.height = linespace + defaultLineHeightForFont(font);
fontDescent = ceil(CTFontGetDescent(fontRef));
@@ -372,6 +372,17 @@ defaultAdvanceForFont(NSFont *font)
cellSize.height = linespace + defaultLineHeightForFont(font);
}
- (void)setColumnspace:(float)newColumnspace
{
columnspace = newColumnspace;
double em = round(defaultAdvanceForFont(font));
float cellWidthMultiplier = [[NSUserDefaults standardUserDefaults]
floatForKey:MMCellWidthMultiplierKey];
cellSize.width = columnspace + ceil(em * cellWidthMultiplier);
}
@@ -435,6 +446,14 @@ defaultAdvanceForFont(NSFont *font)
return YES;
}
- (void)setFrameSize:(NSSize)newSize {
if (!drawPending && !NSEqualSizes(newSize, self.frame.size) && drawData.count == 0) {
[NSAnimationContext beginGrouping];
drawPending = YES;
}
[super setFrameSize:newSize];
}
- (void)keyDown:(NSEvent *)event
{
[helper keyDown:event];
@@ -639,11 +658,10 @@ defaultAdvanceForFont(NSFont *font)
} else {
[drawData addObject:data];
[self setNeedsDisplay:YES];
// NOTE: During resizing, Cocoa only sends draw messages before Vim's rows
// and columns are changed (due to ipc delays). Force a redraw here.
if ([self inLiveResize])
[self display];
}
if (drawPending) {
[NSAnimationContext endGrouping];
drawPending = NO;
}
}
+7 -5
View File
@@ -110,8 +110,8 @@ enum {
// Each fade goes in and then out, so the fade hardware must be reserved accordingly and the
// actual fade time can't exceed half the allowable reservation time... plus some slack to
// prevent visual artifacts caused by defaulting on the fade hardware lease.
fadeTime = MIN(fadeTime, 0.45 * kCGMaxDisplayReservationInterval);
fadeReservationTime = 2.0 * fadeTime + 0.1;
fadeTime = MIN(fadeTime, 0.5 * (kCGMaxDisplayReservationInterval - 1));
fadeReservationTime = 2.0 * fadeTime + 1;
return self;
}
@@ -218,9 +218,11 @@ enum {
// fade back in
if (didBlend) {
CGDisplayFade(token, fadeTime, kCGDisplayBlendSolidColor,
kCGDisplayBlendNormal, .0, .0, .0, false);
CGReleaseDisplayFadeReservation(token);
[NSAnimationContext currentContext].completionHandler = ^{
CGDisplayFade(token, fadeTime, kCGDisplayBlendSolidColor,
kCGDisplayBlendNormal, .0, .0, .0, false);
CGReleaseDisplayFadeReservation(token);
};
}
state = InFullScreen;
+3
View File
@@ -41,6 +41,7 @@ typedef struct {
NSColor *defaultForegroundColor;
NSSize cellSize;
float linespace;
float columnspace;
#if MM_USE_ROW_CACHE
MMRowCacheEntry *rowCache;
#endif
@@ -59,7 +60,9 @@ typedef struct {
- (int)actualRows;
- (int)actualColumns;
- (float)linespace;
- (float)columnspace;
- (void)setLinespace:(float)newLinespace;
- (void)setColumnspace:(float)newColumnspace;
- (void)getMaxRows:(int*)rows columns:(int*)cols;
- (void)setMaxRows:(int)rows columns:(int)cols;
- (void)drawString:(NSString *)string atRow:(int)row column:(int)col
+25
View File
@@ -202,6 +202,11 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar";
return linespace;
}
- (float)columnspace
{
return columnspace;
}
- (void)setLinespace:(float)newLinespace
{
NSLayoutManager *lm = [[self layoutManagers] objectAtIndex:0];
@@ -221,6 +226,25 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar";
cellSize.height = linespace + [lm defaultLineHeightForFont:font];
}
- (void)setColumnspace:(float)newColumnspace
{
NSLayoutManager *lm = [[self layoutManagers] objectAtIndex:0];
if (!lm) {
ASLogWarn(@"No layout manager available");
return;
}
columnspace = newColumnspace;
float em = [@"m" sizeWithAttributes:
[NSDictionary dictionaryWithObject:font
forKey:NSFontAttributeName]].width;
float cellWidthMultiplier = [[NSUserDefaults standardUserDefaults]
floatForKey:MMCellWidthMultiplierKey];
cellSize.width = columnspace + ceilf(em * cellWidthMultiplier);
}
- (void)getMaxRows:(int*)rows columns:(int*)cols
{
if (rows) *rows = maxRows;
@@ -662,6 +686,7 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar";
NSLayoutManager *lm = [[self layoutManagers] objectAtIndex:0];
if (lm) {
cellSize.height = linespace + [lm defaultLineHeightForFont:font];
cellSize.width = columnspace + ceilf(em * cellWidthMultiplier);
} else {
// Should never happen, set some bogus value for cell height.
ASLogWarn(@"No layout manager available");
+1
View File
@@ -49,6 +49,7 @@
- (void)setWideFont:(NSFont *)newFont;
- (NSSize)cellSize;
- (void)setLinespace:(float)newLinespace;
- (void)setColumnspace:(float)newColumnspace;
- (int)maxRows;
- (int)maxColumns;
- (void)getMaxRows:(int*)rows columns:(int*)cols;
+5
View File
@@ -362,6 +362,11 @@
return [(MMTextStorage*)[self textStorage] setLinespace:newLinespace];
}
- (void)setColumnspace:(float)newColumnspace
{
return [(MMTextStorage*)[self textStorage] setColumnspace:newColumnspace];
}
- (int)maxRows
{
MMTextStorage *ts = (MMTextStorage *)[self textStorage];
+8 -9
View File
@@ -554,15 +554,9 @@ static BOOL isUnsafeMessage(int msgid);
{
if (OpenWindowMsgID == msgid) {
[windowController openWindow];
// HACK: Delay actually presenting the window onscreen until after
// processing the queue since it contains drawing commands that need to
// be issued before presentation; otherwise the window may flash white
// just as it opens.
if (!isPreloading)
[windowController performSelector:@selector(presentWindow:)
withObject:nil
afterDelay:0];
if (!isPreloading) {
[windowController presentWindow:nil];
}
} else if (BatchDrawMsgID == msgid) {
[[[windowController vimView] textView] performBatchDrawWithData:data];
} else if (SelectTabMsgID == msgid) {
@@ -762,6 +756,11 @@ static BOOL isUnsafeMessage(int msgid);
int linespace = *((int*)bytes);
[windowController adjustLinespace:linespace];
} else if (AdjustColumnspaceMsgID == msgid) {
const void *bytes = [data bytes];
int columnspace = *((int*)bytes);
[windowController adjustColumnspace:columnspace];
} else if (ActivateMsgID == msgid) {
[NSApp activateIgnoringOtherApps:YES];
[[windowController window] makeKeyAndOrderFront:self];
+1 -1
View File
@@ -909,7 +909,7 @@ enum {
"%dx%d (%s)", cols, rows, constrained[1], constrained[0],
MessageStrings[msgid]);
[vimController sendMessage:msgid data:data];
[vimController sendMessageNow:msgid data:data timeout:1];
// We only want to set the window title if this resize came from
// a live-resize, not (for example) setting 'columns' or 'lines'.
+2
View File
@@ -40,6 +40,7 @@
int userCols;
NSPoint userTopLeft;
NSPoint defaultTopLeft;
NSSize desiredWindowSize;
NSToolbar *toolbar;
BOOL resizingDueToMove;
int blurRadius;
@@ -77,6 +78,7 @@
- (void)showToolbar:(BOOL)on size:(int)size mode:(int)mode;
- (void)setMouseShape:(int)shape;
- (void)adjustLinespace:(int)linespace;
- (void)adjustColumnspace:(int)columnspace;
- (void)liveResizeWillStart;
- (void)liveResizeDidEnd;
+25 -38
View File
@@ -594,11 +594,12 @@
// TODO: What if the resize message fails to make it back?
if (!didMaximize) {
NSSize originalSize = [vimView frame].size;
NSSize contentSize = [vimView desiredSize];
contentSize = [self constrainContentSizeToScreenSize:contentSize];
int rows = 0, cols = 0;
contentSize = [vimView constrainRows:&rows columns:&cols
toSize:contentSize];
NSSize contentSize = [vimView constrainRows:&rows columns:&cols
toSize:
fullScreenWindow ? [fullScreenWindow frame].size :
fullScreenEnabled ? desiredWindowSize :
[self constrainContentSizeToScreenSize:[vimView desiredSize]]];
[vimView setFrameSize:contentSize];
if (fullScreenWindow) {
@@ -660,6 +661,14 @@
}
}
- (void)adjustColumnspace:(int)columnspace
{
if (vimView && [vimView textView]) {
[[vimView textView] setColumnspace:(float)columnspace];
shouldMaximizeWindow = shouldResizeVimView = YES;
}
}
- (void)liveResizeWillStart
{
if (!setupDone) return;
@@ -689,37 +698,6 @@
NSConnection *connection = [(NSDistantObject*)proxy connectionForProxy];
[connection removeRequestMode:NSEventTrackingRunLoopMode];
// NOTE: During live resize messages from MacVim to Vim are often dropped
// (because too many messages are sent at once). This may lead to
// inconsistent states between Vim and MacVim; to avoid this we send a
// synchronous resize message to Vim now (this is not fool-proof, but it
// does seem to work quite well).
// Do NOT send a SetTextDimensionsMsgID message (as opposed to
// LiveResizeMsgID) since then the view is constrained to not be larger
// than the screen the window mostly occupies; this makes it impossible to
// resize the window across multiple screens.
int constrained[2];
NSSize textViewSize = [[vimView textView] frame].size;
[[vimView textView] constrainRows:&constrained[0] columns:&constrained[1]
toSize:textViewSize];
ASLogDebug(@"End of live resize, notify Vim that text dimensions are %dx%d",
constrained[1], constrained[0]);
NSData *data = [NSData dataWithBytes:constrained length:2*sizeof(int)];
BOOL sendOk = [vimController sendMessageNow:LiveResizeMsgID
data:data
timeout:.5];
if (!sendOk) {
// Sending of synchronous message failed. Force the window size to
// match the last dimensions received from Vim, otherwise we end up
// with inconsistent states.
[self resizeWindowToFitContentSize:[vimView desiredSize]
keepOnScreen:NO];
}
// If we saved the original title while resizing, restore it.
if (lastSetTitle != nil) {
[decoratedWindow setTitle:lastSetTitle];
@@ -1026,6 +1004,11 @@
[vimController sendMessage:SetWindowPositionMsgID data:data];
}
- (NSSize)windowWillResize:(NSWindow *)sender toSize:(NSSize)frameSize {
desiredWindowSize = frameSize;
return frameSize;
}
- (void)windowDidResize:(id)sender
{
if (resizingDueToMove) {
@@ -1561,10 +1544,14 @@
// See gui_macvim_add_to_find_pboard() for an explanation of these
// types.
if ([bestType isEqual:VimFindPboardType])
if ([bestType isEqual:VimFindPboardType]) {
query = [pb stringForType:VimFindPboardType];
else
query = [pb stringForType:NSStringPboardType];
} else {
BOOL shareFindPboard = [[NSUserDefaults standardUserDefaults]
boolForKey:MMShareFindPboardKey];
if (shareFindPboard)
query = [pb stringForType:NSStringPboardType];
}
}
NSString *input = nil;
+4
View File
@@ -210,6 +210,7 @@ enum {
MouseMovedMsgID,
SetMouseShapeMsgID,
AdjustLinespaceMsgID,
AdjustColumnspaceMsgID,
ActivateMsgID,
SetServerNameMsgID,
EnterFullScreenMsgID,
@@ -313,6 +314,9 @@ extern NSString *MMLogToStdErrKey;
// (techincally this is a user default but should not be used as such).
extern NSString *MMNoWindowKey;
// Argument used to control MacVim sharing search text via the Find Pasteboard.
extern NSString *MMShareFindPboardKey;
extern NSString *MMAutosaveRowsKey;
extern NSString *MMAutosaveColumnsKey;
extern NSString *MMRendererKey;
+3
View File
@@ -64,6 +64,7 @@ char *MessageStrings[] =
"MouseMovedMsgID",
"SetMouseShapeMsgID",
"AdjustLinespaceMsgID",
"AdjustColumnspaceMsgID",
"ActivateMsgID",
"SetServerNameMsgID",
"EnterFullScreenMsgID",
@@ -117,6 +118,8 @@ NSString *MMLogToStdErrKey = @"MMLogToStdErr";
// (techincally this is a user default but should not be used as such).
NSString *MMNoWindowKey = @"MMNoWindow";
NSString *MMShareFindPboardKey = @"MMShareFindPboard";
NSString *MMAutosaveRowsKey = @"MMAutosaveRows";
NSString *MMAutosaveColumnsKey = @"MMAutosaveColumns";
NSString *MMRendererKey = @"MMRenderer";
+18 -10
View File
@@ -64,11 +64,11 @@
1DE9B9500D341AB8008FEDD4 /* MMWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 1DE9B94E0D341AB8008FEDD4 /* MMWindow.m */; };
1DED78600C6DE43D0079945F /* vimrc in Copy Vim Runtime Files */ = {isa = PBXBuildFile; fileRef = 1DED785F0C6DE43D0079945F /* vimrc */; };
1DFE25A50C527BC4003000F7 /* PSMTabBarControl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D493DB90C52533B00AB718C /* PSMTabBarControl.framework */; };
52818B031C1C08CE00F59085 /* QLStephen.qlgenerator in Copy QuickLookPlugin */ = {isa = PBXBuildFile; fileRef = 52818AFF1C1C075300F59085 /* QLStephen.qlgenerator */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
528DA66A1426D4F9003380F1 /* macvim-askpass in Copy Scripts */ = {isa = PBXBuildFile; fileRef = 528DA6691426D4EB003380F1 /* macvim-askpass */; };
52A364731C4A5789005757EC /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52A364721C4A5789005757EC /* Sparkle.framework */; };
52A364761C4A57C1005757EC /* Sparkle.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 52A364721C4A5789005757EC /* Sparkle.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
52B7ED9B1C4A4D6900AFFF15 /* dsa_pub.pem in Resources */ = {isa = PBXBuildFile; fileRef = 52B7ED9A1C4A4D6900AFFF15 /* dsa_pub.pem */; };
52818B031C1C08CE00F59085 /* QLStephen.qlgenerator in Copy QuickLookPlugin */ = {isa = PBXBuildFile; fileRef = 52818AFF1C1C075300F59085 /* QLStephen.qlgenerator */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
528DA66A1426D4F9003380F1 /* macvim-askpass in Copy Scripts */ = {isa = PBXBuildFile; fileRef = 528DA6691426D4EB003380F1 /* macvim-askpass */; };
8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 29B97318FDCFA39411CA2CEA /* MainMenu.nib */; };
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
@@ -467,14 +467,6 @@
name = Products;
sourceTree = "<group>";
};
528DA6681426D477003380F1 /* Scripts */ = {
isa = PBXGroup;
children = (
528DA6691426D4EB003380F1 /* macvim-askpass */,
);
name = Scripts;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -491,6 +483,7 @@
1DE608B80C58807F0055263D /* Copy Vim Runtime Files */,
1D1C31F00EFFBFD6003FE9A5 /* Make Document Icons */,
528DA6671426D456003380F1 /* Copy Scripts */,
52283AB71EBA200C00A6F6B9 /* Copy mvim scripts */,
);
buildRules = (
);
@@ -620,6 +613,21 @@
shellScript = "# Clear deployment target, else the python script always thinks we're building on Tiger\nunset MACOSX_DEPLOYMENT_TARGET\n\n# Generate the icons (redirect stderr to ignore warnings)\ncd \"$PROJECT_DIR\"/icons/\nmake OUTDIR=\"$TARGET_BUILD_DIR\"/$UNLOCALIZED_RESOURCES_FOLDER_PATH 2> /dev/null\n";
showEnvVarsInLog = 0;
};
52283AB71EBA200C00A6F6B9 /* Copy mvim scripts */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Copy mvim scripts";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "BINPATH=$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/bin\nmkdir -p $BINPATH\ncp -a $SRCROOT/mvim $BINPATH/mvim\nchmod 755 $BINPATH/mvim\n(cd $BINPATH; for f in vim vimdiff view gvim gvimdiff gview mvimdiff mview; do ln -fs mvim $f; done)";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
+24 -1
View File
@@ -36,6 +36,7 @@ static int MMDefaultFontSize = 11;
static int MMMinFontSize = 6;
static int MMMaxFontSize = 100;
static BOOL MMShareFindPboard = YES;
static GuiFont gui_macvim_font_with_name(char_u *name);
static int specialKeyToNSKey(int key);
@@ -198,6 +199,15 @@ gui_macvim_after_fork_init()
// signs.
use_graphical_sign = (val == MMRendererCoreText);
}
// Check to use the Find Pasteboard.
MMShareFindPboard = CFPreferencesGetAppBooleanValue((CFStringRef)MMShareFindPboardKey,
kCFPreferencesCurrentApplication,
&keyValid);
if (!keyValid) {
// Share text via the Find Pasteboard by default.
MMShareFindPboard = YES;
}
}
@@ -252,6 +262,7 @@ gui_mch_init(void)
// Ensure 'linespace' option is passed along to MacVim in case it was set
// in [g]vimrc.
gui_mch_adjust_charheight();
gui_mch_adjust_charwidth();
if (!MMNoMRU && GARGCOUNT > 0) {
// Add files passed on command line to MRU.
@@ -1405,6 +1416,17 @@ gui_mch_adjust_charheight(void)
}
/*
* Adjust gui.char_width (after 'columnspace' was changed).
*/
int
gui_mch_adjust_charwidth(void)
{
[[MMBackend sharedInstance] adjustColumnspace:p_columnspace];
return OK;
}
void
gui_mch_beep(void)
{
@@ -1804,7 +1826,8 @@ gui_macvim_add_to_find_pboard(char_u *pat)
// The second entry will be used by other applications when taking entries
// off the Find pasteboard, whereas MacVim will use the first if present.
[pb setString:s forType:VimFindPboardType];
[pb setString:[s stringByRemovingFindPatterns] forType:NSStringPboardType];
if (MMShareFindPboard)
[pb setString:[s stringByRemovingFindPatterns] forType:NSStringPboardType];
}
void
+17 -29
View File
@@ -8,40 +8,28 @@
# Based on a script by Wout Mertens and suggestions from Laurent Bihanic. This
# version is the fault of Benji Fisher, 16 May 2005 (with modifications by Nico
# Weber and Bjorn Winckler, Aug 13 2007).
# First, check "All the Usual Suspects" for the location of the Vim.app bundle.
# You can short-circuit this by setting the VIM_APP_DIR environment variable
# or by un-commenting and editing the following line:
# VIM_APP_DIR=/Applications
#
if [ -z "$VIM_APP_DIR" ]
then
myDir="`dirname "$0"`"
myAppDir="$myDir/../Applications"
suspects=(
/Applications
~/Applications
/Applications/vim
~/Applications/vim
$myDir
$myDir/vim
$myAppDir
$myAppDir/vim
/Applications/Utilities
/Applications/Utilities/vim
)
for i in ${suspects[@]}; do
if [ -x "$i/MacVim.app" ]; then
VIM_APP_DIR="$i"
break
fi
# Find Vim executable
if [ -L $0 ]; then
# readlink -f
curdir=`pwd -P`
self_path=$0
cd `dirname $self_path`
while [ -L $self_path ]; do
self_path=`readlink $self_path`
cd `dirname $self_path`
self_path=`basename $self_path`
done
binary="`pwd -P`/../MacOS/Vim"
cd $curdir
else
binary="`dirname "$0"`/../MacOS/Vim"
fi
if [ -z "$VIM_APP_DIR" ]
then
echo "Sorry, cannot find MacVim.app. Try setting the VIM_APP_DIR environment variable to the directory containing MacVim.app."
if ! [ -x $binary ]; then
echo "Sorry, cannot find Vim executable."
exit 1
fi
binary="$VIM_APP_DIR/MacVim.app/Contents/MacOS/Vim"
# Next, peek at the name used to invoke this script, and set options
# accordingly.
+41 -31
View File
@@ -207,7 +207,7 @@
#SunOS 4.1.x +X11 -GUI 5.1b (J) Bram Moolenaar
#SunOS 4.1.3_U1 (sun4c) gcc +X11 +GUI Athena 5.0w (J) Darren Hiebert
#SUPER-UX 6.2 (NEC SX-4) cc +X11R6 Motif,Athena4.6b (P) Lennart Schultz
#Tandem/NSK (c) Matthew Woehlke
#Tandem/NSK (c) Matthew Woehlke
#Unisys 6035 cc +X11 Motif 5.3 (8) Glauber Ribeiro
#ESIX V4.2 cc +X11 6.0 (a) Reinhard Wobst
#Mac OS X 10.[23] gcc Carbon 6.2 (x) Bram Moolenaar
@@ -403,6 +403,7 @@ CClink = $(CC)
# First one is for static linking, second one for dynamic loading.
# Use --with-luajit if you want to use LuaJIT instead of Lua.
# Set PATH environment variable to find lua or luajit executable.
# This requires at least "normal" features, "tiny" and "small" don't work.
#CONF_OPT_LUA = --enable-luainterp
#CONF_OPT_LUA = --enable-luainterp=dynamic
#CONF_OPT_LUA = --enable-luainterp --with-luajit
@@ -429,16 +430,15 @@ CClink = $(CC)
# the next line.
# When you get an error for a missing "perl.exp" file, try creating an empty
# one: "touch perl.exp".
# This requires at least "small" features, "tiny" doesn't work.
# This requires at least "normal" features, "tiny" and "small" don't work.
#CONF_OPT_PERL = --enable-perlinterp
#CONF_OPT_PERL = --enable-perlinterp=dynamic
# PYTHON
# Uncomment this when you want to include the Python interface.
# Requires small features or better, fails with tiny features.
# Uncomment lines here when you want to include the Python interface.
# This requires at least "normal" features, "tiny" and "small" don't work.
# NOTE: This may cause threading to be enabled, which has side effects (such
# as using different libraries and debugging becomes more difficult).
# NOTE: Using this together with Perl may cause a crash in initialization.
# For Python3 support make a symbolic link in /usr/local/bin:
# ln -s python3 python3.1
# If both python2.x and python3.x are enabled then the linking will be via
@@ -454,6 +454,7 @@ CClink = $(CC)
# Uncomment this when you want to include the Ruby interface.
# First one for static linking, second one for loading when used.
# Note: you need the development package (e.g., ruby1.9.1-dev on Ubuntu).
# This requires at least "normal" features, "tiny" and "small" don't work.
#CONF_OPT_RUBY = --enable-rubyinterp
#CONF_OPT_RUBY = --enable-rubyinterp=dynamic
#CONF_OPT_RUBY = --enable-rubyinterp --with-ruby-command=ruby1.9.1
@@ -617,7 +618,7 @@ AUTOCONF = autoconf
#PURIFY = purify
# VALGRIND - remove the # to use valgrind for memory leaks and access errors.
# Used for the unittest targets.
# Used for the unittest targets.
# VALGRIND = valgrind --tool=memcheck --leak-check=yes --num-callers=25 --log-file=valgrind.$@
# NBDEBUG - debugging the netbeans interface.
@@ -649,15 +650,15 @@ LINT_OPTIONS = -beprxzF
# coverage information. (provided by Yegappan Lakshmanan)
# 1. make clean, run configure and build Vim as usual.
# 2. Generate the baseline code coverage information:
# $ lcov -c -i -b . -d objects -o objects/coverage_base.info
# $ lcov -c -i -b . -d objects -o objects/coverage_base.info
# 3. Run "make test" to run the unit tests. The code coverage information will
# be generated in the src/objects directory.
# 4. Generate the code coverage information from the tests:
# $ lcov -c -b . -d objects/ -o objects/coverage_test.info
# $ lcov -c -b . -d objects/ -o objects/coverage_test.info
# 5. Combine the baseline and test code coverage data:
# $ lcov -a objects/coverage_base.info -a objects/coverage_test.info -o objects/coverage_total.info
# $ lcov -a objects/coverage_base.info -a objects/coverage_test.info -o objects/coverage_total.info
# 6. Process the test coverage data and generate a report in html:
# $ genhtml objects/coverage_total.info -o objects
# $ genhtml objects/coverage_total.info -o objects
# 7. Open the objects/index.html file in a web browser to view the coverage
# information.
#
@@ -1424,6 +1425,11 @@ PROTO_FLAGS = -d -E"$(CPP)" $(NO_ATTR)
SHELL = /bin/sh
# We would normally use "mkdir -p" but it doesn't work properly everywhere.
# Using AC_PROG_MKDIR_P in configure.ac has a problem with the "auto"
# directory. Always use the install-sh script, it's slower but reliable.
MKDIR_P = $(SHELL) install-sh -c -d
.SUFFIXES:
.SUFFIXES: .c .o .pro
@@ -1901,10 +1907,12 @@ autoconf:
-rm -rf autom4te.cache
-rm -f auto/config.status auto/config.cache
# Re-execute this Makefile to include the new auto/config.mk produced by
# configure Only used when typing "make" with a fresh auto/config.mk.
myself:
$(MAKE) -f Makefile all
# Run vim script to generate the Ex command lookup table.
# This only needs to be run when a command name has been added or changed.
# If this fails because you don't have Vim yet, first build and install Vim
# without changes.
cmdidxs: ex_cmds.h
vim -u NONE -i NONE -X -S create_cmdidxs.vim
# The normal command to compile a .c file to its .o file.
@@ -2129,10 +2137,10 @@ test_arglist \
test_delete \
test_diffmode \
test_digraph \
test_functions \
test_display \
test_edit \
test_ex_undo \
test_ex_z \
test_execute_func \
test_expand \
test_expand_dllpath \
@@ -2149,9 +2157,11 @@ test_arglist \
test_fnameescape \
test_fnamemodify \
test_fold \
test_functions \
test_ga \
test_gf \
test_glob2regpat \
test_global \
test_gn \
test_goto \
test_gui \
@@ -2571,7 +2581,7 @@ DESKTOPPATH = $(DESTDIR)$(DATADIR)/applications
KDEPATH = $(HOME)/.kde/share/icons
install-icons:
if test -n "$(DESTDIR)"; then \
$(SHELL) ./mkinstalldirs $(ICON48PATH) $(ICON32PATH) \
$(MKDIR_P) $(ICON48PATH) $(ICON32PATH) \
$(ICON16PATH) $(DESKTOPPATH); \
fi
@@ -2612,7 +2622,7 @@ $(DESTDIR)$(exec_prefix) $(DEST_BIN) \
$(DEST_LANG) $(DEST_KMAP) $(DEST_COMP) $(DEST_MACRO) \
$(DEST_PACK) $(DEST_TOOLS) $(DEST_TUTOR) $(DEST_SPELL) \
$(DEST_AUTO) $(DEST_AUTO)/xml $(DEST_PLUG):
-$(SHELL) ./mkinstalldirs $@
$(MKDIR_P) $@
-chmod $(DIRMOD) $@
# create links from various names to vim. This is only done when the links
@@ -2775,7 +2785,8 @@ uninstall_runtime:
# Clean up all the files that have been produced, except configure's.
# We support common typing mistakes for Juergen! :-)
clean celan: testclean macvimclean
-rm -f *.o objects/* core $(VIMTARGET).core $(VIMTARGET) vim xxd/*.o
-rm -f *.o core $(VIMTARGET).core $(VIMTARGET) vim xxd/*.o
-rm -rf objects
-rm -f $(TOOLS) auto/osdef.h auto/pathdef.c auto/if_perl.c auto/gui_gtk_gresources.c auto/gui_gtk_gresources.h
-rm -f conftest* *~ auto/link.sed
-rm -f testdir/opt_test.vim
@@ -2792,25 +2803,25 @@ clean celan: testclean macvimclean
SHADOWDIR = shadow
shadow: runtime pixmaps
mkdir $(SHADOWDIR)
cd $(SHADOWDIR); ln -s ../*.[chm] ../*.in ../*.sh ../*.xs ../*.xbm ../gui_gtk_res.xml ../toolcheck ../proto ../vimtutor ../gvimtutor ../mkinstalldirs .
$(MKDIR_P) $(SHADOWDIR)
cd $(SHADOWDIR); ln -s ../*.[chm] ../*.in ../*.sh ../*.xs ../*.xbm ../gui_gtk_res.xml ../toolcheck ../proto ../vimtutor ../gvimtutor ../install-sh .
mkdir $(SHADOWDIR)/auto
cd $(SHADOWDIR)/auto; ln -s ../../auto/configure .
mkdir $(SHADOWDIR)/po
$(MKDIR_P) $(SHADOWDIR)/po
cd $(SHADOWDIR)/po; ln -s ../../po/*.po ../../po/*.mak ../../po/*.vim ../../po/Makefile .
cd $(SHADOWDIR); rm -f auto/link.sed
cp Makefile configure $(SHADOWDIR)
rm -f $(SHADOWDIR)/auto/config.mk $(SHADOWDIR)/config.mk.dist
cp config.mk.dist $(SHADOWDIR)/auto/config.mk
cp config.mk.dist $(SHADOWDIR)
mkdir $(SHADOWDIR)/xxd
$(MKDIR_P) $(SHADOWDIR)/xxd
cd $(SHADOWDIR)/xxd; ln -s ../../xxd/*.[ch] ../../xxd/Make* .
if test -d $(RSRC_DIR); then \
cd $(SHADOWDIR); \
ln -s ../infplist.xml .; \
ln -s ../$(RSRC_DIR) ../os_mac.rsr.hqx ../dehqx.py .; \
fi
mkdir $(SHADOWDIR)/testdir
$(MKDIR_P) $(SHADOWDIR)/testdir
cd $(SHADOWDIR)/testdir; ln -s ../../testdir/Makefile \
../../testdir/Make_all.mak \
../../testdir/README.txt \
@@ -2947,7 +2958,7 @@ auto/gui_gtk_gresources.h: gui_gtk_res.xml $(GUI_GTK_RES_INPUTS)
objects: objects/.dirstamp
objects/.dirstamp:
mkdir -p objects
$(MKDIR_P) objects
touch objects/.dirstamp
# All object files depend on the objects directory, so that parallel make
@@ -3287,8 +3298,7 @@ install_macosx: gui_bundle
# Generate the help tags file now, it won't work with "make installruntime".
-@srcdir=`pwd`; cd $(HELPSOURCE); $(MAKE) VIMEXE=$$srcdir/$(VIMTARGET) vimtags
# Install the runtime files. Recursive!
-mkdir -p $(DESTDIR)$(prefix)/$(RESDIR)/vim/runtime
# -mkdir $(DESTDIR)$(prefix)/$(APPDIR)/bin
$(MKDIR_P) $(DESTDIR)$(prefix)/$(RESDIR)/vim/runtime
srcdir=`pwd`; $(MAKE) -f Makefile installruntime \
VIMEXE=$$srcdir/$(VIMTARGET) \
prefix=$(DESTDIR)$(prefix)/$(RESDIR)$(VIMDIR) \
@@ -3306,16 +3316,16 @@ gui_bundle: $(RESDIR) bundle-dir bundle-executable bundle-info bundle-resource \
bundle-language
$(RESDIR):
mkdir -p $@
$(MKDIR_P) $@
bundle-dir: $(APPDIR)/Contents $(VIMTARGET)
# Make a link to the runtime directory, so that we can try out the executable
# without installing it.
mkdir -p $(RESDIR)/vim
$(MKDIR_P) $(RESDIR)/vim
-ln -s `pwd`/../runtime $(RESDIR)/vim
bundle-executable: $(VIMTARGET)
mkdir -p $(APPDIR)/Contents/MacOS
$(MKDIR_P) $(APPDIR)/Contents/MacOS
cp $(VIMTARGET) $(APPDIR)/Contents/MacOS/$(VIMTARGET)
bundle-info: bundle-dir
@@ -3346,8 +3356,8 @@ bundle-rsrc: os_mac.rsr.hqx
bundle-language: bundle-dir
$(APPDIR)/Contents:
-$(SHELL) ./mkinstalldirs $(APPDIR)/Contents/MacOS
-$(SHELL) ./mkinstalldirs $(RESDIR)/English.lproj
$(MKDIR_P) $(APPDIR)/Contents/MacOS
$(MKDIR_P) $(RESDIR)/English.lproj
##############################################################################
+11 -13
View File
@@ -3456,7 +3456,7 @@ ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_ext=c
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
@@ -3733,7 +3733,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
fi
rm -f conftest*
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
$as_echo_n "checking for fgrep... " >&6; }
if ${ac_cv_path_FGREP+:} false; then :
$as_echo_n "(cached) " >&6
@@ -3799,7 +3799,7 @@ fi
$as_echo "$ac_cv_path_FGREP" >&6; }
FGREP="$ac_cv_path_FGREP"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5
$as_echo_n "checking for library containing strerror... " >&6; }
if ${ac_cv_search_strerror+:} false; then :
$as_echo_n "(cached) " >&6
@@ -3854,7 +3854,7 @@ if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
fi
for ac_prog in gawk mawk nawk awk
for ac_prog in gawk mawk nawk awk
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
@@ -11630,16 +11630,15 @@ if test "x$vim_cv_terminfo" = "xyes" ; then
fi
if test "x$olibs" != "x$LIBS"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking what tgetent() returns for an unknown terminal" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking what tgetent() returns for an unknown terminal" >&5
$as_echo_n "checking what tgetent() returns for an unknown terminal... " >&6; }
if ${vim_cv_tgent+:} false; then :
$as_echo_n "(cached) " >&6
else
if test "$cross_compiling" = yes; then :
if test "$cross_compiling" = yes; then :
as_fn_error $? "failed to compile test program." "$LINENO" 5
as_fn_error $? "failed to compile test program." "$LINENO" 5
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -11659,11 +11658,11 @@ main()
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
vim_cv_tgent=zero
vim_cv_tgent=zero
else
vim_cv_tgent=non-zero
vim_cv_tgent=non-zero
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
@@ -11675,10 +11674,9 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $vim_cv_tgent" >&5
$as_echo "$vim_cv_tgent" >&6; }
if test "x$vim_cv_tgent" = "xzero" ; then
$as_echo "#define TGETENT_ZERO_ERR 0" >>confdefs.h
if test "x$vim_cv_tgent" = "xzero" ; then
$as_echo "#define TGETENT_ZERO_ERR 0" >>confdefs.h
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether termcap.h contains ospeed" >&5
+15 -5
View File
@@ -2425,7 +2425,7 @@ append_to_buffer(buf_T *buffer, char_u *msg, channel_T *channel, ch_part_T part)
curbuf = curwin->w_buffer;
}
}
redraw_buf_later(buffer, VALID);
redraw_buf_and_status_later(buffer, VALID);
channel_need_redraw = TRUE;
}
@@ -2592,9 +2592,14 @@ may_invoke_callback(channel_T *channel, ch_part_T part)
if (nl == NULL)
{
/* Flush remaining message that is missing a NL. */
buf = vim_realloc(buf, node->rq_buflen + 1);
if (buf == NULL)
char_u *new_buf;
new_buf = vim_realloc(buf, node->rq_buflen + 1);
if (new_buf == NULL)
/* This might fail over and over again, should the message
* be dropped? */
return FALSE;
buf = new_buf;
node->rq_buffer = buf;
nl = buf + node->rq_buflen++;
*nl = NUL;
@@ -5168,12 +5173,17 @@ job_stop(job_T *job, typval_T *argvars)
return 0;
}
}
if (job->jv_status == JOB_ENDED)
{
ch_log(job->jv_channel, "Job has already ended, job_stop() skipped");
return 0;
}
ch_logs(job->jv_channel, "Stopping job with '%s'", (char *)arg);
if (mch_stop_job(job, arg) == FAIL)
return 0;
/* Assume that "hup" does not kill the job. */
if (job->jv_channel != NULL && STRCMP(arg, "hup") != 0)
/* Assume that only "kill" will kill the job. */
if (job->jv_channel != NULL && STRCMP(arg, "kill") == 0)
job->jv_channel->ch_job_killed = TRUE;
/* We don't try freeing the job, obviously the caller still has a
+7 -3
View File
@@ -960,7 +960,7 @@ vim_isfilec_or_wc(int c)
}
/*
* return TRUE if 'c' is a printable character
* Return TRUE if 'c' is a printable character.
* Assume characters above 0x100 are printable (multi-byte), except for
* Unicode.
*/
@@ -1717,7 +1717,7 @@ vim_toupper(int c)
{
if (c <= '@')
return c;
if (c >= 0x80)
if (c >= 0x80 || !(cmp_flags & CMP_KEEPASCII))
{
if (enc_utf8)
return utf_toupper(c);
@@ -1733,6 +1733,8 @@ vim_toupper(int c)
if (enc_latin1like)
return latin1upper[c];
}
if (c < 0x80 && (cmp_flags & CMP_KEEPASCII))
return TOUPPER_ASC(c);
return TOUPPER_LOC(c);
}
@@ -1741,7 +1743,7 @@ vim_tolower(int c)
{
if (c <= '@')
return c;
if (c >= 0x80)
if (c >= 0x80 || !(cmp_flags & CMP_KEEPASCII))
{
if (enc_utf8)
return utf_tolower(c);
@@ -1757,6 +1759,8 @@ vim_tolower(int c)
if (enc_latin1like)
return latin1lower[c];
}
if (c < 0x80 && (cmp_flags & CMP_KEEPASCII))
return TOLOWER_ASC(c);
return TOLOWER_LOC(c);
}
#endif
+1 -1
View File
@@ -1,4 +1,4 @@
the first targets to make vim are: scratch config myself
the first target to make vim is: reconfig
srcdir = .
VIMNAME = vim
EXNAME = ex
+19 -21
View File
@@ -11,12 +11,12 @@ AC_DEFINE(UNIX)
AC_PROG_MAKE_SET
dnl Checks for programs.
AC_PROG_CC dnl required by almost everything
AC_PROG_CPP dnl required by header file checks
AC_PROGRAM_EGREP dnl required by AC_EGREP_CPP
AC_PROG_FGREP dnl finds working grep -F
AC_ISC_POSIX dnl required by AC_C_CROSS
AC_PROG_AWK dnl required for "make html" in ../doc
AC_PROG_CC dnl required by almost everything
AC_PROG_CPP dnl required by header file checks
AC_PROGRAM_EGREP dnl required by AC_EGREP_CPP
AC_PROG_FGREP dnl finds working grep -F
AC_ISC_POSIX dnl required by AC_C_CROSS
AC_PROG_AWK dnl required for "make html" in ../doc
dnl Don't strip if we don't have it
AC_CHECK_PROG(STRIP, strip, strip, :)
@@ -3440,10 +3440,9 @@ if test "x$vim_cv_terminfo" = "xyes" ; then
AC_DEFINE(TERMINFO)
fi
if test "x$olibs" != "x$LIBS"; then
AC_CACHE_CHECK([what tgetent() returns for an unknown terminal], [vim_cv_tgent],
[
AC_RUN_IFELSE([AC_LANG_SOURCE([[
AC_CACHE_CHECK([what tgetent() returns for an unknown terminal], [vim_cv_tgent],
[
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include "confdefs.h"
#ifdef HAVE_TERMCAP_H
# include <termcap.h>
@@ -3454,18 +3453,17 @@ if test "x$olibs" != "x$LIBS"; then
#endif
main()
{char s[10000]; int res = tgetent(s, "thisterminaldoesnotexist"); exit(res != 0); }
]])],[
vim_cv_tgent=zero
],[
vim_cv_tgent=non-zero
],[
AC_MSG_ERROR(failed to compile test program.)
])
]])],[
vim_cv_tgent=zero
],[
vim_cv_tgent=non-zero
],[
AC_MSG_ERROR(failed to compile test program.)
])
if test "x$vim_cv_tgent" = "xzero" ; then
AC_DEFINE(TGETENT_ZERO_ERR, 0)
fi
])
if test "x$vim_cv_tgent" = "xzero" ; then
AC_DEFINE(TGETENT_ZERO_ERR, 0)
fi
AC_MSG_CHECKING(whether termcap.h contains ospeed)
+81
View File
@@ -0,0 +1,81 @@
" This script generates the tables cmdidxs1[] and cmdidxs2[][] which,
" given a Ex command, determine the first value to probe to find
" a matching command in cmdnames[] based on the first character
" and the first 2 characters of the command.
" This is used to speed up lookup in cmdnames[].
"
" Script should be run every time new Ex commands are added in Vim,
" from the src/vim directory, since it reads commands from "ex_cmds.h".
let cmds = []
let skipped_cmds = 0
for line in readfile('ex_cmds.h')
if line =~ '^EX(CMD_'
let m = matchlist(line, '^EX(CMD_\S*,\s*"\([a-z][^"]*\)"')
if len(m) >= 2
let cmds += [ m[1] ]
else
let skipped_cmds += 1
endif
endif
endfor
let cmdidxs1 = {}
let cmdidxs2 = {}
for i in range(len(cmds) - 1, 0, -1)
let cmd = cmds[i]
let c1 = cmd[0] " First character of command
let c2 = cmd[1] " Second character of command (if any)
let cmdidxs1{c1} = i
if c2 >= 'a' && c2 <= 'z'
let cmdidxs2{c1}{c2} = i
endif
endfor
let output = [ '/* Automatically generated code by create_cmdidxs.vim' ]
let output += [ ' *' ]
let output += [ ' * Table giving the index of the first command in cmdnames[] to lookup' ]
let output += [ ' * based on the first letter of a command.' ]
let output += [ ' */' ]
let output += [ 'static const unsigned short cmdidxs1[26] =' ]
let output += [ '{' ]
let a_to_z = map(range(char2nr('a'), char2nr('z')), 'nr2char(v:val)')
for c1 in a_to_z
let line = ' /* ' . c1 . ' */ ' . cmdidxs1{c1} . ((c1 == 'z') ? '' : ',')
let output += [ line ]
endfor
let output += [ '};' ]
let output += [ '' ]
let output += [ '/*' ]
let output += [ ' * Table giving the index of the first command in cmdnames[] to lookup' ]
let output += [ ' * based on the first 2 letters of a command.' ]
let output += [ ' * Values in cmdidxs2[c1][c2] are relative to cmdidxs1[c1] so that they' ]
let output += [ ' * fit in a byte.' ]
let output += [ ' */' ]
let output += [ 'static const unsigned char cmdidxs2[26][26] =' ]
let output += [ '{ /* 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 */' ]
for c1 in a_to_z
let line = ' /* ' . c1 . ' */ {'
for c2 in a_to_z
if exists('cmdidxs2{c1}{c2}')
let line .= printf('%3d', cmdidxs2{c1}{c2} - cmdidxs1{c1})
else
let line .= ' 0'
endif
let line .= (c2 == 'z') ? '' : ','
endfor
let line .= ' }' . ((c1 == 'z') ? '' : ',')
let output += [ line ]
endfor
let output += [ '};' ]
let output += [ '' ]
let output += [ 'static const int command_count = ' . (len(cmds) + skipped_cmds) . ';' ]
call writefile(output, "ex_cmdidxs.h")
quit
+14 -8
View File
@@ -59,13 +59,23 @@ rettv_dict_alloc(typval_T *rettv)
if (d == NULL)
return FAIL;
rettv->vval.v_dict = d;
rettv->v_type = VAR_DICT;
rettv_dict_set(rettv, d);
rettv->v_lock = 0;
++d->dv_refcount;
return OK;
}
/*
* Set a dictionary as the return value
*/
void
rettv_dict_set(typval_T *rettv, dict_T *d)
{
rettv->v_type = VAR_DICT;
rettv->vval.v_dict = d;
if (d != NULL)
++d->dv_refcount;
}
/*
* Free a Dictionary, including all non-container items it contains.
* Ignores the reference count.
@@ -646,11 +656,7 @@ failret:
*arg = skipwhite(*arg + 1);
if (evaluate)
{
rettv->v_type = VAR_DICT;
rettv->vval.v_dict = d;
++d->dv_refcount;
}
rettv_dict_set(rettv, d);
return OK;
}
+46 -23
View File
@@ -96,6 +96,7 @@ struct compl_S
static compl_T *compl_first_match = NULL;
static compl_T *compl_curr_match = NULL;
static compl_T *compl_shown_match = NULL;
static compl_T *compl_old_match = NULL;
/* After using a cursor key <Enter> selects a match in the popup menu,
* otherwise it inserts a line break. */
@@ -3440,6 +3441,7 @@ ins_compl_free(void)
} while (compl_curr_match != NULL && compl_curr_match != compl_first_match);
compl_first_match = compl_curr_match = NULL;
compl_shown_match = NULL;
compl_old_match = NULL;
}
static void
@@ -4286,7 +4288,6 @@ ins_compl_get_exp(pos_T *ini)
char_u *ptr;
char_u *dict = NULL;
int dict_f = 0;
compl_T *old_match;
int set_match_pos;
if (!compl_started)
@@ -4300,7 +4301,7 @@ ins_compl_get_exp(pos_T *ini)
last_match_pos = first_match_pos = *ini;
}
old_match = compl_curr_match; /* remember the last current match */
compl_old_match = compl_curr_match; /* remember the last current match */
pos = (compl_direction == FORWARD) ? &last_match_pos : &first_match_pos;
/* For ^N/^P loop over all the flags/windows/buffers in 'complete' */
for (;;)
@@ -4402,6 +4403,11 @@ ins_compl_get_exp(pos_T *ini)
}
}
/* If complete() was called then compl_pattern has been reset. The
* following won't work then, bail out. */
if (compl_pattern == NULL)
break;
switch (type)
{
case -1:
@@ -4635,7 +4641,7 @@ ins_compl_get_exp(pos_T *ini)
/* check if compl_curr_match has changed, (e.g. other type of
* expansion added something) */
if (type != 0 && compl_curr_match != old_match)
if (type != 0 && compl_curr_match != compl_old_match)
found_new_match = OK;
/* break the loop for specialized modes (use 'complete' just for the
@@ -4674,13 +4680,16 @@ ins_compl_get_exp(pos_T *ini)
|| (ctrl_x_mode != 0 && !CTRL_X_MODE_LINE_OR_EVAL(ctrl_x_mode)))
i = ins_compl_make_cyclic();
/* If several matches were added (FORWARD) or the search failed and has
* just been made cyclic then we have to move compl_curr_match to the next
* or previous entry (if any) -- Acevedo */
compl_curr_match = compl_direction == FORWARD ? old_match->cp_next
: old_match->cp_prev;
if (compl_curr_match == NULL)
compl_curr_match = old_match;
if (compl_old_match != NULL)
{
/* If several matches were added (FORWARD) or the search failed and has
* just been made cyclic then we have to move compl_curr_match to the
* next or previous entry (if any) -- Acevedo */
compl_curr_match = compl_direction == FORWARD ? compl_old_match->cp_next
: compl_old_match->cp_prev;
if (compl_curr_match == NULL)
compl_curr_match = compl_old_match;
}
return i;
}
@@ -4770,7 +4779,6 @@ ins_compl_next(
int in_compl_func) /* called from complete_check() */
{
int num_matches = -1;
int i;
int todo = count;
compl_T *found_compl = NULL;
int found_end = FALSE;
@@ -4962,15 +4970,30 @@ ins_compl_next(
*/
if (compl_shown_match->cp_fname != NULL)
{
STRCPY(IObuff, "match in file ");
i = (vim_strsize(compl_shown_match->cp_fname) + 16) - sc_col;
if (i <= 0)
i = 0;
else
STRCAT(IObuff, "<");
STRCAT(IObuff, compl_shown_match->cp_fname + i);
msg(IObuff);
redraw_cmdline = FALSE; /* don't overwrite! */
char *lead = _("match in file");
int space = sc_col - vim_strsize((char_u *)lead) - 2;
char_u *s;
char_u *e;
if (space > 0)
{
/* We need the tail that fits. With double-byte encoding going
* back from the end is very slow, thus go from the start and keep
* the text that fits in "space" between "s" and "e". */
for (s = e = compl_shown_match->cp_fname; *e != NUL; MB_PTR_ADV(e))
{
space -= ptr2cells(e);
while (space < 0)
{
space += ptr2cells(s);
MB_PTR_ADV(s);
}
}
vim_snprintf((char *)IObuff, IOSIZE, "%s %s%s", lead,
s > compl_shown_match->cp_fname ? "<" : "", s);
msg(IObuff);
redraw_cmdline = FALSE; /* don't overwrite! */
}
}
return num_matches;
@@ -9017,7 +9040,7 @@ ins_bs(
#endif
/*
* delete newline!
* Delete newline!
*/
if (curwin->w_cursor.col == 0)
{
@@ -9032,7 +9055,7 @@ ins_bs(
(linenr_T)(curwin->w_cursor.lnum + 1)) == FAIL)
return FALSE;
--Insstart.lnum;
Insstart.col = MAXCOL;
Insstart.col = (colnr_T)STRLEN(ml_get(Insstart.lnum));
}
/*
* In replace mode:
@@ -9543,7 +9566,7 @@ bracketed_paste(paste_mode_T mode, int drop, garray_T *gap)
#endif
buf[idx++] = c;
buf[idx] = NUL;
if (end != NUL && STRNCMP(buf, end, idx) == 0)
if (end != NULL && STRNCMP(buf, end, idx) == 0)
{
if (end[idx] == NUL)
break; /* Found the end of paste code. */
+11 -9
View File
@@ -4665,9 +4665,7 @@ eval_index(
item = item->li_next;
}
clear_tv(rettv);
rettv->v_type = VAR_LIST;
rettv->vval.v_list = l;
++l->lv_refcount;
rettv_list_set(rettv, l);
}
else
{
@@ -5327,6 +5325,10 @@ garbage_collect(int testing)
abort = abort || set_ref_in_timer(copyID);
#endif
#ifdef FEAT_QUICKFIX
abort = abort || set_ref_in_quickfix(copyID);
#endif
if (!abort)
{
/*
@@ -6120,13 +6122,16 @@ var2fpos(
if (name[1] == '0') /* "w0": first visible line */
{
update_topline();
pos.lnum = curwin->w_topline;
/* In silent Ex mode topline is zero, but that's not a valid line
* number; use one instead. */
pos.lnum = curwin->w_topline > 0 ? curwin->w_topline : 1;
return &pos;
}
else if (name[1] == '$') /* "w$": last visible line */
{
validate_botline();
pos.lnum = curwin->w_botline - 1;
/* In silent Ex mode botline is zero, return zero then. */
pos.lnum = curwin->w_botline > 0 ? curwin->w_botline - 1 : 0;
return &pos;
}
}
@@ -8325,7 +8330,6 @@ ex_execute(exarg_T *eap)
* follows is displayed on a new line when scrolling back at the
* more prompt. */
msg_sb_eol();
msg_start();
}
if (eap->cmdidx == CMD_echomsg)
@@ -8480,9 +8484,7 @@ getwinvar(
if (opts != NULL)
{
rettv->v_type = VAR_DICT;
rettv->vval.v_dict = opts;
++opts->dv_refcount;
rettv_dict_set(rettv, opts);
done = TRUE;
}
}
+52 -52
View File
@@ -3005,8 +3005,7 @@ f_expand(typval_T *argvars, typval_T *rettv)
&& get_tv_number_chk(&argvars[2], &error)
&& !error)
{
rettv->v_type = VAR_LIST;
rettv->vval.v_list = NULL;
rettv_list_set(rettv, NULL);
}
s = get_tv_string(&argvars[0]);
@@ -3909,12 +3908,7 @@ f_get(typval_T *argvars, typval_T *rettv)
}
}
else if (STRCMP(what, "dict") == 0)
{
rettv->v_type = VAR_DICT;
rettv->vval.v_dict = pt->pt_dict;
if (pt->pt_dict != NULL)
++pt->pt_dict->dv_refcount;
}
rettv_dict_set(rettv, pt->pt_dict);
else if (STRCMP(what, "args") == 0)
{
rettv->v_type = VAR_LIST;
@@ -4214,9 +4208,7 @@ f_getbufvar(typval_T *argvars, typval_T *rettv)
if (opts != NULL)
{
rettv->v_type = VAR_DICT;
rettv->vval.v_dict = opts;
++opts->dv_refcount;
rettv_dict_set(rettv, opts);
done = TRUE;
}
}
@@ -5248,24 +5240,6 @@ f_getwininfo(typval_T *argvars, typval_T *rettv)
#endif
}
/*
* "getwinposx()" function
*/
static void
f_getwinposx(typval_T *argvars UNUSED, typval_T *rettv)
{
rettv->vval.v_number = -1;
#ifdef FEAT_GUI
if (gui.in_use)
{
int x, y;
if (gui_mch_get_winpos(&x, &y) == OK)
rettv->vval.v_number = x;
}
#endif
}
/*
* "win_findbuf()" function
*/
@@ -5313,6 +5287,33 @@ f_win_id2win(typval_T *argvars, typval_T *rettv)
rettv->vval.v_number = win_id2win(argvars);
}
/*
* "getwinposx()" function
*/
static void
f_getwinposx(typval_T *argvars UNUSED, typval_T *rettv)
{
rettv->vval.v_number = -1;
#ifdef FEAT_GUI
if (gui.in_use)
{
int x, y;
if (gui_mch_get_winpos(&x, &y) == OK)
rettv->vval.v_number = x;
return;
}
#endif
#if defined(HAVE_TGETENT) && defined(FEAT_TERMRESPONSE)
{
int x, y;
if (term_get_winpos(&x, &y) == OK)
rettv->vval.v_number = x;
}
#endif
}
/*
* "getwinposy()" function
*/
@@ -5327,6 +5328,15 @@ f_getwinposy(typval_T *argvars UNUSED, typval_T *rettv)
if (gui_mch_get_winpos(&x, &y) == OK)
rettv->vval.v_number = y;
return;
}
#endif
#if defined(HAVE_TGETENT) && defined(FEAT_TERMRESPONSE)
{
int x, y;
if (term_get_winpos(&x, &y) == OK)
rettv->vval.v_number = y;
}
#endif
}
@@ -5361,8 +5371,7 @@ f_glob(typval_T *argvars, typval_T *rettv)
{
if (get_tv_number_chk(&argvars[2], &error))
{
rettv->v_type = VAR_LIST;
rettv->vval.v_list = NULL;
rettv_list_set(rettv, NULL);
}
if (argvars[3].v_type != VAR_UNKNOWN
&& get_tv_number_chk(&argvars[3], &error))
@@ -5418,8 +5427,7 @@ f_globpath(typval_T *argvars, typval_T *rettv)
{
if (get_tv_number_chk(&argvars[3], &error))
{
rettv->v_type = VAR_LIST;
rettv->vval.v_list = NULL;
rettv_list_set(rettv, NULL);
}
if (argvars[4].v_type != VAR_UNKNOWN
&& get_tv_number_chk(&argvars[4], &error))
@@ -7718,6 +7726,7 @@ static int mkdir_recurse(char_u *dir, int prot);
/*
* Create the directory in which "dir" is located, and higher levels when
* needed.
* Return OK or FAIL.
*/
static int
mkdir_recurse(char_u *dir, int prot)
@@ -9160,9 +9169,7 @@ f_reverse(typval_T *argvars, typval_T *rettv)
list_append(l, li);
li = ni;
}
rettv->vval.v_list = l;
rettv->v_type = VAR_LIST;
++l->lv_refcount;
rettv_list_set(rettv, l);
l->lv_idx = l->lv_len - l->lv_idx - 1;
}
}
@@ -10065,7 +10072,8 @@ set_qf_ll_list(
act = get_tv_string_chk(action_arg);
if (act == NULL)
return; /* type error; errmsg already given */
if ((*act == 'a' || *act == 'r' || *act == ' ') && act[1] == NUL)
if ((*act == 'a' || *act == 'r' || *act == ' ' || *act == 'f') &&
act[1] == NUL)
action = *act;
else
EMSG2(_(e_invact), act);
@@ -10749,9 +10757,7 @@ do_sort_uniq(typval_T *argvars, typval_T *rettv, int sort)
(char_u *)(sort ? N_("sort() argument") : N_("uniq() argument")),
TRUE))
goto theend;
rettv->vval.v_list = l;
rettv->v_type = VAR_LIST;
++l->lv_refcount;
rettv_list_set(rettv, l);
len = list_len(l);
if (len <= 1)
@@ -11773,7 +11779,7 @@ f_synIDattr(typval_T *argvars UNUSED, typval_T *rettv)
break;
case 'n': /* name */
p = get_highlight_name(NULL, id - 1);
p = get_highlight_name_ext(NULL, id - 1, FALSE);
break;
case 'r': /* reverse */
@@ -11839,8 +11845,7 @@ f_synconcealed(typval_T *argvars UNUSED, typval_T *rettv)
char_u str[NUMBUFLEN];
#endif
rettv->v_type = VAR_LIST;
rettv->vval.v_list = NULL;
rettv_list_set(rettv, NULL);
#if defined(FEAT_SYN_HL) && defined(FEAT_CONCEAL)
lnum = get_tv_lnum(argvars); /* -1 on type error */
@@ -11897,8 +11902,7 @@ f_synstack(typval_T *argvars UNUSED, typval_T *rettv)
int id;
#endif
rettv->v_type = VAR_LIST;
rettv->vval.v_list = NULL;
rettv_list_set(rettv, NULL);
#ifdef FEAT_SYN_HL
lnum = get_tv_lnum(argvars); /* -1 on type error */
@@ -12064,9 +12068,7 @@ get_cmd_output_as_rettv(
list_append(list, li);
}
++list->lv_refcount;
rettv->v_type = VAR_LIST;
rettv->vval.v_list = list;
rettv_list_set(rettv, list);
list = NULL;
}
else
@@ -12472,8 +12474,7 @@ f_test_null_channel(typval_T *argvars UNUSED, typval_T *rettv)
static void
f_test_null_dict(typval_T *argvars UNUSED, typval_T *rettv)
{
rettv->v_type = VAR_DICT;
rettv->vval.v_dict = NULL;
rettv_dict_set(rettv, NULL);
}
#ifdef FEAT_JOB_CHANNEL
@@ -12488,8 +12489,7 @@ f_test_null_job(typval_T *argvars UNUSED, typval_T *rettv)
static void
f_test_null_list(typval_T *argvars UNUSED, typval_T *rettv)
{
rettv->v_type = VAR_LIST;
rettv->vval.v_list = NULL;
rettv_list_set(rettv, NULL);
}
static void
+72
View File
@@ -0,0 +1,72 @@
/* Automatically generated code by create_cmdidxs.vim
*
* Table giving the index of the first command in cmdnames[] to lookup
* based on the first letter of a command.
*/
static const unsigned short cmdidxs1[26] =
{
/* a */ 0,
/* b */ 19,
/* c */ 42,
/* d */ 103,
/* e */ 125,
/* f */ 145,
/* g */ 161,
/* h */ 167,
/* i */ 176,
/* j */ 194,
/* k */ 196,
/* l */ 201,
/* m */ 259,
/* n */ 279,
/* o */ 299,
/* p */ 311,
/* q */ 350,
/* r */ 353,
/* s */ 372,
/* t */ 439,
/* u */ 474,
/* v */ 485,
/* w */ 503,
/* x */ 518,
/* y */ 527,
/* z */ 528
};
/*
* Table giving the index of the first command in cmdnames[] to lookup
* based on the first 2 letters of a command.
* Values in cmdidxs2[c1][c2] are relative to cmdidxs1[c1] so that they
* fit in a byte.
*/
static const unsigned char cmdidxs2[26][26] =
{ /* 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 */
/* a */ { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 6, 0, 0, 0, 7, 15, 0, 16, 0, 0, 0, 0, 0 },
/* b */ { 2, 0, 0, 4, 5, 7, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 0, 13, 0, 0, 0, 0, 22, 0, 0, 0 },
/* c */ { 3, 10, 12, 14, 16, 18, 21, 0, 0, 0, 0, 29, 33, 36, 42, 51, 53, 54, 55, 0, 57, 0, 60, 0, 0, 0 },
/* d */ { 0, 0, 0, 0, 0, 0, 0, 0, 6, 15, 0, 16, 0, 0, 17, 0, 0, 19, 20, 0, 0, 0, 0, 0, 0, 0 },
/* e */ { 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 7, 9, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0 },
/* f */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0 },
/* g */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 4, 5, 0, 0, 0, 0 },
/* h */ { 5, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
/* i */ { 1, 0, 0, 0, 0, 3, 0, 0, 0, 4, 0, 5, 6, 0, 0, 0, 0, 0, 13, 0, 15, 0, 0, 0, 0, 0 },
/* j */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 },
/* k */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
/* l */ { 3, 9, 11, 15, 16, 20, 23, 28, 0, 0, 0, 30, 33, 36, 40, 46, 0, 48, 57, 49, 50, 54, 56, 0, 0, 0 },
/* m */ { 1, 0, 0, 0, 9, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18 },
/* n */ { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 8, 10, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0 },
/* o */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 5, 0, 0, 0, 0, 0, 0, 9, 0, 11, 0, 0, 0 },
/* p */ { 1, 0, 3, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 9, 0, 0, 16, 17, 26, 0, 27, 0, 28, 0 },
/* q */ { 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
/* r */ { 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 18, 0, 0, 0, 0 },
/* s */ { 2, 6, 15, 0, 18, 22, 0, 24, 25, 0, 0, 28, 30, 34, 38, 40, 0, 48, 0, 49, 0, 61, 62, 0, 63, 0 },
/* t */ { 2, 0, 19, 0, 22, 23, 0, 24, 0, 25, 0, 26, 27, 28, 29, 30, 0, 31, 33, 0, 34, 0, 0, 0, 0, 0 },
/* u */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
/* v */ { 0, 0, 0, 0, 1, 0, 0, 0, 4, 0, 0, 0, 9, 12, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 0, 0 },
/* w */ { 2, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, 0, 0, 8, 0, 9, 10, 0, 12, 0, 13, 14, 0, 0, 0, 0 },
/* x */ { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 5, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0 },
/* y */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
/* z */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
static const int command_count = 541;
+16 -5
View File
@@ -4564,7 +4564,7 @@ ex_change(exarg_T *eap)
ex_z(exarg_T *eap)
{
char_u *x;
int bigness;
long bigness;
char_u *kind;
int minus = 0;
linenr_T start, end, curs, i;
@@ -4601,7 +4601,12 @@ ex_z(exarg_T *eap)
}
else
{
bigness = atoi((char *)x);
bigness = atol((char *)x);
/* bigness could be < 0 if atol(x) overflows. */
if (bigness > 2 * curbuf->b_ml.ml_line_count || bigness < 0)
bigness = 2 * curbuf->b_ml.ml_line_count;
p_window = bigness;
if (*kind == '=')
bigness += 2;
@@ -4659,6 +4664,8 @@ ex_z(exarg_T *eap)
if (curs > curbuf->b_ml.ml_line_count)
curs = curbuf->b_ml.ml_line_count;
else if (curs < 1)
curs = 1;
for (i = start; i <= end; i++)
{
@@ -4681,7 +4688,11 @@ ex_z(exarg_T *eap)
}
}
curwin->w_cursor.lnum = curs;
if (curwin->w_cursor.lnum != curs)
{
curwin->w_cursor.lnum = curs;
curwin->w_cursor.col = 0;
}
ex_no_reprint = TRUE;
}
@@ -7962,7 +7973,7 @@ sign_list_defined(sign_T *sp)
if (sp->sn_line_hl > 0)
{
MSG_PUTS(" linehl=");
p = get_highlight_name(NULL, sp->sn_line_hl - 1);
p = get_highlight_name_ext(NULL, sp->sn_line_hl - 1, FALSE);
if (p == NULL)
MSG_PUTS("NONE");
else
@@ -7971,7 +7982,7 @@ sign_list_defined(sign_T *sp)
if (sp->sn_text_hl > 0)
{
MSG_PUTS(" texthl=");
p = get_highlight_name(NULL, sp->sn_text_hl - 1);
p = get_highlight_name_ext(NULL, sp->sn_text_hl - 1, FALSE);
if (p == NULL)
MSG_PUTS("NONE");
else
+1 -1
View File
@@ -1629,7 +1629,7 @@ EX(CMD_wincmd, "wincmd", ex_wincmd,
NEEDARG|WORD1|RANGE|NOTADR,
ADDR_WINDOWS),
EX(CMD_windo, "windo", ex_listdo,
BANG|NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL,
NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL,
ADDR_WINDOWS),
EX(CMD_winpos, "winpos", ex_winpos,
EXTRA|TRLBAR|CMDWIN,
+23 -38
View File
@@ -501,40 +501,7 @@ static void ex_folddo(exarg_T *eap);
*/
#define DO_DECLARE_EXCMD
#include "ex_cmds.h"
/*
* Table used to quickly search for a command, based on its first character.
*/
static cmdidx_T cmdidxs[27] =
{
CMD_append,
CMD_buffer,
CMD_change,
CMD_delete,
CMD_edit,
CMD_file,
CMD_global,
CMD_help,
CMD_insert,
CMD_join,
CMD_k,
CMD_list,
CMD_move,
CMD_next,
CMD_open,
CMD_print,
CMD_quit,
CMD_read,
CMD_substitute,
CMD_t,
CMD_undo,
CMD_vglobal,
CMD_write,
CMD_xit,
CMD_yank,
CMD_z,
CMD_bang
};
#include "ex_cmdidxs.h"
static char_u dollar_command[2] = {'$', 0};
@@ -621,7 +588,6 @@ restore_dbg_stuff(struct dbg_stuff *dsp)
}
#endif
/*
* do_exmode(): Repeatedly get commands for the "Ex" mode, until the ":vi"
* command is given.
@@ -3013,7 +2979,10 @@ do_one_cmd(
doend:
if (curwin->w_cursor.lnum == 0) /* can happen with zero line number */
{
curwin->w_cursor.lnum = 1;
curwin->w_cursor.col = 0;
}
if (errormsg != NULL && *errormsg != NUL && !did_emsg)
{
@@ -3215,10 +3184,25 @@ find_command(exarg_T *eap, int *full UNUSED)
}
}
if (ASCII_ISLOWER(*eap->cmd))
eap->cmdidx = cmdidxs[CharOrdLow(*eap->cmd)];
if (ASCII_ISLOWER(eap->cmd[0]))
{
int c1 = eap->cmd[0];
int c2 = eap->cmd[1];
if (command_count != (int)CMD_SIZE)
{
iemsg((char_u *)_("E943: Command table needs to be updated, run 'make cmdidxs'"));
getout(1);
}
/* Use a precomputed index for fast look-up in cmdnames[]
* taking into account the first 2 letters of eap->cmd. */
eap->cmdidx = cmdidxs1[CharOrdLow(c1)];
if (ASCII_ISLOWER(c2))
eap->cmdidx += cmdidxs2[CharOrdLow(c1)][CharOrdLow(c2)];
}
else
eap->cmdidx = cmdidxs[26];
eap->cmdidx = CMD_bang;
for ( ; (int)eap->cmdidx < (int)CMD_SIZE;
eap->cmdidx = (cmdidx_T)((int)eap->cmdidx + 1))
@@ -10333,6 +10317,7 @@ ex_normal(exarg_T *eap)
{
curwin->w_cursor.lnum = eap->line1++;
curwin->w_cursor.col = 0;
check_cursor_moved(curwin);
}
exec_normal_cmd(
+14 -7
View File
@@ -127,7 +127,7 @@ static void clear_hist_entry(histentry_T *hisptr);
#endif
#ifdef FEAT_CMDWIN
static int ex_window(void);
static int open_cmdwin(void);
#endif
#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
@@ -773,7 +773,7 @@ getcmdline(
/*
* Open a window to edit the command line (and history).
*/
c = ex_window();
c = open_cmdwin();
some_key_typed = TRUE;
}
}
@@ -1292,7 +1292,7 @@ getcmdline(
goto cmdline_not_changed;
case K_IGNORE:
/* Ignore mouse event or ex_window() result. */
/* Ignore mouse event or open_cmdwin() result. */
goto cmdline_not_changed;
#ifdef FEAT_GUI_W32
@@ -3347,11 +3347,18 @@ cmdline_del(int from)
*/
void
redrawcmdline(void)
{
redrawcmdline_ex(TRUE);
}
void
redrawcmdline_ex(int do_compute_cmdrow)
{
if (cmd_silent)
return;
need_wait_return = FALSE;
compute_cmdrow();
if (do_compute_cmdrow)
compute_cmdrow();
redrawcmd();
cursorcmd();
}
@@ -4158,7 +4165,7 @@ showmatches(expand_T *xp, int wildmenu UNUSED)
got_int = FALSE; /* only int. the completion, not the cmd line */
#ifdef FEAT_WILDMENU
else if (wildmenu)
win_redr_status_matches(xp, num_files, files_found, 0, showtail);
win_redr_status_matches(xp, num_files, files_found, -1, showtail);
#endif
else
{
@@ -6810,7 +6817,7 @@ cmd_gchar(int offset)
* K_IGNORE if editing continues
*/
static int
ex_window(void)
open_cmdwin(void)
{
struct cmdline_info save_ccline;
bufref_T old_curbuf;
@@ -6855,6 +6862,7 @@ ex_window(void)
# endif
/* don't use a new tab page */
cmdmod.tab = 0;
cmdmod.noswapfile = 1;
/* Create a window for the command-line buffer. */
if (win_split((int)p_cwh, WSP_BOT) == FAIL)
@@ -6871,7 +6879,6 @@ ex_window(void)
(void)do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, ECMD_HIDE, NULL);
(void)setfname(curbuf, (char_u *)"[Command Line]", NULL, TRUE);
set_option_value((char_u *)"bt", 0L, (char_u *)"nofile", OPT_LOCAL);
set_option_value((char_u *)"swf", 0L, NULL, OPT_LOCAL);
curbuf->b_p_ma = TRUE;
#ifdef FEAT_FOLDING
curwin->w_p_fen = FALSE;
+1 -1
View File
@@ -1695,7 +1695,7 @@ conv_to_pvim(void)
ptr[i] = toF_leading(ptr[i]);
++i;
while (canF_Rjoin(ptr[i]) && i < llen)
while (i < llen && canF_Rjoin(ptr[i]))
{
ptr[i] = toF_Rjoin(ptr[i]);
if (F_isterm(ptr[i]) || !F_isalpha(ptr[i]))
+3 -2
View File
@@ -9354,6 +9354,7 @@ apply_autocmds_group(
proftime_T wait_time;
#endif
int did_save_redobuff = FALSE;
save_redo_T save_redo;
/*
* Quickly return if there are no autocommands for this event or
@@ -9559,7 +9560,7 @@ apply_autocmds_group(
if (!ins_compl_active())
#endif
{
saveRedobuff();
saveRedobuff(&save_redo);
did_save_redobuff = TRUE;
}
did_filetype = keep_filetype;
@@ -9662,7 +9663,7 @@ apply_autocmds_group(
{
restore_search_patterns();
if (did_save_redobuff)
restoreRedobuff();
restoreRedobuff(&save_redo);
did_filetype = FALSE;
while (au_pending_free_buf != NULL)
{
+12 -6
View File
@@ -2755,7 +2755,7 @@ foldUpdateIEMSRecurse(
/* End of fold found, update the length when it got shorter. */
if (fp->fd_len != flp->lnum - fp->fd_top)
{
if (fp->fd_top + fp->fd_len > bot + 1)
if (fp->fd_top + fp->fd_len - 1 > bot)
{
/* fold continued below bot */
if (getlevel == foldlevelMarker
@@ -2928,7 +2928,7 @@ foldRemove(garray_T *gap, linenr_T top, linenr_T bot)
{
/* 2: or 3: need to delete nested folds */
foldRemove(&fp->fd_nested, top - fp->fd_top, bot - fp->fd_top);
if (fp->fd_top + fp->fd_len > bot + 1)
if (fp->fd_top + fp->fd_len - 1 > bot)
{
/* 3: need to split it. */
foldSplit(gap, (int)(fp - (fold_T *)gap->ga_data), top, bot);
@@ -2970,10 +2970,12 @@ foldRemove(garray_T *gap, linenr_T top, linenr_T bot)
/* foldReverseOrder() {{{2 */
static void
foldReverseOrder(garray_T *gap, linenr_T start, linenr_T end)
foldReverseOrder(garray_T *gap, linenr_T start_arg, linenr_T end_arg)
{
fold_T *left, *right;
fold_T tmp;
linenr_T start = start_arg;
linenr_T end = end_arg;
for (; start < end; start++, end--)
{
@@ -3133,10 +3135,14 @@ foldMoveRange(garray_T *gap, linenr_T line1, linenr_T line2, linenr_T dest)
dest_index = fold_index(fp, gap);
/*
* All folds are now correct, but they are not necessarily in the correct
* order. We have to swap folds in the range [move_end, dest_index) with
* those in the range [move_start, move_end).
* All folds are now correct, but not necessarily in the correct order. We
* must swap folds in the range [move_end, dest_index) with those in the
* range [move_start, move_end).
*/
if (move_end == 0)
/* There are no folds after those moved, hence no folds have been moved
* out of order. */
return;
foldReverseOrder(gap, (linenr_T)move_start, (linenr_T)dest_index - 1);
foldReverseOrder(gap, (linenr_T)move_start,
(linenr_T)(move_start + dest_index - move_end - 1));
+29 -31
View File
@@ -42,10 +42,6 @@
static buffheader_T redobuff = {{NULL, {NUL}}, NULL, 0, 0};
static buffheader_T old_redobuff = {{NULL, {NUL}}, NULL, 0, 0};
#if defined(FEAT_AUTOCMD) || defined(FEAT_EVAL) || defined(PROTO)
static buffheader_T save_redobuff = {{NULL, {NUL}}, NULL, 0, 0};
static buffheader_T save_old_redobuff = {{NULL, {NUL}}, NULL, 0, 0};
#endif
static buffheader_T recordbuff = {{NULL, {NUL}}, NULL, 0, 0};
static int typeahead_char = 0; /* typeahead char that's not flushed */
@@ -521,27 +517,22 @@ CancelRedo(void)
* Save redobuff and old_redobuff to save_redobuff and save_old_redobuff.
* Used before executing autocommands and user functions.
*/
static int save_level = 0;
void
saveRedobuff(void)
saveRedobuff(save_redo_T *save_redo)
{
char_u *s;
if (save_level++ == 0)
{
save_redobuff = redobuff;
redobuff.bh_first.b_next = NULL;
save_old_redobuff = old_redobuff;
old_redobuff.bh_first.b_next = NULL;
save_redo->sr_redobuff = redobuff;
redobuff.bh_first.b_next = NULL;
save_redo->sr_old_redobuff = old_redobuff;
old_redobuff.bh_first.b_next = NULL;
/* Make a copy, so that ":normal ." in a function works. */
s = get_buffcont(&save_redobuff, FALSE);
if (s != NULL)
{
add_buff(&redobuff, s, -1L);
vim_free(s);
}
/* Make a copy, so that ":normal ." in a function works. */
s = get_buffcont(&save_redo->sr_redobuff, FALSE);
if (s != NULL)
{
add_buff(&redobuff, s, -1L);
vim_free(s);
}
}
@@ -550,15 +541,12 @@ saveRedobuff(void)
* Used after executing autocommands and user functions.
*/
void
restoreRedobuff(void)
restoreRedobuff(save_redo_T *save_redo)
{
if (--save_level == 0)
{
free_buff(&redobuff);
redobuff = save_redobuff;
free_buff(&old_redobuff);
old_redobuff = save_old_redobuff;
}
free_buff(&redobuff);
redobuff = save_redo->sr_redobuff;
free_buff(&old_redobuff);
old_redobuff = save_redo->sr_old_redobuff;
}
#endif
@@ -932,7 +920,7 @@ init_typebuf(void)
typebuf.tb_noremap = noremapbuf_init;
typebuf.tb_buflen = TYPELEN_INIT;
typebuf.tb_len = 0;
typebuf.tb_off = 0;
typebuf.tb_off = MAXMAPLEN + 4;
typebuf.tb_change_cnt = 1;
}
}
@@ -986,11 +974,21 @@ ins_typebuf(
typebuf.tb_off -= addlen;
mch_memmove(typebuf.tb_buf + typebuf.tb_off, str, (size_t)addlen);
}
else if (typebuf.tb_len == 0 && typebuf.tb_buflen
>= addlen + 3 * (MAXMAPLEN + 4))
{
/*
* Buffer is empty and string fits in the existing buffer.
* Leave some space before and after, if possible.
*/
typebuf.tb_off = (typebuf.tb_buflen - addlen - 3 * (MAXMAPLEN + 4)) / 2;
mch_memmove(typebuf.tb_buf + typebuf.tb_off, str, (size_t)addlen);
}
else
{
/*
* Need to allocate a new buffer.
* In typebuf.tb_buf there must always be room for 3 * MAXMAPLEN + 4
* In typebuf.tb_buf there must always be room for 3 * (MAXMAPLEN + 4)
* characters. We add some extra room to avoid having to allocate too
* often.
*/
@@ -1303,7 +1301,7 @@ alloc_typebuf(void)
return FAIL;
}
typebuf.tb_buflen = TYPELEN_INIT;
typebuf.tb_off = 0;
typebuf.tb_off = MAXMAPLEN + 4; /* can insert without realloc */
typebuf.tb_len = 0;
typebuf.tb_maplen = 0;
typebuf.tb_silent = 0;
+3 -3
View File
@@ -97,6 +97,7 @@ EXTERN int cmdline_row;
EXTERN int redraw_cmdline INIT(= FALSE); /* cmdline must be redrawn */
EXTERN int clear_cmdline INIT(= FALSE); /* cmdline must be cleared */
EXTERN int mode_displayed INIT(= FALSE); /* mode is being displayed */
EXTERN int no_win_do_lines_ins INIT(= FALSE); /* don't insert lines */
#if defined(FEAT_CRYPT) || defined(FEAT_EVAL)
EXTERN int cmdline_star INIT(= FALSE); /* cmdline is crypted */
#endif
@@ -532,7 +533,6 @@ EXTERN int clip_autoselect_plus INIT(= FALSE);
EXTERN int clip_autoselectml INIT(= FALSE);
EXTERN int clip_html INIT(= FALSE);
EXTERN regprog_T *clip_exclude_prog INIT(= NULL);
EXTERN int clip_did_set_selection INIT(= TRUE);
EXTERN int clip_unnamed_saved INIT(= 0);
#endif
@@ -934,10 +934,10 @@ EXTERN int State INIT(= NORMAL); /* This is the current state of the
* command interpreter. */
EXTERN int finish_op INIT(= FALSE);/* TRUE while an operator is pending */
EXTERN int opcount INIT(= 0); /* count for pending operator */
EXTERN long opcount INIT(= 0); /* count for pending operator */
/*
* ex mode (Q) state
* Ex mode (Q) state
*/
EXTERN int exmode_active INIT(= 0); /* zero, EXMODE_NORMAL or EXMODE_VIM */
EXTERN int ex_no_reprint INIT(= FALSE); /* no need to print after z or p */
+4 -184
View File
@@ -92,19 +92,6 @@ static void gtk_form_position_child(GtkForm *form,
gboolean force_allocate);
static void gtk_form_position_children(GtkForm *form);
#if !GTK_CHECK_VERSION(3,0,0)
static GdkFilterReturn gtk_form_filter(GdkXEvent *gdk_xevent,
GdkEvent *event,
gpointer data);
static GdkFilterReturn gtk_form_main_filter(GdkXEvent *gdk_xevent,
GdkEvent *event,
gpointer data);
#endif
#if !GTK_CHECK_VERSION(3,16,0)
static void gtk_form_set_static_gravity(GdkWindow *window,
gboolean use_static);
#endif
static void gtk_form_send_configure(GtkForm *form);
static void gtk_form_child_map(GtkWidget *widget, gpointer user_data);
@@ -171,9 +158,6 @@ gtk_form_put(GtkForm *form,
gtk_form_attach_child_window(form, child);
gtk_widget_set_parent(child_widget, GTK_WIDGET(form));
#if !GTK_CHECK_VERSION(3,0,0)
gtk_widget_size_request(child->widget, NULL);
#endif
#if GTK_CHECK_VERSION(3,0,0)
if (gtk_widget_get_realized(GTK_WIDGET(form))
@@ -301,19 +285,7 @@ gtk_form_init(GtkForm *form)
gtk_widget_set_has_window(GTK_WIDGET(form), TRUE);
#endif
form->children = NULL;
#if !GTK_CHECK_VERSION(3,0,0)
form->width = 1;
form->height = 1;
#endif
form->bin_window = NULL;
#if !GTK_CHECK_VERSION(3,0,0)
form->configure_serial = 0;
form->visibility = GDK_VISIBILITY_PARTIAL;
#endif
form->freeze_count = 0;
}
@@ -393,10 +365,6 @@ gtk_form_realize(GtkWidget *widget)
#endif
gdk_window_set_user_data(form->bin_window, widget);
#if !GTK_CHECK_VERSION(3,16,0)
gtk_form_set_static_gravity(form->bin_window, TRUE);
#endif
#if GTK_CHECK_VERSION(3,0,0)
{
GtkStyleContext * const sctx = gtk_widget_get_style_context(widget);
@@ -414,11 +382,6 @@ gtk_form_realize(GtkWidget *widget)
gtk_style_set_background(widget->style, form->bin_window, GTK_STATE_NORMAL);
#endif
#if !GTK_CHECK_VERSION(3,0,0)
gdk_window_add_filter(widget->window, gtk_form_main_filter, form);
gdk_window_add_filter(form->bin_window, gtk_form_filter, form);
#endif
for (tmp_list = form->children; tmp_list; tmp_list = tmp_list->next)
{
GtkFormChild *child = tmp_list->data;
@@ -540,33 +503,11 @@ gtk_form_unrealize(GtkWidget *widget)
static void
gtk_form_size_request(GtkWidget *widget, GtkRequisition *requisition)
{
#if !GTK_CHECK_VERSION(3,0,0)
GList *tmp_list;
GtkForm *form;
#endif
g_return_if_fail(GTK_IS_FORM(widget));
g_return_if_fail(requisition != NULL);
#if !GTK_CHECK_VERSION(3,0,0)
form = GTK_FORM(widget);
#endif
#if GTK_CHECK_VERSION(3,0,0)
requisition->width = 1;
requisition->height = 1;
#else
requisition->width = form->width;
requisition->height = form->height;
tmp_list = form->children;
while (tmp_list)
{
GtkFormChild *child = tmp_list->data;
gtk_widget_size_request(child->widget, NULL);
tmp_list = tmp_list->next;
}
#endif
}
#if GTK_CHECK_VERSION(3,0,0)
@@ -735,28 +676,9 @@ gtk_form_expose(GtkWidget *widget, GdkEventExpose *event)
return FALSE;
for (tmp_list = form->children; tmp_list; tmp_list = tmp_list->next)
{
GtkFormChild *formchild = tmp_list->data;
GtkWidget *child = formchild->widget;
/*
* The following chunk of code is taken from gtkcontainer.c. The
* gtk1.x code synthesized expose events directly on the child widgets,
* which can't be done in gtk2
*/
if (GTK_WIDGET_DRAWABLE(child) && GTK_WIDGET_NO_WINDOW(child)
&& child->window == event->window)
{
GdkEventExpose child_event;
child_event = *event;
child_event.region = gtk_widget_region_intersect(child, event->region);
if (!gdk_region_empty(child_event.region))
{
gdk_region_get_clipbox(child_event.region, &child_event.area);
gtk_widget_send_expose(child, (GdkEvent *)&child_event);
}
}
}
gtk_container_propagate_expose(GTK_CONTAINER(widget),
GTK_WIDGET(((GtkFormChild *)tmp_list->data)->widget),
event);
return FALSE;
}
@@ -914,9 +836,6 @@ gtk_form_attach_child_window(GtkForm *form, GtkFormChild *child)
#endif
gtk_widget_set_parent_window(child->widget, child->window);
#if !GTK_CHECK_VERSION(3,16,0)
gtk_form_set_static_gravity(child->window, TRUE);
#endif
/*
* Install signal handlers to map/unmap child->window
* alongside with the actual widget.
@@ -948,15 +867,6 @@ gtk_form_realize_child(GtkForm *form, GtkFormChild *child)
{
gtk_form_attach_child_window(form, child);
gtk_widget_realize(child->widget);
#if !GTK_CHECK_VERSION(3,16,0)
if (child->window == NULL) /* might be already set, see above */
# if GTK_CHECK_VERSION(3,0,0)
gtk_form_set_static_gravity(gtk_widget_get_window(child->widget), TRUE);
# else
gtk_form_set_static_gravity(child->widget->window, TRUE);
# endif
#endif
}
static void
@@ -1068,96 +978,6 @@ gtk_form_position_children(GtkForm *form)
gtk_form_position_child(form, tmp_list->data, FALSE);
}
/* Callbacks */
/* The main event filter. Actually, we probably don't really need
* to install this as a filter at all, since we are calling it
* directly above in the expose-handling hack.
*
* This routine identifies expose events that are generated when
* we've temporarily moved the bin_window_origin, and translates
* them or discards them, depending on whether we are obscured
* or not.
*/
#if !GTK_CHECK_VERSION(3,0,0)
static GdkFilterReturn
gtk_form_filter(GdkXEvent *gdk_xevent, GdkEvent *event UNUSED, gpointer data)
{
XEvent *xevent;
GtkForm *form;
xevent = (XEvent *) gdk_xevent;
form = GTK_FORM(data);
switch (xevent->type)
{
case Expose:
if (xevent->xexpose.serial == form->configure_serial)
{
if (form->visibility == GDK_VISIBILITY_UNOBSCURED)
return GDK_FILTER_REMOVE;
else
break;
}
break;
case ConfigureNotify:
if ((xevent->xconfigure.x != 0) || (xevent->xconfigure.y != 0))
form->configure_serial = xevent->xconfigure.serial;
break;
}
return GDK_FILTER_CONTINUE;
}
/* Although GDK does have a GDK_VISIBILITY_NOTIFY event,
* there is no corresponding event in GTK, so we have
* to get the events from a filter
*/
static GdkFilterReturn
gtk_form_main_filter(GdkXEvent *gdk_xevent,
GdkEvent *event UNUSED,
gpointer data)
{
XEvent *xevent;
GtkForm *form;
xevent = (XEvent *) gdk_xevent;
form = GTK_FORM(data);
if (xevent->type == VisibilityNotify)
{
switch (xevent->xvisibility.state)
{
case VisibilityFullyObscured:
form->visibility = GDK_VISIBILITY_FULLY_OBSCURED;
break;
case VisibilityPartiallyObscured:
form->visibility = GDK_VISIBILITY_PARTIAL;
break;
case VisibilityUnobscured:
form->visibility = GDK_VISIBILITY_UNOBSCURED;
break;
}
return GDK_FILTER_REMOVE;
}
return GDK_FILTER_CONTINUE;
}
#endif /* !GTK_CHECK_VERSION(3,0,0) */
#if !GTK_CHECK_VERSION(3,16,0)
static void
gtk_form_set_static_gravity(GdkWindow *window, gboolean use_static)
{
/* We don't check if static gravity is actually supported, because it
* results in an annoying assertion error message. */
gdk_window_set_static_gravities(window, use_static);
}
#endif /* !GTK_CHECK_VERSION(3,16,0) */
void
gtk_form_move_resize(GtkForm *form, GtkWidget *widget,
gint x, gint y, gint w, gint h)
-12
View File
@@ -43,19 +43,7 @@ struct _GtkForm
GtkContainer container;
GList *children;
#ifndef USE_GTK3
guint width;
guint height;
#endif
GdkWindow *bin_window;
#ifndef USE_GTK3
GdkVisibilityState visibility;
gulong configure_serial;
#endif
gint freeze_count;
};
+11 -1
View File
@@ -3509,7 +3509,7 @@ gui_mch_init_font(char_u *font_name, int fontset)
GetFontInfo(&font_info);
gui.char_ascent = font_info.ascent;
gui.char_width = CharWidth('_');
gui.char_width = p_columnspace + CharWidth('_');
gui.char_height = font_info.ascent + font_info.descent + p_linespace;
#ifdef USE_ATSUI_DRAWING
@@ -3534,6 +3534,16 @@ gui_mch_adjust_charheight(void)
return OK;
}
/*
* Adjust gui.char_width (after 'columnspace' was changed).
*/
int
gui_mch_adjust_charwidth(void)
{
gui.char_width = p_columnspace + CharWidth('_');
return OK;
}
/*
* Get a font structure for highlighting.
*/
+15 -1
View File
@@ -2627,7 +2627,9 @@ gui_mch_set_curtab(int nr)
void
ex_simalt(exarg_T *eap)
{
char_u *keys = eap->arg;
char_u *keys = eap->arg;
int fill_typebuf = FALSE;
char_u key_name[4];
PostMessage(s_hwnd, WM_SYSCOMMAND, (WPARAM)SC_KEYMENU, (LPARAM)0);
while (*keys)
@@ -2636,6 +2638,18 @@ ex_simalt(exarg_T *eap)
*keys = ' '; /* for showing system menu */
PostMessage(s_hwnd, WM_CHAR, (WPARAM)*keys, (LPARAM)0);
keys++;
fill_typebuf = TRUE;
}
if (fill_typebuf)
{
/* Put a NOP in the typeahead buffer so that the message will get
* processed. */
key_name[0] = K_SPECIAL;
key_name[1] = KS_EXTRA;
key_name[2] = KE_NOP;
key_name[3] = NUL;
typebuf_was_filled = TRUE;
(void)ins_typebuf(key_name, REMAP_NONE, 0, TRUE, FALSE);
}
}
+2 -6
View File
@@ -1136,9 +1136,7 @@ perl_to_vim(SV *sv, typval_T *rettv)
}
}
list->lv_refcount++;
rettv->v_type = VAR_LIST;
rettv->vval.v_list = list;
rettv_list_set(rettv, list);
break;
}
case SVt_PVHV: /* dictionary */
@@ -1192,9 +1190,7 @@ perl_to_vim(SV *sv, typval_T *rettv)
}
}
dict->dv_refcount++;
rettv->v_type = VAR_DICT;
rettv->vval.v_dict = dict;
rettv_dict_set(rettv, dict);
break;
}
default: /* not convertible */
+501
View File
@@ -0,0 +1,501 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2013-12-25.23; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# 'make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
tab=' '
nl='
'
IFS=" $tab$nl"
# Set DOITPROG to "echo" to test this script.
doit=${DOITPROG-}
doit_exec=${doit:-exec}
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_mkdir=
# Desired mode of installed file.
mode=0755
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=
src=
dst=
dir_arg=
dst_arg=
copy_on_change=false
is_target_a_directory=possibly
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) ;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
-s) stripcmd=$stripprog;;
-t)
is_target_a_directory=always
dst_arg=$2
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
shift;;
-T) is_target_a_directory=never;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
# We allow the use of options -d and -T together, by making -d
# take the precedence; this is for compatibility with GNU install.
if test -n "$dir_arg"; then
if test -n "$dst_arg"; then
echo "$0: target directory not allowed when installing a directory." >&2
exit 1
fi
fi
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call 'install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
if test $# -gt 1 || test "$is_target_a_directory" = always; then
if test ! -d "$dst_arg"; then
echo "$0: $dst_arg: Is not a directory." >&2
exit 1
fi
fi
fi
if test -z "$dir_arg"; then
do_exit='(exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
trap "ret=130; $do_exit" 2
trap "ret=141; $do_exit" 13
trap "ret=143; $do_exit" 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names problematic for 'test' and other utilities.
case $src in
-* | [=\(\)!]) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test "$is_target_a_directory" = never; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
dstdir=`dirname "$dst"`
test -d "$dstdir"
dstdir_status=$?
fi
fi
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
[-=\(\)!]*) prefix='./';;
*) prefix='';;
esac
oIFS=$IFS
IFS=/
set -f
set fnord $dstdir
shift
set +f
IFS=$oIFS
prefixes=
for d
do
test X"$d" = X && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
+1 -1
View File
@@ -39,7 +39,7 @@ tutorsubloc=$scriptloc/tutor
if test $what = "install" -o $what = "xxd"; then
if test ! -d $destdir; then
echo creating $destdir
./mkinstalldirs $destdir
/bin/sh install-sh -c -d $destdir
fi
fi
+1 -1
View File
@@ -49,7 +49,7 @@ eviewname=$9
if test $what = "install" -a \( -f $destdir/$vimname.1 -o -f $destdir/$vimdiffname.1 -o -f $destdir/$eviewname.1 \); then
if test ! -d $destdir; then
echo creating $destdir
./mkinstalldirs $destdir
/bin/sh install-sh -c -d $destdir
fi
# ex
+14 -8
View File
@@ -97,13 +97,23 @@ rettv_list_alloc(typval_T *rettv)
if (l == NULL)
return FAIL;
rettv->vval.v_list = l;
rettv->v_type = VAR_LIST;
rettv->v_lock = 0;
++l->lv_refcount;
rettv_list_set(rettv, l);
return OK;
}
/*
* Set a list as the return value
*/
void
rettv_list_set(typval_T *rettv, list_T *l)
{
rettv->v_type = VAR_LIST;
rettv->vval.v_list = l;
if (l != NULL)
++l->lv_refcount;
}
/*
* Unreference a list: decrement the reference count and free it when it
* becomes zero.
@@ -875,11 +885,7 @@ failret:
*arg = skipwhite(*arg + 1);
if (evaluate)
{
rettv->v_type = VAR_LIST;
rettv->vval.v_list = l;
++l->lv_refcount;
}
rettv_list_set(rettv, l);
return OK;
}
+18 -9
View File
@@ -89,15 +89,16 @@ static char *(main_errors[]) =
};
#ifndef PROTO /* don't want a prototype for main() */
/* Various parameters passed between main() and other functions. */
static mparm_T params;
#ifndef NO_VIM_MAIN /* skip this for unittests */
static char_u *start_dir = NULL; /* current working dir on startup */
static int has_dash_c_arg = FALSE;
/* Various parameters passed between main() and other functions. */
static mparm_T params;
int
# ifdef VIMDLL
_export
@@ -688,12 +689,6 @@ vim_main2(void)
starttermcap(); /* start termcap if not done by wait_return() */
TIME_MSG("start termcap");
#if defined(FEAT_TERMRESPONSE)
# if defined(FEAT_MBYTE)
may_req_ambiguous_char_width();
# endif
may_req_bg_color();
#endif
#ifdef FEAT_MOUSE
setmouse(); /* may start using the mouse */
@@ -850,6 +845,11 @@ vim_main2(void)
/* Requesting the termresponse is postponed until here, so that a "-c q"
* argument doesn't make it appear in the shell Vim was started from. */
may_req_termresponse();
# if defined(FEAT_MBYTE)
may_req_ambiguous_char_width();
# endif
may_req_bg_color();
#endif
/* start in insert mode */
@@ -1075,6 +1075,15 @@ common_init(mparm_T *paramp)
#endif
}
/*
* Return TRUE when the --not-a-term argument was found.
*/
int
is_not_a_term()
{
return params.not_a_term;
}
/*
* Main loop: Execute Normal mode commands until exiting Vim.
* Also used to handle commands in the command-line window, until the window
+1 -1
View File
@@ -315,7 +315,7 @@ trunc_string(
for (;;)
{
do
half = half - (*mb_head_off)(s, s + half - 1) - 1;
half = half - utf_head_off(s, s + half - 1) - 1;
while (half > 0 && utf_iscomposing(utf_ptr2char(s + half)));
n = ptr2cells(s + half);
if (len + n > room || half == 0)
-2
View File
@@ -96,8 +96,6 @@ test_trunc_string(void)
int
main(int argc, char **argv)
{
mparm_T params;
vim_memset(&params, 0, sizeof(params));
params.argc = argc;
params.argv = argv;
+12 -2
View File
@@ -9257,7 +9257,8 @@ find_match(int lookfor, linenr_T ourscope)
int
get_expr_indent(void)
{
int indent;
int indent = -1;
char_u *inde_copy;
pos_T save_pos;
colnr_T save_curswant;
int save_set_curswant;
@@ -9274,7 +9275,16 @@ get_expr_indent(void)
if (use_sandbox)
++sandbox;
++textlock;
indent = (int)eval_to_number(curbuf->b_p_inde);
/* Need to make a copy, the 'indentexpr' option could be changed while
* evaluating it. */
inde_copy = vim_strsave(curbuf->b_p_inde);
if (inde_copy != NULL)
{
indent = (int)eval_to_number(inde_copy);
vim_free(inde_copy);
}
if (use_sandbox)
--sandbox;
--textlock;
+2 -2
View File
@@ -1874,7 +1874,7 @@ vim_strchr(char_u *string, int c)
{
while (*p != NUL)
{
int l = (*mb_ptr2len)(p);
int l = utfc_ptr2len(p);
/* Avoid matching an illegal byte here. */
if (utf_ptr2char(p) == c && l > 1)
@@ -2129,7 +2129,7 @@ ga_concat(garray_T *gap, char_u *s)
{
int len;
if (s == NULL)
if (s == NULL || *s == NUL)
return;
len = (int)STRLEN(s);
if (ga_grow(gap, len) == OK)
-38
View File
@@ -1,38 +0,0 @@
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain
errstatus=0
for file
do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
for d
do
pathcomp="$pathcomp$d"
case "$pathcomp" in
-* ) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp" 1>&2
mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
errstatus=$lasterr
fi
fi
pathcomp="$pathcomp/"
done
done
exit $errstatus
# mkinstalldirs ends here
+4 -5
View File
@@ -203,11 +203,9 @@ update_topline(void)
int save_so = p_so;
#endif
if (!screen_valid(TRUE))
return;
/* If the window height is zero just use the cursor line. */
if (curwin->w_height == 0)
/* If there is no valid screen and when the window height is zero just use
* the cursor line. */
if (!screen_valid(TRUE) || curwin->w_height == 0)
{
curwin->w_topline = curwin->w_cursor.lnum;
curwin->w_botline = curwin->w_topline;
@@ -2621,6 +2619,7 @@ halfpage(int flag, linenr_T Prenum)
n = (curwin->w_p_scr <= curwin->w_height) ?
curwin->w_p_scr : curwin->w_height;
update_topline();
validate_botline();
room = curwin->w_empty_rows;
#ifdef FEAT_DIFF
+6
View File
@@ -4376,7 +4376,12 @@ find_decl(
if ((pos = findmatchlimit(NULL, '}', FM_FORWARD,
(int)(old_pos.lnum - curwin->w_cursor.lnum + 1))) != NULL
&& pos->lnum < old_pos.lnum)
{
/* There can't be a useful match before the end of this block.
* Skip to the end. */
curwin->w_cursor = *pos;
continue;
}
}
if (t == FAIL)
@@ -8345,6 +8350,7 @@ nv_g_cmd(cmdarg_T *cap)
break;
#endif
/* "g<": show scrollback text */
case '<':
show_sb_text();
break;
+1 -1
View File
@@ -6466,7 +6466,7 @@ clip_get_selection(VimClipboard *cbd)
VIsual = old_visual;
VIsual_mode = old_visual_mode;
}
else
else if (!is_clipboard_needs_update())
{
clip_free_selection(cbd);
+20 -2
View File
@@ -855,6 +855,13 @@ static struct vimoption options[] =
{"columns", "co", P_NUM|P_NODEFAULT|P_NO_MKRC|P_VI_DEF|P_RCLR,
(char_u *)&Columns, PV_NONE,
{(char_u *)80L, (char_u *)0L} SCRIPTID_INIT},
{"columnspace", "csp", P_NUM|P_VI_DEF|P_RCLR,
#ifdef FEAT_GUI_MACVIM
(char_u *)&p_columnspace, PV_NONE,
#else
(char_u *)NULL, PV_NONE,
#endif
{(char_u *)0L, (char_u *)0L} SCRIPTID_INIT},
{"comments", "com", P_STRING|P_ALLOCED|P_VI_DEF|P_ONECOMMA
|P_NODUP|P_CURSWANT,
#ifdef FEAT_COMMENTS
@@ -3264,6 +3271,7 @@ static struct vimoption options[] =
p_term("t_vi", T_VI)
p_term("t_vs", T_VS)
p_term("t_WP", T_CWP)
p_term("t_GP", T_CGP)
p_term("t_WS", T_CWS)
p_term("t_xn", T_XN)
p_term("t_xs", T_XS)
@@ -6521,7 +6529,7 @@ did_set_string_option(
#if defined(FEAT_XIM) && defined(FEAT_GUI_GTK)
else if (varp == &p_imak)
{
if (gui.in_use && !im_xim_isvalid_imactivate())
if (!im_xim_isvalid_imactivate())
errmsg = e_invarg;
}
#endif
@@ -8985,6 +8993,16 @@ set_num_option(
}
#endif
#ifdef FEAT_GUI_MACVIM
else if (pp == &p_columnspace)
{
/* Recompute gui.char_width and resize the Vim window to keep the
* same number of columns. */
if (gui.in_use && gui_mch_adjust_charwidth() == OK)
gui_set_shellsize(FALSE, FALSE, RESIZE_HOR);
}
#endif
#ifdef FEAT_FOLDING
/* 'foldlevel' */
else if (pp == &curwin->w_p_fdl)
@@ -11268,7 +11286,7 @@ buf_copy_options(buf_T *buf, int flags)
buf->b_p_ml = p_ml;
buf->b_p_ml_nobin = p_ml_nobin;
buf->b_p_inf = p_inf;
buf->b_p_swf = p_swf;
buf->b_p_swf = cmdmod.noswapfile ? FALSE : p_swf;
#ifdef FEAT_INS_EXPAND
buf->b_p_cpt = vim_strsave(p_cpt);
#endif
+1
View File
@@ -644,6 +644,7 @@ EXTERN int p_macatsui; /* 'macatsui' */
#ifdef FEAT_GUI_MACVIM
EXTERN int p_macligatures; /* 'macligatures' */
EXTERN int p_macthinstrokes; /* 'macthinstrokes' */
EXTERN long p_columnspace; /* 'columnspace' */
#endif
EXTERN int p_magic; /* 'magic' */
#ifdef FEAT_MBYTE
+9 -3
View File
@@ -511,7 +511,7 @@ mch_inchar(
|| interrupted
#endif
|| wait_time > 0
|| !did_start_blocking)
|| (wtime < 0 && !did_start_blocking))
continue;
/* no character available or interrupted */
@@ -6028,6 +6028,7 @@ mch_expand_wildcards(
{
int i;
size_t len;
long llen;
char_u *p;
int dir;
@@ -6314,9 +6315,13 @@ mch_expand_wildcards(
goto notfound;
}
fseek(fd, 0L, SEEK_END);
len = ftell(fd); /* get size of temp file */
llen = ftell(fd); /* get size of temp file */
fseek(fd, 0L, SEEK_SET);
buffer = alloc(len + 1);
if (llen < 0)
/* just in case ftell() would fail */
buffer = NULL;
else
buffer = alloc(llen + 1);
if (buffer == NULL)
{
/* out of memory */
@@ -6325,6 +6330,7 @@ mch_expand_wildcards(
fclose(fd);
return FAIL;
}
len = llen;
i = fread((char *)buffer, 1, len, fd);
fclose(fd);
mch_remove(tempname);
+1
View File
@@ -1,6 +1,7 @@
/* dict.c */
dict_T *dict_alloc(void);
int rettv_dict_alloc(typval_T *rettv);
void rettv_dict_set(typval_T *rettv, dict_T *d);
void dict_unref(dict_T *d);
int dict_free_nonref(int copyID);
void dict_free_items(int copyID);

Some files were not shown because too many files have changed in this diff Show More