Compare commits

...

155 Commits

Author SHA1 Message Date
Kazuki Sakamoto 54c198e2d1 MacVim Snapshot 146
Binary targets macOS 10.8+

- Vim patch 8.0.1633

Script interfaces have compatibility with these versions

- Lua 5.3
- Perl 5.16
- Python2 2.7
- Python3 3.6.4
- Ruby 2.5
2018-03-24 01:17:49 -07:00
Kazuki Sakamoto 6dea0a86d9 Merge pull request #656 from ichizok/fix/tui-screen
Fix drawing screen in the case of TUI
2018-03-24 01:03:39 -07:00
Kazuki Sakamoto 2288b39e05 Merge remote-tracking branch 'vim/master' 2018-03-23 21:28:01 -07:00
Bram Moolenaar 8c64a36e40 patch 8.0.1633: a TextChanged autocmd triggers when it is defined
Problem:    A TextChanged autocmd triggers when it is defined after creating a
            buffer.
Solution:   Set b_last_changedtick when opening a buffer. (Hirohito Highlight,
            closes #2742)
2018-03-23 22:39:31 +01:00
Bram Moolenaar 47015b80a0 patch 8.0.1632: in a terminal dump NUL and space are different
Problem:    In a terminal dump NUL and space considered are different,
            although they are displayed the same.
Solution:   When encountering NUL handle it like space.
2018-03-23 22:10:34 +01:00
Bram Moolenaar 948a796bfe patch 8.0.1631: testing with Vim running in terminal is a bit flaky
Problem:    Testing with Vim running in terminal is a bit flaky.
Solution:   Delete any .swp file so that later tests don't fail.
2018-03-23 20:37:45 +01:00
ichizok 994f163a73 Fix drawing the screen in the case of TUI 2018-03-23 19:07:38 +09:00
Bram Moolenaar 295ac5ab5e patch 8.0.1630: trimming white space is not that easy
Problem:    Trimming white space is not that easy.
Solution:   Add the trim() function. (Bukn, closes #1280)
2018-03-22 23:04:02 +01:00
Bram Moolenaar 62b7f6a139 patch 8.0.1629: Mac: getpagesize() is deprecated
Problem:    Mac: getpagesize() is deprecated.
Solution:   Use sysconf() instead. (Ozaki Kiichi, closes #2741)
2018-03-22 21:44:07 +01:00
Bram Moolenaar 0bd052ba12 patch 8.0.1628: channel log doesn't mention exiting
Problem:    Channel log doesn't mention exiting.
Solution:   Add a ch_log() call in getout().
2018-03-22 20:33:56 +01:00
Bram Moolenaar 7735dafb58 patch 8.0.1627: compiler warning for visibility attribute not supported
Problem:    Compiler warning for visibility attribute not supported on MinGW
            builds.
Solution:   Don't add the attribute when we don't expect it to work.
            (Christian Brabandt)
2018-03-22 20:26:50 +01:00
Kazuki Sakamoto 4b08a13191 Merge pull request #651 from ichizok/fix/gui-channel
Don't associate a single fd with both channel out and err
2018-03-22 07:13:09 -07:00
ichizok 14b995a71a Don't associate a single fd with both out and err
Or the order of ch-out and ch-err about dispatch-read and write-to-buffer
would be inconsistent.
2018-03-22 20:13:58 +09:00
Kazuki Sakamoto bdc1c5a229 Merge remote-tracking branch 'vim/master' 2018-03-21 19:27:15 -07:00
Bram Moolenaar b571c63d48 patch 8.0.1626: compiler warning for possible loss of data
Problem:    Compiler warning for possible loss of data.
Solution:   Use size_t instead of int. (Christian Brabandt)
2018-03-21 22:27:59 +01:00
Bram Moolenaar 29dfa5af3c patch 8.0.1625: test_quotestar is flaky when run in GTK GUI
Problem:    Test_quotestar is flaky when run in GTK GUI.
Solution:   Do not call lose_selection when invoked from
            selection_clear_event().
2018-03-20 21:24:45 +01:00
Bram Moolenaar 5a3a49ed59 patch 8.0.1624: options for term_dumpdiff() and term_dumpload() not implemented
Problem:    Options for term_dumpdiff() and term_dumpload() not implemented
            yet.
Solution:   Implement the relevant options.
2018-03-20 18:35:53 +01:00
Bram Moolenaar 3e8d385347 patch 8.0.1623: terminal kill tests are flaky
Problem:    Terminal kill tests are flaky.
Solution:   Instead of running Vim in a terminal, run it as a normal command.
2018-03-20 17:43:01 +01:00
Bram Moolenaar 6ed86ad170 patch 8.0.1622: possible NULL pointer dereference
Problem:    Possible NULL pointer dereferencey. (Coverity)
Solution:   Reverse the check for a NULL pointer.
2018-03-20 13:30:42 +01:00
Bram Moolenaar 6185903e3d patch 8.0.1621: using invalid default value for highlight attribute
Problem:    Using invalid default value for highlight attribute.
Solution:   Use zero instead of -1.
2018-03-20 13:00:25 +01:00
Bram Moolenaar e26e0d2b83 patch 8.0.1620: reading spell file has no good EOF detection
Problem:    Reading spell file has no good EOF detection.
Solution:   Check for EOF at every character read for a length field.
2018-03-20 12:34:04 +01:00
Bram Moolenaar 81c3c89a28 patch 8.0.1619: Win32 GUI: crash when winpty is not installed
Problem:    Win32 GUI: crash when winpty is not installed and trying to use
            :shell in a terminal window.
Solution:   Check for NULL return form term_start(). (Yasuhiro Matsumoto,
            closes #2727)
2018-03-20 11:41:44 +01:00
Bram Moolenaar ecadf4377f patch 8.0.1618: color Grey50 is missing in the compiled-in table
Problem:    Color Grey50, used for ToolbarLine, is missing in the compiled-in
            table.
Solution:   Add the color to the list. (Kazunobu Kuriyama)
2018-03-20 11:17:04 +01:00
Kazuki Sakamoto 5c0460f434 Merge pull request #653 from ichizok/fix/10.9-build
Fix build on earlier than 10.10
2018-03-19 22:16:13 -07:00
ichizok 8d36e468a8 Fix build on earlier than 10.10 2018-03-20 13:54:15 +09:00
Bram Moolenaar 42f652f733 patch 8.0.1617: Win32: :shell command in the GUI crashes
Problem:    Win32: :shell command in the GUI crashes.
Solution:   Handle the situation that "cmd" is NULL. (Yasuhiro Matsumoto,
            closes #2721)
2018-03-19 21:44:37 +01:00
Bram Moolenaar f05fa37822 patch 8.0.1616: Win32: shell commands in the GUI open a new console
Problem:    Win32: shell commands in the GUI open a new console.
Solution:   Use a terminal window for interactive use when 'guioptions'
            contains "!".
2018-03-18 19:29:34 +01:00
Bram Moolenaar 52acb110ac patch 8.0.1615: term_dumpload() does not use the right colors
Problem:    term_dumpload() does not use the right colors.
Solution:   Initialize colors when not using create_vterm().
2018-03-18 19:20:22 +01:00
Bram Moolenaar 98ef233e14 Update runtime files. Convert a couple of help files to utf-8. 2018-03-18 14:44:37 +01:00
Bram Moolenaar 9ef2a30e6f patch 8.0.1614: "make tags" doesn't include libvterm
Problem:    "make tags" doesn't include libvterm.
Solution:   Add the libvterm sources to the tags command.
2018-03-17 15:55:26 +01:00
Bram Moolenaar a2150ac016 patch 8.0.1613: warning for unused variable in tiny build
Problem:    Warning for unused variable in tiny build. (Tony Mechelynck)
Solution:   Move declaration to inner block.
2018-03-17 13:15:17 +01:00
Kazuki Sakamoto 74dc0c854a Merge remote-tracking branch 'vim/master' 2018-03-16 21:29:55 -07:00
Bram Moolenaar 1dd98334d6 patch 8.0.1612: need to close terminal after shell stopped
Problem:    Need to close terminal after shell stopped.
Solution:   Make :terminal without argument close the window by default.
2018-03-16 22:54:53 +01:00
Bram Moolenaar af23bad0fd patch 8.0.1611: CTRL-W in system terminal does not go to job
Problem:    CTRL-W in system terminal does not go to job.
Solution:   Do not use CTRL-W as a terminal command in a system terminal.
2018-03-16 22:20:49 +01:00
Bram Moolenaar 4ac31eeff0 patch 8.0.1610: cannot build without GUI
Problem:    Cannot build without GUI.
Solution:   Add #ifdef.
2018-03-16 21:34:25 +01:00
Bram Moolenaar 135682517b patch 8.0.1609: shell commands in the GUI use a dumb terminal
Problem:    Shell commands in the GUI use a dumb terminal.
Solution:   Add the "!" flag to 'guioptions' to execute system commands in a
            special terminal window.  Only for Unix now.
2018-03-16 20:46:58 +01:00
Kazuki Sakamoto d3c7694d7c Merge pull request #650 from ichizok/fix/travis
Fix CI build
2018-03-15 08:29:13 -07:00
ichizok bdc5e9df55 Revert "Revert Homebrew python change"
This reverts commit 47f76cb45f.
2018-03-15 22:35:29 +09:00
Kazuki Sakamoto ac2ffe903a Merge remote-tracking branch 'vim/master' 2018-03-14 21:26:54 -07:00
Bram Moolenaar 43cb626214 patch 8.0.1608: Win32: directx not enabled by default
Problem:    Win32: directx not enabled by default.
Solution:   Change Makefile to enable directx by default. (Ken Takata)
2018-03-14 21:39:02 +01:00
Bram Moolenaar 62dd452d02 patch 8.0.1607: --clean loads user settings from .gvimrc
Problem:    --clean loads user settings from .gvimrc.
Solution:   Behave like "-U NONE" was used. (Ken Takata)
2018-03-14 21:20:02 +01:00
Bram Moolenaar 228de1dfd2 patch 8.0.1606: singular/plural variants not translated
Problem:    Singular/plural variants not translated.
Solution:   Add NGETTEXT argument to xgettext. (Sergey Alyoshin)
2018-03-14 20:11:12 +01:00
Kazuki Sakamoto 47f76cb45f Revert Homebrew python change
- 00a64c6684
- 6bd9aa8f3d
- b1949f8ce0
2018-03-13 21:27:23 -07:00
Kazuki Sakamoto 2bf2752653 Merge remote-tracking branch 'vim/master' 2018-03-13 17:29:54 -07:00
Bram Moolenaar 012eb66293 patch 8.0.1605: terminal test is a bit flaky
Problem:    Terminal test is a bit flaky.
Solution:   Check for the shell prompt.  Use more lambda functions.
2018-03-13 17:55:27 +01:00
Bram Moolenaar a903472cfa patch 8.0.1604: paste test may fail if $DISPLAY is not set
Problem:    Paste test may fail if $DISPLAY is not set.
Solution:   Add WorkingClipboard() and use it in the paste test.
2018-03-13 15:43:46 +01:00
Bram Moolenaar f118d4847e patch 8.0.1603: cannot build with +terminal but without +menu
Problem:    Cannot build with +terminal but without +menu.
Solution:   Add #ifdef. (Damien)
2018-03-13 13:14:00 +01:00
Bram Moolenaar 625f0c1eb7 patch 8.0.1602: crash in parsing JSON
Problem:    Crash in parsing JSON.
Solution:   Fail when using array or dict as dict key. (Damien)
2018-03-13 13:10:41 +01:00
Kazuki Sakamoto f1c9c25d4a Merge remote-tracking branch 'vim/master' 2018-03-12 21:56:03 -07:00
Bram Moolenaar ff1e879577 patch 8.0.1601: highlight test fails on Win32
Problem:    Highlight test fails on Win32.
Solution:   Check for vtp and vcon support.
2018-03-12 22:16:37 +01:00
Bram Moolenaar f708ac592f patch 8.0.1600: crash when setting t_Co to zero when 'termguicolors' is set
Problem:    Crash when setting t_Co to zero when 'termguicolors' is set.
Solution:   Use IS_CTERM instead of checking the number of colors.
            (closes #2710)
2018-03-12 21:48:32 +01:00
Bram Moolenaar 3e4b84d0b5 patch 8.0.1599: no error message when gdb does not support debugger
Problem:    No error message when gdb does not support the terminal debugger.
Solution:   Check for the response to open the Machine Interface.
2018-03-11 20:51:52 +01:00
Bram Moolenaar c48369c3fc patch 8.0.1598: cannot select text in a terminal with the mouse
Problem:    Cannot select text in a terminal with the mouse.
Solution:   When a job in a terminal is not consuming mouse events, use them
            for modeless selection.  Also stop Insert mode when clicking in a
            terminal window.
2018-03-11 19:30:45 +01:00
Bram Moolenaar e87303af32 patch 8.0.1597: autocommand events are not sorted
Problem:    Autocommand events are not sorted.
Solution:   Sort the autocommand events.
2018-03-11 17:02:12 +01:00
Bram Moolenaar b852c3e64d patch 8.0.1596: no autocommand specifically for opening a terminal window
Problem:    No autocommand specifically for opening a terminal window.
Solution:   Add TerminalOpen. (?, closes #2484)
2018-03-11 16:55:36 +01:00
Bram Moolenaar 12a96de430 patch 8.0.1595: no autocommand triggered before exiting
Problem:    No autocommand triggered before exiting.
Solution:   Add the ExitPre autocommand event.
2018-03-11 14:44:18 +01:00
Bram Moolenaar 435acdb88c patch 8.0.1594: :conform qall not tested with active terminal window
Problem:    :conform qall not tested with active terminal window.
Solution:   Add a test.
2018-03-10 20:51:25 +01:00
Bram Moolenaar 25cdd9c33b patch 8.0.1593: :qall never exits with an active terminal window
Problem:    :qall never exits with an active terminal window.
Solution:   Add a way to kill a job in a terminal window.
2018-03-10 20:28:12 +01:00
Bram Moolenaar b5b7562475 Update runtime files. 2018-03-09 22:22:21 +01:00
Bram Moolenaar 4d8bac8bf5 patch 8.0.1592: terminal windows in a session are not properly restored
Problem:    Terminal windows in a session are not properly restored.
Solution:   Add "terminal" in 'sessionoptions'.  When possible restore the
            command running in a terminal.
2018-03-09 21:33:34 +01:00
Kazuki Sakamoto 009fd881a3 Merge remote-tracking branch 'vim/master' 2018-03-08 22:57:19 -08:00
Bram Moolenaar 20586cb4f4 patch 8.0.1591: MS-Windows: when reparsing the arguments 'wildignore' matters
Problem:    MS-Windows: when reparsing the arguments 'wildignore' matters.
Solution:   Save and reset 'wildignore'. (Yasuhiro Matsumoto, closes #2702)
2018-03-08 22:03:14 +01:00
Bram Moolenaar 1a84024037 patch 8.0.1590: padding in list type wastes memory
Problem:    Padding in list type wastes memory.
Solution:   Reorder struct members to optimize padding. (Dominique Pelle,
            closes #2704)
2018-03-08 21:46:43 +01:00
Kazuki Sakamoto 747560e259 Merge remote-tracking branch 'vim/master' 2018-03-07 18:52:59 -08:00
Bram Moolenaar d7db27bafd patch 8.0.1589: error for setting 'modifiable' when resetting it
Problem:    Error for setting 'modifiable' when resetting it.
Solution:   Check if 'modifiable' was actually set.
2018-03-07 23:02:33 +01:00
Bram Moolenaar 52f18a112a patch 8.0.1588: popup menu hangs after typing CTRL-C
Problem:    Popup menu hangs after typing CTRL-C.
Solution:   Make CTRL-C exit the loop. (Ozaki Kiichi, closes #2697)
2018-03-07 22:09:11 +01:00
Kazuki Sakamoto 2a65ccdf97 Merge pull request #646 from ichizok/fix/popup
Fix ex_popup for MacVim
2018-03-06 21:38:28 -08:00
ichizok cf88ba1d22 Fix ex_popup for MacVim 2018-03-07 14:14:25 +09:00
Kazuki Sakamoto 3440e0f9b5 Merge pull request #645 from ichizok/fix/old-style
Use ANSI style
2018-03-06 21:12:03 -08:00
Kazuki Sakamoto 08aae8d73b Merge remote-tracking branch 'vim/master' 2018-03-06 17:36:08 -08:00
Kazuki Sakamoto 2cc13f8793 Merge pull request #644 from prmtl/fix/merging-artifacts
Remove conflicts artefacts left after merging
2018-03-06 17:33:58 -08:00
Bram Moolenaar 3324d0a864 patch 8.0.1587: inserting from the clipboard doesn't work literally
Problem:    inserting from the clipboard doesn't work literally
Solution:   When pasting from the * or + register always assume literally.
2018-03-06 19:51:13 +01:00
Bram Moolenaar 201dc67db5 patch 8.0.1586: imactivatefunc does not work on non-GUI Mac
Problem:    Imactivatefunc does not work on non-GUI Mac.
Solution:   Fix logic in #ifdef.
2018-03-06 18:59:57 +01:00
Bram Moolenaar ebf142a1ed patch 8.0.1585: enabling beval_term feature in Win32 GUI
Problem:    Enabling beval_term feature in Win32 GUI.
Solution:   Only enable beval_term in Win32 console.
2018-03-06 18:20:03 +01:00
Bram Moolenaar f536bf6d45 patch 8.0.1584: using C99 in Mac file gives compiler warning messages
Problem:    Using C99 in Mac file gives compiler warning messages.
Solution:   Add #prama's to avoid the warnings. (Kazunobu Kuriyama)
2018-03-06 17:55:01 +01:00
Bram Moolenaar fc6f16b57c patch 8.0.1583: using C99 comment
Problem:    Using C99 comment.
Solution:   Use old style comment. (Kazunobu Kuriyama)
2018-03-06 17:43:22 +01:00
Bram Moolenaar 157d813be4 patch 8.0.1582: in the MS-Windows console mouse movement is not used
Problem:    In the MS-Windows console mouse movement is not used.
Solution:   Pass mouse movement events when useful.
2018-03-06 17:09:20 +01:00
Bram Moolenaar 3b3a9a5609 patch 8.0.1581: cannot build Win32 GUI without +eval
Problem:    Cannot build Win32 GUI without +eval.
Solution:   Define HAVE_INPUT_METHOD without +eval. (Ken Takata)
2018-03-06 16:11:47 +01:00
Bram Moolenaar 946acdac5b patch 8.0.1580: FEAT_CURSORBIND and FEAT_SCROLLBIND are unused
Problem:    FEAT_CURSORBIND and FEAT_SCROLLBIND are unused.
Solution:   Delete them.
2018-03-06 15:06:19 +01:00
Bram Moolenaar df0d24b627 patch 8.0.1579: virtual replace test fails in GUI
Problem:    Virtual replace test fails in GUI.
Solution:   Don't save key options if they were not set.
2018-03-06 14:22:58 +01:00
Bram Moolenaar 69f5a3011d patch 8.0.1578: no test for :popup in terminal
Problem:    No test for :popup in terminal.
Solution:   Add a screen dump test.
2018-03-06 13:23:08 +01:00
Bram Moolenaar e780848150 patch 8.0.1577: virtual replace test fails on MS-Windows
Problem:    Virtual replace test fails on MS-Windows.
Solution:   Make adding a termcap entry work for a builtin terminal.
            Restore terminal keys in a better way.
2018-03-06 13:17:23 +01:00
Bram Moolenaar 16896a1019 patch 8.0.1576: Perl VIM::Buffers() does not find every buffer
Problem:    Perl VIM::Buffers() does not find every buffer.
Solution:   Also find unlisted buffer by number or name. (Chris Weyl,
            closes #2692)
2018-03-06 12:25:56 +01:00
Bram Moolenaar 63e82db6fc patch 8.0.1575: crash when using virtual replace
Problem:    Crash when using virtual replace.
Solution:   Adjust orig_line_count.  Add more tests. (Christian Brabandt)
2018-03-06 12:10:48 +01:00
Bram Moolenaar 987723e084 patch 8.0.1574: show cursor in wrong place when using popup menu
Problem:    Show cursor in wrong place when using popup menu. (Wei Zhang)
Solution:   Force updating the cursor position.  Fix skipping over unused
            entries.
2018-03-06 11:43:04 +01:00
ichizok b0def641b7 Use ANSI style 2018-03-06 19:22:49 +09:00
Sebastian Kalinowski b5dae385de Remove conflicts artifacts left after merging
Fixes: #643
2018-03-06 09:47:50 +01:00
Kazuki Sakamoto 0248eca892 Merge remote-tracking branch 'vim/master' 2018-03-05 21:34:18 -08:00
Bram Moolenaar 89894aa671 patch 8.0.1573: getwinpos(1) may cause response to be handled as command
Problem:    getwinpos(1) may cause response to be handled as command.
Solution:   Handle any cursor position report once one was request. (partly by
            Hirohito Higashi)
2018-03-05 22:43:10 +01:00
Bram Moolenaar 362dc33835 patch 8.0.1572: Mac: getting memory size doesn't work everywhere
Problem:    Mac: getting memory size doesn't work everywhere.
Solution:   Use MACOS_X instead of MACOS_X_DARWIN. (Kazunobu Kuriyama)
2018-03-05 21:59:37 +01:00
Bram Moolenaar 40d77b0ec1 patch 8.0.1571: can't build without GUI
Problem:    Can't build without GUI.
Solution:   Adjust #ifdef for gui_find_menu().
2018-03-05 21:32:27 +01:00
Bram Moolenaar 29a2c08d79 patch 8.0.1570: can't use :popup for a menu in the terminal
Problem:    Can't use :popup for a menu in the terminal. (Wei Zhang)
Solution:   Make :popup work in the terminal.  Also fix that entries were
            included that don't work in the current state.
2018-03-05 21:06:23 +01:00
Bram Moolenaar 28ada699c1 patch 8.0.1569: warning for uninitialized variable from gcc
Problem:    Warning for uninitialized variable from gcc.
Solution:   Initialize the variable.
2018-03-05 12:42:42 +01:00
Bram Moolenaar 24fe475894 patch 8.0.1568: can't build on older Mac, header file is missing
Problem:    Can't build on older Mac, header file is missing.
Solution:   Remove the header file. (Ozaki Kiichi, closes #2691)
2018-03-05 10:54:53 +01:00
Kazuki Sakamoto b1949f8ce0 Workaround for travis python 2018-03-04 16:40:15 -08:00
Kazuki Sakamoto 6c6ffd7750 Merge remote-tracking branch 'vim/master' 2018-03-04 16:32:14 -08:00
Bram Moolenaar 6e35a11490 patch 8.0.1567: cannot build Win32 GUI without IME
Problem:    Cannot build Win32 GUI without IME. (John Marriott)
Solution:   Adjust when IME_WITHOUT_XIM and HAVE_INPUT_METHOD are defined and
            use it in a few more places.
2018-03-04 21:36:05 +01:00
Bram Moolenaar 8a3bb56230 patch 8.0.1566: too many #ifdefs
Problem:    Too many #ifdefs.
Solution:   Graduate FEAT_SCROLLBIND and FEAT_CURSORBIND.
2018-03-04 20:14:14 +01:00
Bram Moolenaar 107279c17b patch 8.0.1565: can't build Mac version without GUI
Problem:    Can't build Mac version without GUI.
Solution:   Adjust when IME_WITHOUT_XIM is defined.
2018-03-04 18:57:19 +01:00
Bram Moolenaar f2bd8ef2b4 patch 8.0.1564: too many #ifdefs
Problem:    Too many #ifdefs.
Solution:   Graduate the +autocmd feature. Takes away 450 #ifdefs and
            increases code size of tiny Vim by only 40 Kbyte.
2018-03-04 18:08:14 +01:00
Kazuki Sakamoto cbcc9df5d4 Merge remote-tracking branch 'vim/master' 2018-03-03 21:54:41 -08:00
Bram Moolenaar 3f54fd319f patch 8.0.1563: timeout of getwinposx() can be too short
Problem:    Timeout of getwinposx() can be too short. (lilydjwg)
Solution:   Add getwinpos(). (closes #2689)
2018-03-03 21:29:55 +01:00
Bram Moolenaar 71137fed4d patch 8.0.1562: the terminal debugger can't set a breakpoint with the mouse
Problem:    The terminal debugger can't set a breakpoint with the mouse.
Solution:   Add popup menu entries.
2018-03-03 20:47:21 +01:00
Bram Moolenaar 069dafc1de patch 8.0.1561: crash with rust syntax highligting
Problem:    Crash with rust syntax highligting. (Edd Barrett)
Solution:   Avoid going past the end of an empty line.
2018-03-03 20:02:19 +01:00
Bram Moolenaar 3767b61ad9 patch 8.0.1560: build failure without GUI on MS-Windows
Problem:    Build failure without GUI on MS-Windows.
Solution:   Adjust #ifdef for vcol2col().
2018-03-03 19:51:58 +01:00
Bram Moolenaar 658a154cbf patch 8.0.1559: build failure without GUI
Problem:    Build failure without GUI.
Solution:   Adjust #ifdef for get_fpos_of_mouse().
2018-03-03 19:29:43 +01:00
Bram Moolenaar aef8c3da2b patch 8.0.1558: no right-click menu in a terminal
Problem:    No right-click menu in a terminal.
Solution:   Implement the right click menu for the terminal.
2018-03-03 18:59:16 +01:00
Bram Moolenaar c71807db9c patch 8.0.1557: printf() does not work with only one argument
Problem:    printf() does not work with only one argument. (Daniel Hahler)
Solution:   Allow using just the format. (Ken Takata, closes #2687)
2018-03-03 15:06:52 +01:00
Bram Moolenaar 590ec878a5 patch 8.0.1556: may not parse the t_RS response correctly
Problem:    May not parse the t_RS response correctly, resulting in wrong
            characters in the input stream.
Solution:   When the t_RS response is partly received wait for more
            characters.
2018-03-02 20:58:42 +01:00
Kazuki Sakamoto 6bd9aa8f3d Workaround for travis python 2018-03-01 22:45:05 -08:00
Kazuki Sakamoto 00a64c6684 Sync Homebrew python change 2018-03-01 22:36:04 -08:00
Kazuki Sakamoto 82c9aa5fb1 Merge remote-tracking branch 'vim/master' 2018-03-01 22:00:45 -08:00
Bram Moolenaar 77780b66f4 patch 8.0.1555: build error for some combination of features
Problem:    Build error for some combination of features.
Solution:   Declare variable in more situations.
2018-03-01 23:10:45 +01:00
Bram Moolenaar 0726870326 patch 8.0.1554: custom plugins loaded with --clean
Problem:    Custom plugins loaded with --clean.
Solution:   Do not include the home directory in 'runtimepath'.
2018-03-01 21:57:32 +01:00
Kazuki Sakamoto 17c13c33a6 Merge remote-tracking branch 'vim/master' 2018-02-27 19:47:27 -08:00
Bram Moolenaar 5f73ef8d20 patch 8.0.1553: cannot see what digraph is used to insert a character
Problem:    Cannot see what digraph is used to insert a character.
Solution:   Show the digraph with the "ga" command. (Christian Brabandt)
2018-02-27 21:09:30 +01:00
Bram Moolenaar 8195247054 patch 8.0.1552: may leak file descriptors when executing job
Problem:    May leak file descriptors when executing job.
Solution:   Close more file descriptors. (Ozaki Kiichi, closes #2531)
2018-02-27 19:10:00 +01:00
Bram Moolenaar 988615f26f patch 8.0.1551: on Mac 'maxmemtot' is set to a weird value
Problem:    On Mac 'maxmemtot' is set to a weird value.
Solution:   For Mac use total memory and subtract system memory. For other
            systems accept both a 32 bit and 64 bit result. (Ozaki Kiichi,
            closes #2646)
2018-02-27 17:58:20 +01:00
Bram Moolenaar 792f0e3659 patch 8.0.1550: various small problems in source files
Problem:    Various small problems in source files.
Solution:   Fix the problems.
2018-02-27 17:27:13 +01:00
Bram Moolenaar 5d7ead3bc8 patch 8.0.1549: various small problems in test files
Problem:    Various small problems in test files.
Solution:   Include small changes.
2018-02-27 17:17:42 +01:00
Bram Moolenaar 3ad8772ef0 Include Serbian spell input files 2018-02-27 17:11:01 +01:00
Bram Moolenaar 75542ec9f6 patch 8.0.1548: screen dump test script not included in distribution
Problem:    Screen dump test script not included in distribution.
Solution:   Add the script to the list of distributed files.
2018-02-27 17:07:43 +01:00
Bram Moolenaar 9c474b2773 patch 8.0.1547: undo in the options window makes it empty
Problem:    Undo in the options window makes it empty.
Solution:   Set 'undolevels' while filling the buffer. (Yasuhiro Matthew,
            closes #2645)
2018-02-27 17:04:25 +01:00
Bram Moolenaar c8bcfe7efd patch 8.0.1546: using feedkeys() in a terminal may trigger mappings
Problem:    Using feedkeys() in a terminal window may trigger mappings.
            (Charles Sheridan)
Solution:   Avoid triggering a mapping when peeking for a key.
2018-02-27 16:29:28 +01:00
Bram Moolenaar 8226ac6b59 patch 8.0.1545: screen dumps not included in distribution
Problem:    Screen dumps not included in distribution.
Solution:   Add dumps to the list of distributed files.
2018-02-27 14:54:53 +01:00
Bram Moolenaar 22f1d0e35e Updated runtime files.
Add Serbian translations and spell checking.
2018-02-27 14:53:30 +01:00
Bram Moolenaar d4fc577e60 patch 8.0.1544: when using 'termguicolors' SpellBad doesn't show
Problem:    When using 'termguicolors' SpellBad doesn't show.
Solution:   When the GUI colors are not set fall back to the cterm colors.
2018-02-27 14:39:03 +01:00
Bram Moolenaar 33ef5bb0e4 patch 8.0.1543: with 'termguicolors' Normal color doesn't work correctly
Problem:    With 'termguicolors' Normal color doesn't work correctly.
Solution:   Set cterm_normal_bg_gui_color and cterm_normal_fg_color always.
            (Kazunobu Kuriyama, closes #981, closes #2332)
2018-02-27 13:04:59 +01:00
Kazuki Sakamoto 55e05146a9 Merge remote-tracking branch 'vim/master' 2018-02-25 19:07:36 -08:00
Bram Moolenaar 9271d058c9 patch 8.0.1542: terminal screen dump does not include cursor position
Problem:    Terminal screen dump does not include cursor position.
Solution:   Mark the cursor position in the cump.
2018-02-25 21:39:46 +01:00
Bram Moolenaar 36f923014a patch 8.0.1541: synpat_T is taking too much memory
Problem:    synpat_T is taking too much memory.
Solution:   Reorder members to reduce padding. (Dominique Pelle, closes #2671)
2018-02-24 21:36:34 +01:00
Bram Moolenaar 2b10bcbfc1 patch 8.0.1540: popup menu positioning fails with longer string
Problem:    Popup menu positioning fails with longer string.
Solution:   Only align with right side of window when width is less than
            'pumwidth' (closes #2661)
2018-02-24 21:25:44 +01:00
Bram Moolenaar 6bb2cdfe60 patch 8.0.1539: no test for the popup menu positioning
Problem:    No test for the popup menu positioning.
Solution:   Add a screendump test for the popup menu.
2018-02-24 19:53:53 +01:00
Kazuki Sakamoto b2c38a1932 Merge remote-tracking branch 'vim/master' 2018-02-24 10:08:07 -08:00
Bram Moolenaar bb008dd323 patch 8.0.1538: popupmenu is too far left when completion is long
Problem:    Popupmenu is too far left when completion is long. (Linwei)
Solution:   Adjust column computations. (Hirohito Higashi, closes #2661)
2018-02-24 18:59:55 +01:00
Kazuki Sakamoto d36056a922 Merge remote-tracking branch 'vim/master' 2018-02-24 09:59:05 -08:00
Bram Moolenaar 085346f5a1 patch 8.0.1537: xxd does not skip NUL lines when using ebcdic
Problem:    Xxd does not skip NUL lines when using ebcdic.
Solution:   Check for a NUL before converting a character for ebcdic. (Tim
            Sell, closes #2668)
2018-02-24 18:30:55 +01:00
Bram Moolenaar 791010e648 patch 8.0.1536: quotestar test is flaky when using the GUI
Problem:    Quotestar test is flaky when using the GUI.
Solution:   Add check that the star register arrived at the server.  Increase
            timeouts.
2018-02-24 17:42:28 +01:00
Bram Moolenaar 6acadda8d6 patch 8.0.1535: C syntax test still fails when using gvim
Problem:    C syntax test still fails when using gvim.
Solution:   Clear Normal cterm highlighting instead of setting it.
2018-02-24 16:51:32 +01:00
Bram Moolenaar b7ea7cb8e4 patch 8.0.1534: C syntax test fails when using gvim
Problem:    C syntax test fails when using gvim
Solution:   Force running in a terminal.  Check that 'background' is correct
            even when $COLORFGBG is set.
2018-02-24 14:38:51 +01:00
Bram Moolenaar 674e482d13 patch 8.0.1533: libterm doesn't support requesting fg and bg color
Problem:    Libterm doesn't support requesting fg and bg color.
Solution:   Implement t_RF and t_RB.
2018-02-24 14:03:56 +01:00
Bram Moolenaar cc0f2be880 patch 8.0.1532: compiler warnings without termguicolors feature
Problem:    Compiler warnings without termguicolors feature.
Solution:   Add #ifdef. (John Marriott)  Cleanup the code a bit.
2018-02-23 18:23:30 +01:00
Bram Moolenaar cafafb381a patch 8.0.1531: cannot use 24 bit colors in MS-Windows console
Problem:    Cannot use 24 bit colors in MS-Windows console.
Solution:   Add support for vcon. (Nobuhiro Takasaki, Ken Takasaki,
            fixes #1270, fixes #2060)
2018-02-22 21:07:09 +01:00
Bram Moolenaar 19eb6658ec patch 8.0.1530: dump test fails when using a shadow directory
Problem:    Dump test fails when using a shadow directory.
Solution:   Add the directory to the list of symlinks to make (Elimar
            Riesebieter)
2018-02-22 11:42:49 +01:00
Kazuki Sakamoto b317f73da5 Merge remote-tracking branch 'vim/master' 2018-02-20 20:45:23 -08:00
Bram Moolenaar 3049418f3d patch 8.0.1529: assert_equalfile() does not close file descriptors
Problem:    Assert_equalfile() does not close file descriptors. (Coverity)
Solution:   Close the file descriptors.
2018-02-20 21:46:05 +01:00
Bram Moolenaar 81226e0310 patch 8.0.1528: dead code found
Problem:    Dead code found.
Solution:   Remove the useless lines. (CodeAi, closes #2656)
2018-02-20 21:44:45 +01:00
Bram Moolenaar 3cc9f7440d patch 8.0.1527: screen dump test fails on MS-Windows
Problem:    Screen dump test fails on MS-Windows.
Solution:   Skip dump test on MS-Windows for now.
2018-02-20 17:09:16 +01:00
Bram Moolenaar da65058a9c patch 8.0.1526: no test using a screen dump yet
Problem:    No test using a screen dump yet.
Solution:   Add a test for C syntax highlighting.  Add helper functions.
2018-02-20 15:51:40 +01:00
Bram Moolenaar 7a76092a51 patch 8.0.1525: using :wqa exits even if a job runs in a terminal window
Problem:    Using :wqa exits even if a job runs in a terminal window. (Jason
            Felice)
Solution:   Check if a terminal has a running job. (closes #2654)
2018-02-19 23:10:02 +01:00
Bram Moolenaar 9c8816bd30 patch 8.0.1524: compiler warnings for uninitialized variables
Problem:    Compiler warnings for uninitialized variables. (Tony Mechelynck)
Solution:   Initialize variables.
2018-02-19 21:50:42 +01:00
Kazuki Sakamoto 8342385343 Merge remote-tracking branch 'vim/master' 2018-02-18 20:33:11 -08:00
Bram Moolenaar d96ff16511 patch 8.0.1523: cannot write and read terminal screendumps
Problem:    Cannot write and read terminal screendumps.
Solution:   Add term_dumpwrite(), term_dumpread() and term_dumpdiff().
            Also add assert_equalfile().
2018-02-18 22:13:29 +01:00
Kazuki Sakamoto 3ef9260632 Merge pull request #638 from ichizok/fix/terminal-close
Check the channels of finished-jobs
2018-02-18 10:44:08 -08:00
ichizok 1de2c89985 Check the channels of finished-jobs
On High Sierra, it appears that dispatch handler does not notify the
EOF event of pty, therefor we need check the channel of job on pty
(e.g. terminal) manually.
2018-02-19 00:26:41 +09:00
179 changed files with 14363 additions and 3028 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ sudo: false
before_install:
- brew update || brew update
- brew install python3
- brew upgrade python
- brew install lua
- brew install ruby
+2
View File
@@ -110,6 +110,7 @@ SRC_ALL = \
src/testdir/sautest/autoload/*.vim \
src/testdir/runtest.vim \
src/testdir/shared.vim \
src/testdir/screendump.vim \
src/testdir/view_util.vim \
src/testdir/setup.vim \
src/testdir/gui_init.vim \
@@ -134,6 +135,7 @@ SRC_ALL = \
src/testdir/pyxfile/*.py \
src/testdir/bench*.in \
src/testdir/bench*.vim \
src/testdir/dumps/*.dump \
src/testdir/samples/*.txt \
src/testdir/samples/test000 \
src/testdir/if_ver*.vim \
+31 -8
View File
@@ -1,4 +1,4 @@
*autocmd.txt* For Vim version 8.0. Last change: 2018 Feb 10
*autocmd.txt* For Vim version 8.0. Last change: 2018 Mar 15
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -21,7 +21,6 @@ For a basic explanation, see section |40.3| in the user manual.
11. Disabling autocommands |autocmd-disable|
{Vi does not have any of these commands}
{only when the |+autocmd| feature has not been disabled at compile time}
==============================================================================
1. Introduction *autocmd-intro*
@@ -57,6 +56,8 @@ effects. Be careful not to destroy your text.
Add {cmd} to the list of commands that Vim will
execute automatically on {event} for a file matching
{pat} |autocmd-patterns|.
Note: A quote character is seen as argument to the
:autocmd and won't start a comment.
Vim always adds the {cmd} after existing autocommands,
so that the autocommands execute in the order in which
they were given. See |autocmd-nested| for [nested].
@@ -92,7 +93,8 @@ will appear twice. To avoid this, define your autocommands in a group, so
that you can easily clear them: >
augroup vimrc
autocmd! " Remove all vimrc autocommands
" Remove all vimrc autocommands
autocmd!
au BufNewFile,BufRead *.html so <sfile>:h/html.vim
augroup END
@@ -146,6 +148,8 @@ prompt. When one command outputs two messages this can happen anyway.
plugins, syntax highlighting, etc.
:au[tocmd]! [group] Remove ALL autocommands.
Note: a quote will be seen as argument to the :autocmd
and won't start a comment.
Warning: You should normally not do this without a
group, it breaks plugins, syntax highlighting, etc.
@@ -258,6 +262,7 @@ Name triggered by ~
|BufCreate| just after adding a buffer to the buffer list
|BufDelete| before deleting a buffer from the buffer list
|BufWipeout| before completely deleting a buffer
|TerminalOpen| after a terminal buffer was created
|BufFilePre| before changing the name of the current buffer
|BufFilePost| after changing the name of the current buffer
@@ -286,7 +291,8 @@ Name triggered by ~
|GUIFailed| after starting the GUI failed
|TermResponse| after the terminal response to |t_RV| is received
|QuitPre| when using `:quit`, before deciding whether to quit
|QuitPre| when using `:quit`, before deciding whether to exit
|ExitPre| when using a command that may make Vim exit
|VimLeavePre| before exiting Vim, before writing the viminfo file
|VimLeave| before exiting Vim, after writing the viminfo file
@@ -324,6 +330,10 @@ Name triggered by ~
|CmdwinEnter| after entering the command-line window
|CmdwinLeave| before leaving the command-line window
|CmdlineChanged| after a change was made to the command-line text
|CmdlineEnter| after the cursor moves to the command line
|CmdlineLeave| before the cursor leaves the command line
|InsertEnter| starting Insert mode
|InsertChange| when typing <Insert> while in Insert or Replace mode
|InsertLeave| when leaving Insert mode
@@ -506,9 +516,9 @@ CmdUndefined When a user command is used but it isn't
always define the user command and have it
invoke an autoloaded function. See |autoload|.
*CmdlineChanged*
CmdlineChanged After a change was made to the text inside
command line. Be careful not to mess up the
command line, it may cause Vim to lock up.
CmdlineChanged After a change was made to the text in the
command line. Be careful not to mess up
the command line, it may cause Vim to lock up.
<afile> is set to a single character,
indicating the type of command-line.
|cmdwin-char|
@@ -648,6 +658,11 @@ DirChanged The working directory has changed in response
"auto" to trigger on 'autochdir'.
"drop" to trigger on editing a file
<afile> is set to the new directory name.
*ExitPre*
ExitPre When using `:quit`, `:wq` in a way it makes
Vim exit, or using `:qall`, just after
|QuitPre|. Can be used to close any
non-essential window.
*FileChangedShell*
FileChangedShell When Vim notices that the modification time of
a file has changed since editing started.
@@ -785,7 +800,7 @@ InsertCharPre When a character is typed in Insert mode,
inserted literally.
It is not allowed to change the text |textlock|.
The event is not triggered when 'paste' is
set.
set. {only with the +eval feature}
*InsertEnter*
InsertEnter Just before starting Insert mode. Also for
Replace mode and Virtual Replace mode. The
@@ -863,6 +878,7 @@ QuitPre When using `:quit`, `:wq` or `:qall`, before
or quits Vim. Can be used to close any
non-essential window if the current window is
the last ordinary window.
Also see |ExitPre|.
*RemoteReply*
RemoteReply When a reply from a Vim that functions as
server was received |server2client()|. The
@@ -931,6 +947,7 @@ SwapExists Detected an existing swap file when starting
It is not allowed to change to another buffer,
change a buffer name or change directory
here.
{only available with the +eval feature}
*Syntax*
Syntax When the 'syntax' option has been set. The
pattern is matched against the syntax name.
@@ -957,6 +974,11 @@ TermChanged After the value of 'term' has changed. Useful
for re-loading the syntax file to update the
colors, fonts and other terminal-dependent
settings. Executed for all loaded buffers.
*TerminalOpen*
TerminalOpen Just after a terminal buffer was created, with
`:terminal` or |term_start()|. This event is
triggered even if the buffer is created
without a window, with the ++hidden option.
*TermResponse*
TermResponse After the response to |t_RV| is received from
the terminal. The value of |v:termresponse|
@@ -1003,6 +1025,7 @@ TextYankPost After text has been yanked or deleted in the
called recursively.
It is not allowed to change the buffer text,
see |textlock|.
{only when compiled with the +eval feature}
*User*
User Never executed automatically. To be used for
autocommands that are only executed with
+3 -2
View File
@@ -1,4 +1,4 @@
*editing.txt* For Vim version 8.0. Last change: 2017 Nov 16
*editing.txt* For Vim version 8.0. Last change: 2018 Feb 19
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1202,7 +1202,8 @@ MULTIPLE WINDOWS AND BUFFERS *window-exit*
:wqa[ll]! [++opt]
:xa[ll]! Write all changed buffers, even the ones that are readonly,
and exit Vim. If there are buffers without a file name or
which cannot be written for another reason, Vim will not quit.
which cannot be written for another reason, or there is a
terminal with a running job, Vim will not quit.
{not in Vi}
==============================================================================
+168 -15
View File
@@ -1,4 +1,4 @@
*eval.txt* For Vim version 8.0. Last change: 2018 Feb 10
*eval.txt* For Vim version 8.0. Last change: 2018 Mar 20
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1246,8 +1246,8 @@ The arguments are optional. Example: >
*closure*
Lambda expressions can access outer scope variables and arguments. This is
often called a closure. Example where "i" and "a:arg" are used in a lambda
while they exist in the function scope. They remain valid even after the
function returns: >
while they already exist in the function scope. They remain valid even after
the function returns: >
:function Foo(arg)
: let i = 3
: return {x -> x + i - a:arg}
@@ -1256,7 +1256,10 @@ function returns: >
:echo Bar(6)
< 5
See also |:func-closure|. Lambda and closure support can be checked with: >
Note that the variables must exist in the outer scope before the lamba is
defined for this to work. See also |:func-closure|.
Lambda and closure support can be checked with: >
if has('lambda')
Examples for using a lambda expression with |sort()|, |map()| and |filter()|: >
@@ -2020,6 +2023,8 @@ argv() List the argument list
assert_beeps({cmd}) none assert {cmd} causes a beep
assert_equal({exp}, {act} [, {msg}])
none assert {exp} is equal to {act}
assert_equalfile({fname-one}, {fname-two})
none assert file contents is equal
assert_exception({error} [, {msg}])
none assert {error} is in v:exception
assert_fails({cmd} [, {error}]) none assert {cmd} fails
@@ -2187,8 +2192,9 @@ gettabvar({nr}, {varname} [, {def}])
gettabwinvar({tabnr}, {winnr}, {name} [, {def}])
any {name} in {winnr} in tab page {tabnr}
getwininfo([{winid}]) List list of windows
getwinposx() Number X coord in pixels of GUI Vim window
getwinposy() Number Y coord in pixels of GUI Vim window
getwinpos([{timeout}]) List X and Y coord in pixels of the Vim window
getwinposx() Number X coord in pixels of the Vim window
getwinposy() Number Y coord in pixels of the Vim window
getwinvar({nr}, {varname} [, {def}])
any variable {varname} in window {nr}
glob({expr} [, {nosuf} [, {list} [, {alllinks}]]])
@@ -2410,6 +2416,12 @@ tagfiles() List tags files used
tan({expr}) Float tangent of {expr}
tanh({expr}) Float hyperbolic tangent of {expr}
tempname() String name for a temporary file
term_dumpdiff({filename}, {filename} [, {options}])
Number display difference between two dumps
term_dumpload({filename} [, {options}])
Number displaying a screen dump
term_dumpwrite({buf}, {filename} [, {options}])
none dump terminal window contents
term_getaltscreen({buf}) Number get the alternate screen flag
term_getattr({attr}, {what}) Number get the value of attribute {what}
term_getcursor({buf}) List get the cursor position of a terminal
@@ -2423,6 +2435,8 @@ term_gettty({buf}, [{input}]) String get the tty name of a terminal
term_list() List get the list of terminal buffers
term_scrape({buf}, {row}) List get row of a terminal screen
term_sendkeys({buf}, {keys}) none send keystrokes to a terminal
term_setkill({buf}, {how}) none set signal to stop job in terminal
term_setrestore({buf}, {command}) none set command to restore terminal
term_start({cmd}, {options}) Job open a terminal window and run a job
term_wait({buf} [, {time}]) Number wait for screen to be updated
test_alloc_fail({id}, {countdown}, {repeat})
@@ -2449,6 +2463,7 @@ tolower({expr}) String the String {expr} switched to lowercase
toupper({expr}) String the String {expr} switched to uppercase
tr({src}, {fromstr}, {tostr}) String translate chars of {src} in {fromstr}
to chars in {tostr}
trim({text}[, {mask}]) String trim characters in {mask} from {text}
trunc({expr}) Float truncate Float {expr}
type({name}) Number type of variable {name}
undofile({name}) String undo file name for {name}
@@ -2590,6 +2605,14 @@ assert_equal({expected}, {actual} [, {msg}])
< Will result in a string to be added to |v:errors|:
test.vim line 12: Expected 'foo' but got 'bar' ~
*assert_equalfile()*
assert_equalfile({fname-one}, {fname-two})
When the files {fname-one} and {fname-two} do not contain
exactly the same text an error message is added to |v:errors|.
When {fname-one} or {fname-two} does not exist the error will
mention that.
Mainly useful with |terminal-diff|.
assert_exception({error} [, {msg}]) *assert_exception()*
When v:exception does not contain the string {error} an error
message is added to |v:errors|.
@@ -3150,8 +3173,8 @@ char2nr({expr} [, {utf8}]) *char2nr()*
char2nr("ABC") returns 65
< When {utf8} is omitted or zero, the current 'encoding' is used.
Example for "utf-8": >
char2nr("á") returns 225
char2nr("á"[0]) returns 195
char2nr("á") returns 225
char2nr("á"[0]) returns 195
< With {utf8} set to 1, always treat as utf-8 characters.
A combining character is a separate character.
|nr2char()| does the opposite.
@@ -4587,8 +4610,7 @@ getftype({fname}) *getftype()*
"file" are returned. On MS-Windows a symbolic link to a
directory returns "dir" instead of "link".
*getjumplist()*
getjumplist([{winnr} [, {tabnr}]])
getjumplist([{winnr} [, {tabnr}]]) *getjumplist()*
Returns the |jumplist| for the specified window.
Without arguments use the current window.
@@ -4859,17 +4881,37 @@ gettabwinvar({tabnr}, {winnr}, {varname} [, {def}]) *gettabwinvar()*
Examples: >
:let list_is_on = gettabwinvar(1, 2, '&list')
:echo "myvar = " . gettabwinvar(3, 1, 'myvar')
<
getwinpos([{timeout}]) *getwinpos()*
The result is a list with two numbers, the result of
getwinposx() and getwinposy() combined:
[x-pos, y-pos]
{timeout} can be used to specify how long to wait in msec for
a response from the terminal. When omitted 100 msec is used.
Use a longer time for a remote terminal.
When using a value less than 10 and no response is received
within that time, a previously reported position is returned,
if available. This can be used to poll for the position and
do some work in the mean time: >
while 1
let res = getwinpos(1)
if res[0] >= 0
break
endif
" Do some work here
endwhile
<
*getwinposx()*
getwinposx() The result is a Number, which is the X coordinate in pixels of
the left hand side of the GUI Vim window. Also works for an
xterm.
xterm (uses a timeout of 100 msec).
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. Also works for an xterm.
the top of the GUI Vim window. Also works for an xterm (uses
a timeout of 100 msec).
The result will be -1 if the information is not available.
The value can be used with `:winpos`.
@@ -6571,7 +6613,7 @@ remote_expr({server}, {string} [, {idvar} [, {timeout}]])
between (not at the end), like with join(expr, "\n").
If {idvar} is present and not empty, it is taken as the name
of a variable and a {serverid} for later use with
remote_read() is stored there.
|remote_read()| is stored there.
If {timeout} is given the read times out after this many
seconds. Otherwise a timeout of 600 seconds is used.
See also |clientserver| |RemoteReply|.
@@ -8135,6 +8177,70 @@ tempname() *tempname()* *temp-file-name*
For MS-Windows forward slashes are used when the 'shellslash'
option is set or when 'shellcmdflag' starts with '-'.
*term_dumpdiff()*
term_dumpdiff({filename}, {filename} [, {options}])
Open a new window displaying the difference between the two
files. The files must have been created with
|term_dumpwrite()|.
Returns the buffer number or zero when the diff fails.
Also see |terminal-diff|.
NOTE: this does not work with double-width characters yet.
The top part of the buffer contains the contents of the first
file, the bottom part of the buffer contains the contents of
the second file. The middle part shows the differences.
The parts are separated by a line of dashes.
If the {options} argument is present, it must be a Dict with
these possible members:
"term_name" name to use for the buffer name, instead
of the first file name.
"term_rows" vertical size to use for the terminal,
instead of using 'termsize'
"term_cols" horizontal size to use for the terminal,
instead of using 'termsize'
"vertical" split the window vertically
"curwin" use the current window, do not split the
window; fails if the current buffer
cannot be |abandon|ed
"norestore" do not add the terminal window to a
session file
Each character in the middle part indicates a difference. If
there are multiple differences only the first in this list is
used:
X different character
w different width
f different foreground color
b different background color
a different attribute
+ missing position in first file
- missing position in second file
Using the "s" key the top and bottom parts are swapped. This
makes it easy to spot a difference.
*term_dumpload()*
term_dumpload({filename} [, {options}])
Open a new window displaying the contents of {filename}
The file must have been created with |term_dumpwrite()|.
Returns the buffer number or zero when it fails.
Also see |terminal-diff|.
For {options} see |term_dumpdiff()|.
*term_dumpwrite()*
term_dumpwrite({buf}, {filename} [, {options}])
Dump the contents of the terminal screen of {buf} in the file
{filename}. This uses a format that can be used with
|term_dumpload()| and |term_dumpdiff()|.
If {filename} already exists an error is given. *E953*
Also see |terminal-diff|.
{options} is a dictionary with these optional entries:
"rows" maximum number of rows to dump
"columns" maximum number of columns to dump
term_getaltscreen({buf}) *term_getaltscreen()*
Returns 1 if the terminal of {buf} is using the alternate
screen.
@@ -8185,6 +8291,8 @@ term_getline({buf}, {row}) *term_getline()*
The first line has {row} one. When {row} is "." the cursor
line is used. When {row} is invalid an empty string is
returned.
To get attributes of each character use |term_scrape()|.
{only available when compiled with the |+terminal| feature}
term_getscrolled({buf}) *term_getscrolled()*
@@ -8270,6 +8378,28 @@ term_sendkeys({buf}, {keys}) *term_sendkeys()*
means the character CTRL-X.
{only available when compiled with the |+terminal| feature}
term_setkill({buf}, {how}) *term_setkill()*
When exiting Vim or trying to close the terminal window in
another way, {how} defines whether the job in the terminal can
be stopped.
When {how} is empty (the default), the job will not be
stopped, trying to exit will result in |E947|.
Otherwise, {how} specifies what signal to send to the job.
See |job_stop()| for the values.
After sending the signal Vim will wait for up to a second to
check that the job actually stopped.
term_setrestore({buf}, {command}) *term_setrestore()*
Set the command to write in a session file to restore the job
in this terminal. The line written in the session file is: >
terminal ++curwin ++cols=%d ++rows=%d {command}
< Make sure to escape the command properly.
Use an empty {command} to run 'shell'.
Use "NONE" to not restore this window.
{only available when compiled with the |+terminal| feature}
term_setsize({buf}, {expr}) *term_setsize()*
Not implemented yet.
{only available when compiled with the |+terminal| feature}
@@ -8313,6 +8443,10 @@ term_start({cmd}, {options}) *term_start()*
window; fails if the current buffer
cannot be |abandon|ed
"hidden" do not open a window
"norestore" do not add the terminal window to a
session file
"term_kill" what to do when trying to close the
terminal window, see |term_setkill()|
"term_finish" What to do when the job is finished:
"close": close any windows
"open": open window if needed
@@ -8526,6 +8660,22 @@ tr({src}, {fromstr}, {tostr}) *tr()*
echo tr("<blob>", "<>", "{}")
< returns "{blob}"
trim({text}[, {mask}]) *trim()*
Return {text} as a String where any character in {mask} is
removed from the beginning and end of {text}.
If {mask} is not given, {mask} is all characters up to 0x20,
which includes Tab, space, NL and CR, plus the non-breaking
space character 0xa0.
This code deals with multibyte characters properly.
Examples: >
echo trim(" \r\t\t\r RESERVE \t \t\n\x0B\x0B")."_TAIL"
< returns "RESERVE_TAIL" >
echo trim("needrmvRESERVEnnneeedddrrmmmmvv", "ednmrv")
< returns "RESERVE" >
echo trim("rm<blob1><blob2><any_chars>rrmm<blob1><blob2><blob2>", "rm<blob1><blob2>")
< returns "any_chas"
trunc({expr}) *trunc()*
Return the largest integral value with magnitude less than or
equal to {expr} as a |Float| (truncate towards zero).
@@ -9108,6 +9258,8 @@ ttyout output is a terminal (tty)
unix Unix version of Vim. *+unix*
unnamedplus Compiled with support for "unnamedplus" in 'clipboard'
user_commands User-defined commands.
vcon Win32: Virtual console support is working, can use
'termguicolors'. Also see |+vtp|.
vertsplit Compiled with vertically split windows |:vsplit|.
vim_starting True while initial source'ing takes place. |startup|
*vim_starting*
@@ -9118,6 +9270,8 @@ visualextra Compiled with extra Visual mode commands.
|blockwise-operators|.
vms VMS version of Vim.
vreplace Compiled with |gR| and |gr| commands.
vtp Compiled for vcon support |+vtp| (check vcon to find
out if it works in the current console).
wildignore Compiled with 'wildignore' option.
wildmenu Compiled with 'wildmenu' option.
win32 Win32 version of Vim (MS-Windows 95 and later, 32 or
@@ -9356,8 +9510,7 @@ may be larger.
It is also possible to define a function without any arguments. You must
still supply the () then.
It is allowed to define another function inside a function
body.
It is allowed to define another function inside a function body.
*local-variables*
Inside a function local variables can be used. These will disappear when the
+12 -3
View File
@@ -1,4 +1,4 @@
*gui.txt* For Vim version 8.0. Last change: 2017 Nov 09
*gui.txt* For Vim version 8.0. Last change: 2018 Mar 06
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -134,7 +134,7 @@ task bar with the 'guiheadroom' option.
:winp[os]
Display current position of the top left corner of the GUI vim
window in pixels. Does not work in all versions.
Also see |getwinposx()| and |getwinposy()|.
Also see |getwinpos()|, |getwinposx()| and |getwinposy()|.
:winp[os] {X} {Y} *E466*
Put the GUI vim window at the given {X} and {Y} coordinates.
@@ -993,10 +993,15 @@ it behaves in a strange way.
:popu[p] {name} Popup the menu {name}. The menu named must
have at least one subentry, but need not
appear on the menu-bar (see |hidden-menus|).
{only available for Win32, MacVim, and GTK GUI}
{only available for Win32, MacVim, and GTK GUI
or in the terminal when compiled with
+insert_expand}
:popu[p]! {name} Like above, but use the position of the mouse
pointer instead of the cursor.
In the terminal this is the last known
position, which is usually at the last click
or release (mouse movement is irrelevalt).
Example: >
:popup File
@@ -1007,6 +1012,10 @@ pointer if ! was used). >
:popup ]Toolbar
This creates a popup menu that doesn't exist on the main menu-bar.
Note that in the GUI the :popup command will return immediately, before a
selection has been made. In the terminal the commands waits for the user to
make a selection.
Note that a menu that starts with ']' will not be displayed.
==============================================================================
+4 -1
View File
@@ -1,4 +1,4 @@
*if_ruby.txt* For Vim version 8.0. Last change: 2016 Sep 01
*if_ruby.txt* For Vim version 8.0. Last change: 2018 Mar 15
VIM REFERENCE MANUAL by Shugo Maeda
@@ -221,6 +221,9 @@ for sure edit "gvim.exe" and search for "ruby\d*.dll\c".
If you want to build Vim with RubyInstaller 1.9 or 2.X using MSVC, you need
some tricks. See the src/INSTALLpc.txt for detail.
If Vim is built with RubyInstaller 2.4 or later, you may also need to add
"C:\Ruby<version>\bin\ruby_builtin_dlls" to the PATH environment variable.
Unix ~
+51 -37
View File
@@ -1,4 +1,4 @@
*options.txt* For Vim version 8.0. Last change: 2018 Feb 03
*options.txt* For Vim version 8.0. Last change: 2018 Mar 13
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -50,7 +50,7 @@ achieve special effects. These options come in three forms:
:se[t] {option}&vi Reset option to its Vi default value. {not in Vi}
:se[t] {option}&vim Reset option to its Vim default value. {not in Vi}
:se[t] all& Set all options to their default value. The values of
:se[t] all& Set all options to their default value. The values of
these options are not changed:
all terminal options, starting with t_
'columns'
@@ -402,8 +402,8 @@ Setting the filetype
used to set the option value in, unless this is a help
window, in which case the window below help window is
used (skipping the option-window).
{not available when compiled without the |+eval| or
|+autocmd| features}
{not available when compiled without the |+eval|
feature}
*$HOME*
Using "~" is like using "$HOME", but it is only recognized at the start of an
@@ -1338,7 +1338,7 @@ A jump table for the options with a short description can be found at |Q_op|.
characters. It permits dynamic French paragraph
indentation (negative) or emphasizing the line
continuation (positive).
sbr Display the 'showbreak' value before applying the
sbr Display the 'showbreak' value before applying the
additional indent.
The default value for min is 20 and shift is 0.
@@ -1398,8 +1398,7 @@ A jump table for the options with a short description can be found at |Q_op|.
written
nowrite buffer which will not be written
acwrite buffer which will always be written with BufWriteCmd
autocommands. {not available when compiled without the
|+autocmd| feature}
autocommands.
quickfix quickfix buffer, contains list of errors |:cwindow|
or list of locations |:lwindow|
help help buffer (you are not supposed to set this
@@ -1831,7 +1830,7 @@ A jump table for the options with a short description can be found at |Q_op|.
'copyindent' + off don't copy indent structure
'cpoptions' & (all flags) Vi-compatible flags
'cscopepathcomp'+ 0 don't show directories in tags list
'cscoperelative'+ off
'cscoperelative'+ off don't use basename of path as prefix
'cscopetag' + off don't use cscope for ":tag"
'cscopetagorder'+ 0 see |cscopetagorder|
'cscopeverbose' + off see |cscopeverbose|
@@ -2489,8 +2488,6 @@ A jump table for the options with a short description can be found at |Q_op|.
'cursorbind' 'crb' boolean (default off)
local to window
{not in Vi}
{not available when compiled without the |+cursorbind|
feature}
When this option is set, as the cursor in the current
window moves other cursorbound windows (windows that also have
this option set) move their cursors to the corresponding line and
@@ -2941,8 +2938,6 @@ A jump table for the options with a short description can be found at |Q_op|.
'eventignore' 'ei' string (default "")
global
{not in Vi}
{not available when compiled without the |+autocmd|
feature}
A list of autocommand event names, which are to be ignored.
When set to "all" or when "all" is one of the items, all autocommand
events are ignored, autocommands will not be executed.
@@ -3191,8 +3186,6 @@ A jump table for the options with a short description can be found at |Q_op|.
'filetype' 'ft' string (default: "")
local to buffer
{not in Vi}
{not available when compiled without the |+autocmd|
feature}
When this option is set, the FileType autocommand event is triggered.
All autocommands that match with the value of this option will be
executed. Thus the value of 'filetype' is used in place of the file
@@ -3491,7 +3484,7 @@ A jump table for the options with a short description can be found at |Q_op|.
when internal formatting is used. Make sure the cursor is kept in the
same spot relative to the text then! The |mode()| function will
return "i" or "R" in this situation.
When the expression evaluates to non-zero Vim will fall back to using
the internal format mechanism.
@@ -3973,7 +3966,14 @@ A jump table for the options with a short description can be found at |Q_op|.
To avoid problems with flags that are added in the future, use the
"+=" and "-=" feature of ":set" |add-option-flags|.
Valid letters are as follows:
Valid characters are as follows:
*'go-!'*
'!' External commands are executed in a terminal window. Without
this flag the MS-Windows GUI will open a console window to
execute the command. The Unix GUI will simulate a dumb
terminal to list the command output.
The terminal window will be positioned at the bottom, and grow
upwards as needed.
*guioptions_a* *'go-a'*
'a' Autoselect: If present, then whenever VISUAL mode is started,
or the Visual area extended, Vim tries to become the owner of
@@ -5275,8 +5275,8 @@ A jump table for the options with a short description can be found at |Q_op|.
global or local to buffer |global-local|
{not in Vi}
Program to use for the ":make" command. See |:make_makeprg|.
This option may contain '%' and '#' characters (see |:_%| and |:_#|),
which are expanded to the current and alternate file name. Use |::S|
This option may contain '%' and '#' characters (see |:_%| and |:_#|),
which are expanded to the current and alternate file name. Use |::S|
to escape file names in case they contain special characters.
Environment variables are expanded |:set_env|. See |option-backslash|
about including spaces and backslashes.
@@ -5364,8 +5364,11 @@ A jump table for the options with a short description can be found at |Q_op|.
{not in Vi}
Maximum amount of memory (in Kbyte) to use for one buffer. When this
limit is reached allocating extra memory for a buffer will cause
other memory to be freed. The maximum usable value is about 2000000.
Use this to work without a limit. Also see 'maxmemtot'.
other memory to be freed.
The maximum usable value is about 2000000. Use this to work without a
limit.
The value is ignored when 'swapfile' is off.
Also see 'maxmemtot'.
*'maxmempattern'* *'mmp'*
'maxmempattern' 'mmp' number (default 1000)
@@ -5394,6 +5397,8 @@ A jump table for the options with a short description can be found at |Q_op|.
need more than 2 Gbyte for text editing? Keep in mind that text is
stored in the swap file, one can edit files > 2 Gbyte anyway. We do
need the memory to store undo info.
Buffers with 'swapfile' off still count to the total amount of memory
used.
Also see 'maxmem'.
*'menuitems'* *'mis'*
@@ -5490,6 +5495,8 @@ A jump table for the options with a short description can be found at |Q_op|.
an explanation.
When 'buftype' is "nowrite" or "nofile" this option may be set, but
will be ignored.
Note that the text may actually be the same, e.g. 'modified' is set
when using "rA" on an "A".
*'more'* *'nomore'*
'more' boolean (Vim default: on, Vi default: off)
@@ -5578,6 +5585,8 @@ A jump table for the options with a short description can be found at |Q_op|.
In the "popup" model the right mouse button produces a pop-up menu.
You need to define this first, see |popup-menu|.
In a terminal the popup menu works if Vim is compiled with the
|+insert_expand| option.
Note that you can further refine the meaning of buttons with mappings.
See |gui-mouse-mapping|. But mappings are NOT used for modeless
@@ -6117,14 +6126,13 @@ A jump table for the options with a short description can be found at |Q_op|.
|ins-completion-menu|.
*'pumwidth'* *'pw'*
'pumwidth' 'pw' number (default 0)
'pumwidth' 'pw' number (default 15)
global
{not available when compiled without the
|+insert_expand| feature}
{not in Vi}
Determines the minium width to use for the popup menu for Insert mode
completion. When zero the default of 15 screen cells is used.
|ins-completion-menu|.
Determines the minimum width to use for the popup menu for Insert mode
completion. |ins-completion-menu|.
*'pythondll'*
'pythondll' string (default depends on the build)
@@ -6279,7 +6287,7 @@ A jump table for the options with a short description can be found at |Q_op|.
characters are put before the number.
See |hl-LineNr| and |hl-CursorLineNr| for the highlighting used for
the number.
The number in front of the cursor line also depends on the value of
'number', see |number_relativenumber| for all combinations of the two
options.
@@ -6598,6 +6606,8 @@ A jump table for the options with a short description can be found at |Q_op|.
to find files which replace a distributed runtime files. You can put
a directory after $VIMRUNTIME to find files which add to distributed
runtime files.
When Vim is started with |--clean| the home directory entries are not
included.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
@@ -6616,8 +6626,6 @@ A jump table for the options with a short description can be found at |Q_op|.
'scrollbind' 'scb' boolean (default off)
local to window
{not in Vi}
{not available when compiled without the |+scrollbind|
feature}
See also |scroll-binding|. When this option is set, the current
window scrolls as other scrollbind windows (windows that also have
this option set) scroll. This option is useful for viewing the
@@ -6655,8 +6663,6 @@ A jump table for the options with a short description can be found at |Q_op|.
*'scrollopt'* *'sbo'*
'scrollopt' 'sbo' string (default "ver,jump")
global
{not available when compiled without the |+scrollbind|
feature}
{not in Vi}
This is a comma-separated list of words that specifies how
'scrollbind' windows should behave. 'sbo' stands for ScrollBind
@@ -6746,7 +6752,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'sessionoptions'* *'ssop'*
'sessionoptions' 'ssop' string (default: "blank,buffers,curdir,folds,
help,options,tabpages,winsize")
help,options,tabpages,winsize,terminal")
global
{not in Vi}
{not available when compiled without the |+mksession|
@@ -6778,6 +6784,7 @@ A jump table for the options with a short description can be found at |Q_op|.
tabpages all tab pages; without this only the current tab page
is restored, so that you can make a session for each
tab page separately
terminal include terminal windows where the command can be restored
unix with Unix end-of-line format (single <NL>), even when
on Windows or DOS
winpos position of the whole Vim window
@@ -7573,7 +7580,6 @@ A jump table for the options with a short description can be found at |Q_op|.
W F Preview window flag, text is ",PRV".
y F Type of file in the buffer, e.g., "[vim]". See 'filetype'.
Y F Type of file in the buffer, e.g., ",VIM". See 'filetype'.
{not available when compiled without |+autocmd| feature}
q S "[Quickfix List]", "[Location List]" or empty.
k S Value of "b:keymap_name" or 'keymap' when |:lmap| mappings are
being used: "<keymap>"
@@ -7718,6 +7724,7 @@ A jump table for the options with a short description can be found at |Q_op|.
Also see |swap-file| and |'swapsync'|.
If you want to open a new buffer without creating a swap file for it,
use the |:noswapfile| modifier.
See 'directory' for where the swap file is created.
This option is used together with 'bufhidden' and 'buftype' to
specify special kinds of buffers. See |special-buffers|.
@@ -8067,17 +8074,24 @@ A jump table for the options with a short description can be found at |Q_op|.
:set encoding=utf-8
< You need to do this when your system has no locale support for UTF-8.
*'termguicolors'* *'tgc'*
*'termguicolors'* *'tgc'* *E954*
'termguicolors' 'tgc' boolean (default off)
global
{not in Vi}
{not available when compiled without the
|+termguicolors| feature}
When on, uses |highlight-guifg| and |highlight-guibg| attributes in
the terminal (thus using 24-bit color). Requires a ISO-8613-3
compatible terminal.
If setting this option does not work (produces a colorless UI)
reading |xterm-true-color| might help.
the terminal (thus using 24-bit color).
Requires a ISO-8613-3 compatible terminal. If setting this option
does not work (produces a colorless UI) reading |xterm-true-color|
might help.
For Win32 console, Windows 10 version 1703 (Creators Update) or later
is required. Use this check to find out: >
if has('vcon')
< This requires Vim to be built with the |+vtp| feature.
Note that the "cterm" attributes are still used, not the "gui" ones.
NOTE: This option is reset when 'compatible' is set.
@@ -8164,7 +8178,7 @@ A jump table for the options with a short description can be found at |Q_op|.
non-keyword characters (white space is preferred). Maximum line
length is 510 bytes.
To obtain a file to be used here, check out this ftp site:
[Sorry this link doesn't work anymore, do you know the right one?]
[Sorry this link doesn't work anymore, do you know the right one?]
ftp://ftp.ox.ac.uk/pub/wordlists/ First get the README file.
To include a comma in a file name precede it with a backslash. Spaces
after a comma are ignored, otherwise spaces are included in the file
+3 -2
View File
@@ -1,4 +1,4 @@
*pattern.txt* For Vim version 8.0. Last change: 2018 Feb 04
*pattern.txt* For Vim version 8.0. Last change: 2018 Mar 13
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1166,7 +1166,8 @@ x A single character, with no special meaning, matches itself
- Matching with a collection can be slow, because each character in
the text has to be compared with each character in the collection.
Use one of the other atoms above when possible. Example: "\d" is
much faster than "[0-9]" and matches the same characters.
much faster than "[0-9]" and matches the same characters. However,
the new |NFA| regexp engine deals with this better than the old one.
*/\%[]* *E69* *E70* *E369*
\%[] A sequence of optionally matched atoms. This always matches.
+8 -9
View File
@@ -1,4 +1,4 @@
*quickfix.txt* For Vim version 8.0. Last change: 2017 Dec 13
*quickfix.txt* For Vim version 8.0. Last change: 2018 Mar 04
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -330,9 +330,9 @@ deleted for some reason, the message "line changed" is shown to warn you that
the error location may not be correct. If you quit Vim and start again the
marks are lost and the error locations may not be correct anymore.
If vim is built with |+autocmd| support, two autocommands are available for
running commands before and after a quickfix command (':make', ':grep' and so
on) is executed. See |QuickFixCmdPre| and |QuickFixCmdPost| for details.
Two autocommands are available for running commands before and after a
quickfix command (':make', ':grep' and so on) is executed. See
|QuickFixCmdPre| and |QuickFixCmdPost| for details.
*QuickFixCmdPost-example*
When 'encoding' differs from the locale, the error messages may have a
@@ -657,8 +657,8 @@ To get the number of the current list in the stack: >
4. Using :make *:make_makeprg*
*:mak* *:make*
:mak[e][!] [arguments] 1. If vim was built with |+autocmd|, all relevant
|QuickFixCmdPre| autocommands are executed.
:mak[e][!] [arguments] 1. All relevant |QuickFixCmdPre| autocommands are
executed.
2. If the 'autowrite' option is on, write any changed
buffers
3. An errorfile name is made from 'makeef'. If
@@ -670,9 +670,8 @@ To get the number of the current list in the stack: >
errorfile (for Unix it is also echoed on the
screen).
5. The errorfile is read using 'errorformat'.
6. If vim was built with |+autocmd|, all relevant
|QuickFixCmdPost| autocommands are executed.
See example below.
6. All relevant |QuickFixCmdPost| autocommands are
executed. See example below.
7. If [!] is not given the first error is jumped to.
8. The errorfile is deleted.
9. You can now move through the errors with commands
+2 -1
View File
@@ -1,4 +1,4 @@
*quickref.txt* For Vim version 8.0. Last change: 2018 Jan 31
*quickref.txt* For Vim version 8.0. Last change: 2018 Feb 11
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -845,6 +845,7 @@ Short explanation of each option: *option-list*
'printoptions' 'popt' controls the format of :hardcopy output
'prompt' 'prompt' enable prompt in Ex mode
'pumheight' 'ph' maximum height of the popup menu
'pumwidth' 'pw' minimum width of the popup menu
'pythondll' name of the Python 2 dynamic library
'pythonhome' name of the Python 2 home directory
'pythonthreedll' name of the Python 3 dynamic library
+3 -1
View File
@@ -1,4 +1,4 @@
*repeat.txt* For Vim version 8.0. Last change: 2017 Dec 17
*repeat.txt* For Vim version 8.0. Last change: 2018 Mar 04
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -265,6 +265,7 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
loaded during initialization, see |load-plugins|.
Also see |pack-add|.
{only available when compiled with +eval}
*:packl* *:packloadall*
:packl[oadall][!] Load all packages in the "start" directory under each
@@ -288,6 +289,7 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
An error only causes sourcing the script where it
happens to be aborted, further plugins will be loaded.
See |packages|.
{only available when compiled with +eval}
:scripte[ncoding] [encoding] *:scripte* *:scriptencoding* *E167*
Specify the character encoding used in the script.
+5 -3
View File
@@ -1,4 +1,4 @@
*starting.txt* For Vim version 8.0. Last change: 2018 Feb 09
*starting.txt* For Vim version 8.0. Last change: 2018 Mar 14
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -510,12 +510,14 @@ a slash. Thus "-R" means recovery and "-/R" readonly.
{not in Vi}
*--clean*
--clean Equal to "-u DEFAULTS -i NONE":
--clean Equal to "-u DEFAULTS -U NONE -i NONE":
- initializations from files and environment variables is
skipped
- the |defaults.vim| script is loaded, which implies
'nocompatible': use Vim defaults
- no |gvimrc| script is loaded
- no viminfo file is read or written
- the home directory is excluded from 'runtimepath'
*-x*
-x Use encryption to read/write files. Will prompt for a key,
which is then stored in the 'key' option. All writes will
@@ -1011,7 +1013,7 @@ Vi compatible default value ~
When Vim starts, the 'compatible' option is on. This will be used when Vim
starts its initializations. But as soon as:
- a user vimrc file is found, or
- a vimrc file in the current directoryis found, or
- a vimrc file in the current directory is found, or
- the "VIMINIT" environment variable is set, or
- the "-N" command line argument is given, or
- the "--clean" command line argument is given, or
+26
View File
@@ -302,6 +302,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
'gfw' options.txt /*'gfw'*
'ghr' options.txt /*'ghr'*
'go' options.txt /*'go'*
'go-!' options.txt /*'go-!'*
'go-A' options.txt /*'go-A'*
'go-F' options.txt /*'go-F'*
'go-L' options.txt /*'go-L'*
@@ -800,8 +801,10 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
'prompt' options.txt /*'prompt'*
'pt' options.txt /*'pt'*
'pumheight' options.txt /*'pumheight'*
'pumwidth' options.txt /*'pumwidth'*
'pvh' options.txt /*'pvh'*
'pvw' options.txt /*'pvw'*
'pw' options.txt /*'pw'*
'pythondll' options.txt /*'pythondll'*
'pythonhome' options.txt /*'pythonhome'*
'pythonthreedll' options.txt /*'pythonthreedll'*
@@ -1378,6 +1381,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
+visual various.txt /*+visual*
+visualextra various.txt /*+visualextra*
+vreplace various.txt /*+vreplace*
+vtp various.txt /*+vtp*
+wildignore various.txt /*+wildignore*
+wildmenu various.txt /*+wildmenu*
+windows various.txt /*+windows*
@@ -4637,6 +4641,8 @@ E95 message.txt /*E95*
E950 message.txt /*E950*
E951 pattern.txt /*E951*
E952 autocmd.txt /*E952*
E953 eval.txt /*E953*
E954 options.txt /*E954*
E96 diff.txt /*E96*
E97 diff.txt /*E97*
E98 diff.txt /*E98*
@@ -4648,6 +4654,7 @@ EncodingChanged autocmd.txt /*EncodingChanged*
Eterm syntax.txt /*Eterm*
Ex intro.txt /*Ex*
Ex-mode intro.txt /*Ex-mode*
ExitPre autocmd.txt /*ExitPre*
Exuberant_ctags tagsrch.txt /*Exuberant_ctags*
F motion.txt /*F*
FALSE eval.txt /*FALSE*
@@ -4880,8 +4887,10 @@ Tcl if_tcl.txt /*Tcl*
TermChanged autocmd.txt /*TermChanged*
TermResponse autocmd.txt /*TermResponse*
Terminal-mode terminal.txt /*Terminal-mode*
TerminalOpen autocmd.txt /*TerminalOpen*
TextChanged autocmd.txt /*TextChanged*
TextChangedI autocmd.txt /*TextChangedI*
TextChangedP autocmd.txt /*TextChangedP*
TextYankPost autocmd.txt /*TextYankPost*
Transact-SQL ft_sql.txt /*Transact-SQL*
U undo.txt /*U*
@@ -5143,7 +5152,9 @@ asin() eval.txt /*asin()*
asm.vim syntax.txt /*asm.vim*
asm68k syntax.txt /*asm68k*
asmh8300.vim syntax.txt /*asmh8300.vim*
assert_beeps() eval.txt /*assert_beeps()*
assert_equal() eval.txt /*assert_equal()*
assert_equalfile() eval.txt /*assert_equalfile()*
assert_exception() eval.txt /*assert_exception()*
assert_fails() eval.txt /*assert_fails()*
assert_false() eval.txt /*assert_false()*
@@ -6622,6 +6633,7 @@ get-ms-debuggers debug.txt /*get-ms-debuggers*
getbufinfo() eval.txt /*getbufinfo()*
getbufline() eval.txt /*getbufline()*
getbufvar() eval.txt /*getbufvar()*
getchangelist() eval.txt /*getchangelist()*
getchar() eval.txt /*getchar()*
getcharmod() eval.txt /*getcharmod()*
getcharsearch() eval.txt /*getcharsearch()*
@@ -6637,6 +6649,7 @@ getfperm() eval.txt /*getfperm()*
getfsize() eval.txt /*getfsize()*
getftime() eval.txt /*getftime()*
getftype() eval.txt /*getftype()*
getjumplist() eval.txt /*getjumplist()*
getlatestvimscripts-install pi_getscript.txt /*getlatestvimscripts-install*
getline() eval.txt /*getline()*
getloclist() eval.txt /*getloclist()*
@@ -6656,6 +6669,7 @@ gettabinfo() eval.txt /*gettabinfo()*
gettabvar() eval.txt /*gettabvar()*
gettabwinvar() eval.txt /*gettabwinvar()*
getwininfo() eval.txt /*getwininfo()*
getwinpos() eval.txt /*getwinpos()*
getwinposx() eval.txt /*getwinposx()*
getwinposy() eval.txt /*getwinposy()*
getwinvar() eval.txt /*getwinvar()*
@@ -8999,6 +9013,9 @@ term++open terminal.txt /*term++open*
term-dependent-settings term.txt /*term-dependent-settings*
term-list syntax.txt /*term-list*
term.txt term.txt /*term.txt*
term_dumpdiff() eval.txt /*term_dumpdiff()*
term_dumpload() eval.txt /*term_dumpload()*
term_dumpwrite() eval.txt /*term_dumpwrite()*
term_getaltscreen() eval.txt /*term_getaltscreen()*
term_getattr() eval.txt /*term_getattr()*
term_getcursor() eval.txt /*term_getcursor()*
@@ -9012,6 +9029,8 @@ term_gettty() eval.txt /*term_gettty()*
term_list() eval.txt /*term_list()*
term_scrape() eval.txt /*term_scrape()*
term_sendkeys() eval.txt /*term_sendkeys()*
term_setkill() eval.txt /*term_setkill()*
term_setrestore() eval.txt /*term_setrestore()*
term_setsize() eval.txt /*term_setsize()*
term_start() eval.txt /*term_start()*
term_wait() eval.txt /*term_wait()*
@@ -9029,10 +9048,15 @@ termdebug-example terminal.txt /*termdebug-example*
termdebug-starting terminal.txt /*termdebug-starting*
termdebug-stepping terminal.txt /*termdebug-stepping*
termdebug-variables terminal.txt /*termdebug-variables*
termdebug_popup terminal.txt /*termdebug_popup*
termdebug_wide terminal.txt /*termdebug_wide*
terminal terminal.txt /*terminal*
terminal-colors os_unix.txt /*terminal-colors*
terminal-cursor-style terminal.txt /*terminal-cursor-style*
terminal-debug terminal.txt /*terminal-debug*
terminal-diff terminal.txt /*terminal-diff*
terminal-diffscreendump terminal.txt /*terminal-diffscreendump*
terminal-dumptest terminal.txt /*terminal-dumptest*
terminal-functions usr_41.txt /*terminal-functions*
terminal-info term.txt /*terminal-info*
terminal-key-codes term.txt /*terminal-key-codes*
@@ -9040,6 +9064,8 @@ terminal-ms-windows terminal.txt /*terminal-ms-windows*
terminal-options term.txt /*terminal-options*
terminal-output-codes term.txt /*terminal-output-codes*
terminal-resizing terminal.txt /*terminal-resizing*
terminal-screendump terminal.txt /*terminal-screendump*
terminal-session terminal.txt /*terminal-session*
terminal-size-color terminal.txt /*terminal-size-color*
terminal-special-keys terminal.txt /*terminal-special-keys*
terminal-testing terminal.txt /*terminal-testing*
+212 -52
View File
@@ -1,4 +1,4 @@
*terminal.txt* For Vim version 8.0. Last change: 2018 Jan 28
*terminal.txt* For Vim version 8.0. Last change: 2018 Mar 16
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -7,36 +7,38 @@
Terminal window support *terminal*
WARNING: THIS IS ONLY PARTLY IMPLEMENTED, ANYTHING CAN STILL CHANGE
The terminal feature is optional, use this to check if your Vim has it: >
echo has('terminal')
If the result is "1" you have it.
1. Basic use |terminal-use|
Typing |terminal-typing|
Size and color |terminal-size-color|
Syntax |:terminal|
Resizing |terminal-resizing|
Terminal Modes |Terminal-mode|
Cursor style |terminal-cursor-style|
Special keys |terminal-special-keys|
Unix |terminal-unix|
MS-Windows |terminal-ms-windows|
2. Remote testing |terminal-testing|
3. Debugging |terminal-debug|
Starting |termdebug-starting|
Example session |termdebug-example|
Stepping through code |termdebug-stepping|
Inspecting variables |termdebug-variables|
Other commands |termdebug-commands|
Communication |termdebug-communication|
Customizing |termdebug-customizing|
1. Basic use |terminal-use|
Typing |terminal-typing|
Size and color |terminal-size-color|
Syntax |:terminal|
Resizing |terminal-resizing|
Terminal Modes |Terminal-mode|
Cursor style |terminal-cursor-style|
Special keys |terminal-special-keys|
Session |terminal-session|
Unix |terminal-unix|
MS-Windows |terminal-ms-windows|
2. Remote testing |terminal-testing|
3. Diffing screen dumps |terminal-diff|
Writing a screen dump test for Vim |terminal-dumptest|
Creating a screen dump |terminal-screendump|
Comparing screen dumps |terminal-diffscreendump|
4. Debugging |terminal-debug|
Starting |termdebug-starting|
Example session |termdebug-example|
Stepping through code |termdebug-stepping|
Inspecting variables |termdebug-variables|
Other commands |termdebug-commands|
Communication |termdebug-communication|
Customizing |termdebug-customizing|
{Vi does not have any of these commands}
{only available when compiled with the |+terminal| feature}
The terminal feature requires the |+multi_byte|, |+job| and |+channel| features.
==============================================================================
@@ -97,9 +99,14 @@ themselves (like Vim does).
To change the keys you type use terminal mode mappings, see |:tmap|.
These are defined like any mapping, but apply only when typing keys that are
sent to the job running in the terminal. For example, to make Escape switch
sent to the job running in the terminal. For example, to make F1 switch
to Terminal-Normal mode: >
tnoremap <F1> <C-W>N
You can use Esc, but you need to make sure it won't cause other keys to
break: >
tnoremap <Esc> <C-W>N
set notimeout ttimeout timeoutlen=100
< *options-in-terminal*
After opening the terminal window and setting 'buftype' to "terminal" the
BufWinEnter autocommand event is triggered. This makes it possible to set
@@ -138,6 +145,13 @@ Syntax ~
if [command] is NONE no job is started, the pty of the
terminal can be used by a command like gdb.
If [command] is missing the default behavior is to
close the terminal when the shell exits. This can be
changed with the ++noclose argument.
If [command] is present the default behavior is to
keep the terminal open in Terminal-Normal mode. This
can be changed with the ++close argument.
A new buffer will be created, using [command] or
'shell' as the name, prefixed with a "!". If a buffer
by this name already exists a number is added in
@@ -153,15 +167,25 @@ Syntax ~
Supported [options] are:
++close The terminal window will close
automatically when the job terminates.
++noclose The terminal window will NOT close
automatically when the job terminates.
++open When the job terminates and no window
shows it, a window will be opened.
Note that this can be interruptive.
The last of ++close, ++noclose and ++open
matters and rules out earlier arguments.
++curwin Open the terminal in the current
window, do not split the current
window. Fails if the current buffer
cannot be |abandon|ed.
++hidden Open the terminal in a hidden buffer,
no window will be used.
++norestore Do not include this terminal window
in a session file.
++kill={how} When trying to close the terminal
window kill the job with {how}. See
|term_setkill()| for the values.
++rows={height} Use {height} for the terminal window
height. If the terminal uses the full
Vim height (no window above or below
@@ -185,8 +209,12 @@ Syntax ~
If you want to use more options use the |term_start()|
function.
When the buffer associated with the terminal is unloaded or wiped out the job
is killed, similar to calling `job_stop(job, "kill")`
When the buffer associated with the terminal is forcibly unloaded or wiped out
the job is killed, similar to calling `job_stop(job, "kill")` .
Closing the window normally results in |E947|. When a kill method was set
with "++kill={how}" or |term_setkill()| then closing the window will use that
way to kill or interrupt the job. For example: >
:term ++kill=term tail -f /tmp/log
So long as the job is running the window behaves like it contains a modified
buffer. Trying to close the window with `CTRL-W :quit` fails. When using
@@ -285,6 +313,22 @@ is inverted. Since Vim cannot detect this, the terminal window cursor
blinking will also be inverted.
Session ~
*terminal-session*
A terminal window will be restored when using a session file, if possible and
wanted.
If "terminal" was removed from 'sessionoptions' then no terminal windows will
be restored.
If the job in the terminal was finished the window will not be restored.
If the terminal can be restored, the command that was used to open it will be
used again. To change this use the |term_setrestore()| function. This can
also be used to not restore a specific terminal by setting the command to
"NONE".
Special keys ~
*terminal-special-keys*
Since the terminal emulator simulates an xterm, only escape sequences that
@@ -360,7 +404,97 @@ term_scrape() inspect terminal screen
==============================================================================
3. Debugging *terminal-debug*
3. Diffing screen dumps *terminal-diff*
In some cases it can be bothersome to test that Vim displays the right
characters on the screen. E.g. with syntax highlighting. To make this
simpler it is possible to take a screen dump of a terminal and compare it to
an expected screen dump.
Vim uses the window size, text, color and other attributes as displayed. The
Vim screen size, font and other properties do not matter. Therefore this
mechanism is portable across systems. A conventional screenshot would reflect
all differences, including font size and family.
Writing a screen dump test for Vim ~
*terminal-dumptest*
For an example see the Test_syntax_c() function in
src/testdir/test_syntax.vim. The main parts are:
- Write a file you want to test with. This is useful for testing syntax
highlighting. You can also start Vim with en empty buffer.
- Run Vim in a terminal with a specific size. The default is 20 lines of 75
characters. This makes sure the dump is always this size. The function
RunVimInTerminal() takes care of this. Pass it the arguments for the Vim
command.
- Send any commands to Vim using term_sendkeys(). For example: >
call term_sendkeys(buf, ":echo &lines &columns\<CR>")
- Check that the screen is now in the expected state, using
VerifyScreenDump(). This expects the reference screen dump to be in the
src/testdir/dumps/ directory. Pass the name without ".dump". It is
recommended to use the name of the test function and a sequence number, so
that we know what test is using the file.
- Repeat sending commands and checking the state.
- Finally stop Vim by calling StopVimInTerminal().
The first time you do this you won't have a screen dump yet. Create an empty
file for now, e.g.: >
touch src/testdir/dumps/Test_function_name_01.dump
The test will then fail, giving you the command to compare the reference dump
and the failed dump, e.g.: >
call term_dumpdiff("Test_func.dump.failed", "dumps/Test_func.dump")
Use this command in Vim, with the current directory set to src/testdir.
Once you are satisfied with the test, move the failed dump in place of the
reference: >
:!mv Test_func.dump.failed dumps/Test_func.dump
Creating a screen dump ~
*terminal-screendump*
To create the screen dump, run Vim (or any other program) in a terminal and
make it show the desired state. Then use the term_dumpwrite() function to
create a screen dump file. For example: >
:call term_dumpwrite(77, "mysyntax.dump")
Here "77" is the buffer number of the terminal. Use `:ls!` to see it.
You can view the screen dump with term_dumpload(): >
:call term_dumpload("mysyntax.dump")
To verify that Vim still shows exactly the same screen, run Vim again with
exactly the same way to show the desired state. Then create a screen dump
again, using a different file name: >
:call term_dumpwrite(88, "test.dump")
To assert that the files are exactly the same use assert_equalfile(): >
call assert_equalfile("mysyntax.dump", "test.dump")
If there are differences then v:errors will contain the error message.
Comparing screen dumps ~
*terminal-diffscreendump*
assert_equalfile() does not make it easy to see what is different.
To spot the problem use term_dumpdiff(): >
call term_dumpdiff("mysyntax.dump", "test.dump")
This will open a window consisting of three parts:
1. The contents of the first dump
2. The difference between the first and second dump
3. The contents of the second dump
You can usually see what differs in the second part. Use the 'ruler' to
relate it to the position in the first or second dump.
Alternatively, press "s" to swap the first and second dump. Do this several
times so that you can spot the difference in the context of the text.
==============================================================================
4. Debugging *terminal-debug*
The Terminal debugging plugin can be used to debug a program with gdb and view
the source code in a Vim window. Since this is completely contained inside
@@ -387,7 +521,7 @@ program window A terminal window for the executed program. When "run" is
The current window is used to show the source code. When gdb pauses the
source file location will be displayed, if possible. A sign is used to
highlight the current position (using highlight group debugPC).
highlight the current position, using highlight group debugPC.
If the buffer in the current window is modified, another window will be opened
to display the current gdb position.
@@ -412,6 +546,7 @@ You should now have three windows:
source - where you started, has a window toolbar with buttons
gdb - you can type gdb commands here
program - the executed program will use this window
You can use CTRL-W CTRL-W or the mouse to move focus between windows.
Put focus on the gdb window and type: >
break ex_help
@@ -432,6 +567,8 @@ displayed:
This way you can inspect the value of local variables. You can also focus the
gdb window and use a "print" command, e.g.: >
print *eap
If mouse pointer movements are working, Vim will also show a balloon when the
mouse rests on text that can be evaluated by gdb.
Now go back to the source window and put the cursor on the first line after
the for loop, then type: >
@@ -467,38 +604,42 @@ Put focus on the gdb window to type commands there. Some common ones are:
- frame N go to the Nth stack frame
- continue continue execution
In the window showing the source code these commands can used to control gdb:
:Run [args] run the program with [args] or the previous arguments
:Arguments {args} set arguments for the next :Run
In the window showing the source code these commands can be used to control gdb:
`:Run` [args] run the program with [args] or the previous arguments
`:Arguments` {args} set arguments for the next `:Run`
:Break set a breakpoint at the current line; a sign will be displayed
:Delete delete a breakpoint at the current line
`:Break` set a breakpoint at the current line; a sign will be displayed
`:Clear` delete the breakpoint at the current line
:Step execute the gdb "step" command
:Over execute the gdb "next" command (:Next is a Vim command)
:Finish execute the gdb "finish" command
:Continue execute the gdb "continue" command
:Stop interrupt the program
`:Step` execute the gdb "step" command
`:Over` execute the gdb "next" command (`:Next` is a Vim command)
`:Finish` execute the gdb "finish" command
`:Continue` execute the gdb "continue" command
`:Stop` interrupt the program
If 'mouse' is set the plugin adds a window toolbar with these entries:
Step :Step
Next :Over
Finish :Finish
Cont :Continue
Stop :Stop
Eval :Evaluate
Step `:Step`
Next `:Over`
Finish `:Finish`
Cont `:Continue`
Stop `:Stop`
Eval `:Evaluate`
This way you can use the mouse to perform the most common commands. You need
to have the 'mouse' option set to enable mouse clicks.
You can add the window toolbar in other windows you open with: >
:Winbar
Inspecting variables ~
*termdebug-variables*
:Evaluate evaluate the expression under the cursor
K same
:Evaluate {expr} evaluate {expr}
:'<,'>Evaluate evaluate the Visually selected text
`:Evaluate` evaluate the expression under the cursor
`K` same
`:Evaluate` {expr} evaluate {expr}
`:'<,'>Evaluate` evaluate the Visually selected text
This is similar to using "print" in the gdb window.
You can usually shorten `:Evaluate` to `:Ev`.
Other commands ~
@@ -515,17 +656,22 @@ will break the debugger.
Customizing ~
*termdebug-customizing*
GDB command *termdebug-customizing*
To change the name of the gdb command, set the "termdebugger" variable before
invoking `:Termdebug`: >
let termdebugger = "mygdb"
< *gdb-version*
< *gdb-version*
Only debuggers fully compatible with gdb will work. Vim uses the GDB/MI
interface. This probably requires gdb version 7.12. if you get this error:
interface. The "new-ui" command requires gdb version 7.12 or later. if you
get this error:
Undefined command: "new-ui". Try "help".~
Then your gdb is too old.
*hl-debugPC* *hl-debugBreakpoint*
Colors *hl-debugPC* *hl-debugBreakpoint*
The color of the signs can be adjusted with these highlight groups:
- debugPC the current position
- debugBreakpoint a breakpoint
@@ -538,6 +684,20 @@ When 'background' is "dark":
hi debugPC term=reverse ctermbg=darkblue guibg=darkblue
hi debugBreakpoint term=reverse ctermbg=red guibg=red
Popup menu *termdebug_popup*
By default the Termdebug plugin sets 'mousemodel' to "popup_setpos" and adds
these entries to the popup menu:
Set breakpoint `:Break`
Clear breakpoint `:Clear`
Evaluate `:Evaluate`
If you don't want this then disable it with: >
let g:termdebug_popup = 0
Vim window width *termdebug_wide*
To change the width of the Vim window when debugging starts, and use a
vertical split: >
let g:termdebug_wide = 163
+131 -170
View File
@@ -1,4 +1,4 @@
*todo.txt* For Vim version 8.0. Last change: 2018 Feb 09
*todo.txt* For Vim version 8.0. Last change: 2018 Mar 16
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -35,125 +35,11 @@ entered there will not be repeated below, unless there is extra information.
*known-bugs*
-------------------- Known bugs and current work -----------------------
No maintainer for Vietnamese translations.
No maintainer for Simplified Chinese translations.
Terminal emulator window:
- Lots of stuff to implement, see src/terminal.c
- Improve debugger interface:
Include all debug features of Agide.
- Implement the right-click popup menu for the terminal. Can use the
completion popup menu code and mouse dragging.
Use it for "set breakpoint", "remove breakpoint", etc.
- get ideas from http://clewn.sf.net
- Look into the idevim plugin/script.
- Improve testing:
Make a screenshot of a terminal, store in a file.
Display a stored screenshot, display diff with another one.
Make a test that puts Vim in a specific state, make a screenshot and compare
with the expected screenshot. Set t_Co to 256.
+channel:
- get_job_options() isn't clear about what causes an error, often just returns
"invalid argument".
- Add a separate timeout for opening a socket. Currently it's fixed at 50
msec, which is too small for a remote connection. (tverniquet, #2130)
- Try out background make plugin:
https://github.com/AndrewVos/vim-make-background
- Problem with stderr on Windows? (Vincent Rischmann, 2016 Aug 31, #1026)
- Writing raw mode to a buffer should still handle NL characters as line
breaks. (Dmitry Zotikov, 2017 Aug 16)
- When out_cb executes :sleep, the close_cb may be invoked. (Daniel Hahler,
2016 Dec 11, #1320)
- Implement |job-term| ?
- Channel test fails with Motif. Sometimes kills the X11 server.
- When a message in the queue but there is no callback, drop it after a while?
Add timestamp to queued messages and callbacks with ID, remove after a
minute. Option to set the droptime.
- Add an option to drop text of very long lines? Default to 1 Mbyte.
- Add remark about undo sync, is there a way to force it?
- When starting a job, have an option to open the server socket, so we know
the port, and pass it to the command with --socket-fd {nr}. (Olaf Dabrunz,
Feb 9) How to do this on MS-Windows?
- For connection to server, a "keep open" flag would be useful. Retry
connecting in the main loop with zero timeout.
- job_start(): run job in a newly opened terminal (not a terminal window).
With xterm could use -S{pty}.
Although user could use "xterm -e 'cmd arg'".
Regexp problems:
- When search pattern has the base character both with and without combining
character, search fails. E.g. "รรีบ" in "การรีบรักใคร". (agguser, #2312)
- [:space:] only matches ASCII spaces. Add [:white:] for all space-like
characters, esp. including 0xa0. Use character class zero.
- Since 7.4.704 the old regex engine fails to match [[:print:]] in 0xf6.
(Manuel Ortega, 2016 Apr 24)
Test fails on Mac. Avoid using isalpha(), isalnum(), etc? Depends on
LC_CTYPE
- The old engine does not find a match for "/\%#=1\(\)\{80}", the new engine
matches everywhere.
- Using win_linetabsize() can still be slow. Cache the result, store col and
vcol. Reset them when moving to another line.
- Very slow with a long line and Ruby highlighting. (John Whitley, 2014 Dec 4)
- Bug with pattern: '\vblock (\d+)\.\n.*\d+%(\1)@<!\.$'
(Lech Lorens, 2014 Feb 3)
- Issue 164: freeze on regexp search.
- Ignorecase not handled properly for multi-byte characters. (Axel Bender,
2013 Dec 11)
- Using \@> and \?. (Brett Stahlman, 2013 Dec 21) Remark from Marcin
Szamotulski; Remark from Brett 2014 Jan 6 and 7.
- NFA regexp doesn't handle \%<v correctly. (Ingo Karkat, 2014 May 12)
- Does not work with NFA regexp engine:
\%u, \%x, \%o, \%d followed by a composing character
- Search for \%d0\+ may fail with E363. (Christian Brabandt, 2016 Oct 4)
- \%'[ does not work. '%'] does work. (Masaaki Nakamura, 2016 Apr 4)
- Bug relating to back references. (Ingo Karkat, 2014 Jul 24)
- New RE does not give an error for empty group: "\(\)\{2}" (Dominique Pelle,
2015 Feb 7)
- Using back reference before the capturing group sometimes works with the old
engine, can we do this with the new engine? E.g. with
"/\%(<\1>\)\@<=.*\%(<\/\(\w\+\)>\)\@=" matching text inside HTML tags.
This problem is probably the same: "\%(^\1.*$\n\)\@<=\(\d\+\).*$".
(guotuofeng, 2015 Jun 22)
- Strange matching with "\(Hello\n\)\@<=A". (Anas Syed, 2015 Feb 12)
- Problem with \v(A)@<=b+\1c. (Issue 334)
- Diff highlighting can be very slow. (Issue 309)
- Using %> for a virtual column has a check based on 'tabsize'. Better would
be to cache the result of win_linetabsize(col), storing both col and vcol,
and use them to decide whether win_linetabsize() needs to be called. Reset
col and vcol when moving to another line.
- this doesn't work: "syntax match ErrorMsg /.\%9l\%>20c\&\%<28c/". Leaving
out the \& works. Seems any column check after \& fails.
- Difference between two engines: ".*\zs\/\@>\/" on text "///"
(Chris Paul, 2016 Nov 13) New engine not greedy enough?
Another one: echom matchstr(" sdfsfsf\n sfdsdfsdf",'[^\n]*')
(2017 May 15, #1252)
Use vim_clear() in more places, instead of vim_free() and assigning NULL.
Include a few color schemes, based on popularity:
http://www.vim.org/scripts/script_search_results.php?keywords=&script_type=color+scheme&order_by=rating&direction=descending&search=search
http://vimawesome.com/?q=tag:color-scheme
Use names that indicate their appearance (Christian Brabandt, 2017 Aug 3)
- monokai - Xia Crusoe (2017 Aug 4)
- seoul256 - Christian Brabandt (2017 Aug 3)
- gruvbox - Christian Brabandt (2017 Aug 3) (simplified version from
Lifepillar, 2018 Jan 22, #2573)
- janah - Marco Hinz (2017 Aug 4)
- apprentice - Romain Lafourcade (2017 Aug 6) remarks about help file #1964
Suggested by Hiroki Kokubun:
- [Iceberg](https://github.com/cocopon/iceberg.vim) (my one)
- [hybrid](https://github.com/w0ng/vim-hybrid)
Include solarized color scheme?, it does not support termguicolors.
- Sanitized version of pablo (Lifepillar, 2017 Nov 21)
Reproducible:
invalid memory access in regexp with zero-width.
reproduced by Dominique, 2017 Dec 23
"silent! try" doesn't restore emsg_silent when an exception is thrown.
(Ben Reilly, 2018 Jan 5, #2531) Possible solution by Christian Brabandt, 2018
Jan 6.
- Still some stuff to implement and bugs to fix, see src/terminal.c
- Crash when using popup menu while balloon is visible?
- Test_terminal_qall_kill_func if flaky
- Drop options argument of term_dumpdiff() / termp_dumpload() ?
Mode message isn't updated on vertical split. (Alexei Averchenko, 2018 Feb 2,
#2611)
@@ -161,22 +47,27 @@ Mode message isn't updated on vertical split. (Alexei Averchenko, 2018 Feb 2,
Errors found with random data:
heap-buffer-overflow in alist_add (#2472)
Implement option_save() and option_restore().
Compiler warnings (geeknik, 2017 Oct 26):
- signed integer overflow in do_sub() (#2249)
- signed integer overflow in get_address() (#2248)
- signed integer overflow in getdecchrs() (#2254)
- undefined left shift in get_string_tv() (#2250)
Cursor in wrong screen line with WinBar. (#2362)
Fix by Christian Brabandt (2018 Jan 2)
Mouse pointer sticks to stop shape. Only on Windows GUI? #2709
balloon_show() does not work properly in the terminal. (Ben Jackson, 2017 Dec
20, #2481)
Also see #2352, want better control over balloon, perhaps set the position.
Patch to support hunspell. (Matej Cepl, Jan 2018, #2500)
Patch to include hunspell support. (Matej Cepl, 2017 Dec 26, #845)
Doesn't work on Windows yet.
Try out background make plugin:
https://github.com/AndrewVos/vim-make-background
or asyncmake:
https://github.com/yegappan/asyncmake
Add a ModeChanged autocommand that has an argument indicating the old and new
mode. Also used for switching Terminal mode.
Cursor in status line after search. (#2530)
@@ -184,35 +75,19 @@ Cursor in wrong position when line wraps. (#2540)
Alternative manpager.vim. (Enno, 2018 Jan 5, #2529)
Patch for minimum width of completion popup menu. (Christian Brabandt, 2018
Jan 3, #2314)
Patch to redraw instead of scroll for terminal window. (Ken Takata, #2010)
Patch to add "user_data" to completion items. (Ben Jackson, 2018 Feb 1, #2608,
closes #2508)
Patch to add TextChangedP, text changed while popup menu is visible. (Prabir
Shrestha, 2018 Jan 28, test added by Christian Brabandt)
Does setting 'cursorline' cause syntax highlighting to slow down? Perhaps is
mess up the cache? (Mike Lee Williams, 2018 Jan 27, #2539)
When using :packadd files under "later" are not used, which is inconsistent
with packages under "start". (xtal8, #1994)
Column number is wrong whsn using 'linebreak' and 'wrap'. (Keith Smiley, 2018
Column number is wrong when using 'linebreak' and 'wrap'. (Keith Smiley, 2018
Jan 15, #2555)
Patch to add getjumplist(). (Yegappan Lakshmanan, 2018 Feb 2, #2609)
Serbian translations. (Peseic, 2018 Jan 17)
Patch for problem with restoring screen on Windows. (Nobuhiro Takasaki, 2015
Sep 10) Update 2018 Jan 4 #2575
Alternate change by Ken Takata.
Check argument of systemlist(). (Pavlov)
Patch to parse ":line" in tags file and use it for search. (Daniel Hahler,
#2546)
No maintainer for Vietnamese translations.
No maintainer for Simplified Chinese translations.
When 'inchsearch' and 'hlsearch' are set /\v highlights everything.
Also see #2337
@@ -220,35 +95,29 @@ Also see #2337
Starting job with cwd option, when the directory does not exist, gives a
confusing error message. (Wang Shidong, 2018 Jan 2, #2519)
7 Add a watchpoint in the debug mode: An expression that breaks execution
when evaluating to non-zero. Add the "watchadd expr" command, stop when
the value of the expression changes. ":watchdel" deletes an item,
":watchlist" lists the items. (Charles Campbell)
Patch by Christian Brabandt, 2016 Jun 10, #859
7 Make "ga" show the digraph for a character, if it exists.
Patch from Christian Brabandt, 2011 Aug 19.
Patch to add "module" to quickfix entries. (Marcin Szamotulski, Coot, 2017 Jun
8, #1757) Now part of #2322. Or #2327? #1757 was re-opened, include that
first.
Add the debug command line history to viminfo.
Avoid that "sign unplace id" does a redraw right away, esp. when there is a
sequence of these commands. (Andy Stewart, 2018 Mar 16)
ch_sendraw() with long string does not try to read inbetween, which may cause
a deadlock if the reading side is waiting for the write to finish. (Nate
Bosch, 2018 Jan 13, #2548)
Add Makefiles to the runtime/spell directory tree, since nobody uses Aap.
Will have to explain the manual steps (downloading the .aff and .dic files,
applying the diff, etc.
User dictionary ~/.vim/spell/lang.utf-8.add not used for spell checking until a
word is re-added to it. (Matej Cepl, 2018 Feb 6)
Problem with mouse scroll in tmux. (fcying, #2419) Might be caused by patch
8.0.1309. Removing "held_button = MOUSE_RELEASE;" helps. (2018 Feb 5)
Patch for 24 bit color support in MS-Windows console, using vcon. (Nobuhiro
Takasaki, Ken Takata, 2017 Oct 1, #2060).
Does setting 'cursorline' cause syntax highlighting to slow down? Perhaps is
mess up the cache? (Mike Lee Williams, 2018 Jan 27, #2539)
Fold at end of the buffer behaves inconsistently. (James McCoy, 2017 Oct 9)
With foldmethod=syntax and nofoldenable comment highlighting isn't removed.
@@ -264,9 +133,15 @@ Also see #1689.
ml_get error when using a Python. (Yggdroot, 2017 Jun 1, #1737)
Lemonboy can reproduce (2017 Jun 5)
crash when removing an element while inside map(). (Nikolai Pavlov, 2018 Feb
17, #2652)
When 'virtualedit' is "all" and 'cursorcolumn' is set, the wrong column may be
highlighted. (van-de-bugger, 2018 Jan 23, #2576)
Patch to parse ":line" in tags file and use it for search. (Daniel Hahler,
#2546) Fixes #1057. Missing a test.
Patch to add winlayout() function. (Yegappan Lakshmanan, 2018 Jan 4)
No profile information for function that executes ":quit". (Daniel Hahler,
@@ -290,9 +165,6 @@ ml_get errors with buggy script. (Dominique, 2017 Apr 30)
Error in emsg with buggy script. (Dominique, 2017 Apr 30)
Patch to avoid clearing the intro message on Win32 console.
(Ken Takata, 2017 Nov 14)
Patch to fix encoding in print document name (Yasuhiro Matsumoto, 2017 Dec 20,
#2478)
@@ -302,9 +174,16 @@ Linse, 2017 Nov 14, #2336)
Join truncates xml comment. (Dmitrii Tcyganok, 2017 Dec 24, #2494)
Requires 'formatoptions' to include "j". (Gary Johnson, 2017 Dec 24)
Patch to support hunspell. (Matej Cepl, Jan 2018, #2500) Based on older patch
in #846)
Doesn't work on Windows yet. Not ready to included, hard coded paths.
When a timer is running and typing CTRL-R on the command line, it is not
redrawn properly. (xtal8, 2017 Oct 23, #2241)
In an optional package the "after" directory is not scanned?
(Renato Fabbri, 2018 Feb 22)
Universal solution to detect if t_RS is working, using cursor position.
Koichi Iwamoto, #2126
@@ -320,9 +199,6 @@ Ask whether to use Windows or Vim key behavior?
Patch for improving detecting Ruby on Mac in configure. (Ilya Mikhaltsou, 2017
Nov 21)
Add a ModeChanged autocommand that has an argument indicating the old and new
mode. Also used for switching Terminal mode.
When using command line window, CmdlineLeave is triggered without
CmdlineEnter. (xtal8, 2017 Oct 30, #2263)
Add some way to get the nested state. Although CmdwinEnter is obviously
@@ -365,9 +241,6 @@ Memory leaks in test_channel? (or is it because of fork())
Using uninitialized value in test_crypt.
Memory leaks in test_escaped_glob
Patch to clear background when "guibg=NONE" is used and 'termguicolors' is
set. (Nick Jensen, 2017 Nov 13, #2332, based on #981 by Kazunobu Kuriyama)
Patch to make gM move to middle of line. (Yasuhiro Matsumoto, Sep 8, #2070)
Cannot copy modeless selection when cursor is inside it. (lkintact, #2300)
@@ -415,6 +288,22 @@ Seems to happen when the selection is requested the second time, but before
clip_x11_convert_selection_cb() is invoked, thus in X library code.
Kazunobu Kuriyama is working on a proper fix. (2017 Jul 25)
Include a few color schemes, based on popularity:
http://www.vim.org/scripts/script_search_results.php?keywords=&script_type=color+scheme&order_by=rating&direction=descending&search=search
http://vimawesome.com/?q=tag:color-scheme
Use names that indicate their appearance (Christian Brabandt, 2017 Aug 3)
- monokai - Xia Crusoe (2017 Aug 4)
- seoul256 - Christian Brabandt (2017 Aug 3)
- gruvbox - Christian Brabandt (2017 Aug 3) (simplified version from
Lifepillar, 2018 Jan 22, #2573)
- janah - Marco Hinz (2017 Aug 4)
- apprentice - Romain Lafourcade (2017 Aug 6) remarks about help file #1964
Suggested by Hiroki Kokubun:
- [Iceberg](https://github.com/cocopon/iceberg.vim) (my one)
- [hybrid](https://github.com/w0ng/vim-hybrid)
Include solarized color scheme?, it does not support termguicolors.
- Sanitized version of pablo (Lifepillar, 2017 Nov 21)
Problem with three-piece comment. (Michael Lee, 2017 May 11, #1696)
Creating a partial with an autoload function is confused about the "self"
@@ -705,6 +594,78 @@ no longer support.
sort() is not stable when using numeric/float sort (Nikolay Pavlov, 2016 Sep
4#1038)
+channel:
- Add a separate timeout for opening a socket. Currently it's fixed at 50
msec, which is too small for a remote connection. (tverniquet, #2130)
- Problem with stderr on Windows? (Vincent Rischmann, 2016 Aug 31, #1026)
- Writing raw mode to a buffer should still handle NL characters as line
breaks. (Dmitry Zotikov, 2017 Aug 16)
- When out_cb executes :sleep, the close_cb may be invoked. (Daniel Hahler,
2016 Dec 11, #1320)
- Implement |job-term| ?
- Channel test fails with Motif. Sometimes kills the X11 server.
- When a message in the queue but there is no callback, drop it after a while?
Add timestamp to queued messages and callbacks with ID, remove after a
minute. Option to set the droptime.
- Add an option to drop text of very long lines? Default to 1 Mbyte.
- Add remark about undo sync, is there a way to force it?
- When starting a job, have an option to open the server socket, so we know
the port, and pass it to the command with --socket-fd {nr}. (Olaf Dabrunz,
Feb 9) How to do this on MS-Windows?
- For connection to server, a "keep open" flag would be useful. Retry
connecting in the main loop with zero timeout.
- job_start(): run job in a newly opened terminal (not a terminal window).
With xterm could use -S{pty}.
Although user could use "xterm -e 'cmd arg'".
Regexp problems:
- When search pattern has the base character both with and without combining
character, search fails. E.g. "รรีบ" in "การรีบรักใคร". (agguser, #2312)
- [:space:] only matches ASCII spaces. Add [:white:] for all space-like
characters, esp. including 0xa0. Use character class zero.
- Since 7.4.704 the old regex engine fails to match [[:print:]] in 0xf6.
(Manuel Ortega, 2016 Apr 24)
Test fails on Mac. Avoid using isalpha(), isalnum(), etc? Depends on
LC_CTYPE
- The old engine does not find a match for "/\%#=1\(\)\{80}", the new engine
matches everywhere.
- Using win_linetabsize() can still be slow. Cache the result, store col and
vcol. Reset them when moving to another line.
- Very slow with a long line and Ruby highlighting. (John Whitley, 2014 Dec 4)
- Bug with pattern: '\vblock (\d+)\.\n.*\d+%(\1)@<!\.$'
(Lech Lorens, 2014 Feb 3)
- Issue 164: freeze on regexp search.
- Ignorecase not handled properly for multi-byte characters. (Axel Bender,
2013 Dec 11)
- Using \@> and \?. (Brett Stahlman, 2013 Dec 21) Remark from Marcin
Szamotulski; Remark from Brett 2014 Jan 6 and 7.
- NFA regexp doesn't handle \%<v correctly. (Ingo Karkat, 2014 May 12)
- Does not work with NFA regexp engine:
\%u, \%x, \%o, \%d followed by a composing character
- Search for \%d0\+ may fail with E363. (Christian Brabandt, 2016 Oct 4)
- \%'[ does not work. '%'] does work. (Masaaki Nakamura, 2016 Apr 4)
- Bug relating to back references. (Ingo Karkat, 2014 Jul 24)
- New RE does not give an error for empty group: "\(\)\{2}" (Dominique Pelle,
2015 Feb 7)
- Using back reference before the capturing group sometimes works with the old
engine, can we do this with the new engine? E.g. with
"/\%(<\1>\)\@<=.*\%(<\/\(\w\+\)>\)\@=" matching text inside HTML tags.
This problem is probably the same: "\%(^\1.*$\n\)\@<=\(\d\+\).*$".
(guotuofeng, 2015 Jun 22)
- Strange matching with "\(Hello\n\)\@<=A". (Anas Syed, 2015 Feb 12)
- Problem with \v(A)@<=b+\1c. (Issue 334)
- Diff highlighting can be very slow. (Issue 309)
- Using %> for a virtual column has a check based on 'tabsize'. Better would
be to cache the result of win_linetabsize(col), storing both col and vcol,
and use them to decide whether win_linetabsize() needs to be called. Reset
col and vcol when moving to another line.
- this doesn't work: "syntax match ErrorMsg /.\%9l\%>20c\&\%<28c/". Leaving
out the \& works. Seems any column check after \& fails.
- Difference between two engines: ".*\zs\/\@>\/" on text "///"
(Chris Paul, 2016 Nov 13) New engine not greedy enough?
Another one: echom matchstr(" sdfsfsf\n sfdsdfsdf",'[^\n]*')
(2017 May 15, #1252)
Patch to add "cmdline" completion to getcompletion(). (Shougo, Oct 1, #1140)
Feature request: Complete members of a dictionary. (Luc Hermitte, 2017 Jan 4,
@@ -1136,7 +1097,7 @@ Patch: On MS-Windows shellescape() may have to triple double quotes.
(Ingo Karkat, 2015 Jan 16)
Patch for variable tabstops. On github (Christian Brabandt, 2014 May 15)
Update 2016 Jun 10, # 857
Update 2018 March 12, #2711
Redo only remembers the last change. Could use "{count}g." to redo an older
change. How does the user know which change? At least have a way to list
+9 -1
View File
@@ -1,4 +1,4 @@
*usr_05.txt* For Vim version 8.0. Last change: 2016 Mar 28
*usr_05.txt* For Vim version 8.0. Last change: 2018 Feb 20
VIM USER MANUAL - by Bram Moolenaar
@@ -48,6 +48,14 @@ For MS-DOS and MS-Windows you can use one of these:
$HOME/_vimrc ~
$VIM/_vimrc ~
If you are creating the vimrc file for the first time, it is recommended to
put this line at the top: >
source $VIMRUNTIME/defaults.vim
This initializes Vim for new users (as opposed to traditional Vi users). See
|defaults.vim| for the details.
The vimrc file can contain all the commands that you type after a colon. The
most simple ones are for setting options. For example, if you want Vim to
always start with the 'incsearch' option on, add this line your vimrc file: >
+9 -9
View File
@@ -1,4 +1,4 @@
*usr_24.txt* For Vim version 8.0. Last change: 2006 Jul 23
*usr_24.txt* For Vim version 8.0. Last change: 2018 Mar 18
VIM USER MANUAL - by Bram Moolenaar
@@ -538,8 +538,8 @@ a 16 bit and a 32 bit number (e.g., for a Unicode character): >
*24.9* Digraphs
Some characters are not on the keyboard. For example, the copyright character
(©). To type these characters in Vim, you use digraphs, where two characters
represent one. To enter a ©, for example, you press three keys: >
(©). To type these characters in Vim, you use digraphs, where two characters
represent one. To enter a ©, for example, you press three keys: >
CTRL-K Co
@@ -549,12 +549,12 @@ To find out what digraphs are available, use the following command: >
Vim will display the digraph table. Here are three lines of it:
AC ~_ 159 NS | 160 !I ¡ 161 Ct ¢ 162 Pd £ 163 Cu ¤ 164 Ye ¥ 165 ~
BB ¦ 166 SE § 167 ': ¨ 168 Co © 169 -a ª 170 << « 171 NO ¬ 172 ~
-- ­ 173 Rg ® 174 'm ¯ 175 DG ° 176 +- ± 177 2S ² 178 3S ³ 179 ~
AC ~_ 159 NS | 160 !I ¡ 161 Ct ¢ 162 Pd £ 163 Cu ¤ 164 Ye ¥ 165 ~
BB ¦ 166 SE § 167 ': ¨ 168 Co © 169 -a ª 170 << « 171 NO ¬ 172 ~
-- ­ 173 Rg ® 174 'm ¯ 175 DG ° 176 +- ± 177 2S ² 178 3S ³ 179 ~
This shows, for example, that the digraph you get by typing CTRL-K Pd is the
character (£). This is character number 163 (decimal).
character (£). This is character number 163 (decimal).
Pd is short for Pound. Most digraphs are selected to give you a hint about
the character they will produce. If you look through the list you will
understand the logic.
@@ -569,9 +569,9 @@ that combination. Thus CTRL-K dP also works. Since there is no digraph for
You can define your own digraphs. Example: >
:digraph a" ä
:digraph a" ä
This defines that CTRL-K a" inserts an ä character. You can also specify the
This defines that CTRL-K a" inserts an ä character. You can also specify the
character with a decimal number. This defines the same digraph: >
:digraph a" 228
+6 -4
View File
@@ -1,4 +1,4 @@
*usr_41.txt* For Vim version 8.0. Last change: 2017 Dec 02
*usr_41.txt* For Vim version 8.0. Last change: 2018 Mar 03
VIM USER MANUAL - by Bram Moolenaar
@@ -885,8 +885,9 @@ Interactive: *interactive-functions*
GUI: *gui-functions*
getfontname() get name of current font being used
getwinposx() X position of the GUI Vim window
getwinposy() Y position of the GUI Vim window
getwinpos() position of the Vim window
getwinposx() X position of the Vim window
getwinposy() Y position of the Vim window
balloon_show() set the balloon content
balloon_split() split a message for a balloon
@@ -924,7 +925,8 @@ Testing: *test-functions*
assert_false() assert that an expression is false
assert_true() assert that an expression is true
assert_exception() assert that a command throws an exception
assert_fails() assert that a function call fails
assert_beeps() assert that a command beeps
assert_fails() assert that a command fails
assert_report() report a test failure
test_alloc_fail() make memory allocation fail
test_autochdir() enable 'autochdir' during startup
+25 -12
View File
@@ -1,4 +1,4 @@
*various.txt* For Vim version 8.0. Last change: 2017 Nov 18
*various.txt* For Vim version 8.0. Last change: 2018 Mar 10
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -40,23 +40,35 @@ CTRL-L Clear and redraw the screen. The redraw may happen
:as[cii] or *ga* *:as* *:ascii*
ga Print the ascii value of the character under the
cursor in decimal, hexadecimal and octal. For
example, when the cursor is on a 'R':
cursor in decimal, hexadecimal and octal.
Mnemonic: Get Ascii value.
For example, when the cursor is on a 'R':
<R> 82, Hex 52, Octal 122 ~
When the character is a non-standard ASCII character,
but printable according to the 'isprint' option, the
non-printable version is also given. When the
character is larger than 127, the <M-x> form is also
printed. For example:
non-printable version is also given.
When the character is larger than 127, the <M-x> form
is also printed. For example:
<~A> <M-^A> 129, Hex 81, Octal 201 ~
<p> <|~> <M-~> 254, Hex fe, Octal 376 ~
(where <p> is a special character)
The <Nul> character in a file is stored internally as
<NL>, but it will be shown as:
<^@> 0, Hex 00, Octal 000 ~
If the character has composing characters these are
also shown. The value of 'maxcombine' doesn't matter.
Mnemonic: Get Ascii value. {not in Vi}
If the character can be inserted as a digraph, also
output the two characters that can be used to create
the character:
<ö> 246, Hex 00f6, Oct 366, Digr o: ~
This shows you can type CTRL-K o : to insert ö.
{not in Vi}
*g8*
g8 Print the hex values of the bytes used in the
@@ -294,7 +306,7 @@ g8 Print the hex values of the bytes used in the
Here is an overview of the features.
The first column shows the smallest version in which
they are included:
T tiny
T tiny (always)
S small
N normal
B big
@@ -308,7 +320,7 @@ g8 Print the hex values of the bytes used in the
*+acl* |ACL| support included
*+ARP* Amiga only: ARP support included
B *+arabic* |Arabic| language support
N *+autocmd* |:autocmd|, automatic commands
T *+autocmd* |:autocmd|, automatic commands
H *+autoservername* Automatically enable |clientserver|
m *+balloon_eval* |balloon-eval| support in the GUI. Included when
compiling with supported GUI (Motif, GTK, GUI) and
@@ -332,7 +344,7 @@ N *+comments* |'comments'| support
B *+conceal* "conceal" support, see |conceal| |:syn-conceal| etc.
N *+cryptv* encryption support |encryption|
B *+cscope* |cscope| support
m *+cursorbind* |'cursorbind'| support
T *+cursorbind* |'cursorbind'| support
m *+cursorshape* |termcap-cursor-shape| support
m *+debug* Compiled for debugging.
N *+dialog_gui* Support for |:confirm| with GUI dialog.
@@ -340,7 +352,7 @@ N *+dialog_con* Support for |:confirm| with console dialog.
N *+dialog_con_gui* Support for |:confirm| with GUI and console dialog.
N *+diff* |vimdiff| and 'diff'
N *+digraphs* |digraphs| *E196*
m *+directx* Win32 GUI only: DirectX and |'renderoptions'|
*+directx* Win32 GUI only: DirectX and |'renderoptions'|
*+dnd* Support for DnD into the "~ register |quote_~|.
B *+emacs_tags* |emacs-tags| files
N *+eval* expression evaluation |eval.txt|
@@ -419,7 +431,7 @@ N *+reltime* |reltime()| function, 'hlsearch'/'incsearch' timeout,
B *+rightleft* Right to left typing |'rightleft'|
m *+ruby* Ruby interface |ruby|
m *+ruby/dyn* Ruby interface |ruby-dynamic| |/dyn|
N *+scrollbind* |'scrollbind'|
T *+scrollbind* |'scrollbind'|
B *+signs* |:sign|
N *+smartindent* |'smartindent'|
N *+startuptime* |--startuptime| argument
@@ -452,6 +464,7 @@ N *+virtualedit* |'virtualedit'|
S *+visual* Visual mode |Visual-mode| Always enabled since 7.4.200.
N *+visualextra* extra Visual mode commands |blockwise-operators|
N *+vreplace* |gR| and |gr|
*+vtp* on MS-Windows console: support for 'termguicolors'
N *+wildignore* |'wildignore'|
N *+wildmenu* |'wildmenu'|
*+windows* more than one window; Always enabled since 8.0.1118.
+8 -8
View File
@@ -1,4 +1,4 @@
*version6.txt* For Vim version 8.0. Last change: 2014 Aug 29
*version6.txt* For Vim version 8.0. Last change: 2018 Mar 18
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -6103,7 +6103,7 @@ New tutor translations:
Slovak (Lubos Celko)
Greek (Christos Kontas)
German (Joachim Hofmann)
Norwegian (Øyvind Holm)
Norwegian (Øyvind Holm)
New filetype plugins:
Occam (Mario Schweigler)
@@ -6121,13 +6121,13 @@ New compiler plugins:
Modelsim vcom (Paul Baleme)
New menu translations:
Brazilian (José de Paula)
Brazilian (José de Paula)
British (Mike Williams)
Korean in UTF-8. (Nam SungHyun)
Norwegian (Øyvind Holm)
Norwegian (Øyvind Holm)
Serbian (Aleksandar Jelenak)
New message translation for Norwegian. (Øyvind Holm)
New message translation for Norwegian. (Øyvind Holm)
New color scheme:
desert (Hans Fugal)
@@ -10066,7 +10066,7 @@ Files: src/os_unix.c
Patch 6.2.019 (lang)
Problem: Loading the Portuguese menu causes an error message.
Solution: Join two lines. (Jose Pedro Oliveira, José de Paula)
Solution: Join two lines. (Jose Pedro Oliveira, José de Paula)
Files: runtime/lang/menu_pt_br.vim
Patch 6.2.020
@@ -12418,7 +12418,7 @@ Files: src/message.c
Patch 6.2.376
Problem: Win32: Ruby interface cannot be dynamically linked with Ruby 1.6.
Solution: Add #ifdefs around use of rb_w32_snprintf(). (Benoît Cerrina)
Solution: Add #ifdefs around use of rb_w32_snprintf(). (Benoît Cerrina)
Files: src/if_ruby.c
Patch 6.2.377 (after 6.2.372)
@@ -14320,7 +14320,7 @@ Files: src/edit.c
Patch 6.3.061
Problem: When editing a utf-8 file in an utf-8 xterm and there is a
multi-byte character in the last column, displaying is messed up.
(Joël Rio)
(Joël Rio)
Solution: Check for a multi-byte character, not a multi-column character.
Files: src/screen.c
+10 -7
View File
@@ -1,5 +1,5 @@
" CHICKEN-specific Vim customizations
" Last Change: 2018-01-06
" Last Change: 2018-03-05
" Author: Evan Hanson <evhan@foldling.org>
" Maintainer: Evan Hanson <evhan@foldling.org>
" URL: https://foldling.org/vim/ftplugin/chicken.vim
@@ -14,34 +14,37 @@ endif
setl keywordprg=chicken-doc
setl lispwords+=and-let*
setl lispwords+=begin-for-syntax
setl lispwords+=compiler-typecase
setl lispwords+=condition-case
setl lispwords+=define-compiler-syntax
setl lispwords+=define-constant
setl lispwords+=define-external
setl lispwords+=define-for-syntax
setl lispwords+=define-foreign-type
setl lispwords+=define-inline
setl lispwords+=define-location
setl lispwords+=define-record
setl lispwords+=define-record-printer
setl lispwords+=define-specialization
setl lispwords+=define-syntax-rule
setl lispwords+=eval-when
setl lispwords+=fluid-let
setl lispwords+=foreign-lambda*
setl lispwords+=foreign-primitive
setl lispwords+=foreign-safe-lambda*
setl lispwords+=functor
setl lispwords+=handle-exceptions
setl lispwords+=let-compiler-syntax
setl lispwords+=let-location
setl lispwords+=let-optionals
setl lispwords+=let-optionals*
setl lispwords+=letrec-values
setl lispwords+=match
setl lispwords+=match-lambda
setl lispwords+=match-lambda*
setl lispwords+=match-let
setl lispwords+=match-let*
setl lispwords+=match-letrec
setl lispwords+=module
setl lispwords+=receive
setl lispwords+=select
setl lispwords+=set!-values
setl lispwords+=test-group
let b:undo_ftplugin = b:undo_ftplugin . ' keywordprg<'
+20 -2
View File
@@ -3,7 +3,7 @@
" Maintainer: Tom Picton <tom@tompicton.co.uk>
" Previous Maintainer: James Sully <sullyj3@gmail.com>
" Previous Maintainer: Johannes Zellner <johannes@zellner.org>
" Last Change: Wed, 20 December 2017
" Last Change: Sun, 18 March 2018
" https://github.com/tpict/vim-ftplugin-python
if exists("b:did_ftplugin") | finish | endif
@@ -14,7 +14,25 @@ set cpo&vim
setlocal cinkeys-=0#
setlocal indentkeys-=0#
setlocal include=^\\s*\\(from\\\|import\\)
setlocal includeexpr=substitute(v:fname,'\\.','/','g')
" For imports with leading .., append / and replace additional .s with ../
let b:grandparent_match = '^\(.\.\)\(\.*\)'
let b:grandparent_sub = '\=submatch(1)."/".repeat("../",strlen(submatch(2)))'
" For imports with a single leading ., replace it with ./
let b:parent_match = '^\.\(\.\)\@!'
let b:parent_sub = './'
" Replace any . sandwiched between word characters with /
let b:child_match = '\(\w\)\.\(\w\)'
let b:child_sub = '\1/\2'
setlocal includeexpr=substitute(substitute(substitute(
\v:fname,
\b:grandparent_match,b:grandparent_sub,''),
\b:parent_match,b:parent_sub,''),
\b:child_match,b:child_sub,'g')
setlocal suffixesadd=.py
setlocal comments=b:#,fb:-
setlocal commentstring=#\ %s
+3 -8
View File
@@ -1,6 +1,6 @@
" Vim filetype plugin file
" Language: Scheme (R7RS)
" Last Change: 2018-01-20
" Last Change: 2018-03-05
" Author: Evan Hanson <evhan@foldling.org>
" Maintainer: Evan Hanson <evhan@foldling.org>
" Previous Maintainer: Sergey Khorev <sergey.khorev@gmail.com>
@@ -14,25 +14,20 @@ let s:cpo = &cpo
set cpo&vim
setl lisp
setl comments=:;;;;,:;;;,:;;,:;,sr:#\|,ex:\|#
setl comments=:;;;;,:;;;,:;;,:;,sr:#\|,mb:\|,ex:\|#
setl commentstring=;%s
setl define=^\\s*(def\\k*
setl iskeyword=33,35-39,42-43,45-58,60-90,94,95,97-122,126
let b:undo_ftplugin = 'setl lisp< comments< commentstring< define< iskeyword<'
setl lispwords=begin
setl lispwords+=case
setl lispwords+=case-lambda
setl lispwords+=cond
setl lispwords+=cond-expand
setl lispwords=case
setl lispwords+=define
setl lispwords+=define-record-type
setl lispwords+=define-syntax
setl lispwords+=define-values
setl lispwords+=do
setl lispwords+=guard
setl lispwords+=import
setl lispwords+=lambda
setl lispwords+=let
setl lispwords+=let*
+27 -11
View File
@@ -2,7 +2,7 @@
" Header: "{{{
" Maintainer: Bram Moolenaar
" Original Author: Andy Wokula <anwoku@yahoo.de>
" Last Change: 2017 Jun 13
" Last Change: 2018 Mar 12
" Version: 1.0
" Description: HTML indent script with cached state for faster indenting on a
" range of lines.
@@ -56,6 +56,9 @@ let s:cpo_save = &cpo
set cpo-=C
"}}}
" Pattern to match the name of a tag, including custom elements.
let s:tagname = '\w\+\(-\w\+\)*'
" Check and process settings from b:html_indent and g:html_indent... variables.
" Prefer using buffer-local settings over global settings, so that there can
" be defaults for all HTML files and exceptions for specific types of HTML
@@ -230,9 +233,9 @@ call s:AddITags(s:indent_tags, [
call s:AddITags(s:indent_tags, [
\ 'area', 'article', 'aside', 'audio', 'bdi', 'canvas',
\ 'command', 'data', 'datalist', 'details', 'embed', 'figcaption',
\ 'figure', 'footer', 'header', 'keygen', 'mark', 'meter', 'nav', 'output',
\ 'progress', 'rp', 'rt', 'ruby', 'section', 'source', 'summary', 'svg',
\ 'time', 'track', 'video', 'wbr'])
\ 'figure', 'footer', 'header', 'keygen', 'main', 'mark', 'meter',
\ 'nav', 'output', 'progress', 'rp', 'rt', 'ruby', 'section', 'source',
\ 'summary', 'svg', 'time', 'track', 'video', 'wbr'])
" Tags added for web components:
call s:AddITags(s:indent_tags, [
@@ -280,7 +283,7 @@ func! s:CountITags(text)
let s:nextrel = 0 " relative indent steps for next line [unit &sw]:
let s:block = 0 " assume starting outside of a block
let s:countonly = 1 " don't change state
call substitute(a:text, '<\zs/\=\w\+\(-\w\+\)*\>\|<!--\[\|\[endif\]-->\|<!--\|-->', '\=s:CheckTag(submatch(0))', 'g')
call substitute(a:text, '<\zs/\=' . s:tagname . '\>\|<!--\[\|\[endif\]-->\|<!--\|-->', '\=s:CheckTag(submatch(0))', 'g')
let s:countonly = 0
endfunc "}}}
@@ -292,7 +295,7 @@ func! s:CountTagsAndState(text)
let s:nextrel = 0 " relative indent steps for next line [unit &sw]:
let s:block = b:hi_newstate.block
let tmp = substitute(a:text, '<\zs/\=\w\+\(-\w\+\)*\>\|<!--\[\|\[endif\]-->\|<!--\|-->', '\=s:CheckTag(submatch(0))', 'g')
let tmp = substitute(a:text, '<\zs/\=' . s:tagname . '\>\|<!--\[\|\[endif\]-->\|<!--\|-->', '\=s:CheckTag(submatch(0))', 'g')
if s:block == 3
let b:hi_newstate.scripttype = s:GetScriptType(matchstr(tmp, '\C.*<SCRIPT\>\zs[^>]*'))
endif
@@ -530,7 +533,7 @@ func! s:FreshState(lnum)
let swendtag = match(text, '^\s*</') >= 0
" If previous line ended in a closing tag, line up with the opening tag.
if !swendtag && text =~ '</\w\+\s*>\s*$'
if !swendtag && text =~ '</' . s:tagname . '\s*>\s*$'
call cursor(state.lnum, 99999)
normal! F<
let start_lnum = HtmlIndent_FindStartTag()
@@ -860,7 +863,7 @@ func! HtmlIndent_FindStartTag()
" The cursor must be on or before a closing tag.
" If found, positions the cursor at the match and returns the line number.
" Otherwise returns 0.
let tagname = matchstr(getline('.')[col('.') - 1:], '</\zs\w\+\ze')
let tagname = matchstr(getline('.')[col('.') - 1:], '</\zs' . s:tagname . '\ze')
let start_lnum = searchpair('<' . tagname . '\>', '', '</' . tagname . '\>', 'bW')
if start_lnum > 0
return start_lnum
@@ -876,7 +879,7 @@ func! HtmlIndent_FindTagEnd()
" a self-closing tag, to the matching ">".
" Limited to look up to b:html_indent_line_limit lines away.
let text = getline('.')
let tagname = matchstr(text, '\w\+\|!--', col('.'))
let tagname = matchstr(text, s:tagname . '\|!--', col('.'))
if tagname == '!--'
call search('--\zs>')
elseif s:get_tag('/' . tagname) != 0
@@ -921,9 +924,22 @@ func! s:InsideTag(foundHtmlString)
else
let idx = match(text, '\s\zs[_a-zA-Z0-9-]\+="')
endif
if idx == -1
" try <tag attr
let idx = match(text, '<' . s:tagname . '\s\+\zs\w')
endif
if idx == -1
" after just <tag indent one level more
let idx = match(text, '<' . s:tagname . '$')
if idx >= 0
call cursor(lnum, idx)
return virtcol('.') + shiftwidth()
endif
endif
if idx > 0
" Found the attribute. TODO: assumes spaces, no Tabs.
return idx
" Found the attribute to align with.
call cursor(lnum, idx)
return virtcol('.')
endif
endwhile
return -1
+143
View File
@@ -0,0 +1,143 @@
" Maintainer: Oliver Corff <oliver.corff@email.de>
" Last Changed: 2018 Feb 12
scriptencoding utf-8
" oto = Old Turkic, Orkhon
let b:keymap_name = "oto"
highlight lCursor guibg=red guifg=NONE
" map F8 to toggle keymap (Ctrl-^ not present on keyboard)
noremap <F8> :let &iminsert = ! &iminsert<CR>
lnoremap <F8> <C-^>
noremap! <F8> <C-^>
loadkeymap
A 𐰀 10C00 OLD TURKIC LETTER ORKHON A
00 𐰀 10C00 OLD TURKIC LETTER ORKHON A
I 𐰃 10C03 OLD TURKIC LETTER ORKHON I
03 𐰃 10C03 OLD TURKIC LETTER ORKHON I
O 𐰆 10C06 OLD TURKIC LETTER ORKHON O
U 𐰆 10C06 OLD TURKIC LETTER ORKHON O
06 𐰆 10C06 OLD TURKIC LETTER ORKHON O
OE 𐰇 10C07 OLD TURKIC LETTER ORKHON OE
UE 𐰇 10C07 OLD TURKIC LETTER ORKHON OE
07 𐰇 10C07 OLD TURKIC LETTER ORKHON OE
ab 𐰉 10C09 OLD TURKIC LETTER ORKHON AB
b1 𐰉 10C09 OLD TURKIC LETTER ORKHON AB
09 𐰉 10C09 OLD TURKIC LETTER ORKHON AB
aeb 𐰋 10C0B OLD TURKIC LETTER ORKHON AEB
eb 𐰋 10C0B OLD TURKIC LETTER ORKHON AEB
b2 𐰋 10C0B OLD TURKIC LETTER ORKHON AEB
0b 𐰋 10C0B OLD TURKIC LETTER ORKHON AEB
ag 𐰍 10C0D OLD TURKIC LETTER ORKHON AG
g1 𐰍 10C0D OLD TURKIC LETTER ORKHON AG
0d 𐰍 10C0D OLD TURKIC LETTER ORKHON AG
aeg 𐰏 10C0F OLD TURKIC LETTER ORKHON AEG
eg 𐰏 10C0F OLD TURKIC LETTER ORKHON AEG
g2 𐰏 10C0F OLD TURKIC LETTER ORKHON AEG
0f 𐰏 10C0F OLD TURKIC LETTER ORKHON AEG
ad 𐰑 10C11 OLD TURKIC LETTER ORKHON AD
d1 𐰑 10C11 OLD TURKIC LETTER ORKHON AD
11 𐰑 10C11 OLD TURKIC LETTER ORKHON AD
aed 𐰓 10C13 OLD TURKIC LETTER ORKHON AED
ed 𐰓 10C13 OLD TURKIC LETTER ORKHON AED
d2 𐰓 10C13 OLD TURKIC LETTER ORKHON AED
13 𐰓 10C13 OLD TURKIC LETTER ORKHON AED
ez 𐰔 10C14 OLD TURKIC LETTER ORKHON EZ
z 𐰔 10C14 OLD TURKIC LETTER ORKHON EZ
14 𐰔 10C14 OLD TURKIC LETTER ORKHON EZ
ay 𐰖 10C16 OLD TURKIC LETTER ORKHON AY
y1 𐰖 10C16 OLD TURKIC LETTER ORKHON AY
16 𐰖 10C16 OLD TURKIC LETTER ORKHON AY
aey 𐰘 10C18 OLD TURKIC LETTER ORKHON AEY
ey 𐰘 10C18 OLD TURKIC LETTER ORKHON AEY
y2 𐰘 10C18 OLD TURKIC LETTER ORKHON AEY
18 𐰘 10C18 OLD TURKIC LETTER ORKHON AEY
aek 𐰚 10C1A OLD TURKIC LETTER ORKHON AEK
k 𐰚 10C1A OLD TURKIC LETTER ORKHON AEK
1a 𐰚 10C1A OLD TURKIC LETTER ORKHON AEK
oek 𐰜 10C1C OLD TURKIC LETTER ORKHON OEK
q 𐰜 10C1C OLD TURKIC LETTER ORKHON OEK
1c 𐰜 10C1C OLD TURKIC LETTER ORKHON OEK
al 𐰞 10C1E OLD TURKIC LETTER ORKHON AL
l1 𐰞 10C1E OLD TURKIC LETTER ORKHON AL
1e 𐰞 10C1E OLD TURKIC LETTER ORKHON AL
ael 𐰠 10C20 OLD TURKIC LETTER ORKHON AEL
el 𐰠 10C20 OLD TURKIC LETTER ORKHON AEL
l2 𐰠 10C20 OLD TURKIC LETTER ORKHON AEL
20 𐰠 10C20 OLD TURKIC LETTER ORKHON AEL
elt 𐰡 10C21 OLD TURKIC LETTER ORKHON ELT
lt 𐰡 10C21 OLD TURKIC LETTER ORKHON ELT
21 𐰡 10C21 OLD TURKIC LETTER ORKHON ELT
em 𐰢 10C22 OLD TURKIC LETTER ORKHON EM
m 𐰢 10C22 OLD TURKIC LETTER ORKHON EM
22 𐰢 10C22 OLD TURKIC LETTER ORKHON EM
an 𐰣 10C23 OLD TURKIC LETTER ORKHON AN
n1 𐰣 10C23 OLD TURKIC LETTER ORKHON AN
23 𐰣 10C23 OLD TURKIC LETTER ORKHON AN
en 𐰤 10C24 OLD TURKIC LETTER ORKHON AEN
n2 𐰤 10C24 OLD TURKIC LETTER ORKHON AEN
24 𐰤 10C24 OLD TURKIC LETTER ORKHON AEN
ent 𐰦 10C26 OLD TURKIC LETTER ORKHON ENT
nt 𐰦 10C26 OLD TURKIC LETTER ORKHON ENT
26 𐰦 10C26 OLD TURKIC LETTER ORKHON ENT
enc 𐰨 10C28 OLD TURKIC LETTER ORKHON ENC
nc 𐰨 10C28 OLD TURKIC LETTER ORKHON ENC
28 𐰨 10C28 OLD TURKIC LETTER ORKHON ENC
eny 𐰪 10C2A OLD TURKIC LETTER ORKHON ENY
ny 𐰪 10C2A OLD TURKIC LETTER ORKHON ENY
2a 𐰪 10C2A OLD TURKIC LETTER ORKHON ENY
eng 𐰭 10C2D OLD TURKIC LETTER ORKHON ENG
ng 𐰭 10C2D OLD TURKIC LETTER ORKHON ENG
2d 𐰭 10C2D OLD TURKIC LETTER ORKHON ENG
ep 𐰯 10C2F OLD TURKIC LETTER ORKHON EP
p 𐰯 10C2F OLD TURKIC LETTER ORKHON EP
2f 𐰯 10C2F OLD TURKIC LETTER ORKHON EP
op 𐰰 10C30 OLD TURKIC LETTER ORKHON OP
up 𐰰 10C30 OLD TURKIC LETTER ORKHON OP
30 𐰰 10C30 OLD TURKIC LETTER ORKHON OP
ic 𐰱 10C31 OLD TURKIC LETTER ORKHON IC
31 𐰱 10C31 OLD TURKIC LETTER ORKHON IC
ec 𐰲 10C32 OLD TURKIC LETTER ORKHON EC
32 𐰲 10C32 OLD TURKIC LETTER ORKHON EC
aq 𐰴 10C34 OLD TURKIC LETTER ORKHON AQ
34 𐰴 10C34 OLD TURKIC LETTER ORKHON AQ
iq 𐰶 10C36 OLD TURKIC LETTER ORKHON IQ
yq 𐰶 10C36 OLD TURKIC LETTER ORKHON IQ
36 𐰶 10C36 OLD TURKIC LETTER ORKHON IQ
oq 𐰸 10C38 OLD TURKIC LETTER ORKHON OQ
uq 𐰸 10C38 OLD TURKIC LETTER ORKHON OQ
38 𐰸 10C38 OLD TURKIC LETTER ORKHON OQ
ar 𐰺 10C3A OLD TURKIC LETTER ORKHON AR
r1 𐰺 10C3A OLD TURKIC LETTER ORKHON AR
3a 𐰺 10C3A OLD TURKIC LETTER ORKHON AR
aer 𐰼 10C3C OLD TURKIC LETTER ORKHON AER
er 𐰼 10C3C OLD TURKIC LETTER ORKHON AER
r2 𐰼 10C3C OLD TURKIC LETTER ORKHON AER
3c 𐰼 10C3C OLD TURKIC LETTER ORKHON AER
as 𐰽 10C3D OLD TURKIC LETTER ORKHON AS
s1 𐰽 10C3D OLD TURKIC LETTER ORKHON AS
3d 𐰽 10C3D OLD TURKIC LETTER ORKHON AS
aes 𐰾 10C3E OLD TURKIC LETTER ORKHON AES
es 𐰾 10C3E OLD TURKIC LETTER ORKHON AES
s2 𐰾 10C3E OLD TURKIC LETTER ORKHON AES
3e 𐰾 10C3E OLD TURKIC LETTER ORKHON AES
ash 𐰿 10C3F OLD TURKIC LETTER ORKHON ASH
sh1 𐰿 10C3F OLD TURKIC LETTER ORKHON ASH
3f 𐰿 10C3F OLD TURKIC LETTER ORKHON ASH
esh 𐱁 10C41 OLD TURKIC LETTER ORKHON ESH
sh2 𐱁 10C41 OLD TURKIC LETTER ORKHON ESH
41 𐱁 10C41 OLD TURKIC LETTER ORKHON ESH
at 𐱃 10C43 OLD TURKIC LETTER ORKHON AT
t1 𐱃 10C43 OLD TURKIC LETTER ORKHON AT
43 𐱃 10C43 OLD TURKIC LETTER ORKHON AT
aet 𐱅 10C45 OLD TURKIC LETTER ORKHON AET
et 𐱅 10C45 OLD TURKIC LETTER ORKHON AET
t2 𐱅 10C45 OLD TURKIC LETTER ORKHON AET
45 𐱅 10C45 OLD TURKIC LETTER ORKHON AET
ot 𐱇 10C47 OLD TURKIC LETTER ORKHON OT
ut 𐱇 10C47 OLD TURKIC LETTER ORKHON OT
47 𐱇 10C47 OLD TURKIC LETTER ORKHON OT
bash 𐱈 10C48 OLD TURKIC LETTER ORKHON BASH
48 𐱈 10C48 OLD TURKIC LETTER ORKHON BASH
+115
View File
@@ -0,0 +1,115 @@
" Maintainer: Oliver Corff <oliver.corff@yemail.de>
" Last Changed: 2018 Feb 12
" All characters are given literally, conversion to another encoding (e.g.,
" UTF-8) should work.
scriptencoding utf-8
let b:keymap_name = "oto"
highlight lCursor guibg=red guifg=NONE
" map F8 to toggle keymap (Ctrl-^ not present on keyboard)
noremap <F8> :let &iminsert = ! &iminsert<CR>
lnoremap <F8> <C-^>
noremap! <F8> <C-^>
loadkeymap
A 𐰁 10C01 OLD TURKIC LETTER YENISEI A
01 𐰁 10C01 OLD TURKIC LETTER YENISEI A
AE 𐰂 10C02 OLD TURKIC LETTER YENISEI AE
02 𐰂 10C02 OLD TURKIC LETTER YENISEI AE
I 𐰄 10C04 OLD TURKIC LETTER YENISEI I
04 𐰄 10C04 OLD TURKIC LETTER YENISEI I
E 𐰅 10C05 OLD TURKIC LETTER YENISEI E
05 𐰅 10C05 OLD TURKIC LETTER YENISEI E
OE 𐰈 10C08 OLD TURKIC LETTER YENISEI OE
UE 𐰈 10C08 OLD TURKIC LETTER YENISEI OE
08 𐰈 10C08 OLD TURKIC LETTER YENISEI OE
ab 𐰊 10C0A OLD TURKIC LETTER YENISEI AB
b1 𐰊 10C0A OLD TURKIC LETTER YENISEI AB
0a 𐰊 10C0A OLD TURKIC LETTER YENISEI AB
aeb 𐰌 10C0C OLD TURKIC LETTER YENISEI AEB
eb 𐰌 10C0C OLD TURKIC LETTER YENISEI AEB
b2 𐰌 10C0C OLD TURKIC LETTER YENISEI AEB
0c 𐰌 10C0C OLD TURKIC LETTER YENISEI AEB
ag 𐰎 10C0E OLD TURKIC LETTER YENISEI AG
g1 𐰎 10C0E OLD TURKIC LETTER YENISEI AG
0e 𐰎 10C0E OLD TURKIC LETTER YENISEI AG
aeg 𐰐 10C10 OLD TURKIC LETTER YENISEI AEG
eg 𐰐 10C10 OLD TURKIC LETTER YENISEI AEG
g2 𐰐 10C10 OLD TURKIC LETTER YENISEI AEG
10 𐰐 10C10 OLD TURKIC LETTER YENISEI AEG
ad 𐰒 10C12 OLD TURKIC LETTER YENISEI AD
d1 𐰒 10C12 OLD TURKIC LETTER YENISEI AD
12 𐰒 10C12 OLD TURKIC LETTER YENISEI AD
ez 𐰕 10C15 OLD TURKIC LETTER YENISEI EZ
z 𐰕 10C15 OLD TURKIC LETTER YENISEI EZ
15 𐰕 10C15 OLD TURKIC LETTER YENISEI EZ
ay 𐰗 10C17 OLD TURKIC LETTER YENISEI AY
y1 𐰗 10C17 OLD TURKIC LETTER YENISEI AY
17 𐰗 10C17 OLD TURKIC LETTER YENISEI AY
aey 𐰙 10C19 OLD TURKIC LETTER YENISEI AEY
ey 𐰙 10C19 OLD TURKIC LETTER YENISEI AEY
y2 𐰙 10C19 OLD TURKIC LETTER YENISEI AEY
19 𐰙 10C19 OLD TURKIC LETTER YENISEI AEY
aek 𐰛 10C1B OLD TURKIC LETTER YENISEI AEK
ak 𐰛 10C1B OLD TURKIC LETTER YENISEI AEK
k 𐰛 10C1B OLD TURKIC LETTER YENISEI AEK
1b 𐰛 10C1B OLD TURKIC LETTER YENISEI AEK
oek 𐰝 10C1D OLD TURKIC LETTER YENISEI OEK
ök 𐰝 10C1D OLD TURKIC LETTER YENISEI OEK
uek 𐰝 10C1D OLD TURKIC LETTER YENISEI OEK
ük 𐰝 10C1D OLD TURKIC LETTER YENISEI OEK
1d 𐰝 10C1D OLD TURKIC LETTER YENISEI OEK
al 𐰟 10C1F OLD TURKIC LETTER YENISEI AL
l 𐰟 10C1F OLD TURKIC LETTER YENISEI AL
l1 𐰟 10C1F OLD TURKIC LETTER YENISEI AL
1f 𐰟 10C1F OLD TURKIC LETTER YENISEI AL
aen 𐰥 10C25 OLD TURKIC LETTER YENISEI AEN
en 𐰥 10C25 OLD TURKIC LETTER YENISEI AEN
n2 𐰥 10C25 OLD TURKIC LETTER YENISEI AEN
25 𐰥 10C25 OLD TURKIC LETTER YENISEI AEN
ent 𐰧 10C27 OLD TURKIC LETTER YENISEI ENT
nt 𐰧 10C27 OLD TURKIC LETTER YENISEI ENT
27 𐰧 10C27 OLD TURKIC LETTER YENISEI ENT
enc 𐰩 10C29 OLD TURKIC LETTER YENISEI ENC
nc 𐰩 10C29 OLD TURKIC LETTER YENISEI ENC
29 𐰩 10C29 OLD TURKIC LETTER YENISEI ENC
eny 𐰫 10C2B OLD TURKIC LETTER YENISEI ENY
ny 𐰫 10C2B OLD TURKIC LETTER YENISEI ENY
2b 𐰫 10C2B OLD TURKIC LETTER YENISEI ENY
ang 𐰬 10C2C OLD TURKIC LETTER YENISEI ANG
ng 𐰬 10C2C OLD TURKIC LETTER YENISEI ANG
2c 𐰬 10C2C OLD TURKIC LETTER YENISEI ANG
aeng 𐰮 10C2E OLD TURKIC LETTER YENISEI AENG
eng 𐰮 10C2E OLD TURKIC LETTER YENISEI AENG
2e 𐰮 10C2E OLD TURKIC LETTER YENISEI AENG
ec 𐰳 10C33 OLD TURKIC LETTER YENISEI EC
c 𐰳 10C33 OLD TURKIC LETTER YENISEI EC
33 𐰳 10C33 OLD TURKIC LETTER YENISEI EC
aq 𐰵 10C35 OLD TURKIC LETTER YENISEI AQ
q 𐰵 10C35 OLD TURKIC LETTER YENISEI AQ
35 𐰵 10C35 OLD TURKIC LETTER YENISEI AQ
iq 𐰷 10C37 OLD TURKIC LETTER YENISEI IQ
yq 𐰷 10C37 OLD TURKIC LETTER YENISEI IQ
37 𐰷 10C37 OLD TURKIC LETTER YENISEI IQ
oq 𐰹 10C39 OLD TURKIC LETTER YENISEI OQ
uq 𐰹 10C39 OLD TURKIC LETTER YENISEI OQ
39 𐰹 10C39 OLD TURKIC LETTER YENISEI OQ
ar 𐰻 10C3B OLD TURKIC LETTER YENISEI AR
r 𐰻 10C3B OLD TURKIC LETTER YENISEI AR
r1 𐰻 10C3B OLD TURKIC LETTER YENISEI AR
3b 𐰻 10C3B OLD TURKIC LETTER YENISEI AR
ash 𐱀 10C40 OLD TURKIC LETTER YENISEI ASH
sh1 𐱀 10C40 OLD TURKIC LETTER YENISEI ASH
40 𐱀 10C40 OLD TURKIC LETTER YENISEI ASH
esh 𐱂 10C42 OLD TURKIC LETTER YENISEI ESH
sh2 𐱂 10C42 OLD TURKIC LETTER YENISEI ESH
42 𐱂 10C42 OLD TURKIC LETTER YENISEI ESH
at 𐱄 10C44 OLD TURKIC LETTER YENISEI AT
t1 𐱄 10C44 OLD TURKIC LETTER YENISEI AT
44 𐱄 10C44 OLD TURKIC LETTER YENISEI AT
aet 𐱆 10C46 OLD TURKIC LETTER YENISEI AET
et 𐱆 10C46 OLD TURKIC LETTER YENISEI AET
t2 𐱆 10C46 OLD TURKIC LETTER YENISEI AET
46 𐱆 10C46 OLD TURKIC LETTER YENISEI AET
+61 -30
View File
@@ -1,6 +1,7 @@
" Menu Translations: Serbian
" Maintainer: Aleksandar Jelenak <ajelenak AT yahoo.com>
" Last Change: Fri, 30 May 2003 12:15:30 -0400
" Last Change: Fri, 30 May 2003 10:17:39 Eastern Daylight Time
" Adapted for VIM 8 by: Ivan Pesic on 2017-12-28 12:05+0400
" Quit when menu translations have already been done.
if exists("did_menu_trans")
@@ -19,6 +20,7 @@ menutrans &Find &Nadji
menutrans &Credits &Zasluge
menutrans Co&pying P&reuzimanje
menutrans O&rphans &Sirocici
menutrans &Sponsor/Register Sponzor/&Registrujte\ se
menutrans &Version &Verzija
menutrans &About &O\ programu
@@ -26,6 +28,7 @@ menutrans &About &O\ programu
menutrans &File &Datoteka
menutrans &Open\.\.\.<Tab>:e &Otvori\.\.\.<Tab>:e
menutrans Sp&lit-Open\.\.\.<Tab>:sp &Podeli-otvori\.\.\.<Tab>:sp
menutrans Open\ Tab\.\.\.<Tab>:tabnew Otvori\ karticu\.\.\.<Tab>:tabnew
menutrans &New<Tab>:enew &Nova<Tab>:enew
menutrans &Close<Tab>:close &Zatvori<Tab>:close
menutrans &Save<Tab>:w &Sacuvaj<Tab>:w
@@ -52,24 +55,27 @@ menutrans &Select\ all<Tab>ggVG Izaberi\ sv&e<Tab>ggVG
menutrans &Find\.\.\. &Nadji\.\.\.
menutrans Find\ and\ Rep&lace\.\.\. Nadji\ i\ &zameni\.\.\.
menutrans Settings\ &Window P&rozor\ podesavanja
menutrans Startup\ &Settings Po&desavanja\ pri\ pokretanju
menutrans &Global\ Settings Op&sta\ podesavanja
menutrans F&ile\ Settings Podesavanja\ za\ da&toteke
menutrans &Shiftwidth &Pomeraj
menutrans Soft\ &Tabstop &Meka\ tabulacija
menutrans Te&xt\ Width\.\.\. &Sirina\ teksta\.\.\.
menutrans &File\ Format\.\.\. &Vrsta\ datoteke\.\.\.
menutrans C&olor\ Scheme Bo&je
menutrans &Keymap Pres&likavanje\ tastature
menutrans Show\ C&olor\ Schemes\ in\ Menu Prikazi\ seme\ bo&ja\ u\ meniju
menutrans C&olor\ Scheme \Seme\ bo&ja
menutrans Show\ &Keymaps\ in\ Menu Prikazi\ pres&likavanja\ tastature\ u\ meniju
menutrans &Keymap Pres&likavanja\ tastature
menutrans Select\ Fo&nt\.\.\. Izbor\ &fonta\.\.\.
" Edit/Global Settings
menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! Naglasi\ &obrazce\ (da/ne)<Tab>:set\ hls!
menutrans Toggle\ &Ignore-case<Tab>:set\ ic! Zanemari\ \velicinu\ &slova\ (da/ne)<Tab>:set\ ic!
menutrans Toggle\ &Showmatch<Tab>:set\ sm! Proveri\ pratecu\ &zagradu\ (da/ne)<Tab>:set\ sm!
menutrans Toggle\ &Ignoring\ Case<Tab>:set\ ic! Zanemari\ velicinu\ &slova\ (da/ne)<Tab>:set\ ic!
menutrans Toggle\ &Showing\ Matched\ Pairs<Tab>:set\ sm! Proveri\ pratecu\ &zagradu\ (da/ne)<Tab>:set\ sm!
menutrans &Context\ lines Vidljivi\ &redovi
menutrans &Virtual\ Edit Virtuelno\ &uredjivanje
menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! Rezim\ u&nosa\ (da/ne)<Tab>:set\ im!
menutrans Toggle\ Vi\ C&ompatible<Tab>:set\ cp! '&Vi'\ saglasno\ (da/ne)<Tab>:set\ cp!
menutrans Toggle\ Vi\ C&ompatibility<Tab>:set\ cp! '&Vi'\ saglasno\ (da/ne)<Tab>:set\ cp!
menutrans Search\ &Path\.\.\. Putanja\ &pretrage\.\.\.
menutrans Ta&g\ Files\.\.\. &Datoteke\ oznaka\.\.\.
menutrans Toggle\ &Toolbar Linija\ sa\ &alatkama\ (da/ne)
@@ -85,28 +91,30 @@ menutrans Block\ and\ Insert Blok\ i\ unos
menutrans Always Uvek
" Edit/File Settings
menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! Redni\ &brojevi\ (da/ne)<Tab>:set\ nu!
menutrans Toggle\ &List\ Mode<Tab>:set\ list! Rezim\ &liste\ (da/ne)<Tab>:set\ list!
menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! Obavijanje\ &redova\ (da/ne)<Tab>:set\ wrap!
menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! Prelomi\ &na\ rec\ (da/ne)<Tab>:set\ lbr!
menutrans Toggle\ &expand-tab<Tab>:set\ et! Razmaci\ umesto\ &tabulacije\ (da/ne)<Tab>:set\ et!
menutrans Toggle\ &auto-indent<Tab>:set\ ai! Auto-&uvlacenje\ (da/ne)<Tab>:set\ ai!
menutrans Toggle\ &C-indenting<Tab>:set\ cin! &Ce-uvlacenje\ (da/ne)<Tab>:set\ cin!
menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! Prikazi\ &numeraciju\ linija\ (da/ne)<Tab>:set\ nu!
menutrans Toggle\ Relati&ve\ Line\ Numbering<Tab>:set\ rnu! Prikazi\ Relati&vnu\ numeraciju\ linija\ (da/ne)<Tab>:set\ rnu!
menutrans Toggle\ &List\ Mode<Tab>:set\ list! Rezim\ &liste\ (da/ne)<Tab>:set\ list!
menutrans Toggle\ Line\ &Wrapping<Tab>:set\ wrap! Obavijanje\ &redova\ (da/ne)<Tab>:set\ wrap!
menutrans Toggle\ W&rapping\ at\ Word<Tab>:set\ lbr! Prelomi\ &na\ rec\ (da/ne)<Tab>:set\ lbr!
menutrans Toggle\ Tab\ &Expanding<Tab>:set\ et! Razmaci\ umesto\ &tabulacije\ (da/ne)<Tab>:set\ et!
menutrans Toggle\ &Auto\ Indenting<Tab>:set\ ai! Auto-&uvlacenje\ (da/ne)<Tab>:set\ ai!
menutrans Toggle\ &C-Style\ Indenting<Tab>:set\ cin! &C-uvlacenje\ (da/ne)<Tab>:set\ cin!
" Edit/Keymap
menutrans None Nijedan
menutrans None Bez\ preslikavanja
" Tools menu
menutrans &Tools &Alatke
menutrans &Jump\ to\ this\ tag<Tab>g^] Skoci\ na\ &ovu\ oznaku<Tab>g^]
menutrans Jump\ &back<Tab>^T Skoci\ &natrag<Tab>^T
menutrans Build\ &Tags\ File Izgradi\ &datoteku\ oznaka
menutrans &Spelling Pra&vopis
menutrans &Folding &Podvijanje
menutrans Create\ &Fold<Tab>zf S&tvori\ podvijutak<Tab>zf
menutrans &Delete\ Fold<Tab>zd O&brisi\ podvijutak<Tab>zd
menutrans Delete\ &All\ Folds<Tab>zD Obrisi\ sve\ po&dvijutke<Tab>zD
menutrans Fold\ column\ &width Sirina\ &reda\ podvijutka
menutrans &Diff &Uporedjivanje
"menutrans &Diff &Uporedjivanje
menutrans &Make<Tab>:make 'mak&e'<Tab>:make
menutrans &List\ Errors<Tab>:cl Spisak\ &gresaka<Tab>:cl
menutrans L&ist\ Messages<Tab>:cl! Sp&isak\ poruka<Tab>:cl!
@@ -115,32 +123,49 @@ menutrans &Previous\ Error<Tab>:cp Pre&thodna\ greska<Tab>:cp
menutrans &Older\ List<Tab>:cold Stari\ spisa&k<Tab>:cold
menutrans N&ewer\ List<Tab>:cnew No&vi\ spisak<Tab>:cnew
menutrans Error\ &Window Prozor\ sa\ g&reskama
menutrans &Set\ Compiler I&zaberi\ prevodioca
menutrans Se&t\ Compiler I&zaberi\ prevodioca
menutrans &Convert\ to\ HEX<Tab>:%!xxd Pretvori\ u\ &HEKS<Tab>:%!xxd
menutrans Conve&rt\ back<Tab>:%!xxd\ -r Vr&ati\ u\ prvobitan\ oblik<Tab>:%!xxd\ -r
menutrans Show\ Compiler\ Se&ttings\ in\ Menu Prikazi\ pode&savanja\ prevodioca\ u\ meniju
" Tools/Spelling
menutrans &Spell\ Check\ On &Ukljuci\ proveru\ pravopisa
menutrans Spell\ Check\ &Off &Iskljuci\ proveru\ pravopisa
menutrans To\ &Next\ Error<Tab>]s Idi\ na\ &sledecu\ gresku<Tab>]s
menutrans To\ &Previous\ Error<Tab>[s Idi\ na\ &prethodnu\ gresku<Tab>[s
menutrans Suggest\ &Corrections<Tab>z= Predlozi\ isp&ravke<Tab>z=
menutrans &Repeat\ Correction<Tab>:spellrepall P&onovi\ ispravku<Tab>:spellrepall
menutrans Set\ Language\ to\ "en" Postavi\ jezik\ na\ "en"
menutrans Set\ Language\ to\ "en_au" Postavi\ jezik\ na\ "en_au"
menutrans Set\ Language\ to\ "en_ca" Postavi\ jezik\ na\ "en_ca"
menutrans Set\ Language\ to\ "en_gb" Postavi\ jezik\ na\ "en_gb"
menutrans Set\ Language\ to\ "en_nz" Postavi\ jezik\ na\ "en_nz"
menutrans Set\ Language\ to\ "en_us" Postavi\ jezik\ na\ "en_us"
menutrans &Find\ More\ Languages Pronadji\ jos\ jezika
" Tools/Folding
menutrans &Enable/Disable\ folds<Tab>zi &Omoguci/prekini\ podvijanje<Tab>zi
menutrans &View\ Cursor\ Line<Tab>zv &Pokazi\ red\ sa\ kursorom<Tab>zv
menutrans &View\ Cursor\ Line<Tab>zv &Pokazi\ red\ sa\ kursorom<Tab>zv
menutrans Vie&w\ Cursor\ Line\ only<Tab>zMzx Pokazi\ &samo\ red\ sa\ kursorom<Tab>zMzx
menutrans C&lose\ more\ folds<Tab>zm &Zatvori\ vise\ podvijutaka<Tab>zm
menutrans &Close\ all\ folds<Tab>zM Zatvori\ s&ve\ podvijutke<Tab>zM
menutrans O&pen\ more\ folds<Tab>zr Otvori\ vis&e\ podvijutaka<Tab>zr
menutrans &Open\ all\ folds<Tab>zR O&tvori\ sve\ podvijutke<Tab>zR
menutrans Fold\ Met&hod &Nacin\ podvijanja
menutrans Fold\ Col&umn\ Width Sirina\ kolone\ ispred\ podvijutaka
" Tools/Folding/Fold Method
menutrans M&anual &Rucno
menutrans I&ndent &Uvucenost
menutrans E&xpression &Izraz
menutrans S&yntax &Sintaksa
menutrans M&anual &Rucno
menutrans I&ndent &Uvucenost
menutrans E&xpression &Izraz
menutrans S&yntax &Sintaksa
"menutrans &Diff
menutrans Ma&rker &Oznaka
menutrans Ma&rker &Oznaka
" Tools/Diff
menutrans &Update &Azuriraj
menutrans &Get\ Block &Prihvati\ izmenu
menutrans &Put\ Block Pre&baci\ izmenu
menutrans &Update &Azuriraj
menutrans &Get\ Block &Prihvati\ blok\ izmena
menutrans &Put\ Block Pre&baci\ blok\ izmena
" Tools/Error Window
menutrans &Update<Tab>:cwin &Azuriraj<Tab>:cwin
@@ -188,8 +213,10 @@ menutrans Cu&t &Iseci
menutrans &Copy &Kopiraj
menutrans &Paste &Ubaci
menutrans &Delete I&zbrisi
menutrans Select\ Blockwise Biraj\ &pravougaono
menutrans Select\ Blockwise Biraj\ b&lokovski
menutrans Select\ &Word Izaberi\ &rec
menutrans Select\ &Sentence Izaberi\ r&ecenicu
menutrans Select\ Pa&ragraph Izaberi\ &paragraf
menutrans Select\ &Line Izaberi\ r&ed
menutrans Select\ &Block Izaberi\ &blok
menutrans Select\ &All Izaberi\ &sve
@@ -235,9 +262,9 @@ endif
" Syntax menu
menutrans &Syntax &Sintaksa
menutrans &Show\ filetypes\ in\ menu Izbor\ 'filetype'\ iz\ &menija
menutrans Set\ '&syntax'\ only Pode&si\ 'syntax'\ samo
menutrans Set\ '&filetype'\ too Podesi\ 'filetype'\ &takodje
menutrans &Show\ File\ Types\ in\ Menu Prikazi\ tipove\ datoteka\ u\ &meniju
menutrans Set\ '&syntax'\ only Pode&si\ samo\ 'syntax'
menutrans Set\ '&filetype'\ too Podesi\ &takodje\ i\ 'filetype'
menutrans &Off &Iskljuceno
menutrans &Manual &Rucno
menutrans A&utomatic &Automatski
@@ -255,9 +282,13 @@ let g:menutrans_tags_dialog = "Unesite imena datoteka sa oznakama\nRazdvojite za
let g:menutrans_textwidth_dialog = "Unesite novu sirinu teksta (0 sprecava prelom)"
let g:menutrans_fileformat_dialog = "Izaberite vrstu datoteke"
let g:menutrans_fileformat_dialog = "Izaberite format zapisa datoteke"
let g:menutrans_fileformat_choices = "&Unix\n&Dos\n&Mac\n&Otkazi"
let menutrans_no_file = "[Nema datoteke]"
let &cpo = s:keepcpo
unlet s:keepcpo
" vim: tw=0 keymap=serbian
+67 -36
View File
@@ -1,6 +1,7 @@
" Menu Translations: Serbian
" Maintainer: Aleksandar Jelenak <ajelenak AT yahoo.com>
" Last Change: Fri, 30 May 2003 12:04:48 -0400
" Last Change: Fri, 30 May 2003 10:17:39 Eastern Daylight Time
" Adapted for VIM 8 by: Ivan Pe¹iæ on 2017-12-28 12:05+0400
" Quit when menu translations have already been done.
if exists("did_menu_trans")
@@ -21,6 +22,7 @@ menutrans &Find &Na
menutrans &Credits &Zasluge
menutrans Co&pying P&reuzimanje
menutrans O&rphans &Siroèiæi
menutrans &Sponsor/Register Sponzor/&Registrujte\ se
menutrans &Version &Verzija
menutrans &About &O\ programu
@@ -28,6 +30,7 @@ menutrans &About &O\ programu
menutrans &File &Datoteka
menutrans &Open\.\.\.<Tab>:e &Otvori\.\.\.<Tab>:e
menutrans Sp&lit-Open\.\.\.<Tab>:sp &Podeli-otvori\.\.\.<Tab>:sp
menutrans Open\ Tab\.\.\.<Tab>:tabnew Otvori\ karticu\.\.\.<Tab>:tabnew
menutrans &New<Tab>:enew &Nova<Tab>:enew
menutrans &Close<Tab>:close &Zatvori<Tab>:close
menutrans &Save<Tab>:w &Saèuvaj<Tab>:w
@@ -54,24 +57,27 @@ menutrans &Select\ all<Tab>ggVG Izaberi\ sv&e<Tab>ggVG
menutrans &Find\.\.\. &Naði\.\.\.
menutrans Find\ and\ Rep&lace\.\.\. Naði\ i\ &zameni\.\.\.
menutrans Settings\ &Window P&rozor\ pode¹avanja
menutrans Startup\ &Settings Po&de¹avanja\ pri\ pokretanju
menutrans &Global\ Settings Opta\ pode¹avanja
menutrans F&ile\ Settings Pode¹avanja\ za\ da&toteke
menutrans &Shiftwidth &Pomeraj
menutrans Soft\ &Tabstop &Meka\ tabulacija
menutrans Te&xt\ Width\.\.\. &©irina\ teksta\.\.\.
menutrans &File\ Format\.\.\. &Vrsta\ datoteke\.\.\.
menutrans C&olor\ Scheme Bo&je
menutrans &Keymap Pres&likavanje\ tastature
menutrans Show\ C&olor\ Schemes\ in\ Menu Prika¾i\ ¹eme\ bo&ja\ u\ meniju
menutrans C&olor\ Schemeeme\ bo&ja
menutrans Show\ &Keymaps\ in\ Menu Prika¾i\ pres&likavanja\ tastature\ u\ meniju
menutrans &Keymap Pres&likavanja\ tastature
menutrans Select\ Fo&nt\.\.\. Izbor\ &fonta\.\.\.
" Edit/Global Settings
menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! Naglasi\ &obrazce\ (da/ne)<Tab>:set\ hls!
menutrans Toggle\ &Ignore-case<Tab>:set\ ic! Zanemari\ \velièinu\ &slova\ (da/ne)<Tab>:set\ ic!
menutrans Toggle\ &Showmatch<Tab>:set\ sm! Proveri\ prateæu\ &zagradu\ (da/ne)<Tab>:set\ sm!
menutrans Toggle\ &Ignoring\ Case<Tab>:set\ ic! Zanemari\ velièinu\ &slova\ (da/ne)<Tab>:set\ ic!
menutrans Toggle\ &Showing\ Matched\ Pairs<Tab>:set\ sm! Proveri\ prateæu\ &zagradu\ (da/ne)<Tab>:set\ sm!
menutrans &Context\ lines Vidljivi\ &redovi
menutrans &Virtual\ Edit Virtuelno\ &ureðivanje
menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! Re¾im\ u&nosa\ (da/ne)<Tab>:set\ im!
menutrans Toggle\ Vi\ C&ompatible<Tab>:set\ cp! '&Vi'\ saglasno\ (da/ne)<Tab>:set\ cp!
menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! Re¾im\ u&nosa\ (da/ne)<Tab>:set\ im!
menutrans Toggle\ Vi\ C&ompatibility<Tab>:set\ cp! '&Vi'\ saglasno\ (da/ne)<Tab>:set\ cp!
menutrans Search\ &Path\.\.\. Putanja\ &pretrage\.\.\.
menutrans Ta&g\ Files\.\.\. &Datoteke\ oznaka\.\.\.
menutrans Toggle\ &Toolbar Linija\ sa\ &alatkama\ (da/ne)
@@ -87,28 +93,30 @@ menutrans Block\ and\ Insert Blok\ i\ unos
menutrans Always Uvek
" Edit/File Settings
menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! Redni\ &brojevi\ (da/ne)<Tab>:set\ nu!
menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! Prika¾i\ &numeraciju\ linija\ (da/ne)<Tab>:set\ nu!
menutrans Toggle\ Relati&ve\ Line\ Numbering<Tab>:set\ rnu! Prika¾i\ Relati&vnu\ numeraciju\ linija\ (da/ne)<Tab>:set\ rnu!
menutrans Toggle\ &List\ Mode<Tab>:set\ list! Re¾im\ &liste\ (da/ne)<Tab>:set\ list!
menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! Obavijanje\ &redova\ (da/ne)<Tab>:set\ wrap!
menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! Prelomi\ &na\ reè\ (da/ne)<Tab>:set\ lbr!
menutrans Toggle\ &expand-tab<Tab>:set\ et! Razmaci\ umesto\ &tabulacije\ (da/ne)<Tab>:set\ et!
menutrans Toggle\ &auto-indent<Tab>:set\ ai! Auto-&uvlaèenje\ (da/ne)<Tab>:set\ ai!
menutrans Toggle\ &C-indenting<Tab>:set\ cin! &Ce-uvlaèenje\ (da/ne)<Tab>:set\ cin!
menutrans Toggle\ Line\ &Wrapping<Tab>:set\ wrap! Obavijanje\ &redova\ (da/ne)<Tab>:set\ wrap!
menutrans Toggle\ W&rapping\ at\ Word<Tab>:set\ lbr! Prelomi\ &na\ reè\ (da/ne)<Tab>:set\ lbr!
menutrans Toggle\ Tab\ &Expanding<Tab>:set\ et! Razmaci\ umesto\ &tabulacije\ (da/ne)<Tab>:set\ et!
menutrans Toggle\ &Auto\ Indenting<Tab>:set\ ai! Auto-&uvlaèenje\ (da/ne)<Tab>:set\ ai!
menutrans Toggle\ &C-Style\ Indenting<Tab>:set\ cin! &C-uvlaèenje\ (da/ne)<Tab>:set\ cin!
" Edit/Keymap
menutrans None Nijedan
menutrans None Bez\ preslikavanja
" Tools menu
menutrans &Tools &Alatke
menutrans &Jump\ to\ this\ tag<Tab>g^] Skoèi\ na\ &ovu\ oznaku<Tab>g^]
menutrans Jump\ &back<Tab>^T Skoèi\ &natrag<Tab>^T
menutrans Build\ &Tags\ File Izgradi\ &datoteku\ oznaka
menutrans &Spelling Pra&vopis
menutrans &Folding &Podvijanje
menutrans Create\ &Fold<Tab>zf S&tvori\ podvijutak<Tab>zf
menutrans &Delete\ Fold<Tab>zd O&bri¹i\ podvijutak<Tab>zd
menutrans Delete\ &All\ Folds<Tab>zD Obri¹i\ sve\ po&dvijutke<Tab>zD
menutrans Fold\ column\ &width ©irina\ &reda\ podvijutka
menutrans &Diff &Uporeðivanje
"menutrans &Diff &Uporeðivanje
menutrans &Make<Tab>:make 'mak&e'<Tab>:make
menutrans &List\ Errors<Tab>:cl Spisak\ &gre¹aka<Tab>:cl
menutrans L&ist\ Messages<Tab>:cl! Sp&isak\ poruka<Tab>:cl!
@@ -117,9 +125,25 @@ menutrans &Previous\ Error<Tab>:cp Pre&thodna\ gre
menutrans &Older\ List<Tab>:cold Stari\ spisa&k<Tab>:cold
menutrans N&ewer\ List<Tab>:cnew No&vi\ spisak<Tab>:cnew
menutrans Error\ &Window Prozor\ sa\ g&re¹kama
menutrans &Set\ Compiler I&zaberi\ prevodioca
menutrans Se&t\ Compiler I&zaberi\ prevodioca
menutrans &Convert\ to\ HEX<Tab>:%!xxd Pretvori\ u\ &HEKS<Tab>:%!xxd
menutrans Conve&rt\ back<Tab>:%!xxd\ -r Vr&ati\ u\ prvobitan\ oblik<Tab>:%!xxd\ -r
menutrans Show\ Compiler\ Se&ttings\ in\ Menu Prika¾i\ podeavanja\ prevodioca\ u\ meniju
" Tools/Spelling
menutrans &Spell\ Check\ On &Ukljuèi\ proveru\ pravopisa
menutrans Spell\ Check\ &Off &Iskljuèi\ proveru\ pravopisa
menutrans To\ &Next\ Error<Tab>]s Idi\ na\ &sledeæu\ gre¹ku<Tab>]s
menutrans To\ &Previous\ Error<Tab>[s Idi\ na\ &prethodnu\ gre¹ku<Tab>[s
menutrans Suggest\ &Corrections<Tab>z= Predlo¾i\ isp&ravke<Tab>z=
menutrans &Repeat\ Correction<Tab>:spellrepall P&onovi\ ispravku<Tab>:spellrepall
menutrans Set\ Language\ to\ "en" Postavi\ jezik\ na\ "en"
menutrans Set\ Language\ to\ "en_au" Postavi\ jezik\ na\ "en_au"
menutrans Set\ Language\ to\ "en_ca" Postavi\ jezik\ na\ "en_ca"
menutrans Set\ Language\ to\ "en_gb" Postavi\ jezik\ na\ "en_gb"
menutrans Set\ Language\ to\ "en_nz" Postavi\ jezik\ na\ "en_nz"
menutrans Set\ Language\ to\ "en_us" Postavi\ jezik\ na\ "en_us"
menutrans &Find\ More\ Languages Pronaði\ jo¹\ jezika
" Tools/Folding
menutrans &Enable/Disable\ folds<Tab>zi &Omoguæi/prekini\ podvijanje<Tab>zi
@@ -130,6 +154,7 @@ menutrans &Close\ all\ folds<Tab>zM Zatvori\ s&ve\ podvijutke<Tab>zM
menutrans O&pen\ more\ folds<Tab>zr Otvori\ vi¹&e\ podvijutaka<Tab>zr
menutrans &Open\ all\ folds<Tab>zR O&tvori\ sve\ podvijutke<Tab>zR
menutrans Fold\ Met&hod &Naèin\ podvijanja
menutrans Fold\ Col&umn\ Width ©irina\ kolone\ ispred\ podvijutaka
" Tools/Folding/Fold Method
menutrans M&anual &Ruèno
@@ -141,8 +166,8 @@ menutrans Ma&rker &Oznaka
" Tools/Diff
menutrans &Update &A¾uriraj
menutrans &Get\ Block &Prihvati\ izmenu
menutrans &Put\ Block Pre&baci\ izmenu
menutrans &Get\ Block &Prihvati\ blok\ izmena
menutrans &Put\ Block Pre&baci\ blok\ izmena
" Tools/Error Window
menutrans &Update<Tab>:cwin &A¾uriraj<Tab>:cwin
@@ -190,8 +215,10 @@ menutrans Cu&t &Iseci
menutrans &Copy &Kopiraj
menutrans &Paste &Ubaci
menutrans &Delete I&zbri¹i
menutrans Select\ Blockwise Biraj\ &pravougaono
menutrans Select\ Blockwise Biraj\ b&lokovski
menutrans Select\ &Word Izaberi\ &reè
menutrans Select\ &Sentence Izaberi\ r&eèenicu
menutrans Select\ Pa&ragraph Izaberi\ &paragraf
menutrans Select\ &Line Izaberi\ r&ed
menutrans Select\ &Block Izaberi\ &blok
menutrans Select\ &All Izaberi\ &sve
@@ -202,20 +229,20 @@ if has("toolbar")
delfun Do_toolbar_tmenu
endif
fun Do_toolbar_tmenu()
tmenu ToolBar.Open Uèitaj
tmenu ToolBar.Save Saèuvaj
tmenu ToolBar.Open Uèitaj
tmenu ToolBar.Save Saèuvaj
tmenu ToolBar.SaveAll Saèuvaj sve
tmenu ToolBar.Print ©tampaj
tmenu ToolBar.Undo Vrati
tmenu ToolBar.Redo Povrati
tmenu ToolBar.Cut Iseci
tmenu ToolBar.Copy Kopiraj
tmenu ToolBar.Undo Vrati
tmenu ToolBar.Redo Povrati
tmenu ToolBar.Cut Iseci
tmenu ToolBar.Copy Kopiraj
tmenu ToolBar.Paste Ubaci
tmenu ToolBar.Find Naði
tmenu ToolBar.Find Naði
tmenu ToolBar.FindNext Naði sledeæi
tmenu ToolBar.FindPrev Naði prethodni
tmenu ToolBar.Replace Zameni
tmenu ToolBar.New Novi
tmenu ToolBar.New Novi
tmenu ToolBar.WinSplit Podeli prozor
tmenu ToolBar.WinMax Maksimalna visina
tmenu ToolBar.WinMin Minimalna visina
@@ -226,25 +253,25 @@ if has("toolbar")
tmenu ToolBar.LoadSesn Uèitaj seansu
tmenu ToolBar.SaveSesn Saèuvaj seansu
tmenu ToolBar.RunScript Izvr¹i spis
tmenu ToolBar.Make 'make'
tmenu ToolBar.Make 'make'
tmenu ToolBar.Shell Operativno okru¾enje
tmenu ToolBar.RunCtags Napravi oznake
tmenu ToolBar.TagJump Idi na oznaku
tmenu ToolBar.Help Pomoæ
tmenu ToolBar.Help Pomoæ
tmenu ToolBar.FindHelp Naði obja¹njenje
endfun
endif
" Syntax menu
menutrans &Syntax &Sintaksa
menutrans &Show\ filetypes\ in\ menu Izbor\ 'filetype'\ iz\ &menija
menutrans Set\ '&syntax'\ only Pode&si\ 'syntax'\ samo
menutrans Set\ '&filetype'\ too Podesi\ 'filetype'\ &takoðe
menutrans &Off &Iskljuèeno
menutrans &Show\ File\ Types\ in\ Menu Prika¾i\ tipove\ datoteka\ u\ &meniju
menutrans Set\ '&syntax'\ only Pode&si\ samo\ 'syntax'
menutrans Set\ '&filetype'\ too Podesi\ &takoðe\ i\ 'filetype'
menutrans &Off &Iskljuèeno
menutrans &Manual &Ruèno
menutrans A&utomatic &Automatski
menutrans A&utomatic &Automatski
menutrans on/off\ for\ &This\ file Da/ne\ za\ ovu\ &datoteku
menutrans Co&lor\ test Provera\ &boja
menutrans Co&lor\ test Provera\ &boja
menutrans &Highlight\ test Provera\ isti&canja
menutrans &Convert\ to\ HTML Pretvori\ &u\ HTML
@@ -257,9 +284,13 @@ let g:menutrans_tags_dialog = "Unesite imena datoteka sa oznakama\nRazdvojite za
let g:menutrans_textwidth_dialog = "Unesite novu ¹irinu teksta (0 spreèava prelom)"
let g:menutrans_fileformat_dialog = "Izaberite vrstu datoteke"
let g:menutrans_fileformat_dialog = "Izaberite format zapisa datoteke"
let g:menutrans_fileformat_choices = "&Unix\n&Dos\n&Mac\n&Otka¾i"
let menutrans_no_file = "[Nema datoteke]"
let &cpo = s:keepcpo
unlet s:keepcpo
" vim: tw=0 keymap=serbian
+67 -36
View File
@@ -1,6 +1,7 @@
" Menu Translations: Serbian
" Maintainer: Aleksandar Jelenak <ajelenak AT yahoo.com>
" Last Change: Fri, 30 May 2003 12:02:07 -0400
" Last Change: Fri, 30 May 2003 10:17:39 Eastern Daylight Time
" Adapted for VIM 8 by: ¸ÒÐÝ ¿ÕèØû on 2017-12-28 12:05+0400
" Quit when menu translations have already been done.
if exists("did_menu_trans")
@@ -21,6 +22,7 @@ menutrans &Find &
menutrans &CreditsÐáÛãÓÕ
menutrans Co&pying ¿&àÕãרÜÐúÕ
menutrans O&rphans &ÁØàÞçØûØ
menutrans &Sponsor/Register ÁßÞÝ×Þà/&ÀÕÓØáâàãøâÕ\ áÕ
menutrans &VersionÕàרøÐ
menutrans &About &¾\ ßàÞÓàÐÜã
@@ -28,6 +30,7 @@ menutrans &About &
menutrans &File &´ÐâÞâÕÚÐ
menutrans &Open\.\.\.<Tab>:eâÒÞàØ\.\.\.<Tab>:e
menutrans Sp&lit-Open\.\.\.<Tab>:sp &¿ÞÔÕÛØ-ÞâÒÞàØ\.\.\.<Tab>:sp
menutrans Open\ Tab\.\.\.<Tab>:tabnew ¾âÒÞàØ\ ÚÐàâØæã\.\.\.<Tab>:tabnew
menutrans &New<Tab>:enewÞÒÐ<Tab>:enew
menutrans &Close<Tab>:closeÐâÒÞàØ<Tab>:close
menutrans &Save<Tab>:w &ÁÐçãÒÐø<Tab>:w
@@ -54,24 +57,27 @@ menutrans &Select\ all<Tab>ggVG
menutrans &Find\.\.\. &½ÐòØ\.\.\.
menutrans Find\ and\ Rep&lace\.\.\. ½ÐòØ\ Ø\ &×ÐÜÕÝØ\.\.\.
menutrans Settings\ &Window ¿&àÞ×Þà\ ßÞÔÕèÐÒÐúÐ
menutrans Startup\ &Settings ¿Þ&ÔÕèÐÒÐúÐ\ ßàØ\ ßÞÚàÕâÐúã
menutrans &Global\ Settings ¾ß&èâÐ\ ßÞÔÕèÐÒÐúÐ
menutrans F&ile\ Settings ¿ÞÔÕèÐÒÐúÐ\ ×Ð\ ÔÐ&âÞâÕÚÕ
menutrans &Shiftwidth &¿ÞÜÕàÐø
menutrans Soft\ &TabstopÕÚÐ\ âÐÑãÛÐæØøÐ
menutrans Te&xt\ Width\.\.\. &ÈØàØÝÐ\ âÕÚáâÐ\.\.\.
menutrans &File\ Format\.\.\. &²àáâÐ\ ÔÐâÞâÕÚÕ\.\.\.
menutrans C&olor\ Scheme ±Þ&øÕ
menutrans &Keymap ¿àÕá&ÛØÚÐÒÐúÕ\ âÐáâÐâãàÕ
menutrans Show\ C&olor\ Schemes\ in\ Menu ¿àØÚÐÖØ\ èÕÜÕ\ ÑÞ&øÐ\ ã\ ÜÕÝØøã
menutrans C&olor\ Scheme \ÈÕÜÕ\ ÑÞ&øÐ
menutrans Show\ &Keymaps\ in\ Menu ¿àØÚÐÖØ\ ßàÕá&ÛØÚÐÒÐúÐ\ âÐáâÐâãàÕ\ ã\ ÜÕÝØøã
menutrans &Keymap ¿àÕá&ÛØÚÐÒÐúÐ\ âÐáâÐâãàÕ
menutrans Select\ Fo&nt\.\.\. ¸×ÑÞà\ &äÞÝâÐ\.\.\.
" Edit/Global Settings
menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! ½ÐÓÛÐáØ\ &ÞÑàÐ׿Õ\ (ÔÐ/ÝÕ)<Tab>:set\ hls!
menutrans Toggle\ &Ignore-case<Tab>:set\ ic! ·ÐÝÕÜÐàØ\ \ÒÕÛØçØÝã\ &áÛÞÒÐ\ (ÔÐ/ÝÕ)<Tab>:set\ ic!
menutrans Toggle\ &Showmatch<Tab>:set\ sm! ¿àÞÒÕàØ\ ßàÐâÕûã\ &×ÐÓàÐÔã\ (ÔÐ/ÝÕ)<Tab>:set\ sm!
menutrans Toggle\ &Ignoring\ Case<Tab>:set\ ic! ·ÐÝÕÜÐàØ\ ÒÕÛØçØÝã\ &áÛÞÒÐ\ (ÔÐ/ÝÕ)<Tab>:set\ ic!
menutrans Toggle\ &Showing\ Matched\ Pairs<Tab>:set\ sm! ¿àÞÒÕàØ\ ßàÐâÕûã\ &×ÐÓàÐÔã\ (ÔÐ/ÝÕ)<Tab>:set\ sm!
menutrans &Context\ lines ²ØÔùØÒØ\ &àÕÔÞÒØ
menutrans &Virtual\ Edit ²ØàâãÕÛÝÞ\ &ãàÕòØÒÐúÕ
menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! ÀÕÖØÜ\ ã&ÝÞáÐ\ (ÔÐ/ÝÕ)<Tab>:set\ im!
menutrans Toggle\ Vi\ C&ompatible<Tab>:set\ cp! '&Vi'\ áÐÓÛÐáÝÞ\ (ÔÐ/ÝÕ)<Tab>:set\ cp!
menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! ÀÕÖØÜ\ ã&ÝÞáÐ\ (ÔÐ/ÝÕ)<Tab>:set\ im!
menutrans Toggle\ Vi\ C&ompatibility<Tab>:set\ cp! '&Vi'\ áÐÓÛÐáÝÞ\ (ÔÐ/ÝÕ)<Tab>:set\ cp!
menutrans Search\ &Path\.\.\. ¿ãâÐúÐ\ &ßàÕâàÐÓÕ\.\.\.
menutrans Ta&g\ Files\.\.\. &´ÐâÞâÕÚÕ\ Þ×ÝÐÚÐ\.\.\.
menutrans Toggle\ &Toolbar »ØÝØøÐ\ áÐ\ &ÐÛÐâÚÐÜÐ\ (ÔÐ/ÝÕ)
@@ -87,28 +93,30 @@ menutrans Block\ and\ Insert
menutrans Always ÃÒÕÚ
" Edit/File Settings
menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! ÀÕÔÝØ\ &ÑàÞøÕÒØ\ (ÔÐ/ÝÕ)<Tab>:set\ nu!
menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! ¿àØÚÐÖØ\ &ÝãÜÕàÐæØøã\ ÛØÝØøÐ\ (ÔÐ/ÝÕ)<Tab>:set\ nu!
menutrans Toggle\ Relati&ve\ Line\ Numbering<Tab>:set\ rnu! ¿àØÚÐÖØ\ ÀÕÛÐâØ&ÒÝã\ ÝãÜÕàÐæØøã\ ÛØÝØøÐ\ (ÔÐ/ÝÕ)<Tab>:set\ rnu!
menutrans Toggle\ &List\ Mode<Tab>:set\ list! ÀÕÖØÜ\ &ÛØáâÕ\ (ÔÐ/ÝÕ)<Tab>:set\ list!
menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! ¾ÑÐÒØøÐúÕ\ &àÕÔÞÒÐ\ (ÔÐ/ÝÕ)<Tab>:set\ wrap!
menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! ¿àÕÛÞÜØ\ &ÝÐ\ àÕç\ (ÔÐ/ÝÕ)<Tab>:set\ lbr!
menutrans Toggle\ &expand-tab<Tab>:set\ et! ÀÐ×ÜÐæØ\ ãÜÕáâÞ\ &âÐÑãÛÐæØøÕ\ (ÔÐ/ÝÕ)<Tab>:set\ et!
menutrans Toggle\ &auto-indent<Tab>:set\ ai! °ãâÞ-&ãÒÛÐçÕúÕ\ (ÔÐ/ÝÕ)<Tab>:set\ ai!
menutrans Toggle\ &C-indenting<Tab>:set\ cin! &ÆÕ-ãÒÛÐçÕúÕ\ (ÔÐ/ÝÕ)<Tab>:set\ cin!
menutrans Toggle\ Line\ &Wrapping<Tab>:set\ wrap! ¾ÑÐÒØøÐúÕ\ &àÕÔÞÒÐ\ (ÔÐ/ÝÕ)<Tab>:set\ wrap!
menutrans Toggle\ W&rapping\ at\ Word<Tab>:set\ lbr! ¿àÕÛÞÜØ\ &ÝÐ\ àÕç\ (ÔÐ/ÝÕ)<Tab>:set\ lbr!
menutrans Toggle\ Tab\ &Expanding<Tab>:set\ et! ÀÐ×ÜÐæØ\ ãÜÕáâÞ\ &âÐÑãÛÐæØøÕ\ (ÔÐ/ÝÕ)<Tab>:set\ et!
menutrans Toggle\ &Auto\ Indenting<Tab>:set\ ai! °ãâÞ-&ãÒÛÐçÕúÕ\ (ÔÐ/ÝÕ)<Tab>:set\ ai!
menutrans Toggle\ &C-Style\ Indenting<Tab>:set\ cin! &C-ãÒÛÐçÕúÕ\ (ÔÐ/ÝÕ)<Tab>:set\ cin!
" Edit/Keymap
menutrans None ½ØøÕÔÐÝ
menutrans None ±Õ×\ ßàÕáÛØÚÐÒÐúÐ
" Tools menu
menutrans &ToolsÛÐâÚÕ
menutrans &Jump\ to\ this\ tag<Tab>g^] ÁÚÞçØ\ ÝÐ\ &ÞÒã\ Þ×ÝÐÚã<Tab>g^]
menutrans Jump\ &back<Tab>^T ÁÚÞçØ\ &ÝÐâàÐÓ<Tab>^T
menutrans Build\ &Tags\ File ¸×ÓàÐÔØ\ &ÔÐâÞâÕÚã\ Þ×ÝÐÚÐ
menutrans &Spelling ¿àÐ&ÒÞߨá
menutrans &Folding &¿ÞÔÒØøÐúÕ
menutrans Create\ &Fold<Tab>zf Á&âÒÞàØ\ ßÞÔÒØøãâÐÚ<Tab>zf
menutrans &Delete\ Fold<Tab>zd ¾&ÑàØèØ\ ßÞÔÒØøãâÐÚ<Tab>zd
menutrans Delete\ &All\ Folds<Tab>zD ¾ÑàØèØ\ áÒÕ\ ßÞ&ÔÒØøãâÚÕ<Tab>zD
menutrans Fold\ column\ &width ÈØàØÝÐ\ &àÕÔÐ\ ßÞÔÒØøãâÚÐ
menutrans &Diff &ÃßÞàÕòØÒÐúÕ
"menutrans &Diff &ÃßÞàÕòØÒÐúÕ
menutrans &Make<Tab>:make 'mak&Õ'<Tab>:make
menutrans &List\ Errors<Tab>:cl ÁߨáÐÚ\ &ÓàÕèÐÚÐ<Tab>:cl
menutrans L&ist\ Messages<Tab>:cl! Áß&ØáÐÚ\ ßÞàãÚÐ<Tab>:cl!
@@ -117,9 +125,25 @@ menutrans &Previous\ Error<Tab>:cp
menutrans &Older\ List<Tab>:cold ÁâÐàØ\ áߨáÐ&Ú<Tab>:cold
menutrans N&ewer\ List<Tab>:cnew ½Þ&ÒØ\ áߨáÐÚ<Tab>:cnew
menutrans Error\ &Window ¿àÞ×Þà\ áÐ\ Ó&àÕèÚÐÜÐ
menutrans &Set\ Compiler ¸&×ÐÑÕàØ\ ßàÕÒÞÔØÞæÐ
menutrans Se&t\ Compiler ¸&×ÐÑÕàØ\ ßàÕÒÞÔØÞæÐ
menutrans &Convert\ to\ HEX<Tab>:%!xxd ¿àÕâÒÞàØ\ ã\ &ŵºÁ<Tab>:%!xxd
menutrans Conve&rt\ back<Tab>:%!xxd\ -r ²à&ÐâØ\ ã\ ßàÒÞÑØâÐÝ\ ÞÑÛØÚ<Tab>:%!xxd\ -r
menutrans Show\ Compiler\ Se&ttings\ in\ Menu ¿àØÚÐÖØ\ ßÞÔÕ&èÐÒÐúÐ\ ßàÕÒÞÔØÞæÐ\ ã\ ÜÕÝØøã
" Tools/Spelling
menutrans &Spell\ Check\ On &ÃÚùãçØ\ ßàÞÒÕàã\ ßàÐÒÞߨáÐ
menutrans Spell\ Check\ &Off &¸áÚùãçØ\ ßàÞÒÕàã\ ßàÐÒÞߨáÐ
menutrans To\ &Next\ Error<Tab>]s ¸ÔØ\ ÝÐ\ &áÛÕÔÕûã\ ÓàÕèÚã<Tab>]s
menutrans To\ &Previous\ Error<Tab>[s ¸ÔØ\ ÝÐ\ &ßàÕâåÞÔÝã\ ÓàÕèÚã<Tab>[s
menutrans Suggest\ &Corrections<Tab>z= ¿àÕÔÛÞÖØ\ Øáß&àÐÒÚÕ<Tab>z=
menutrans &Repeat\ Correction<Tab>:spellrepall ¿&ÞÝÞÒØ\ ØáßàÐÒÚã<Tab>:spellrepall
menutrans Set\ Language\ to\ "en" ¿ÞáâÐÒØ\ øÕרÚ\ ÝÐ\ "en"
menutrans Set\ Language\ to\ "en_au" ¿ÞáâÐÒØ\ øÕרÚ\ ÝÐ\ "en_au"
menutrans Set\ Language\ to\ "en_ca" ¿ÞáâÐÒØ\ øÕרÚ\ ÝÐ\ "en_ca"
menutrans Set\ Language\ to\ "en_gb" ¿ÞáâÐÒØ\ øÕרÚ\ ÝÐ\ "en_gb"
menutrans Set\ Language\ to\ "en_nz" ¿ÞáâÐÒØ\ øÕרÚ\ ÝÐ\ "en_nz"
menutrans Set\ Language\ to\ "en_us" ¿ÞáâÐÒØ\ øÕרÚ\ ÝÐ\ "en_us"
menutrans &Find\ More\ Languages ¿àÞÝÐòØ\ øÞè\ øÕרÚÐ
" Tools/Folding
menutrans &Enable/Disable\ folds<Tab>zi &¾ÜÞÓãûØ/ßàÕÚØÝØ\ ßÞÔÒØøÐúÕ<Tab>zi
@@ -130,6 +154,7 @@ menutrans &Close\ all\ folds<Tab>zM
menutrans O&pen\ more\ folds<Tab>zr ¾âÒÞàØ\ ÒØè&Õ\ ßÞÔÒØøãâÐÚÐ<Tab>zr
menutrans &Open\ all\ folds<Tab>zR ¾&âÒÞàØ\ áÒÕ\ ßÞÔÒØøãâÚÕ<Tab>zR
menutrans Fold\ Met&hodÐçØÝ\ ßÞÔÒØøÐúÐ
menutrans Fold\ Col&umn\ Width ÈØàØÝÐ\ ÚÞÛÞÝÕ\ ØáßàÕÔ\ ßÞÔÒØøãâÐÚÐ
" Tools/Folding/Fold Method
menutrans M&anual &ÀãçÝÞ
@@ -141,8 +166,8 @@ menutrans Ma&rker &
" Tools/Diff
menutrans &UpdateÖãàØàÐø
menutrans &Get\ Block &¿àØåÒÐâØ\ Ø×ÜÕÝã
menutrans &Put\ Block ¿àÕ&ÑÐæØ\ Ø×ÜÕÝã
menutrans &Get\ Block &¿àØåÒÐâØ\ ÑÛÞÚ\ Ø×ÜÕÝa
menutrans &Put\ Block ¿àÕ&ÑÐæØ\ ÑÛÞÚ\ Ø×ÜÕÝÐ
" Tools/Error Window
menutrans &Update<Tab>:cwinÖãàØàÐø<Tab>:cwin
@@ -190,8 +215,10 @@ menutrans Cu&t &
menutrans &Copy &ºÞߨàÐø
menutrans &Paste &ÃÑÐæØ
menutrans &Delete ¸&×ÑàØèØ
menutrans Select\ Blockwise ±ØàÐø\ &ßàÐÒÞãÓÐÞÝÞ
menutrans Select\ Blockwise ±ØàÐø\ Ñ&ÛÞÚÞÒáÚØ
menutrans Select\ &Word ¸×ÐÑÕàØ\ &àÕç
menutrans Select\ &Sentence ¸×ÐÑÕàØ\ à&ÕçÕÝØæã
menutrans Select\ Pa&ragraph ¸×ÐÑÕàØ\ &ßÐàÐÓàÐä
menutrans Select\ &Line ¸×ÐÑÕàØ\ à&ÕÔ
menutrans Select\ &Block ¸×ÐÑÕàØ\ &ÑÛÞÚ
menutrans Select\ &All ¸×ÐÑÕàØ\ &áÒÕ
@@ -202,20 +229,20 @@ if has("toolbar")
delfun Do_toolbar_tmenu
endif
fun Do_toolbar_tmenu()
tmenu ToolBar.Open ÃçØâÐø
tmenu ToolBar.Save ÁÐçãÒÐø
tmenu ToolBar.Open ÃçØâÐø
tmenu ToolBar.Save ÁÐçãÒÐø
tmenu ToolBar.SaveAll ÁÐçãÒÐø áÒÕ
tmenu ToolBar.Print ÈâÐÜßÐø
tmenu ToolBar.Undo ²àÐâØ
tmenu ToolBar.Redo ¿ÞÒàÐâØ
tmenu ToolBar.Cut ¸áÕæØ
tmenu ToolBar.Copy ºÞߨàÐø
tmenu ToolBar.Undo ²àÐâØ
tmenu ToolBar.Redo ¿ÞÒàÐâØ
tmenu ToolBar.Cut ¸áÕæØ
tmenu ToolBar.Copy ºÞߨàÐø
tmenu ToolBar.Paste ÃÑÐæØ
tmenu ToolBar.Find ½ÐòØ
tmenu ToolBar.Find ½ÐòØ
tmenu ToolBar.FindNext ½ÐòØ áÛÕÔÕûØ
tmenu ToolBar.FindPrev ½ÐòØ ßàÕâåÞÔÝØ
tmenu ToolBar.Replace ·ÐÜÕÝØ
tmenu ToolBar.New ½ÞÒØ
tmenu ToolBar.New ½ÞÒØ
tmenu ToolBar.WinSplit ¿ÞÔÕÛØ ßàÞ×Þà
tmenu ToolBar.WinMax ¼ÐÚáØÜÐÛÝÐ ÒØáØÝÐ
tmenu ToolBar.WinMin ¼ØÝØÜÐÛÝÐ ÒØáØÝÐ
@@ -226,25 +253,25 @@ if has("toolbar")
tmenu ToolBar.LoadSesn ÃçØâÐø áÕÐÝáã
tmenu ToolBar.SaveSesn ÁÐçãÒÐø áÕÐÝáã
tmenu ToolBar.RunScript ¸×ÒàèØ áߨá
tmenu ToolBar.Make 'make'
tmenu ToolBar.Make 'make'
tmenu ToolBar.Shell ¾ßÕàÐâØÒÝÞ ÞÚàãÖÕúÕ
tmenu ToolBar.RunCtags ½ÐßàÐÒØ Þ×ÝÐÚÕ
tmenu ToolBar.TagJump ¸ÔØ ÝÐ Þ×ÝÐÚã
tmenu ToolBar.Help ¿ÞÜÞû
tmenu ToolBar.Help ¿ÞÜÞû
tmenu ToolBar.FindHelp ½ÐòØ ÞÑøÐèúÕúÕ
endfun
endif
" Syntax menu
menutrans &Syntax &ÁØÝâÐÚáÐ
menutrans &Show\ filetypes\ in\ menu ¸×ÑÞà\ 'filetype'\ Ø×\ &ÜÕÝØøÐ
menutrans Set\ '&syntax'\ only ¿ÞÔÕ&áØ\ 'syntax'\ áÐÜÞ
menutrans Set\ '&filetype'\ too ¿ÞÔÕáØ\ 'filetype'\ &âÐÚÞòÕ
menutrans &Off &¸áÚùãçÕÝÞ
menutrans &Show\ File\ Types\ in\ Menu ¿àØÚÐÖØ\ âØßÞÒÕ\ ÔÐâÞâÕÚÐ\ ã\ &ÜÕÝØøã
menutrans Set\ '&syntax'\ only ¿ÞÔÕ&áØ\ áÐÜÞ\ 'syntax'
menutrans Set\ '&filetype'\ too ¿ÞÔÕáØ\ &âÐÚÞòÕ\ Ø\ 'filetype'
menutrans &Off &¸áÚùãçÕÝÞ
menutrans &Manual &ÀãçÝÞ
menutrans A&utomatic ãâÞÜÐâáÚØ
menutrans A&utomatic ãâÞÜÐâáÚØ
menutrans on/off\ for\ &This\ file ´Ð/ÝÕ\ ×Ð\ ÞÒã\ &ÔÐâÞâÕÚã
menutrans Co&lor\ test ¿àÞÒÕàÐ\ &ÑÞøÐ
menutrans Co&lor\ test ¿àÞÒÕàÐ\ &ÑÞøÐ
menutrans &Highlight\ test ¿àÞÒÕàÐ\ ØáâØ&æÐúÐ
menutrans &Convert\ to\ HTML ¿àÕâÒÞàØ\ &ã\ HTML
@@ -257,9 +284,13 @@ let g:menutrans_tags_dialog = "
let g:menutrans_textwidth_dialog = "ÃÝÕáØâÕ ÝÞÒã èØàØÝã âÕÚáâÐ (0 áßàÕçÐÒÐ ßàÕÛÞÜ)"
let g:menutrans_fileformat_dialog = "¸×ÐÑÕàØâÕ Òàáâã ÔÐâÞâÕÚÕ"
let g:menutrans_fileformat_dialog = "¸×ÐÑÕàØâÕ äÞàÜÐâ ×ÐߨáÐ ÔÐâÞâÕÚÕ"
let g:menutrans_fileformat_choices = "&Unix\n&Dos\n&Mac\n&¾âÚÐÖØ"
let menutrans_no_file = "[½ÕÜÐ ÔÐâÞâÕÚÕ]"
let &cpo = s:keepcpo
unlet s:keepcpo
" vim: tw=0 keymap=serbian
+50 -21
View File
@@ -1,6 +1,7 @@
" Menu Translations: Serbian
" Maintainer: Aleksandar Jelenak <ajelenak AT yahoo.com>
" Last Change: Fri, 30 May 2003 10:17:39 Eastern Daylight Time
" Adapted for VIM 8 by: Иван Пешић on 2017-12-28 12:05+0400
" Quit when menu translations have already been done.
if exists("did_menu_trans")
@@ -21,6 +22,7 @@ menutrans &Find &Нађи
menutrans &Credits &Заслуге
menutrans Co&pying П&реузимање
menutrans O&rphans &Сирочићи
menutrans &Sponsor/Register Спонзор/&Региструјте\ се
menutrans &Version &Верзија
menutrans &About &О\ програму
@@ -28,6 +30,7 @@ menutrans &About &О\ програму
menutrans &File &Датотека
menutrans &Open\.\.\.<Tab>:e &Отвори\.\.\.<Tab>:e
menutrans Sp&lit-Open\.\.\.<Tab>:sp &Подели-отвори\.\.\.<Tab>:sp
menutrans Open\ Tab\.\.\.<Tab>:tabnew Отвори\ картицу\.\.\.<Tab>:tabnew
menutrans &New<Tab>:enew &Нова<Tab>:enew
menutrans &Close<Tab>:close &Затвори<Tab>:close
menutrans &Save<Tab>:w &Сачувај<Tab>:w
@@ -54,24 +57,27 @@ menutrans &Select\ all<Tab>ggVG Изабери\ св&е<Tab>ggVG
menutrans &Find\.\.\. &Нађи\.\.\.
menutrans Find\ and\ Rep&lace\.\.\. Нађи\ и\ &замени\.\.\.
menutrans Settings\ &Window П&розор\ подешавања
menutrans Startup\ &Settings По&дешавања\ при\ покретању
menutrans &Global\ Settings Оп&шта\ подешавања
menutrans F&ile\ Settings Подешавања\ за\ да&тотеке
menutrans &Shiftwidth &Померај
menutrans Soft\ &Tabstop &Мека\ табулација
menutrans Te&xt\ Width\.\.\. &Ширина\ текста\.\.\.
menutrans &File\ Format\.\.\. &Врста\ датотеке\.\.\.
menutrans C&olor\ Scheme Бо&је
menutrans &Keymap Прес&ликавање\ тастатуре
menutrans Show\ C&olor\ Schemes\ in\ Menu Прикажи\ шеме\ бо&ја\ у\ менију
menutrans C&olor\ Scheme \Шеме\ бо&ја
menutrans Show\ &Keymaps\ in\ Menu Прикажи\ прес&ликавања\ тастатуре\ у\ менију
menutrans &Keymap Прес&ликавања\ тастатуре
menutrans Select\ Fo&nt\.\.\. Избор\ &фонта\.\.\.
" Edit/Global Settings
menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! Нагласи\ &образце\ (да/не)<Tab>:set\ hls!
menutrans Toggle\ &Ignore-case<Tab>:set\ ic! Занемари\ \величину\ &слова\ (да/не)<Tab>:set\ ic!
menutrans Toggle\ &Showmatch<Tab>:set\ sm! Провери\ пратећу\ &заграду\ (да/не)<Tab>:set\ sm!
menutrans Toggle\ &Ignoring\ Case<Tab>:set\ ic! Занемари\ величину\ &слова\ (да/не)<Tab>:set\ ic!
menutrans Toggle\ &Showing\ Matched\ Pairs<Tab>:set\ sm! Провери\ пратећу\ &заграду\ (да/не)<Tab>:set\ sm!
menutrans &Context\ lines Видљиви\ &редови
menutrans &Virtual\ Edit Виртуелно\ &уређивање
menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! Режим\ у&носа\ (да/не)<Tab>:set\ im!
menutrans Toggle\ Vi\ C&ompatible<Tab>:set\ cp! '&Vi'\ сагласно\ (да/не)<Tab>:set\ cp!
menutrans Toggle\ Vi\ C&ompatibility<Tab>:set\ cp! '&Vi'\ сагласно\ (да/не)<Tab>:set\ cp!
menutrans Search\ &Path\.\.\. Путања\ &претраге\.\.\.
menutrans Ta&g\ Files\.\.\. &Датотеке\ ознака\.\.\.
menutrans Toggle\ &Toolbar Линија\ са\ &алаткама\ (да/не)
@@ -87,28 +93,30 @@ menutrans Block\ and\ Insert Блок\ и\ унос
menutrans Always Увек
" Edit/File Settings
menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! Редни\ &бројеви\ (да/не)<Tab>:set\ nu!
menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! Прикажи\ &нумерацију\ линија\ (да/не)<Tab>:set\ nu!
menutrans Toggle\ Relati&ve\ Line\ Numbering<Tab>:set\ rnu! Прикажи\ Релати&вну\ нумерацију\ линија\ (да/не)<Tab>:set\ rnu!
menutrans Toggle\ &List\ Mode<Tab>:set\ list! Режим\ &листе\ (да/не)<Tab>:set\ list!
menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! Обавијање\ &редова\ (да/не)<Tab>:set\ wrap!
menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! Преломи\ &на\ реч\ (да/не)<Tab>:set\ lbr!
menutrans Toggle\ &expand-tab<Tab>:set\ et! Размаци\ уместо\ &табулације\ (да/не)<Tab>:set\ et!
menutrans Toggle\ &auto-indent<Tab>:set\ ai! Ауто-&увлачење\ (да/не)<Tab>:set\ ai!
menutrans Toggle\ &C-indenting<Tab>:set\ cin! &Це-увлачење\ (да/не)<Tab>:set\ cin!
menutrans Toggle\ Line\ &Wrapping<Tab>:set\ wrap! Обавијање\ &редова\ (да/не)<Tab>:set\ wrap!
menutrans Toggle\ W&rapping\ at\ Word<Tab>:set\ lbr! Преломи\ &на\ реч\ (да/не)<Tab>:set\ lbr!
menutrans Toggle\ Tab\ &Expanding<Tab>:set\ et! Размаци\ уместо\ &табулације\ (да/не)<Tab>:set\ et!
menutrans Toggle\ &Auto\ Indenting<Tab>:set\ ai! Ауто-&увлачење\ (да/не)<Tab>:set\ ai!
menutrans Toggle\ &C-Style\ Indenting<Tab>:set\ cin! &C-увлачење\ (да/не)<Tab>:set\ cin!
" Edit/Keymap
menutrans None Ниједан
menutrans None Без\ пресликавања
" Tools menu
menutrans &Tools &Алатке
menutrans &Jump\ to\ this\ tag<Tab>g^] Скочи\ на\ &ову\ ознаку<Tab>g^]
menutrans Jump\ &back<Tab>^T Скочи\ &натраг<Tab>^T
menutrans Build\ &Tags\ File Изгради\ &датотеку\ ознака
menutrans &Spelling Пра&вопис
menutrans &Folding &Подвијање
menutrans Create\ &Fold<Tab>zf С&твори\ подвијутак<Tab>zf
menutrans &Delete\ Fold<Tab>zd О&бриши\ подвијутак<Tab>zd
menutrans Delete\ &All\ Folds<Tab>zD Обриши\ све\ по&двијутке<Tab>zD
menutrans Fold\ column\ &width Ширина\ &реда\ подвијутка
menutrans &Diff &Упоређивање
"menutrans &Diff &Упоређивање
menutrans &Make<Tab>:make 'mak&е'<Tab>:make
menutrans &List\ Errors<Tab>:cl Списак\ &грешака<Tab>:cl
menutrans L&ist\ Messages<Tab>:cl! Сп&исак\ порука<Tab>:cl!
@@ -117,9 +125,25 @@ menutrans &Previous\ Error<Tab>:cp Пре&тходна\ грешка<Tab>:cp
menutrans &Older\ List<Tab>:cold Стари\ списа&к<Tab>:cold
menutrans N&ewer\ List<Tab>:cnew Но&ви\ списак<Tab>:cnew
menutrans Error\ &Window Прозор\ са\ г&решкама
menutrans &Set\ Compiler И&забери\ преводиоца
menutrans Se&t\ Compiler И&забери\ преводиоца
menutrans &Convert\ to\ HEX<Tab>:%!xxd Претвори\ у\ &ХЕКС<Tab>:%!xxd
menutrans Conve&rt\ back<Tab>:%!xxd\ -r Вр&ати\ у\ првобитан\ облик<Tab>:%!xxd\ -r
menutrans Show\ Compiler\ Se&ttings\ in\ Menu Прикажи\ поде&шавања\ преводиоца\ у\ менију
" Tools/Spelling
menutrans &Spell\ Check\ On &Укључи\ проверу\ правописа
menutrans Spell\ Check\ &Off &Искључи\ проверу\ правописа
menutrans To\ &Next\ Error<Tab>]s Иди\ на\ &следећу\ грешку<Tab>]s
menutrans To\ &Previous\ Error<Tab>[s Иди\ на\ &претходну\ грешку<Tab>[s
menutrans Suggest\ &Corrections<Tab>z= Предложи\ исп&равке<Tab>z=
menutrans &Repeat\ Correction<Tab>:spellrepall П&онови\ исправку<Tab>:spellrepall
menutrans Set\ Language\ to\ "en" Постави\ језик\ на\ "en"
menutrans Set\ Language\ to\ "en_au" Постави\ језик\ на\ "en_au"
menutrans Set\ Language\ to\ "en_ca" Постави\ језик\ на\ "en_ca"
menutrans Set\ Language\ to\ "en_gb" Постави\ језик\ на\ "en_gb"
menutrans Set\ Language\ to\ "en_nz" Постави\ језик\ на\ "en_nz"
menutrans Set\ Language\ to\ "en_us" Постави\ језик\ на\ "en_us"
menutrans &Find\ More\ Languages Пронађи\ још\ језика
" Tools/Folding
menutrans &Enable/Disable\ folds<Tab>zi &Омогући/прекини\ подвијање<Tab>zi
@@ -130,6 +154,7 @@ menutrans &Close\ all\ folds<Tab>zM Затвори\ с&ве\ подвијут
menutrans O&pen\ more\ folds<Tab>zr Отвори\ виш&е\ подвијутака<Tab>zr
menutrans &Open\ all\ folds<Tab>zR О&твори\ све\ подвијутке<Tab>zR
menutrans Fold\ Met&hod &Начин\ подвијања
menutrans Fold\ Col&umn\ Width Ширина\ колоне\ испред\ подвијутака
" Tools/Folding/Fold Method
menutrans M&anual &Ручно
@@ -141,8 +166,8 @@ menutrans Ma&rker &Ознака
" Tools/Diff
menutrans &Update &Ажурирај
menutrans &Get\ Block &Прихвати\ измену
menutrans &Put\ Block Пре&баци\ измену
menutrans &Get\ Block &Прихвати\ блок\ изменa
menutrans &Put\ Block Пре&баци\ блок\ измена
" Tools/Error Window
menutrans &Update<Tab>:cwin &Ажурирај<Tab>:cwin
@@ -190,8 +215,10 @@ menutrans Cu&t &Исеци
menutrans &Copy &Копирај
menutrans &Paste &Убаци
menutrans &Delete И&збриши
menutrans Select\ Blockwise Бирај\ &правоугаоно
menutrans Select\ Blockwise Бирај\ б&локовски
menutrans Select\ &Word Изабери\ &реч
menutrans Select\ &Sentence Изабери\ р&еченицу
menutrans Select\ Pa&ragraph Изабери\ &параграф
menutrans Select\ &Line Изабери\ р&ед
menutrans Select\ &Block Изабери\ &блок
menutrans Select\ &All Изабери\ &све
@@ -237,9 +264,9 @@ endif
" Syntax menu
menutrans &Syntax &Синтакса
menutrans &Show\ filetypes\ in\ menu Избор\ 'filetype'\ из\ &менија
menutrans Set\ '&syntax'\ only Поде&си\ 'syntax'\ само
menutrans Set\ '&filetype'\ too Подеси\ 'filetype'\ &такође
menutrans &Show\ File\ Types\ in\ Menu Прикажи\ типове\ датотека\ у\ &менију
menutrans Set\ '&syntax'\ only Поде&си\ само\ 'syntax'
menutrans Set\ '&filetype'\ too Подеси\ &такође\ и\ 'filetype'
menutrans &Off &Искључено
menutrans &Manual &Ручно
menutrans A&utomatic &Аутоматски
@@ -257,7 +284,9 @@ let g:menutrans_tags_dialog = "Унесите имена датотека са
let g:menutrans_textwidth_dialog = "Унесите нову ширину текста (0 спречава прелом)"
let g:menutrans_fileformat_dialog = "Изаберите врсту датотеке"
let g:menutrans_fileformat_dialog = "Изаберите формат записа датотеке"
let g:menutrans_fileformat_choices = "&Unix\n&Dos\n&Mac\n&Откажи"
let menutrans_no_file = "[Нема датотеке]"
+9 -4
View File
@@ -1,7 +1,7 @@
" These commands create the option window.
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2017 Nov 21
" Last Change: 2018 Feb 27
" If there already is an option window, jump to that one.
let buf = bufnr('option-window')
@@ -122,11 +122,13 @@ fun! <SID>Update(lnum, line, local, thiswin)
endfun
" Reset 'title' and 'icon' to make it work faster.
" Reset 'undolevels' to avoid undo'ing until the buffer is empty.
let s:old_title = &title
let s:old_icon = &icon
let s:old_sc = &sc
let s:old_ru = &ru
set notitle noicon nosc noru
let s:old_ul = &ul
set notitle noicon nosc noru ul=-1
" If the current window is a help window, try finding a non-help window.
" Relies on syntax highlighting to be switched on.
@@ -775,7 +777,7 @@ call <SID>OptionG("km", &km)
call <SID>Header("editing text")
call append("$", "undolevels\tmaximum number of changes that can be undone")
call append("$", "\t(global or local to buffer)")
call append("$", " \tset ul=" . &ul)
call append("$", " \tset ul=" . s:old_ul)
call append("$", "undofile\tautomatically save and restore undo history")
call <SID>BinOptionG("udf", &udf)
call append("$", "undodir\tlist of directories for undo files")
@@ -821,6 +823,8 @@ if has("insert_expand")
call <SID>OptionG("cot", &cot)
call append("$", "pumheight\tmaximum height of the popup menu")
call <SID>OptionG("ph", &ph)
call append("$", "pumwidth\tminimum width of the popup menu")
call <SID>OptionG("pw", &pw)
call append("$", "completefunc\tuser defined function for Insert mode completion")
call append("$", "\t(local to buffer)")
call <SID>OptionL("cfu")
@@ -1455,6 +1459,7 @@ let &icon = s:old_icon
let &ru = s:old_ru
let &sc = s:old_sc
let &cpo = s:cpo_save
unlet s:old_title s:old_icon s:old_ru s:old_sc s:cpo_save s:idx s:lnum
let &ul = s:old_ul
unlet s:old_title s:old_icon s:old_ru s:old_sc s:cpo_save s:idx s:lnum s:old_ul
" vim: ts=8 sw=2 sts=2
+91 -22
View File
@@ -105,9 +105,39 @@ func s:StartDebug(cmd)
let s:gdbwin = win_getid(winnr())
" Connect gdb to the communication pty, using the GDB/MI interface
" If you get an error "undefined command" your GDB is too old.
call term_sendkeys(s:gdbbuf, 'new-ui mi ' . commpty . "\r")
" Wait for the response to show up, users may not notice the error and wonder
" why the debugger doesn't work.
let try_count = 0
while 1
let response = ''
for lnum in range(1,20)
if term_getline(s:gdbbuf, lnum) =~ 'new-ui mi '
let response = term_getline(s:gdbbuf, lnum + 1)
if response =~ 'Undefined command'
echoerr 'Your gdb does not support the Machine Interface feature'
exe 'bwipe! ' . s:ptybuf
exe 'bwipe! ' . s:commbuf
return
endif
if response =~ 'New UI allocated'
" Success!
break
endif
endif
endfor
if response =~ 'New UI allocated'
break
endif
let try_count += 1
if try_count > 100
echoerr 'Cannot check if your gdb works, continuing anyway'
break
endif
sleep 10m
endwhile
" Interpret commands while the target is running. This should usualy only be
" exec-interrupt, since many commands don't work properly while the target is
" running.
@@ -201,7 +231,7 @@ endfunc
" Install commands in the current window to control the debugger.
func s:InstallCommands()
command Break call s:SetBreakpoint()
command Delete call s:DeleteBreakpoint()
command Clear call s:ClearBreakpoint()
command Step call s:SendCommand('-exec-step')
command Over call s:SendCommand('-exec-next')
command Finish call s:SendCommand('-exec-finish')
@@ -212,24 +242,42 @@ func s:InstallCommands()
command -range -nargs=* Evaluate call s:Evaluate(<range>, <q-args>)
command Gdb call win_gotoid(s:gdbwin)
command Program call win_gotoid(s:ptywin)
command Winbar call s:InstallWinbar()
" TODO: can the K mapping be restored?
nnoremap K :Evaluate<CR>
if has('menu') && &mouse != ''
nnoremenu WinBar.Step :Step<CR>
nnoremenu WinBar.Next :Over<CR>
nnoremenu WinBar.Finish :Finish<CR>
nnoremenu WinBar.Cont :Continue<CR>
nnoremenu WinBar.Stop :Stop<CR>
nnoremenu WinBar.Eval :Evaluate<CR>
call s:InstallWinbar()
if !exists('g:termdebug_popup') || g:termdebug_popup != 0
let s:saved_mousemodel = &mousemodel
let &mousemodel = 'popup_setpos'
an 1.200 PopUp.-SEP3- <Nop>
an 1.210 PopUp.Set\ breakpoint :Break<CR>
an 1.220 PopUp.Clear\ breakpoint :Clear<CR>
an 1.230 PopUp.Evaluate :Evaluate<CR>
endif
endif
endfunc
let s:winbar_winids = []
" Install the window toolbar in the current window.
func s:InstallWinbar()
nnoremenu WinBar.Step :Step<CR>
nnoremenu WinBar.Next :Over<CR>
nnoremenu WinBar.Finish :Finish<CR>
nnoremenu WinBar.Cont :Continue<CR>
nnoremenu WinBar.Stop :Stop<CR>
nnoremenu WinBar.Eval :Evaluate<CR>
call add(s:winbar_winids, win_getid(winnr()))
endfunc
" Delete installed debugger commands in the current window.
func s:DeleteCommands()
delcommand Break
delcommand Delete
delcommand Clear
delcommand Step
delcommand Over
delcommand Finish
@@ -240,16 +288,34 @@ func s:DeleteCommands()
delcommand Evaluate
delcommand Gdb
delcommand Program
delcommand Winbar
nunmap K
if has('menu')
aunmenu WinBar.Step
aunmenu WinBar.Next
aunmenu WinBar.Finish
aunmenu WinBar.Cont
aunmenu WinBar.Stop
aunmenu WinBar.Eval
" Remove the WinBar entries from all windows where it was added.
let curwinid = win_getid(winnr())
for winid in s:winbar_winids
if win_gotoid(winid)
aunmenu WinBar.Step
aunmenu WinBar.Next
aunmenu WinBar.Finish
aunmenu WinBar.Cont
aunmenu WinBar.Stop
aunmenu WinBar.Eval
endif
endfor
call win_gotoid(curwinid)
let s:winbar_winids = []
if exists('s:saved_mousemodel')
let &mousemodel = s:saved_mousemodel
unlet s:saved_mousemodel
aunmenu PopUp.-SEP3-
aunmenu PopUp.Set\ breakpoint
aunmenu PopUp.Clear\ breakpoint
aunmenu PopUp.Evaluate
endif
endif
exe 'sign unplace ' . s:pc_id
@@ -278,8 +344,8 @@ func s:SetBreakpoint()
endif
endfunc
" :Delete - Delete a breakpoint at the cursor position.
func s:DeleteBreakpoint()
" :Clear - Delete a breakpoint at the cursor position.
func s:ClearBreakpoint()
let fname = fnameescape(expand('%:p'))
let lnum = line('.')
for [key, val] in items(s:breakpoints)
@@ -325,9 +391,11 @@ func s:Evaluate(range, arg)
else
let expr = expand('<cexpr>')
endif
let s:ignoreEvalError = 0
call s:SendEval(expr)
endfunc
let s:ignoreEvalError = 0
let s:evalFromBalloonExpr = 0
" Handle the result of data-evaluate-expression
@@ -347,6 +415,7 @@ func s:HandleEvaluate(msg)
if s:evalexpr[0] != '*' && value =~ '^0x' && value != '0x0' && value !~ '"$'
" Looks like a pointer, also display what it points to.
let s:ignoreEvalError = 1
call s:SendEval('*' . s:evalexpr)
else
let s:evalFromBalloonExpr = 0
@@ -359,19 +428,19 @@ func TermDebugBalloonExpr()
if v:beval_winid != s:startwin
return
endif
call s:SendEval(v:beval_text)
let s:evalFromBalloonExpr = 1
let s:evalFromBalloonExprResult = ''
let s:ignoreEvalError = 1
call s:SendEval(v:beval_text)
return ''
endfunc
" Handle an error.
func s:HandleError(msg)
if a:msg =~ 'No symbol .* in current context'
\ || a:msg =~ 'Cannot access memory at address '
\ || a:msg =~ 'Attempt to use a type name as an expression'
\ || a:msg =~ 'A syntax error in expression,'
if s:ignoreEvalError
" Result of s:SendEval() failed, ignore.
let s:ignoreEvalError = 0
let s:evalFromBalloonExpr = 0
return
endif
echoerr substitute(a:msg, '.*msg="\(.*\)"', '\1', '')
-4
View File
@@ -104,10 +104,6 @@ if s:line1 =~# "^#!"
elseif s:name =~# '^pike\%(\>\|[0-9]\)'
set ft=pike
" Pike
elseif s:name =~# '^pike\%(\>\|[0-9]\)'
set ft=pike
" Lua
elseif s:name =~# 'lua'
set ft=lua
+142
View File
@@ -0,0 +1,142 @@
# Aap recipe for Serbian Vim spell files.
# Use a freshly compiled Vim if it exists.
@if os.path.exists('../../../src/vim'):
VIM = ../../../src/vim
@else:
:progsearch VIM vim
SPELLDIR = ..
FILES = sr_RS.aff sr_RS.dic
'sr_RS@latin.aff' 'sr_RS@latin.dic'
all: $SPELLDIR/sr.utf-8.spl $SPELLDIR/'sr@latin.utf-8.spl' ../README_sr.txt
# Original files will be in the subfolder hunspell-sr after unpacking:
# sr.dic original cyrillic dictionary
# sr.aff original cyrillic affix file
# sr-Latn.dic original latin dictionary file
# sr-Latn.aff original latin affix file
# Just before using the dictionary files, the right ones are copied to
# sr_RS.aff
# sr_RS.dic
# and
# sr_RS@latin.aff
# sr_RS@latin.dic
$SPELLDIR/sr.utf-8.spl : $FILES
:sys env LANG=sr_RS.UTF-8
$VIM -u NONE -e -c "set enc=utf-8" -c "mkspell! $SPELLDIR/sr sr_RS" -c q
$SPELLDIR/"sr@latin.utf-8.spl" : $FILES
:sys env LANG=sr_RS@latin.UTF-8
$VIM -u NONE -e -c "set enc=utf-8" -c "mkspell! $SPELLDIR/sr@latin sr_RS@latin" -c q
../README_sr.txt : hunspell-sr/README_sr.txt README_sr_RS.txt
:cat README_sr_RS.txt >!$target
:print >>$target
:print ============================================================== >>$target
:print Следи оригинална README датотека: >>$target
:print >>$target
:cat hunspell-sr/README_sr.txt >>$target
#
# Used to fetch the files.
#
ZIPFILE = http://devbase.net/dict-sr/hunspell-sr-20130715.zip
:attr {fetch = $ZIPFILE} sr_RS.zip
# The files don't depend on the .zip file so that we can delete it.
# Only download the zip file if the targets don't exist.
sr_RS.aff sr_RS.dic: {buildcheck=}
:assertpkg unzip patch
:fetch sr_RS.zip
:sys $UNZIP sr_RS.zip
:delete sr_RS.zip
@if not os.path.exists('sr_RS.orig.aff'):
:copy hunspell-sr/sr.aff sr_RS.orig.aff
@if not os.path.exists('sr_RS.orig.dic'):
:copy hunspell-sr/sr.dic sr_RS.orig.dic
@if os.path.exists('sr_RS.diff'):
:sys patch <sr_RS.diff
:copy sr_RS.orig.aff sr_RS.aff
:copy sr_RS.orig.dic sr_RS.dic
# Remove the 3 misspelled words and update the word count
# :sys $VIM -u NONE -e -c "set enc=utf-8"
# -c "e sr_RS.orig.dic"
# -c "%g/ажуриранје/d"
# -c "%g/вишнја/d"
# -c "%g/вишнјевац/d"
# -c "%s/263909/263906/e"
# -c "w! sr_RS.dic"
# -c q
sr_RS@latin.aff sr_RS@latin.dic: {buildcheck=}
:assertpkg unzip patch
:fetch sr_RS.zip
:sys $UNZIP sr_RS.zip
:delete sr_RS.zip
@if not os.path.exists('sr_RS@latin.orig.aff'):
:copy hunspell-sr/sr-Latn.aff 'sr_RS@latin.orig.aff'
@if not os.path.exists('sr_RS@latin.orig.dic'):
:copy hunspell-sr/sr-Latn.dic 'sr_RS@latin.orig.dic'
@if os.path.exists('sr_RS@latin.diff'):
:sys patch <'sr_RS@latin.diff'
:copy 'sr_RS@latin.orig.aff' 'sr_RS@latin.aff'
:copy 'sr_RS@latin.orig.dic' 'sr_RS@latin.dic'
# Remove the 3 duplicated words and update the word count
# :sys $VIM -u NONE -e -c "set enc=utf-8"
# -c "e sr_RS@latin.orig.dic"
# -c "%g/\v(ažuriranje)(\_.*\1)@=/d"
# -c "%g/\v(višnja)(\_.*\1)@=/d"
# -c "%g/\v(višnjevac)(\_.*\1)@=/d"
# -c "%s/263909/263906/e"
# -c "w! sr_RS@latin.dic"
# -c q
# Generate diff files, so that others can get the files and apply
# the diffs to get the Vim versions.
diff:
:assertpkg diff
:sys {force} diff -a -C 1 sr_RS.orig.aff sr_RS.aff >sr_RS.diff
:sys {force} diff -a -C 1 sr_RS.orig.dic sr_RS.dic >>sr_RS.diff
:sys {force} diff -a -C 1 'sr_RS@latin.orig.aff' 'sr_RS@latin.aff' >'sr_RS@latin.diff'
:sys {force} diff -a -C 1 'sr_RS@latin.orig.dic' 'sr_RS@latin.dic' >>'sr_RS@latin.diff'
# Delete all the unpacked and generated files, including the "orig" files.
clean:
:delete {force} sr_RS.zip sr_RS.dic
sr_RS.orig.aff sr_RS.orig.dic
sr_RS.aff
'sr_RS@latin.dic' 'sr_RS@latin.aff'
'sr_RS@latin.orig.aff' 'sr_RS@latin.orig.dic'
:sys rm -f -r hunspell-sr/
# Check for updated OpenOffice spell files. When there are changes the
# ".new.aff" and ".new.dic" files are left behind for manual inspection.
#
#check:
# :assertpkg unzip diff
# :fetch fr_FR.zip
# :mkdir tmp
# :cd tmp
# @try:
# @import stat
# :sys $UNZIP ../fr_FR.zip
# :sys {force} diff ../fr_FR.orig.aff fr_FR.aff >d
# @if os.stat('d')[stat.ST_SIZE] > 0:
# :copy fr_FR.aff ../fr_FR.new.aff
# :sys {force} diff ../fr_FR.orig.dic fr_FR.dic >d
# @if os.stat('d')[stat.ST_SIZE] > 0:
# :copy fr_FR.dic ../fr_FR.new.dic
# @finally:
# :cd ..
# :delete {r}{f}{q} tmp
# :delete fr_FR.zip
vim: set sts=4 sw=4 :
+68
View File
@@ -0,0 +1,68 @@
*** sr_RS.orig.aff Fri Feb 23 20:04:41 2018
--- sr_RS.aff Fri Feb 23 18:18:48 2018
***************
*** 1,10 ****
! SET UTF-8
! LANG sr
! TRY аиоенртсвумклпјдгзбшчцхћњљжфђџАИОЕНРТСВУМКЛПЈДГЗБШЧЦХЋЊЉЖФЂЏ
! KEY љњертжуиопшђж|асдфгхјклчћ|зџцвбнм|жшђ|ћшч|жчђ|ђћж|зж|љањседрфтгжхуј|јиколпч|азсџдцфвгбх|хнјмк
!
! MAP 4
! MAP цћ
! MAP цч
MAP зж
--- 1,5 ----
! SET utf-8
! MAP 3
! MAP цћч
MAP зж
***************
*** 12,14 ****
! REP 8
REP дј ђ
--- 7,11 ----
! MIDWORD -
!
! REP 4
REP дј ђ
***************
*** 17,28 ****
REP дж џ
- REP ц с # Ако хоћу да откуцам слово „С“ могу се залетети за ознаком на тастатури и уписати „Ц“ (C)
- REP п р # Ако хоћу да откуцам слово „В“ могу се залетети за ознаком и уписати „Б“ (B)
- REP џ х # Ако хоћу да откуцам слово „Р“ могу се залетети за ознаком и уписати „П“ (P)
- REP х н # Ако хоћу да откуцам слово „Х“ могу се залетети за ознаком и уписати „Џ“ (X)
- # Ако хоћу да откуцам слово „В“ могу се залетети за ознаком и уписати „Б“ (B) (покривено KEY паром „в - б“)
-
- ICONV 3
- ICONV ҵ тц
- ICONV ҥ нг
- ICONV ӕ ае
--- 14,15 ----
*** sr_RS.orig.dic Fri Feb 23 20:04:42 2018
--- sr_RS.dic Fri Feb 23 20:04:46 2018
***************
*** 1,2 ****
! 263909
а
--- 1,2 ----
! 263906
а
***************
*** 882,884 ****
ажурираних
- ажуриранје
ажурирано
--- 882,883 ----
***************
*** 22177,22180 ****
вишку
- вишнја
- вишнјевац
Вишну
--- 22176,22177 ----
+66
View File
@@ -0,0 +1,66 @@
*** sr_RS@latin.orig.aff Fri Feb 23 20:08:28 2018
--- sr_RS@latin.aff Fri Feb 23 18:18:48 2018
***************
*** 1,10 ****
! SET UTF-8
! LANG sr-Latn
! TRY aioenrtsvumklpjdgzbščchćnjljžfđdžAIOENRTSVUMKLPJDGZBŠČCHĆNJLJŽFĐDŽ
! KEY qwertyuiopšđž|asdfghjklčć|zxcvbnm|žšđ|ćšč|žčđ|đćž|zy|qawsedrftgyhuj|jikolpč|azsxdcfvgbh|hnjmk
!
! MAP 4
! MAP cć
! MAP cč
MAP zž
--- 1,5 ----
! SET utf-8
! MAP 3
! MAP cćč
MAP zž
***************
*** 12,20 ****
! REP 1
! REP dj đ
! ICONV fi fi
! ICONV fl fl
! ICONV st st
! ICONV ij ij
! ICONV œ oe
--- 7,14 ----
! MIDWORD -
! REP 4
! REP dj đ
! REP fl fl
! REP ff ff
! REP fi fi
*** sr_RS@latin.orig.dic Fri Feb 23 20:08:28 2018
--- sr_RS@latin.dic Fri Feb 23 20:08:53 2018
***************
*** 1,2 ****
! 263909
a
--- 1,2 ----
! 263906
a
***************
*** 882,884 ****
ažuriranih
- ažuriranje
ažurirano
--- 882,883 ----
***************
*** 22177,22184 ****
višku
- višnja
- višnjevac
Višnu
višnja
višnjama
višnjare
višnje
--- 22176,22181 ----
+2 -2
View File
@@ -1,6 +1,6 @@
" Vim syntax file
" Language: Scheme (CHICKEN)
" Last Change: 2018 Jan 31
" Last Change: 2018-02-05
" Author: Evan Hanson <evhan@foldling.org>
" Maintainer: Evan Hanson <evhan@foldling.org>
" URL: https://foldling.org/vim/syntax/chicken.vim
@@ -14,7 +14,7 @@ if !exists('b:did_scheme_syntax')
endif
" Lighten parentheses.
hi def link schemeParentheses Comment
hi! def link schemeParentheses Comment
" foo#bar
syn match schemeExtraSyntax /[^ #'`\t\n()\[\]"|;]\+#[^ '`\t\n()\[\]"|;]\+/
+102 -109
View File
@@ -4,10 +4,10 @@
" Claudio Fleiner <claudio@fleiner.com> (Maintainer)
" Yeti (Add full CSS2, HTML4 support)
" Nikolai Weibull (Add CSS2 support)
" Maintainer: Jules Wang <w.jq0722@gmail.com>
" URL: https://github.com/JulesWang/css.vim
" Last Change: 2017 Jan 14
" cssClassName updated by Ryuichi Hayashida Jan 2016
" Maintainer: Jules Wang <w.jq0722@gmail.com>
" Last Change: 2018 Feb. 27
" cssClassName updated by Ryuichi Hayashida Jan 2016
" quit when a syntax file was already loaded
if !exists("main_syntax")
@@ -69,74 +69,12 @@ endtry
" digits
syn match cssValueInteger contained "[-+]\=\d\+" contains=cssUnitDecorators
syn match cssValueNumber contained "[-+]\=\d\+\(\.\d*\)\=" contains=cssUnitDecorators
syn match cssValueLength contained "[-+]\=\d\+\(\.\d*\)\=\(%\|mm\|cm\|in\|pt\|pc\|em\|ex\|px\|rem\|dpi\|dppx\|dpcm\)\>" contains=cssUnitDecorators
syn match cssValueLength contained "[-+]\=\d\+\(\.\d*\)\=\(mm\|cm\|in\|pt\|pc\|em\|ex\|px\|rem\|dpi\|dppx\|dpcm\)\>" contains=cssUnitDecorators
syn match cssValueLength contained "[-+]\=\d\+\(\.\d*\)\=%" contains=cssUnitDecorators
syn match cssValueAngle contained "[-+]\=\d\+\(\.\d*\)\=\(deg\|grad\|rad\)\>" contains=cssUnitDecorators
syn match cssValueTime contained "+\=\d\+\(\.\d*\)\=\(ms\|s\)\>" contains=cssUnitDecorators
syn match cssValueFrequency contained "+\=\d\+\(\.\d*\)\=\(Hz\|kHz\)\>" contains=cssUnitDecorators
syn match cssIncludeKeyword /@\(-[a-z]\+-\)\=\(media\|keyframes\|import\|charset\|namespace\|page\)/ contained
" @media
syn region cssInclude start=/@media\>/ end=/\ze{/ skipwhite skipnl contains=cssMediaProp,cssValueLength,cssMediaKeyword,cssValueInteger,cssMediaAttr,cssVendor,cssMediaType,cssIncludeKeyword,cssMediaComma,cssComment nextgroup=cssMediaBlock
syn keyword cssMediaType contained screen print aural braille embossed handheld projection tty tv speech all contained skipwhite skipnl
syn keyword cssMediaKeyword only not and contained
syn region cssMediaBlock transparent matchgroup=cssBraces start='{' end='}' contains=css.*Attr,css.*Prop,cssComment,cssValue.*,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition,cssTagName,cssClassName,cssIdentifier,cssPseudoClass,cssSelectorOp,cssSelectorOp2,cssAttributeSelector fold
syn match cssMediaComma "," skipwhite skipnl contained
" Reference: http://www.w3.org/TR/css3-mediaqueries/
syn keyword cssMediaProp contained width height orientation scan grid
syn match cssMediaProp contained /\(\(max\|min\)-\)\=\(\(device\)-\)\=aspect-ratio/
syn match cssMediaProp contained /\(\(max\|min\)-\)\=device-pixel-ratio/
syn match cssMediaProp contained /\(\(max\|min\)-\)\=device-\(height\|width\)/
syn match cssMediaProp contained /\(\(max\|min\)-\)\=\(height\|width\|resolution\|monochrome\|color\(-index\)\=\)/
syn keyword cssMediaAttr contained portrait landscape progressive interlace
" @page
" http://www.w3.org/TR/css3-page/
syn match cssPage "@page\>[^{]*{\@=" contains=cssPagePseudo,cssIncludeKeyword nextgroup=cssPageWrap transparent skipwhite skipnl
syn match cssPagePseudo /:\(left\|right\|first\|blank\)/ contained skipwhite skipnl
syn region cssPageWrap contained transparent matchgroup=cssBraces start="{" end="}" contains=cssPageMargin,cssPageProp,cssAttrRegion,css.*Prop,cssComment,cssValue.*,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition,cssHacks
syn match cssPageMargin /@\(\(top\|left\|right\|bottom\)-\(left\|center\|right\|middle\|bottom\)\)\(-corner\)\=/ contained nextgroup=cssDefinition skipwhite skipnl
syn keyword cssPageProp contained content size
" http://www.w3.org/TR/CSS2/page.html#break-inside
syn keyword cssPageProp contained orphans widows
" @keyframe
" http://www.w3.org/TR/css3-animations/#keyframes
syn match cssKeyFrame "@\(-[a-z]\+-\)\=keyframes\>[^{]*{\@=" nextgroup=cssKeyFrameWrap contains=cssVendor,cssIncludeKeyword skipwhite skipnl transparent
syn region cssKeyFrameWrap contained transparent matchgroup=cssBraces start="{" end="}" contains=cssKeyFrameSelector
syn match cssKeyFrameSelector /\(\d*%\|from\|to\)\=/ contained skipwhite skipnl nextgroup=cssDefinition
" @import
syn region cssInclude start=/@import\>/ end=/\ze;/ transparent contains=cssStringQ,cssStringQQ,cssUnicodeEscape,cssComment,cssIncludeKeyword,cssURL,cssMediaProp,cssValueLength,cssMediaKeyword,cssValueInteger,cssMediaAttr,cssVendor,cssMediaType
syn region cssInclude start=/@charset\>/ end=/\ze;/ transparent contains=cssStringQ,cssStringQQ,cssUnicodeEscape,cssComment,cssIncludeKeyword
syn region cssInclude start=/@namespace\>/ end=/\ze;/ transparent contains=cssStringQ,cssStringQQ,cssUnicodeEscape,cssComment,cssIncludeKeyword
" @font-face
" http://www.w3.org/TR/css3-fonts/#at-font-face-rule
syn match cssFontDescriptor "@font-face\>" nextgroup=cssFontDescriptorBlock skipwhite skipnl
syn region cssFontDescriptorBlock contained transparent matchgroup=cssBraces start="{" end="}" contains=cssComment,cssError,cssUnicodeEscape,cssCommonAttr,cssFontDescriptorProp,cssValue.*,cssFontDescriptorFunction,cssFontDescriptorAttr,cssNoise
syn match cssFontDescriptorProp contained "\<font-family\>"
syn keyword cssFontDescriptorProp contained src
syn match cssFontDescriptorProp contained "\<font-\(style\|weight\|stretch\)\>"
syn match cssFontDescriptorProp contained "\<unicode-range\>"
syn match cssFontDescriptorProp contained "\<font-\(variant\|feature-settings\)\>"
" src functions
syn region cssFontDescriptorFunction contained matchgroup=cssFunctionName start="\<\(uri\|url\|local\|format\)\s*(" end=")" contains=cssStringQ,cssStringQQ oneline keepend
" font-sytle and font-weight attributes
syn keyword cssFontDescriptorAttr contained normal italic oblique bold
" font-stretch attributes
syn match cssFontDescriptorAttr contained "\<\(\(ultra\|extra\|semi\)-\)\=\(condensed\|expanded\)\>"
" unicode-range attributes
syn match cssFontDescriptorAttr contained "U+[0-9A-Fa-f?]\+"
syn match cssFontDescriptorAttr contained "U+\x\+-\x\+"
" font-feature-settings attributes
syn keyword cssFontDescriptorAttr contained on off
" The 16 basic color names
syn keyword cssColor contained aqua black blue fuchsia gray green lime maroon navy olive purple red silver teal yellow
@@ -162,8 +100,8 @@ syn keyword cssColor contained midnightblue mintcream mistyrose moccasin navajow
syn keyword cssColor contained oldlace olivedrab orange orangered orchid
syn match cssColor contained /\<pale\(goldenrod\|green\|turquoise\|violetred\)\>/
syn keyword cssColor contained papayawhip peachpuff peru pink plum powderblue
syn keyword cssColor contained rosybrown royalblue saddlebrown salmon sandybrown
syn keyword cssColor contained seagreen seashell sienna skyblue slateblue
syn keyword cssColor contained rosybrown royalblue rebeccapurple saddlebrown salmon
syn keyword cssColor contained sandybrown seagreen seashell sienna skyblue slateblue
syn keyword cssColor contained slategray slategrey snow springgreen steelblue tan
syn keyword cssColor contained thistle tomato turquoise violet wheat
syn keyword cssColor contained whitesmoke yellowgreen
@@ -180,10 +118,11 @@ syn match cssImportant contained "!\s*important\>"
syn match cssColor contained "\<transparent\>"
syn match cssColor contained "\<currentColor\>"
syn match cssColor contained "\<white\>"
syn match cssColor contained "#[0-9A-Fa-f]\{3\}\>" contains=cssUnitDecorators
syn match cssColor contained "#[0-9A-Fa-f]\{6\}\>" contains=cssUnitDecorators
syn match cssColor contained "#\x\{3,4\}\>" contains=cssUnitDecorators
syn match cssColor contained "#\x\{6\}\>" contains=cssUnitDecorators
syn match cssColor contained "#\x\{8\}\>" contains=cssUnitDecorators
syn region cssURL contained matchgroup=cssFunctionName start="\<url\s*(" end=")" contains=cssStringQ,cssStringQQ oneline
syn region cssURL contained matchgroup=cssFunctionName start="\<\(uri\|url\|local\|format\)\s*(" end=")" contains=cssStringQ,cssStringQQ oneline
syn region cssFunction contained matchgroup=cssFunctionName start="\<\(rgb\|clip\|attr\|counter\|rect\|cubic-bezier\|steps\)\s*(" end=")" oneline contains=cssValueInteger,cssValueNumber,cssValueLength,cssFunctionComma
syn region cssFunction contained matchgroup=cssFunctionName start="\<\(rgba\|hsl\|hsla\|color-stop\|from\|to\)\s*(" end=")" oneline contains=cssColor,cssValueInteger,cssValueNumber,cssValueLength,cssFunctionComma,cssFunction
syn region cssFunction contained matchgroup=cssFunctionName start="\<\(linear-\|radial-\)\=\gradient\s*(" end=")" oneline contains=cssColor,cssValueInteger,cssValueNumber,cssValueLength,cssFunction,cssGradientAttr,cssFunctionComma
@@ -224,7 +163,6 @@ syn keyword cssBackgroundAttr contained left center right top bottom
" background-repeat attributes
syn match cssBackgroundAttr contained "\<no-repeat\>"
syn match cssBackgroundAttr contained "\<repeat\(-[xy]\)\=\>"
syn keyword cssBackgroundAttr contained space round
" background-size attributes
syn keyword cssBackgroundAttr contained cover contain
@@ -236,7 +174,7 @@ syn match cssBorderProp contained "\<box-decoration-break\>"
syn match cssBorderProp contained "\<box-shadow\>"
" border-image attributes
syn keyword cssBorderAttr contained stretch round space fill
syn keyword cssBorderAttr contained stretch round fill
" border-style attributes
syn keyword cssBorderAttr contained dotted dashed solid double groove ridge inset outset
@@ -264,14 +202,18 @@ syn match cssDimensionProp contained "\<\(min\|max\)-\(width\|height\)\>"
syn keyword cssDimensionProp contained height
syn keyword cssDimensionProp contained width
" shadow and sizing are in other property groups
syn match cssFlexibleBoxProp contained "\<box-\(align\|direction\|flex\|ordinal-group\|orient\|pack\|shadow\|sizing\)\>"
syn keyword cssFlexibleBoxAttr contained start end baseline
syn keyword cssFlexibleBoxAttr contained reverse
syn keyword cssFlexibleBoxAttr contained single multiple
syn keyword cssFlexibleBoxAttr contained horizontal
syn match cssFlexibleBoxAttr contained "\<vertical\(-align\)\@!\>" "escape vertical-align
syn match cssFlexibleBoxAttr contained "\<\(inline\|block\)-axis\>"
" CSS Flexible Box Layout Module Level 1
" http://www.w3.org/TR/css3-flexbox/
" CSS Box Alignment Module Level 3
" http://www.w3.org/TR/css-align-3/
syn match cssFlexibleBoxProp contained "\<flex\(-\(direction\|wrap\|flow\|grow\|shrink\|basis\)\)\=\>"
syn match cssFlexibleBoxProp contained "\<\(align\|justify\)\(-\(items\|self\|content\)\)\=\>"
syn keyword cssFlexibleBoxProp contained order
syn match cssFlexibleBoxAttr contained "\<\(row\|column\|wrap\)\(-reverse\)\=\>"
syn keyword cssFlexibleBoxAttr contained nowrap stretch baseline center
syn match cssFlexibleBoxAttr contained "\<flex\(-\(start\|end\)\)\=\>"
syn match cssFlexibleBoxAttr contained "\<space\(-\(between\|around\)\)\=\>"
" CSS Fonts Module Level 3
" http://www.w3.org/TR/css-fonts-3/
@@ -279,11 +221,11 @@ syn match cssFontProp contained "\<font\(-\(family\|\|feature-settings\|kerning\
" font attributes
syn keyword cssFontAttr contained icon menu caption
syn match cssFontAttr contained "\<small-\(caps\|caption\)\>"
syn match cssFontAttr contained "\<message-box\>"
syn match cssFontAttr contained "\<status-bar\>"
syn keyword cssFontAttr contained larger smaller
syn match cssFontAttr contained "\<\(x\{1,2\}-\)\=\(large\|small\)\>"
syn match cssFontAttr contained "\<small-\(caps\|caption\)\>"
" font-family attributes
syn match cssFontAttr contained "\<\(sans-\)\=serif\>"
syn keyword cssFontAttr contained Antiqua Arial Black Book Charcoal Comic Courier Dingbats Gadget Geneva Georgia Grande Helvetica Impact Linotype Lucida MS Monaco Neue New Palatino Roboto Roman Symbol Tahoma Times Trebuchet Verdana Webdings Wingdings York Zapf
@@ -312,12 +254,16 @@ syn match cssMultiColumnProp contained "\<break-\(after\|before\|inside\)\>"
syn match cssMultiColumnProp contained "\<column-\(count\|fill\|gap\|rule\(-\(color\|style\|width\)\)\=\|span\|width\)\>"
syn keyword cssMultiColumnProp contained columns
syn keyword cssMultiColumnAttr contained balance medium
syn keyword cssMultiColumnAttr contained always avoid left right page column
syn match cssMultiColumnAttr contained "\<avoid-\(page\|column\)\>"
syn keyword cssMultiColumnAttr contained always left right page column
syn match cssMultiColumnAttr contained "\<avoid\(-\(page\|column\)\)\=\>"
" http://www.w3.org/TR/css3-break/#page-break
syn match cssMultiColumnProp contained "\<page\(-break-\(before\|after\|inside\)\)\=\>"
" http://www.w3.org/TR/SVG11/interact.html
syn match cssInteractProp contained "\<pointer-events\>"
syn match cssInteractAttr contained "\<\(visible\)\=\(Painted\|Fill\|Stroke\)\=\>"
" TODO find following items in w3c docs.
syn keyword cssGeneratedContentProp contained quotes crop
syn match cssGeneratedContentProp contained "\<counter-\(reset\|increment\)\>"
@@ -325,7 +271,12 @@ syn match cssGeneratedContentProp contained "\<move-to\>"
syn match cssGeneratedContentProp contained "\<page-policy\>"
syn match cssGeneratedContentAttr contained "\<\(no-\)\=\(open\|close\)-quote\>"
syn match cssGridProp contained "\<grid-\(columns\|rows\)\>"
" https://www.w3.org/TR/css-grid-1/
syn match cssGridProp contained "\<grid\>"
syn match cssGridProp contained "\<grid\(-\(template\|auto\)\)\=\(-\(columns\|rows\|areas\)\)\>"
syn match cssGridProp contained "\<grid-\(column\|row\)\(-\(start\|end\|gap\)\)\=\>"
syn match cssGridProp contained "\<grid-\(area\|gap\)\>"
syn match cssGridProp contained "\<grid-auto-flow\>"
syn match cssHyerlinkProp contained "\<target\(-\(name\|new\|position\)\)\=\>"
@@ -339,14 +290,14 @@ syn keyword cssListAttr contained inside outside
syn keyword cssPositioningProp contained bottom clear clip display float left
syn keyword cssPositioningProp contained position right top visibility
syn match cssPositioningProp contained "\<z-index\>"
syn keyword cssPositioningAttr contained block compact
syn keyword cssPositioningAttr contained block compact grid
syn match cssPositioningAttr contained "\<table\(-\(row-group\|\(header\|footer\)-group\|row\|column\(-group\)\=\|cell\|caption\)\)\=\>"
syn keyword cssPositioningAttr contained left right both
syn match cssPositioningAttr contained "\<list-item\>"
syn match cssPositioningAttr contained "\<inline\(-\(block\|box\|table\)\)\=\>"
syn keyword cssPositioningAttr contained static relative absolute fixed
syn match cssPositioningAttr contained "\<inline\(-\(block\|box\|table\|grid\|flex\)\)\=\>"
syn keyword cssPositioningAttr contained static relative absolute fixed subgrid
syn keyword cssPrintAttr contained landscape portrait crop cross always avoid
syn keyword cssPrintAttr contained landscape portrait crop cross always
syn match cssTableProp contained "\<\(caption-side\|table-layout\|border-collapse\|border-spacing\|empty-cells\)\>"
syn keyword cssTableAttr contained fixed collapse separate show hide once always
@@ -419,17 +370,20 @@ syn keyword cssUIAttr contained both horizontal vertical
syn match cssUIProp contained "\<text-overflow\>"
syn keyword cssUIAttr contained clip ellipsis
" Already highlighted Props: font content
syn match cssUIProp contained "\<image-rendering\>"
syn keyword cssUIAttr contained pixellated
syn match cssUIAttr contained "\<crisp-edges\>"
"------------------------------------------------
" Webkit/iOS specific attributes
syn match cssUIAttr contained '\(preserve-3d\)'
syn match cssUIAttr contained '\<preserve-3d\>'
" IE specific attributes
syn match cssIEUIAttr contained '\(bicubic\)'
syn match cssIEUIAttr contained '\<bicubic\>'
" Webkit/iOS specific properties
syn match cssUIProp contained '\(tap-highlight-color\|user-select\|touch-callout\)'
syn match cssUIProp contained '\<tap-highlight-color\|user-select\|touch-callout\>'
" IE specific properties
syn match cssIEUIProp contained '\(interpolation-mode\|zoom\|filter\)'
syn match cssIEUIProp contained '\<interpolation-mode\|zoom\|filter\>'
" Webkit/Firebox specific properties/attributes
syn keyword cssUIProp contained appearance
@@ -454,11 +408,25 @@ syn keyword cssAuralAttr contained male female child code digits continuous
" mobile text
syn match cssMobileTextProp contained "\<text-size-adjust\>"
syn keyword cssMediaProp contained width height orientation scan grid
syn match cssMediaProp contained /\(\(max\|min\)-\)\=\(\(device\)-\)\=aspect-ratio/
syn match cssMediaProp contained /\(\(max\|min\)-\)\=device-pixel-ratio/
syn match cssMediaProp contained /\(\(max\|min\)-\)\=device-\(height\|width\)/
syn match cssMediaProp contained /\(\(max\|min\)-\)\=\(height\|width\|resolution\|monochrome\|color\(-index\)\=\)/
syn keyword cssMediaAttr contained portrait landscape progressive interlace
syn match cssKeyFrameProp /\d*%\|from\|to/ contained nextgroup=cssDefinition
syn match cssPageMarginProp /@\(\(top\|left\|right\|bottom\)-\(left\|center\|right\|middle\|bottom\)\)\(-corner\)\=/ contained nextgroup=cssDefinition
syn keyword cssPageProp contained content size
syn keyword cssPageProp contained orphans widows
syn keyword cssFontDescriptorProp contained src
syn match cssFontDescriptorProp contained "\<unicode-range\>"
" unicode-range attributes
syn match cssFontDescriptorAttr contained "U+[0-9A-Fa-f?]\+"
syn match cssFontDescriptorAttr contained "U+\x\+-\x\+"
syn match cssBraces contained "[{}]"
syn match cssError contained "{@<>"
syn region cssDefinition transparent matchgroup=cssBraces start='{' end='}' contains=cssAttrRegion,css.*Prop,cssComment,cssValue.*,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition,cssHacks,cssNoise fold
syn region cssDefinition transparent matchgroup=cssBraces start='{' end='}' contains=cssTagName,cssAttributeSelector,cssClassName,cssIdentifier,cssAtRule,cssAttrRegion,css.*Prop,cssComment,cssValue.*,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition,cssHacks,cssNoise fold
syn match cssBraceError "}"
syn match cssAttrComma ","
@@ -477,7 +445,7 @@ syn match cssPseudoClassId contained "\<focus\(-inner\)\=\>"
syn match cssPseudoClassId contained "\<\(input-\)\=placeholder\>"
" Misc highlight groups
syntax match cssUnitDecorators /\(#\|-\|%\|mm\|cm\|in\|pt\|pc\|em\|ex\|px\|ch\|rem\|vh\|vw\|vmin\|vmax\|dpi\|dppx\|dpcm\|Hz\|kHz\|s\|ms\|deg\|grad\|rad\)/ contained
syntax match cssUnitDecorators /\(#\|-\|+\|%\|mm\|cm\|in\|pt\|pc\|em\|ex\|px\|ch\|rem\|vh\|vw\|vmin\|vmax\|dpi\|dppx\|dpcm\|Hz\|kHz\|s\|ms\|deg\|grad\|rad\)/ contained
syntax match cssNoise contained /\(:\|;\|\/\)/
" Comment
@@ -490,7 +458,7 @@ syn region cssStringQQ start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=cssUnicodeEsc
syn region cssStringQ start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=cssUnicodeEscape,cssSpecialCharQ
" Vendor Prefix
syn match cssVendor contained "\(-\(webkit\|moz\|o\|ms\)-\)"
syn match cssVendor contained "-\(webkit\|moz\|o\|ms\)-"
" Various CSS Hack characters
" In earlier versions of IE (6 and 7), one can prefix property names
@@ -508,6 +476,34 @@ syn region cssAttrRegion start=/:/ end=/\ze\(;\|)\|}\)/ contained contains=css.*
" 'transition' has Props after ':'.
syn region cssAttrRegion start=/transition\s*:/ end=/\ze\(;\|)\|}\)/ contained contains=css.*Prop,css.*Attr,cssColor,cssImportant,cssValue.*,cssFunction,cssString.*,cssURL,cssComment,cssUnicodeEscape,cssVendor,cssError,cssAttrComma,cssNoise
syn match cssAtKeyword /@\(font-face\|media\|keyframes\|import\|charset\|namespace\|page\|supports\)/ contained
syn keyword cssAtRuleLogical only not and contained
" @media
" Reference: http://www.w3.org/TR/css3-mediaqueries/
syn region cssAtRule start=/@media\>/ end=/\ze{/ skipwhite skipnl matchgroup=cssAtKeyword contains=cssMediaProp,cssValueLength,cssAtRuleLogical,cssValueInteger,cssMediaAttr,cssVendor,cssMediaType,cssComment nextgroup=cssDefinition
syn keyword cssMediaType contained screen print aural braille embossed handheld projection tty tv speech all contained
" @page
" http://www.w3.org/TR/css3-page/
syn region cssAtRule start=/@page\>/ end=/\ze{/ skipwhite skipnl matchgroup=cssAtKeyword contains=cssPagePseudo,cssComment nextgroup=cssDefinition
syn match cssPagePseudo /:\(left\|right\|first\|blank\)/ contained skipwhite skipnl
" @keyframe
" http://www.w3.org/TR/css3-animations/#keyframes
syn region cssAtRule start=/@\(-[a-z]\+-\)\=keyframes\>/ end=/\ze{/ skipwhite skipnl matchgroup=cssAtKeyword contains=cssVendor,cssComment nextgroup=cssDefinition
syn region cssAtRule start=/@import\>/ end=/\ze;/ contains=cssStringQ,cssStringQQ,cssUnicodeEscape,cssComment,cssAtKeyword,cssURL,cssMediaProp,cssValueLength,cssAtRuleLogical,cssValueInteger,cssMediaAttr,cssMediaType
syn region cssAtRule start=/@charset\>/ end=/\ze;/ contains=cssStringQ,cssStringQQ,cssUnicodeEscape,cssComment,cssAtKeyword
syn region cssAtRule start=/@namespace\>/ end=/\ze;/ contains=cssStringQ,cssStringQQ,cssUnicodeEscape,cssComment,cssAtKeyword
" @font-face
" http://www.w3.org/TR/css3-fonts/#at-font-face-rule
syn match cssAtRule "@font-face\>" nextgroup=cssFontDescriptorBlock
" @supports
" https://www.w3.org/TR/css3-conditional/#at-supports
syn region cssAtRule start=/@supports\>/ end=/\ze{/ skipwhite skipnl contains=cssAtRuleLogical,cssAttrRegion,css.*Prop,cssValue.*,cssVendor,cssAtKeyword,cssComment nextgroup=cssDefinition
if main_syntax == "css"
syn sync minlines=10
@@ -537,6 +533,7 @@ hi def link cssFontProp cssProp
hi def link cssGeneratedContentProp cssProp
hi def link cssGridProp cssProp
hi def link cssHyerlinkProp cssProp
hi def link cssInteractProp cssProp
hi def link cssLineboxProp cssProp
hi def link cssListProp cssProp
hi def link cssMarqueeProp cssProp
@@ -567,6 +564,7 @@ hi def link cssFontAttr cssAttr
hi def link cssGeneratedContentAttr cssAttr
hi def link cssGridAttr cssAttr
hi def link cssHyerlinkAttr cssAttr
hi def link cssInteractAttr cssAttr
hi def link cssLineboxAttr cssAttr
hi def link cssListAttr cssAttr
hi def link cssMarginAttr cssAttr
@@ -603,8 +601,8 @@ hi def link cssFunctionName Function
hi def link cssFunctionComma Function
hi def link cssColor Constant
hi def link cssIdentifier Function
hi def link cssInclude Include
hi def link cssIncludeKeyword atKeyword
hi def link cssAtRule Include
hi def link cssAtKeyword PreProc
hi def link cssImportant Special
hi def link cssBraces Function
hi def link cssBraceError Error
@@ -613,20 +611,16 @@ hi def link cssUnicodeEscape Special
hi def link cssStringQQ String
hi def link cssStringQ String
hi def link cssAttributeSelector String
hi def link cssMedia atKeyword
hi def link cssMediaType Special
hi def link cssMediaComma Normal
hi def link cssMediaKeyword Statement
hi def link cssAtRuleLogical Statement
hi def link cssMediaProp cssProp
hi def link cssMediaAttr cssAttr
hi def link cssPage atKeyword
hi def link cssPagePseudo PreProc
hi def link cssPageMargin atKeyword
hi def link cssPageMarginProp cssAtKeyword
hi def link cssPageProp cssProp
hi def link cssKeyFrame atKeyword
hi def link cssKeyFrameSelector Constant
hi def link cssKeyFrameProp Constant
hi def link cssFontDescriptor Special
hi def link cssFontDescriptorFunction Constant
hi def link cssFontDescriptorProp cssProp
hi def link cssFontDescriptorAttr cssAttr
hi def link cssUnicodeRange Constant
@@ -636,7 +630,6 @@ hi def link cssProp StorageClass
hi def link cssAttr Constant
hi def link cssUnitDecorators Number
hi def link cssNoise Noise
hi def link atKeyword PreProc
let b:current_syntax = "css"
+7 -1
View File
@@ -2,7 +2,7 @@
" Language: dircolors(1) input file
" Maintainer: Jan Larres <jan@majutsushi.net>
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2013-08-17
" Latest Revision: 2018-02-19
if exists("b:current_syntax")
finish
@@ -135,6 +135,12 @@ function! s:preview_color(linenr) abort
elseif item >= 40 && item <= 47
" ANSI SGR background color
let hi_str .= s:get_hi_str(item - 40, 'bg')
elseif item >= 90 && item <= 97
" ANSI SGR+8 foreground color (xterm 16-color support)
let hi_str .= s:get_hi_str(item - 82, 'fg')
elseif item >= 100 && item <= 107
" ANSI SGR+8 background color (xterm 16-color support)
let hi_str .= s:get_hi_str(item - 92, 'bg')
elseif item == 38
" Foreground for terminals with 88/256 color support
let color = s:get_256color(colors)
+1 -1
View File
@@ -66,7 +66,7 @@ syn keyword vimErrSetting contained bioskey biosk conskey consk autoprint beauti
" AutoCmd Events {{{2
syn case ignore
syn keyword vimAutoEvent contained BufAdd BufCreate BufDelete BufEnter BufFilePost BufFilePre BufHidden BufLeave BufNew BufNewFile BufRead BufReadCmd BufReadPost BufReadPre BufUnload BufWinEnter BufWinLeave BufWipeout BufWrite BufWriteCmd BufWritePost BufWritePre CmdlineEnter CmdlineLeave CmdUndefined CmdwinEnter CmdwinLeave ColorScheme CompleteDone CursorHold CursorHoldI CursorMoved CursorMovedI EncodingChanged FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileChangedShellPost FileEncoding FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre FilterWritePost FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter GUIFailed InsertChange InsertCharPre InsertEnter InsertLeave MenuPopup OptionSet QuickFixCmdPost QuickFixCmdPre QuitPre RemoteReply SessionLoadPost ShellCmdPost ShellFilterPost SourceCmd SourcePre SpellFileMissing StdinReadPost StdinReadPre SwapExists Syntax TabClosed TabEnter TabLeave TabNew TermChanged TermResponse TextChanged TextChangedI User VimEnter VimLeave VimLeavePre VimResized WinEnter WinLeave WinNew
syn keyword vimAutoEvent contained BufAdd BufCreate BufDelete BufEnter BufFilePost BufFilePre BufHidden BufLeave BufNew BufNewFile BufRead BufReadCmd BufReadPost BufReadPre BufUnload BufWinEnter BufWinLeave BufWipeout BufWrite BufWriteCmd BufWritePost BufWritePre CmdlineEnter CmdlineLeave CmdUndefined CmdwinEnter CmdwinLeave ColorScheme CompleteDone CursorHold CursorHoldI CursorMoved CursorMovedI EncodingChanged FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileChangedShellPost FileEncoding FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre FilterWritePost FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter GUIFailed InsertChange InsertCharPre InsertEnter InsertLeave MenuPopup OptionSet QuickFixCmdPost QuickFixCmdPre QuitPre RemoteReply SessionLoadPost ShellCmdPost ShellFilterPost SourceCmd SourcePre SpellFileMissing StdinReadPost StdinReadPre SwapExists Syntax TabClosed TabEnter TabLeave TabNew TermChanged TermResponse TextChanged TextChangedI TextChangedP User VimEnter VimLeave VimLeavePre VimResized WinEnter WinLeave WinNew
" Highlight commonly used Groupnames {{{2
syn keyword vimGroup contained Comment Constant String Character Number Boolean Float Identifier Function Statement Conditional Repeat Label Operator Keyword Exception PreProc Include Define Macro PreCondit Type StorageClass Structure Typedef Special SpecialChar Tag Delimiter SpecialComment Debug Underlined Ignore Error Todo
+1 -1
View File
@@ -1255,7 +1255,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>145</string>
<string>146</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
+29 -13
View File
@@ -24,6 +24,8 @@ int use_gui_macvim_draw_string = 1;
static int use_graphical_sign = 0;
static BOOL is_macos_high_sierra_or_later = NO;
// Max number of files to add to MRU in one go (this matches the maximum that
// Cocoa displays in the MRU -- if this changes in Cocoa then update this
// number as well).
@@ -283,6 +285,15 @@ gui_mch_init(void)
[[MMBackend sharedInstance] addToMRU:filenames];
}
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
{
NSOperatingSystemVersion version = {10, 13, 0};
is_macos_high_sierra_or_later =
[[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:version];
}
#endif
return OK;
}
@@ -2315,8 +2326,9 @@ static int vimModMaskToEventModifierFlags(int mods)
// -- Channel Support ------------------------------------------------------
// -- Job and Channel Support ------------------------------------------------------
#if defined(FEAT_JOB_CHANNEL)
void *
gui_macvim_add_channel(channel_T *channel, ch_part_T part)
{
@@ -2340,6 +2352,14 @@ gui_macvim_remove_channel(void *cookie)
dispatch_release(s);
}
void
gui_macvim_cleanup_job_all(void)
{
if (is_macos_high_sierra_or_later)
job_cleanup_all();
}
#endif // FEAT_JOB_CHANNEL
// -- Graphical Sign Support ------------------------------------------------
@@ -2406,11 +2426,11 @@ gui_mch_destroy_sign(void *sign)
#ifdef FEAT_BEVAL
BalloonEval *
gui_mch_create_beval_area(target, mesg, mesgCB, clientData)
void *target;
char_u *mesg;
void (*mesgCB)(BalloonEval *, int);
void *clientData;
gui_mch_create_beval_area(
void *target,
char_u *mesg,
void (*mesgCB)(BalloonEval *, int),
void *clientData)
{
BalloonEval *beval;
@@ -2426,8 +2446,7 @@ gui_mch_create_beval_area(target, mesg, mesgCB, clientData)
}
void
gui_mch_enable_beval_area(beval)
BalloonEval *beval;
gui_mch_enable_beval_area(BalloonEval *beval)
{
// Set the balloon delay when enabling balloon eval.
float delay = p_bdlay/1000.0f - MMBalloonEvalInternalDelay;
@@ -2438,8 +2457,7 @@ gui_mch_enable_beval_area(beval)
}
void
gui_mch_disable_beval_area(beval)
BalloonEval *beval;
gui_mch_disable_beval_area(BalloonEval *beval)
{
// NOTE: An empty tool tip indicates that the tool tip window should hide.
[[MMBackend sharedInstance] queueMessage:SetTooltipMsgID properties:
@@ -2450,9 +2468,7 @@ gui_mch_disable_beval_area(beval)
* Show a balloon with "mesg".
*/
void
gui_mch_post_balloon(beval, mesg)
BalloonEval *beval;
char_u *mesg;
gui_mch_post_balloon(BalloonEval *beval, char_u *mesg)
{
NSString *toolTip = [NSString stringWithVimString:mesg];
[[MMBackend sharedInstance] setLastToolTip:toolTip];
+3 -3
View File
@@ -20,7 +20,7 @@
#
# "make upx" makes *compressed* versions of the 32 bit GUI and console EXEs,
# using the excellent UPX compressor:
# http://upx.sourceforge.net/
# https://upx.github.io/
# "make mpress" uses the MPRESS compressor for 32- and 64-bit EXEs:
# http://www.matcode.com/mpress.htm
#
@@ -34,9 +34,9 @@ DEBUG=no
OPTIMIZE=MAXSPEED
# set to yes to make gvim, no for vim
GUI=yes
# set to yes if you want to use DirectWrite (DirectX)
# set to no if you do not want to use DirectWrite (DirectX)
# MinGW-w64 is needed, and ARCH should be set to i686 or x86-64.
DIRECTX=no
DIRECTX=yes
# FEATURES=[TINY | SMALL | NORMAL | BIG | HUGE]
# Set to TINY to make minimal version (few features).
FEATURES=HUGE
+5 -1
View File
@@ -26,7 +26,7 @@
# GUI interface: GUI=yes (default is no)
#
# GUI with DirectWrite (DirectX): DIRECTX=yes
# (default is no, requires GUI=yes and MBYTE=yes)
# (default is yes if GUI=yes, requires GUI=yes and MBYTE=yes)
#
# Color emoji support: COLOR_EMOJI=yes
# (default is yes if DIRECTX=yes, requires WinSDK 8.1 or later.)
@@ -180,6 +180,10 @@
TARGETOS = WINNT
!ifndef DIRECTX
DIRECTX = $(GUI)
!endif
# Select one of eight object code directories, depends on GUI, OLE, DEBUG and
# interfaces.
# If you change something else, do "make clean" first!
+11 -3
View File
@@ -651,12 +651,16 @@ LINT_OPTIONS = -beprxzF
# PROFILING - Uncomment the next two lines to do profiling with gcc and gprof.
# Might not work with GUI or Perl.
# For unknown reasons adding "-lc" fixes a linking problem with some versions
# of GCC. That's probably a bug in the "-pg" implementation.
# After running Vim see the profile result with: gprof vim gmon.out | vim -
# Need to recompile everything after changing this: "make clean" "make".
#PROFILE_CFLAGS = -pg -g -DWE_ARE_PROFILING
#PROFILE_LIBS = -pg
# GCC 5 and later need the -no-pie argument.
#PROFILE_LIBS = -pg -no-pie
# For unknown reasons adding "-lc" fixes a linking problem with some versions
# of GCC. That's probably a bug in the "-pg" implementation.
#PROFILE_LIBS = -pg -lc
@@ -1409,6 +1413,8 @@ TERM_DEPS = \
libvterm/src/utf8.h \
libvterm/src/vterm_internal.h
TERM_SRC = libvterm/src/*.c
### Command to create dependencies based on #include "..."
### prototype headers are ignored due to -DPROTO, system
### headers #include <...> are ignored if we use the -MM option, as
@@ -2053,7 +2059,7 @@ notags:
# Motif and Athena GUI
# You can ignore error messages for missing files.
tags TAGS: notags
$(TAGPRG) $(TAGS_SRC) $(TAGS_INCL)
$(TAGPRG) $(TAGS_SRC) $(TAGS_INCL) $(TERM_SRC) $(TERM_DEPS)
# Make a highlight file for types. Requires Exuberant ctags and awk
types: types.vim
@@ -2168,6 +2174,7 @@ test_arglist \
test_eval_stuff \
test_ex_undo \
test_ex_z \
test_exit \
test_exec_while_if \
test_execute_func \
test_exists \
@@ -2898,6 +2905,7 @@ shadow: runtime pixmaps
../../testdir/pyxfile \
../../testdir/sautest \
../../testdir/samples \
../../testdir/dumps \
../../testdir/test83-tags? \
../../testdir/*.ok .
+17 -2
View File
@@ -8,8 +8,8 @@ You might also want to read ":help development".
JUMPING AROUND
First of all, use ":make tags" to generate a tags file, so that you can use
the ":tag" command to jump around the source code.
First of all, use ":make tags" to generate a tags file, so that you can jump
around in the source code.
To jump to a function or variable definition, move the cursor on the name and
use the CTRL-] command. Use CTRL-T or CTRL-O to jump back.
@@ -43,6 +43,21 @@ Most code can be found in a file with an obvious name (incomplete list):
window.c handling split windows
DEBUGGING
If you have a reasonable recent version of gdb, you can use the :Termdebug
command to debug Vim. See ":help :Termdebug".
When something is time critical or stepping through code is a hassle, use the
channel logging to create a time-stamped log file. Add lines to the code like
this:
ch_log(NULL, "Value is now %02x", value);
After compiling and starting Vim, do:
:call ch_logfile('debuglog', 'w')
And edit "debuglog" to see what happens. The channel functions already have
ch_log() calls, thus you always see that in the log.
IMPORTANT VARIABLES
The current mode is stored in "State". The values it can have are NORMAL,
+1 -1
View File
@@ -137,7 +137,7 @@ get_beval_info(
* Show a balloon with "mesg" or "list".
*/
void
post_balloon(BalloonEval *beval UNUSED, char_u *mesg, list_T *list)
post_balloon(BalloonEval *beval UNUSED, char_u *mesg, list_T *list UNUSED)
{
# ifdef FEAT_BEVAL_TERM
# ifdef FEAT_GUI
+69 -169
View File
@@ -63,9 +63,7 @@ static void insert_sign(buf_T *buf, signlist_T *prev, signlist_T *next, int id,
static char *msg_loclist = N_("[Location List]");
static char *msg_qflist = N_("[Quickfix List]");
#endif
#ifdef FEAT_AUTOCMD
static char *e_auabort = N_("E855: Autocommands caused command to abort");
#endif
/* Number of times free_buffer() was called. */
static int buf_free_count = 0;
@@ -116,17 +114,15 @@ read_buffer(
else if (retval == OK)
unchanged(curbuf, FALSE);
#ifdef FEAT_AUTOCMD
if (retval == OK)
{
# ifdef FEAT_EVAL
#ifdef FEAT_EVAL
apply_autocmds_retval(EVENT_STDINREADPOST, NULL, NULL, FALSE,
curbuf, &retval);
# else
curbuf, &retval);
#else
apply_autocmds(EVENT_STDINREADPOST, NULL, NULL, FALSE, curbuf);
# endif
}
#endif
}
}
return retval;
}
@@ -143,9 +139,7 @@ open_buffer(
int flags) /* extra flags for readfile() */
{
int retval = OK;
#ifdef FEAT_AUTOCMD
bufref_T old_curbuf;
#endif
#ifdef FEAT_SYN_HL
long old_tw = curbuf->b_p_tw;
#endif
@@ -188,12 +182,10 @@ open_buffer(
return FAIL;
}
#ifdef FEAT_AUTOCMD
/* The autocommands in readfile() may change the buffer, but only AFTER
* reading the file. */
set_bufref(&old_curbuf, curbuf);
modified_was_set = FALSE;
#endif
/* mark cursor position as being invalid */
curwin->w_valid = 0;
@@ -289,11 +281,9 @@ open_buffer(
* the changed flag. Unless in readonly mode: "ls | gview -".
* When interrupted and 'cpoptions' contains 'i' set changed flag. */
if ((got_int && vim_strchr(p_cpo, CPO_INTMOD) != NULL)
#ifdef FEAT_AUTOCMD
|| modified_was_set /* ":set modified" used in autocmd */
# ifdef FEAT_EVAL
#ifdef FEAT_EVAL
|| (aborting() && vim_strchr(p_cpo, CPO_INTMOD) != NULL)
# endif
#endif
)
changed();
@@ -301,6 +291,13 @@ open_buffer(
unchanged(curbuf, FALSE);
save_file_ff(curbuf); /* keep this fileformat */
/* Set last_changedtick to avoid triggering a TextChanged autocommand right
* after it was added. */
curbuf->b_last_changedtick = CHANGEDTICK(curbuf);
#ifdef FEAT_INS_EXPAND
curbuf->b_last_changedtick_pum = CHANGEDTICK(curbuf);
#endif
/* require "!" to overwrite the file, because it wasn't read completely */
#ifdef FEAT_EVAL
if (aborting())
@@ -315,25 +312,22 @@ open_buffer(
foldUpdateAll(curwin);
#endif
#ifdef FEAT_AUTOCMD
/* need to set w_topline, unless some autocommand already did that. */
if (!(curwin->w_valid & VALID_TOPLINE))
{
curwin->w_topline = 1;
# ifdef FEAT_DIFF
#ifdef FEAT_DIFF
curwin->w_topfill = 0;
# endif
#endif
}
# ifdef FEAT_EVAL
#ifdef FEAT_EVAL
apply_autocmds_retval(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf, &retval);
# else
#else
apply_autocmds(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf);
# endif
#endif
if (retval == OK)
{
#ifdef FEAT_AUTOCMD
/*
* The autocommands may have changed the current buffer. Apply the
* modelines to the correct buffer, if it still exists and is loaded.
@@ -344,22 +338,19 @@ open_buffer(
/* Go to the buffer that was opened. */
aucmd_prepbuf(&aco, old_curbuf.br_buf);
#endif
do_modelines(0);
curbuf->b_flags &= ~(BF_CHECK_RO | BF_NEVERLOADED);
#ifdef FEAT_AUTOCMD
# ifdef FEAT_EVAL
#ifdef FEAT_EVAL
apply_autocmds_retval(EVENT_BUFWINENTER, NULL, NULL, FALSE, curbuf,
&retval);
# else
&retval);
#else
apply_autocmds(EVENT_BUFWINENTER, NULL, NULL, FALSE, curbuf);
# endif
#endif
/* restore curwin/curbuf and a few other things */
aucmd_restbuf(&aco);
}
#endif
}
return retval;
@@ -454,14 +445,12 @@ close_buffer(
int action,
int abort_if_last UNUSED)
{
#ifdef FEAT_AUTOCMD
int is_curbuf;
int nwindows;
bufref_T bufref;
int is_curwin = (curwin != NULL && curwin->w_buffer == buf);
win_T *the_curwin = curwin;
tabpage_T *the_curtab = curtab;
#endif
int unload_buf = (action != 0);
int del_buf = (action == DOBUF_DEL || action == DOBUF_WIPE);
int wipe_buf = (action == DOBUF_WIPE);
@@ -510,7 +499,6 @@ close_buffer(
}
#endif
#ifdef FEAT_AUTOCMD
/* Disallow deleting the buffer when it is locked (already being closed or
* halfway a command that relies on it). Unloading is allowed. */
if (buf->b_locked > 0 && (del_buf || wipe_buf))
@@ -518,7 +506,6 @@ close_buffer(
EMSG(_("E937: Attempt to delete a buffer that is in use"));
return;
}
#endif
/* check no autocommands closed the window */
if (win != NULL && win_valid_any_tab(win))
@@ -534,7 +521,6 @@ close_buffer(
win->w_cursor.col, TRUE);
}
#ifdef FEAT_AUTOCMD
set_bufref(&bufref, buf);
/* When the buffer is no longer in a window, trigger BufWinLeave */
@@ -570,10 +556,10 @@ aucmd_abort:
/* Autocommands made this the only window. */
goto aucmd_abort;
}
# ifdef FEAT_EVAL
#ifdef FEAT_EVAL
if (aborting()) /* autocmds may abort script processing */
return;
# endif
#endif
}
/* If the buffer was in curwin and the window has changed, go back to that
@@ -587,7 +573,6 @@ aucmd_abort:
}
nwindows = buf->b_nwindows;
#endif
/* decrease the link count from windows (unless not in any window) */
if (buf->b_nwindows > 0)
@@ -620,23 +605,20 @@ aucmd_abort:
* Free all things allocated for this buffer.
* Also calls the "BufDelete" autocommands when del_buf is TRUE.
*/
#ifdef FEAT_AUTOCMD
/* Remember if we are closing the current buffer. Restore the number of
* windows, so that autocommands in buf_freeall() don't get confused. */
is_curbuf = (buf == curbuf);
buf->b_nwindows = nwindows;
#endif
buf_freeall(buf, (del_buf ? BFA_DEL : 0) + (wipe_buf ? BFA_WIPE : 0));
#ifdef FEAT_AUTOCMD
/* Autocommands may have deleted the buffer. */
if (!bufref_valid(&bufref))
return;
# ifdef FEAT_EVAL
#ifdef FEAT_EVAL
if (aborting()) /* autocmds may abort script processing */
return;
# endif
#endif
/*
* It's possible that autocommands change curbuf to the one being deleted.
@@ -655,7 +637,6 @@ aucmd_abort:
* Decrement the count for the close we do here. */
if (buf->b_nwindows > 0)
--buf->b_nwindows;
#endif
#ifdef FEAT_ODB_EDITOR
odb_buffer_close(buf);
@@ -736,7 +717,6 @@ buf_clear_file(buf_T *buf)
void
buf_freeall(buf_T *buf, int flags)
{
#ifdef FEAT_AUTOCMD
int is_curbuf = (buf == curbuf);
bufref_T bufref;
int is_curwin = (curwin != NULL && curwin->w_buffer == buf);
@@ -782,10 +762,10 @@ buf_freeall(buf_T *buf, int flags)
unblock_autocmds();
}
# ifdef FEAT_EVAL
#ifdef FEAT_EVAL
if (aborting()) /* autocmds may abort script processing */
return;
# endif
#endif
/*
* It's possible that autocommands change curbuf to the one being deleted.
@@ -795,7 +775,6 @@ buf_freeall(buf_T *buf, int flags)
*/
if (buf == curbuf && !is_curbuf)
return;
#endif
#ifdef FEAT_DIFF
diff_buf_delete(buf); /* Can't use 'diff' for unloaded buffer. */
#endif
@@ -874,7 +853,6 @@ free_buffer(buf_T *buf)
buf_hashtab_remove(buf);
#ifdef FEAT_AUTOCMD
aubuflocal_remove(buf);
if (autocmd_busy)
@@ -885,7 +863,6 @@ free_buffer(buf_T *buf)
au_pending_free_buf = buf;
}
else
#endif
vim_free(buf);
}
@@ -998,7 +975,7 @@ goto_buffer(
# if defined(HAS_SWAP_EXISTS_ACTION)
if (swap_exists_action == SEA_QUIT && *eap->cmd == 's')
{
# if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
# if defined(FEAT_EVAL)
cleanup_T cs;
/* Reset the error/interrupt/exception state here so that
@@ -1011,7 +988,7 @@ goto_buffer(
swap_exists_action = SEA_NONE;
swap_exists_did_quit = TRUE;
# if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
# if defined(FEAT_EVAL)
/* Restore the error/interrupt/exception state if not discarded by a
* new aborting error, interrupt, or uncaught exception. */
leave_cleanup(&cs);
@@ -1031,17 +1008,17 @@ goto_buffer(
void
handle_swap_exists(bufref_T *old_curbuf)
{
# if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
# if defined(FEAT_EVAL)
cleanup_T cs;
# endif
#ifdef FEAT_SYN_HL
# ifdef FEAT_SYN_HL
long old_tw = curbuf->b_p_tw;
#endif
# endif
buf_T *buf;
if (swap_exists_action == SEA_QUIT)
{
# if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
# if defined(FEAT_EVAL)
/* Reset the error/interrupt/exception state here so that
* aborting() returns FALSE when closing a buffer. */
enter_cleanup(&cs);
@@ -1061,14 +1038,14 @@ handle_swap_exists(bufref_T *old_curbuf)
if (buf != NULL)
{
enter_buffer(buf);
#ifdef FEAT_SYN_HL
# ifdef FEAT_SYN_HL
if (old_tw != curbuf->b_p_tw)
check_colorcolumn(curwin);
#endif
# endif
}
/* If "old_curbuf" is NULL we are in big trouble here... */
# if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
# if defined(FEAT_EVAL)
/* Restore the error/interrupt/exception state if not discarded by a
* new aborting error, interrupt, or uncaught exception. */
leave_cleanup(&cs);
@@ -1076,7 +1053,7 @@ handle_swap_exists(bufref_T *old_curbuf)
}
else if (swap_exists_action == SEA_RECOVER)
{
# if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
# if defined(FEAT_EVAL)
/* Reset the error/interrupt/exception state here so that
* aborting() returns FALSE when closing a buffer. */
enter_cleanup(&cs);
@@ -1089,7 +1066,7 @@ handle_swap_exists(bufref_T *old_curbuf)
cmdline_row = msg_row;
do_modelines(0);
# if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
# if defined(FEAT_EVAL)
/* Restore the error/interrupt/exception state if not discarded by a
* new aborting error, interrupt, or uncaught exception. */
leave_cleanup(&cs);
@@ -1404,23 +1381,21 @@ do_buffer(
if (!forceit && bufIsChanged(buf))
{
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
# if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
if ((p_confirm || cmdmod.confirm) && p_write)
{
dialog_changed(buf, FALSE);
# ifdef FEAT_AUTOCMD
if (!bufref_valid(&bufref))
/* Autocommand deleted buffer, oops! It's not changed
* now. */
return FAIL;
# endif
/* If it's still changed fail silently, the dialog already
* mentioned why it fails. */
if (bufIsChanged(buf))
return FAIL;
}
else
#endif
# endif
{
EMSGN(_("E89: No write since last change for buffer %ld (add ! to override)"),
buf->b_fnum);
@@ -1448,9 +1423,7 @@ do_buffer(
* a window with this buffer.
*/
while (buf == curbuf
#ifdef FEAT_AUTOCMD
&& !(curwin->w_closing || curwin->w_buffer->b_locked > 0)
#endif
&& (!ONE_WINDOW || first_tabpage->tp_next != NULL))
{
if (win_close(curwin, FALSE) == FAIL)
@@ -1480,15 +1453,10 @@ do_buffer(
*/
buf = NULL; /* selected buffer */
bp = NULL; /* used when no loaded buffer found */
#ifdef FEAT_AUTOCMD
if (au_new_curbuf.br_buf != NULL && bufref_valid(&au_new_curbuf))
buf = au_new_curbuf.br_buf;
# ifdef FEAT_JUMPLIST
else
# endif
#endif
#ifdef FEAT_JUMPLIST
if (curwin->w_jumplistlen > 0)
else if (curwin->w_jumplistlen > 0)
{
int jumpidx;
@@ -1607,17 +1575,13 @@ do_buffer(
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
if ((p_confirm || cmdmod.confirm) && p_write)
{
# ifdef FEAT_AUTOCMD
bufref_T bufref;
set_bufref(&bufref, buf);
# endif
dialog_changed(curbuf, FALSE);
# ifdef FEAT_AUTOCMD
if (!bufref_valid(&bufref))
/* Autocommand deleted buffer, oops! */
return FAIL;
# endif
}
if (bufIsChanged(curbuf))
#endif
@@ -1630,15 +1594,14 @@ do_buffer(
/* Go to the other buffer. */
set_curbuf(buf, action);
#if defined(FEAT_LISTCMDS) \
&& (defined(FEAT_SCROLLBIND) || defined(FEAT_CURSORBIND))
#if defined(FEAT_LISTCMDS)
if (action == DOBUF_SPLIT)
{
RESET_BINDING(curwin); /* reset 'scrollbind' and 'cursorbind' */
}
#endif
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
#if defined(FEAT_EVAL)
if (aborting()) /* autocmds may abort script processing */
return FAIL;
#endif
@@ -1682,17 +1645,15 @@ set_curbuf(buf_T *buf, int action)
set_bufref(&prevbufref, prevbuf);
set_bufref(&newbufref, buf);
#ifdef FEAT_AUTOCMD
/* Autocommands may delete the curren buffer and/or the buffer we wan to go
* to. In those cases don't close the buffer. */
if (!apply_autocmds(EVENT_BUFLEAVE, NULL, NULL, FALSE, curbuf)
|| (bufref_valid(&prevbufref)
&& bufref_valid(&newbufref)
# ifdef FEAT_EVAL
#ifdef FEAT_EVAL
&& !aborting()
# endif
))
#endif
))
{
#ifdef FEAT_SYN_HL
if (prevbuf == curwin->w_buffer)
@@ -1700,7 +1661,7 @@ set_curbuf(buf_T *buf, int action)
#endif
if (unload)
close_windows(prevbuf, FALSE);
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
#if defined(FEAT_EVAL)
if (bufref_valid(&prevbufref) && !aborting())
#else
if (bufref_valid(&prevbufref))
@@ -1718,16 +1679,14 @@ set_curbuf(buf_T *buf, int action)
curwin = previouswin;
}
}
#ifdef FEAT_AUTOCMD
/* An autocommand may have deleted "buf", already entered it (e.g., when
* it did ":bunload") or aborted the script processing.
* If curwin->w_buffer is null, enter_buffer() will make it valid again */
if ((buf_valid(buf) && buf != curbuf
# ifdef FEAT_EVAL
#ifdef FEAT_EVAL
&& !aborting()
# endif
) || curwin->w_buffer == NULL)
#endif
) || curwin->w_buffer == NULL)
{
enter_buffer(buf);
#ifdef FEAT_SYN_HL
@@ -1777,9 +1736,7 @@ enter_buffer(buf_T *buf)
curwin->w_cursor.coladd = 0;
#endif
curwin->w_set_curswant = TRUE;
#ifdef FEAT_AUTOCMD
curwin->w_topline_was_set = FALSE;
#endif
/* mark cursor position as being invalid */
curwin->w_valid = 0;
@@ -1787,13 +1744,11 @@ enter_buffer(buf_T *buf)
/* Make sure the buffer is loaded. */
if (curbuf->b_ml.ml_mfp == NULL) /* need to load the file */
{
#ifdef FEAT_AUTOCMD
/* If there is no filetype, allow for detecting one. Esp. useful for
* ":ball" used in a autocommand. If there already is a filetype we
* might prefer to keep it. */
if (*curbuf->b_p_ft == NUL)
did_filetype = FALSE;
#endif
open_buffer(FALSE, NULL, 0);
}
@@ -1802,14 +1757,12 @@ enter_buffer(buf_T *buf)
if (!msg_silent)
need_fileinfo = TRUE; /* display file info after redraw */
(void)buf_check_timestamp(curbuf, FALSE); /* check if file changed */
#ifdef FEAT_AUTOCMD
curwin->w_topline = 1;
# ifdef FEAT_DIFF
#ifdef FEAT_DIFF
curwin->w_topfill = 0;
# endif
#endif
apply_autocmds(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf);
apply_autocmds(EVENT_BUFWINENTER, NULL, NULL, FALSE, curbuf);
#endif
}
/* If autocommands did not change the cursor position, restore cursor lnum
@@ -1821,10 +1774,8 @@ enter_buffer(buf_T *buf)
#ifdef FEAT_TITLE
maketitle();
#endif
#ifdef FEAT_AUTOCMD
/* when autocmds didn't change it */
if (curwin->w_topline == 1 && !curwin->w_topline_was_set)
#endif
scroll_cursor_halfway(FALSE); /* redisplay at correct position */
#ifdef FEAT_NETBEANS_INTG
@@ -1879,10 +1830,10 @@ no_write_message(void)
}
void
no_write_message_nobang(void)
no_write_message_nobang(buf_T *buf UNUSED)
{
#ifdef FEAT_TERMINAL
if (term_job_running(curbuf->b_term))
if (term_job_running(buf->b_term))
EMSG(_("E948: Job still running"));
else
#endif
@@ -1952,11 +1903,9 @@ buflist_new(
if ((flags & BLN_LISTED) && !buf->b_p_bl)
{
#ifdef FEAT_AUTOCMD
bufref_T bufref;
#endif
buf->b_p_bl = TRUE;
#ifdef FEAT_AUTOCMD
set_bufref(&bufref, buf);
if (!(flags & BLN_DUMMY))
{
@@ -1964,7 +1913,6 @@ buflist_new(
&& !bufref_valid(&bufref))
return NULL;
}
#endif
}
return buf;
}
@@ -1985,21 +1933,17 @@ buflist_new(
&& (curbuf->b_ml.ml_mfp == NULL || BUFEMPTY()))
{
buf = curbuf;
#ifdef FEAT_AUTOCMD
/* It's like this buffer is deleted. Watch out for autocommands that
* change curbuf! If that happens, allocate a new buffer anyway. */
if (curbuf->b_p_bl)
apply_autocmds(EVENT_BUFDELETE, NULL, NULL, FALSE, curbuf);
if (buf == curbuf)
apply_autocmds(EVENT_BUFWIPEOUT, NULL, NULL, FALSE, curbuf);
# ifdef FEAT_EVAL
#ifdef FEAT_EVAL
if (aborting()) /* autocmds may abort script processing */
return NULL;
# endif
#endif
#ifdef FEAT_AUTOCMD
if (buf == curbuf)
#endif
{
/* Make sure 'bufhidden' and 'buftype' are empty */
clear_string_option(&buf->b_p_bh);
@@ -2053,7 +1997,7 @@ buflist_new(
buf_freeall(buf, 0);
if (buf != curbuf) /* autocommands deleted the buffer! */
return NULL;
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
#if defined(FEAT_EVAL)
if (aborting()) /* autocmds may abort script processing */
return NULL;
#endif
@@ -2132,7 +2076,6 @@ buflist_new(
clrallmarks(buf); /* clear marks */
fmarks_check_names(buf); /* check file marks for this file */
buf->b_p_bl = (flags & BLN_LISTED) ? TRUE : FALSE; /* init 'buflisted' */
#ifdef FEAT_AUTOCMD
if (!(flags & BLN_DUMMY))
{
bufref_T bufref;
@@ -2150,12 +2093,11 @@ buflist_new(
&& !bufref_valid(&bufref))
return NULL;
}
# ifdef FEAT_EVAL
#ifdef FEAT_EVAL
if (aborting()) /* autocmds may abort script processing */
return NULL;
# endif
}
#endif
}
return buf;
}
@@ -2234,9 +2176,7 @@ free_buf_options(
#ifdef FEAT_SEARCHPATH
clear_string_option(&buf->b_p_sua);
#endif
#ifdef FEAT_AUTOCMD
clear_string_option(&buf->b_p_ft);
#endif
#ifdef FEAT_CINDENT
clear_string_option(&buf->b_p_cink);
clear_string_option(&buf->b_p_cino);
@@ -2319,10 +2259,8 @@ buflist_getfile(
text_locked_msg();
return FAIL;
}
#ifdef FEAT_AUTOCMD
if (curbuf_locked())
return FAIL;
#endif
/* altfpos may be changed by getfile(), get it now */
if (lnum == 0)
@@ -4378,7 +4316,6 @@ build_stl_str_hl(
: _("[Help]"));
break;
#ifdef FEAT_AUTOCMD
case STL_FILETYPE:
if (*wp->w_buffer->b_p_ft != NUL
&& STRLEN(wp->w_buffer->b_p_ft) < TMPLEN - 3)
@@ -4401,7 +4338,6 @@ build_stl_str_hl(
str = tmp;
}
break;
#endif
#if defined(FEAT_QUICKFIX)
case STL_PREVIEWFLAG:
@@ -5023,20 +4959,18 @@ do_arg_all(
if (!buf_hide(buf) && buf->b_nwindows <= 1
&& bufIsChanged(buf))
{
#ifdef FEAT_AUTOCMD
bufref_T bufref;
set_bufref(&bufref, buf);
#endif
(void)autowrite(buf, FALSE);
#ifdef FEAT_AUTOCMD
/* check if autocommands removed the window */
if (!win_valid(wp) || !bufref_valid(&bufref))
{
wpnext = firstwin; /* start all over... */
continue;
}
#endif
}
/* don't close last window */
if (ONE_WINDOW
@@ -5045,11 +4979,10 @@ do_arg_all(
else
{
win_close(wp, !buf_hide(buf) && !bufIsChanged(buf));
#ifdef FEAT_AUTOCMD
/* check if autocommands removed the next window */
if (!win_valid(wpnext))
wpnext = firstwin; /* start all over... */
#endif
}
}
}
@@ -5059,11 +4992,10 @@ do_arg_all(
if (had_tab == 0 || tpnext == NULL)
break;
# ifdef FEAT_AUTOCMD
/* check if autocommands removed the next tab page */
if (!valid_tabpage(tpnext))
tpnext = first_tabpage; /* start all over...*/
# endif
goto_tabpage_tp(tpnext, TRUE, TRUE);
}
@@ -5074,11 +5006,9 @@ do_arg_all(
if (count > opened_len || count <= 0)
count = opened_len;
#ifdef FEAT_AUTOCMD
/* Don't execute Win/Buf Enter/Leave autocommands here. */
++autocmd_no_enter;
++autocmd_no_leave;
#endif
last_curwin = curwin;
last_curtab = curtab;
win_enter(lastwin, FALSE);
@@ -5124,10 +5054,8 @@ do_arg_all(
if (split_ret == FAIL)
continue;
}
#ifdef FEAT_AUTOCMD
else /* first window: do autocmd for leaving this buffer */
--autocmd_no_leave;
#endif
/*
* edit file "i"
@@ -5143,10 +5071,8 @@ do_arg_all(
((buf_hide(curwin->w_buffer)
|| bufIsChanged(curwin->w_buffer)) ? ECMD_HIDE : 0)
+ ECMD_OLDBUF, curwin);
#ifdef FEAT_AUTOCMD
if (use_firstwin)
++autocmd_no_leave;
#endif
use_firstwin = FALSE;
}
ui_breakcheck();
@@ -5159,9 +5085,8 @@ do_arg_all(
/* Remove the "lock" on the argument list. */
alist_unlink(alist);
#ifdef FEAT_AUTOCMD
--autocmd_no_enter;
#endif
/* restore last referenced tabpage's curwin */
if (last_curtab != new_curtab)
{
@@ -5176,9 +5101,7 @@ do_arg_all(
if (win_valid(new_curwin))
win_enter(new_curwin, FALSE);
#ifdef FEAT_AUTOCMD
--autocmd_no_leave;
#endif
vim_free(opened);
}
@@ -5233,18 +5156,13 @@ ex_buffer_all(exarg_T *eap)
- tabline_height()
: wp->w_width != Columns)
|| (had_tab > 0 && wp != firstwin)) && !ONE_WINDOW
#ifdef FEAT_AUTOCMD
&& !(wp->w_closing || wp->w_buffer->b_locked > 0)
#endif
)
&& !(wp->w_closing || wp->w_buffer->b_locked > 0))
{
win_close(wp, FALSE);
#ifdef FEAT_AUTOCMD
wpnext = firstwin; /* just in case an autocommand does
something strange with windows */
tpnext = first_tabpage; /* start all over...*/
open_wins = 0;
#endif
}
else
++open_wins;
@@ -5261,14 +5179,10 @@ ex_buffer_all(exarg_T *eap)
* open one. Otherwise move the window to the right position.
* Watch out for autocommands that delete buffers or windows!
*/
#ifdef FEAT_AUTOCMD
/* Don't execute Win/Buf Enter/Leave autocommands here. */
++autocmd_no_enter;
#endif
win_enter(lastwin, FALSE);
#ifdef FEAT_AUTOCMD
++autocmd_no_leave;
#endif
for (buf = firstbuf; buf != NULL && open_wins < count; buf = buf->b_next)
{
/* Check if this buffer needs a window */
@@ -5296,11 +5210,10 @@ ex_buffer_all(exarg_T *eap)
if (wp == NULL && split_ret == OK)
{
#ifdef FEAT_AUTOCMD
bufref_T bufref;
set_bufref(&bufref, buf);
#endif
/* Split the window and put the buffer in it */
p_ea_save = p_ea;
p_ea = TRUE; /* use space from all windows */
@@ -5315,20 +5228,18 @@ ex_buffer_all(exarg_T *eap)
swap_exists_action = SEA_DIALOG;
#endif
set_curbuf(buf, DOBUF_GOTO);
#ifdef FEAT_AUTOCMD
if (!bufref_valid(&bufref))
{
/* autocommands deleted the buffer!!! */
#if defined(HAS_SWAP_EXISTS_ACTION)
swap_exists_action = SEA_NONE;
# endif
#endif
break;
}
#endif
#if defined(HAS_SWAP_EXISTS_ACTION)
if (swap_exists_action == SEA_QUIT)
{
# if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
# if defined(FEAT_EVAL)
cleanup_T cs;
/* Reset the error/interrupt/exception state here so that
@@ -5342,7 +5253,7 @@ ex_buffer_all(exarg_T *eap)
swap_exists_action = SEA_NONE;
swap_exists_did_quit = TRUE;
# if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
# if defined(FEAT_EVAL)
/* Restore the error/interrupt/exception state if not
* discarded by a new aborting error, interrupt, or uncaught
* exception. */
@@ -5369,13 +5280,9 @@ ex_buffer_all(exarg_T *eap)
if (had_tab > 0 && tabpage_index(NULL) <= p_tpm)
cmdmod.tab = 9999;
}
#ifdef FEAT_AUTOCMD
--autocmd_no_enter;
#endif
win_enter(firstwin, FALSE); /* back to first window */
#ifdef FEAT_AUTOCMD
--autocmd_no_leave;
#endif
/*
* Close superfluous windows.
@@ -5384,15 +5291,12 @@ ex_buffer_all(exarg_T *eap)
{
r = (buf_hide(wp->w_buffer) || !bufIsChanged(wp->w_buffer)
|| autowrite(wp->w_buffer, FALSE) == OK);
#ifdef FEAT_AUTOCMD
if (!win_valid(wp))
{
/* BufWrite Autocommands made the window invalid, start over */
wp = lastwin;
}
else
#endif
if (r)
else if (r)
{
win_close(wp, !buf_hide(wp->w_buffer));
--open_wins;
@@ -6243,12 +6147,10 @@ set_buflisted(int on)
if (on != curbuf->b_p_bl)
{
curbuf->b_p_bl = on;
#ifdef FEAT_AUTOCMD
if (on)
apply_autocmds(EVENT_BUFADD, NULL, NULL, FALSE, curbuf);
else
apply_autocmds(EVENT_BUFDELETE, NULL, NULL, FALSE, curbuf);
#endif
}
}
@@ -6321,13 +6223,11 @@ wipe_buffer(
if (buf->b_fnum == top_file_num - 1)
--top_file_num;
#ifdef FEAT_AUTOCMD
if (!aucmd) /* Don't trigger BufDelete autocommands here. */
block_autocmds();
#endif
close_buffer(NULL, buf, DOBUF_WIPE, FALSE);
#ifdef FEAT_AUTOCMD
if (!aucmd)
unblock_autocmds();
#endif
}
+79 -13
View File
@@ -1028,11 +1028,18 @@ channel_set_pipes(channel_T *channel, sock_T in, sock_T out, sock_T err)
channel_gui_unregister_one(channel, PART_ERR);
# endif
ch_close_part(channel, PART_ERR);
channel->CH_ERR_FD = err;
channel->ch_to_be_closed |= (1 << PART_ERR);
# if defined(FEAT_GUI)
channel_gui_register_one(channel, PART_ERR);
# if defined(FEAT_GUI_MACVIM)
if (err == out && gui.in_use)
channel->CH_ERR_FD = INVALID_FD;
else
# endif
{
channel->CH_ERR_FD = err;
channel->ch_to_be_closed |= (1 << PART_ERR);
# if defined(FEAT_GUI)
channel_gui_register_one(channel, PART_ERR);
# endif
}
}
}
@@ -4781,43 +4788,57 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
{
if (!(supported2 & JO2_TERM_ROWS))
break;
opt->jo_set |= JO2_TERM_ROWS;
opt->jo_set2 |= JO2_TERM_ROWS;
opt->jo_term_rows = get_tv_number(item);
}
else if (STRCMP(hi->hi_key, "term_cols") == 0)
{
if (!(supported2 & JO2_TERM_COLS))
break;
opt->jo_set |= JO2_TERM_COLS;
opt->jo_set2 |= JO2_TERM_COLS;
opt->jo_term_cols = get_tv_number(item);
}
else if (STRCMP(hi->hi_key, "vertical") == 0)
{
if (!(supported2 & JO2_VERTICAL))
break;
opt->jo_set |= JO2_VERTICAL;
opt->jo_set2 |= JO2_VERTICAL;
opt->jo_vertical = get_tv_number(item);
}
else if (STRCMP(hi->hi_key, "curwin") == 0)
{
if (!(supported2 & JO2_CURWIN))
break;
opt->jo_set |= JO2_CURWIN;
opt->jo_set2 |= JO2_CURWIN;
opt->jo_curwin = get_tv_number(item);
}
else if (STRCMP(hi->hi_key, "hidden") == 0)
{
if (!(supported2 & JO2_HIDDEN))
break;
opt->jo_set |= JO2_HIDDEN;
opt->jo_set2 |= JO2_HIDDEN;
opt->jo_hidden = get_tv_number(item);
}
else if (STRCMP(hi->hi_key, "norestore") == 0)
{
if (!(supported2 & JO2_NORESTORE))
break;
opt->jo_set2 |= JO2_NORESTORE;
opt->jo_term_norestore = get_tv_number(item);
}
else if (STRCMP(hi->hi_key, "term_kill") == 0)
{
if (!(supported2 & JO2_TERM_KILL))
break;
opt->jo_set2 |= JO2_TERM_KILL;
opt->jo_term_kill = get_tv_string_chk(item);
}
#endif
else if (STRCMP(hi->hi_key, "env") == 0)
{
if (!(supported2 & JO2_ENV))
break;
opt->jo_set |= JO2_ENV;
opt->jo_set2 |= JO2_ENV;
opt->jo_env = item->vval.v_dict;
++item->vval.v_dict->dv_refcount;
}
@@ -4831,7 +4852,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
EMSG2(_(e_invargval), "cwd");
return FAIL;
}
opt->jo_set |= JO2_CWD;
opt->jo_set2 |= JO2_CWD;
}
else if (STRCMP(hi->hi_key, "waittime") == 0)
{
@@ -5404,11 +5425,13 @@ job_check_ended(void)
/*
* Create a job and return it. Implements job_start().
* "argv_arg" is only for Unix.
* When "argv_arg" is NULL then "argvars" is used.
* The returned job has a refcount of one.
* Returns NULL when out of memory.
*/
job_T *
job_start(typval_T *argvars, jobopt_T *opt_arg)
job_start(typval_T *argvars, char **argv_arg, jobopt_T *opt_arg)
{
job_T *job;
char_u *cmd = NULL;
@@ -5495,6 +5518,13 @@ job_start(typval_T *argvars, jobopt_T *opt_arg)
job_set_options(job, &opt);
#ifdef USE_ARGV
if (argv_arg != NULL)
{
argv = argv_arg;
}
else
#endif
if (argvars[0].v_type == VAR_STRING)
{
/* Command is a string. */
@@ -5505,6 +5535,7 @@ job_start(typval_T *argvars, jobopt_T *opt_arg)
goto theend;
}
#ifdef USE_ARGV
/* This will modify "cmd". */
if (mch_parse_cmd(cmd, FALSE, &argv, &argc) == FAIL)
goto theend;
argv[argc] = NULL;
@@ -5571,7 +5602,8 @@ job_start(typval_T *argvars, jobopt_T *opt_arg)
theend:
#ifdef USE_ARGV
vim_free(argv);
if (argv != argv_arg)
vim_free(argv);
#else
vim_free(ga.ga_data);
#endif
@@ -5686,4 +5718,38 @@ job_stop(job_T *job, typval_T *argvars, char *type)
return 1;
}
# ifdef FEAT_GUI_MACVIM
void
job_cleanup_all(void)
{
job_T *job;
for (job = first_job; job != NULL; job = job->jv_next)
{
channel_T *channel = job->jv_channel;
ch_part_T part;
if (channel == NULL || job->jv_status != JOB_FINISHED)
continue;
/* check the socket and pipes */
for (part = PART_SOCK; part < PART_IN; ++part)
{
sock_T fd = channel->ch_part[part].ch_fd;
if (fd != INVALID_FD)
{
int r = channel_wait(channel, fd, 0);
if (r == CW_READY)
channel_read(channel, part, "job_cleanup_all");
else if (r == CW_ERROR)
ch_close_part_on_error(channel, part, TRUE,
"job_cleanup_all");
}
}
}
}
# endif
#endif /* FEAT_JOB_CHANNEL */
-26
View File
@@ -872,13 +872,9 @@ diff_file(
(diff_flags & DIFF_ICASE) ? "-i " : "",
tmp_orig, tmp_new);
append_redir(cmd, (int)len, p_srr, tmp_diff);
#ifdef FEAT_AUTOCMD
block_autocmds(); /* Avoid ShellCmdPost stuff */
#endif
(void)call_shell(cmd, SHELL_FILTER|SHELL_SILENT|SHELL_DOOUT);
#ifdef FEAT_AUTOCMD
unblock_autocmds();
#endif
vim_free(cmd);
}
}
@@ -984,13 +980,9 @@ ex_diffpatch(exarg_T *eap)
* cooked mode to allow the user to respond to prompts. */
vim_snprintf((char *)buf, buflen, "patch -o %s %s < %s",
tmp_new, tmp_orig, esc_name);
#ifdef FEAT_AUTOCMD
block_autocmds(); /* Avoid ShellCmdPost stuff */
#endif
(void)call_shell(buf, SHELL_FILTER | SHELL_COOKED);
#ifdef FEAT_AUTOCMD
unblock_autocmds();
#endif
}
#ifdef UNIX
@@ -1052,11 +1044,9 @@ ex_diffpatch(exarg_T *eap)
eap->arg = newname;
ex_file(eap);
#ifdef FEAT_AUTOCMD
/* Do filetype detection with the new name. */
if (au_has_group((char_u *)"filetypedetect"))
do_cmdline_cmd((char_u *)":doau filetypedetect BufRead");
#endif
}
}
}
@@ -1170,16 +1160,12 @@ diff_win_options(
# endif
/* Use 'scrollbind' and 'cursorbind' when available */
#ifdef FEAT_SCROLLBIND
if (!wp->w_p_diff)
wp->w_p_scb_save = wp->w_p_scb;
wp->w_p_scb = TRUE;
#endif
#ifdef FEAT_CURSORBIND
if (!wp->w_p_diff)
wp->w_p_crb_save = wp->w_p_crb;
wp->w_p_crb = TRUE;
#endif
if (!wp->w_p_diff)
wp->w_p_wrap_save = wp->w_p_wrap;
wp->w_p_wrap = FALSE;
@@ -1209,10 +1195,8 @@ diff_win_options(
/* make sure topline is not halfway a fold */
changed_window_setting_win(wp);
# endif
#ifdef FEAT_SCROLLBIND
if (vim_strchr(p_sbo, 'h') == NULL)
do_cmdline_cmd((char_u *)"set sbo+=hor");
#endif
/* Save the current values, to be restored in ex_diffoff(). */
wp->w_p_diff_saved = TRUE;
@@ -1231,9 +1215,7 @@ diff_win_options(
ex_diffoff(exarg_T *eap)
{
win_T *wp;
#ifdef FEAT_SCROLLBIND
int diffwin = FALSE;
#endif
FOR_ALL_WINDOWS(wp)
{
@@ -1247,14 +1229,10 @@ ex_diffoff(exarg_T *eap)
if (wp->w_p_diff_saved)
{
#ifdef FEAT_SCROLLBIND
if (wp->w_p_scb)
wp->w_p_scb = wp->w_p_scb_save;
#endif
#ifdef FEAT_CURSORBIND
if (wp->w_p_crb)
wp->w_p_crb = wp->w_p_crb_save;
#endif
if (!wp->w_p_wrap)
wp->w_p_wrap = wp->w_p_wrap_save;
#ifdef FEAT_FOLDING
@@ -1286,20 +1264,16 @@ ex_diffoff(exarg_T *eap)
/* Note: 'sbo' is not restored, it's a global option. */
diff_buf_adjust(wp);
}
#ifdef FEAT_SCROLLBIND
diffwin |= wp->w_p_diff;
#endif
}
/* Also remove hidden buffers from the list. */
if (eap->forceit)
diff_buf_clear();
#ifdef FEAT_SCROLLBIND
/* Remove "hor" from from 'scrollopt' if there are no diff windows left. */
if (!diffwin && vim_strchr(p_sbo, 'h') != NULL)
do_cmdline_cmd((char_u *)"set sbo-=hor");
#endif
}
/*
+35
View File
@@ -1974,6 +1974,41 @@ do_digraph(int c)
return c;
}
/*
* Find a digraph for "val". If found return the string to display it.
* If not found return NULL.
*/
char_u *
get_digraph_for_char(val)
int val;
{
int i;
int use_defaults;
digr_T *dp;
static char_u r[3];
for (use_defaults = 0; use_defaults <= 1; use_defaults++)
{
if (use_defaults == 0)
dp = (digr_T *)user_digraphs.ga_data;
else
dp = digraphdefault;
for (i = 0; use_defaults ? dp->char1 != NUL
: i < user_digraphs.ga_len; ++i)
{
if (dp->result == val)
{
r[0] = dp->char1;
r[1] = dp->char2;
r[2] = NUL;
return r;
}
++dp;
}
}
return NULL;
}
/*
* Get a digraph. Used after typing CTRL-K on the command line or in normal
* mode.
+2 -2
View File
@@ -1200,8 +1200,8 @@ install_vimrc(int idx)
/* If the path has a space: When using cmd.exe (Win NT/2000/XP) put
* quotes around the diff command and rely on the default value of
* shellxquote to solve the quoting problem for the whole command.
*
* shellxquote to solve the quoting problem for the whole command.
*
* Otherwise put a double quote just before the space and at the
* end of the command. Putting quotes around the whole thing
* doesn't work on Win 95/98/ME. This is mostly guessed! */
+38 -67
View File
@@ -273,7 +273,7 @@ static int ins_ctrl_ey(int tc);
static void ins_try_si(int c);
#endif
static colnr_T get_nolist_virtcol(void);
#ifdef FEAT_AUTOCMD
#if defined(FEAT_EVAL)
static char_u *do_insert_char_pre(int c);
#endif
@@ -388,7 +388,6 @@ edit(
ins_compl_clear(); /* clear stuff for CTRL-X mode */
#endif
#ifdef FEAT_AUTOCMD
/*
* Trigger InsertEnter autocommands. Do not do this for "r<CR>" or "grx".
*/
@@ -396,7 +395,7 @@ edit(
{
pos_T save_cursor = curwin->w_cursor;
# ifdef FEAT_EVAL
#ifdef FEAT_EVAL
if (cmdchar == 'R')
ptr = (char_u *)"r";
else if (cmdchar == 'V')
@@ -405,7 +404,7 @@ edit(
ptr = (char_u *)"i";
set_vim_var_string(VV_INSERTMODE, ptr, 1);
set_vim_var_string(VV_CHAR, NULL, -1); /* clear v:char */
# endif
#endif
apply_autocmds(EVENT_INSERTENTER, NULL, NULL, FALSE, curbuf);
/* Make sure the cursor didn't move. Do call check_cursor_col() in
@@ -415,9 +414,9 @@ edit(
* line number is still valid (lines may have been deleted).
* Do not restore if v:char was set to a non-empty string. */
if (!EQUAL_POS(curwin->w_cursor, save_cursor)
# ifdef FEAT_EVAL
#ifdef FEAT_EVAL
&& *get_vim_var_str(VV_CHAR) == NUL
# endif
#endif
&& save_cursor.lnum <= curbuf->b_ml.ml_line_count)
{
int save_state = State;
@@ -428,7 +427,6 @@ edit(
State = save_state;
}
}
#endif
#ifdef FEAT_CONCEAL
/* Check if the cursor line needs redrawing before changing State. If
@@ -521,7 +519,7 @@ edit(
*/
if (curbuf->b_p_iminsert == B_IMODE_LMAP)
State |= LANGMAP;
#ifdef FEAT_MBYTE
#ifdef HAVE_INPUT_METHOD
im_set_active(curbuf->b_p_iminsert == B_IMODE_IM);
#endif
@@ -766,15 +764,11 @@ edit(
*/
ins_redraw(TRUE);
#ifdef FEAT_SCROLLBIND
if (curwin->w_p_scb)
do_check_scrollbind(TRUE);
#endif
#ifdef FEAT_CURSORBIND
if (curwin->w_p_crb)
do_check_cursorbind();
#endif
update_curswant();
old_topline = curwin->w_topline;
#ifdef FEAT_DIFF
@@ -805,10 +799,8 @@ edit(
c = safe_vgetc();
} while (c == K_IGNORE || c == K_NOP);
#ifdef FEAT_AUTOCMD
/* Don't want K_CURSORHOLD for the second key, e.g., after CTRL-V. */
did_cursorhold = TRUE;
#endif
#ifdef FEAT_RIGHTLEFT
if (p_hkmap && KeyTyped)
@@ -856,7 +848,7 @@ edit(
* completion: Add to "compl_leader". */
if (ins_compl_accept_char(c))
{
#ifdef FEAT_AUTOCMD
#if defined(FEAT_EVAL)
/* Trigger InsertCharPre. */
char_u *str = do_insert_char_pre(c);
char_u *p;
@@ -1030,12 +1022,10 @@ doESCkey:
if (ins_esc(&count, cmdchar, nomove))
{
#ifdef FEAT_AUTOCMD
if (cmdchar != 'r' && cmdchar != 'v')
apply_autocmds(EVENT_INSERTLEAVE, NULL, NULL,
FALSE, curbuf);
did_cursorhold = FALSE;
#endif
return (c == Ctrl_O);
}
continue;
@@ -1243,12 +1233,10 @@ doESCkey:
case K_IGNORE: /* Something mapped to nothing */
break;
#ifdef FEAT_AUTOCMD
case K_CURSORHOLD: /* Didn't type something for a while. */
apply_autocmds(EVENT_CURSORHOLDI, NULL, NULL, FALSE, curbuf);
did_cursorhold = TRUE;
break;
#endif
#ifdef FEAT_GUI_W32
/* On Win32 ignore <M-F4>, we get it when closing the window was
@@ -1497,7 +1485,7 @@ normalchar:
/*
* Insert a normal character.
*/
#ifdef FEAT_AUTOCMD
#if defined(FEAT_EVAL)
if (!p_paste)
{
/* Trigger InsertCharPre. */
@@ -1574,16 +1562,14 @@ normalchar:
break;
} /* end of switch (c) */
#ifdef FEAT_AUTOCMD
/* If typed something may trigger CursorHoldI again. */
if (c != K_CURSORHOLD
# ifdef FEAT_COMPL_FUNC
#ifdef FEAT_COMPL_FUNC
/* but not in CTRL-X mode, a script can't restore the state */
&& ctrl_x_mode == CTRL_X_NORMAL
# endif
#endif
)
did_cursorhold = FALSE;
#endif
/* If the cursor was moved we didn't just insert a space */
if (arrow_used)
@@ -1633,25 +1619,17 @@ ins_redraw(
if (char_avail())
return;
#if defined(FEAT_AUTOCMD) || defined(FEAT_CONCEAL)
#if defined(FEAT_CONCEAL)
/* Trigger CursorMoved if the cursor moved. Not when the popup menu is
* visible, the command might delete it. */
if (ready && (
# ifdef FEAT_AUTOCMD
has_cursormovedI()
# endif
# if defined(FEAT_AUTOCMD) && defined(FEAT_CONCEAL)
||
# endif
# ifdef FEAT_CONCEAL
curwin->w_p_cole > 0
if (ready && (has_cursormovedI()
# if defined(FEAT_CONCEAL)
|| curwin->w_p_cole > 0
# endif
)
# ifdef FEAT_AUTOCMD
&& !EQUAL_POS(last_cursormoved, curwin->w_cursor)
# endif
&& !EQUAL_POS(last_cursormoved, curwin->w_cursor)
# ifdef FEAT_INS_EXPAND
&& !pum_visible()
&& !pum_visible()
# endif
)
{
@@ -1663,7 +1641,6 @@ ins_redraw(
if (syntax_present(curwin) && must_redraw)
update_screen(0);
# endif
# ifdef FEAT_AUTOCMD
if (has_cursormovedI())
{
/* Make sure curswant is correct, an autocommand may call
@@ -1671,37 +1648,31 @@ ins_redraw(
update_curswant();
apply_autocmds(EVENT_CURSORMOVEDI, NULL, NULL, FALSE, curbuf);
}
# endif
# ifdef FEAT_CONCEAL
if (curwin->w_p_cole > 0)
{
# ifdef FEAT_AUTOCMD
conceal_old_cursor_line = last_cursormoved.lnum;
# endif
conceal_new_cursor_line = curwin->w_cursor.lnum;
conceal_update_lines = TRUE;
}
# endif
# ifdef FEAT_AUTOCMD
last_cursormoved = curwin->w_cursor;
# endif
}
#endif
#ifdef FEAT_AUTOCMD
/* Trigger TextChangedI if b_changedtick differs. */
if (ready && has_textchangedI()
&& curbuf->b_last_changedtick != CHANGEDTICK(curbuf)
# ifdef FEAT_INS_EXPAND
#ifdef FEAT_INS_EXPAND
&& !pum_visible()
# endif
#endif
)
{
apply_autocmds(EVENT_TEXTCHANGEDI, NULL, NULL, FALSE, curbuf);
curbuf->b_last_changedtick = CHANGEDTICK(curbuf);
}
# ifdef FEAT_INS_EXPAND
#ifdef FEAT_INS_EXPAND
/* Trigger TextChangedP if b_changedtick differs. When the popupmenu closes
* TextChangedI will need to trigger for backwards compatibility, thus use
* different b_last_changedtick* variables. */
@@ -1712,7 +1683,6 @@ ins_redraw(
apply_autocmds(EVENT_TEXTCHANGEDP, NULL, NULL, FALSE, curbuf);
curbuf->b_last_changedtick_pum = CHANGEDTICK(curbuf);
}
# endif
#endif
if (must_redraw)
@@ -4015,19 +3985,15 @@ ins_compl_prep(int c)
if (want_cindent && in_cinkeys(KEY_COMPLETE, ' ', inindent(0)))
do_c_expr_indent();
#endif
#ifdef FEAT_AUTOCMD
/* Trigger the CompleteDone event to give scripts a chance to act
* upon the completion. */
apply_autocmds(EVENT_COMPLETEDONE, NULL, NULL, FALSE, curbuf);
#endif
}
}
#ifdef FEAT_AUTOCMD
else if (ctrl_x_mode == CTRL_X_LOCAL_MSG)
/* Trigger the CompleteDone event to give scripts a chance to act
* upon the (possibly failed) completion. */
apply_autocmds(EVENT_COMPLETEDONE, NULL, NULL, FALSE, curbuf);
#endif
/* reset continue_* if we left expansion-mode, if we stay they'll be
* (re)set properly in ins_complete() */
@@ -6238,10 +6204,7 @@ insertchar(
#ifdef FEAT_RIGHTLEFT
&& !p_ri
#endif
#ifdef FEAT_AUTOCMD
&& !has_insertcharpre()
#endif
)
&& !has_insertcharpre())
{
#define INPUT_BUFLEN 100
char_u buf[INPUT_BUFLEN + 1];
@@ -8418,7 +8381,7 @@ ins_reg(void)
++no_u_sync;
if (regname == '=')
{
# ifdef FEAT_MBYTE
# ifdef HAVE_INPUT_METHOD
int im_on = im_get_status();
# endif
/* Sync undo when evaluating the expression calls setline() or
@@ -8426,7 +8389,7 @@ ins_reg(void)
u_sync_once = 2;
regname = get_expr_register();
# ifdef FEAT_MBYTE
# ifdef HAVE_INPUT_METHOD
/* Restore the Input Method. */
if (im_on)
im_set_active(TRUE);
@@ -8555,12 +8518,12 @@ ins_ctrl_hat(void)
{
curbuf->b_p_iminsert = B_IMODE_LMAP;
State |= LANGMAP;
#ifdef FEAT_MBYTE
#ifdef HAVE_INPUT_METHOD
im_set_active(FALSE);
#endif
}
}
#ifdef FEAT_MBYTE
#ifdef HAVE_INPUT_METHOD
else
{
/* There are no ":lmap" mappings, toggle IM */
@@ -8707,7 +8670,7 @@ ins_esc(
}
}
#ifdef FEAT_MBYTE
#ifdef HAVE_INPUT_METHOD
/* Disable IM to allow typing English directly for Normal mode commands.
* When ":lmap" is enabled don't change 'iminsert' (IM can be enabled as
* well). */
@@ -8857,7 +8820,6 @@ ins_insert(int replaceState)
}
#endif
#ifdef FEAT_AUTOCMD
# ifdef FEAT_EVAL
set_vim_var_string(VV_INSERTMODE,
(char_u *)((State & REPLACE_FLAG) ? "i" :
@@ -8867,7 +8829,6 @@ ins_insert(int replaceState)
"r"), 1);
# endif
apply_autocmds(EVENT_INSERTCHANGE, NULL, NULL, FALSE, curbuf);
#endif
if (State & REPLACE_FLAG)
State = INSERT | (State & LANGMAP);
else
@@ -8960,7 +8921,17 @@ ins_del(void)
|| do_join(2, FALSE, TRUE, FALSE, FALSE) == FAIL)
vim_beep(BO_BS);
else
{
curwin->w_cursor.col = temp;
#ifdef FEAT_VREPLACE
/* Adjust orig_line_count in case more lines have been deleted than
* have been added. That makes sure, that open_line() later
* can access all buffer lines correctly */
if (State & VREPLACE_FLAG &&
orig_line_count > curbuf->b_ml.ml_line_count)
orig_line_count = curbuf->b_ml.ml_line_count;
#endif
}
}
else if (del_char(FALSE) == FAIL) /* delete char under cursor */
vim_beep(BO_BS);
@@ -10606,7 +10577,7 @@ get_nolist_virtcol(void)
return curwin->w_virtcol;
}
#ifdef FEAT_AUTOCMD
#if defined(FEAT_EVAL)
/*
* Handle the InsertCharPre autocommand.
* "c" is the character that was typed.
@@ -10623,11 +10594,11 @@ do_insert_char_pre(int c)
if (!has_insertcharpre())
return NULL;
#ifdef FEAT_MBYTE
# ifdef FEAT_MBYTE
if (has_mbyte)
buf[(*mb_char2bytes)(c, buf)] = NUL;
else
#endif
# endif
{
buf[0] = c;
buf[1] = NUL;
+71 -6
View File
@@ -5125,11 +5125,9 @@ garbage_collect(int testing)
FOR_ALL_TAB_WINDOWS(tp, wp)
abort = abort || set_ref_in_item(&wp->w_winvar.di_tv, copyID,
NULL, NULL);
#ifdef FEAT_AUTOCMD
if (aucmd_win != NULL)
abort = abort || set_ref_in_item(&aucmd_win->w_winvar.di_tv, copyID,
NULL, NULL);
#endif
/* tabpage-local variables */
FOR_ALL_TABPAGES(tp)
@@ -6560,7 +6558,6 @@ v_throwpoint(char_u *oldval)
return NULL;
}
#if defined(FEAT_AUTOCMD) || defined(PROTO)
/*
* Set v:cmdarg.
* If "eap" != NULL, use "eap" to generate the value and return the old value.
@@ -6618,7 +6615,7 @@ set_cmdarg(exarg_T *eap, char_u *oldarg)
if (eap->force_ff != 0)
sprintf((char *)newval + STRLEN(newval), " ++ff=%s",
eap->cmd + eap->force_ff);
# ifdef FEAT_MBYTE
#ifdef FEAT_MBYTE
if (eap->force_enc != 0)
sprintf((char *)newval + STRLEN(newval), " ++enc=%s",
eap->cmd + eap->force_enc);
@@ -6628,11 +6625,10 @@ set_cmdarg(exarg_T *eap, char_u *oldarg)
STRCPY(newval + STRLEN(newval), " ++bad=drop");
else if (eap->bad_char != 0)
sprintf((char *)newval + STRLEN(newval), " ++bad=%c", eap->bad_char);
# endif
#endif
vimvars[VV_CMDARG].vv_str = newval;
return oldval;
}
#endif
/*
* Get the value of internal variable "name".
@@ -8833,6 +8829,75 @@ assert_equal_common(typval_T *argvars, assert_type_T atype)
}
}
void
assert_equalfile(typval_T *argvars)
{
char_u buf1[NUMBUFLEN];
char_u buf2[NUMBUFLEN];
char_u *fname1 = get_tv_string_buf_chk(&argvars[0], buf1);
char_u *fname2 = get_tv_string_buf_chk(&argvars[1], buf2);
garray_T ga;
FILE *fd1;
FILE *fd2;
if (fname1 == NULL || fname2 == NULL)
return;
IObuff[0] = NUL;
fd1 = mch_fopen((char *)fname1, READBIN);
if (fd1 == NULL)
{
vim_snprintf((char *)IObuff, IOSIZE, (char *)e_notread, fname1);
}
else
{
fd2 = mch_fopen((char *)fname2, READBIN);
if (fd2 == NULL)
{
fclose(fd1);
vim_snprintf((char *)IObuff, IOSIZE, (char *)e_notread, fname2);
}
else
{
int c1, c2;
long count = 0;
for (;;)
{
c1 = fgetc(fd1);
c2 = fgetc(fd2);
if (c1 == EOF)
{
if (c2 != EOF)
STRCPY(IObuff, "first file is shorter");
break;
}
else if (c2 == EOF)
{
STRCPY(IObuff, "second file is shorter");
break;
}
else if (c1 != c2)
{
vim_snprintf((char *)IObuff, IOSIZE,
"difference at byte %ld", count);
break;
}
++count;
}
fclose(fd1);
fclose(fd2);
}
}
if (IObuff[0] != NUL)
{
prepare_assert_error(&ga);
ga_concat(&ga, IObuff);
assert_error(&ga);
ga_clear(&ga);
}
}
void
assert_match_common(typval_T *argvars, assert_type_T atype)
{
+128 -17
View File
@@ -46,6 +46,7 @@ static void f_arglistid(typval_T *argvars, typval_T *rettv);
static void f_argv(typval_T *argvars, typval_T *rettv);
static void f_assert_beeps(typval_T *argvars, typval_T *rettv);
static void f_assert_equal(typval_T *argvars, typval_T *rettv);
static void f_assert_equalfile(typval_T *argvars, typval_T *rettv);
static void f_assert_exception(typval_T *argvars, typval_T *rettv);
static void f_assert_fails(typval_T *argvars, typval_T *rettv);
static void f_assert_false(typval_T *argvars, typval_T *rettv);
@@ -196,6 +197,7 @@ static void f_gettabinfo(typval_T *argvars, typval_T *rettv);
static void f_gettabvar(typval_T *argvars, typval_T *rettv);
static void f_gettabwinvar(typval_T *argvars, typval_T *rettv);
static void f_getwininfo(typval_T *argvars, typval_T *rettv);
static void f_getwinpos(typval_T *argvars, typval_T *rettv);
static void f_getwinposx(typval_T *argvars, typval_T *rettv);
static void f_getwinposy(typval_T *argvars, typval_T *rettv);
static void f_getwinvar(typval_T *argvars, typval_T *rettv);
@@ -428,6 +430,7 @@ static void f_timer_stopall(typval_T *argvars, typval_T *rettv);
static void f_tolower(typval_T *argvars, typval_T *rettv);
static void f_toupper(typval_T *argvars, typval_T *rettv);
static void f_tr(typval_T *argvars, typval_T *rettv);
static void f_trim(typval_T *argvars, typval_T *rettv);
#ifdef FEAT_FLOAT
static void f_trunc(typval_T *argvars, typval_T *rettv);
#endif
@@ -487,6 +490,7 @@ static struct fst
#endif
{"assert_beeps", 1, 2, f_assert_beeps},
{"assert_equal", 2, 3, f_assert_equal},
{"assert_equalfile", 2, 2, f_assert_equalfile},
{"assert_exception", 1, 2, f_assert_exception},
{"assert_fails", 1, 2, f_assert_fails},
{"assert_false", 1, 2, f_assert_false},
@@ -639,6 +643,7 @@ static struct fst
{"gettabvar", 2, 3, f_gettabvar},
{"gettabwinvar", 3, 4, f_gettabwinvar},
{"getwininfo", 0, 1, f_getwininfo},
{"getwinpos", 0, 1, f_getwinpos},
{"getwinposx", 0, 0, f_getwinposx},
{"getwinposy", 0, 0, f_getwinposy},
{"getwinvar", 2, 3, f_getwinvar},
@@ -736,7 +741,7 @@ static struct fst
{"pow", 2, 2, f_pow},
#endif
{"prevnonblank", 1, 1, f_prevnonblank},
{"printf", 2, 19, f_printf},
{"printf", 1, 19, f_printf},
{"pumvisible", 0, 0, f_pumvisible},
#ifdef FEAT_PYTHON3
{"py3eval", 1, 1, f_py3eval},
@@ -847,6 +852,9 @@ static struct fst
#endif
{"tempname", 0, 0, f_tempname},
#ifdef FEAT_TERMINAL
{"term_dumpdiff", 2, 3, f_term_dumpdiff},
{"term_dumpload", 1, 2, f_term_dumpload},
{"term_dumpwrite", 2, 3, f_term_dumpwrite},
{"term_getaltscreen", 1, 1, f_term_getaltscreen},
{"term_getattr", 2, 2, f_term_getattr},
{"term_getcursor", 1, 1, f_term_getcursor},
@@ -860,6 +868,8 @@ static struct fst
{"term_list", 0, 0, f_term_list},
{"term_scrape", 2, 2, f_term_scrape},
{"term_sendkeys", 2, 2, f_term_sendkeys},
{"term_setkill", 2, 2, f_term_setkill},
{"term_setrestore", 2, 2, f_term_setrestore},
{"term_start", 1, 2, f_term_start},
{"term_wait", 1, 2, f_term_wait},
#endif
@@ -890,6 +900,7 @@ static struct fst
{"tolower", 1, 1, f_tolower},
{"toupper", 1, 1, f_toupper},
{"tr", 3, 3, f_tr},
{"trim", 1, 2, f_trim},
#ifdef FEAT_FLOAT
{"trunc", 1, 1, f_trunc},
#endif
@@ -1296,6 +1307,15 @@ f_assert_equal(typval_T *argvars, typval_T *rettv UNUSED)
assert_equal_common(argvars, ASSERT_EQUAL);
}
/*
* "assert_equalfile(fname-one, fname-two)" function
*/
static void
f_assert_equalfile(typval_T *argvars, typval_T *rettv UNUSED)
{
assert_equalfile(argvars);
}
/*
* "assert_notequal(expected, actual[, msg])" function
*/
@@ -2652,9 +2672,7 @@ f_delete(typval_T *argvars, typval_T *rettv)
static void
f_did_filetype(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
#ifdef FEAT_AUTOCMD
rettv->vval.v_number = did_filetype;
#endif
}
/*
@@ -3037,12 +3055,10 @@ f_exists(typval_T *argvars, typval_T *rettv)
}
else if (*p == '#')
{
#ifdef FEAT_AUTOCMD
if (p[1] == '#')
n = autocmd_supported(p + 2);
else
n = au_exists(p + 1);
#endif
}
else /* internal variable */
{
@@ -5519,6 +5535,38 @@ f_win_screenpos(typval_T *argvars, typval_T *rettv)
list_append_number(rettv->vval.v_list, wp == NULL ? 0 : wp->w_wincol + 1);
}
/*
* "getwinpos({timeout})" function
*/
static void
f_getwinpos(typval_T *argvars UNUSED, typval_T *rettv)
{
int x = -1;
int y = -1;
if (rettv_list_alloc(rettv) == FAIL)
return;
#ifdef FEAT_GUI
if (gui.in_use)
(void)gui_mch_get_winpos(&x, &y);
# if defined(HAVE_TGETENT) && defined(FEAT_TERMRESPONSE)
else
# endif
#endif
#if defined(HAVE_TGETENT) && defined(FEAT_TERMRESPONSE)
{
varnumber_T timeout = 100;
if (argvars[0].v_type != VAR_UNKNOWN)
timeout = get_tv_number(&argvars[0]);
term_get_winpos(&x, &y, timeout);
}
#endif
list_append_number(rettv->vval.v_list, (varnumber_T)x);
list_append_number(rettv->vval.v_list, (varnumber_T)y);
}
/*
* "getwinposx()" function
*/
@@ -5540,7 +5588,7 @@ f_getwinposx(typval_T *argvars UNUSED, typval_T *rettv)
{
int x, y;
if (term_get_winpos(&x, &y) == OK)
if (term_get_winpos(&x, &y, (varnumber_T)100) == OK)
rettv->vval.v_number = x;
}
#endif
@@ -5567,7 +5615,7 @@ f_getwinposy(typval_T *argvars UNUSED, typval_T *rettv)
{
int x, y;
if (term_get_winpos(&x, &y) == OK)
if (term_get_winpos(&x, &y, (varnumber_T)100) == OK)
rettv->vval.v_number = y;
}
#endif
@@ -5756,9 +5804,7 @@ f_has(typval_T *argvars, typval_T *rettv)
#ifdef FEAT_ARABIC
"arabic",
#endif
#ifdef FEAT_AUTOCMD
"autocmd",
#endif
#ifdef FEAT_AUTOSERVERNAME
"autoservername",
#endif
@@ -5817,9 +5863,7 @@ f_has(typval_T *argvars, typval_T *rettv)
#ifdef FEAT_CSCOPE
"cscope",
#endif
#ifdef FEAT_CURSORBIND
"cursorbind",
#endif
#ifdef CURSOR_SHAPE
"cursorshape",
#endif
@@ -6075,9 +6119,7 @@ f_has(typval_T *argvars, typval_T *rettv)
#if defined(FEAT_RUBY) && !defined(DYNAMIC_RUBY)
"ruby",
#endif
#ifdef FEAT_SCROLLBIND
"scrollbind",
#endif
#ifdef FEAT_CMDL_INFO
"showcmd",
"cmdline_info",
@@ -6177,6 +6219,9 @@ f_has(typval_T *argvars, typval_T *rettv)
#ifdef FEAT_VREPLACE
"vreplace",
#endif
#ifdef FEAT_VTP
"vtp",
#endif
#ifdef FEAT_WILDIGN
"wildignore",
#endif
@@ -6328,9 +6373,9 @@ f_has(typval_T *argvars, typval_T *rettv)
else if (STRICMP(name, "syntax_items") == 0)
n = syntax_present(curwin);
#endif
#if defined(WIN3264)
else if (STRICMP(name, "win95") == 0)
n = FALSE; /* Win9x is no more supported. */
#ifdef FEAT_VTP
else if (STRICMP(name, "vcon") == 0)
n = has_vtp_working();
#endif
#ifdef FEAT_NETBEANS_INTG
else if (STRICMP(name, "netbeans_enabled") == 0)
@@ -7008,7 +7053,7 @@ f_job_start(typval_T *argvars, typval_T *rettv)
rettv->v_type = VAR_JOB;
if (check_restricted() || check_secure())
return;
rettv->vval.v_job = job_start(argvars, NULL);
rettv->vval.v_job = job_start(argvars, NULL, NULL);
}
/*
@@ -13187,6 +13232,72 @@ error:
rettv->vval.v_string = ga.ga_data;
}
/*
* "trim({expr})" function
*/
static void
f_trim(typval_T *argvars, typval_T *rettv)
{
char_u buf1[NUMBUFLEN];
char_u buf2[NUMBUFLEN];
char_u *head = get_tv_string_buf_chk(&argvars[0], buf1);
char_u *mask = NULL;
char_u *tail;
char_u *prev;
char_u *p;
int c1;
rettv->v_type = VAR_STRING;
if (head == NULL)
{
rettv->vval.v_string = NULL;
return;
}
if (argvars[1].v_type == VAR_STRING)
mask = get_tv_string_buf_chk(&argvars[1], buf2);
while (*head != NUL)
{
c1 = PTR2CHAR(head);
if (mask == NULL)
{
if (c1 > ' ' && c1 != 0xa0)
break;
}
else
{
for (p = mask; *p != NUL; MB_PTR_ADV(p))
if (c1 == PTR2CHAR(p))
break;
if (*p == NUL)
break;
}
MB_PTR_ADV(head);
}
for (tail = head + STRLEN(head); tail > head; tail = prev)
{
prev = tail;
MB_PTR_BACK(head, prev);
c1 = PTR2CHAR(prev);
if (mask == NULL)
{
if (c1 > ' ' && c1 != 0xa0)
break;
}
else
{
for (p = mask; *p != NUL; MB_PTR_ADV(p))
if (c1 == PTR2CHAR(p))
break;
if (*p == NUL)
break;
}
}
rettv->vval.v_string = vim_strnsave(head, (int)(tail - head));
}
#ifdef FEAT_FLOAT
/*
* "trunc({float})" function
+64 -111
View File
@@ -28,9 +28,7 @@ static int read_viminfo_up_to_marks(vir_T *virp, int forceit, int writing);
#endif
static int check_readonly(int *forceit, buf_T *buf);
#ifdef FEAT_AUTOCMD
static void delbuf_msg(char_u *name);
#endif
static int
#ifdef __BORLANDC__
_RTLENTRYF
@@ -49,6 +47,9 @@ do_ascii(exarg_T *eap UNUSED)
char buf1[20];
char buf2[20];
char_u buf3[7];
#ifdef FEAT_DIGRAPHS
char_u *dig;
#endif
#ifdef FEAT_MBYTE
int cc[MAX_MCO];
int ci = 0;
@@ -94,7 +95,15 @@ do_ascii(exarg_T *eap UNUSED)
else
#endif
buf2[0] = NUL;
vim_snprintf((char *)IObuff, IOSIZE,
#ifdef FEAT_DIGRAPHS
dig = get_digraph_for_char(cval);
if (dig != NULL)
vim_snprintf((char *)IObuff, IOSIZE,
_("<%s>%s%s %d, Hex %02x, Oct %03o, Digr %s"),
transchar(c), buf1, buf2, cval, cval, cval, dig);
else
#endif
vim_snprintf((char *)IObuff, IOSIZE,
_("<%s>%s%s %d, Hex %02x, Octal %03o"),
transchar(c), buf1, buf2, cval, cval, cval);
#ifdef FEAT_MBYTE
@@ -121,9 +130,19 @@ do_ascii(exarg_T *eap UNUSED)
)
IObuff[len++] = ' '; /* draw composing char on top of a space */
len += (*mb_char2bytes)(c, IObuff + len);
vim_snprintf((char *)IObuff + len, IOSIZE - len,
c < 0x10000 ? _("> %d, Hex %04x, Octal %o")
: _("> %d, Hex %08x, Octal %o"), c, c, c);
#ifdef FEAT_DIGRAPHS
dig = get_digraph_for_char(c);
if (dig != NULL)
vim_snprintf((char *)IObuff + len, IOSIZE - len,
c < 0x10000 ? _("> %d, Hex %04x, Oct %o, Digr %s")
: _("> %d, Hex %08x, Oct %o, Digr %s"),
c, c, c, dig);
else
#endif
vim_snprintf((char *)IObuff + len, IOSIZE - len,
c < 0x10000 ? _("> %d, Hex %04x, Octal %o")
: _("> %d, Hex %08x, Octal %o"),
c, c, c);
if (ci == MAX_MCO)
break;
if (enc_utf8)
@@ -1127,9 +1146,7 @@ do_bang(
/* Careful: This may recursively call do_bang() again! (because of
* autocommands) */
do_filter(line1, line2, eap, newcmd, do_in, do_out);
#ifdef FEAT_AUTOCMD
apply_autocmds(EVENT_SHELLFILTERPOST, NULL, NULL, FALSE, curbuf);
#endif
}
if (free_newcmd)
vim_free(newcmd);
@@ -1165,9 +1182,7 @@ do_filter(
linenr_T read_linecount;
pos_T cursor_save;
char_u *cmd_buf;
#ifdef FEAT_AUTOCMD
buf_T *old_curbuf = curbuf;
#endif
int shell_flags = 0;
if (*cmd == NUL) /* no filter command */
@@ -1238,16 +1253,14 @@ do_filter(
{
msg_putchar('\n'); /* keep message from buf_write() */
--no_wait_return;
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
#if defined(FEAT_EVAL)
if (!aborting())
#endif
(void)EMSG2(_(e_notcreate), itmp); /* will call wait_return */
goto filterend;
}
#ifdef FEAT_AUTOCMD
if (curbuf != old_curbuf)
goto filterend;
#endif
if (!do_out)
msg_putchar('\n');
@@ -1313,7 +1326,7 @@ do_filter(
if (readfile(otmp, NULL, line2, (linenr_T)0, (linenr_T)MAXLNUM,
eap, READ_FILTER) != OK)
{
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
#if defined(FEAT_EVAL)
if (!aborting())
#endif
{
@@ -1322,10 +1335,8 @@ do_filter(
}
goto error;
}
#ifdef FEAT_AUTOCMD
if (curbuf != old_curbuf)
goto filterend;
#endif
}
read_linecount = curbuf->b_ml.ml_line_count - read_linecount;
@@ -1405,13 +1416,11 @@ error:
filterend:
#ifdef FEAT_AUTOCMD
if (curbuf != old_curbuf)
{
--no_wait_return;
EMSG(_("E135: *Filter* Autocommands must not change current buffer"));
}
#endif
if (itmp != NULL)
mch_remove(itmp);
if (otmp != NULL)
@@ -1461,9 +1470,7 @@ do_shell(
* avoid having to type return below.
*/
msg_putchar('\r'); /* put cursor at start of line */
#ifdef FEAT_AUTOCMD
if (!autocmd_busy)
#endif
{
#ifdef MSWIN
if (!winstart)
@@ -1476,11 +1483,7 @@ do_shell(
msg_putchar('\n'); /* may shift screen one line up */
/* warning message before calling the shell */
if (p_warn
#ifdef FEAT_AUTOCMD
&& !autocmd_busy
#endif
&& msg_silent == 0)
if (p_warn && !autocmd_busy && msg_silent == 0)
FOR_ALL_BUFFERS(buf)
if (bufIsChangedNotTerm(buf))
{
@@ -1515,14 +1518,12 @@ do_shell(
msg_col = 0;
}
#ifdef FEAT_AUTOCMD
if (autocmd_busy)
{
if (msg_silent == 0)
redraw_later_clear();
}
else
#endif
{
/*
* For ":sh" there is no need to call wait_return(), just redraw.
@@ -1591,9 +1592,7 @@ do_shell(
/* display any error messages now */
display_errors();
#ifdef FEAT_AUTOCMD
apply_autocmds(EVENT_SHELLCMDPOST, NULL, NULL, FALSE, curbuf);
#endif
}
/*
@@ -2958,16 +2957,14 @@ rename_buffer(char_u *new_fname)
char_u *fname, *sfname, *xfname;
buf_T *buf;
#ifdef FEAT_AUTOCMD
buf = curbuf;
apply_autocmds(EVENT_BUFFILEPRE, NULL, NULL, FALSE, curbuf);
/* buffer changed, don't change name now */
if (buf != curbuf)
return FAIL;
# ifdef FEAT_EVAL
#ifdef FEAT_EVAL
if (aborting()) /* autocmds may abort script processing */
return FAIL;
# endif
#endif
/*
* The name of the current buffer will be changed.
@@ -2996,9 +2993,8 @@ rename_buffer(char_u *new_fname)
}
vim_free(fname);
vim_free(sfname);
#ifdef FEAT_AUTOCMD
apply_autocmds(EVENT_BUFFILEPOST, NULL, NULL, FALSE, curbuf);
#endif
/* Change directories when the 'acd' option is set. */
DO_AUTOCHDIR
return OK;
@@ -3177,22 +3173,20 @@ do_write(exarg_T *eap)
{
if (eap->cmdidx == CMD_saveas && alt_buf != NULL)
{
#ifdef FEAT_AUTOCMD
buf_T *was_curbuf = curbuf;
apply_autocmds(EVENT_BUFFILEPRE, NULL, NULL, FALSE, curbuf);
apply_autocmds(EVENT_BUFFILEPRE, NULL, NULL, FALSE, alt_buf);
# ifdef FEAT_EVAL
#ifdef FEAT_EVAL
if (curbuf != was_curbuf || aborting())
# else
#else
if (curbuf != was_curbuf)
# endif
#endif
{
/* buffer changed, don't change name now */
retval = FAIL;
goto theend;
}
#endif
/* Exchange the file names for the current and the alternate
* buffer. This makes it look like we are now editing the buffer
* under the new name. Must be done before buf_write(), because
@@ -3208,7 +3202,7 @@ do_write(exarg_T *eap)
alt_buf->b_sfname = curbuf->b_sfname;
curbuf->b_sfname = fname;
buf_name_changed(curbuf);
#ifdef FEAT_AUTOCMD
apply_autocmds(EVENT_BUFFILEPOST, NULL, NULL, FALSE, curbuf);
apply_autocmds(EVENT_BUFFILEPOST, NULL, NULL, FALSE, alt_buf);
if (!alt_buf->b_p_bl)
@@ -3216,11 +3210,11 @@ do_write(exarg_T *eap)
alt_buf->b_p_bl = TRUE;
apply_autocmds(EVENT_BUFADD, NULL, NULL, FALSE, alt_buf);
}
# ifdef FEAT_EVAL
#ifdef FEAT_EVAL
if (curbuf != was_curbuf || aborting())
# else
#else
if (curbuf != was_curbuf)
# endif
#endif
{
/* buffer changed, don't write the file */
retval = FAIL;
@@ -3239,7 +3233,6 @@ do_write(exarg_T *eap)
/* Autocommands may have changed buffer names, esp. when
* 'autochdir' is set. */
fname = curbuf->b_sfname;
#endif
}
name_was_missing = curbuf->b_ffname == NULL;
@@ -3428,6 +3421,14 @@ do_wqall(exarg_T *eap)
FOR_ALL_BUFFERS(buf)
{
#ifdef FEAT_TERMINAL
if (exiting && term_job_running(buf->b_term))
{
no_write_message_nobang(buf);
++error;
}
else
#endif
if (bufIsChanged(buf) && !bt_dontwrite(buf))
{
/*
@@ -3460,18 +3461,14 @@ do_wqall(exarg_T *eap)
}
else
{
#ifdef FEAT_AUTOCMD
bufref_T bufref;
set_bufref(&bufref, buf);
#endif
if (buf_write_all(buf, eap->forceit) == FAIL)
++error;
#ifdef FEAT_AUTOCMD
/* an autocommand may have deleted the buffer */
if (!bufref_valid(&bufref))
buf = firstbuf;
#endif
}
eap->forceit = save_forceit; /* check_overwrite() may set it */
}
@@ -3575,10 +3572,8 @@ getfile(
if (text_locked())
return GETFILE_ERROR;
#ifdef FEAT_AUTOCMD
if (curbuf_locked())
return GETFILE_ERROR;
#endif
if (fnum == 0)
{
@@ -3673,17 +3668,15 @@ do_ecmd(
{
int other_file; /* TRUE if editing another file */
int oldbuf; /* TRUE if using existing buffer */
#ifdef FEAT_AUTOCMD
int auto_buf = FALSE; /* TRUE if autocommands brought us
into the buffer unexpectedly */
char_u *new_name = NULL;
#if defined(FEAT_EVAL)
int did_set_swapcommand = FALSE;
#endif
buf_T *buf;
bufref_T bufref;
#if defined(FEAT_AUTOCMD) || defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
bufref_T old_curbuf;
#endif
char_u *free_fname = NULL;
#ifdef FEAT_BROWSE
char_u *browse_file = NULL;
@@ -3707,9 +3700,7 @@ do_ecmd(
if (eap != NULL)
command = eap->do_ecmd_cmd;
#if defined(FEAT_AUTOCMD) || defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
set_bufref(&old_curbuf, curbuf);
#endif
if (fnum != 0)
{
@@ -3722,11 +3713,10 @@ do_ecmd(
#ifdef FEAT_BROWSE
if (cmdmod.browse)
{
# ifdef FEAT_AUTOCMD
if (
# ifdef FEAT_GUI
# ifdef FEAT_GUI
!gui.in_use &&
# endif
# endif
au_has_group((char_u *)"FileExplorer"))
{
/* No browsing supported but we do have the file explorer:
@@ -3735,7 +3725,6 @@ do_ecmd(
ffname = (char_u *)".";
}
else
# endif
{
browse_file = do_browse(0, (char_u *)_("Edit File"), ffname,
NULL, NULL, NULL, curbuf);
@@ -3809,7 +3798,7 @@ do_ecmd(
*/
reset_VIsual();
#ifdef FEAT_AUTOCMD
#if defined(FEAT_EVAL)
if ((command != NULL || newlnum > (linenr_T)0)
&& *get_vim_var_str(VV_SWAPCOMMAND) == NUL)
{
@@ -3872,12 +3861,11 @@ do_ecmd(
#endif
buf = buflist_new(ffname, sfname, 0L,
BLN_CURBUF | ((flags & ECMD_SET_HELP) ? 0 : BLN_LISTED));
#ifdef FEAT_AUTOCMD
/* autocommands may change curwin and curbuf */
if (oldwin != NULL)
oldwin = curwin;
set_bufref(&old_curbuf, curbuf);
#endif
}
if (buf == NULL)
goto theend;
@@ -3892,11 +3880,7 @@ do_ecmd(
(void)buf_check_timestamp(buf, FALSE);
/* Check if autocommands made the buffer invalid or changed the
* current buffer. */
if (!bufref_valid(&bufref)
#ifdef FEAT_AUTOCMD
|| curbuf != old_curbuf.br_buf
#endif
)
if (!bufref_valid(&bufref) || curbuf != old_curbuf.br_buf)
goto theend;
#ifdef FEAT_EVAL
if (aborting()) /* autocmds may abort script processing */
@@ -3921,7 +3905,6 @@ do_ecmd(
*/
if (buf != curbuf)
{
#ifdef FEAT_AUTOCMD
/*
* Be careful: The autocommands may delete any buffer and change
* the current buffer.
@@ -3942,13 +3925,13 @@ do_ecmd(
delbuf_msg(new_name); /* frees new_name */
goto theend;
}
# ifdef FEAT_EVAL
#ifdef FEAT_EVAL
if (aborting()) /* autocmds may abort script processing */
{
vim_free(new_name);
goto theend;
}
# endif
#endif
if (buf == curbuf) /* already in new buffer */
auto_buf = TRUE;
else
@@ -3961,7 +3944,6 @@ do_ecmd(
++buf->b_locked;
if (curbuf == old_curbuf.br_buf)
#endif
buf_copy_options(buf, BCO_ENTER);
/* Close the link to the current buffer. This will set
@@ -3970,18 +3952,17 @@ do_ecmd(
close_buffer(oldwin, curbuf,
(flags & ECMD_HIDE) ? 0 : DOBUF_UNLOAD, FALSE);
#ifdef FEAT_AUTOCMD
the_curwin->w_closing = FALSE;
--buf->b_locked;
# ifdef FEAT_EVAL
#ifdef FEAT_EVAL
/* autocmds may abort script processing */
if (aborting() && curwin->w_buffer != NULL)
{
vim_free(new_name);
goto theend;
}
# endif
#endif
/* Be careful again, like above. */
if (!bufref_valid(&au_new_curbuf))
{
@@ -3992,7 +3973,6 @@ do_ecmd(
if (buf == curbuf) /* already in new buffer */
auto_buf = TRUE;
else
#endif
{
#ifdef FEAT_SYN_HL
/*
@@ -4025,13 +4005,10 @@ do_ecmd(
#ifdef FEAT_SPELL
did_get_winopts = TRUE;
#endif
#ifdef FEAT_AUTOCMD
}
vim_free(new_name);
au_new_curbuf.br_buf = NULL;
au_new_curbuf.br_buf_free_count = 0;
#endif
}
curwin->w_pcmark.lnum = 1;
@@ -4054,9 +4031,7 @@ do_ecmd(
++RedrawingDisabled;
did_inc_redrawing_disabled = TRUE;
#ifdef FEAT_AUTOCMD
buf = curbuf;
#endif
if ((flags & ECMD_SET_HELP) || keep_help_flag)
{
prepare_help_buffer();
@@ -4069,21 +4044,19 @@ do_ecmd(
set_buflisted(TRUE);
}
#ifdef FEAT_AUTOCMD
/* If autocommands change buffers under our fingers, forget about
* editing the file. */
if (buf != curbuf)
goto theend;
# ifdef FEAT_EVAL
#ifdef FEAT_EVAL
if (aborting()) /* autocmds may abort script processing */
goto theend;
# endif
#endif
/* Since we are starting to edit a file, consider the filetype to be
* unset. Helps for when an autocommand changes files and expects syntax
* highlighting to work in the other file. */
did_filetype = FALSE;
#endif
/*
* other_file oldbuf
@@ -4100,14 +4073,13 @@ do_ecmd(
newlnum = curwin->w_cursor.lnum;
solcol = curwin->w_cursor.col;
}
#ifdef FEAT_AUTOCMD
buf = curbuf;
if (buf->b_fname != NULL)
new_name = vim_strsave(buf->b_fname);
else
new_name = NULL;
set_bufref(&bufref, buf);
#endif
if (p_ur < 0 || curbuf->b_ml.ml_line_count <= p_ur)
{
/* Save all the text, so that the reload can be undone.
@@ -4116,9 +4088,7 @@ do_ecmd(
if (u_savecommon(0, curbuf->b_ml.ml_line_count + 1, 0, TRUE)
== FAIL)
{
#ifdef FEAT_AUTOCMD
vim_free(new_name);
#endif
goto theend;
}
u_unchanged(curbuf);
@@ -4129,7 +4099,7 @@ do_ecmd(
}
else
buf_freeall(curbuf, 0); /* free all things for buffer */
#ifdef FEAT_AUTOCMD
/* If autocommands deleted the buffer we were going to re-edit, give
* up and jump to the end. */
if (!bufref_valid(&bufref))
@@ -4144,10 +4114,9 @@ do_ecmd(
* the autocommands changed the buffer... */
if (buf != curbuf)
goto theend;
# ifdef FEAT_EVAL
#ifdef FEAT_EVAL
if (aborting()) /* autocmds may abort script processing */
goto theend;
# endif
#endif
buf_clear_file(curbuf);
curbuf->b_op_start.lnum = 0; /* clear '[ and '] marks */
@@ -4165,9 +4134,7 @@ do_ecmd(
*/
check_arg_idx(curwin);
#ifdef FEAT_AUTOCMD
if (!auto_buf)
#endif
{
/*
* Set cursor and init window before reading the file and executing
@@ -4208,7 +4175,7 @@ do_ecmd(
/*
* Open the buffer and read the file.
*/
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
#if defined(FEAT_EVAL)
if (should_abort(open_buffer(FALSE, eap, readfile_flags)))
retval = FAIL;
#else
@@ -4221,7 +4188,6 @@ do_ecmd(
handle_swap_exists(&old_curbuf);
#endif
}
#ifdef FEAT_AUTOCMD
else
{
/* Read the modelines, but only to set window-local options. Any
@@ -4235,7 +4201,6 @@ do_ecmd(
&retval);
}
check_arg_idx(curwin);
#endif
/* If autocommands change the cursor position or topline, we should
* keep it. Also when it moves within a line. */
@@ -4313,11 +4278,7 @@ do_ecmd(
* Did not read the file, need to show some info about the file.
* Do this after setting the cursor.
*/
if (oldbuf
#ifdef FEAT_AUTOCMD
&& !auto_buf
#endif
)
if (oldbuf && !auto_buf)
{
int msg_scroll_save = msg_scroll;
@@ -4357,9 +4318,7 @@ do_ecmd(
if (topline == 0 && command == NULL)
p_so = 999; /* force cursor halfway the window */
update_topline();
#ifdef FEAT_SCROLLBIND
curwin->w_scbind_pos = curwin->w_topline;
#endif
p_so = n;
redraw_curbuf_later(NOT_VALID); /* redraw this buffer later */
}
@@ -4401,7 +4360,7 @@ do_ecmd(
theend:
if (did_inc_redrawing_disabled)
--RedrawingDisabled;
#ifdef FEAT_AUTOCMD
#if defined(FEAT_EVAL)
if (did_set_swapcommand)
set_vim_var_string(VV_SWAPCOMMAND, NULL, -1);
#endif
@@ -4412,7 +4371,6 @@ theend:
return retval;
}
#ifdef FEAT_AUTOCMD
static void
delbuf_msg(char_u *name)
{
@@ -4422,7 +4380,6 @@ delbuf_msg(char_u *name)
au_new_curbuf.br_buf = NULL;
au_new_curbuf.br_buf_free_count = 0;
}
#endif
static int append_indent = 0; /* autoindent for first line */
@@ -5127,7 +5084,7 @@ do_sub(exarg_T *eap)
*/
line2 = eap->line2;
for (lnum = eap->line1; lnum <= line2 && !(got_quit
#if defined(FEAT_EVAL) && defined(FEAT_AUTOCMD)
#if defined(FEAT_EVAL)
|| aborting()
#endif
); ++lnum)
@@ -5311,10 +5268,8 @@ do_sub(exarg_T *eap)
setmouse(); /* disable mouse in xterm */
#endif
curwin->w_cursor.col = regmatch.startpos[0].col;
#ifdef FEAT_CURSORBIND
if (curwin->w_p_crb)
do_check_cursorbind();
#endif
/* When 'cpoptions' contains "u" don't sync undo when
* asking for confirmation. */
@@ -6841,7 +6796,6 @@ fix_help_buffer(void)
char_u *rt;
int mustfree;
#ifdef FEAT_AUTOCMD
/* Set filetype to "help" if still needed. */
if (STRCMP(curbuf->b_p_ft, "help") != 0)
{
@@ -6849,7 +6803,6 @@ fix_help_buffer(void)
set_option_value((char_u *)"ft", 0L, (char_u *)"help", OPT_LOCAL);
--curbuf_lock;
}
#endif
#ifdef FEAT_SYN_HL
if (!syntax_present(curwin))
+35 -42
View File
@@ -2045,17 +2045,15 @@ autowrite_all(void)
FOR_ALL_BUFFERS(buf)
if (bufIsChanged(buf) && !buf->b_p_ro)
{
#ifdef FEAT_AUTOCMD
bufref_T bufref;
set_bufref(&bufref, buf);
#endif
(void)buf_write_all(buf, FALSE);
#ifdef FEAT_AUTOCMD
/* an autocommand may have deleted the buffer */
if (!bufref_valid(&bufref))
buf = firstbuf;
#endif
}
}
@@ -2067,11 +2065,9 @@ autowrite_all(void)
check_changed(buf_T *buf, int flags)
{
int forceit = (flags & CCGD_FORCEIT);
#ifdef FEAT_AUTOCMD
bufref_T bufref;
set_bufref(&bufref, buf);
#endif
if ( !forceit
&& bufIsChanged(buf)
@@ -2093,24 +2089,22 @@ check_changed(buf_T *buf, int flags)
# endif
))
++count;
# ifdef FEAT_AUTOCMD
if (!bufref_valid(&bufref))
/* Autocommand deleted buffer, oops! It's not changed now. */
return FALSE;
# endif
dialog_changed(buf, count > 1);
# ifdef FEAT_AUTOCMD
if (!bufref_valid(&bufref))
/* Autocommand deleted buffer, oops! It's not changed now. */
return FALSE;
# endif
return bufIsChanged(buf);
}
#endif
if (flags & CCGD_EXCMD)
no_write_message();
else
no_write_message_nobang();
no_write_message_nobang(curbuf);
return TRUE;
}
return FALSE;
@@ -2270,11 +2264,9 @@ dialog_changed(
)
&& !buf2->b_p_ro)
{
#ifdef FEAT_AUTOCMD
bufref_T bufref;
set_bufref(&bufref, buf2);
#endif
#ifdef FEAT_BROWSE
/* May get file name, when there is none */
browse_save_fname(buf2);
@@ -2283,11 +2275,10 @@ dialog_changed(
buf2->b_fname, buf2->b_ffname, FALSE) == OK)
/* didn't hit Cancel */
(void)buf_write_all(buf2, FALSE);
#ifdef FEAT_AUTOCMD
/* an autocommand may have deleted the buffer */
if (!bufref_valid(&bufref))
buf2 = firstbuf;
#endif
}
}
}
@@ -2336,7 +2327,7 @@ add_bufnum(int *bufnrs, int *bufnump, int nr)
/*
* Return TRUE if any buffer was changed and cannot be abandoned.
* That changed buffer becomes the current buffer.
* When "unload" is true the current buffer is unloaded instead of making it
* When "unload" is TRUE the current buffer is unloaded instead of making it
* hidden. This is used for ":q!".
*/
int
@@ -2354,6 +2345,7 @@ check_changed_any(
tabpage_T *tp;
win_T *wp;
/* Make a list of all buffers, with the most important ones first. */
FOR_ALL_BUFFERS(buf)
++bufcount;
@@ -2366,17 +2358,19 @@ check_changed_any(
/* curbuf */
bufnrs[bufnum++] = curbuf->b_fnum;
/* buf in curtab */
/* buffers in current tab */
FOR_ALL_WINDOWS(wp)
if (wp->w_buffer != curbuf)
add_bufnum(bufnrs, &bufnum, wp->w_buffer->b_fnum);
/* buf in other tab */
/* buffers in other tabs */
FOR_ALL_TABPAGES(tp)
if (tp != curtab)
for (wp = tp->tp_firstwin; wp != NULL; wp = wp->w_next)
add_bufnum(bufnrs, &bufnum, wp->w_buffer->b_fnum);
/* any other buf */
/* any other buffer */
FOR_ALL_BUFFERS(buf)
add_bufnum(bufnrs, &bufnum, buf->b_fnum);
@@ -2390,6 +2384,14 @@ check_changed_any(
bufref_T bufref;
set_bufref(&bufref, buf);
#ifdef FEAT_TERMINAL
if (term_job_running(buf->b_term))
{
if (term_try_stop_job(buf) == FAIL)
break;
}
else
#endif
/* Try auto-writing the buffer. If this fails but the buffer no
* longer exists it's not changed, that's OK. */
if (check_changed(buf, (p_awa ? CCGD_AW : 0)
@@ -2402,6 +2404,7 @@ check_changed_any(
if (i >= bufnum)
goto theend;
/* Get here if "buf" cannot be abandoned. */
ret = TRUE;
exiting = FALSE;
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
@@ -2443,19 +2446,15 @@ check_changed_any(
FOR_ALL_TAB_WINDOWS(tp, wp)
if (wp->w_buffer == buf)
{
#ifdef FEAT_AUTOCMD
bufref_T bufref;
set_bufref(&bufref, buf);
#endif
goto_tabpage_win(tp, wp);
#ifdef FEAT_AUTOCMD
/* Paranoia: did autocms wipe out the buffer with changes? */
if (!bufref_valid(&bufref))
{
goto theend;
}
#endif
goto buf_found;
}
buf_found:
@@ -2493,20 +2492,16 @@ check_fname(void)
buf_write_all(buf_T *buf, int forceit)
{
int retval;
#ifdef FEAT_AUTOCMD
buf_T *old_curbuf = curbuf;
#endif
retval = (buf_write(buf, buf->b_ffname, buf->b_fname,
(linenr_T)1, buf->b_ml.ml_line_count, NULL,
FALSE, forceit, TRUE, FALSE));
#ifdef FEAT_AUTOCMD
if (curbuf != old_curbuf)
{
msg_source(HL_ATTR(HLF_W));
MSG(_("Warning: Entered other buffer unexpectedly (check autocommands)"));
}
#endif
return retval;
}
@@ -3126,7 +3121,7 @@ ex_listdo(exarg_T *eap)
tabpage_T *tp;
buf_T *buf = curbuf;
int next_fnum = 0;
#if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL)
#if defined(FEAT_SYN_HL)
char_u *save_ei = NULL;
#endif
char_u *p_shm_save;
@@ -3144,7 +3139,7 @@ ex_listdo(exarg_T *eap)
}
#endif
#if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL)
#if defined(FEAT_SYN_HL)
if (eap->cmdidx != CMD_windo && eap->cmdidx != CMD_tabdo)
/* Don't do syntax HL autocommands. Skipping the syntax file is a
* great speed improvement. */
@@ -3322,11 +3317,10 @@ ex_listdo(exarg_T *eap)
if (eap->cmdidx == CMD_windo)
{
validate_cursor(); /* cursor may have moved */
#ifdef FEAT_SCROLLBIND
/* required when 'scrollbind' has been set */
if (curwin->w_p_scb)
do_check_scrollbind(TRUE);
#endif
}
if (eap->cmdidx == CMD_windo || eap->cmdidx == CMD_tabdo)
@@ -3338,7 +3332,7 @@ ex_listdo(exarg_T *eap)
listcmd_busy = FALSE;
}
#if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL)
#if defined(FEAT_SYN_HL)
if (save_ei != NULL)
{
au_event_restore(save_ei);
@@ -3733,6 +3727,8 @@ source_in_path(char_u *path, char_u *name, int flags)
}
#if defined(FEAT_EVAL) || defined(PROTO)
/*
* Expand wildcards in "pat" and invoke do_source() for each match.
*/
@@ -3873,7 +3869,6 @@ load_pack_plugin(char_u *fname)
vim_snprintf((char *)pat, len, plugpat, ffname);
source_all_matches(pat);
#ifdef FEAT_AUTOCMD
{
char_u *cmd = vim_strsave((char_u *)"g:did_load_filetypes");
@@ -3888,7 +3883,6 @@ load_pack_plugin(char_u *fname)
}
vim_free(cmd);
}
#endif
vim_free(pat);
retval = OK;
@@ -3984,8 +3978,9 @@ ex_packadd(exarg_T *eap)
vim_free(pat);
}
}
#endif
#if defined(FEAT_EVAL) && defined(FEAT_AUTOCMD)
#if defined(FEAT_EVAL) || defined(PROTO)
/*
* ":options"
*/
@@ -4381,23 +4376,21 @@ do_source(
goto theend;
}
#ifdef FEAT_AUTOCMD
/* Apply SourceCmd autocommands, they should get the file and source it. */
if (has_autocmd(EVENT_SOURCECMD, fname_exp, NULL)
&& apply_autocmds(EVENT_SOURCECMD, fname_exp, fname_exp,
FALSE, curbuf))
{
# ifdef FEAT_EVAL
#ifdef FEAT_EVAL
retval = aborting() ? FAIL : OK;
# else
#else
retval = OK;
# endif
#endif
goto theend;
}
/* Apply SourcePre autocommands, they may get the file. */
apply_autocmds(EVENT_SOURCEPRE, fname_exp, fname_exp, FALSE, curbuf);
#endif
#ifdef USE_FOPEN_NOINH
cookie.fp = fopen_noinh_readbin((char *)fname_exp);
+106 -113
View File
@@ -81,14 +81,8 @@ static void ex_abclear(exarg_T *eap);
# define ex_menu ex_ni
# define ex_menutranslate ex_ni
#endif
#ifdef FEAT_AUTOCMD
static void ex_autocmd(exarg_T *eap);
static void ex_doautocmd(exarg_T *eap);
#else
# define ex_autocmd ex_ni
# define ex_doautocmd ex_ni
# define ex_doautoall ex_ni
#endif
#ifdef FEAT_LISTCMDS
static void ex_bunload(exarg_T *eap);
static void ex_buffer(exarg_T *eap);
@@ -210,8 +204,9 @@ static void ex_tearoff(exarg_T *eap);
#else
# define ex_tearoff ex_ni
#endif
#if defined(FEAT_MENU) && (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_GTK) \
|| defined(FEAT_GUI_MACVIM))
#if (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_GTK) \
|| defined(FEAT_GUI_MACVIM) \
|| defined(FEAT_TERM_POPUP_MENU)) && defined(FEAT_MENU)
static void ex_popup(exarg_T *eap);
#else
# define ex_popup ex_ni
@@ -236,6 +231,10 @@ static void ex_popup(exarg_T *eap);
# define ex_syntax ex_ni
# define ex_ownsyntax ex_ni
#endif
#ifndef FEAT_EVAL
# define ex_packadd ex_ni
# define ex_packloadall ex_ni
#endif
#if !defined(FEAT_SYN_HL) || !defined(FEAT_PROFILE)
# define ex_syntime ex_ni
#endif
@@ -392,13 +391,8 @@ static void ex_viminfo(exarg_T *eap);
# define ex_viminfo ex_ni
#endif
static void ex_behave(exarg_T *eap);
#ifdef FEAT_AUTOCMD
static void ex_filetype(exarg_T *eap);
static void ex_setfiletype(exarg_T *eap);
#else
# define ex_filetype ex_ni
# define ex_setfiletype ex_ni
#endif
#ifndef FEAT_DIFF
# define ex_diffoff ex_ni
# define ex_diffpatch ex_ni
@@ -409,7 +403,7 @@ static void ex_setfiletype(exarg_T *eap);
#endif
static void ex_digraphs(exarg_T *eap);
static void ex_set(exarg_T *eap);
#if !defined(FEAT_EVAL) || !defined(FEAT_AUTOCMD)
#if !defined(FEAT_EVAL)
# define ex_options ex_ni
#endif
#ifdef FEAT_SEARCH_EXTRA
@@ -1768,11 +1762,8 @@ do_one_cmd(
/* avoid that a function call in 'statusline' does this */
&& !getline_equal(fgetline, cookie, get_func_line)
#endif
#ifdef FEAT_AUTOCMD
/* avoid that an autocommand, e.g. QuitPre, does this */
&& !getline_equal(fgetline, cookie, getnextac)
#endif
)
&& !getline_equal(fgetline, cookie, getnextac))
--quitmore;
/*
@@ -1919,7 +1910,6 @@ do_one_cmd(
case 'n': if (checkforcmd(&ea.cmd, "noautocmd", 3))
{
#ifdef FEAT_AUTOCMD
if (cmdmod.save_ei == NULL)
{
/* Set 'eventignore' to "all". Restore the
@@ -1928,7 +1918,6 @@ do_one_cmd(
set_string_option_direct((char_u *)"ei", -1,
(char_u *)"all", OPT_FREE, SID_NONE);
}
#endif
continue;
}
if (!checkforcmd(&ea.cmd, "noswapfile", 3))
@@ -2309,7 +2298,6 @@ do_one_cmd(
goto doend;
}
#ifdef FEAT_AUTOCMD
/* If this looks like an undefined user command and there are CmdUndefined
* autocommands defined, trigger the matching autocommands. */
if (p != NULL && ea.cmdidx == CMD_SIZE && !ea.skip
@@ -2326,9 +2314,12 @@ do_one_cmd(
vim_free(p);
/* If the autocommands did something and didn't cause an error, try
* finding the command again. */
p = (ret && !aborting()) ? find_command(&ea, NULL) : ea.cmd;
}
p = (ret
#ifdef FEAT_EVAL
&& !aborting()
#endif
) ? find_command(&ea, NULL) : ea.cmd;
}
#ifdef FEAT_USR_CMDS
if (p == NULL)
@@ -2428,7 +2419,6 @@ do_one_cmd(
errormsg = (char_u *)_(get_text_locked_msg());
goto doend;
}
#ifdef FEAT_AUTOCMD
/* Disallow editing another buffer when "curbuf_lock" is set.
* Do allow ":edit" (check for argument later).
* Do allow ":checktime" (it's postponed). */
@@ -2438,7 +2428,6 @@ do_one_cmd(
&& !IS_USER_CMDIDX(ea.cmdidx)
&& curbuf_locked())
goto doend;
#endif
if (!ni && !(ea.argt & RANGE) && ea.addr_count > 0)
{
@@ -2978,7 +2967,7 @@ doend:
if (verbose_save >= 0)
p_verbose = verbose_save;
#ifdef FEAT_AUTOCMD
if (cmdmod.save_ei != NULL)
{
/* Restore 'eventignore' to the value before ":noautocmd". */
@@ -2986,7 +2975,7 @@ doend:
OPT_FREE, SID_NONE);
free_string_option(cmdmod.save_ei);
}
#endif
if (cmdmod.filter_regmatch.regprog != NULL)
vim_regfree(cmdmod.filter_regmatch.regprog);
@@ -4032,14 +4021,12 @@ set_one_cmd_context(
}
}
break;
#ifdef FEAT_AUTOCMD
case CMD_autocmd:
return set_context_in_autocmd(xp, arg, FALSE);
case CMD_doautocmd:
case CMD_doautoall:
return set_context_in_autocmd(xp, arg, TRUE);
#endif
case CMD_set:
set_context_in_set_cmd(xp, arg, 0);
break;
@@ -5517,7 +5504,6 @@ ex_abclear(exarg_T *eap)
map_clear(eap->cmd, eap->arg, TRUE, TRUE);
}
#if defined(FEAT_AUTOCMD) || defined(PROTO)
static void
ex_autocmd(exarg_T *eap)
{
@@ -5551,7 +5537,6 @@ ex_doautocmd(exarg_T *eap)
if (call_do_modelines && did_aucmd)
do_modelines(0);
}
#endif
#ifdef FEAT_LISTCMDS
/*
@@ -7219,8 +7204,35 @@ not_exiting(void)
settmode(TMODE_RAW);
}
static int
before_quit_autocmds(win_T *wp, int quit_all, int forceit)
{
apply_autocmds(EVENT_QUITPRE, NULL, NULL, FALSE, wp->w_buffer);
/* Bail out when autocommands closed the window.
* Refuse to quit when the buffer in the last window is being closed (can
* only happen in autocommands). */
if (!win_valid(wp)
|| curbuf_locked()
|| (wp->w_buffer->b_nwindows == 1 && wp->w_buffer->b_locked > 0))
return TRUE;
if (quit_all || (check_more(FALSE, forceit) == OK && only_one_window()))
{
apply_autocmds(EVENT_EXITPRE, NULL, NULL, FALSE, curbuf);
/* Refuse to quit when locked or when the buffer in the last window is
* being closed (can only happen in autocommands). */
if (curbuf_locked()
|| (curbuf->b_nwindows == 1 && curbuf->b_locked > 0))
return TRUE;
}
return FALSE;
}
/*
* ":quit": quit current window, quit Vim if the last window is closed.
* ":{nr}quit": quit window {nr}
*/
static void
ex_quit(exarg_T *eap)
@@ -7251,18 +7263,13 @@ ex_quit(exarg_T *eap)
else
wp = curwin;
#ifdef FEAT_AUTOCMD
/* Refuse to quit when locked. */
if (curbuf_locked())
return;
apply_autocmds(EVENT_QUITPRE, NULL, NULL, FALSE, wp->w_buffer);
/* Bail out when autocommands closed the window.
* Refuse to quit when the buffer in the last window is being closed (can
* only happen in autocommands). */
if (!win_valid(wp)
|| (wp->w_buffer->b_nwindows == 1 && wp->w_buffer->b_locked > 0))
/* Trigger QuitPre and maybe ExitPre */
if (before_quit_autocmds(wp, FALSE, eap->forceit))
return;
#endif
#ifdef FEAT_NETBEANS_INTG
netbeansForcedQuit = eap->forceit;
@@ -7335,13 +7342,9 @@ ex_quit_all(exarg_T *eap)
text_locked_msg();
return;
}
#ifdef FEAT_AUTOCMD
apply_autocmds(EVENT_QUITPRE, NULL, NULL, FALSE, curbuf);
/* Refuse to quit when locked or when the buffer in the last window is
* being closed (can only happen in autocommands). */
if (curbuf_locked() || (curbuf->b_nwindows == 1 && curbuf->b_locked > 0))
if (before_quit_autocmds(curwin, TRUE, eap->forceit))
return;
#endif
exiting = TRUE;
if (eap->forceit || !check_changed_any(FALSE, FALSE))
@@ -7362,11 +7365,7 @@ ex_close(exarg_T *eap)
cmdwin_result = Ctrl_C;
else
#endif
if (!text_locked()
#ifdef FEAT_AUTOCMD
&& !curbuf_locked()
#endif
)
if (!text_locked() && !curbuf_locked())
{
if (eap->addr_count == 0)
ex_win_close(eap->forceit, curwin, NULL);
@@ -7582,11 +7581,7 @@ ex_tabclose(exarg_T *eap)
tabpage_close_other(tp, eap->forceit);
return;
}
else if (!text_locked()
#ifdef FEAT_AUTOCMD
&& !curbuf_locked()
#endif
)
else if (!text_locked() && !curbuf_locked())
tabpage_close(eap->forceit);
}
}
@@ -7679,9 +7674,7 @@ tabpage_close_other(tabpage_T *tp, int forceit)
break;
}
#ifdef FEAT_AUTOCMD
apply_autocmds(EVENT_TABCLOSED, NULL, NULL, FALSE, curbuf);
#endif
redraw_tabline = TRUE;
if (h != tabline_height())
@@ -7789,7 +7782,7 @@ ex_stop(exarg_T *eap)
}
/*
* ":exit", ":xit" and ":wq": Write file and exit Vim.
* ":exit", ":xit" and ":wq": Write file and quite the current window.
*/
static void
ex_exit(exarg_T *eap)
@@ -7807,13 +7800,9 @@ ex_exit(exarg_T *eap)
text_locked_msg();
return;
}
#ifdef FEAT_AUTOCMD
apply_autocmds(EVENT_QUITPRE, NULL, NULL, FALSE, curbuf);
/* Refuse to quit when locked or when the buffer in the last window is
* being closed (can only happen in autocommands). */
if (curbuf_locked() || (curbuf->b_nwindows == 1 && curbuf->b_locked > 0))
if (before_quit_autocmds(curwin, FALSE, eap->forceit))
return;
#endif
/*
* if more files or windows we won't exit
@@ -7919,10 +7908,9 @@ handle_drop(
/* Postpone this while editing the command line. */
if (text_locked())
return;
#ifdef FEAT_AUTOCMD
if (curbuf_locked())
return;
#endif
/* When the screen is being updated we should not change buffers and
* windows structures, it may cause freed memory to be used. */
if (updating_screen)
@@ -8090,9 +8078,7 @@ alist_set(
if (recursive)
{
#ifdef FEAT_AUTOCMD
EMSG(_(e_au_recursive));
#endif
return;
}
++recursive;
@@ -8269,11 +8255,10 @@ ex_splitview(exarg_T *eap)
&& eap->cmdidx != CMD_vnew
&& eap->cmdidx != CMD_new)
{
# ifdef FEAT_AUTOCMD
if (
# ifdef FEAT_GUI
# ifdef FEAT_GUI
!gui.in_use &&
# endif
# endif
au_has_group((char_u *)"FileExplorer"))
{
/* No browsing supported but we do have the file explorer:
@@ -8282,7 +8267,6 @@ ex_splitview(exarg_T *eap)
eap->arg = (char_u *)".";
}
else
# endif
{
fname = do_browse(0, (char_u *)_("Edit File in new window"),
eap->arg, NULL, NULL, NULL, curbuf);
@@ -8318,20 +8302,18 @@ ex_splitview(exarg_T *eap)
else if (win_split(eap->addr_count > 0 ? (int)eap->line2 : 0,
*eap->cmd == 'v' ? WSP_VERT : 0) != FAIL)
{
# ifdef FEAT_SCROLLBIND
/* Reset 'scrollbind' when editing another file, but keep it when
* doing ":split" without arguments. */
if (*eap->arg != NUL
# ifdef FEAT_BROWSE
# ifdef FEAT_BROWSE
|| cmdmod.browse
# endif
# endif
)
{
RESET_BINDING(curwin);
}
else
do_check_scrollbind(FALSE);
# endif
do_exedit(eap, old_curwin);
}
@@ -8686,12 +8668,11 @@ do_exedit(
#endif
)
{
#ifdef FEAT_AUTOCMD
/* Can't edit another file when "curbuf_lock" is set. Only ":edit"
* can bring us here, others are stopped earlier. */
if (*eap->arg != NUL && curbuf_locked())
return;
#endif
n = readonlymode;
if (eap->cmdidx == CMD_view || eap->cmdidx == CMD_sview)
readonlymode = TRUE;
@@ -8720,7 +8701,7 @@ do_exedit(
need_hide = (curbufIsChanged() && curbuf->b_nwindows <= 1);
if (!need_hide || buf_hide(curbuf))
{
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
#if defined(FEAT_EVAL)
cleanup_T cs;
/* Reset the error/interrupt/exception state here so that
@@ -8732,7 +8713,7 @@ do_exedit(
#endif
win_close(curwin, !need_hide && !buf_hide(curbuf));
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
#if defined(FEAT_EVAL)
/* Restore the error/interrupt/exception state if not
* discarded by a new aborting error, interrupt, or
* uncaught exception. */
@@ -8799,12 +8780,23 @@ ex_tearoff(exarg_T *eap)
}
#endif
#if defined(FEAT_MENU) && (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_GTK) \
|| defined(FEAT_GUI_MACVIM))
#if (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_GTK) \
|| defined(FEAT_GUI_MACVIM) \
|| defined(FEAT_TERM_POPUP_MENU)) && defined(FEAT_MENU)
static void
ex_popup(exarg_T *eap)
{
gui_make_popup(eap->arg, eap->forceit);
# if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_GTK) \
|| defined(FEAT_GUI_MACVIM)
if (gui.in_use)
gui_make_popup(eap->arg, eap->forceit);
# ifdef FEAT_TERM_POPUP_MENU
else
# endif
# endif
# ifdef FEAT_TERM_POPUP_MENU
pum_make_popup(eap->arg, eap->forceit);
# endif
}
#endif
@@ -8825,7 +8817,6 @@ ex_swapname(exarg_T *eap UNUSED)
static void
ex_syncbind(exarg_T *eap UNUSED)
{
#ifdef FEAT_SCROLLBIND
win_T *wp;
win_T *save_curwin = curwin;
buf_T *save_curbuf = curbuf;
@@ -8893,7 +8884,6 @@ ex_syncbind(exarg_T *eap UNUSED)
ins_typebuf(ctrl_o, REMAP_NONE, 0, TRUE, FALSE);
}
}
#endif
}
@@ -8946,7 +8936,7 @@ ex_read(exarg_T *eap)
}
if (i != OK)
{
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
#if defined(FEAT_EVAL)
if (!aborting())
#endif
EMSG2(_(e_notopen), eap->arg);
@@ -9032,10 +9022,8 @@ ex_cd(exarg_T *eap)
else
#endif
{
#ifdef FEAT_AUTOCMD
if (allbuf_locked())
return;
#endif
if (vim_strchr(p_cpo, CPO_CHDIR) != NULL && curbufIsChanged()
&& !eap->forceit)
{
@@ -9092,11 +9080,9 @@ ex_cd(exarg_T *eap)
/* Echo the new current directory if the command was typed. */
if (KeyTyped || p_verbose >= 5)
ex_pwd(eap);
#ifdef FEAT_AUTOCMD
apply_autocmds(EVENT_DIRCHANGED,
is_local_chdir ? (char_u *)"window" : (char_u *)"global",
new_dir, FALSE, curbuf);
#endif
}
vim_free(tofree);
}
@@ -10615,21 +10601,15 @@ find_cmdline_var(char_u *src, int *usedlen)
#define SPEC_SFILE (SPEC_CFILE + 1)
"<slnum>", /* ":so" file line number */
#define SPEC_SLNUM (SPEC_SFILE + 1)
#ifdef FEAT_AUTOCMD
"<afile>", /* autocommand file name */
# define SPEC_AFILE (SPEC_SLNUM + 1)
#define SPEC_AFILE (SPEC_SLNUM + 1)
"<abuf>", /* autocommand buffer number */
# define SPEC_ABUF (SPEC_AFILE + 1)
#define SPEC_ABUF (SPEC_AFILE + 1)
"<amatch>", /* autocommand match name */
# define SPEC_AMATCH (SPEC_ABUF + 1)
#endif
#define SPEC_AMATCH (SPEC_ABUF + 1)
#ifdef FEAT_CLIENTSERVER
"<client>"
# ifdef FEAT_AUTOCMD
# define SPEC_CLIENT (SPEC_AMATCH + 1)
# else
# define SPEC_CLIENT (SPEC_SLNUM + 1)
# endif
# define SPEC_CLIENT (SPEC_AMATCH + 1)
#endif
};
@@ -10828,7 +10808,6 @@ eval_vars(
break;
#endif
#ifdef FEAT_AUTOCMD
case SPEC_AFILE: /* file name for autocommand */
result = autocmd_fname;
if (result != NULL && !autocmd_fname_full)
@@ -10867,7 +10846,6 @@ eval_vars(
}
break;
#endif
case SPEC_SFILE: /* file name for ":so" command */
result = sourcing_name;
if (result == NULL)
@@ -11003,7 +10981,6 @@ arg_all(void)
return retval;
}
#if defined(FEAT_AUTOCMD) || defined(PROTO)
/*
* Expand the <sfile> string in "arg".
*
@@ -11065,7 +11042,6 @@ expand_sfile(char_u *arg)
return result;
}
#endif
#ifdef FEAT_SESSION
static int ses_winsizes(FILE *fd, int restore_size,
@@ -11167,6 +11143,11 @@ makeopens(
{
if (!(only_save_windows && buf->b_nwindows == 0)
&& !(buf->b_help && !(ssop_flags & SSOP_HELP))
#ifdef FEAT_TERMINAL
/* skip terminal buffers: finished ones are not useful, others
* will be resurrected and result in a new buffer */
&& !bt_terminal(buf)
#endif
&& buf->b_fname != NULL
&& buf->b_p_bl)
{
@@ -11385,7 +11366,8 @@ makeopens(
/*
* Wipe out an empty unnamed buffer we started in.
*/
if (put_line(fd, "if exists('s:wipebuf')") == FAIL)
if (put_line(fd, "if exists('s:wipebuf') && s:wipebuf != bufnr('%')")
== FAIL)
return FAIL;
if (put_line(fd, " silent exe 'bwipe ' . s:wipebuf") == FAIL)
return FAIL;
@@ -11545,6 +11527,12 @@ ses_do_frame(frame_T *fr)
static int
ses_do_win(win_T *wp)
{
#ifdef FEAT_TERMINAL
if (bt_terminal(wp->w_buffer))
return !term_is_finished(wp->w_buffer)
&& (ssop_flags & SSOP_TERMINAL)
&& term_should_restore(wp->w_buffer);
#endif
if (wp->w_buffer->b_fname == NULL
#ifdef FEAT_QUICKFIX
/* When 'buftype' is "nofile" can't restore the window contents. */
@@ -11610,13 +11598,21 @@ put_view(
/* Edit the file. Skip this when ":next" already did it. */
if (add_edit && (!did_next || wp->w_arg_idx_invalid))
{
# ifdef FEAT_TERMINAL
if (bt_terminal(wp->w_buffer))
{
if (term_write_session(fd, wp) == FAIL)
return FAIL;
}
else
# endif
/*
* Load the file.
*/
if (wp->w_buffer->b_ffname != NULL
#ifdef FEAT_QUICKFIX
# ifdef FEAT_QUICKFIX
&& !bt_nofile(wp->w_buffer)
#endif
# endif
)
{
/*
@@ -11634,8 +11630,7 @@ put_view(
|| fputs(" | else | edit ", fd) < 0
|| ses_fname(fd, wp->w_buffer, flagp, FALSE) == FAIL
|| fputs(" | endif", fd) < 0
||
put_eol(fd) == FAIL)
|| put_eol(fd) == FAIL)
return FAIL;
}
else
@@ -12105,7 +12100,6 @@ get_mapclear_arg(expand_T *xp UNUSED, int idx)
return NULL;
}
#ifdef FEAT_AUTOCMD
static int filetype_detect = FALSE;
static int filetype_plugin = FALSE;
static int filetype_indent = FALSE;
@@ -12219,7 +12213,6 @@ ex_setfiletype(exarg_T *eap)
did_filetype = FALSE;
}
}
#endif
static void
ex_digraphs(exarg_T *eap UNUSED)
@@ -12243,7 +12236,7 @@ ex_set(exarg_T *eap)
flags = OPT_LOCAL;
else if (eap->cmdidx == CMD_setglobal)
flags = OPT_GLOBAL;
#if defined(FEAT_EVAL) && defined(FEAT_AUTOCMD) && defined(FEAT_BROWSE)
#if defined(FEAT_EVAL) && defined(FEAT_BROWSE)
if (cmdmod.browse && flags == 0)
ex_options(eap);
else
+10 -41
View File
@@ -146,7 +146,6 @@ static void set_search_match(pos_T *t);
#endif
#ifdef FEAT_AUTOCMD
static void
trigger_cmd_autocmd(int typechar, int evt)
{
@@ -156,7 +155,6 @@ trigger_cmd_autocmd(int typechar, int evt)
typestr[1] = NUL;
apply_autocmds(evt, typestr, typestr, FALSE, curbuf);
}
#endif
/*
* Abandon the command line.
@@ -266,9 +264,7 @@ getcmdline(
* custom status line may invoke ":normal". */
struct cmdline_info save_ccline;
#endif
#ifdef FEAT_AUTOCMD
int cmdline_type;
#endif
#ifdef FEAT_EVAL
if (firstc == -1)
@@ -376,11 +372,11 @@ getcmdline(
b_im_ptr = &curbuf->b_p_imsearch;
if (*b_im_ptr == B_IMODE_LMAP)
State |= LANGMAP;
#ifdef FEAT_MBYTE
#ifdef HAVE_INPUT_METHOD
im_set_active(*b_im_ptr == B_IMODE_IM);
#endif
}
#ifdef FEAT_MBYTE
#ifdef HAVE_INPUT_METHOD
else if (p_imcmdline)
im_set_active(TRUE);
#endif
@@ -396,11 +392,9 @@ getcmdline(
* terminal mode set to cooked. Need to set raw mode here then. */
settmode(TMODE_RAW);
#ifdef FEAT_AUTOCMD
/* Trigger CmdlineEnter autocommands. */
cmdline_type = firstc == NUL ? '-' : firstc;
trigger_cmd_autocmd(cmdline_type, EVENT_CMDLINEENTER);
#endif
#ifdef FEAT_CMDHIST
init_history();
@@ -1132,7 +1126,7 @@ getcmdline(
{
/* ":lmap" mappings exists, toggle use of mappings. */
State ^= LANGMAP;
#ifdef FEAT_MBYTE
#ifdef HAVE_INPUT_METHOD
im_set_active(FALSE); /* Disable input method */
#endif
if (b_im_ptr != NULL)
@@ -1143,7 +1137,7 @@ getcmdline(
*b_im_ptr = B_IMODE_NONE;
}
}
#ifdef FEAT_MBYTE
#ifdef HAVE_INPUT_METHOD
else
{
/* There are no ":lmap" mappings, toggle IM. When
@@ -1954,10 +1948,8 @@ cmdline_not_changed:
#endif
cmdline_changed:
#ifdef FEAT_AUTOCMD
/* Trigger CmdlineChanged autocommands. */
trigger_cmd_autocmd(cmdline_type, EVENT_CMDLINECHANGED);
#endif
#ifdef FEAT_SEARCH_EXTRA
/*
@@ -2168,13 +2160,11 @@ returncmd:
if (some_key_typed)
need_wait_return = FALSE;
#ifdef FEAT_AUTOCMD
/* Trigger CmdlineLeave autocommands. */
trigger_cmd_autocmd(cmdline_type, EVENT_CMDLINELEAVE);
#endif
State = save_State;
#ifdef FEAT_MBYTE
#ifdef HAVE_INPUT_METHOD
if (b_im_ptr != NULL && *b_im_ptr != B_IMODE_LMAP)
im_save_status(b_im_ptr);
im_set_active(FALSE);
@@ -2274,7 +2264,6 @@ get_text_locked_msg(void)
return e_secure;
}
#if defined(FEAT_AUTOCMD) || defined(PROTO)
/*
* Check if "curbuf_lock" or "allbuf_lock" is set and return TRUE when it is
* and give an error message.
@@ -2304,7 +2293,6 @@ allbuf_locked(void)
}
return FALSE;
}
#endif
static int
cmdline_charsize(int idx)
@@ -4994,10 +4982,8 @@ ExpandFromContext(
{EXPAND_SYNTIME, get_syntime_arg, TRUE, TRUE},
#endif
{EXPAND_HIGHLIGHT, get_highlight_name, TRUE, TRUE},
#ifdef FEAT_AUTOCMD
{EXPAND_EVENTS, get_event_name, TRUE, TRUE},
{EXPAND_AUGROUP, get_augroup_name, TRUE, TRUE},
#endif
#ifdef FEAT_CSCOPE
{EXPAND_CSCOPE, get_cscope_name, TRUE, TRUE},
#endif
@@ -6944,10 +6930,9 @@ open_cmdwin(void)
/* Save current window sizes. */
win_size_save(&winsizes);
# ifdef FEAT_AUTOCMD
/* Don't execute autocommands while creating the window. */
block_autocmds();
# endif
/* don't use a new tab page */
cmdmod.tab = 0;
cmdmod.noswapfile = 1;
@@ -6956,9 +6941,7 @@ open_cmdwin(void)
if (win_split((int)p_cwh, WSP_BOT) == FAIL)
{
beep_flush();
# ifdef FEAT_AUTOCMD
unblock_autocmds();
# endif
return K_IGNORE;
}
cmdwin_type = get_cmdline_type();
@@ -6977,12 +6960,10 @@ open_cmdwin(void)
# endif
RESET_BINDING(curwin);
# ifdef FEAT_AUTOCMD
/* Do execute autocommands for setting the filetype (load syntax). */
unblock_autocmds();
/* But don't allow switching to another buffer. */
++curbuf_lock;
# endif
/* Showing the prompt may have set need_wait_return, reset it. */
need_wait_return = FALSE;
@@ -6997,9 +6978,7 @@ open_cmdwin(void)
}
set_option_value((char_u *)"ft", 0L, (char_u *)"vim", OPT_LOCAL);
}
# ifdef FEAT_AUTOCMD
--curbuf_lock;
# endif
/* Reset 'textwidth' after setting 'filetype' (the Vim filetype plugin
* sets 'textwidth' to 78). */
@@ -7045,12 +7024,10 @@ open_cmdwin(void)
setmouse();
# endif
# ifdef FEAT_AUTOCMD
/* Trigger CmdwinEnter autocommands. */
trigger_cmd_autocmd(cmdwin_type, EVENT_CMDWINENTER);
if (restart_edit != 0) /* autocmd with ":startinsert" */
stuffcharReadbuff(K_NOP);
# endif
i = RedrawingDisabled;
RedrawingDisabled = 0;
@@ -7063,20 +7040,16 @@ open_cmdwin(void)
RedrawingDisabled = i;
# ifdef FEAT_AUTOCMD
# ifdef FEAT_FOLDING
# ifdef FEAT_FOLDING
save_KeyTyped = KeyTyped;
# endif
# endif
/* Trigger CmdwinLeave autocommands. */
trigger_cmd_autocmd(cmdwin_type, EVENT_CMDWINLEAVE);
# ifdef FEAT_FOLDING
# ifdef FEAT_FOLDING
/* Restore KeyTyped in case it is modified by autocommands */
KeyTyped = save_KeyTyped;
# endif
# endif
/* Restore the command line info. */
@@ -7094,7 +7067,7 @@ open_cmdwin(void)
}
else
{
# if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
# if defined(FEAT_EVAL)
/* autocmds may abort script processing */
if (aborting() && cmdwin_result != K_IGNORE)
cmdwin_result = Ctrl_C;
@@ -7155,10 +7128,8 @@ open_cmdwin(void)
}
}
# ifdef FEAT_AUTOCMD
/* Don't execute autocommands while deleting the window. */
block_autocmds();
# endif
# ifdef FEAT_CONCEAL
/* Avoid command-line window first character being concealed. */
curwin->w_p_cole = 0;
@@ -7176,9 +7147,7 @@ open_cmdwin(void)
/* Restore window sizes. */
win_size_restore(&winsizes);
# ifdef FEAT_AUTOCMD
unblock_autocmds();
# endif
}
ga_clear(&winsizes);
+17 -23
View File
@@ -439,18 +439,11 @@
# define FEAT_MODIFY_FNAME
#endif
/*
* +autocmd ":autocmd" command
*/
#ifdef FEAT_NORMAL
# define FEAT_AUTOCMD
#endif
/*
* +diff Displaying diffs in a nice way.
* Requires +windows and +autocmd.
*/
#if defined(FEAT_NORMAL) && defined(FEAT_AUTOCMD)
#if defined(FEAT_NORMAL)
# define FEAT_DIFF
#endif
@@ -706,20 +699,6 @@
# define FEAT_LIBCALL
#endif
/*
* +scrollbind synchronization of split windows
*/
#if defined(FEAT_NORMAL)
# define FEAT_SCROLLBIND
#endif
/*
* +cursorbind synchronization of split windows
*/
#if defined(FEAT_NORMAL)
# define FEAT_CURSORBIND
#endif
/*
* +menu ":menu" command
*/
@@ -730,6 +709,13 @@
# endif
#endif
/*
* popup menu in a terminal
*/
#if defined(FEAT_MENU) && !defined(ALWAYS_USE_GUI) && defined(FEAT_INS_EXPAND)
# define FEAT_TERM_POPUP_MENU
#endif
/* There are two ways to use XPM. */
#if (defined(HAVE_XM_XPMP_H) && defined(FEAT_GUI_MOTIF)) \
|| defined(HAVE_X11_XPM_H)
@@ -1348,7 +1334,8 @@
/*
* +balloon_eval_term Allow balloon expression evaluation in the terminal.
*/
#if defined(FEAT_HUGE) && defined(UNIX) && defined(FEAT_TIMERS)
#if defined(FEAT_HUGE) && defined(FEAT_TIMERS) && \
(defined(UNIX) || (defined(WIN32) && !defined(FEAT_GUI_W32)))
# define FEAT_BEVAL_TERM
#endif
@@ -1411,6 +1398,13 @@
# define FEAT_FILTERPIPE
#endif
/*
* +vtp: Win32 virtual console.
*/
#if !defined(FEAT_GUI) && defined(WIN3264)
# define FEAT_VTP
#endif
/*
* +transparency 'transparency' option.
*/
+25 -120
View File
@@ -47,14 +47,12 @@ static int msg_add_fileformat(int eol_type);
static void msg_add_eol(void);
static int check_mtime(buf_T *buf, stat_T *s);
static int time_differs(long t1, long t2);
#ifdef FEAT_AUTOCMD
static int apply_autocmds_exarg(event_T event, char_u *fname, char_u *fname_io, int force, buf_T *buf, exarg_T *eap);
static int au_find_group(char_u *name);
# define AUGROUP_DEFAULT -1 /* default autocmd group */
# define AUGROUP_ERROR -2 /* erroneous autocmd group */
# define AUGROUP_ALL -3 /* all autocmd groups */
#endif
#if defined(FEAT_CRYPT) || defined(FEAT_MBYTE)
# define HAS_BW_FLAGS
@@ -135,11 +133,8 @@ static int move_lines(buf_T *frombuf, buf_T *tobuf);
#ifdef TEMPDIRNAMES
static void vim_settempdir(char_u *tempdir);
#endif
#ifdef FEAT_AUTOCMD
static char *e_auchangedbuf = N_("E812: Autocommands changed buffer or buffer name");
#endif
#ifdef FEAT_AUTOCMD
/*
* Set by the apply_autocmds_group function if the given event is equal to
* EVENT_FILETYPE. Used by the readfile function in order to determine if
@@ -149,7 +144,6 @@ static char *e_auchangedbuf = N_("E812: Autocommands changed buffer or buffer na
* apply_autocmds_group.
*/
static int au_did_filetype INIT(= FALSE);
#endif
void
filemess(
@@ -307,17 +301,13 @@ readfile(
char_u conv_rest[CONV_RESTLEN];
int conv_restlen = 0; /* nr of bytes in conv_rest[] */
#endif
#ifdef FEAT_AUTOCMD
buf_T *old_curbuf;
char_u *old_b_ffname;
char_u *old_b_fname;
int using_b_ffname;
int using_b_fname;
#endif
#ifdef FEAT_AUTOCMD
au_did_filetype = FALSE; /* reset before triggering any autocommands */
#endif
curbuf->b_no_eol_lnum = 0; /* in case it was set by the previous read */
@@ -337,7 +327,6 @@ readfile(
return FAIL;
}
#ifdef FEAT_AUTOCMD
/* Remember the initial values of curbuf, curbuf->b_ffname and
* curbuf->b_fname to detect whether they are altered as a result of
* executing nasty autocommands. Also check if "fname" and "sfname"
@@ -348,7 +337,6 @@ readfile(
using_b_ffname = (fname == curbuf->b_ffname)
|| (sfname == curbuf->b_ffname);
using_b_fname = (fname == curbuf->b_fname) || (sfname == curbuf->b_fname);
#endif
/* After reading a file the cursor line changes but we don't want to
* display the line. */
@@ -369,7 +357,6 @@ readfile(
fname = sfname;
#endif
#ifdef FEAT_AUTOCMD
/*
* The BufReadCmd and FileReadCmd events intercept the reading process by
* executing the associated commands instead.
@@ -404,7 +391,6 @@ readfile(
curbuf->b_op_start = pos;
}
#endif
if ((shortmess(SHM_OVER) || curbuf->b_help) && p_verbose == 0)
msg_scroll = FALSE; /* overwrite previous file message */
@@ -613,7 +599,6 @@ readfile(
#endif
{
check_need_swap(newfile);
#ifdef FEAT_AUTOCMD
/* SwapExists autocommand may mess things up */
if (curbuf != old_curbuf
|| (using_b_ffname
@@ -624,7 +609,6 @@ readfile(
EMSG(_(e_auchangedbuf));
return FAIL;
}
#endif
}
if (dir_of_file_exists(fname))
filemess(curbuf, sfname, (char_u *)_("[New File]"), 0);
@@ -641,14 +625,12 @@ readfile(
if (eap != NULL)
set_forced_fenc(eap);
#endif
#ifdef FEAT_AUTOCMD
apply_autocmds_exarg(EVENT_BUFNEWFILE, sfname, sfname,
FALSE, curbuf, eap);
#endif
/* remember the current fileformat */
save_file_ff(curbuf);
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
#if defined(FEAT_EVAL)
if (aborting()) /* autocmds may abort script processing */
return FAIL;
#endif
@@ -701,7 +683,6 @@ readfile(
#endif
{
check_need_swap(newfile);
#ifdef FEAT_AUTOCMD
if (!read_stdin && (curbuf != old_curbuf
|| (using_b_ffname && (old_b_ffname != curbuf->b_ffname))
|| (using_b_fname && (old_b_fname != curbuf->b_fname))))
@@ -711,7 +692,6 @@ readfile(
close(fd);
return FAIL;
}
#endif
#ifdef UNIX
/* Set swap file protection bits after creating it. */
if (swap_mode > 0 && curbuf->b_ml.ml_mfp != NULL
@@ -764,7 +744,6 @@ readfile(
try_dos = (vim_strchr(p_ffs, 'd') != NULL);
try_unix = (vim_strchr(p_ffs, 'x') != NULL);
#ifdef FEAT_AUTOCMD
if (!read_buffer)
{
int m = msg_scroll;
@@ -834,7 +813,6 @@ readfile(
return FAIL;
}
}
#endif /* FEAT_AUTOCMD */
/* Autocommands may add lines to the file, need to check if it is empty */
wasempty = (curbuf->b_ml.ml_flags & ML_EMPTY);
@@ -2704,7 +2682,6 @@ failed:
}
#endif
#ifdef FEAT_AUTOCMD
if (!read_stdin && !read_fifo && (!read_buffer || sfname != NULL))
{
int m = msg_scroll;
@@ -2746,7 +2723,6 @@ failed:
return FAIL;
# endif
}
#endif
if (recoverymode && error)
return FAIL;
@@ -3197,9 +3173,7 @@ buf_write(
#endif
/* writing everything */
int whole = (start == 1 && end == buf->b_ml.ml_line_count);
#ifdef FEAT_AUTOCMD
linenr_T old_line_count = buf->b_ml.ml_line_count;
#endif
int attr;
int fileformat;
int write_bin;
@@ -3319,7 +3293,6 @@ buf_write(
buf->b_op_end.lnum = end;
buf->b_op_end.col = 0;
#ifdef FEAT_AUTOCMD
{
aco_save_T aco;
int buf_ffname = FALSE;
@@ -3509,7 +3482,6 @@ buf_write(
if (buf_fname_s)
fname = buf->b_sfname;
}
#endif
#ifdef FEAT_NETBEANS_INTG
if (netbeans_active() && isNetbeansBuffer(buf))
@@ -5020,12 +4992,10 @@ restore_backup:
)
{
unchanged(buf, TRUE);
#ifdef FEAT_AUTOCMD
/* b:changedtick is always incremented in unchanged() but that
* should not trigger a TextChanged event. */
if (buf->b_last_changedtick + 1 == CHANGEDTICK(buf))
buf->b_last_changedtick = CHANGEDTICK(buf);
#endif
u_unchanged(buf);
u_update_save_nr(buf);
}
@@ -5194,7 +5164,6 @@ nofail:
}
#endif
#ifdef FEAT_AUTOCMD
#ifdef FEAT_EVAL
if (!should_abort(retval))
#else
@@ -5232,7 +5201,6 @@ nofail:
retval = FALSE;
#endif
}
#endif
got_int |= prev_got_int;
@@ -5250,37 +5218,34 @@ nofail:
static int
set_rw_fname(char_u *fname, char_u *sfname)
{
#ifdef FEAT_AUTOCMD
buf_T *buf = curbuf;
/* It's like the unnamed buffer is deleted.... */
if (curbuf->b_p_bl)
apply_autocmds(EVENT_BUFDELETE, NULL, NULL, FALSE, curbuf);
apply_autocmds(EVENT_BUFWIPEOUT, NULL, NULL, FALSE, curbuf);
# ifdef FEAT_EVAL
#ifdef FEAT_EVAL
if (aborting()) /* autocmds may abort script processing */
return FAIL;
# endif
#endif
if (curbuf != buf)
{
/* We are in another buffer now, don't do the renaming. */
EMSG(_(e_auchangedbuf));
return FAIL;
}
#endif
if (setfname(curbuf, fname, sfname, FALSE) == OK)
curbuf->b_flags |= BF_NOTEDITED;
#ifdef FEAT_AUTOCMD
/* ....and a new named one is created */
apply_autocmds(EVENT_BUFNEW, NULL, NULL, FALSE, curbuf);
if (curbuf->b_p_bl)
apply_autocmds(EVENT_BUFADD, NULL, NULL, FALSE, curbuf);
# ifdef FEAT_EVAL
#ifdef FEAT_EVAL
if (aborting()) /* autocmds may abort script processing */
return FAIL;
# endif
#endif
/* Do filetype detection now if 'filetype' is empty. */
if (*curbuf->b_p_ft == NUL)
@@ -5289,7 +5254,6 @@ set_rw_fname(char_u *fname, char_u *sfname)
(void)do_doautocmd((char_u *)"filetypedetect BufRead", FALSE, NULL);
do_modelines(0);
}
#endif
return OK;
}
@@ -6109,8 +6073,6 @@ make_bom(char_u *buf, char_u *name)
}
#endif
#if defined(FEAT_VIMINFO) || defined(FEAT_BROWSE) || \
defined(FEAT_QUICKFIX) || defined(FEAT_AUTOCMD) || defined(PROTO)
/*
* Try to find a shortname by comparing the fullname with the current
* directory.
@@ -6134,7 +6096,6 @@ shorten_fname1(char_u *full_path)
vim_free(dirname);
return p;
}
#endif
/*
* Try to find a shortname by comparing the fullname with the current
@@ -6789,10 +6750,7 @@ check_timestamps(
}
if (!stuff_empty() || global_busy || !typebuf_typed()
#ifdef FEAT_AUTOCMD
|| autocmd_busy || curbuf_lock > 0 || allbuf_lock > 0
#endif
)
|| autocmd_busy || curbuf_lock > 0 || allbuf_lock > 0)
need_check_timestamps = TRUE; /* check later */
else
{
@@ -6912,14 +6870,14 @@ buf_check_timestamp(
#ifdef FEAT_GUI
int save_mouse_correct = need_mouse_correct;
#endif
#ifdef FEAT_AUTOCMD
static int busy = FALSE;
int n;
#ifdef FEAT_EVAL
char_u *s;
#endif
bufref_T bufref;
set_bufref(&bufref, buf);
#endif
/* If there is no file name, the buffer is not loaded, 'buftype' is
* set, we are in the middle of a save or being called recursively: ignore
@@ -6928,9 +6886,7 @@ buf_check_timestamp(
|| buf->b_ml.ml_mfp == NULL
|| *buf->b_p_bt != NUL
|| buf->b_saving
#ifdef FEAT_AUTOCMD
|| busy
#endif
#ifdef FEAT_NETBEANS_INTG
|| isNetbeansBuffer(buf)
#endif
@@ -6991,17 +6947,16 @@ buf_check_timestamp(
else
reason = "time";
#ifdef FEAT_AUTOCMD
/*
* Only give the warning if there are no FileChangedShell
* autocommands.
* Avoid being called recursively by setting "busy".
*/
busy = TRUE;
# ifdef FEAT_EVAL
#ifdef FEAT_EVAL
set_vim_var_string(VV_FCS_REASON, (char_u *)reason, -1);
set_vim_var_string(VV_FCS_CHOICE, (char_u *)"", -1);
# endif
#endif
++allbuf_lock;
n = apply_autocmds(EVENT_FILECHANGEDSHELL,
buf->b_fname, buf->b_fname, FALSE, buf);
@@ -7011,18 +6966,17 @@ buf_check_timestamp(
{
if (!bufref_valid(&bufref))
EMSG(_("E246: FileChangedShell autocommand deleted buffer"));
# ifdef FEAT_EVAL
#ifdef FEAT_EVAL
s = get_vim_var_str(VV_FCS_CHOICE);
if (STRCMP(s, "reload") == 0 && *reason != 'd')
reload = TRUE;
else if (STRCMP(s, "ask") == 0)
n = FALSE;
else
# endif
#endif
return 2;
}
if (!n)
#endif
{
if (*reason == 'd')
mesg = _("E211: File \"%s\" no longer available");
@@ -7138,9 +7092,7 @@ buf_check_timestamp(
}
else
{
# ifdef FEAT_AUTOCMD
if (!autocmd_busy)
# endif
{
msg_start();
msg_puts_attr(tbuf, HL_ATTR(HLF_E) + MSG_HIST);
@@ -7152,9 +7104,9 @@ buf_check_timestamp(
if (emsg_silent == 0)
{
out_flush();
# ifdef FEAT_GUI
#ifdef FEAT_GUI
if (!focus)
# endif
#endif
/* give the user some time to think about it */
ui_delay(1000L, TRUE);
@@ -7189,12 +7141,10 @@ buf_check_timestamp(
#endif
}
#ifdef FEAT_AUTOCMD
/* Trigger FileChangedShell when the file was changed in any way. */
if (bufref_valid(&bufref) && retval != 0)
(void)apply_autocmds(EVENT_FILECHANGEDSHELLPOST,
buf->b_fname, buf->b_fname, FALSE, buf);
#endif
#ifdef FEAT_GUI
/* restore this in case an autocommand has set it; it would break
* 'mousefocus' */
@@ -7278,14 +7228,12 @@ buf_reload(buf_T *buf, int orig_mode)
if (saved == OK)
{
curbuf->b_flags |= BF_CHECK_RO; /* check for RO again */
#ifdef FEAT_AUTOCMD
keep_filetype = TRUE; /* don't detect 'filetype' */
#endif
if (readfile(buf->b_ffname, buf->b_fname, (linenr_T)0,
(linenr_T)0,
(linenr_T)MAXLNUM, &ea, flags) != OK)
{
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
#if defined(FEAT_EVAL)
if (!aborting())
#endif
EMSG2(_("E321: Could not reload \"%s\""), buf->b_fname);
@@ -7334,9 +7282,7 @@ buf_reload(buf_T *buf, int orig_mode)
curwin->w_cursor = old_cursor;
check_cursor();
update_topline();
#ifdef FEAT_AUTOCMD
keep_filetype = FALSE;
#endif
#ifdef FEAT_FOLDING
{
win_T *wp;
@@ -7710,12 +7656,8 @@ forward_slash(char_u *fname)
/*
* Code for automatic commands.
*
* Only included when "FEAT_AUTOCMD" has been defined.
*/
#if defined(FEAT_AUTOCMD) || defined(PROTO)
/*
* The autocommands are stored in a list for each event.
* Autocommands for the same pattern, that are consecutive, are joined
@@ -7820,6 +7762,7 @@ static struct event_name
{"CursorMovedI", EVENT_CURSORMOVEDI},
{"DirChanged", EVENT_DIRCHANGED},
{"EncodingChanged", EVENT_ENCODINGCHANGED},
{"ExitPre", EVENT_EXITPRE},
{"FileEncoding", EVENT_ENCODINGCHANGED},
{"FileAppendPost", EVENT_FILEAPPENDPOST},
{"FileAppendPre", EVENT_FILEAPPENDPRE},
@@ -7868,6 +7811,7 @@ static struct event_name
{"TabEnter", EVENT_TABENTER},
{"TabLeave", EVENT_TABLEAVE},
{"TermChanged", EVENT_TERMCHANGED},
{"TerminalOpen", EVENT_TERMINALOPEN},
{"TermResponse", EVENT_TERMRESPONSE},
{"TextChanged", EVENT_TEXTCHANGED},
{"TextChangedI", EVENT_TEXTCHANGEDI},
@@ -7952,9 +7896,7 @@ static int au_get_grouparg(char_u **argp);
static int do_autocmd_event(event_T event, char_u *pat, int nested, char_u *cmd, int forceit, int group);
static int apply_autocmds_group(event_T event, char_u *fname, char_u *fname_io, int force, int group, buf_T *buf, exarg_T *eap);
static void auto_next_pat(AutoPatCmd *apc, int stop_at_last);
#if defined(FEAT_AUTOCMD) || defined(FEAT_WILDIGN)
static int match_file_pat(char_u *pattern, regprog_T **prog, char_u *fname, char_u *sfname, char_u *tail, int allow_dirs);
#endif
static event_T last_event;
@@ -9052,7 +8994,6 @@ check_nomodeline(char_u **argp)
* Search for a visible window containing the current buffer. If there isn't
* one then use "aucmd_win".
* Set "curbuf" and "curwin" to match "buf".
* When FEAT_AUTOCMD is not defined another version is used, see below.
*/
void
aucmd_prepbuf(
@@ -9105,7 +9046,9 @@ aucmd_prepbuf(
aco->use_aucmd_win = TRUE;
aucmd_win_used = TRUE;
aucmd_win->w_buffer = buf;
#if defined(FEAT_SYN_HL) || defined(FEAT_SPELL)
aucmd_win->w_s = &buf->b_s;
#endif
++buf->b_nwindows;
win_init_empty(aucmd_win); /* set cursor and topline to safe values */
@@ -9146,7 +9089,6 @@ aucmd_prepbuf(
/*
* Cleanup after executing autocommands for a (hidden) buffer.
* Restore the window as it was (if possible).
* When FEAT_AUTOCMD is not defined another version is used, see below.
*/
void
aucmd_restbuf(
@@ -9444,13 +9386,13 @@ has_textyankpost(void)
static int
apply_autocmds_group(
event_T event,
char_u *fname, /* NULL or empty means use actual file name */
char_u *fname_io, /* fname to use for <afile> on cmdline, NULL means
char_u *fname, /* NULL or empty means use actual file name */
char_u *fname_io, /* fname to use for <afile> on cmdline, NULL means
use fname */
int force, /* when TRUE, ignore autocmd_busy */
int group, /* group ID, or AUGROUP_ALL */
buf_T *buf, /* buffer for <abuf> */
exarg_T *eap) /* command arguments */
int force, /* when TRUE, ignore autocmd_busy */
int group, /* group ID, or AUGROUP_ALL */
buf_T *buf, /* buffer for <abuf> */
exarg_T *eap UNUSED) /* command arguments */
{
char_u *sfname = NULL; /* short file name */
char_u *tail;
@@ -10248,43 +10190,7 @@ theend:
return retval;
}
#else /* FEAT_AUTOCMD */
/*
* Prepare for executing commands for (hidden) buffer "buf".
* This is the non-autocommand version, it simply saves "curbuf" and sets
* "curbuf" and "curwin" to match "buf".
*/
void
aucmd_prepbuf(
aco_save_T *aco, /* structure to save values in */
buf_T *buf) /* new curbuf */
{
aco->save_curbuf = curbuf;
--curbuf->b_nwindows;
curbuf = buf;
curwin->w_buffer = buf;
++curbuf->b_nwindows;
}
/*
* Restore after executing commands for a (hidden) buffer.
* This is the non-autocommand version.
*/
void
aucmd_restbuf(
aco_save_T *aco) /* structure holding saved values */
{
--curbuf->b_nwindows;
curbuf = aco->save_curbuf;
curwin->w_buffer = curbuf;
++curbuf->b_nwindows;
}
#endif /* FEAT_AUTOCMD */
#if defined(FEAT_AUTOCMD) || defined(FEAT_WILDIGN) || defined(PROTO)
/*
* Try matching a filename with a "pattern" ("prog" is NULL), or use the
* precompiled regprog "prog" ("pattern" is NULL). That avoids calling
@@ -10330,7 +10236,6 @@ match_file_pat(
vim_regfree(regmatch.regprog);
return result;
}
#endif
#if defined(FEAT_WILDIGN) || defined(PROTO)
/*
+2 -6
View File
@@ -516,7 +516,6 @@ CancelRedo(void)
}
}
#if defined(FEAT_AUTOCMD) || defined(FEAT_EVAL) || defined(PROTO)
/*
* Save redobuff and old_redobuff to save_redobuff and save_old_redobuff.
* Used before executing autocommands and user functions.
@@ -552,7 +551,6 @@ restoreRedobuff(save_redo_T *save_redo)
free_buff(&old_redobuff);
old_redobuff = save_redo->sr_old_redobuff;
}
#endif
/*
* Append "s" to the redo buffer.
@@ -1854,7 +1852,7 @@ vpeekc(void)
return vgetorpeek(FALSE);
}
#if defined(FEAT_TERMRESPONSE) || defined(PROTO)
#if defined(FEAT_TERMRESPONSE) || defined(FEAT_TERMINAL) || defined(PROTO)
/*
* Like vpeekc(), but don't allow mapping. Do allow checking for terminal
* codes.
@@ -2891,7 +2889,7 @@ vgetorpeek(int advance)
+ typebuf.tb_len] != NUL)
typebuf.tb_noremap[typebuf.tb_off
+ typebuf.tb_len++] = RM_YES;
#ifdef FEAT_MBYTE
#ifdef HAVE_INPUT_METHOD
/* Get IM status right after getting keys, not after the
* timeout for a mapping (focus may be lost by then). */
vgetc_im_active = im_get_status();
@@ -3122,10 +3120,8 @@ fix_input_buffer(char_u *buf, int len)
else
#endif
if (p[0] == NUL || (p[0] == K_SPECIAL
#ifdef FEAT_AUTOCMD
/* timeout may generate K_CURSORHOLD */
&& (i < 2 || p[1] != KS_EXTRA || p[2] != (int)KE_CURSORHOLD)
#endif
#if defined(WIN3264) && !defined(FEAT_GUI)
/* Win32 console passes modifiers */
&& (i < 2 || p[1] != KS_MODIFIER)
+2 -16
View File
@@ -385,7 +385,6 @@ EXTERN guicolor_T cterm_normal_bg_gui_color INIT(= INVALCOLOR);
EXTERN int is_mac_terminal INIT(= FALSE); /* recognized Terminal.app */
#endif
#ifdef FEAT_AUTOCMD
EXTERN int autocmd_busy INIT(= FALSE); /* Is apply_autocmds() busy? */
EXTERN int autocmd_no_enter INIT(= FALSE); /* *Enter autocmds disabled */
EXTERN int autocmd_no_leave INIT(= FALSE); /* *Leave autocmds disabled */
@@ -405,7 +404,6 @@ EXTERN bufref_T au_new_curbuf INIT(= {NULL COMMA 0 COMMA 0});
* Free the buffer/window when autocmd_busy is being set to FALSE. */
EXTERN buf_T *au_pending_free_buf INIT(= NULL);
EXTERN win_T *au_pending_free_win INIT(= NULL);
#endif
#ifdef FEAT_MOUSE
/*
@@ -572,10 +570,8 @@ EXTERN win_T *prevwin INIT(= NULL); /* previous window */
EXTERN win_T *curwin; /* currently active window */
#ifdef FEAT_AUTOCMD
EXTERN win_T *aucmd_win; /* window used in aucmd_prepbuf() */
EXTERN int aucmd_win_used INIT(= FALSE); /* aucmd_win is being used */
#endif
/*
* The window layout is kept in a tree of frames. topframe points to the top
@@ -639,6 +635,7 @@ EXTERN int exiting INIT(= FALSE);
EXTERN int really_exiting INIT(= FALSE);
/* TRUE when we are sure to exit, e.g., after
* a deadly signal */
EXTERN int v_dying INIT(= 0); /* internal value of v:dying */
EXTERN int stdout_isatty INIT(= TRUE); /* is stdout a terminal? */
#if defined(FEAT_AUTOCHDIR)
@@ -664,7 +661,6 @@ EXTERN int textlock INIT(= 0);
/* non-zero when changing text and jumping to
* another window or buffer is not allowed */
#ifdef FEAT_AUTOCMD
EXTERN int curbuf_lock INIT(= 0);
/* non-zero when the current buffer can't be
* changed. Used for FileChangedRO. */
@@ -673,7 +669,6 @@ EXTERN int allbuf_lock INIT(= 0);
* changed, no buffer can be deleted and
* current directory can't be changed.
* Used for SwapExists et al. */
#endif
#ifdef FEAT_EVAL
# define HAVE_SANDBOX
EXTERN int sandbox INIT(= 0);
@@ -733,7 +728,6 @@ EXTERN colnr_T ai_col INIT(= 0);
EXTERN int end_comment_pending INIT(= NUL);
#endif
#ifdef FEAT_SCROLLBIND
/*
* This flag is set after a ":syncbind" to let the check_scrollbind() function
* know that it should not attempt to perform scrollbinding due to the scroll
@@ -741,7 +735,6 @@ EXTERN int end_comment_pending INIT(= NUL);
* undo some of the work done by ":syncbind.") -ralston
*/
EXTERN int did_syncbind INIT(= FALSE);
#endif
#ifdef FEAT_SMARTINDENT
/*
@@ -988,15 +981,12 @@ EXTERN int emsg_silent INIT(= 0); /* don't print error messages */
EXTERN int emsg_noredir INIT(= 0); /* don't redirect error messages */
EXTERN int cmd_silent INIT(= FALSE); /* don't echo the command line */
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) \
|| defined(FEAT_AUTOCMD)
# define HAS_SWAP_EXISTS_ACTION
EXTERN int swap_exists_action INIT(= SEA_NONE);
/* For dialog when swap file already
* exists. */
EXTERN int swap_exists_did_quit INIT(= FALSE);
/* Selected "quit" at the dialog. */
#endif
EXTERN char_u *IObuff; /* sprintf's are done in this buffer,
size is IOSIZE */
@@ -1024,7 +1014,7 @@ EXTERN int stop_insert_mode; /* for ":stopinsert" and 'insertmode' */
EXTERN int KeyTyped; /* TRUE if user typed current char */
EXTERN int KeyStuffed; /* TRUE if current char from stuffbuf */
#ifdef FEAT_MBYTE
#ifdef HAVE_INPUT_METHOD
EXTERN int vgetc_im_active; /* Input Method was active for last
character obtained from vgetc() */
#endif
@@ -1077,7 +1067,6 @@ EXTERN char_u *repeat_cmdline INIT(= NULL); /* command line for "." */
#ifdef FEAT_CMDHIST
EXTERN char_u *new_last_cmdline INIT(= NULL); /* new value for last_cmdline */
#endif
#ifdef FEAT_AUTOCMD
EXTERN char_u *autocmd_fname INIT(= NULL); /* fname for <afile> on cmdline */
EXTERN int autocmd_fname_full; /* autocmd_fname is full path */
EXTERN int autocmd_bufnr INIT(= 0); /* fnum for <abuf> on cmdline */
@@ -1088,7 +1077,6 @@ EXTERN pos_T last_cursormoved /* for CursorMoved event */
= INIT_POS_T(0, 0, 0)
# endif
;
#endif
EXTERN int postponed_split INIT(= 0); /* for CTRL-W CTRL-] command */
EXTERN int postponed_split_flags INIT(= 0); /* args for win_split() */
@@ -1600,9 +1588,7 @@ EXTERN char_u e_notset[] INIT(= N_("E764: Option '%s' is not set"));
EXTERN char_u e_invalidreg[] INIT(= N_("E850: Invalid register name"));
#endif
EXTERN char_u e_dirnotf[] INIT(= N_("E919: Directory not found in '%s': \"%s\""));
#ifdef FEAT_AUTOCMD
EXTERN char_u e_au_recursive[] INIT(= N_("E952: Autocommand caused recursive behavior"));
#endif
#ifdef FEAT_GUI_MAC
EXTERN short disallow_gui INIT(= FALSE);
+14 -35
View File
@@ -132,13 +132,11 @@ gui_start(void)
vim_free(old_term);
#ifdef FEAT_AUTOCMD
/* If the GUI started successfully, trigger the GUIEnter event, otherwise
* the GUIFailed event. */
gui_mch_update();
apply_autocmds(gui.in_use ? EVENT_GUIENTER : EVENT_GUIFAILED,
NULL, NULL, FALSE, curbuf);
#endif
--recursive;
}
@@ -1094,7 +1092,7 @@ gui_update_cursor(
gui_undraw_cursor();
if (gui.row < 0)
return;
#ifdef FEAT_MBYTE
#ifdef HAVE_INPUT_METHOD
if (gui.row != gui.cursor_row || gui.col != gui.cursor_col)
im_set_position(gui.row, gui.col);
#endif
@@ -1152,7 +1150,7 @@ gui_update_cursor(
if (id > 0)
{
cattr = syn_id2colors(id, &cfg, &cbg);
#if defined(FEAT_MBYTE) || defined(FEAT_HANGULIN)
#if defined(HAVE_INPUT_METHOD) || defined(FEAT_HANGULIN)
{
static int iid;
guicolor_T fg, bg;
@@ -2997,7 +2995,7 @@ gui_wait_for_chars_or_timer(long wtime)
gui_wait_for_chars(long wtime, int tb_change_cnt)
{
int retval;
#if defined(ELAPSED_FUNC) && defined(FEAT_AUTOCMD)
#if defined(ELAPSED_FUNC)
ELAPSED_TYPE start_tv;
#endif
@@ -3029,7 +3027,7 @@ gui_wait_for_chars(long wtime, int tb_change_cnt)
return retval;
}
#if defined(ELAPSED_FUNC) && defined(FEAT_AUTOCMD)
#if defined(ELAPSED_FUNC)
ELAPSED_INIT(start_tv);
#endif
@@ -3046,11 +3044,10 @@ gui_wait_for_chars(long wtime, int tb_change_cnt)
*/
if (gui_wait_for_chars_or_timer(p_ut) == OK)
retval = OK;
#ifdef FEAT_AUTOCMD
else if (trigger_cursorhold()
# ifdef ELAPSED_FUNC
#ifdef ELAPSED_FUNC
&& ELAPSED_FUNC(start_tv) >= p_ut
# endif
#endif
&& typebuf.tb_change_cnt == tb_change_cnt)
{
char_u buf[3];
@@ -3063,7 +3060,6 @@ gui_wait_for_chars(long wtime, int tb_change_cnt)
retval = OK;
}
#endif
if (retval == FAIL && typebuf.tb_change_cnt == tb_change_cnt)
{
@@ -4011,9 +4007,7 @@ gui_drag_scrollbar(scrollbar_T *sb, long value, int still_dragging)
int sb_num;
#ifdef USE_ON_FLY_SCROLL
colnr_T old_leftcol = curwin->w_leftcol;
# ifdef FEAT_SCROLLBIND
linenr_T old_topline = curwin->w_topline;
# endif
# ifdef FEAT_DIFF
int old_topfill = curwin->w_topfill;
# endif
@@ -4178,16 +4172,15 @@ gui_drag_scrollbar(scrollbar_T *sb, long value, int still_dragging)
}
#ifdef USE_ON_FLY_SCROLL
# ifdef FEAT_SCROLLBIND
/*
* synchronize other windows, as necessary according to 'scrollbind'
*/
if (curwin->w_p_scb
&& ((sb->wp == NULL && curwin->w_leftcol != old_leftcol)
|| (sb->wp == curwin && (curwin->w_topline != old_topline
# ifdef FEAT_DIFF
# ifdef FEAT_DIFF
|| curwin->w_topfill != old_topfill
# endif
# endif
))))
{
do_check_scrollbind(TRUE);
@@ -4197,7 +4190,6 @@ gui_drag_scrollbar(scrollbar_T *sb, long value, int still_dragging)
updateWindow(wp);
setcursor();
}
# endif
out_flush_cursor(FALSE, TRUE);
#else
add_to_input_buf(bytes, byte_count);
@@ -4527,9 +4519,7 @@ gui_do_scroll(void)
}
if (old_cursor.lnum != wp->w_cursor.lnum)
coladvance(wp->w_curswant);
#ifdef FEAT_SCROLLBIND
wp->w_scbind_pos = wp->w_topline;
#endif
}
/* Make sure wp->w_leftcol and wp->w_skipcol are correct. */
@@ -5192,34 +5182,24 @@ no_console_input(void)
void
gui_update_screen(void)
{
#ifdef FEAT_CONCEAL
# ifdef FEAT_CONCEAL
linenr_T conceal_old_cursor_line = 0;
linenr_T conceal_new_cursor_line = 0;
int conceal_update_lines = FALSE;
#endif
# endif
update_topline();
validate_cursor();
#if defined(FEAT_AUTOCMD) || defined(FEAT_CONCEAL)
/* Trigger CursorMoved if the cursor moved. */
if (!finish_op && (
# ifdef FEAT_AUTOCMD
has_cursormoved()
# endif
# if defined(FEAT_AUTOCMD) && defined(FEAT_CONCEAL)
||
# endif
if (!finish_op && (has_cursormoved()
# ifdef FEAT_CONCEAL
curwin->w_p_cole > 0
|| curwin->w_p_cole > 0
# endif
)
&& !EQUAL_POS(last_cursormoved, curwin->w_cursor))
) && !EQUAL_POS(last_cursormoved, curwin->w_cursor))
{
# ifdef FEAT_AUTOCMD
if (has_cursormoved())
apply_autocmds(EVENT_CURSORMOVED, NULL, NULL, FALSE, curbuf);
# endif
# ifdef FEAT_CONCEAL
if (curwin->w_p_cole > 0)
{
@@ -5230,11 +5210,10 @@ gui_update_screen(void)
# endif
last_cursormoved = curwin->w_cursor;
}
#endif
update_screen(0); /* may need to update the screen */
setcursor();
# if defined(FEAT_CONCEAL)
# ifdef FEAT_CONCEAL
if (conceal_update_lines
&& (conceal_old_cursor_line != conceal_new_cursor_line
|| conceal_cursor_line(curwin)
+2
View File
@@ -210,6 +210,8 @@ typedef long guicolor_T; /* handle for a GUI color; for X11 this should
#define INVALCOLOR (guicolor_T)-11111 /* number for invalid color; on 32 bit
displays there is a tiny chance this is an
actual color */
#define CTERMCOLOR (guicolor_T)-11110 /* only used for cterm.bg_rgb and
cterm.fg_rgb: use cterm color */
#if defined(FEAT_GUI_MACVIM)
typedef void *GuiFont;
+4 -4
View File
@@ -1895,8 +1895,8 @@ gui_mch_show_popupmenu(vimmenu_T *menu)
trigger.window = gtk_widget_get_window(gui.drawarea);
trigger.send_event = FALSE;
trigger.time = gui.event_time;
trigger.x = 0.0;
trigger.y = 0.0;
trigger.x = 0.0;
trigger.y = 0.0;
trigger.axes = NULL;
trigger.state = 0;
trigger.button = 3;
@@ -1983,8 +1983,8 @@ gui_make_popup(char_u *path_name, int mouse_pos)
trigger.window = win;
trigger.send_event = FALSE;
trigger.time = GDK_CURRENT_TIME;
trigger.x = 0.0;
trigger.y = 0.0;
trigger.x = 0.0;
trigger.y = 0.0;
trigger.axes = NULL;
trigger.state = 0;
trigger.button = 0;
+11 -2
View File
@@ -1366,15 +1366,21 @@ key_release_event(GtkWidget *widget UNUSED,
* Selection handlers:
*/
/* Remember when clip_lose_selection was called from here, we must not call
* gtk_selection_owner_set() then. */
static int in_selection_clear_event = FALSE;
static gint
selection_clear_event(GtkWidget *widget UNUSED,
GdkEventSelection *event,
gpointer user_data UNUSED)
{
in_selection_clear_event = TRUE;
if (event->selection == clip_plus.gtk_sel_atom)
clip_lose_selection(&clip_plus);
else
clip_lose_selection(&clip_star);
in_selection_clear_event = FALSE;
return TRUE;
}
@@ -7048,8 +7054,11 @@ clip_mch_request_selection(VimClipboard *cbd)
void
clip_mch_lose_selection(VimClipboard *cbd UNUSED)
{
gtk_selection_owner_set(NULL, cbd->gtk_sel_atom, gui.event_time);
gui_mch_update();
if (!in_selection_clear_event)
{
gtk_selection_owner_set(NULL, cbd->gtk_sel_atom, gui.event_time);
gui_mch_update();
}
}
/*
+1 -1
View File
@@ -6242,7 +6242,7 @@ char_u *FullPathFromFSSpec_save(FSSpec file)
#endif
}
#if (defined(FEAT_MBYTE) || defined(PROTO)) && defined(USE_CARBONKEYHANDLER)
#if (defined(FEAT_MBYTE) && defined(USE_CARBONKEYHANDLER)) || defined(PROTO)
/*
* Input Method Control functions.
*/
+2 -6
View File
@@ -1147,17 +1147,15 @@ cs_find_common(
return FALSE;
}
# ifdef FEAT_AUTOCMD
if (*qfpos != '0'
&& apply_autocmds(EVENT_QUICKFIXCMDPRE, (char_u *)"cscope",
curbuf->b_fname, TRUE, curbuf))
{
# ifdef FEAT_EVAL
# ifdef FEAT_EVAL
if (aborting())
return FALSE;
# endif
}
# endif
}
}
#endif
@@ -1251,10 +1249,8 @@ cs_find_common(
postponed_split = 0;
}
# ifdef FEAT_AUTOCMD
apply_autocmds(EVENT_QUICKFIXCMDPOST, (char_u *)"cscope",
curbuf->b_fname, TRUE, curbuf);
# endif
if (use_ll)
/*
* In the location list window, use the displayed location
+1 -1
View File
@@ -1558,7 +1558,7 @@ Buffers(...)
pat = (char_u *)SvPV(sv, len);
++emsg_off;
b = buflist_findpat(pat, pat+len, FALSE, FALSE, FALSE);
b = buflist_findpat(pat, pat + len, TRUE, FALSE, FALSE);
--emsg_off;
}
+1 -1
View File
@@ -5996,7 +5996,7 @@ convert_dl(PyObject *obj, typval_T *tv,
PyObject *capsule;
char hexBuf[sizeof(void *) * 2 + 3];
sprintf(hexBuf, "%p", obj);
sprintf(hexBuf, "%p", (void *)obj);
# ifdef PY_USE_CAPSULE
capsule = PyDict_GetItemString(lookup_dict, hexBuf);
+1 -1
View File
@@ -74,7 +74,7 @@
#undef HAVE_FCNTL_H /* Clash with os_win32.h */
#define PyBytes_FromString PyString_FromString
#define PyBytes_Check PyString_Check
#define PyBytes_Check PyString_Check
#define PyBytes_AsStringAndSize PyString_AsStringAndSize
#if !defined(FEAT_PYTHON) && defined(PROTO)
+1 -3
View File
@@ -1124,7 +1124,7 @@ GetRegProp(
* This procedure is invoked by the various X event loops throughout Vims when
* a property changes on the communication window. This procedure reads the
* property and enqueues command requests and responses. If immediate is true,
* it runs the event immediatly instead of enqueuing it. Immediate can cause
* it runs the event immediately instead of enqueuing it. Immediate can cause
* unintended behavior and should only be used for code that blocks for a
* response.
*/
@@ -1481,14 +1481,12 @@ server_parse_message(
ga_concat(&(r->strings), str);
ga_append(&(r->strings), NUL);
}
#ifdef FEAT_AUTOCMD
{
char_u winstr[30];
sprintf((char *)winstr, "0x%x", (unsigned int)win);
apply_autocmds(EVENT_REMOTEREPLY, winstr, str, TRUE, curbuf);
}
#endif
vim_free(tofree);
}
else
+8 -10
View File
@@ -62,20 +62,18 @@
//#define USE_DYNFILEID
#ifdef USE_DYNFILEID
typedef BOOL (WINAPI *pfnGetFileInformationByHandleEx)(
HANDLE hFile,
FILE_INFO_BY_HANDLE_CLASS FileInformationClass,
LPVOID lpFileInformation,
DWORD dwBufferSize
);
HANDLE hFile,
FILE_INFO_BY_HANDLE_CLASS FileInformationClass,
LPVOID lpFileInformation,
DWORD dwBufferSize);
static pfnGetFileInformationByHandleEx pGetFileInformationByHandleEx = NULL;
# ifndef USE_FILEEXTD
static BOOL WINAPI stub_GetFileInformationByHandleEx(
HANDLE hFile,
FILE_INFO_BY_HANDLE_CLASS FileInformationClass,
LPVOID lpFileInformation,
DWORD dwBufferSize
)
HANDLE hFile,
FILE_INFO_BY_HANDLE_CLASS FileInformationClass,
LPVOID lpFileInformation,
DWORD dwBufferSize)
{
return FALSE;
}
+13 -1
View File
@@ -621,7 +621,9 @@ json_decode_item(js_read_T *reader, typval_T *res, int options)
if (top_item != NULL && top_item->jd_type == JSON_OBJECT_KEY
&& (options & JSON_JS)
&& reader->js_buf[reader->js_used] != '"'
&& reader->js_buf[reader->js_used] != '\'')
&& reader->js_buf[reader->js_used] != '\''
&& reader->js_buf[reader->js_used] != '['
&& reader->js_buf[reader->js_used] != '{')
{
char_u *key;
@@ -642,6 +644,11 @@ json_decode_item(js_read_T *reader, typval_T *res, int options)
switch (*p)
{
case '[': /* start of array */
if (top_item && top_item->jd_type == JSON_OBJECT_KEY)
{
retval = FAIL;
break;
}
if (ga_grow(&stack, 1) == FAIL)
{
retval = FAIL;
@@ -668,6 +675,11 @@ json_decode_item(js_read_T *reader, typval_T *res, int options)
continue;
case '{': /* start of object */
if (top_item && top_item->jd_type == JSON_OBJECT_KEY)
{
retval = FAIL;
break;
}
if (ga_grow(&stack, 1) == FAIL)
{
retval = FAIL;
+2 -2
View File
@@ -162,7 +162,7 @@ test_fill_called_on_find_end(void)
reader.js_fill = fill_from_cookie;
reader.js_used = 0;
reader.js_buf = (char_u *)" [ \"a\" , 123 ";
reader.js_cookie = " [ \"a\" , 123 ] ";
reader.js_cookie = " [ \"a\" , 123 ] ";
assert(json_find_end(&reader, 0) == OK);
reader.js_buf = (char_u *)" [ \"a\" , ";
assert(json_find_end(&reader, 0) == OK);
@@ -186,7 +186,7 @@ test_fill_called_on_string(void)
reader.js_used = 0;
reader.js_buf = (char_u *)" \"foo";
reader.js_end = reader.js_buf + STRLEN(reader.js_buf);
reader.js_cookie = " \"foobar\" ";
reader.js_cookie = " \"foobar\" ";
assert(json_decode_string(&reader, NULL, '"') == OK);
}
#endif
+14
View File
@@ -259,6 +259,19 @@ typedef struct {
int (*setlineinfo)(int row, const VTermLineInfo *newinfo, const VTermLineInfo *oldinfo, void *user);
} VTermStateCallbacks;
typedef struct {
VTermPos pos;
int buttons;
#define MOUSE_BUTTON_LEFT 0x01
#define MOUSE_BUTTON_MIDDLE 0x02
#define MOUSE_BUTTON_RIGHT 0x04
int flags;
#define MOUSE_WANT_CLICK 0x01
#define MOUSE_WANT_DRAG 0x02
#define MOUSE_WANT_MOVE 0x04
/* useful to add protocol? */
} VTermMouseState;
VTermState *vterm_obtain_state(VTerm *vt);
void vterm_state_set_callbacks(VTermState *state, const VTermStateCallbacks *callbacks, void *user);
@@ -272,6 +285,7 @@ void *vterm_state_get_unrecognised_fbdata(VTermState *state);
void vterm_state_reset(VTermState *state, int hard);
void vterm_state_get_cursorpos(const VTermState *state, VTermPos *cursorpos);
void vterm_state_get_mousestate(const VTermState *state, VTermMouseState *mousestate);
void vterm_state_get_default_colors(const VTermState *state, VTermColor *default_fg, VTermColor *default_bg);
void vterm_state_get_palette_color(const VTermState *state, int index, VTermColor *col);
void vterm_state_set_default_colors(VTermState *state, const VTermColor *default_fg, const VTermColor *default_bg);
+1
View File
@@ -8,6 +8,7 @@ typedef enum {
VTERM_MOD_CTRL = 0x04
} VTermModifier;
/* The order here must match keycodes[] in src/keyboard.c! */
typedef enum {
VTERM_KEY_NONE,
+24
View File
@@ -1506,6 +1506,22 @@ static int on_osc(const char *command, size_t cmdlen, void *user)
settermprop_string(state, VTERM_PROP_TITLE, command + 2, cmdlen - 2);
return 1;
}
else if(strneq(command, "10;", 3)) {
/* request foreground color: <Esc>]10;?<0x07> */
int red = state->default_fg.red;
int blue = state->default_fg.blue;
int green = state->default_fg.green;
vterm_push_output_sprintf_ctrl(state->vt, C1_OSC, "10;rgb:%02x%02x/%02x%02x/%02x%02x\x07", red, red, green, green, blue, blue);
return 1;
}
else if(strneq(command, "11;", 3)) {
/* request background color: <Esc>]11;?<0x07> */
int red = state->default_bg.red;
int blue = state->default_bg.blue;
int green = state->default_bg.green;
vterm_push_output_sprintf_ctrl(state->vt, C1_OSC, "11;rgb:%02x%02x/%02x%02x/%02x%02x\x07", red, red, green, green, blue, blue);
return 1;
}
else if(strneq(command, "12;", 3)) {
settermprop_string(state, VTERM_PROP_CURSORCOLOR, command + 3, cmdlen - 3);
return 1;
@@ -1777,6 +1793,14 @@ void vterm_state_get_cursorpos(const VTermState *state, VTermPos *cursorpos)
*cursorpos = state->pos;
}
void vterm_state_get_mousestate(const VTermState *state, VTermMouseState *mousestate)
{
mousestate->pos.col = state->mouse_col;
mousestate->pos.row = state->mouse_row;
mousestate->buttons = state->mouse_buttons;
mousestate->flags = state->mouse_flags;
}
void vterm_state_set_callbacks(VTermState *state, const VTermStateCallbacks *callbacks, void *user)
{
if(callbacks) {
+1 -1
View File
@@ -56,7 +56,7 @@ VTerm *vterm_new_with_allocator(int rows, int cols, VTermAllocatorFunctions *fun
vt->strbuffer_cur = 0;
vt->strbuffer = vterm_allocator_malloc(vt, vt->strbuffer_len);
vt->outbuffer_len = 64;
vt->outbuffer_len = 200;
vt->outbuffer_cur = 0;
vt->outbuffer = vterm_allocator_malloc(vt, vt->outbuffer_len);
+3 -5
View File
@@ -5,7 +5,7 @@
#include <stdarg.h>
#if defined(__GNUC__)
#if defined(__GNUC__) && !defined(__MINGW32__)
# define INTERNAL __attribute__((visibility("internal")))
# define UNUSED __attribute__((unused))
#else
@@ -95,9 +95,6 @@ struct VTermState
int mouse_col, mouse_row;
int mouse_buttons;
int mouse_flags;
#define MOUSE_WANT_CLICK 0x01
#define MOUSE_WANT_DRAG 0x02
#define MOUSE_WANT_MOVE 0x04
enum { MOUSE_X10, MOUSE_UTF8, MOUSE_SGR, MOUSE_RXVT } mouse_protocol;
@@ -222,7 +219,8 @@ enum {
C1_SS3 = 0x8f,
C1_DCS = 0x90,
C1_CSI = 0x9b,
C1_ST = 0x9c
C1_ST = 0x9c,
C1_OSC = 0x9d
};
void vterm_state_push_output_sprintf_CSI(VTermState *vts, const char *format, ...);
+1 -13
View File
@@ -294,19 +294,7 @@
# define DO_AUTOCHDIR
#endif
#if defined(FEAT_SCROLLBIND) && defined(FEAT_CURSORBIND)
# define RESET_BINDING(wp) (wp)->w_p_scb = FALSE; (wp)->w_p_crb = FALSE
#else
# if defined(FEAT_SCROLLBIND)
# define RESET_BINDING(wp) (wp)->w_p_scb = FALSE
# else
# if defined(FEAT_CURSORBIND)
# define RESET_BINDING(wp) (wp)->w_p_crb = FALSE
# else
# define RESET_BINDING(wp)
# endif
# endif
#endif
#define RESET_BINDING(wp) (wp)->w_p_scb = FALSE; (wp)->w_p_crb = FALSE
#ifdef FEAT_DIFF
# define PLINES_NOFILL(x) plines_nofill(x)
+36 -63
View File
@@ -111,7 +111,7 @@ main
# endif
(int argc, char **argv)
{
#ifdef STARTUPTIME
#if defined(STARTUPTIME) || defined(CLEAN_RUNTIMEPATH)
int i;
#endif
@@ -165,18 +165,25 @@ main
#ifdef STARTUPTIME
/* Need to find "--startuptime" before actually parsing arguments. */
for (i = 1; i < argc; ++i)
{
if (STRICMP(argv[i], "--startuptime") == 0 && i + 1 < argc)
for (i = 1; i < argc - 1; ++i)
if (STRICMP(argv[i], "--startuptime") == 0)
{
time_fd = mch_fopen(argv[i + 1], "a");
TIME_MSG("--- VIM STARTING ---");
break;
}
}
#endif
starttime = time(NULL);
#ifdef CLEAN_RUNTIMEPATH
/* Need to find "--clean" before actually parsing arguments. */
for (i = 1; i < argc; ++i)
if (STRICMP(argv[i], "--clean") == 0)
{
params.clean = TRUE;
break;
}
#endif
common_init(&params);
#ifdef FEAT_CLIENTSERVER
@@ -791,10 +798,8 @@ vim_main2(void)
if (exmode_active)
curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count;
#ifdef FEAT_AUTOCMD
apply_autocmds(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf);
TIME_MSG("BufEnter autocommands");
#endif
setpcmark();
#ifdef FEAT_QUICKFIX
@@ -886,10 +891,8 @@ vim_main2(void)
#ifdef FEAT_EVAL
set_vim_var_nr(VV_VIM_DID_ENTER, 1L);
#endif
#ifdef FEAT_AUTOCMD
apply_autocmds(EVENT_VIMENTER, NULL, NULL, FALSE, curbuf);
TIME_MSG("VimEnter autocommands");
#endif
#if defined(FEAT_EVAL) && defined(FEAT_CLIPBOARD)
/* Adjust default register name for "unnamed" in 'clipboard'. Can only be
@@ -904,7 +907,7 @@ vim_main2(void)
}
#endif
#if defined(FEAT_DIFF) && defined(FEAT_SCROLLBIND)
#if defined(FEAT_DIFF)
/* When a startup script or session file setup for diff'ing and
* scrollbind, sync the scrollbind now. */
if (curwin->w_p_diff && curwin->w_p_scb)
@@ -1087,7 +1090,7 @@ common_init(mparm_T *paramp)
* First find out the home directory, needed to expand "~" in options.
*/
init_homedir(); /* find real value of $HOME */
set_init_1();
set_init_1(paramp->clean);
TIME_MSG("inits 1");
#ifdef FEAT_EVAL
@@ -1224,50 +1227,33 @@ main_loop(
skip_redraw = FALSE;
else if (do_redraw || stuff_empty())
{
# ifdef FEAT_GUI
#ifdef FEAT_GUI
/* If ui_breakcheck() was used a resize may have been postponed. */
gui_may_resize_shell();
# endif
#if defined(FEAT_AUTOCMD) || defined(FEAT_CONCEAL)
#endif
/* Trigger CursorMoved if the cursor moved. */
if (!finish_op && (
# ifdef FEAT_AUTOCMD
has_cursormoved()
# endif
# if defined(FEAT_AUTOCMD) && defined(FEAT_CONCEAL)
||
# endif
# ifdef FEAT_CONCEAL
curwin->w_p_cole > 0
# endif
#ifdef FEAT_CONCEAL
|| curwin->w_p_cole > 0
#endif
)
# ifdef FEAT_AUTOCMD
&& !EQUAL_POS(last_cursormoved, curwin->w_cursor)
# endif
)
&& !EQUAL_POS(last_cursormoved, curwin->w_cursor))
{
# ifdef FEAT_AUTOCMD
if (has_cursormoved())
apply_autocmds(EVENT_CURSORMOVED, NULL, NULL,
FALSE, curbuf);
# endif
# ifdef FEAT_CONCEAL
if (curwin->w_p_cole > 0)
{
# ifdef FEAT_AUTOCMD
conceal_old_cursor_line = last_cursormoved.lnum;
# endif
conceal_new_cursor_line = curwin->w_cursor.lnum;
conceal_update_lines = TRUE;
}
# endif
# ifdef FEAT_AUTOCMD
last_cursormoved = curwin->w_cursor;
# endif
}
#endif
#ifdef FEAT_AUTOCMD
/* Trigger TextChanged if b:changedtick differs. */
if (!finish_op && has_textchanged()
&& curbuf->b_last_changedtick != CHANGEDTICK(curbuf))
@@ -1275,9 +1261,8 @@ main_loop(
apply_autocmds(EVENT_TEXTCHANGED, NULL, NULL, FALSE, curbuf);
curbuf->b_last_changedtick = CHANGEDTICK(curbuf);
}
#endif
#if defined(FEAT_DIFF) && defined(FEAT_SCROLLBIND)
#if defined(FEAT_DIFF)
/* Scroll-binding for diff mode may have been postponed until
* here. Avoids doing it for every change. */
if (diff_need_scrollbind)
@@ -1354,7 +1339,7 @@ main_loop(
may_clear_sb_text(); /* clear scroll-back text on next msg */
showruler(FALSE);
# if defined(FEAT_CONCEAL)
#if defined(FEAT_CONCEAL)
if (conceal_update_lines
&& (conceal_old_cursor_line != conceal_new_cursor_line
|| conceal_cursor_line(curwin)
@@ -1369,7 +1354,7 @@ main_loop(
mch_enable_flush();
curwin->w_valid &= ~VALID_CROW;
}
# endif
#endif
setcursor();
cursor_on();
@@ -1473,13 +1458,15 @@ getout_preserve_modified(int exitval)
void
getout(int exitval)
{
#ifdef FEAT_AUTOCMD
tabpage_T *tp;
tabpage_T *next_tp;
buf_T *buf;
win_T *wp;
tabpage_T *tp, *next_tp;
#endif
exiting = TRUE;
#if defined(FEAT_JOB_CHANNEL)
ch_log(NULL, "Exiting...");
#endif
/* When running in Ex mode an error causes us to exit with a non-zero exit
* code. POSIX requires this, although it's not 100% clear from the
@@ -1502,8 +1489,7 @@ getout(int exitval)
msg_didany = FALSE;
#endif
#ifdef FEAT_AUTOCMD
if (get_vim_var_nr(VV_DYING) <= 1)
if (v_dying <= 1)
{
/* Trigger BufWinLeave for all windows, but only once per buffer. */
for (tp = first_tabpage; tp != NULL; tp = next_tp)
@@ -1547,7 +1533,6 @@ getout(int exitval)
}
apply_autocmds(EVENT_VIMLEAVEPRE, NULL, NULL, FALSE, curbuf);
}
#endif
#ifdef FEAT_VIMINFO
if (*p_viminfo != NUL)
@@ -1555,10 +1540,8 @@ getout(int exitval)
write_viminfo(NULL, FALSE);
#endif
#ifdef FEAT_AUTOCMD
if (get_vim_var_nr(VV_DYING) <= 1)
if (v_dying <= 1)
apply_autocmds(EVENT_VIMLEAVE, NULL, NULL, FALSE, curbuf);
#endif
#ifdef FEAT_PROFILE
profile_dump();
@@ -1575,13 +1558,11 @@ getout(int exitval)
wait_return(FALSE);
}
#ifdef FEAT_AUTOCMD
/* Position the cursor again, the autocommands may have moved it */
# ifdef FEAT_GUI
#ifdef FEAT_GUI
if (!gui.in_use)
# endif
windgoto((int)Rows - 1, 0);
#endif
windgoto((int)Rows - 1, 0);
#ifdef FEAT_JOB_CHANNEL
job_stop_on_exit();
@@ -1981,6 +1962,10 @@ command_line_scan(mparm_T *parmp)
else if (STRNICMP(argv[0] + argv_idx, "clean", 5) == 0)
{
parmp->use_vimrc = (char_u *)"DEFAULTS";
#ifdef FEAT_GUI
use_gvimrc = (char_u *)"NONE";
#endif
parmp->clean = TRUE;
set_option_value((char_u *)"vif", 0L, (char_u *)"NONE", 0);
}
else if (STRNICMP(argv[0] + argv_idx, "literal", 7) == 0)
@@ -2777,13 +2762,11 @@ create_windows(mparm_T *parmp UNUSED)
* Commands in the .vimrc might have loaded a file or split the window.
* Watch out for autocommands that delete a window.
*/
#ifdef FEAT_AUTOCMD
/*
* Don't execute Win/Buf Enter/Leave autocommands here
*/
++autocmd_no_enter;
++autocmd_no_leave;
#endif
dorewind = TRUE;
while (done++ < 1000)
{
@@ -2843,9 +2826,7 @@ create_windows(mparm_T *parmp UNUSED)
else
handle_swap_exists(NULL);
#endif
#ifdef FEAT_AUTOCMD
dorewind = TRUE; /* start again */
#endif
}
ui_breakcheck();
if (got_int)
@@ -2859,10 +2840,8 @@ create_windows(mparm_T *parmp UNUSED)
else
curwin = firstwin;
curbuf = curwin->w_buffer;
#ifdef FEAT_AUTOCMD
--autocmd_no_enter;
--autocmd_no_leave;
#endif
}
}
@@ -2880,13 +2859,11 @@ edit_buffers(
int advance = TRUE;
win_T *win;
# ifdef FEAT_AUTOCMD
/*
* Don't execute Win/Buf Enter/Leave autocommands here
*/
++autocmd_no_enter;
++autocmd_no_leave;
# endif
/* When w_arg_idx is -1 remove the window (see create_windows()). */
if (curwin->w_arg_idx == -1)
@@ -2967,9 +2944,7 @@ edit_buffers(
if (parmp->window_layout == WIN_TABS)
goto_tabpage(1);
# ifdef FEAT_AUTOCMD
--autocmd_no_enter;
# endif
/* make the first window the current window */
win = firstwin;
@@ -2987,9 +2962,7 @@ edit_buffers(
#endif
win_enter(win, FALSE);
#ifdef FEAT_AUTOCMD
--autocmd_no_leave;
#endif
TIME_MSG("editing files in windows");
if (parmp->window_count > 1 && parmp->window_layout != WIN_TABS)
win_equal(curwin, FALSE, 'b'); /* adjust heights */
+7 -13
View File
@@ -799,11 +799,9 @@ codepage_invalid:
fix_arg_enc();
#endif
#ifdef FEAT_AUTOCMD
/* Fire an autocommand to let people do custom font setup. This must be
* after Vim has been setup for the new encoding. */
apply_autocmds(EVENT_ENCODINGCHANGED, NULL, (char_u *)"", FALSE, curbuf);
#endif
#ifdef FEAT_SPELL
/* Need to reload spell dictionaries */
@@ -2260,7 +2258,6 @@ utf_char2len(int c)
/*
* Convert Unicode character "c" to UTF-8 string in "buf[]".
* Returns the number of bytes.
* This does not include composing characters.
*/
int
utf_char2bytes(int c, char_u *buf)
@@ -4793,7 +4790,8 @@ iconv_end(void)
# define USE_IMSTATUSFUNC (*p_imsf != NUL)
#endif
#if defined(FEAT_EVAL) && defined(FEAT_MBYTE)
#if defined(FEAT_EVAL) && defined(FEAT_MBYTE) \
&& (defined(FEAT_XIM) || defined(IME_WITHOUT_XIM))
# ifdef FEAT_GUI_MACVIM
void
# else
@@ -4820,11 +4818,7 @@ call_imstatusfunc(void)
int is_active;
/* FIXME: Don't execute user function in unsafe situation. */
if (exiting
# ifdef FEAT_AUTOCMD
|| is_autocmd_blocked()
# endif
)
if (exiting || is_autocmd_blocked())
return FALSE;
/* FIXME: :py print 'xxx' is shown duplicate result.
* Use silent to avoid it. */
@@ -5778,11 +5772,11 @@ im_synthesize_keypress(unsigned int keyval, unsigned int state)
xim_reset(void)
{
# ifndef FEAT_GUI_MACVIM
#ifdef FEAT_EVAL
# ifdef FEAT_EVAL
if (USE_IMACTIVATEFUNC)
call_imactivatefunc(im_is_active);
else
#endif
# endif
if (xic != NULL)
{
gtk_im_context_reset(xic);
@@ -6567,11 +6561,11 @@ xim_get_status_area_height(void)
#else /* !defined(FEAT_XIM) */
# if !defined(FEAT_GUI_W32) || !(defined(FEAT_MBYTE_IME) || defined(GLOBAL_IME))
# ifdef IME_WITHOUT_XIM
static int im_was_set_active = FALSE;
int
im_get_status()
im_get_status(void)
{
# if defined(FEAT_MBYTE) && defined(FEAT_EVAL)
if (USE_IMSTATUSFUNC)
+2 -4
View File
@@ -1732,13 +1732,11 @@ theend:
}
if (serious_error && called_from_main)
ml_close(curbuf, TRUE);
#ifdef FEAT_AUTOCMD
else
{
apply_autocmds(EVENT_BUFREADPOST, NULL, curbuf->b_fname, FALSE, curbuf);
apply_autocmds(EVENT_BUFWINENTER, NULL, curbuf->b_fname, FALSE, curbuf);
}
#endif
return;
}
@@ -4071,7 +4069,7 @@ attention_message(
--no_wait_return;
}
#ifdef FEAT_AUTOCMD
#if defined(FEAT_EVAL)
static int do_swapexists(buf_T *buf, char_u *fname);
/*
@@ -4450,7 +4448,7 @@ findswapname(
#if (defined(UNIX) || defined(VMS)) && (defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG))
process_still_running = FALSE;
#endif
#ifdef FEAT_AUTOCMD
#if defined(FEAT_EVAL)
/*
* If there is an SwapExists autocommand and we can handle
* the response, trigger it. It may return 0 to ask the
+77 -64
View File
@@ -34,10 +34,6 @@ static int menu_namecmp(char_u *name, char_u *mname);
static int get_menu_cmd_modes(char_u *, int, int *, int *);
static char_u *popup_mode_name(char_u *name, int idx);
static char_u *menu_text(char_u *text, int *mnemonic, char_u **actext);
#ifdef FEAT_GUI
static int get_menu_mode(void);
static void gui_update_menus_recurse(vimmenu_T *, int);
#endif
#if defined(FEAT_GUI_W32) && defined(FEAT_TEAROFF)
static void gui_create_tearoffs_recurse(vimmenu_T *menu, const char_u *pname, int *pri_tab, int pri_idx);
@@ -1877,7 +1873,7 @@ menu_is_tearoff(char_u *name UNUSED)
}
#endif
#ifdef FEAT_GUI
#if defined(FEAT_GUI) || defined(FEAT_TERM_POPUP_MENU) || defined(PROTO)
static int
get_menu_mode(void)
@@ -1901,6 +1897,68 @@ get_menu_mode(void)
return MENU_INDEX_INVALID;
}
int
get_menu_mode_flag(void)
{
int mode = get_menu_mode();
if (mode == MENU_INDEX_INVALID)
return 0;
return 1 << mode;
}
/*
* Display the Special "PopUp" menu as a pop-up at the current mouse
* position. The "PopUpn" menu is for Normal mode, "PopUpi" for Insert mode,
* etc.
*/
void
show_popupmenu(void)
{
vimmenu_T *menu;
int mode;
mode = get_menu_mode();
if (mode == MENU_INDEX_INVALID)
return;
mode = menu_mode_chars[mode];
{
char_u ename[2];
ename[0] = mode;
ename[1] = NUL;
apply_autocmds(EVENT_MENUPOPUP, ename, NULL, FALSE, curbuf);
}
for (menu = root_menu; menu != NULL; menu = menu->next)
if (STRNCMP("PopUp", menu->name, 5) == 0 && menu->name[5] == mode)
break;
/* Only show a popup when it is defined and has entries */
if (menu != NULL && menu->children != NULL)
{
# if defined(FEAT_GUI)
if (gui.in_use)
{
/* Update the menus now, in case the MenuPopup autocommand did
* anything. */
gui_update_menus(0);
gui_mch_show_popupmenu(menu);
}
# endif
# if defined(FEAT_GUI) && defined(FEAT_TERM_POPUP_MENU)
else
# endif
# if defined(FEAT_TERM_POPUP_MENU)
pum_show_popupmenu(menu);
# endif
}
}
#endif
#if defined(FEAT_GUI) || defined(PROTO)
/*
* Check that a pointer appears in the menu tree. Used to protect from using
* a menu that was deleted after it was selected but before the event was
@@ -1961,28 +2019,28 @@ gui_update_menus_recurse(vimmenu_T *menu, int mode)
while (menu)
{
if ((menu->modes & menu->enabled & mode)
#if defined(FEAT_GUI_W32) && defined(FEAT_TEAROFF)
# if defined(FEAT_GUI_W32) && defined(FEAT_TEAROFF)
|| menu_is_tearoff(menu->dname)
#endif
# endif
)
grey = FALSE;
else
grey = TRUE;
#ifdef FEAT_GUI_ATHENA
# ifdef FEAT_GUI_ATHENA
/* Hiding menus doesn't work for Athena, it can cause a crash. */
gui_mch_menu_grey(menu, grey);
#else
# else
/* Never hide a toplevel menu, it may make the menubar resize or
* disappear. Same problem for ToolBar items. */
if (vim_strchr(p_go, GO_GREY) != NULL || menu->parent == NULL
# ifdef FEAT_TOOLBAR
# ifdef FEAT_TOOLBAR
|| menu_is_toolbar(menu->parent->name)
# endif
# endif
)
gui_mch_menu_grey(menu, grey);
else
gui_mch_menu_hidden(menu, grey);
#endif
# endif
gui_update_menus_recurse(menu->children, mode);
menu = menu->next;
}
@@ -2002,13 +2060,7 @@ gui_update_menus(int modes)
if (modes != 0x0)
mode = modes;
else
{
mode = get_menu_mode();
if (mode == MENU_INDEX_INVALID)
mode = 0;
else
mode = (1 << mode);
}
mode = get_menu_mode_flag();
if (force_menu_update || mode != prev_mode)
{
@@ -2016,15 +2068,15 @@ gui_update_menus(int modes)
gui_mch_draw_menubar();
prev_mode = mode;
force_menu_update = FALSE;
#ifdef FEAT_GUI_W32
# ifdef FEAT_GUI_W32
/* This can leave a tearoff as active window - make sure we
* have the focus <negri>*/
gui_mch_activate_window();
#endif
# endif
}
}
#if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_MOTIF) \
# if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_MOTIF) \
|| defined(FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON) || defined(PROTO)
/*
* Check if a key is used as a mnemonic for a toplevel menu.
@@ -2043,47 +2095,7 @@ gui_is_menu_shortcut(int key)
return TRUE;
return FALSE;
}
#endif
/*
* Display the Special "PopUp" menu as a pop-up at the current mouse
* position. The "PopUpn" menu is for Normal mode, "PopUpi" for Insert mode,
* etc.
*/
void
gui_show_popupmenu(void)
{
vimmenu_T *menu;
int mode;
mode = get_menu_mode();
if (mode == MENU_INDEX_INVALID)
return;
mode = menu_mode_chars[mode];
#ifdef FEAT_AUTOCMD
{
char_u ename[2];
ename[0] = mode;
ename[1] = NUL;
apply_autocmds(EVENT_MENUPOPUP, ename, NULL, FALSE, curbuf);
}
#endif
for (menu = root_menu; menu != NULL; menu = menu->next)
if (STRNCMP("PopUp", menu->name, 5) == 0 && menu->name[5] == mode)
break;
/* Only show a popup when it is defined and has entries */
if (menu != NULL && menu->children != NULL)
{
/* Update the menus now, in case the MenuPopup autocommand did
* anything. */
gui_update_menus(0);
gui_mch_show_popupmenu(menu);
}
}
# endif
#endif /* FEAT_GUI */
#if (defined(FEAT_GUI_W32) && defined(FEAT_TEAROFF)) || defined(PROTO)
@@ -2244,7 +2256,7 @@ gui_destroy_tearoffs_recurse(vimmenu_T *menu)
* Execute "menu". Use by ":emenu" and the window toolbar.
* "eap" is NULL for the window toolbar.
*/
static void
void
execute_menu(exarg_T *eap, vimmenu_T *menu)
{
char_u *mode;
@@ -2477,6 +2489,7 @@ winbar_click(win_T *wp, int col)
}
#if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_GTK) \
|| defined(FEAT_TERM_POPUP_MENU) \
|| defined(FEAT_GUI_MACVIM) \
|| defined(FEAT_BEVAL_TIP) || defined(PROTO)
/*
+15 -6
View File
@@ -3183,12 +3183,10 @@ changed_common(
if (must_redraw < VALID)
must_redraw = VALID;
#ifdef FEAT_AUTOCMD
/* when the cursor line is changed always trigger CursorMoved */
if (lnum <= curwin->w_cursor.lnum
&& lnume + (xtra < 0 ? -xtra : xtra) > curwin->w_cursor.lnum)
last_cursormoved.lnum = 0;
#endif
}
/*
@@ -3252,18 +3250,14 @@ change_warning(
if (curbuf->b_did_warn == FALSE
&& curbufIsChanged() == 0
#ifdef FEAT_AUTOCMD
&& !autocmd_busy
#endif
&& curbuf->b_p_ro)
{
#ifdef FEAT_AUTOCMD
++curbuf_lock;
apply_autocmds(EVENT_FILECHANGEDRO, NULL, NULL, FALSE, curbuf);
--curbuf_lock;
if (!curbuf->b_p_ro)
return;
#endif
/*
* Do what msg() does, but with a column offset if the warning should
* be after the mode message.
@@ -3720,7 +3714,22 @@ vim_beep(
&& !(gui.in_use && gui.starting)
#endif
)
{
out_str_cf(T_VB);
#ifdef FEAT_VTP
/* No restore color information, refresh the screen. */
if (has_vtp_working() != 0
# ifdef FEAT_TERMGUICOLORS
&& p_tgc
# endif
)
{
redraw_later(CLEAR);
update_screen(0);
redrawcmd();
}
#endif
}
else
out_char(BELL);
#ifdef ELAPSED_FUNC
+41 -18
View File
@@ -1099,10 +1099,8 @@ free_all_mem(void)
return;
entered_free_all_mem = TRUE;
# ifdef FEAT_AUTOCMD
/* Don't want to trigger autocommands from here on. */
block_autocmds();
# endif
/* Close all tabs and windows. Reset 'equalalways' to avoid redraws. */
p_ea = FALSE;
@@ -1157,9 +1155,7 @@ free_all_mem(void)
# endif
/* Obviously named calls. */
# if defined(FEAT_AUTOCMD)
free_all_autocmds();
# endif
clear_termcodes();
free_all_marks();
alist_clear(&global_alist);
@@ -3409,11 +3405,9 @@ vim_chdirfile(char_u *fname, char *trigger_autocmd UNUSED)
vim_strncpy(dir, fname, MAXPATHL - 1);
*gettail_sep(dir) = NUL;
res = mch_chdir((char *)dir) == 0 ? OK : FAIL;
#ifdef FEAT_AUTOCMD
if (res == OK && trigger_autocmd != NULL)
apply_autocmds(EVENT_DIRCHANGED, (char_u *)trigger_autocmd,
dir, FALSE, curbuf);
#endif
return res;
}
#endif
@@ -6160,59 +6154,83 @@ filewritable(char_u *fname)
#if defined(FEAT_SPELL) || defined(FEAT_PERSISTENT_UNDO) || defined(PROTO)
/*
* Read 2 bytes from "fd" and turn them into an int, MSB first.
* Returns -1 when encountering EOF.
*/
int
get2c(FILE *fd)
{
int n;
int c, n;
n = getc(fd);
n = (n << 8) + getc(fd);
return n;
if (n == EOF) return -1;
c = getc(fd);
if (c == EOF) return -1;
return (n << 8) + c;
}
/*
* Read 3 bytes from "fd" and turn them into an int, MSB first.
* Returns -1 when encountering EOF.
*/
int
get3c(FILE *fd)
{
int n;
int c, n;
n = getc(fd);
n = (n << 8) + getc(fd);
n = (n << 8) + getc(fd);
return n;
if (n == EOF) return -1;
c = getc(fd);
if (c == EOF) return -1;
n = (n << 8) + c;
c = getc(fd);
if (c == EOF) return -1;
return (n << 8) + c;
}
/*
* Read 4 bytes from "fd" and turn them into an int, MSB first.
* Returns -1 when encountering EOF.
*/
int
get4c(FILE *fd)
{
int c;
/* Use unsigned rather than int otherwise result is undefined
* when left-shift sets the MSB. */
unsigned n;
n = (unsigned)getc(fd);
n = (n << 8) + (unsigned)getc(fd);
n = (n << 8) + (unsigned)getc(fd);
n = (n << 8) + (unsigned)getc(fd);
c = getc(fd);
if (c == EOF) return -1;
n = (unsigned)c;
c = getc(fd);
if (c == EOF) return -1;
n = (n << 8) + (unsigned)c;
c = getc(fd);
if (c == EOF) return -1;
n = (n << 8) + (unsigned)c;
c = getc(fd);
if (c == EOF) return -1;
n = (n << 8) + (unsigned)c;
return (int)n;
}
/*
* Read 8 bytes from "fd" and turn them into a time_T, MSB first.
* Returns -1 when encountering EOF.
*/
time_T
get8ctime(FILE *fd)
{
int c;
time_T n = 0;
int i;
for (i = 0; i < 8; ++i)
n = (n << 8) + getc(fd);
{
c = getc(fd);
if (c == EOF) return -1;
n = (n << 8) + c;
}
return n;
}
@@ -6361,6 +6379,11 @@ parse_queued_messages(void)
channel_handle_events(FALSE);
# endif
# if defined(FEAT_GUI_MACVIM) && defined(FEAT_JOB_CHANNEL)
if (gui.in_use)
gui_macvim_cleanup_job_all();
# endif
# ifdef FEAT_NETBEANS_INTG
/* Process the queued netbeans messages. */
netbeans_parse_messages();
-8
View File
@@ -210,9 +210,7 @@ update_topline(void)
curwin->w_topline = curwin->w_cursor.lnum;
curwin->w_botline = curwin->w_topline;
curwin->w_valid |= VALID_BOTLINE|VALID_BOTLINE_AP;
#ifdef FEAT_SCROLLBIND
curwin->w_scbind_pos = 1;
#endif
return;
}
@@ -241,9 +239,7 @@ update_topline(void)
curwin->w_topline = 1;
curwin->w_botline = 2;
curwin->w_valid |= VALID_BOTLINE|VALID_BOTLINE_AP;
#ifdef FEAT_SCROLLBIND
curwin->w_scbind_pos = 1;
#endif
}
/*
@@ -564,9 +560,7 @@ set_topline(win_T *wp, linenr_T lnum)
/* Approximate the value of w_botline */
wp->w_botline += lnum - wp->w_topline;
wp->w_topline = lnum;
#ifdef FEAT_AUTOCMD
wp->w_topline_was_set = TRUE;
#endif
#ifdef FEAT_DIFF
wp->w_topfill = 0;
#endif
@@ -2804,7 +2798,6 @@ halfpage(int flag, linenr_T Prenum)
redraw_later(VALID);
}
#if defined(FEAT_CURSORBIND) || defined(PROTO)
void
do_check_cursorbind(void)
{
@@ -2877,4 +2870,3 @@ do_check_cursorbind(void)
curwin = old_curwin;
curbuf = old_curbuf;
}
#endif /* FEAT_CURSORBIND */
-6
View File
@@ -1581,9 +1581,7 @@ nb_do_cmd(
do_update = 1;
buf->initDone = TRUE;
nb_set_curbuf(buf->bufp);
#if defined(FEAT_AUTOCMD)
apply_autocmds(EVENT_BUFREADPOST, 0, 0, FALSE, buf->bufp);
#endif
/* handle any postponed key commands */
handle_key_queue();
@@ -2160,17 +2158,13 @@ nb_do_cmd(
#endif
)
{
#ifdef FEAT_AUTOCMD
bufref_T bufref;
set_bufref(&bufref, buf->bufp);
#endif
buf_write_all(buf->bufp, FALSE);
#ifdef FEAT_AUTOCMD
/* an autocommand may have deleted the buffer */
if (!bufref_valid(&bufref))
buf->bufp = NULL;
#endif
}
}
else
+88 -100
View File
@@ -169,9 +169,7 @@ static void nv_nbcmd(cmdarg_T *cap);
#ifdef FEAT_DND
static void nv_drop(cmdarg_T *cap);
#endif
#ifdef FEAT_AUTOCMD
static void nv_cursorhold(cmdarg_T *cap);
#endif
static void get_op_vcol(oparg_T *oap, colnr_T col, int initial);
static char *e_noident = N_("E349: No identifier under cursor");
@@ -424,9 +422,7 @@ static const struct nv_cmd
#ifdef FEAT_DND
{K_DROP, nv_drop, NV_STS, 0},
#endif
#ifdef FEAT_AUTOCMD
{K_CURSORHOLD, nv_cursorhold, NV_KEEPREG, 0},
#endif
{K_PS, nv_edit, 0, 0},
};
@@ -595,7 +591,6 @@ normal_cmd(
#endif
}
#ifdef FEAT_AUTOCMD
/* Restore counts from before receiving K_CURSORHOLD. This means after
* typing "3", handling K_CURSORHOLD and then typing "2" we get "32", not
* "3 * 2". */
@@ -606,7 +601,6 @@ normal_cmd(
oap->prev_opcount = 0;
oap->prev_count0 = 0;
}
#endif
mapped_len = typebuf_maplen();
@@ -737,7 +731,6 @@ getcount:
}
}
#ifdef FEAT_AUTOCMD
if (c == K_CURSORHOLD)
{
/* Save the count values so that ca.opcount and ca.count0 are exactly
@@ -745,9 +738,7 @@ getcount:
oap->prev_opcount = ca.opcount;
oap->prev_count0 = ca.count0;
}
else
#endif
if (ca.opcount != 0)
else if (ca.opcount != 0)
{
/*
* If we're in the middle of an operator (including after entering a
@@ -808,10 +799,8 @@ getcount:
text_locked_msg();
goto normal_end;
}
#ifdef FEAT_AUTOCMD
if ((nv_cmds[idx].cmd_flags & NV_NCW) && curbuf_locked())
goto normal_end;
#endif
/*
* In Visual/Select mode, a few keys are handled in a special way.
@@ -892,17 +881,15 @@ getcount:
int lit = FALSE; /* get extra character literally */
int langmap_active = FALSE; /* using :lmap mappings */
int lang; /* getting a text character */
#ifdef FEAT_MBYTE
#ifdef HAVE_INPUT_METHOD
int save_smd; /* saved value of p_smd */
#endif
++no_mapping;
++allow_keys; /* no mapping for nchar, but allow key codes */
#ifdef FEAT_AUTOCMD
/* Don't generate a CursorHold event here, most commands can't handle
* it, e.g., nv_replace(), nv_csearch(). */
did_cursorhold = TRUE;
#endif
if (ca.cmdchar == 'g')
{
/*
@@ -957,7 +944,7 @@ getcount:
State = LANGMAP;
langmap_active = TRUE;
}
#ifdef FEAT_MBYTE
#ifdef HAVE_INPUT_METHOD
save_smd = p_smd;
p_smd = FALSE; /* Don't let the IM code show the mode here */
if (lang && curbuf->b_p_iminsert == B_IMODE_IM)
@@ -973,7 +960,7 @@ getcount:
++allow_keys;
State = NORMAL_BUSY;
}
#ifdef FEAT_MBYTE
#ifdef HAVE_INPUT_METHOD
if (lang)
{
if (curbuf->b_p_iminsert != B_IMODE_LMAP)
@@ -1102,10 +1089,8 @@ getcount:
if (need_flushbuf)
out_flush();
#endif
#ifdef FEAT_AUTOCMD
if (ca.cmdchar != K_IGNORE)
did_cursorhold = FALSE;
#endif
State = NORMAL;
@@ -1278,10 +1263,7 @@ normal_end:
#ifdef FEAT_CMDL_INFO
if (oap->op_type == OP_NOP && oap->regname == 0
# ifdef FEAT_AUTOCMD
&& ca.cmdchar != K_CURSORHOLD
# endif
)
&& ca.cmdchar != K_CURSORHOLD)
clear_showcmd();
#endif
@@ -1293,21 +1275,17 @@ normal_end:
mb_adjust_cursor();
#endif
#ifdef FEAT_SCROLLBIND
if (curwin->w_p_scb && toplevel)
{
validate_cursor(); /* may need to update w_leftcol */
do_check_scrollbind(TRUE);
}
#endif
#ifdef FEAT_CURSORBIND
if (curwin->w_p_crb && toplevel)
{
validate_cursor(); /* may need to update w_leftcol */
do_check_cursorbind();
}
#endif
#ifdef FEAT_TERMINAL
/* don't go to Insert mode if a terminal has a running job */
@@ -2286,12 +2264,12 @@ op_function(oparg_T *oap UNUSED)
* Do the appropriate action for the current mouse click in the current mode.
* Not used for Command-line mode.
*
* Normal Mode:
* Normal and Visual Mode:
* event modi- position visual change action
* fier cursor window
* left press - yes end yes
* left press C yes end yes "^]" (2)
* left press S yes end yes "*" (2)
* left press S yes end (popup: extend) yes "*" (2)
* left drag - yes start if moved no
* left relse - yes start if moved no
* middle press - yes if not active no put register
@@ -2670,84 +2648,95 @@ do_mouse(
if (which_button == MOUSE_RIGHT
&& !(mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL)))
{
/*
* NOTE: Ignore right button down and drag mouse events.
* Windows only shows the popup menu on the button up event.
*/
#if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_GTK) \
|| defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MAC) \
|| defined(FEAT_GUI_MACVIM)
if (!is_click)
return FALSE;
#endif
#if defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_MSWIN)
if (is_click || is_drag)
return FALSE;
#endif
#if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_GTK) \
|| defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_MSWIN) \
|| defined(FEAT_GUI_MAC) || defined(FEAT_GUI_PHOTON) \
|| defined(FEAT_TERM_POPUP_MENU) \
|| defined(FEAT_GUI_MACVIM)
# ifdef FEAT_GUI
if (gui.in_use)
{
jump_flags = 0;
if (STRCMP(p_mousem, "popup_setpos") == 0)
{
/* First set the cursor position before showing the popup
* menu. */
if (VIsual_active)
{
pos_T m_pos;
# if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_GTK) \
|| defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MAC)
if (!is_click)
/* Ignore right button release events, only shows the popup
* menu on the button down event. */
return FALSE;
# endif
# if defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_MSWIN)
if (is_click || is_drag)
/* Ignore right button down and drag mouse events. Windows
* only shows the popup menu on the button up event. */
return FALSE;
# endif
}
# endif
# if defined(FEAT_GUI) && defined(FEAT_TERM_POPUP_MENU)
else
# endif
# if defined(FEAT_TERM_POPUP_MENU)
if (!is_click)
/* Ignore right button release events, only shows the popup
* menu on the button down event. */
return FALSE;
#endif
/*
* set MOUSE_MAY_STOP_VIS if we are outside the
* selection or the current window (might have false
* negative here)
*/
if (mouse_row < curwin->w_winrow
|| mouse_row
> (curwin->w_winrow + curwin->w_height))
jump_flags = MOUSE_MAY_STOP_VIS;
else if (get_fpos_of_mouse(&m_pos) != IN_BUFFER)
jump_flags = MOUSE_MAY_STOP_VIS;
else
jump_flags = 0;
if (STRCMP(p_mousem, "popup_setpos") == 0)
{
/* First set the cursor position before showing the popup
* menu. */
if (VIsual_active)
{
pos_T m_pos;
/*
* set MOUSE_MAY_STOP_VIS if we are outside the
* selection or the current window (might have false
* negative here)
*/
if (mouse_row < curwin->w_winrow
|| mouse_row
> (curwin->w_winrow + curwin->w_height))
jump_flags = MOUSE_MAY_STOP_VIS;
else if (get_fpos_of_mouse(&m_pos) != IN_BUFFER)
jump_flags = MOUSE_MAY_STOP_VIS;
else
{
if ((LT_POS(curwin->w_cursor, VIsual)
&& (LT_POS(m_pos, curwin->w_cursor)
|| LT_POS(VIsual, m_pos)))
|| (LT_POS(VIsual, curwin->w_cursor)
&& (LT_POS(m_pos, VIsual)
|| LT_POS(curwin->w_cursor, m_pos))))
{
if ((LT_POS(curwin->w_cursor, VIsual)
&& (LT_POS(m_pos, curwin->w_cursor)
|| LT_POS(VIsual, m_pos)))
|| (LT_POS(VIsual, curwin->w_cursor)
&& (LT_POS(m_pos, VIsual)
|| LT_POS(curwin->w_cursor, m_pos))))
{
jump_flags = MOUSE_MAY_STOP_VIS;
}
else if (VIsual_mode == Ctrl_V)
{
getvcols(curwin, &curwin->w_cursor, &VIsual,
&leftcol, &rightcol);
getvcol(curwin, &m_pos, NULL, &m_pos.col, NULL);
if (m_pos.col < leftcol || m_pos.col > rightcol)
jump_flags = MOUSE_MAY_STOP_VIS;
}
else if (VIsual_mode == Ctrl_V)
{
getvcols(curwin, &curwin->w_cursor, &VIsual,
&leftcol, &rightcol);
getvcol(curwin, &m_pos, NULL, &m_pos.col, NULL);
if (m_pos.col < leftcol || m_pos.col > rightcol)
jump_flags = MOUSE_MAY_STOP_VIS;
}
}
}
else
jump_flags = MOUSE_MAY_STOP_VIS;
}
if (jump_flags)
{
jump_flags = jump_to_mouse(jump_flags, NULL, which_button);
update_curbuf(VIsual_active ? INVERTED : VALID);
setcursor();
out_flush(); /* Update before showing popup menu */
}
# ifdef FEAT_MENU
gui_show_popupmenu();
# endif
return (jump_flags & CURSOR_MOVED) != 0;
else
jump_flags = MOUSE_MAY_STOP_VIS;
}
else
return FALSE;
if (jump_flags)
{
jump_flags = jump_to_mouse(jump_flags, NULL, which_button);
update_curbuf(VIsual_active ? INVERTED : VALID);
setcursor();
out_flush(); /* Update before showing popup menu */
}
# ifdef FEAT_MENU
show_popupmenu();
got_click = FALSE; /* ignore release events */
# endif
return (jump_flags & CURSOR_MOVED) != 0;
#else
return FALSE;
#endif
@@ -3991,7 +3980,6 @@ display_showcmd(void)
}
#endif
#ifdef FEAT_SCROLLBIND
/*
* When "check" is FALSE, prepare for commands that scroll the window.
* When "check" is TRUE, take care of scroll-binding after the window has
@@ -4150,7 +4138,6 @@ check_scrollbind(linenr_T topline_diff, long leftcol_diff)
curwin = old_curwin;
curbuf = old_curbuf;
}
#endif /* #ifdef FEAT_SCROLLBIND */
/*
* Command character that's ignored.
@@ -6286,13 +6273,11 @@ nv_gotofile(cmdarg_T *cap)
text_locked_msg();
return;
}
#ifdef FEAT_AUTOCMD
if (curbuf_locked())
{
clearop(cap->oap);
return;
}
#endif
ptr = grab_file_name(cap->count1, &lnum);
@@ -7508,6 +7493,11 @@ v_visop(cmdarg_T *cap)
static void
nv_subst(cmdarg_T *cap)
{
#ifdef FEAT_TERMINAL
/* When showing output of term_dumpdiff() swap the top and botom. */
if (term_swap_diff() == OK)
return;
#endif
if (VIsual_active) /* "vs" and "vS" are the same as "vc" */
{
if (cap->cmdchar == 'S')
@@ -9614,7 +9604,6 @@ nv_drop(cmdarg_T *cap UNUSED)
}
#endif
#ifdef FEAT_AUTOCMD
/*
* Trigger CursorHold event.
* When waiting for a character for 'updatetime' K_CURSORHOLD is put in the
@@ -9627,7 +9616,6 @@ nv_cursorhold(cmdarg_T *cap)
did_cursorhold = TRUE;
cap->retval |= CA_COMMAND_BUSY; /* don't call edit() now */
}
#endif
/*
* Calculate start/end virtual columns for operating in block mode.
+24 -11
View File
@@ -899,17 +899,21 @@ valid_yank_reg(
*
* If regname is 0 and writing, use register 0
* If regname is 0 and reading, use previous register
*
* Return TRUE when the register should be inserted literally (selection or
* clipboard).
*/
void
int
get_yank_register(int regname, int writing)
{
int i;
int ret = FALSE;
y_append = FALSE;
if ((regname == 0 || regname == '"') && !writing && y_previous != NULL)
{
y_current = y_previous;
return;
return ret;
}
i = regname;
if (VIM_ISDIGIT(i))
@@ -926,10 +930,16 @@ get_yank_register(int regname, int writing)
#ifdef FEAT_CLIPBOARD
/* When selection is not available, use register 0 instead of '*' */
else if (clip_star.available && regname == '*')
{
i = STAR_REGISTER;
ret = TRUE;
}
/* When clipboard is not available, use register 0 instead of '+' */
else if (clip_plus.available && regname == '+')
{
i = PLUS_REGISTER;
ret = TRUE;
}
#endif
#ifdef FEAT_DND
else if (!writing && regname == '~')
@@ -940,6 +950,7 @@ get_yank_register(int regname, int writing)
y_current = &(y_regs[i]);
if (writing) /* remember the register we write into for do_put() */
y_previous = y_current;
return ret;
}
#if defined(FEAT_CLIPBOARD) || defined(PROTO)
@@ -1387,12 +1398,13 @@ put_in_typebuf(
int
insert_reg(
int regname,
int literally) /* insert literally, not as if typed */
int literally_arg) /* insert literally, not as if typed */
{
long i;
int retval = OK;
char_u *arg;
int allocated;
int literally = literally_arg;
/*
* It is possible to get into an endless loop by having CTRL-R a in
@@ -1423,7 +1435,8 @@ insert_reg(
}
else /* name or number register */
{
get_yank_register(regname, FALSE);
if (get_yank_register(regname, FALSE))
literally = TRUE;
if (y_current->y_array == NULL)
retval = FAIL;
else
@@ -1580,12 +1593,14 @@ get_spec_reg(
int
cmdline_paste_reg(
int regname,
int literally, /* Insert text literally instead of "as typed" */
int literally_arg, /* Insert text literally instead of "as typed" */
int remcr) /* don't add CR characters */
{
long i;
int literally = literally_arg;
get_yank_register(regname, FALSE);
if (get_yank_register(regname, FALSE))
literally = TRUE;
if (y_current->y_array == NULL)
return FAIL;
@@ -1651,7 +1666,7 @@ shift_delete_registers()
y_regs[1].y_array = NULL; /* set register one to empty */
}
#ifdef FEAT_AUTOCMD
#if defined(FEAT_EVAL)
static void
yank_do_autocmd(oparg_T *oap, yankreg_T *reg)
{
@@ -1866,7 +1881,7 @@ op_delete(oparg_T *oap)
}
}
#ifdef FEAT_AUTOCMD
#if defined(FEAT_EVAL)
if (did_yank && has_textyankpost())
yank_do_autocmd(oap, y_current);
#endif
@@ -3350,7 +3365,7 @@ op_yank(oparg_T *oap, int deleting, int mess)
# endif
#endif
#ifdef FEAT_AUTOCMD
#if defined(FEAT_EVAL)
if (!deleting && has_textyankpost())
yank_do_autocmd(oap, y_current);
#endif
@@ -3493,11 +3508,9 @@ do_put(
return;
}
#ifdef FEAT_AUTOCMD
/* Autocommands may be executed when saving lines for undo, which may make
* y_array invalid. Start undo now to avoid that. */
u_save(curwin->w_cursor.lnum, curwin->w_cursor.lnum + 1);
#endif
if (insert_string != NULL)
{
+57 -101
View File
@@ -114,9 +114,7 @@
#define PV_FF OPT_BUF(BV_FF)
#define PV_FLP OPT_BUF(BV_FLP)
#define PV_FO OPT_BUF(BV_FO)
#ifdef FEAT_AUTOCMD
# define PV_FT OPT_BUF(BV_FT)
#endif
#define PV_FT OPT_BUF(BV_FT)
#define PV_IMI OPT_BUF(BV_IMI)
#define PV_IMS OPT_BUF(BV_IMS)
#if defined(FEAT_CINDENT) && defined(FEAT_EVAL)
@@ -232,9 +230,7 @@
# define PV_RL OPT_WIN(WV_RL)
# define PV_RLC OPT_WIN(WV_RLC)
#endif
#ifdef FEAT_SCROLLBIND
# define PV_SCBIND OPT_WIN(WV_SCBIND)
#endif
#define PV_SCBIND OPT_WIN(WV_SCBIND)
#define PV_SCROLL OPT_WIN(WV_SCROLL)
#ifdef FEAT_SPELL
# define PV_SPELL OPT_WIN(WV_SPELL)
@@ -251,9 +247,7 @@
# define PV_WFH OPT_WIN(WV_WFH)
# define PV_WFW OPT_WIN(WV_WFW)
#define PV_WRAP OPT_WIN(WV_WRAP)
#ifdef FEAT_CURSORBIND
# define PV_CRBIND OPT_WIN(WV_CRBIND)
#endif
#define PV_CRBIND OPT_WIN(WV_CRBIND)
#ifdef FEAT_CONCEAL
# define PV_COCU OPT_WIN(WV_COCU)
# define PV_COLE OPT_WIN(WV_COLE)
@@ -322,9 +316,7 @@ static char_u *p_fenc;
static char_u *p_ff;
static char_u *p_fo;
static char_u *p_flp;
#ifdef FEAT_AUTOCMD
static char_u *p_ft;
#endif
static long p_iminsert;
static long p_imsearch;
#if defined(FEAT_FIND_ID) && defined(FEAT_EVAL)
@@ -1003,11 +995,7 @@ static struct vimoption options[] =
#endif
{(char_u *)0L, (char_u *)0L} SCRIPTID_INIT},
{"cursorbind", "crb", P_BOOL|P_VI_DEF,
#ifdef FEAT_CURSORBIND
(char_u *)VAR_WIN, PV_CRBIND,
#else
(char_u *)NULL, PV_NONE,
#endif
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
{"cursorcolumn", "cuc", P_BOOL|P_VI_DEF|P_RWIN,
#ifdef FEAT_SYN_HL
@@ -1148,11 +1136,7 @@ static struct vimoption options[] =
(char_u *)&p_ek, PV_NONE,
{(char_u *)FALSE, (char_u *)TRUE} SCRIPTID_INIT},
{"eventignore", "ei", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP,
#ifdef FEAT_AUTOCMD
(char_u *)&p_ei, PV_NONE,
#else
(char_u *)NULL, PV_NONE,
#endif
{(char_u *)"", (char_u *)0L} SCRIPTID_INIT},
{"expandtab", "et", P_BOOL|P_VI_DEF|P_VIM,
(char_u *)&p_et, PV_ET,
@@ -1197,13 +1181,8 @@ static struct vimoption options[] =
#endif
(char_u *)0L} SCRIPTID_INIT},
{"filetype", "ft", P_STRING|P_ALLOCED|P_VI_DEF|P_NOGLOB|P_NFNAME,
#ifdef FEAT_AUTOCMD
(char_u *)&p_ft, PV_FT,
{(char_u *)"", (char_u *)0L}
#else
(char_u *)NULL, PV_NONE,
{(char_u *)0L, (char_u *)0L}
#endif
SCRIPTID_INIT},
{"fillchars", "fcs", P_STRING|P_VI_DEF|P_RALL|P_ONECOMMA|P_NODUP,
(char_u *)&p_fcs, PV_NONE,
@@ -2471,11 +2450,7 @@ static struct vimoption options[] =
(char_u *)VAR_WIN, PV_SCROLL,
{(char_u *)0L, (char_u *)0L} SCRIPTID_INIT},
{"scrollbind", "scb", P_BOOL|P_VI_DEF,
#ifdef FEAT_SCROLLBIND
(char_u *)VAR_WIN, PV_SCBIND,
#else
(char_u *)NULL, PV_NONE,
#endif
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
{"scrolljump", "sj", P_NUM|P_VI_DEF|P_VIM,
(char_u *)&p_sj, PV_NONE,
@@ -2484,13 +2459,8 @@ static struct vimoption options[] =
(char_u *)&p_so, PV_NONE,
{(char_u *)0L, (char_u *)0L} SCRIPTID_INIT},
{"scrollopt", "sbo", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP,
#ifdef FEAT_SCROLLBIND
(char_u *)&p_sbo, PV_NONE,
{(char_u *)"ver,jump", (char_u *)0L}
#else
(char_u *)NULL, PV_NONE,
{(char_u *)0L, (char_u *)0L}
#endif
SCRIPTID_INIT},
{"sections", "sect", P_STRING|P_VI_DEF,
(char_u *)&p_sections, PV_NONE,
@@ -2509,7 +2479,7 @@ static struct vimoption options[] =
{"sessionoptions", "ssop", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP,
#ifdef FEAT_SESSION
(char_u *)&p_ssop, PV_NONE,
{(char_u *)"blank,buffers,curdir,folds,help,options,tabpages,winsize",
{(char_u *)"blank,buffers,curdir,folds,help,options,tabpages,winsize,terminal",
(char_u *)0L}
#else
(char_u *)NULL, PV_NONE,
@@ -3326,16 +3296,10 @@ static char *(p_km_values[]) = {"startsel", "stopsel", NULL};
#ifdef FEAT_BROWSE
static char *(p_bsdir_values[]) = {"current", "last", "buffer", NULL};
#endif
#ifdef FEAT_SCROLLBIND
static char *(p_scbopt_values[]) = {"ver", "hor", "jump", NULL};
#endif
static char *(p_debug_values[]) = {"msg", "throw", "beep", NULL};
static char *(p_ead_values[]) = {"both", "ver", "hor", NULL};
#ifdef FEAT_AUTOCMD
static char *(p_buftype_values[]) = {"nofile", "nowrite", "quickfix", "help", "terminal", "acwrite", NULL};
#else
static char *(p_buftype_values[]) = {"nofile", "nowrite", "quickfix", "help", "terminal", NULL};
#endif
static char *(p_bufhidden_values[]) = {"hide", "unload", "delete", "wipe", NULL};
static char *(p_bs_values[]) = {"indent", "eol", "start", NULL};
#ifdef FEAT_FOLDING
@@ -3431,9 +3395,10 @@ static int briopt_check(win_T *wp);
* Initialize the options, first part.
*
* Called only once from main(), just after creating the first buffer.
* If "clean_arg" is TRUE Vim was started with --clean.
*/
void
set_init_1(void)
set_init_1(int clean_arg)
{
char_u *p;
int opt_idx;
@@ -3643,6 +3608,24 @@ set_init_1(void)
*/
set_options_default(0);
#ifdef CLEAN_RUNTIMEPATH
if (clean_arg)
{
opt_idx = findoption((char_u *)"runtimepath");
if (opt_idx >= 0)
{
options[opt_idx].def_val[VI_DEFAULT] = (char_u *)CLEAN_RUNTIMEPATH;
p_rtp = (char_u *)CLEAN_RUNTIMEPATH;
}
opt_idx = findoption((char_u *)"packpath");
if (opt_idx >= 0)
{
options[opt_idx].def_val[VI_DEFAULT] = (char_u *)CLEAN_RUNTIMEPATH;
p_pp = (char_u *)CLEAN_RUNTIMEPATH;
}
}
#endif
#ifdef FEAT_GUI
if (found_reverse_arg)
set_option_value((char_u *)"bg", 0L, (char_u *)"dark", 0);
@@ -4424,7 +4407,7 @@ set_title_defaults(void)
}
#endif
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
#if defined(FEAT_EVAL)
static void
trigger_optionsset_string(
int opt_idx,
@@ -4915,7 +4898,7 @@ do_set(
char_u *oldval = NULL; /* previous value if *varp */
char_u *newval;
char_u *origval = NULL;
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
#if defined(FEAT_EVAL)
char_u *saved_origval = NULL;
char_u *saved_newval = NULL;
#endif
@@ -5269,7 +5252,7 @@ do_set(
*/
*(char_u **)(varp) = newval;
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
#if defined(FEAT_EVAL)
if (!starting
# ifdef FEAT_CRYPT
&& options[opt_idx].indir != PV_KEY
@@ -5292,7 +5275,7 @@ do_set(
errmsg = did_set_string_option(opt_idx, (char_u **)varp,
new_value_alloced, oldval, errbuf, opt_flags);
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
#if defined(FEAT_EVAL)
if (errmsg == NULL)
trigger_optionsset_string(opt_idx, opt_flags,
saved_origval, saved_newval);
@@ -5815,9 +5798,7 @@ check_buf_options(buf_T *buf)
check_string_option(&buf->b_p_cino);
parse_cino(buf);
#endif
#ifdef FEAT_AUTOCMD
check_string_option(&buf->b_p_ft);
#endif
#if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT)
check_string_option(&buf->b_p_cinw);
#endif
@@ -6071,7 +6052,7 @@ set_string_option(
char_u *s;
char_u **varp;
char_u *oldval;
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
#if defined(FEAT_EVAL)
char_u *saved_oldval = NULL;
char_u *saved_newval = NULL;
#endif
@@ -6091,7 +6072,7 @@ set_string_option(
oldval = *varp;
*varp = s;
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
#if defined(FEAT_EVAL)
if (!starting
# ifdef FEAT_CRYPT
&& options[opt_idx].indir != PV_KEY
@@ -6106,7 +6087,7 @@ set_string_option(
opt_flags)) == NULL)
did_set_option(opt_idx, opt_flags, TRUE);
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
#if defined(FEAT_EVAL)
/* call autocommand after handling side effects */
if (r == NULL)
trigger_optionsset_string(opt_idx, opt_flags,
@@ -6118,7 +6099,6 @@ set_string_option(
return r;
}
#if defined(FEAT_KEYMAP) || defined(FEAT_AUTOCMD) || defined(FEAT_SYN_HL)
/*
* Return TRUE if "val" is a valid 'filetype' name.
* Also used for 'syntax' and 'keymap'.
@@ -6133,7 +6113,6 @@ valid_filetype(char_u *val)
return FALSE;
return TRUE;
}
#endif
/*
* Handle string options that need some action to perform when changed.
@@ -6157,9 +6136,7 @@ did_set_string_option(
/* set when changing an option that only requires a redraw in the GUI */
int redraw_gui_only = FALSE;
#endif
#ifdef FEAT_AUTOCMD
int ft_changed = FALSE;
#endif
/* Get the global option to compare with, otherwise we would have to check
* two values for all local options. */
@@ -6352,13 +6329,11 @@ did_set_string_option(
#endif
/* 'scrollopt' */
#ifdef FEAT_SCROLLBIND
else if (varp == &p_sbo)
{
if (check_opt_strings(p_sbo, p_scbopt_values, TRUE) != OK)
errmsg = e_invarg;
}
#endif
/* 'ambiwidth' */
#ifdef FEAT_MBYTE
@@ -6440,14 +6415,12 @@ did_set_string_option(
}
#endif
#ifdef FEAT_AUTOCMD
/* 'eventignore' */
else if (varp == &p_ei)
{
if (check_ei() == FAIL)
errmsg = e_invarg;
}
#endif
#ifdef FEAT_MBYTE
/* 'encoding', 'fileencoding', 'termencoding' and 'makeencoding' */
@@ -7572,7 +7545,6 @@ did_set_string_option(
}
#endif
#ifdef FEAT_AUTOCMD
else if (gvarp == &p_ft)
{
if (!valid_filetype(*varp))
@@ -7580,7 +7552,6 @@ did_set_string_option(
else
ft_changed = STRCMP(oldval, *varp) != 0;
}
#endif
#ifdef FEAT_SYN_HL
else if (gvarp == &p_syn)
@@ -7697,18 +7668,17 @@ did_set_string_option(
else if (!(opt_flags & OPT_LOCAL) && opt_flags != OPT_GLOBAL)
set_string_option_global(opt_idx, varp);
#ifdef FEAT_AUTOCMD
/*
* Trigger the autocommand only after setting the flags.
*/
# ifdef FEAT_SYN_HL
#ifdef FEAT_SYN_HL
/* When 'syntax' is set, load the syntax of that name */
if (varp == &(curbuf->b_p_syn))
{
apply_autocmds(EVENT_SYNTAX, curbuf->b_p_syn,
curbuf->b_fname, TRUE, curbuf);
}
# endif
#endif
else if (varp == &(curbuf->b_p_ft))
{
/* 'filetype' is set, trigger the FileType autocommand.
@@ -7724,7 +7694,6 @@ did_set_string_option(
varp = NULL;
}
}
#endif
#ifdef FEAT_SPELL
if (varp == &(curwin->w_s->b_p_spl))
{
@@ -8344,8 +8313,8 @@ set_bool_option(
{
# ifdef FEAT_TERMINAL
/* Cannot set 'modifiable' when in Terminal mode. */
if (term_in_normal_mode()
|| (bt_terminal(curbuf) && !term_is_finished(curbuf)))
if (curbuf->b_p_ma && (term_in_normal_mode() || (bt_terminal(curbuf)
&& curbuf->b_term != NULL && !term_is_finished(curbuf))))
{
curbuf->b_p_ma = FALSE;
return (char_u *)N_("E946: Cannot make a terminal with running job modifiable");
@@ -8384,14 +8353,12 @@ set_bool_option(
#endif
}
#ifdef FEAT_AUTOCMD
/* when 'buflisted' changes, trigger autocommands */
else if ((int *)varp == &curbuf->b_p_bl && old_value != curbuf->b_p_bl)
{
apply_autocmds(curbuf->b_p_bl ? EVENT_BUFADD : EVENT_BUFDELETE,
NULL, NULL, TRUE, curbuf);
}
#endif
/* when 'swf' is set, create swapfile, when reset remove swapfile */
else if ((int *)varp == &curbuf->b_p_swf)
@@ -8463,7 +8430,6 @@ set_bool_option(
}
#endif
#ifdef FEAT_SCROLLBIND
/* when 'scrollbind' is set: snapshot the current position to avoid a jump
* at the end of normal_cmd() */
else if ((int *)varp == &curwin->w_p_scb)
@@ -8474,7 +8440,6 @@ set_bool_option(
curwin->w_scbind_pos = curwin->w_topline;
}
}
#endif
#if defined(FEAT_QUICKFIX)
/* There can be only one window with 'previewwindow' set. */
@@ -8582,9 +8547,7 @@ set_bool_option(
#ifdef FEAT_TITLE
redraw_titles();
#endif
#ifdef FEAT_AUTOCMD
modified_was_set = value;
#endif
}
#ifdef BACKSLASH_IN_FILENAME
@@ -8678,7 +8641,7 @@ set_bool_option(
}
#endif
#ifdef FEAT_MBYTE
#ifdef HAVE_INPUT_METHOD
/* 'imdisable' */
else if ((int *)varp == &p_imdisable)
{
@@ -8861,10 +8824,25 @@ set_bool_option(
/* 'termguicolors' */
else if ((int *)varp == &p_tgc)
{
# ifdef FEAT_VTP
/* Do not turn on 'tgc' when 24-bit colors are not supported. */
if (!has_vtp_working())
{
p_tgc = 0;
return (char_u*)N_("E954: 24-bit colors are not supported on this environment");
}
swap_tcap();
# endif
# ifdef FEAT_GUI
if (!gui.in_use && !gui.starting)
# endif
highlight_gui_started();
# ifdef FEAT_VTP
control_console_color_rgb();
/* reset t_Co */
if (STRCMP(T_NAME, "win32") == 0)
set_termname(T_NAME);
# endif
}
#endif
@@ -8876,7 +8854,7 @@ set_bool_option(
options[opt_idx].flags |= P_WAS_SET;
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
#if defined(FEAT_EVAL)
if (!starting)
{
char_u buf_old[2], buf_new[2], buf_type[7];
@@ -9465,7 +9443,7 @@ set_num_option(
options[opt_idx].flags |= P_WAS_SET;
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
#if defined(FEAT_EVAL)
if (!starting && errmsg == NULL)
{
char_u buf_old[11], buf_new[11], buf_type[7];
@@ -10315,22 +10293,15 @@ makeset(FILE *fd, int opt_flags, int local_only)
}
else /* P_STRING */
{
#if defined(FEAT_SYN_HL) || defined(FEAT_AUTOCMD)
int do_endif = FALSE;
/* Don't set 'syntax' and 'filetype' again if the value is
* already right, avoids reloading the syntax file. */
if (
# if defined(FEAT_SYN_HL)
p->indir == PV_SYN
# if defined(FEAT_AUTOCMD)
||
# endif
# endif
# if defined(FEAT_AUTOCMD)
p->indir == PV_FT
# endif
)
#if defined(FEAT_SYN_HL)
p->indir == PV_SYN ||
#endif
p->indir == PV_FT)
{
if (fprintf(fd, "if &%s != '%s'", p->fullname,
*(char_u **)(varp)) < 0
@@ -10338,17 +10309,14 @@ makeset(FILE *fd, int opt_flags, int local_only)
return FAIL;
do_endif = TRUE;
}
#endif
if (put_setstring(fd, cmd, p->fullname, (char_u **)varp,
(p->flags & P_EXPAND) != 0) == FAIL)
return FAIL;
#if defined(FEAT_SYN_HL) || defined(FEAT_AUTOCMD)
if (do_endif)
{
if (put_line(fd, "endif") == FAIL)
return FAIL;
}
#endif
}
}
}
@@ -10907,12 +10875,8 @@ get_varp(struct vimoption *p)
case PV_BRI: return (char_u *)&(curwin->w_p_bri);
case PV_BRIOPT: return (char_u *)&(curwin->w_p_briopt);
#endif
#ifdef FEAT_SCROLLBIND
case PV_SCBIND: return (char_u *)&(curwin->w_p_scb);
#endif
#ifdef FEAT_CURSORBIND
case PV_CRBIND: return (char_u *)&(curwin->w_p_crb);
#endif
#ifdef FEAT_CONCEAL
case PV_COCU: return (char_u *)&(curwin->w_p_cocu);
case PV_COLE: return (char_u *)&(curwin->w_p_cole);
@@ -10959,9 +10923,7 @@ get_varp(struct vimoption *p)
case PV_FENC: return (char_u *)&(curbuf->b_p_fenc);
#endif
case PV_FF: return (char_u *)&(curbuf->b_p_ff);
#ifdef FEAT_AUTOCMD
case PV_FT: return (char_u *)&(curbuf->b_p_ft);
#endif
case PV_FO: return (char_u *)&(curbuf->b_p_fo);
case PV_FLP: return (char_u *)&(curbuf->b_p_flp);
case PV_IMI: return (char_u *)&(curbuf->b_p_iminsert);
@@ -11102,14 +11064,10 @@ copy_winopt(winopt_T *from, winopt_T *to)
to->wo_bri = from->wo_bri;
to->wo_briopt = vim_strsave(from->wo_briopt);
#endif
#ifdef FEAT_SCROLLBIND
to->wo_scb = from->wo_scb;
to->wo_scb_save = from->wo_scb_save;
#endif
#ifdef FEAT_CURSORBIND
to->wo_crb = from->wo_crb;
to->wo_crb_save = from->wo_crb_save;
#endif
#ifdef FEAT_SPELL
to->wo_spell = from->wo_spell;
#endif
@@ -11379,10 +11337,8 @@ buf_copy_options(buf_T *buf, int flags)
buf->b_p_cink = vim_strsave(p_cink);
buf->b_p_cino = vim_strsave(p_cino);
#endif
#ifdef FEAT_AUTOCMD
/* Don't copy 'filetype', it must be detected */
buf->b_p_ft = empty_option;
#endif
buf->b_p_pi = p_pi;
#if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT)
buf->b_p_cinw = vim_strsave(p_cinw);
+4 -12
View File
@@ -214,6 +214,7 @@
#define SHM_ALL "rmfixlnwaWtToOsAIcqF" /* all possible flags for 'shm' */
/* characters for p_go: */
#define GO_TERMINAL '!' /* use terminal for system commands */
#define GO_ASEL 'a' /* autoselect */
#define GO_ASELML 'A' /* autoselect modeless selection */
#define GO_BOT 'b' /* use bottom scrollbar */
@@ -236,7 +237,7 @@
#define GO_FOOTER 'F' /* add footer */
#define GO_VERTICAL 'v' /* arrange dialog buttons vertically */
#define GO_KEEPWINSIZE 'k' /* keep GUI window size */
#define GO_ALL "aAbcefFghilmMprtTvk" /* all possible flags for 'go' */
#define GO_ALL "!aAbcefFghilmMprtTvk" /* all possible flags for 'go' */
/* flags for 'comments' option */
#define COM_NEST 'n' /* comments strings nest */
@@ -477,9 +478,7 @@ EXTERN char_u *p_efm; /* 'errorformat' */
EXTERN char_u *p_gefm; /* 'grepformat' */
EXTERN char_u *p_gp; /* 'grepprg' */
#endif
#ifdef FEAT_AUTOCMD
EXTERN char_u *p_ei; /* 'eventignore' */
#endif
EXTERN int p_ek; /* 'esckeys' */
EXTERN int p_exrc; /* 'exrc' */
#ifdef FEAT_MBYTE
@@ -760,9 +759,7 @@ EXTERN char_u *p_pp; /* 'packpath' */
EXTERN char_u *p_rtp; /* 'runtimepath' */
EXTERN long p_sj; /* 'scrolljump' */
EXTERN long p_so; /* 'scrolloff' */
#ifdef FEAT_SCROLLBIND
EXTERN char_u *p_sbo; /* 'scrollopt' */
#endif
EXTERN char_u *p_sections; /* 'sections' */
EXTERN int p_secure; /* 'secure' */
EXTERN char_u *p_sel; /* 'selection' */
@@ -774,7 +771,7 @@ EXTERN unsigned ssop_flags;
/* Also used for 'viewoptions'! */
static char *(p_ssop_values[]) = {"buffers", "winpos", "resize", "winsize",
"localoptions", "options", "help", "blank", "globals", "slash", "unix",
"sesdir", "curdir", "folds", "cursor", "tabpages", NULL};
"sesdir", "curdir", "folds", "cursor", "tabpages", "terminal", NULL};
# endif
# define SSOP_BUFFERS 0x001
# define SSOP_WINPOS 0x002
@@ -792,6 +789,7 @@ static char *(p_ssop_values[]) = {"buffers", "winpos", "resize", "winsize",
# define SSOP_FOLDS 0x2000
# define SSOP_CURSOR 0x4000
# define SSOP_TABPAGES 0x8000
# define SSOP_TERMINAL 0x10000
#endif
EXTERN char_u *p_sh; /* 'shell' */
EXTERN char_u *p_shcf; /* 'shellcmdflag' */
@@ -1069,9 +1067,7 @@ enum
, BV_FF
, BV_FLP
, BV_FO
#ifdef FEAT_AUTOCMD
, BV_FT
#endif
, BV_IMI
, BV_IMS
#if defined(FEAT_CINDENT) && defined(FEAT_EVAL)
@@ -1163,9 +1159,7 @@ enum
, WV_TK
, WV_TMS
#endif
#ifdef FEAT_CURSORBIND
, WV_CRBIND
#endif
#ifdef FEAT_LINEBREAK
, WV_BRI
, WV_BRIOPT
@@ -1202,9 +1196,7 @@ enum
, WV_RL
, WV_RLC
#endif
#ifdef FEAT_SCROLLBIND
, WV_SCBIND
#endif
, WV_SCROLL
#ifdef FEAT_SPELL
, WV_SPELL
-2
View File
@@ -152,7 +152,6 @@ mch_inchar(
*/
if (WaitForChar(raw_in, p_ut * 1000L) == 0)
{
#ifdef FEAT_AUTOCMD
if (trigger_cursorhold() && maxlen >= 3)
{
buf[0] = K_SPECIAL;
@@ -160,7 +159,6 @@ mch_inchar(
buf[2] = (int)KE_CURSORHOLD;
return 3;
}
#endif
before_blocking();
}
}
+3
View File
@@ -43,6 +43,9 @@
#ifndef DFLT_RUNTIMEPATH
# define DFLT_RUNTIMEPATH "home:vimfiles,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,home:vimfiles/after"
#endif
#ifndef CLEAN_RUNTIMEPATH
# define CLEAN_RUNTIMEPATH "$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after"
#endif
#ifndef BASENAMELEN
# define BASENAMELEN 26 /* Amiga */
+1
View File
@@ -125,6 +125,7 @@
#define DFLT_ERRORFILE "errors.err"
#define DFLT_RUNTIMEPATH "$HOME/vimfiles,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,$HOME/vimfiles/after"
#define CLEAN_RUNTIMEPATH "$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after"
#define CASE_INSENSITIVE_FILENAME /* ignore case when comparing file names */
#define SPACE_IN_FILENAME
+3
View File
@@ -215,6 +215,9 @@
#ifndef DFLT_RUNTIMEPATH
# define DFLT_RUNTIMEPATH "~/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,~/.vim/after"
#endif
#ifndef CLEAN_RUNTIMEPATH
# define CLEAN_RUNTIMEPATH "$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after"
#endif
/*
* Macintosh has plenty of memory, use large buffers
+13
View File
@@ -11,6 +11,14 @@
* os_macosx.m -- Mac specific things for Mac OS X.
*/
/* Suppress compiler warnings to non-C89 code. */
#if defined(__clang__) && defined(__STRICT_ANSI__)
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wc99-extensions"
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wdeclaration-after-statement"
#endif
/* Avoid a conflict for the definition of Boolean between Mac header files and
* X11 header files. */
#define NO_X11_INCLUDES
@@ -190,6 +198,11 @@ releasepool:
#endif /* FEAT_CLIPBOARD */
/* Lift the compiler warning suppression. */
#if defined(__clang__) && defined(__STRICT_ANSI__)
# pragma clang diagnostic pop
# pragma clang diagnostic pop
#endif
void
macosx_fork()

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