aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <bram@vim.org>2014-07-19 14:04:47 +0200
committerSteve Kondik <shade@chemlab.org>2015-01-18 00:47:06 +0000
commit65cd3526f1577cdd5aba1c23c820bfde6988a658 (patch)
tree8706ca231670a88fc0340322f8388caebb2d4272
parent71a51b1bcc7255fb302ff373537a062c44cd70b4 (diff)
downloadandroid_external_vim-cm-12.1.tar.gz
android_external_vim-cm-12.1.tar.bz2
android_external_vim-cm-12.1.zip
This is a squashed commit of the following: commit 1db48f5f2de0b06d41328659e1d1b472b2aa685f Author: Bram Moolenaar <bram@vim.org> Date: Wed Jan 14 11:25:05 2015 +0100 updated for version 7.4.568 Problem: Giving an error for ":0wincmd w" is a problem for some plugins. Solution: Allow the zero in the range. (Marcin Szamotulski) commit 6e9d6ad321ea931a8fa261ff780055a45d753b79 Author: Bram Moolenaar <bram@vim.org> Date: Sat Jan 10 15:09:25 2015 +0100 Updated syntax files. commit a61af3901949b9f191f22039157eb09e34179e46 Author: Bram Moolenaar <bram@vim.org> Date: Wed Jan 7 19:04:28 2015 +0100 updated for version 7.4.567 Problem: Non-ascii vertical separater characters are always redrawn. Solution: Compare only the one byte that's stored. (Thiago Padilha) commit da9a48e659f61b28b8b67134c94032484945772b Author: Bram Moolenaar <bram@vim.org> Date: Wed Jan 7 16:57:10 2015 +0100 Update runtime files. commit ebf92c4e3aec759dec2c79ce67f63ab82b45f88b Author: Bram Moolenaar <bram@vim.org> Date: Wed Jan 7 16:54:21 2015 +0100 updated for version 7.4.566 Problem: :argdo, :bufdo, :windo and :tabdo don't take a range. Solution: Support the range. (Marcin Szamotulski) commit e1b3418692037caa2d0fcaa305657dc0164b7255 Author: Bram Moolenaar <bram@vim.org> Date: Wed Jan 7 15:57:17 2015 +0100 updated for version 7.4.565 Problem: Ranges for arguments, buffers, tabs, etc. are not checked to be valid but limited to the maximum. This can cause the wrong thing to happen. Solution: Give an error for an invalid value. (Marcin Szamotulski) Use windows range for ":wincmd". commit bacba2977af76c0de486573670a4eab0079ea105 Author: Bram Moolenaar <bram@vim.org> Date: Wed Jan 7 14:43:39 2015 +0100 updated for version 7.4.564 Problem: FEAT_OSFILETYPE is used even though it's never defined. Solution: Remove the code. (Christian Brabandt) commit adcae6de46e67596bf0445c6cfeabca2a23b102c Author: Bram Moolenaar <bram@vim.org> Date: Wed Jan 7 14:02:52 2015 +0100 updated for version 7.4.563 Problem: No test for replacing on a tab in Virtual replace mode. Solution: Add a test. (Elias Diem) commit 9da970403ea953f8542cb4569d42af11b6b6891b Author: Bram Moolenaar <bram@vim.org> Date: Wed Jan 7 13:31:52 2015 +0100 updated for version 7.4.562 Problem: Segfault with wide screen and error in 'rulerformat'. (Ingo Karkat) Solution: Check there is enough space. (Christian Brabandt) commit 2d435022c101a9abc5a4ee74ab6b74d84d6820b0 Author: Bram Moolenaar <bram@vim.org> Date: Wed Jan 7 13:15:45 2015 +0100 updated for version 7.4.561 Problem: Ex range handling is wrong for buffer-local user commands. Solution: Check for CMD_USER_BUF. (Marcin Szamotulski) commit 80b86b1d76c208721c67741d67527623d6776ff7 Author: Bram Moolenaar <bram@vim.org> Date: Wed Dec 17 21:00:49 2014 +0100 updated for version 7.4.560 Problem: Memory leak using :wviminfo. Issue 296. Solution: Free memory when needed. (idea by Christian Brabandt) commit f6a9542e256efabbc8205200ef04ab02a9882f71 Author: Bram Moolenaar <bram@vim.org> Date: Wed Dec 17 18:35:42 2014 +0100 updated for version 7.4.559 Problem: Appending a block in the middle of a tab does not work correctly when virtualedit is set. Solution: Decrement spaces and count, don't reset them. (James McCoy) commit 5b2388c6297cd0fed5e80ade3fa8d28b7821e086 Author: Bram Moolenaar <bram@vim.org> Date: Wed Dec 17 17:59:31 2014 +0100 updated for version 7.4.558 Problem: When the X server restarts Vim may get stuck. Solution: Destroy the application context and create it again. (Issue 203) commit 9d4d9aa5506ee108824ab644effc84d89ca16ea1 Author: Bram Moolenaar <bram@vim.org> Date: Wed Dec 17 14:47:56 2014 +0100 updated for version 7.4.557 Problem: One more small issue. Solution: Update function proto. commit e49e7509bfb800f2b51ba3d5aed2ee70488ef090 Author: Bram Moolenaar <bram@vim.org> Date: Wed Dec 17 14:46:09 2014 +0100 updated for version 7.4.556 Problem: Failed commands in Python interface not handled correctly. Solution: Restore window and buffer on failure. commit 30d31bd173554b28af883838908644a4e7b4874c Author: Bram Moolenaar <bram@vim.org> Date: Wed Dec 17 14:42:46 2014 +0100 updated for version 7.4.555 Problem: test_close_count may fail for some combination of features. Solution: Require normal features. commit 202ad0b3ed83d79842b347ddd46a0fe39272eff9 Author: Bram Moolenaar <bram@vim.org> Date: Wed Dec 17 14:41:10 2014 +0100 updated for version 7.4.554 Problem: Missing part of patch 7.4.519. Solution: Copy back regprog after calling vim_regexec. commit 15df9f2feb01a3d80ac34ef4d0c6b205c71c4913 Author: Bram Moolenaar <bram@vim.org> Date: Wed Dec 17 14:36:14 2014 +0100 updated for version 7.4.553 Problem: Various small issues. Solution: Fix those issues. commit 379637d7e31f9245546261bda2684545d5a4a734 Author: Bram Moolenaar <bram@vim.org> Date: Sun Dec 14 01:27:49 2014 +0100 Updated runtime files. commit a00bdaeddcb46c7d501942cd3c8d2b3b63eacc35 Author: Bram Moolenaar <bram@vim.org> Date: Sun Dec 14 00:43:54 2014 +0100 updated for version 7.4.552 Problem: Langmap applies to Insert mode expression mappings. Solution: Check for Insert mode. (Daniel Hahler) commit 33ed3fb390264fbba467909d6c97c5d9410d9a26 Author: Bram Moolenaar <bram@vim.org> Date: Sat Dec 13 22:00:22 2014 +0100 updated for version 7.4.551 Problem: "ygn" may yank too much. (Fritzophrenic) Issue 295. Solution: Check the width of the next match. (Christian Brabandt) commit 2d443f8499a062478889e9cc739e6ac311e30276 Author: Bram Moolenaar <bram@vim.org> Date: Sat Dec 13 21:09:57 2014 +0100 updated for version 7.4.550 Problem: curs_rows() function is always called with the second argument false. Solution: Remove the argument. (Christian Brabandt) validate_botline_win() can then also be removed. commit 0f0f2792f36de6c085f7c8ab437658b5eff5f661 Author: Bram Moolenaar <bram@vim.org> Date: Sat Dec 13 21:03:10 2014 +0100 Add new files for 7.4.549. commit 5d2fcaca8f1b051ee5bca3a3b7eafffef7f6dab2 Author: Bram Moolenaar <bram@vim.org> Date: Sat Dec 13 21:00:55 2014 +0100 updated for version 7.4.549 Problem: Function name not recognized correctly when inside a function. Solution: Don't check for an alpha character. commit 602f4f9571141a92176cd9b388822014088a5d71 Author: Bram Moolenaar <bram@vim.org> Date: Sat Dec 13 20:50:09 2014 +0100 updated for version 7.4.548 Problem: Function name not recognized correctly when inside a function. Solution: Don't check for an alpha character. commit 73d7ca332437bf8793a3b0bd38b69769eed83964 Author: Bram Moolenaar <bram@vim.org> Date: Sat Dec 13 20:11:33 2014 +0100 updated for version 7.4.547 Problem: Using "vit" does not select a multi-byte character at the end correctly. Solution: Advance the cursor over the multi-byte character. (Christian Brabandt) commit 5e4f4a4329c72b09d780fbad24bcecde64372acc Author: Bram Moolenaar <bram@vim.org> Date: Sat Dec 13 03:58:09 2014 +0100 updated for version 7.4.546 Problem: Repeated use of vim_snprintf() with a number. Solution: Move these vim_snprintf() calls into a function. commit f78d274a341595052f24f7b66e55e03c1814d31d Author: Bram Moolenaar <bram@vim.org> Date: Sat Dec 13 03:36:39 2014 +0100 updated for version 7.4.545 Problem: Highlighting for multi-line matches is not correct. Solution: Stop highlight at the end of the match. (Hirohito Higashi) commit c3db1ed24f503da2396967a72e2a0578f8c68380 Author: Bram Moolenaar <bram@vim.org> Date: Sat Dec 13 03:20:14 2014 +0100 updated for version 7.4.544 Problem: Warnings for unused arguments when compiling with a combination of features. Solution: Add "UNUSED". commit 17a9d0806f25f0f17fd5b0f0a03029d1be57a7fb Author: Bram Moolenaar <bram@vim.org> Date: Sat Dec 13 03:17:11 2014 +0100 updated for version 7.4.543 Problem: Since patch 7.4.232 "1,3s/\n//" joins two lines instead of three. (Eliseo Martínez) Issue 287 Solution: Correct the line count. (Christian Brabandt) Also set the last used search pattern. commit 88903e377ef73555e0306235743e88c7e505c9ec Author: Bram Moolenaar <bram@vim.org> Date: Mon Dec 8 04:16:44 2014 +0100 updated for version 7.4.542 Problem: Using a range for window and buffer commands has a few problems. Cannot specify the type of range for a user command. Solution: Add the -addr argument for user commands. Fix problems. (Marcin Szamotulski) commit 5a240857d81dad703a78eedbde558db62133a4ab Author: Bram Moolenaar <bram@vim.org> Date: Sun Dec 7 00:18:33 2014 +0100 updated for version 7.4.541 Problem: Crash when doing a range assign. Solution: Check for NULL poiter. (Yukihiro Nakadaira) commit c6ad9960613be206e08b7d9b5374508bed9c3a77 Author: Bram Moolenaar <bram@vim.org> Date: Sat Dec 6 23:33:00 2014 +0100 Update runtime files. commit 950c154d1d10e62bc95e620dc238c663f7d03dfd Author: Bram Moolenaar <bram@vim.org> Date: Sun Nov 30 22:51:06 2014 +0100 updated for version 7.4.540 Problem: Cannot build with tiny and small features. (Taro Muraoka) Solution: Add #ifdef around CMD_USER. commit 0a91d2e9b40e6a1659d201c9047555fccb74d3a6 Author: Bram Moolenaar <bram@vim.org> Date: Sun Nov 30 14:50:16 2014 +0100 updated for version 7.4.539 Problem: Crash when computing buffer count. Problem with range for user commands. Line range wrong in Visual area. Solution: Avoid segfault in compute_buffer_local_count(). Check for CMD_USER when checking type of range. (Marcin Szamotulski) commit bbec8a2bfc32f7d63062eb2afc6e1d9fafebd8ca Author: Bram Moolenaar <bram@vim.org> Date: Sun Nov 30 13:34:23 2014 +0100 updated for version 7.4.538 Problem: Tests fail with small features plus Python. Solution: Disallow weird combination of options. Do not set "fdm" when folding is disabled. commit a395235d384f0540a1c7f59370e8fc431fd9449f Author: Bram Moolenaar <bram@vim.org> Date: Thu Nov 27 19:14:49 2014 +0100 updated for version 7.4.537 Problem: Value of v:hlsearch reflects an internal variable. Solution: Make the value reflect whether search highlighting is actually displayed. (Christian Brabandt) commit 0b172c54a8b351245c5f73a168b402dfcb11ad11 Author: Bram Moolenaar <bram@vim.org> Date: Thu Nov 27 18:57:11 2014 +0100 updated for version 7.4.536 Problem: Test 63 fails when using a black&white terminal. Solution: Add attributes for a non-color terminal. (Christian Brabandt) commit 762754250b412f5ed2e0fcd219421b0ec3f47fac Author: Bram Moolenaar <bram@vim.org> Date: Thu Nov 27 18:33:02 2014 +0100 updated for version 7.4.535 Problem: Can't build with tiny features. Solution: Add #ifdefs and skip a test. commit d337cf7ce9d608bfb9d71e61f1bcaaca6ae0aa3b Author: Bram Moolenaar <bram@vim.org> Date: Thu Nov 27 17:46:22 2014 +0100 Add files added by patch 7.4.530 to the repository. commit be6dab63ce8df521132120bc40e0a9bffdaefdba Author: Bram Moolenaar <bram@vim.org> Date: Thu Nov 27 17:44:08 2014 +0100 updated for version 7.4.534 Problem: Warnings when compiling if_ruby.c. Solution: Avoid the warnings. (Ken Takata) commit 734ca27b386dedf28f88c6a16bf8ca9b8295ab09 Author: Bram Moolenaar <bram@vim.org> Date: Thu Nov 27 17:37:57 2014 +0100 updated for version 7.4.533 Problem: ":hardcopy" leaks memory in case of errors. Solution: Free memory in all code paths. (Christian Brabandt) commit 84fde72a440f99f5df1eac8895f08491078fae6d Author: Bram Moolenaar <bram@vim.org> Date: Thu Nov 27 17:29:56 2014 +0100 updated for version 7.4.532 Problem: When using 'incsearch' "2/pattern/e" highlights the first match. Solution: Move the code to set extra_col inside the loop for count. (Ozaki Kiichi) commit 78a30de7fedbd50151f9313dd544ee3573bcbd25 Author: Bram Moolenaar <bram@vim.org> Date: Thu Nov 27 16:38:11 2014 +0100 updated for version 7.4.531 Problem: Comments about parsing an Ex command are wrong. Solution: Correct the steop numbers. commit cb60568d17deac5606ac0897d517df295788713b Author: Bram Moolenaar <bram@vim.org> Date: Thu Nov 27 16:22:48 2014 +0100 updated for version 7.4.530 Problem: Many commands take a count or range that is not using line numbers. Solution: For each command specify what kind of count it uses. For windows, buffers and arguments have "$" and "." have a relevant meaning. (Marcin Szamotulski) commit 6c0f42e7db17db1f541df13a0856f33b15fed088 Author: Bram Moolenaar <bram@vim.org> Date: Thu Nov 27 14:09:13 2014 +0100 updated for version 7.4.529 Problem: No test for what 7.4.517 fixes. Solution: Adjust the tests for breakindent. (Christian Brabandt) commit a6f88392b4e14b7b821b25f39ea88358ceda9738 Author: Bram Moolenaar <bram@vim.org> Date: Thu Nov 27 13:37:10 2014 +0100 updated for version 7.4.528 Problem: Crash when using matchadd() (Yasuhiro Matsumoto) Solution: Copy the match regprog. commit c9c8e08bb6eefbe9911746dbfccdd12818f4a178 Author: Bram Moolenaar <bram@vim.org> Date: Sun Nov 23 15:57:49 2014 +0100 updated for version 7.4.527 Problem: Still confusing regexp failure and NFA_TOO_EXPENSIVE. Solution: NFA changes equivalent of 7.4.526. commit d6c785d7ffde199f766676824ff5019c7fc4ec48 Author: Bram Moolenaar <bram@vim.org> Date: Thu Nov 20 23:07:05 2014 +0100 updated for version 7.4.526 Problem: matchstr() fails on long text. Daniel Hahler) Solution: Return NFA_TOO_EXPENSIVE from regexec_nl(). (Christian Brabandt) commit 530654c730442925a35ef8384658c9b8f4899787 Author: Bram Moolenaar <bram@vim.org> Date: Wed Nov 19 20:04:48 2014 +0100 updated for version 7.4.525 Problem: map() leaks memory when there is an error in the expression. Solution: Call clear_tv(). (Christian Brabandt) commit 558c7332182e4f019327aa4f432c7a174e57726c Author: Bram Moolenaar <bram@vim.org> Date: Wed Nov 19 19:33:16 2014 +0100 updated for version 7.4.524 Problem: When using ":ownsyntax" spell checking is messed up. (Issue 78) Solution: Use the window-local option values. (Christian Brabandt) commit 8f7897d837e5626786a74fec1a16cfbcb1a91a1b Author: Bram Moolenaar <bram@vim.org> Date: Wed Nov 19 18:54:17 2014 +0100 Update runtime files. commit 452a92f855be9400df3c5aba927338a53555677c Author: Bram Moolenaar <bram@vim.org> Date: Wed Nov 19 18:48:46 2014 +0100 updated for version 7.4.523 Problem: When the X11 server is stopped and restarted, while Vim is kept in the background, copy/paste no longer works. (Issue 203) Solution: Setup the clipboard again. (Christian Brabandt) commit 32fa74316152f8c5514ac6c31b32ec93c329a258 Author: Bram Moolenaar <bram@vim.org> Date: Wed Nov 19 18:03:28 2014 +0100 updated for version 7.4.522 Problem: Specifying wrong buffer size for GetLongPathName(). Solution: Use the actual size. (Ken Takata) commit 6fc0c78a985d53958dd516f29cdf41c2b62c6b8b Author: Bram Moolenaar <bram@vim.org> Date: Wed Nov 19 17:35:39 2014 +0100 updated for version 7.4.521 Problem: When using "vep" a mark is moved to the next line. (Maxi Padulo, Issue 283) Solution: Decrement the line number. (Christian Brabandt) commit 826592e144d1eef76afbd946c91aa94e8fe785a0 Author: Bram Moolenaar <bram@vim.org> Date: Wed Nov 19 17:05:55 2014 +0100 updated for version 7.4.520 Problem: Sun PCK locale is not recognzed. Solution: Add PCK in the table. (Keiichi Oono) commit 6230f9a733f7f8d27c8e650243edd3839398478a Author: Bram Moolenaar <bram@vim.org> Date: Wed Nov 19 16:38:07 2014 +0100 updated for version 7.4.519 Problem: Crash when using syntax highlighting. Solution: When regprog is freed and replaced, store the result. commit 4642f09be61acfea2b1617e37ccf4de01dcce117 Author: Bram Moolenaar <bram@vim.org> Date: Wed Nov 19 13:40:08 2014 +0100 updated for version 7.4.518 Problem: Using status line height in width computations. Solution: Use one instead. (Hirohito Higashi) commit 33db0bb396adc5b2c690c1b7f4602b374a6efb99 Author: Bram Moolenaar <bram@vim.org> Date: Wed Nov 19 13:21:57 2014 +0100 updated for version 7.4.517 Problem: With a wrapping line the cursor may not end up in the right place. (Nazri Ramliy) Solution: Adjust n_extra for a Tab that wraps. (Christian Brabandt) commit 17543ec5d472929df51ae24ebb91212f2bc23726 Author: Bram Moolenaar <bram@vim.org> Date: Thu Nov 13 14:26:09 2014 +0100 Update translations. commit e069f2575670d867aacab078aebb590f252eb754 Author: Bram Moolenaar <bram@vim.org> Date: Thu Nov 13 14:25:38 2014 +0100 Update runtime files. commit 396180439d33903bb75cfd93cb2f2d6114579fdc Author: Bram Moolenaar <bram@vim.org> Date: Wed Nov 12 20:09:06 2014 +0100 updated for version 7.4.516 Problem: Completing a function name containing a # does not work. Issue 253. Solution: Recognize the # character. (Christian Brabandt) commit d59263223f94ccbcb8eb4e060a9bec5ac90ed348 Author: Bram Moolenaar <bram@vim.org> Date: Wed Nov 12 19:28:16 2014 +0100 updated for version 7.4.515 Problem: In a help buffer the global 'foldmethod' is used. (Paul Marshall) Solution: Reset 'foldmethod' when starting to edit a help file. Move the code to a separate function. commit de9274eff78961e936759d473ebc16b7b95b7791 Author: Bram Moolenaar <bram@vim.org> Date: Wed Nov 12 18:59:25 2014 +0100 updated for version 7.4.514 Problem: Memory access error. (Dominique Pelle) Solution: Update tpos. (Christian Brabandt) commit 15fadf064e61562050dc357d252643537bb819c8 Author: Bram Moolenaar <bram@vim.org> Date: Wed Nov 12 18:49:16 2014 +0100 updated for version 7.4.513 Problem: Crash because reference count is wrong for list returned by getreg(). Solution: Increment the reference count. (Kimmy Lindvall) commit 87b33b2cfda004e24f3802a343b40e40dd01fffc Author: Bram Moolenaar <bram@vim.org> Date: Wed Nov 12 16:10:48 2014 +0100 updated for version 7.4.512 Problem: Cannot generate prototypes for Win32 files and VMS. Solution: Add typedefs and #ifdef commit aa613f3a399db10e3709dbfae373d57f99e05ec8 Author: Bram Moolenaar <bram@vim.org> Date: Wed Nov 12 16:05:04 2014 +0100 updated for version 7.4.511 Problem: Generating proto for if_ruby.c uses type not defined elsewhere. Solution: Do not generate a prototype for rb_gc_writebarrier_unprotect_promoted() commit 729e3333695e5a235e6102870d60eb080595b0da Author: Bram Moolenaar <bram@vim.org> Date: Wed Nov 12 15:45:21 2014 +0100 updated for version 7.4.510 Problem: "-fwrapv" argument breaks use of cproto. Solution: Remove the alphabetic arguments in a drastic way. commit a134ba72b4b9398fb8ccd6679e3931fe8890c072 Author: Bram Moolenaar <bram@vim.org> Date: Wed Nov 12 15:15:42 2014 +0100 updated for version 7.4.509 Problem: Users are not aware their encryption is weak. Solution: Give a warning when prompting for the key. commit 4a82a801454892dba3b8cc7134c5d67ef27aa069 Author: Bram Moolenaar <bram@vim.org> Date: Wed Nov 12 13:07:53 2014 +0100 updated for version 7.4.508 Problem: When generating ja.sjis.po the header is not correctly adjusted. Solution: Check for the right header string. (Ken Takata) commit 358cfafd7d2881fa57023bb548e265b44a1075b0 Author: Bram Moolenaar <bram@vim.org> Date: Thu Nov 6 10:03:01 2014 +0100 updated for version 7.4.507 Problem: Building with MingW and Perl. Solution: Remove quotes. (Ken Takata) commit 5aec70f8751961c96767f4bd448d167d8e3573f9 Author: Bram Moolenaar <bram@vim.org> Date: Wed Nov 5 19:33:24 2014 +0100 updated for version 7.4.506 Problem: MS-Windows: Cannot open a file with 259 characters. Solution: Fix off-by-one error. (Ken Takata) commit e2fa5c2d05a265bccc29c11991281c797e50e2ee Author: Bram Moolenaar <bram@vim.org> Date: Wed Nov 5 18:36:03 2014 +0100 updated for version 7.4.505 Problem: On MS-Windows when 'encoding' is a double-byte encoding a file name longer than MAX_PATH bytes but shorter than that in characters causes problems. Solution: Fail on file names longer than MAX_PATH bytes. (Ken Takata) commit 4bbb782cd70e98723326f8e8578cf64adf7a2445 Author: Bram Moolenaar <bram@vim.org> Date: Wed Nov 5 18:18:17 2014 +0100 updated for version 7.4.504 Problem: Restriction of the MS-Windows installer that the path must end in "Vim" prevents installing more than one version. Solution: Remove the restriction. (Tim Lebedkov) commit b1f2d0d8edd79ef5ee0674b1be655aed5d6e5c66 Author: Bram Moolenaar <bram@vim.org> Date: Wed Nov 5 18:06:01 2014 +0100 updated for version 7.4.503 Problem: Cannot append a list of lines to a file. Solution: Add the append option to writefile(). (Yasuhiro Matsumoto) commit e028d0288ed0eaaf10c443ce523f891b3d50a6c9 Author: Bram Moolenaar <bram@vim.org> Date: Wed Nov 5 17:44:52 2014 +0100 updated for version 7.4.502 Problem: Language mapping also applies to mapped characters. Solution: Add the 'langnoremap' option, when on 'langmap' does not apply to mapped characters. (Christian Brabandt) commit 46d1e94d0b851c2245d79f3a8de6d7c0658d93be Author: Bram Moolenaar <bram@vim.org> Date: Wed Nov 5 17:04:18 2014 +0100 updated for version 7.4.501 Problem: Typo in file pattern. Solution: Insert a slash and remove a dot. commit 08a9b33893897ea61ee2a61bc06e12d36b5f70bb Author: Bram Moolenaar <bram@vim.org> Date: Wed Nov 5 17:02:17 2014 +0100 Update runtime files. commit b5dfb30c0a1fb0579165e3b7f65a9201b9d91924 Author: Bram Moolenaar <bram@vim.org> Date: Wed Nov 5 16:39:28 2014 +0100 updated for version 7.4.500 Problem: Test 72 still fails once in a while. Solution: Don't set 'fileformat' to unix, reset it. (Ken Takata) commit d5b48bbc57f89c6ba8a8c2e9733606b40604252f Author: Bram Moolenaar <bram@vim.org> Date: Wed Nov 5 16:03:44 2014 +0100 updated for version 7.4.499 Problem: substitute() can be slow with long strings. Solution: Store a pointer to the end, instead of calling strlen() every time. (Ozaki Kiichi) commit 49e727adb630b90fda793524e95c38019e93ce68 Author: Bram Moolenaar <bram@vim.org> Date: Wed Nov 5 15:46:09 2014 +0100 updated for version 7.4.498 Problem: Typo in DOS makefile. Solution: Change exists to exist. (Ken Takata) commit f96681fd9105905bd7cb31f31143575b19281bde Author: Bram Moolenaar <bram@vim.org> Date: Wed Nov 5 14:27:36 2014 +0100 updated for version 7.4.497 Problem: With some regexp patterns the NFA engine uses many states and becomes very slow. To the user it looks like Vim freezes. Solution: When the number of states reaches a limit fall back to the old engine. (Christian Brabandt) commit 75cccc57d5a4e35cc1b3e29aced799b675cc5a1e Author: Bram Moolenaar <bram@vim.org> Date: Wed Nov 5 13:53:32 2014 +0100 updated for version 7.4.496 Problem: Many lines are both in Make_cyg.mak and Make_ming.mak Solution: Move the common parts to one file. (Ken Takata) commit d115b34622e6665e621d4f5b590c796ad3f56ff9 Author: Bram Moolenaar <bram@vim.org> Date: Wed Nov 5 13:43:21 2014 +0100 updated for version 7.4.495 Problem: XPM isn't used correctly in the Cygwin Makefile. Solution: Include the rules like in Make_ming.mak. (Ken Takata) commit 5fd2c434541983ece473dcbc9edd1330dfca4601 Author: Bram Moolenaar <bram@vim.org> Date: Wed Nov 5 09:53:23 2014 +0100 updated for version 7.4.494 Problem: Cursor shape is wrong after a CompleteDone autocommand. Solution: Update the cursor and mouse shape after ":normal" restores the state. (Jacob Niehus) commit 76262a4936163a100817564a74f7bbde8e8bbba5 Author: Bram Moolenaar <bram@vim.org> Date: Fri Oct 31 19:51:36 2014 +0100 updated for version 7.4.493 Problem: A TextChanged autocommand is triggered when saving a file. (William Gardner) Solution: Update last_changedtick after calling unchanged(). (Christian Brabandt) commit 0682052f88f85b893400183e753f3dec49769b48 Author: Bram Moolenaar <bram@vim.org> Date: Fri Oct 31 19:20:36 2014 +0100 updated for version 7.4.492 Problem: In Insert mode, after inserting a newline that inserts a comment leader, CTRL-O moves to the right. (ZyX) Issue 57. Solution: Correct the condition for moving the cursor back to the NUL. (Christian Brabandt) commit 3ad3e53ca5c28de0dc3def06eea5d219326e6462 Author: Bram Moolenaar <bram@vim.org> Date: Fri Oct 31 15:45:52 2014 +0100 updated for version 7.4.491 Problem: When winrestview() has a negative "topline" value there are display errors. Solution: Correct a negative value to 1. (Hirohito Higashi) commit a2c6b291013ee1494acbba5e8c279cb8c3053f80 Author: Bram Moolenaar <bram@vim.org> Date: Fri Oct 31 13:54:25 2014 +0100 updated for version 7.4.490 Problem: Cannot specify the buffer to use for "do" and "dp", making them useless for three-way diff. Solution: Use the count as the buffer number. (James McCoy) commit 8fbf31af1b989fd75a68a715bb10a41b22ce9225 Author: Bram Moolenaar <bram@vim.org> Date: Fri Oct 31 12:42:01 2014 +0100 updated for version 7.4.489 Problem: Cursor movement still wrong when 'lbr' is set and there is a number column. (Hirohito Higashi) Solution: Add correction for number column. (Hiroyuki Takagi) commit a7e2dd5543bd54bc576072832acc6312c112991b Author: Bram Moolenaar <bram@vim.org> Date: Wed Oct 22 22:09:01 2014 +0200 updated for version 7.4.488 Problem: test_mapping fails for some people. Solution: Set the 'encoding' option. (Ken Takata) commit fdd803e6bfe8326ac998cac9ba7d8315cd7089cf Author: Bram Moolenaar <bram@vim.org> Date: Tue Oct 21 22:36:31 2014 +0200 Add the missing test files. commit 4905c2b508f507248632c9a1c7237b4c71852f3c Author: Bram Moolenaar <bram@vim.org> Date: Tue Oct 21 20:57:15 2014 +0200 updated for version 7.4.487 Problem: ":sign jump" may use another window even though the file is already edited in the current window. Solution: First check if the file is in the current window. (James McCoy) commit 564e22eebebd6baa72346e783c8031d6fc70cde1 Author: Bram Moolenaar <bram@vim.org> Date: Tue Oct 21 20:01:58 2014 +0200 updated for version 7.4.486 Problem: Check for writing to a yank register is wrong. Solution: Negate the check. (Zyx). Also clean up the #ifdefs. commit 9b88289483abc9abc4c14cf14f8672625c233482 Author: Bram Moolenaar <bram@vim.org> Date: Tue Oct 21 19:35:31 2014 +0200 updated for version 7.4.485 Problem: Abbreviations don't work. (Toothpik) Solution: Move the length computation inside the for loop. Compare against the unescaped key. commit 84ac59d9b0f76dbbb3dddabe2c53d28fe3592f81 Author: Bram Moolenaar <bram@vim.org> Date: Tue Oct 21 18:17:09 2014 +0200 updated for version 7.4.484 Problem: Compiler warning on MS-Windows. (Ken Takata) Solution: Add type cast. commit 784f468def91b3c9baff85674e036f61a3158377 Author: Bram Moolenaar <bram@vim.org> Date: Tue Oct 21 16:22:17 2014 +0200 updated for version 7.4.483 Problem: A 0x80 byte is not handled correctly in abbreviations. Solution: Unescape special characters. Add a test. (Christian Brabandt) commit 622de7ababdb451f6b28d22d02481d836687abae Author: Bram Moolenaar <bram@vim.org> Date: Tue Oct 21 14:15:17 2014 +0200 updated for version 7.4.482 Problem: When 'balloonexpr' results in a list, the text has a trailing newline. (Lcd) Solution: Remove one trailing newline. commit 692cb8c7bd1e0838c99bfb1a91fa12af28a6c358 Author: Bram Moolenaar <bram@vim.org> Date: Thu Oct 16 20:35:36 2014 +0200 updated for version 7.4.481 Problem: Compiler warning on MS-Windows. Solution: Add type casts. (Ken Takata) commit e6a61dafe8147999fba507f097a46ab678fd0531 Author: Bram Moolenaar <bram@vim.org> Date: Thu Oct 16 16:16:37 2014 +0200 updated for version 7.4.480 Problem: MS-Windows: Can't build. Solution: Remove goto, use a flag instead. commit 3cd009196341948f0730fe9f42859660bf759093 Author: Bram Moolenaar <bram@vim.org> Date: Wed Oct 15 22:51:52 2014 +0200 Update runtime files and translations. commit 8d77464e654d6e10b64aa203325b527b3f2ca41d Author: Bram Moolenaar <bram@vim.org> Date: Wed Oct 15 22:50:10 2014 +0200 updated for version 7.4.479 Problem: MS-Windows: The console title can be wrong. Solution: Take the encoding into account. When restoring the title use the right function. (Yasuhiro Matsumoto) commit c7c8f02b53e0ab53065065c2410011cd9d89fe4a Author: Bram Moolenaar <bram@vim.org> Date: Wed Oct 15 21:26:40 2014 +0200 updated for version 7.4.478 Problem: Using byte length instead of character length for 'showbreak'. Solution: Compute the character length. (Marco Hinz) commit b4999d92327479875411f64fa2b99ef949697d12 Author: Bram Moolenaar <bram@vim.org> Date: Wed Oct 15 12:56:49 2014 +0200 updated for version 7.4.477 Problem: When using ":%diffput" and the other file is empty an extra empty line remains. Solution: Set the buf_empty flag. commit b37cbf4e9f2ea4115beae4f475bd9207d81f9591 Author: Bram Moolenaar <bram@vim.org> Date: Wed Oct 15 12:07:11 2014 +0200 updated for version 7.4.476 Problem: MingW: compiling with "XPM=no" doesn't work. Solution: Check for the "no" value. (KF Leong) Also for Cygwin. (Ken Takata) commit 8e7dc7de6175fb68810c105738d3901ab201011e Author: Bram Moolenaar <bram@vim.org> Date: Sat Oct 11 14:47:26 2014 +0200 updated for version 7.4.475 Problem: Can't compile on a system where Xutf8SetWMProperties() is not in the X11 library. Issue 265. Solution: Add a configure check. commit ce6dfbe334c8b91a248b53a264d53ea0e92b2188 Author: Bram Moolenaar <bram@vim.org> Date: Sat Oct 11 12:48:26 2014 +0200 updated for version 7.4.474 Problem: AIX compiler can't handle // comment. Issue 265. Solution: Remove that line. commit 5c7e13cf57c0fb6f701d0e7ad25e1c043999009c Author: Bram Moolenaar <bram@vim.org> Date: Fri Oct 10 15:34:33 2014 +0200 updated for version 7.4.473 Problem: Cursor movement is incorrect when there is a number column/sign/fold column and 'sbr' is displayed. Solution: Adjust the column for 'sbr'. (Christian Brabandt) commit ae983fe6b99dd413fe919da3995841da383cca14 Author: Bram Moolenaar <bram@vim.org> Date: Fri Oct 10 15:28:46 2014 +0200 updated for version 7.4.472 Problem: The "precedes" entry in 'listchar' will be drawn when 'showbreak is set and list is not. Solution: Only draw this character when 'list' is on. (Christian Brabandt) commit 9dd25d085c7fa4cc198dd70b2c3f3b32690de445 Author: Bram Moolenaar <bram@vim.org> Date: Thu Oct 9 17:05:56 2014 +0200 updated for version 7.4.471 Problem: MS-Windows: When printer name contains multi-byte, the name is displayed as ???. Solution: Convert the printer name from the active codepage to 'encoding'. (Yasuhiro Matsumoto) commit 721991655b939cc50fa750bf95c226eb54fcd237 Author: Bram Moolenaar <bram@vim.org> Date: Thu Oct 9 15:37:06 2014 +0200 updated for version 7.4.470 Problem: Test 11 and 100 do not work properly on Windows. Solution: Avoid using feedkeys(). (Ken Takata) commit f67aa1992552c299febdd4bc4f7c278581598a7a Author: Bram Moolenaar <bram@vim.org> Date: Thu Oct 9 14:48:30 2014 +0200 updated for version 7.4.469 Problem: Can't build with MSVC. (Ken Takata) Solution: Move the assignment after the declarations. commit 598e7564533af08c8e8995fe790f1ec3b0b8dd98 Author: Bram Moolenaar <bram@vim.org> Date: Thu Oct 9 13:36:16 2014 +0200 updated for version 7.4.468 Problem: Issue 26: CTRL-C does not interrupt after it was mapped and then unmapped. Solution: Reset mapped_ctrl_c. (Christian Brabandt) commit dd4ee04855057f764c312fdb42024bff0624dd3e Author: Bram Moolenaar <bram@vim.org> Date: Thu Oct 9 13:24:43 2014 +0200 updated for version 7.4.467 commit 030e89c0a365390977204f8b0c2f3ad6f7e63196 Author: Bram Moolenaar <bram@vim.org> Date: Thu Oct 9 10:44:37 2014 +0200 updated for version 7.4.466 Problem: CTRL-W } does not open preview window. (Erik Falor) Solution: Don't set g_do_tagpreview for CTRL-W }. commit b4767e35bd809746a93f347f41eb8f37cb687128 Author: Bram Moolenaar <bram@vim.org> Date: Tue Oct 7 10:38:40 2014 +0200 updated for version 7.4.465 Problem: Crash when expanding a very long string. Solution: Use wsncpy() instead of wcscpy(). (Ken Takata) commit 377ba8e5a0df0c1d71a810896e2d1510ffc4ef20 Author: Bram Moolenaar <bram@vim.org> Date: Mon Oct 6 18:10:09 2014 +0200 updated for version 7.4.464 Problem: Compiler warning. Solution: Add type cast. (Ken Takata) commit 7a9af0765d643eb793d400e5cb40824ff6f565db Author: Bram Moolenaar <bram@vim.org> Date: Thu Oct 2 01:41:41 2014 +0200 Update runtime files. commit 0df824425be03743f37435381f8f3317db44cd57 Author: Bram Moolenaar <bram@vim.org> Date: Mon Sep 29 18:08:59 2014 +0200 updated for version 7.4.463 Problem: Test 86 and 87 may hang on MS-Windows. Solution: Call inputrestore() after inputsave(). (Ken Takata) commit 2f9ff92671dea94a90b5c9810bd98922e29caf3d Author: Bram Moolenaar <bram@vim.org> Date: Mon Sep 29 17:15:18 2014 +0200 updated for version 7.4.462 Problem: Setting the local value of 'backupcopy' empty gives an error. (Peter Mattern) Solution: When using an empty value set the flags to zero. (Hirohito Higashi) commit e0f839194fb7c1d89ce22177dec0bb57c498ee68 Author: Bram Moolenaar <bram@vim.org> Date: Sat Sep 27 11:18:19 2014 +0200 updated for version 7.4.461 Problem: MS-Windows: When collate is on the number of copies is too high. Solution: Only set the collated/uncollated count when collate is on. (Yasuhiro Matsumoto) commit 9de1a12da0e9bdf6b2e2056146d34fe1a944ef6f Author: Bram Moolenaar <bram@vim.org> Date: Wed Sep 24 13:26:44 2014 +0200 updated for version 7.4.460 Problem: Can't build without the quickfix feature. (Erik Falor) Solution: Add a #ifdef. commit f1ae5f80960aa1b56941d59f34e132c2542fbdf7 Author: Bram Moolenaar <bram@vim.org> Date: Tue Sep 23 21:53:41 2014 +0200 updated for version 7.4.459 Problem: Can't change the icon after building Vim. Solution: Load the icon from a file on startup. (Yasuhiro Matsumoto) commit 1eefca4120bef37fe75a48b2ba7018e6c6269c65 Author: Bram Moolenaar <bram@vim.org> Date: Tue Sep 23 18:37:56 2014 +0200 updated for version 7.4.458 Problem: Issue 252: Cursor moves in a zero-height window. Solution: Check for zero height. (idea by Christian Brabandt) commit 089c2fa3241c825ed35369b26162013b283631af Author: Bram Moolenaar <bram@vim.org> Date: Tue Sep 23 16:49:46 2014 +0200 updated for version 7.4.457 Problem: Using getchar() in an expression mapping may result in K_CURSORHOLD, which can't be recognized. Solution: Add the <CursorHold> key. (Hirohito Higashi) commit 6458fa9fced914a02d41b62a3f687ea740354a39 Author: Bram Moolenaar <bram@vim.org> Date: Tue Sep 23 15:45:08 2014 +0200 updated for version 7.4.456 Problem: 'backupcopy' is global, cannot write only some files in a different way. Solution: Make 'backupcopy' global-local. (Christian Brabandt) commit 2c45d1f44797f34b7643fb7251d65bcb602fe792 Author: Bram Moolenaar <bram@vim.org> Date: Tue Sep 23 14:24:40 2014 +0200 updated for version 7.4.455 Problem: Completion for :buf does not use 'wildignorecase'. (Akshay H) Solution: Pass the 'wildignorecase' flag around. commit 53dee4541d9055f4f7f4ca19fe56c08f04baa821 Author: Bram Moolenaar <bram@vim.org> Date: Tue Sep 23 13:48:43 2014 +0200 updated for version 7.4.454 Problem: When using a Visual selection of multiple words and doing CTRL-W_] it jumps to the tag matching the word under the cursor, not the selected text. (Patrick hemmer) Solution: Do not reset Visual mode. (idea by Christian Brabandt) commit 85fd8d71debe3ec276c76492133aeb0e8bbc264b Author: Bram Moolenaar <bram@vim.org> Date: Fri Sep 19 22:38:48 2014 +0200 Updated runtime files. commit 6b9af9b2c4ec39f7f7d48f95f23404b1a2a451f7 Author: Bram Moolenaar <bram@vim.org> Date: Fri Sep 19 22:23:26 2014 +0200 updated for version 7.4.453 Problem: Still can't build with tiny features. Solution: Add #ifdef. commit 832bd4965bedf305e1bc701038ad4b1f981807dc Author: Bram Moolenaar <bram@vim.org> Date: Fri Sep 19 22:05:53 2014 +0200 updated for version 7.4.452 Problem: Can't build with tiny features. (Tony Mechelynck) Solution: Use "return" instead of "break". commit d545ea52b4ab71379e4d997d77d439cded18e702 Author: Bram Moolenaar <bram@vim.org> Date: Fri Sep 19 20:45:23 2014 +0200 updated for version 7.4.451 Problem: Calling system() with empty input gives an error for writing the temp file. Solution: Do not try writing if the string length is zero. (Olaf Dabrunz) commit 83ef225c2c854db121ca9630c55807b24f8001dd Author: Bram Moolenaar <bram@vim.org> Date: Fri Sep 19 20:07:26 2014 +0200 updated for version 7.4.450 Problem: Not all commands that edit another buffer support the +cmd argument. Solution: Add the +cmd argument to relevant commands. (Marcin Szamotulski) commit a861246e2cd3df03ace1cd658c1c30a4f45540ee Author: Bram Moolenaar <bram@vim.org> Date: Fri Sep 19 19:39:34 2014 +0200 updated for version 7.4.449 Problem: Can't easily close the help window. (Chris Gaal) Solution: Add ":helpclose". (Christian Brabandt) commit bb03acc5a2728579d971b251c25c227801694b48 Author: Bram Moolenaar <bram@vim.org> Date: Fri Sep 19 16:13:53 2014 +0200 updated for version 7.4.448 Problem: Using ETO_IGNORELANGUAGE causes problems. Solution: Remove this flag. (Paul Moore) commit ffc23f09d3a23667c79b6fbd8a5af9d3b21e551d Author: Bram Moolenaar <bram@vim.org> Date: Fri Sep 19 16:04:11 2014 +0200 updated for version 7.4.447 Problem: Spell files from Hunspell may generate a lot of errors. Solution: Add the IGNOREEXTRA flag. commit cafe810ab1af670ad2224ccc53d7deaf0304530e Author: Bram Moolenaar <bram@vim.org> Date: Fri Sep 19 14:26:36 2014 +0200 updated for version 7.4.446 Problem: In some situations, when setting up an environment to trigger an autocommand, the environment is not properly restored. Solution: Check the return value of switch_win() and call restore_win() always. (Daniel Hahler) commit 784c692476ea03439d07b0b437385278727f56f4 Author: Bram Moolenaar <bram@vim.org> Date: Fri Sep 19 13:46:52 2014 +0200 updated for version 7.4.445 Problem: Clipboard may be cleared on startup. Solution: Set clip_did_set_selection to -1 during startup. (Christian Brabandt) commit 033888d07833234eff0dad596b601451dc902ac9 Author: Bram Moolenaar <bram@vim.org> Date: Mon Sep 15 14:25:54 2014 +0200 updated for version 7.4.444 Problem: Reversed question mark not recognized as punctuation. (Issue 258) Solution: Add the Supplemental Punctuation range. commit 4f5f877461520b90ede82728acf63249f8c8f441 Author: Bram Moolenaar <bram@vim.org> Date: Thu Sep 11 22:50:09 2014 +0200 updated for version 7.4.443 Problem: Error reported by ubsan when running test 72. Solution: Add type cast to unsigned. (Dominique Pelle) commit 27769e8163434a4a73791537bcf98b0d2a18cdbf Author: Bram Moolenaar <bram@vim.org> Date: Tue Sep 9 23:11:49 2014 +0200 updated for version 7.4.442 Problem: Using unitinialized variable. Solution: Pass the first window of the tabpage. commit 1951e669a7297318621dbe440f5539b6846ef554 Author: Bram Moolenaar <bram@vim.org> Date: Tue Sep 9 18:48:09 2014 +0200 Update runtime files. commit 5a1a4b6290b8a072e5b12c2abaa1bec338749a82 Author: Bram Moolenaar <bram@vim.org> Date: Tue Sep 9 18:45:49 2014 +0200 updated for version 7.4.441 Problem: Endless loop and other problems when 'cedit' is set to CTRL-C. Solution: Do not call ex_window() when ex_normal_busy or got_int was set. (Yasuhiro Matsumoto) commit 4863d3cd7a4f6dcb4848761ac0c3e6ad0c55c77f Author: Bram Moolenaar <bram@vim.org> Date: Tue Sep 9 18:29:33 2014 +0200 updated for version 7.4.440 Problem: Omni complete popup drawn incorrectly. Solution: Call validate_cursor() instead of check_cursor(). (Hirohito Higashi) commit f6d9276cede71c8d4ca7d2e930e9e0604281306f Author: Bram Moolenaar <bram@vim.org> Date: Tue Sep 9 17:47:38 2014 +0200 updated for version 7.4.439 Problem: Duplicate message in message history. Some quickfix messages appear twice. (Gary Johnson) Solution: Do not reset keep_msg too early. (Hirohito Higashi) commit 132b4526bb6011c70ee901ef9c8a51f39ece741d Author: Bram Moolenaar <bram@vim.org> Date: Tue Sep 9 17:33:07 2014 +0200 updated for version 7.4.438 Problem: Cached values for 'cino' not reset for ":set all&". Solution: Call parse_cino(). (Yukihiro Nakadaira) commit 1aa7446ac7eb540af30136427bc4a7b107856aed Author: Bram Moolenaar <bram@vim.org> Date: Tue Sep 9 17:18:49 2014 +0200 updated for version 7.4.437 Problem: New and old regexp engine are not consistent. Solution: Also give an error for "\ze*" for the old regexp engine. commit 474a3e07e95ccdcf03368d201e637fa52e08ca93 Author: Bram Moolenaar <bram@vim.org> Date: Tue Sep 9 16:59:38 2014 +0200 updated for version 7.4.436 Problem: ml_get error for autocommand that moves the cursor of the current window. Solution: Check the cursor position after switching back to the current buffer. (Christian Brabandt) commit 34fda24024a74866985f20710172da18b977b5fd Author: Bram Moolenaar <bram@vim.org> Date: Tue Sep 9 16:32:39 2014 +0200 updated for version 7.4.435 Problem: Line formatting behaves differently when 'linebreak' is set. (mvxxc) Solution: Disable 'linebreak' temporarily. (Christian Brabandt) commit 1b7f89b2e3bed5a45688b9e882d115016618c638 Author: Bram Moolenaar <bram@vim.org> Date: Tue Sep 9 16:13:08 2014 +0200 updated for version 7.4.434 Problem: gettabvar() is not consistent with getwinvar() and getbufvar(). Solution: Return a dict with all variables when the varname is empty. (Yasuhiro Matsumoto) commit f0777cca8fcfc7dd3ba21709ef374318d1f069b9 Author: Bram Moolenaar <bram@vim.org> Date: Tue Sep 9 13:52:58 2014 +0200 updated for version 7.4.433 Problem: Test 75 fails on MS-Windows. Solution: Use ":normal" instead of feedkeys(). (Michael Soyka) commit 8e9462d61cca431883ac4b3ffa55ad7e27490b32 Author: Bram Moolenaar <bram@vim.org> Date: Tue Sep 9 12:25:33 2014 +0200 updated for version 7.4.432 Problem: When the startup code expands command line arguments, setting 'encoding' will not properly convert the arguments. Solution: Call get_cmd_argsW() early in main(). (Yasuhiro Matsumoto) commit e92b3ebb71d2af4694b222bf80b3602d2de394d1 Author: Bram Moolenaar <bram@vim.org> Date: Tue Sep 9 12:22:06 2014 +0200 updated for version 7.4.431 Problem: Compiler warning. Solution: Add type cast. (Mike Williams) commit 0833cf1a93fab1bb937d7df7253d4c95dfe90e3a Author: Bram Moolenaar <bram@vim.org> Date: Sat Aug 30 18:10:18 2014 +0200 updated for version 7.4.430 Problem: test_listlbr fails when compiled with normal features. Solution: Check for the +conceal feature. commit e10278a6f1972458276ac70673b8b774bcfe8078 Author: Bram Moolenaar <bram@vim.org> Date: Sat Aug 30 13:32:06 2014 +0200 updated for version 7.4.429 Problem: Build fails with fewer features. (Elimar Riesebieter) Solution: Add #ifdef. commit 73828b3129eff3524bbcb813634173cccd1c41a9 Author: Bram Moolenaar <bram@vim.org> Date: Fri Aug 29 17:45:32 2014 +0200 updated for version 7.4.428 Problem: executable() may return a wrong result on MS-Windows. Solution: Change the way SearchPath() is called. (Yasuhiro Matsumoto, Ken Takata) commit ca4e9f6e87abe2e1ca6c58e78cf96b11cc9d616c Author: Bram Moolenaar <bram@vim.org> Date: Fri Aug 29 15:53:52 2014 +0200 updated for version 7.4.427 Problem: When an InsertCharPre autocommand executes system() typeahead may be echoed and messes up the display. (Jacob Niehus) Solution: Do not set cooked mode when invoked from ":silent". commit bded0ac7d24ce3ef71f2409f40d00a398866edb8 Author: Bram Moolenaar <bram@vim.org> Date: Fri Aug 29 15:12:54 2014 +0200 updated for version 7.4.426 Problem: README File missing from list of files. Solution: Update the list of files. commit 3e97c4e081f070f656f4a406048e96ab4fb79cff Author: Bram Moolenaar <bram@vim.org> Date: Fri Aug 29 15:12:19 2014 +0200 Update runtime files. commit ae6872bd5793894d4d02043c308dafdf40107d12 Author: Bram Moolenaar <bram@vim.org> Date: Fri Aug 29 14:20:51 2014 +0200 updated for version 7.4.425 Problem: When 'showbreak' is used "gj" may move to the wrong position. (Nazri Ramliy) Solution: Adjust virtcol when 'showbreak' is set. (Christian Brabandt) commit ac7b295d45ba4ad003654198abc9a27edd670be8 Author: Bram Moolenaar <bram@vim.org> Date: Fri Aug 29 13:49:52 2014 +0200 updated for version 7.4.424 Problem: Get ml_get error when using Python to delete lines in a buffer that is not in a window. issue 248. Solution: Do not try adjusting the cursor for a different buffer. commit 6097ee62092e6573386f212b78b384216f68ad0a Author: Bram Moolenaar <bram@vim.org> Date: Fri Aug 29 12:58:44 2014 +0200 updated for version 7.4.423 Problem: expand("$shell") does not work as documented. Solution: Do not escape the $ when expanding environment variables. commit ce282c68428239edcb008a4f0723ae3b5fc8a97e Author: Bram Moolenaar <bram@vim.org> Date: Fri Aug 29 12:08:43 2014 +0200 updated for version 7.4.422 Problem: When using conceal with linebreak some text is not displayed correctly. (Grüner Gimpel) Solution: Check for conceal mode when using linebreak. (Christian Brabandt) commit bf9683f2cb55c283f0772f65ffae1ea494353db8 Author: Bram Moolenaar <bram@vim.org> Date: Fri Aug 29 11:56:32 2014 +0200 updated for version 7.4.421 Problem: Crash when searching for "\ze*". (Urtica Dioica) Solution: Disallow a multi after \ze and \zs. commit ccd409ed57769472f1d023bd8853b434d2d9ab23 Author: Bram Moolenaar <bram@vim.org> Date: Fri Aug 29 10:04:47 2014 +0200 updated for version 7.4.420 Problem: It's not obvious how to add a new test. Solution: Add a README file. (Christian Brabandt) commit af55596a0743940d5d43b6d94756fd273a3f0db4 Author: Bram Moolenaar <bram@vim.org> Date: Fri Aug 29 09:46:10 2014 +0200 updated for version 7.4.419 Problem: Whan part of a list is locked it's possible to make changes. Solution: Check if any of the list items is locked before make a change. (ZyX) commit be54cd8c54f77925a61408370d3476b4d9a4cd79 Author: Bram Moolenaar <bram@vim.org> Date: Fri Aug 29 09:02:27 2014 +0200 updated for version 7.4.418 Problem: When leaving ":append" the cursor shape is like in Insert mode. (Jacob Niehus) Solution: Do not have State set to INSERT when calling getline(). commit ca638a866ab842768de3f05e792cd828882b3b92 Author: Bram Moolenaar <bram@vim.org> Date: Sun Aug 24 21:39:49 2014 +0200 updated for version 7.4.417 Problem: After splitting a window and setting 'breakindent' the default minimum with is not respected. Solution: Call briopt_check() when copying options to a new window. commit ea5cc41b6db46dc7c80dcf055124df3c20272886 Author: Bram Moolenaar <bram@vim.org> Date: Sun Aug 24 21:19:25 2014 +0200 updated for version 7.4.416 Problem: Problem with breakindent/showbreak and tabs. Solution: Handle tabs differently. (Christian Brabandt) commit 4d05f31eb31287ef039e571b1c28629b9c27f1fa Author: Bram Moolenaar <bram@vim.org> Date: Sat Aug 23 15:31:19 2014 +0200 Runtime file updates. commit 25fb2dc13c2b56051ac32b13ab4ec65dd01068ec Author: Bram Moolenaar <bram@vim.org> Date: Sat Aug 23 14:18:52 2014 +0200 Update version number to 7.4.415 commit 7a0ccc850828864c2c05735a9c8058b8c4b9ae2f Author: Bram Moolenaar <bram@vim.org> Date: Sat Aug 23 14:16:20 2014 +0200 updated for version 7.4.415 Problem: Cannot build. Warning for shadowed variable. (John Little) Solution: Add missing change. Remove declaration. commit b6350a943d9e87baf00a2e7f5806884c300a9a74 Author: Bram Moolenaar <bram@vim.org> Date: Fri Aug 22 23:05:54 2014 +0200 updated for version 7.4.414 Problem: Cannot define a command only when it's used. Solution: Add the CmdUndefined autocommand event. (partly by Yasuhiro Matsumoto) commit 654e2b43556e89175145edf28b576612fc65b7f9 Author: Bram Moolenaar <bram@vim.org> Date: Fri Aug 22 19:21:47 2014 +0200 Updated runtime files. commit 9f6446edac88e347961d9a94a3e247669cf41ac7 Author: Bram Moolenaar <bram@vim.org> Date: Fri Aug 22 18:44:33 2014 +0200 updated for version 7.4.413 Problem: MS-Windows: Using US international keyboard layout, inserting dead key by pressing space does not always work. Issue 250. Solution: Let MS-Windows translate the message. (John Wellesz) commit a3d4266909ed2f060d348b956321995cdab9fa86 Author: Bram Moolenaar <bram@vim.org> Date: Fri Aug 22 18:12:57 2014 +0200 updated for version 7.4.412 Problem: Can't build on Windows XP with MSVC. Solution: Add SUBSYSTEM_VER to the Makefile. (Yongwei Wu) commit 7650b4900c577322416d2899f872dc866fc9a359 Author: Bram Moolenaar <bram@vim.org> Date: Fri Aug 22 13:13:27 2014 +0200 updated for version 7.4.411 Problem: "foo bar" sorts before "foo" with sort(). (John Little) Solution: Avoid putting quotes around strings before comparing them. commit 60e656878f3e42a25a0e2078c538d1be91051c6a Author: Bram Moolenaar <bram@vim.org> Date: Sun Aug 17 17:24:07 2014 +0200 updated for version 7.4.410 Problem: Fold does not open after search when there is a CmdwinLeave autocommand. Solution: Restore KeyTyped. (Jacob Niehus) commit c891e7502274aaa7a88919985cedc6c153a9e835 Author: Bram Moolenaar <bram@vim.org> Date: Sun Aug 17 17:05:44 2014 +0200 updated for version 7.4.409 Problem: Can't build with Perl on Fedora 20. Solution: Find xsubpp in another directory. (Michael Henry) commit 61df1ed9092a91854c2918cffd83dd95c64f2b79 Author: Bram Moolenaar <bram@vim.org> Date: Sat Aug 16 19:45:02 2014 +0200 Add files missing from 7.4.408. commit ccd42ea0ffd228ff54b5459260901ffa3a846e94 Author: Bram Moolenaar <bram@vim.org> Date: Sat Aug 16 18:36:43 2014 +0200 updated for version 7.4.408 Problem: Visual block insert breaks a multi-byte character. Solution: Calculate the position properly. (Yasuhiro Matsumoto) commit b1b3b58748c729c78ba4dd702e1bd2cc3c374424 Author: Bram Moolenaar <bram@vim.org> Date: Sat Aug 16 18:13:03 2014 +0200 updated for version 7.4.407 Problem: Inserting text for Visual block mode, with cursor movement, repeats the wrong text. (Aleksandar Ivanov) Solution: Reset the update_Insstart_orig flag. (Christian Brabandt) commit 30d4cec9339386d249eb9741ed5d04aade1d8aaf Author: Bram Moolenaar <bram@vim.org> Date: Sat Aug 16 17:34:34 2014 +0200 updated for version 7.4.406 Problem: Test 72 and 100 fail on MS-Windows. Solution: Set fileformat to unix in the tests. (Taro Muraoka) commit e7b8a833df32ff7ab9613e2948a1865b3e55952d Author: Bram Moolenaar <bram@vim.org> Date: Sat Aug 16 16:28:36 2014 +0200 updated for version 7.4.405 Problem: Screen updating is slow when using matches. Solution: Do not use the ">=" as in patch 7.4.362, check the lnum. commit b5af617660c1067535c86ce208635261dec3ce62 Author: Bram Moolenaar <bram@vim.org> Date: Wed Aug 13 22:05:53 2014 +0200 updated for version 7.4.404 Problem: Windows 64 bit compiler warnings. Solution: Add type casts. (Mike Williams) commit fe22ea648c5e69329a05cfc88c9b4aba77e0bdc1 Author: Bram Moolenaar <bram@vim.org> Date: Wed Aug 13 21:58:28 2014 +0200 updated for version 7.4.403 Problem: Valgrind reports errors when running test 72. (Dominique Pelle) Solution: Reset the local 'cryptmethod' option before storing the seed. Set the seed in the memfile even when there is no block0 yet. commit 0f0cedd91f44e18b0a6373d168611f95bf15c771 Author: Bram Moolenaar <bram@vim.org> Date: Tue Aug 12 20:14:33 2014 +0200 updated for version 7.4.402 Problem: Test 72 crashes under certain conditions. (Kazunobu Kuriyama) Solution: Clear the whole bufinfo_T early. commit 0de13a29be8e0c18f9f30cdbf031012eb542cef6 Author: Bram Moolenaar <bram@vim.org> Date: Sun Aug 10 16:31:50 2014 +0200 updated for version 7.4.401 Problem: Can't build on MS-Windows. Solution: Include the new files in all the Makefiles. commit ee2dc2bbfb2401383e851175c67382f752509c00 Author: Bram Moolenaar <bram@vim.org> Date: Sun Aug 10 13:46:36 2014 +0200 updated for version 7.4.400 Problem: List of distributed files is incomplete. Solution: Add recently added files. commit eb2011c6a57ad68a61637c2476e2ecb1bf58003e Author: Bram Moolenaar <bram@vim.org> Date: Sun Aug 10 13:38:34 2014 +0200 updated for version 7.4.399 Problem: Encryption implementation is messy. Blowfish encryption has a weakness. Solution: Refactor the encryption, store the state in an allocated struct instead of using a save/restore mechanism. Introduce the "blowfish2" method, which does not have the weakness and encrypts the whole undo file. (largely by David Leadbeater) commit 3be1d504d7cb78d8f014d958eb7d522b7855b24b Author: Bram Moolenaar <bram@vim.org> Date: Thu Aug 7 13:55:10 2014 +0200 updated for version 7.4.398 Problem: Gcc error for the argument of InterlockedIncrement() and InterlockedDecrement(). (Axel Bender) Solution: Remove "unsigned" from the cRefCount_ declaration. commit 8cbcf3f93a553cb06862388222119a93ef8c9af0 Author: Bram Moolenaar <bram@vim.org> Date: Wed Aug 6 19:09:16 2014 +0200 updated for version 7.4.397 Problem: Matchparen only uses the topmost syntax item. Solution: Go through the syntax stack to find items. (James McCoy) Also use getcurpos() when possible. commit 1fec1248c1326a6785338ebcfef9cc0c3364a604 Author: Bram Moolenaar <bram@vim.org> Date: Wed Aug 6 18:17:11 2014 +0200 updated for version 7.4.396 Problem: When 'clipboard' is "unnamed", :g/pat/d is very slow. (Praful) Solution: Only set the clipboard after the last delete. (Christian Brabandt) commit b67f4307d54bf0c940a64db07fad6b497be0129f Author: Bram Moolenaar <bram@vim.org> Date: Wed Aug 6 17:44:14 2014 +0200 updated for version 7.4.395 Problem: C indent is wrong below an if with wrapped condition followed by curly braces. (Trevor Powell) Solution: Make a copy of tryposBrace. commit faf155d0f934f08734e0ac044216a33979681620 Author: Bram Moolenaar <bram@vim.org> Date: Wed Aug 6 16:49:55 2014 +0200 updated for version 7.4.394 Problem: When using DirectX last italic character is incomplete. Solution: Add one to the number of cells. (Ken Takata) commit 538cba38631e9deca047ffb46ee4ab5dd27fca83 Author: Bram Moolenaar <bram@vim.org> Date: Wed Aug 6 14:52:30 2014 +0200 updated for version 7.4.393 Problem: Text drawing on newer MS-Windows systems is suboptimal. Some multi-byte characters are not displayed, even though the same font in Notepad can display them. (Srinath Avadhanula) Solution: Add the 'renderoptions' option to enable Direct-X drawing. (Taro Muraoka) commit 008cd45dd47a5c64f1e54aee6131bec1a1dfa78c Author: Bram Moolenaar <bram@vim.org> Date: Wed Aug 6 13:36:59 2014 +0200 updated for version 7.4.392 Problem: Not easy to detect type of command line window. Solution: Add the getcmdwintype() function. (Jacob Niehus) commit 28003b665ca44e6cce7d686d2e0260dea6b3077b Author: Bram Moolenaar <bram@vim.org> Date: Wed Aug 6 13:20:56 2014 +0200 updated for version 7.4.391 Problem: No 'cursorline' highlighting when the cursor is on a line with diff highlighting. (Benjamin Fritz) Solution: Combine the highlight attributes. (Christian Brabandt) commit 94ae20760b80d86001e911c0a767401aca54bf95 Author: Bram Moolenaar <bram@vim.org> Date: Wed Aug 6 12:49:18 2014 +0200 updated for version 7.4.390 Problem: Advancing pointer over end of a string. Solution: Init quote character to -1 instead of zero. (Dominique Pelle) commit b0a9990d7dc699d9ff80e1274ccf578b3b12ed0c Author: Bram Moolenaar <bram@vim.org> Date: Wed Jul 30 17:21:58 2014 +0200 updated for version 7.4.389 Problem: Still sometimes Vim enters Replace mode when starting up. Solution: Use a different solution in detecting the termresponse and location response. (Hayaki Saito) commit db2df01545b026dbdb0382839787694c12bf265a Author: Bram Moolenaar <bram@vim.org> Date: Wed Jul 30 16:44:22 2014 +0200 updated for version 7.4.388 Problem: With 'linebreak' set and 'list' unset a Tab is not counted properly. (Kent Sibilev) Solution: Check the 'list' option. (Christian Brabandt) commit 3e6090a2a5f93ba0ced62e9fcc855dfc5a17320c Author: Bram Moolenaar <bram@vim.org> Date: Wed Jul 30 16:00:58 2014 +0200 updated for version 7.4.387 Problem: "4gro" replaces one character then executes "ooo". (Urtica Dioica) Solution: Write the ESC in the second stuff buffer. commit 567af08e5f78c45adf0290e212974838e2497816 Author: Bram Moolenaar <bram@vim.org> Date: Wed Jul 30 14:05:00 2014 +0200 updated for version 7.4.386 Problem: When splitting a window the changelist position is wrong. Solution: Copy the changelist position. (Jacob Niehus) commit 140d69df2acf6d2bed56d09f105e6ca6c9c89c84 Author: Bram Moolenaar <bram@vim.org> Date: Wed Jul 30 13:22:52 2014 +0200 updated for version 7.4.385 Problem: When building with tiny or small features building the .mo files fails. Solution: In autoconf do not setup for building the .mo files when it would fail. commit b6266bf75e500479f31b4d15900a7cde489a100e Author: Bram Moolenaar <bram@vim.org> Date: Wed Jul 30 13:20:39 2014 +0200 updated for version 7.4.384 Problem: Test 102 fails when compiled with small features. Solution: Source small.vim. (Jacob Niehus) commit e072100c18f50930e6d763f5b4b0ed05cb586d71 Author: Bram Moolenaar <bram@vim.org> Date: Sat Jul 26 13:40:44 2014 +0200 Update runtime files. Add vroom file support. commit d871079ea0d8dbacea927a55447f6c0ed750baac Author: Bram Moolenaar <bram@vim.org> Date: Wed Jul 23 21:10:43 2014 +0200 updated for version 7.4.383 Problem: Bad interaction between preview window and omnifunc. Solution: Avoid redrawing the status line. (Hirohito Higashi) commit 4bd6c380aeecdaf21b7e4efbab306ad195221c8f Author: Bram Moolenaar <bram@vim.org> Date: Wed Jul 23 20:41:14 2014 +0200 updated for version 7.4.382 Problem: Mapping characters may not work after typing Esc in Insert mode. Solution: Fix the noremap flags for inserted characters. (Jacob Niehus) commit 1e6f5bd6ac9c749cf43a5646f2599d99bfe49a38 Author: Bram Moolenaar <bram@vim.org> Date: Wed Jul 23 17:39:25 2014 +0200 updated for version 7.4.381 Problem: Get u_undo error when backspacing in Insert mode deletes more than one line break. (Ayberk Ozgur) Solution: Also decrement Insstart.lnum. commit 60b0004a3f620903e21e356c4cfe870d58bd3836 Author: Bram Moolenaar <bram@vim.org> Date: Wed Jul 23 16:57:00 2014 +0200 updated for version 7.4.380 Problem: Loading python may cause Vim to exit. Solution: Avoid loading the "site" module. (Taro Muraoka) commit 19397dc732a9fb517a4f0a277771a8a01293dcc5 Author: Bram Moolenaar <bram@vim.org> Date: Wed Jul 23 16:33:07 2014 +0200 updated for version 7.4.379 Problem: Accessing freed memory after using setqflist(list, 'r'). (Lcd) Solution: Reset qf_index. commit df38569e850639c63e79492ebede604830e6ab47 Author: Bram Moolenaar <bram@vim.org> Date: Wed Jul 23 15:55:00 2014 +0200 updated for version 7.4.378 Problem: Title of quickfist list is not kept for setqflist(list, 'r'). Solution: Keep the title. Add a test. (Lcd) commit 5a7bd5ae9732fd9ff77253c4a5098234a1d4ff68 Author: Bram Moolenaar <bram@vim.org> Date: Wed Jul 23 15:21:20 2014 +0200 updated for version 7.4.377 Problem: When 'equalalways' is set a split may report "no room" even though there is plenty of room. Solution: Compute the available room properly. (Yukihiro Nakadaira) commit af4b6892e53ef7565fe15930322281c3f4c5eea1 Author: Bram Moolenaar <bram@vim.org> Date: Wed Jul 23 13:50:46 2014 +0200 updated for version 7.4.376 Problem: Popup menu flickers too much. Solution: Remove the forced redraw. (Hirohito Higashi) commit 3638f34c7813403fc702a63a2004caac5214a399 Author: Bram Moolenaar <bram@vim.org> Date: Wed Jul 23 13:16:30 2014 +0200 updated for version 7.4.375 Problem: Test 63 fails when run with GUI-only Vim. Solution: Add guibg attributes. (suggested by Mike Soyka) commit 9db8986704d8ccb85fa5c415a08317012eb7ae26 Author: Bram Moolenaar <bram@vim.org> Date: Wed Jul 23 12:31:20 2014 +0200 updated for version 7.4.374 Problem: Character after "fb" command not mapped if it might be a composing character. Solution: Don't disable mapping when looking for a composing character. (Jacob Niehus) Change-Id: I9503d93325fa36c313399f561bc339bfa08a2616
-rw-r--r--Filelist11
-rw-r--r--nsis/gvim.nsi9
-rw-r--r--runtime/autoload/gzip.vim8
-rw-r--r--runtime/autoload/netrw.vim2484
-rw-r--r--runtime/autoload/netrwSettings.vim9
-rw-r--r--runtime/autoload/netrw_gitignore.vim13
-rw-r--r--runtime/autoload/phpcomplete.vim204
-rw-r--r--runtime/compiler/go.vim29
-rw-r--r--runtime/compiler/msvc.vim4
-rw-r--r--runtime/doc/autocmd.txt20
-rw-r--r--runtime/doc/cmdline.txt7
-rw-r--r--runtime/doc/diff.txt16
-rw-r--r--runtime/doc/editing.txt81
-rw-r--r--runtime/doc/eval.txt95
-rw-r--r--runtime/doc/gui_w32.txt5
-rw-r--r--runtime/doc/helphelp.txt5
-rw-r--r--runtime/doc/if_pyth.txt4
-rw-r--r--runtime/doc/indent.txt2
-rw-r--r--runtime/doc/index.txt5
-rw-r--r--runtime/doc/insert.txt4
-rw-r--r--runtime/doc/map.txt25
-rw-r--r--runtime/doc/netbeans.txt2
-rw-r--r--runtime/doc/options.txt122
-rw-r--r--runtime/doc/os_vms.txt4
-rw-r--r--runtime/doc/os_win32.txt10
-rw-r--r--runtime/doc/pattern.txt21
-rw-r--r--runtime/doc/pi_netrw.txt766
-rw-r--r--runtime/doc/quickref.txt11
-rw-r--r--runtime/doc/repeat.txt9
-rw-r--r--runtime/doc/spell.txt13
-rw-r--r--runtime/doc/syntax.txt45
-rw-r--r--runtime/doc/tabpage.txt59
-rw-r--r--runtime/doc/tags44
-rw-r--r--runtime/doc/todo.txt336
-rw-r--r--runtime/doc/usr_04.txt4
-rw-r--r--runtime/doc/usr_25.txt4
-rw-r--r--runtime/doc/usr_41.txt3
-rw-r--r--runtime/doc/various.txt3
-rw-r--r--runtime/doc/version6.txt4
-rw-r--r--runtime/doc/version7.txt20
-rw-r--r--runtime/doc/windows.txt181
-rw-r--r--runtime/filetype.vim37
-rw-r--r--runtime/ftplugin/dockerfile.vim16
-rw-r--r--runtime/ftplugin/go.vim18
-rw-r--r--runtime/ftplugin/json.vim17
-rw-r--r--runtime/ftplugin/less.vim20
-rw-r--r--runtime/ftplugin/man.vim10
-rw-r--r--runtime/ftplugin/matlab.vim14
-rw-r--r--runtime/ftplugin/vim.vim11
-rw-r--r--runtime/ftplugin/vroom.vim35
-rw-r--r--runtime/indent/ada.vim2
-rw-r--r--runtime/indent/go.vim78
-rw-r--r--runtime/indent/html.vim6
-rw-r--r--runtime/indent/json.vim168
-rw-r--r--runtime/indent/less.vim13
-rw-r--r--runtime/indent/lua.vim4
-rw-r--r--runtime/indent/php.vim87
-rw-r--r--runtime/indent/sh.vim6
-rw-r--r--runtime/indent/vim.vim33
-rw-r--r--runtime/indent/vroom.vim21
-rw-r--r--runtime/lang/menu_chinese_gb.936.vim22
-rw-r--r--runtime/lang/menu_zh_cn.gb2312.vim8
-rw-r--r--runtime/lang/menu_zh_cn.utf-8.vim8
-rw-r--r--runtime/macros/editexisting.vim4
-rw-r--r--runtime/optwin.vim14
-rw-r--r--runtime/plugin/matchparen.vim29
-rw-r--r--runtime/plugin/netrwPlugin.vim44
-rw-r--r--runtime/scripts.vim6
-rw-r--r--runtime/spell/ro/main.aap52
-rw-r--r--runtime/spell/ro/ro_RO.diff68
-rw-r--r--runtime/synmenu.vim3
-rw-r--r--runtime/syntax/amiga.vim8
-rw-r--r--runtime/syntax/asciidoc.vim4
-rw-r--r--runtime/syntax/c.vim70
-rw-r--r--runtime/syntax/csh.vim8
-rw-r--r--runtime/syntax/dcl.vim8
-rw-r--r--runtime/syntax/debchangelog.vim4
-rw-r--r--runtime/syntax/debcontrol.vim19
-rw-r--r--runtime/syntax/debsources.vim4
-rw-r--r--runtime/syntax/diff.vim9
-rw-r--r--runtime/syntax/django.vim4
-rw-r--r--runtime/syntax/dockerfile.vim24
-rw-r--r--runtime/syntax/elmfilt.vim8
-rw-r--r--runtime/syntax/exports.vim8
-rw-r--r--runtime/syntax/gnuplot.vim672
-rw-r--r--runtime/syntax/go.vim208
-rw-r--r--runtime/syntax/godoc.vim21
-rw-r--r--runtime/syntax/html.vim7
-rw-r--r--runtime/syntax/htmldjango.vim4
-rw-r--r--runtime/syntax/j.vim42
-rw-r--r--runtime/syntax/json.vim143
-rw-r--r--runtime/syntax/less.vim79
-rw-r--r--runtime/syntax/lisp.vim25
-rw-r--r--runtime/syntax/maple.vim8
-rw-r--r--runtime/syntax/netrw.vim16
-rw-r--r--runtime/syntax/php.vim13
-rw-r--r--runtime/syntax/python.vim4
-rw-r--r--runtime/syntax/r.vim54
-rw-r--r--runtime/syntax/registry.vim11
-rw-r--r--runtime/syntax/rpcgen.vim8
-rw-r--r--runtime/syntax/rst.vim37
-rw-r--r--runtime/syntax/sh.vim85
-rw-r--r--runtime/syntax/sisu.vim34
-rw-r--r--runtime/syntax/sm.vim8
-rw-r--r--runtime/syntax/tags.vim8
-rw-r--r--runtime/syntax/tex.vim170
-rw-r--r--runtime/syntax/valgrind.vim6
-rw-r--r--runtime/syntax/vim.vim288
-rw-r--r--runtime/syntax/vroom.vim113
-rw-r--r--runtime/syntax/xmath.vim6
-rw-r--r--runtime/syntax/xxd.vim8
-rw-r--r--runtime/syntax/yacc.vim4
-rw-r--r--runtime/syntax/zimbu.vim64
-rw-r--r--runtime/tutor/tutor.es.utf-82
-rw-r--r--runtime/tutor/tutor.fr4
-rw-r--r--runtime/tutor/tutor.fr.utf-84
-rw-r--r--runtime/tutor/tutor.ja.euc7
-rw-r--r--runtime/tutor/tutor.ja.sjis7
-rw-r--r--runtime/tutor/tutor.ja.utf-87
-rw-r--r--runtime/tutor/tutor.pt4
-rw-r--r--runtime/tutor/tutor.pt.utf-84
-rw-r--r--runtime/tutor/tutor.ru979
-rw-r--r--runtime/tutor/tutor.ru.cp1251979
-rw-r--r--runtime/tutor/tutor.ru.utf-8979
-rw-r--r--runtime/tutor/tutor.uk.utf-8976
-rw-r--r--runtime/tutor/tutor.utf-84
-rw-r--r--runtime/tutor/tutor.zh.big54
-rw-r--r--runtime/tutor/tutor.zh.euc4
-rw-r--r--runtime/tutor/tutor.zh.utf-84
-rw-r--r--runtime/tutor/tutor.zh_cn.utf-84
-rw-r--r--runtime/tutor/tutor.zh_tw.utf-84
-rw-r--r--runtime/vimrc_example.vim9
-rw-r--r--src/INSTALL2
-rw-r--r--src/INSTALLpc.txt49
-rw-r--r--src/Make_bc3.mak2
-rw-r--r--src/Make_bc5.mak2
-rw-r--r--src/Make_cyg.mak722
-rw-r--r--src/Make_cyg_ming.mak851
-rw-r--r--src/Make_dice.mak8
-rw-r--r--src/Make_djg.mak2
-rw-r--r--src/Make_ivc.mak10
-rw-r--r--src/Make_manx.mak12
-rw-r--r--src/Make_ming.mak790
-rw-r--r--src/Make_morph.mak2
-rw-r--r--src/Make_mvc.mak48
-rw-r--r--src/Make_os2.mak4
-rw-r--r--src/Make_sas.mak10
-rw-r--r--src/Make_vms.mms6
-rw-r--r--src/Makefile53
-rwxr-xr-xsrc/auto/configure76
-rw-r--r--src/blowfish.c307
-rw-r--r--src/buffer.c54
-rw-r--r--src/charset.c13
-rw-r--r--src/config.h.in3
-rw-r--r--src/config.mk.in3
-rw-r--r--src/configure.in51
-rw-r--r--src/crypt.c605
-rw-r--r--src/crypt_zip.c158
-rw-r--r--src/diff.c14
-rw-r--r--src/edit.c40
-rw-r--r--src/eval.c248
-rw-r--r--src/ex_cmds.c195
-rw-r--r--src/ex_cmds.h1585
-rw-r--r--src/ex_cmds2.c53
-rw-r--r--src/ex_docmd.c977
-rw-r--r--src/ex_getln.c28
-rw-r--r--src/feature.h7
-rw-r--r--src/fileio.c516
-rw-r--r--src/getchar.c47
-rw-r--r--src/globals.h9
-rw-r--r--src/gui.h2
-rw-r--r--src/gui_beval.c11
-rw-r--r--src/gui_dwrite.cpp901
-rw-r--r--src/gui_dwrite.h85
-rw-r--r--src/gui_w32.c232
-rw-r--r--src/gui_w48.c52
-rw-r--r--src/hardcopy.c34
-rw-r--r--src/if_cscope.c4
-rw-r--r--src/if_py_both.h13
-rw-r--r--src/if_python.c31
-rw-r--r--src/if_ruby.c14
-rw-r--r--src/macros.h15
-rw-r--r--src/main.c28
-rw-r--r--src/mbyte.c2
-rw-r--r--src/memline.c120
-rw-r--r--src/message.c4
-rw-r--r--src/misc1.c12
-rw-r--r--src/misc2.c339
-rw-r--r--src/move.c38
-rw-r--r--src/normal.c30
-rw-r--r--src/ops.c102
-rw-r--r--src/option.c143
-rw-r--r--src/option.h9
-rw-r--r--src/os_mswin.c78
-rw-r--r--src/os_unix.c79
-rw-r--r--src/os_vms.c2
-rw-r--r--src/os_win32.c103
-rw-r--r--src/po/eo.po203
-rw-r--r--src/po/fr.po616
-rw-r--r--src/po/ja.sjis.po2
-rw-r--r--src/po/ru.cp1251.po99
-rw-r--r--src/po/ru.po99
-rw-r--r--src/po/sjiscorr.c3
-rw-r--r--src/po/uk.cp1251.po153
-rw-r--r--src/po/uk.po153
-rw-r--r--src/popupmnu.c6
-rw-r--r--src/proto.h2
-rw-r--r--src/proto/blowfish.pro10
-rw-r--r--src/proto/crypt.pro26
-rw-r--r--src/proto/crypt_zip.pro5
-rw-r--r--src/proto/diff.pro2
-rw-r--r--src/proto/eval.pro2
-rw-r--r--src/proto/ex_cmds.pro1
-rw-r--r--src/proto/ex_docmd.pro4
-rw-r--r--src/proto/fileio.pro5
-rw-r--r--src/proto/getchar.pro1
-rw-r--r--src/proto/gui_w32.pro2
-rw-r--r--src/proto/misc1.pro2
-rw-r--r--src/proto/misc2.pro11
-rw-r--r--src/proto/ops.pro2
-rw-r--r--src/proto/option.pro2
-rw-r--r--src/proto/os_mswin.pro1
-rw-r--r--src/proto/os_vms.pro3
-rw-r--r--src/proto/regexp.pro1
-rw-r--r--src/proto/screen.pro2
-rw-r--r--src/proto/search.pro1
-rw-r--r--src/proto/term.pro2
-rw-r--r--src/proto/ui.pro2
-rw-r--r--src/proto/window.pro2
-rw-r--r--src/quickfix.c45
-rw-r--r--src/regexp.c203
-rw-r--r--src/regexp.h26
-rw-r--r--src/regexp_nfa.c50
-rw-r--r--src/screen.c70
-rw-r--r--src/search.c78
-rw-r--r--src/spell.c41
-rw-r--r--src/structs.h29
-rw-r--r--src/syntax.c31
-rw-r--r--src/term.c136
-rw-r--r--src/testdir/Make_amiga.mak26
-rw-r--r--src/testdir/Make_dos.mak25
-rw-r--r--src/testdir/Make_ming.mak25
-rw-r--r--src/testdir/Make_os2.mak27
-rw-r--r--src/testdir/Make_vms.mms22
-rw-r--r--src/testdir/Makefile29
-rw-r--r--src/testdir/README.txt18
-rw-r--r--src/testdir/bench_re_freeze.in13
-rw-r--r--src/testdir/bench_re_freeze.vim13
-rw-r--r--src/testdir/samples/re.freeze.txt6
-rw-r--r--src/testdir/test100.in7
-rw-r--r--src/testdir/test101.in3
-rw-r--r--src/testdir/test101.ok1
-rw-r--r--src/testdir/test102.in1
-rw-r--r--src/testdir/test11.in6
-rw-r--r--src/testdir/test3.in8
-rw-r--r--src/testdir/test3.ok8
-rw-r--r--src/testdir/test39.in21
-rw-r--r--src/testdir/test39.okbin481 -> 584 bytes
-rw-r--r--src/testdir/test4.in3
-rw-r--r--src/testdir/test4.ok3
-rw-r--r--src/testdir/test48.in5
-rw-r--r--src/testdir/test48.ok1
-rw-r--r--src/testdir/test53.in7
-rw-r--r--src/testdir/test53.ok6
-rw-r--r--src/testdir/test55.in20
-rw-r--r--src/testdir/test55.ok6
-rw-r--r--src/testdir/test62.in2
-rw-r--r--src/testdir/test63.in29
-rw-r--r--src/testdir/test63.ok2
-rw-r--r--src/testdir/test64.in13
-rw-r--r--src/testdir/test64.ok2
-rw-r--r--src/testdir/test71.in27
-rw-r--r--src/testdir/test71.ok5
-rw-r--r--src/testdir/test71a.in4
-rw-r--r--src/testdir/test72.in29
-rw-r--r--src/testdir/test72.ok4
-rw-r--r--src/testdir/test75.in8
-rw-r--r--src/testdir/test86.in1
-rw-r--r--src/testdir/test87.in1
-rw-r--r--src/testdir/test91.in1
-rw-r--r--src/testdir/test91.ok4
-rw-r--r--src/testdir/test_argument_count.in47
-rw-r--r--src/testdir/test_argument_count.ok13
-rw-r--r--src/testdir/test_breakindent.in54
-rw-r--r--src/testdir/test_breakindent.ok9
-rw-r--r--src/testdir/test_changelist.in22
-rw-r--r--src/testdir/test_changelist.ok1
-rw-r--r--src/testdir/test_close_count.in153
-rw-r--r--src/testdir/test_close_count.ok23
-rw-r--r--src/testdir/test_command_count.in130
-rw-r--r--src/testdir/test_command_count.ok35
-rw-r--r--src/testdir/test_insertcount.in14
-rw-r--r--src/testdir/test_insertcount.ok3
-rw-r--r--src/testdir/test_listlbr.in20
-rw-r--r--src/testdir/test_listlbr.ok11
-rw-r--r--src/testdir/test_listlbr_utf8.in11
-rw-r--r--src/testdir/test_listlbr_utf8.ok7
-rw-r--r--src/testdir/test_mapping.in25
-rw-r--r--src/testdir/test_mapping.ok4
-rw-r--r--src/testdir/test_nested_function.in34
-rw-r--r--src/testdir/test_nested_function.ok6
-rw-r--r--src/testdir/test_qf_title.in18
-rw-r--r--src/testdir/test_qf_title.ok2
-rw-r--r--src/testdir/test_signs.in22
-rw-r--r--src/testdir/test_signs.ok2
-rw-r--r--src/testdir/test_utf8.in18
-rw-r--r--src/testdir/test_utf8.ok4
-rw-r--r--src/testdir/test_writefile.in18
-rw-r--r--src/testdir/test_writefile.ok5
-rw-r--r--src/ui.c54
-rw-r--r--src/undo.c690
-rw-r--r--src/version.c397
-rw-r--r--src/vim.h14
-rw-r--r--src/window.c129
314 files changed, 18394 insertions, 8086 deletions
diff --git a/Filelist b/Filelist
index 46aaa964e..522375472 100644
--- a/Filelist
+++ b/Filelist
@@ -11,6 +11,8 @@ SRC_ALL = \
src/blowfish.c \
src/buffer.c \
src/charset.c \
+ src/crypt.c \
+ src/crypt_zip.c \
src/diff.c \
src/digraph.c \
src/edit.c \
@@ -80,6 +82,7 @@ SRC_ALL = \
src/xxd/xxd.c \
src/main.aap \
src/testdir/main.aap \
+ src/testdir/README.txt \
src/testdir/*.in \
src/testdir/sautest/autoload/*.vim \
src/testdir/test[0-9]*.ok \
@@ -99,10 +102,15 @@ SRC_ALL = \
src/testdir/pythonx/topmodule/submodule/subsubmodule/subsubsubmodule.py \
src/testdir/python_after/*.py \
src/testdir/python_before/*.py \
+ src/testdir/bench*.in \
+ src/testdir/bench*.vim \
+ src/testdir/samples/*.txt \
src/proto.h \
src/proto/blowfish.pro \
src/proto/buffer.pro \
src/proto/charset.pro \
+ src/proto/crypt.pro \
+ src/proto/crypt_zip.pro \
src/proto/diff.pro \
src/proto/digraph.pro \
src/proto/edit.pro \
@@ -272,6 +280,7 @@ SRC_DOS = \
src/Make_bc3.mak \
src/Make_bc5.mak \
src/Make_cyg.mak \
+ src/Make_cyg_ming.mak \
src/Make_djg.mak \
src/Make_ivc.mak \
src/Make_dvc.mak \
@@ -289,6 +298,8 @@ SRC_DOS = \
src/dosinst.h \
src/glbl_ime.cpp \
src/glbl_ime.h \
+ src/gui_dwrite.cpp \
+ src/gui_dwrite.h \
src/gui_w16.c \
src/gui_w32.c \
src/gui_w48.c \
diff --git a/nsis/gvim.nsi b/nsis/gvim.nsi
index 7b69e7d9c..a2d20bf82 100644
--- a/nsis/gvim.nsi
+++ b/nsis/gvim.nsi
@@ -1,6 +1,6 @@
# NSIS file to create a self-installing exe for Vim.
# It requires NSIS version 2.0 or later.
-# Last Change: 2010 Jul 30
+# Last Change: 2014 Nov 5
# WARNING: if you make changes to this script, look out for $0 to be valid,
# because uninstall deletes most files in $0.
@@ -38,7 +38,7 @@ SetDatablockOptimize on
RequestExecutionLevel highest
ComponentText "This will install Vim ${VER_MAJOR}.${VER_MINOR} on your computer."
-DirText "Choose a directory to install Vim (must end in 'vim')"
+DirText "Choose a directory to install Vim (should contain 'vim')"
Icon icons\vim_16c.ico
# NSIS2 uses a different strategy with six different images in a strip...
#EnabledBitmap icons\enabled.bmp
@@ -135,11 +135,6 @@ FunctionEnd
# We only accept the directory if it ends in "vim". Using .onVerifyInstDir has
# the disadvantage that the browse dialog is difficult to use.
Function CheckInstallDir
- StrCpy $0 $INSTDIR 3 -3
- StrCmp $0 "vim" PathGood
- MessageBox MB_OK "The path must end in 'vim'."
- Abort
- PathGood:
FunctionEnd
Function .onInstSuccess
diff --git a/runtime/autoload/gzip.vim b/runtime/autoload/gzip.vim
index 1245fdddc..a6b4605b0 100644
--- a/runtime/autoload/gzip.vim
+++ b/runtime/autoload/gzip.vim
@@ -1,6 +1,6 @@
" Vim autoload file for editing compressed files.
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2008 Jul 04
+" Last Change: 2014 Nov 05
" These functions are used by the gzip plugin.
@@ -120,6 +120,8 @@ fun gzip#read(cmd)
silent! exe "bwipe " . tmp_esc
silent! exe "bwipe " . tmpe_esc
endif
+ " Store the OK flag, so that we can use it when writing.
+ let b:uncompressOk = ok
" Restore saved option values.
let &pm = pm_save
@@ -146,8 +148,10 @@ endfun
" After writing compressed file: Compress written file with "cmd"
fun gzip#write(cmd)
+ if exists('b:uncompressOk') && !b:uncompressOk
+ echomsg "Not compressing file because uncompress failed; reset b:uncompressOk to compress anyway"
" don't do anything if the cmd is not supported
- if s:check(a:cmd)
+ elseif s:check(a:cmd)
" Rename the file before compressing it.
let nm = resolve(expand("<afile>"))
let nmt = s:tempname(nm)
diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim
index d8d185709..42439a57d 100644
--- a/runtime/autoload/netrw.vim
+++ b/runtime/autoload/netrw.vim
@@ -1,7 +1,7 @@
" netrw.vim: Handles file transfer and remote directory listing across
" AUTOLOAD SECTION
-" Date: May 13, 2014
-" Version: 152
+" Date: Jan 05, 2015
+" Version: 153
" Maintainer: Charles E Campbell <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
" Copyright: Copyright (C) 1999-2013 Charles E. Campbell {{{1
@@ -29,7 +29,7 @@ if v:version < 704 || !has("patch213")
let s:needpatch213= 1
finish
endif
-let g:loaded_netrw = "v152"
+let g:loaded_netrw = "v153"
if !exists("s:NOTE")
let s:NOTE = 0
let s:WARNING = 1
@@ -51,7 +51,10 @@ setl cpo&vim
" 0=note = s:NOTE
" 1=warning = s:WARNING
" 2=error = s:ERROR
-" Apr 16, 2014 : max errnum currently is 97
+" Usage: netrw#ErrorMsg(s:NOTE | s:WARNING | s:ERROR,"some message",error-number)
+" netrw#ErrorMsg(s:NOTE | s:WARNING | s:ERROR,["message1","message2",...],error-number)
+" (this function can optionally take a list of messages)
+" May 15, 2014 : max errnum currently is 98
fun! netrw#ErrorMsg(level,msg,errnum)
" call Dfunc("netrw#ErrorMsg(level=".a:level." msg<".a:msg."> errnum=".a:errnum.") g:netrw_use_errorwindow=".g:netrw_use_errorwindow)
@@ -84,18 +87,31 @@ fun! netrw#ErrorMsg(level,msg,errnum)
exe bufwinnr("NetrwMessage")."wincmd w"
" call Decho("setl ma noro")
setl ma noro
- keepj call setline(line("$")+1,level.a:msg)
- keepj $
+ if type(a:msg) == 3
+ for msg in a:msg
+ NetrwKeepj call setline(line("$")+1,level.msg)
+ endfor
+ else
+ NetrwKeepj call setline(line("$")+1,level.a:msg)
+ endif
+ NetrwKeepj $
else
" call Decho("create a NetrwMessage buffer window")
bo 1split
sil! call s:NetrwEnew()
- sil! keepj call s:NetrwSafeOptions()
+ sil! NetrwKeepj call s:NetrwSafeOptions()
setl bt=nofile
- keepj file NetrwMessage
+ NetrwKeepj file NetrwMessage
" call Decho("setl ma noro")
setl ma noro
- call setline(line("$"),level.a:msg)
+ if type(a:msg) == 3
+ for msg in a:msg
+ NetrwKeepj call setline(line("$")+1,level.msg)
+ endfor
+ else
+ NetrwKeepj call setline(line("$"),level.a:msg)
+ endif
+ NetrwKeepj $
endif
" call Decho("wrote msg<".level.a:msg."> to NetrwMessage win#".winnr())
if &fo !~ '[ta]'
@@ -118,7 +134,15 @@ fun! netrw#ErrorMsg(level,msg,errnum)
elseif a:level == s:ERROR
echohl Error
endif
- echomsg level.a:msg
+
+ if type(a:msg) == 3
+ for msg in a:msg
+ echomsg level.msg
+ endfor
+ else
+ echomsg level.a:msg
+ endif
+
" call Decho("echomsg ***netrw*** ".a:msg)
echohl None
endif
@@ -127,7 +151,7 @@ fun! netrw#ErrorMsg(level,msg,errnum)
endfun
" ---------------------------------------------------------------------
-" NetrwInit: initializes variables if they haven't been defined {{{2
+" s:NetrwInit: initializes variables if they haven't been defined {{{2
" Loosely, varname = value.
fun s:NetrwInit(varname,value)
" call Decho("varname<".a:varname."> value=".a:value)
@@ -175,6 +199,13 @@ if !exists("g:netrw_fetch_cmd")
let g:netrw_fetch_cmd = ""
endif
endif
+if !exists("g:netrw_file_cmd")
+ if executable("elinks")
+ call s:NetrwInit("g:netrw_file_cmd","elinks")
+ elseif executable("links")
+ call s:NetrwInit("g:netrw_file_cmd","links")
+ endif
+endif
if !exists("g:netrw_ftp_cmd")
let g:netrw_ftp_cmd = "ftp"
endif
@@ -203,6 +234,7 @@ if !exists("g:netrw_http_cmd")
endif
endif
call s:NetrwInit("g:netrw_http_put_cmd","curl -T")
+call s:NetrwInit("g:netrw_keepj","keepj")
call s:NetrwInit("g:netrw_rcp_cmd" , "rcp")
call s:NetrwInit("g:netrw_rsync_cmd", "rsync")
if !exists("g:netrw_scp_cmd")
@@ -300,12 +332,20 @@ if !exists("g:netrw_list_cmd")
" provide a pscp-based listing command
let g:netrw_scp_cmd ="pscp -i C:\\private.ppk"
endif
- let g:netrw_list_cmd= g:netrw_scp_cmd." -ls USEPORT HOSTNAME:"
+ if exists("g:netrw_list_cmd_options")
+ let g:netrw_list_cmd= g:netrw_scp_cmd." -ls USEPORT HOSTNAME: ".g:netrw_list_cmd_options
+ else
+ let g:netrw_list_cmd= g:netrw_scp_cmd." -ls USEPORT HOSTNAME:"
+ endif
elseif executable(g:netrw_ssh_cmd)
" provide a scp-based default listing command
- let g:netrw_list_cmd= g:netrw_ssh_cmd." USEPORT HOSTNAME ls -FLa"
+ if exists("g:netrw_list_cmd_options")
+ let g:netrw_list_cmd= g:netrw_ssh_cmd." USEPORT HOSTNAME ls -FLa ".g:netrw_list_cmd_options
+ else
+ let g:netrw_list_cmd= g:netrw_ssh_cmd." USEPORT HOSTNAME ls -FLa"
+ endif
else
-" call Decho("g:netrw_ssh_cmd." is not executable")
+" call Decho(g:netrw_ssh_cmd." is not executable")
let g:netrw_list_cmd= ""
endif
endif
@@ -331,6 +371,19 @@ if !exists("g:netrw_localcopycmd")
let g:netrw_localcopycmd= ""
endif
endif
+if !exists("g:netrw_localcopydircmd")
+ if has("win32") || has("win95") || has("win64") || has("win16")
+ if g:netrw_cygwin
+ let g:netrw_localcopydircmd= "cp -R"
+ else
+ let g:netrw_localcopycmd= expand("$COMSPEC")." /c xcopy /e /c /h /i /k"
+ endif
+ elseif has("unix") || has("macunix")
+ let g:netrw_localcopydircmd= "cp -R"
+ else
+ let g:netrw_localcopycmd= ""
+ endif
+endif
if exists("g:netrw_local_mkdir")
let g:netrw_localmkdir= g:netrw_local_mkdir
call netrw#ErrorMsg(s:NOTE,"g:netrw_local_mkdir is deprecated in favor of g:netrw_localmkdir",87)
@@ -399,6 +452,7 @@ else
endif
call s:NetrwInit("g:netrw_preview" , 0)
call s:NetrwInit("g:netrw_scpport" , "-P")
+call s:NetrwInit("g:netrw_servername" , "NETRWSERVER")
call s:NetrwInit("g:netrw_sshport" , "-p")
call s:NetrwInit("g:netrw_rename_cmd" , g:netrw_ssh_cmd." USEPORT HOSTNAME mv")
call s:NetrwInit("g:netrw_rm_cmd" , g:netrw_ssh_cmd." USEPORT HOSTNAME rm")
@@ -407,16 +461,20 @@ call s:NetrwInit("g:netrw_rmf_cmd" , g:netrw_ssh_cmd." USEPORT HOSTNAME rm
" Default values - q-s ---------- {{{3
call s:NetrwInit("g:netrw_quickhelp",0)
let s:QuickHelp= ["-:go up dir D:delete R:rename s:sort-by x:special",
- \ "%:create new file d:create new directory",
- \ "o:split&open v:vert-split&open",
- \ "i:style qf:file info O:obtain r:reverse p:preview",
- \ "mf:mark file mt:set target mm:move mc:copy",
- \ "-bookmarks- mb:make mB:delete qb:list gb:go to",
- \ "-history- qb:list u:go up U:go down",
- \ "-targets- mt:target Tb:use bookmark Th:use history"]
+ \ "(create new) %:file d:directory",
+ \ "(windows split&open) o:horz v:vert p:preview",
+ \ "i:style qf:file info O:obtain r:reverse",
+ \ "(marks) mf:mark file mt:set target mm:move mc:copy",
+ \ "(bookmarks) mb:make mB:delete qb:list gb:go to",
+ \ "(history) qb:list u:go up U:go down",
+ \ "(targets) mt:target Tb:use bookmark Th:use history"]
" g:netrw_sepchr: picking a character that doesn't appear in filenames that can be used to separate priority from filename
call s:NetrwInit("g:netrw_sepchr" , (&enc == "euc-jp")? "\<Char-0x01>" : "\<Char-0xff>")
-call s:NetrwInit("s:netrw_silentxfer" , (exists("g:netrw_silent") && g:netrw_silent != 0)? "sil keepj " : "keepj ")
+if !exists("g:netrw_keepj") || g:netrw_keepj == "keepj"
+ call s:NetrwInit("s:netrw_silentxfer" , (exists("g:netrw_silent") && g:netrw_silent != 0)? "sil keepj " : "keepj ")
+else
+ call s:NetrwInit("s:netrw_silentxfer" , (exists("g:netrw_silent") && g:netrw_silent != 0)? "sil " : " ")
+endif
call s:NetrwInit("g:netrw_sort_by" , "name") " alternatives: date , size
call s:NetrwInit("g:netrw_sort_options" , "")
call s:NetrwInit("g:netrw_sort_direction", "normal") " alternative: reverse (z y x ...)
@@ -488,6 +546,13 @@ if v:version >= 700 && has("balloon_eval") && !exists("s:initbeval") && !exists(
endif
au WinEnter * if &ft == "netrw"|call s:NetrwInsureWinVars()|endif
+if g:netrw_keepj =~ "keepj"
+ com! -nargs=* NetrwKeepj keepj <args>
+else
+ let g:netrw_keepj= ""
+ com! -nargs=* NetrwKeepj <args>
+endif
+
" ==============================
" Netrw Utility Functions: {{{1
" ==============================
@@ -525,7 +590,7 @@ if v:version >= 700 && has("balloon_eval") && has("syntax") && exists("g:syntax_
" if v:version < 700 |call Decho("did not load netrw#BalloonHelp(): vim version ".v:version." < 700 -")|endif
" if !has("balloon_eval") |call Decho("did not load netrw#BalloonHelp(): does not have balloon eval") |endif
" if !has("syntax") |call Decho("did not load netrw#BalloonHelp(): syntax disabled") |endif
-" if !exists("g:syntax_on") |call Decho("did not load netrw#BalloonHelp(): g:syntax_on=".g:syntax_on) |endif
+" if !exists("g:syntax_on") |call Decho("did not load netrw#BalloonHelp(): g:syntax_on n/a") |endif
" if exists("g:netrw_nobeval") |call Decho("did not load netrw#BalloonHelp(): g:netrw_nobeval exists") |endif
endif
@@ -655,7 +720,7 @@ fun! netrw#Explore(indx,dosplit,style,...)
" else " Decho
" call Decho("case a:dosplit=".a:dosplit." AND modified=".&modified." AND a:style=".a:style." is not 6")
endif
- keepj norm! 0
+ NetrwKeepj norm! 0
if a:0 > 0
" call Decho("case [a:0=".a:0."] > 0: a:1<".a:1.">")
@@ -751,7 +816,6 @@ fun! netrw#Explore(indx,dosplit,style,...)
endif
if dirname =~ '^scp://' || dirname =~ '^ftp://'
call netrw#Nread(2,dirname)
- "call s:NetrwBrowse(0,dirname)
else
if dirname == ""
let dirname= getcwd()
@@ -778,9 +842,9 @@ fun! netrw#Explore(indx,dosplit,style,...)
" ---------------------------------------------------------------------
" Jan 24, 2013: not sure why the following was present. See P08-Ingelrest
" if has("win32") || has("win95") || has("win64") || has("win16")
-" keepj call search('\<'.substitute(curdir,'^.*[/\\]','','e').'\>','cW')
+" NetrwKeepj call search('\<'.substitute(curdir,'^.*[/\\]','','e').'\>','cW')
" else
-" keepj call search('\<'.substitute(curdir,'^.*/','','e').'\>','cW')
+" NetrwKeepj call search('\<'.substitute(curdir,'^.*/','','e').'\>','cW')
" endif
" ---------------------------------------------------------------------
@@ -811,7 +875,7 @@ fun! netrw#Explore(indx,dosplit,style,...)
" Nexplore
" call Decho("..case Nexplore with starpat=".starpat.": (indx=".indx.")")
if !exists("w:netrw_explore_list") " sanity check
- keepj call netrw#ErrorMsg(s:WARNING,"using Nexplore or <s-down> improperly; see help for netrw-starstar",40)
+ NetrwKeepj call netrw#ErrorMsg(s:WARNING,"using Nexplore or <s-down> improperly; see help for netrw-starstar",40)
if has("clipboard")
sil! let @* = keepregstar
sil! let @+ = keepregstar
@@ -836,7 +900,7 @@ fun! netrw#Explore(indx,dosplit,style,...)
" Pexplore
" call Decho("case Pexplore with starpat=".starpat.": (indx=".indx.")")
if !exists("w:netrw_explore_list") " sanity check
- keepj call netrw#ErrorMsg(s:WARNING,"using Pexplore or <s-up> improperly; see help for netrw-starstar",41)
+ NetrwKeepj call netrw#ErrorMsg(s:WARNING,"using Pexplore or <s-up> improperly; see help for netrw-starstar",41)
if has("clipboard")
sil! let @* = keepregstar
sil! let @+ = keepregstar
@@ -861,7 +925,7 @@ fun! netrw#Explore(indx,dosplit,style,...)
" Explore -- initialize
" build list of files to Explore with Nexplore/Pexplore
" call Decho("..starpat=".starpat.": case Explore: initialize (indx=".indx.")")
- keepj keepalt call s:NetrwClearExplore()
+ NetrwKeepj keepalt call s:NetrwClearExplore()
let w:netrw_explore_indx= 0
if !exists("b:netrw_curdir")
let b:netrw_curdir= getcwd()
@@ -874,7 +938,7 @@ fun! netrw#Explore(indx,dosplit,style,...)
" call Decho("..case starpat=".starpat.": build *//pattern list (curdir-only srch for files containing pattern) &hls=".&hls)
" call Decho("....pattern<".pattern.">")
try
- exe "keepj noautocmd vimgrep /".pattern."/gj ".fnameescape(b:netrw_curdir)."/*"
+ exe "NetrwKeepj noautocmd vimgrep /".pattern."/gj ".fnameescape(b:netrw_curdir)."/*"
catch /^Vim\%((\a\+)\)\=:E480/
keepalt call netrw#ErrorMsg(s:WARNING,"no match with pattern<".pattern.">",76)
" call Dret("netrw#Explore : unable to find pattern<".pattern.">")
@@ -888,7 +952,7 @@ fun! netrw#Explore(indx,dosplit,style,...)
" call Decho("..case starpat=".starpat.": build **//pattern list (recursive descent files containing pattern)")
" call Decho("....pattern<".pattern.">")
try
- exe "sil keepj noautocmd keepalt vimgrep /".pattern."/gj "."**/*"
+ exe "sil NetrwKeepj noautocmd keepalt vimgrep /".pattern."/gj "."**/*"
catch /^Vim\%((\a\+)\)\=:E480/
keepalt call netrw#ErrorMsg(s:WARNING,'no files matched pattern<'.pattern.'>',45)
if &hls | let keepregslash= s:ExplorePatHls(pattern) | endif
@@ -927,7 +991,7 @@ fun! netrw#Explore(indx,dosplit,style,...)
" call Decho("....w:netrw_explore_listlen=".w:netrw_explore_listlen)
if w:netrw_explore_listlen == 0 || (w:netrw_explore_listlen == 1 && w:netrw_explore_list[0] =~ '\*\*\/')
- keepalt keepj call netrw#ErrorMsg(s:WARNING,"no files matched",42)
+ keepalt NetrwKeepj call netrw#ErrorMsg(s:WARNING,"no files matched",42)
if has("clipboard")
sil! let @* = keepregstar
sil! let @+ = keepregstar
@@ -947,7 +1011,7 @@ fun! netrw#Explore(indx,dosplit,style,...)
" call Decho("....wrap indx (indx=".indx." listlen=".w:netrw_explore_listlen.")")
let indx = (indx < 0)? ( w:netrw_explore_listlen - 1 ) : 0
let w:netrw_explore_indx= indx
- keepalt keepj call netrw#ErrorMsg(s:NOTE,"no more files match Explore pattern",43)
+ keepalt NetrwKeepj call netrw#ErrorMsg(s:NOTE,"no more files match Explore pattern",43)
endif
exe "let dirfile= w:netrw_explore_list[".indx."]"
@@ -961,20 +1025,20 @@ fun! netrw#Explore(indx,dosplit,style,...)
let w:netrw_liststyle= g:netrw_liststyle
endif
if w:netrw_liststyle == s:THINLIST || w:netrw_liststyle == s:LONGLIST
- keepalt keepj call search('^'.substitute(dirfile,"^.*/","","").'\>',"W")
+ keepalt NetrwKeepj call search('^'.substitute(dirfile,"^.*/","","").'\>',"W")
else
- keepalt keepj call search('\<'.substitute(dirfile,"^.*/","","").'\>',"w")
+ keepalt NetrwKeepj call search('\<'.substitute(dirfile,"^.*/","","").'\>',"w")
endif
let w:netrw_explore_mtchcnt = indx + 1
let w:netrw_explore_bufnr = bufnr("%")
let w:netrw_explore_line = line(".")
- keepalt keepj call s:SetupNetrwStatusLine('%f %h%m%r%=%9*%{NetrwStatusLine()}')
+ keepalt NetrwKeepj call s:SetupNetrwStatusLine('%f %h%m%r%=%9*%{NetrwStatusLine()}')
" call Decho("....explore: mtchcnt=".w:netrw_explore_mtchcnt." bufnr=".w:netrw_explore_bufnr." line#".w:netrw_explore_line)
else
" call Decho("..your vim does not have +path_extra")
if !exists("g:netrw_quiet")
- keepalt keepj call netrw#ErrorMsg(s:WARNING,"your vim needs the +path_extra feature for Exploring with **!",44)
+ keepalt NetrwKeepj call netrw#ErrorMsg(s:WARNING,"your vim needs the +path_extra feature for Exploring with **!",44)
endif
if has("clipboard")
sil! let @* = keepregstar
@@ -993,9 +1057,9 @@ fun! netrw#Explore(indx,dosplit,style,...)
endif
let newdir= dirname
if !exists("b:netrw_curdir")
- keepj call netrw#LocalBrowseCheck(getcwd())
+ NetrwKeepj call netrw#LocalBrowseCheck(getcwd())
else
- keepj call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,newdir))
+ NetrwKeepj call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,newdir))
endif
endif
@@ -1057,50 +1121,99 @@ endfun
" ---------------------------------------------------------------------
" netrw#Lexplore: toggle Explorer window, keeping it on the left of the current tab {{{2
-fun! netrw#Lexplore(...)
-" call Dfunc("netrw#Lexplore() a:0=".a:0)
+fun! netrw#Lexplore(count,rightside,...)
+" call Dfunc("netrw#Lexplore(count=".a:count."rightside=".a:rightside.",...) a:0=".a:0." ft=".&ft)
+ let curwin= winnr()
+
if a:0 > 0 && a:1 != ""
" if a netrw window is already on the left-side of the tab
" and a directory has been specified, explore with that
" directory.
- let lexwinnr= winnr()
+ let a1 = expand(a:1)
+" call Decho("a:1<".a:1."> curwin#".curwin)
exe "1wincmd w"
if &ft == "netrw"
- exe "Explore ".fnameescape(a:1)
- exe lexwinnr."wincmd w"
+" call Decho("exe Explore ".fnameescape(a:1))
+ exe "Explore ".fnameescape(a1)
+ exe curwin."wincmd w"
+ if exists("t:netrw_lexposn")
+" call Decho("forgetting t:netrw_lexposn")
+ unlet t:netrw_lexposn
+ endif
+" call Dret("netrw#Lexplore")
+ return
endif
- exe lexwinnr."wincmd w"
-" call Dret("netrw#Lexplore")
- return
+ exe curwin."wincmd w"
+ else
+ let a1= ""
endif
if exists("t:netrw_lexbufnr")
- " close down netrw explorer window
+ " check if t:netrw_lexbufnr refers to a netrw window
let lexwinnr = bufwinnr(t:netrw_lexbufnr)
- if lexwinnr != -1
- let curwin = winnr()
- exe lexwinnr."wincmd w"
- close
- exe curwin."wincmd w"
- endif
+ else
+ let lexwinnr= 0
+ endif
+
+ if lexwinnr > 0
+ " close down netrw explorer window
+" call Decho("t:netrw_lexbufnr#".t:netrw_lexbufnr.": close down netrw window")
+ exe lexwinnr."wincmd w"
+ let g:netrw_winsize = -winwidth(0)
+ let t:netrw_lexposn = netrw#SavePosn()
+" call Decho("saving t:netrw_lexposn")
+ close
+ if lexwinnr < curwin
+ let curwin= curwin - 1
+ endif
+ exe curwin."wincmd w"
unlet t:netrw_lexbufnr
else
" open netrw explorer window
+" call Decho("t:netrw_lexbufnr<n/a>: open netrw explorer window")
exe "1wincmd w"
let keep_altv = g:netrw_altv
let g:netrw_altv = 0
- if a:0 > 0 && a:1 != ""
- exe "Vexplore ".fnameescape(a:1)
+ if a:count != 0
+ let netrw_winsize = g:netrw_winsize
+ let g:netrw_winsize = a:count
+ endif
+ let curfile= expand("%")
+" call Decho("curfile<".curfile.">")
+ exe (a:rightside? "botright" : "topleft")." vertical ".((g:netrw_winsize > 0)? (g:netrw_winsize*winwidth(0))/100 : -g:netrw_winsize) . " new"
+ if a:0 > 0 && a1 != ""
+" call Decho("case 1: Explore ".a1)
+ exe "Explore ".fnameescape(a1)
+ elseif curfile =~ '^\a\+://'
+" call Decho("case 2: Explore ".substitute(curfile,'[^/\\]*$','',''))
+ exe "Explore ".substitute(curfile,'[^/\\]*$','','')
else
- Vexplore .
+" call Decho("case 3: Explore .")
+ Explore .
endif
+ if a:count != 0
+ let g:netrw_winsize = netrw_winsize
+ endif
+ setlocal winfixwidth
let g:netrw_altv = keep_altv
let t:netrw_lexbufnr = bufnr("%")
+ if exists("t:netrw_lexposn")
+" call Decho("restoring to t:netrw_lexposn")
+ call netrw#RestorePosn(t:netrw_lexposn)
+ unlet t:netrw_lexposn
+ endif
endif
+
+ " set up default window for editing via <cr>
if exists("g:netrw_chgwin") && g:netrw_chgwin == -1
- let g:netrw_chgwin= 2
+ if a:rightside
+ let g:netrw_chgwin= 1
+ else
+ let g:netrw_chgwin= 2
+ endif
endif
+
" call Dret("netrw#Lexplore")
endfun
@@ -1261,17 +1374,16 @@ fun! netrw#Obtain(islocal,fname,...)
let path= ""
endif
let filelist= join(map(deepcopy(fnamelist),'shellescape(g:netrw_machine.":".path.v:val,1)'))
-" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_scp_cmd.shellescape(useport,1)." ".filelist." ".shellescape(tgtdir,1))
- exe s:netrw_silentxfer."!".g:netrw_scp_cmd.shellescape(useport,1)." ".filelist." ".shellescape(tgtdir,1)
+ call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_scp_cmd.shellescape(useport,1)." ".filelist." ".shellescape(tgtdir,1))
elseif b:netrw_method == 2
" obtain file using ftp + .netrc
" call Decho("obtain via ftp+.netrc (method #2)")
- call s:SaveBufVars()|sil keepjumps new|call s:RestoreBufVars()
+ call s:SaveBufVars()|sil NetrwKeepj new|call s:RestoreBufVars()
let tmpbufnr= bufnr("%")
setl ff=unix
if exists("g:netrw_ftpmode") && g:netrw_ftpmode != ""
- keepj put =g:netrw_ftpmode
+ NetrwKeepj put =g:netrw_ftpmode
" call Decho("filter input: ".getline('$'))
endif
@@ -1281,7 +1393,7 @@ fun! netrw#Obtain(islocal,fname,...)
endif
if exists("g:netrw_ftpextracmd")
- keepj put =g:netrw_ftpextracmd
+ NetrwKeepj put =g:netrw_ftpextracmd
" call Decho("filter input: ".getline('$'))
endif
for fname in fnamelist
@@ -1289,11 +1401,9 @@ fun! netrw#Obtain(islocal,fname,...)
" call Decho("filter input: ".getline('$'))
endfor
if exists("g:netrw_port") && g:netrw_port != ""
-" call Decho("executing: %!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1))
- exe s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1)
+ call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1))
else
-" call Decho("executing: %!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1))
- exe s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)
+ call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1))
endif
" If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
if getline(1) !~ "^$" && !exists("g:netrw_quiet") && getline(1) !~ '^Trying '
@@ -1306,53 +1416,53 @@ fun! netrw#Obtain(islocal,fname,...)
elseif b:netrw_method == 3
" obtain with ftp + machine, id, passwd, and fname (ie. no .netrc)
" call Decho("obtain via ftp+mipf (method #3)")
- call s:SaveBufVars()|sil keepjumps new|call s:RestoreBufVars()
+ call s:SaveBufVars()|sil NetrwKeepj new|call s:RestoreBufVars()
let tmpbufnr= bufnr("%")
setl ff=unix
if exists("g:netrw_port") && g:netrw_port != ""
- keepj put ='open '.g:netrw_machine.' '.g:netrw_port
+ NetrwKeepj put ='open '.g:netrw_machine.' '.g:netrw_port
" call Decho("filter input: ".getline('$'))
else
- keepj put ='open '.g:netrw_machine
+ NetrwKeepj put ='open '.g:netrw_machine
" call Decho("filter input: ".getline('$'))
endif
if exists("g:netrw_uid") && g:netrw_uid != ""
if exists("g:netrw_ftp") && g:netrw_ftp == 1
- keepj put =g:netrw_uid
+ NetrwKeepj put =g:netrw_uid
" call Decho("filter input: ".getline('$'))
if exists("s:netrw_passwd") && s:netrw_passwd != ""
- keepj put ='\"'.s:netrw_passwd.'\"'
+ NetrwKeepj put ='\"'.s:netrw_passwd.'\"'
endif
" call Decho("filter input: ".getline('$'))
elseif exists("s:netrw_passwd")
- keepj put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"'
+ NetrwKeepj put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"'
" call Decho("filter input: ".getline('$'))
endif
endif
if exists("g:netrw_ftpmode") && g:netrw_ftpmode != ""
- keepj put =g:netrw_ftpmode
+ NetrwKeepj put =g:netrw_ftpmode
" call Decho("filter input: ".getline('$'))
endif
if exists("b:netrw_fname") && b:netrw_fname != ""
- keepj call setline(line("$")+1,'cd "'.b:netrw_fname.'"')
+ NetrwKeepj call setline(line("$")+1,'cd "'.b:netrw_fname.'"')
" call Decho("filter input: ".getline('$'))
endif
if exists("g:netrw_ftpextracmd")
- keepj put =g:netrw_ftpextracmd
+ NetrwKeepj put =g:netrw_ftpextracmd
" call Decho("filter input: ".getline('$'))
endif
if exists("g:netrw_ftpextracmd")
- keepj put =g:netrw_ftpextracmd
+ NetrwKeepj put =g:netrw_ftpextracmd
" call Decho("filter input: ".getline('$'))
endif
for fname in fnamelist
- keepj call setline(line("$")+1,'get "'.fname.'"')
+ NetrwKeepj call setline(line("$")+1,'get "'.fname.'"')
endfor
" call Decho("filter input: ".getline('$'))
@@ -1360,14 +1470,13 @@ fun! netrw#Obtain(islocal,fname,...)
" -i : turns off interactive prompting from ftp
" -n unix : DON'T use <.netrc>, even though it exists
" -n win32: quit being obnoxious about password
- keepj norm! 1Gdd
-" call Decho("executing: %!".s:netrw_ftp_cmd." ".g:netrw_ftp_options)
- exe s:netrw_silentxfer."%!".s:netrw_ftp_cmd." ".g:netrw_ftp_options
+ NetrwKeepj norm! 1Gdd
+ call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." ".g:netrw_ftp_options)
" If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
if getline(1) !~ "^$"
" call Decho("error<".getline(1).">")
if !exists("g:netrw_quiet")
- keepj call netrw#ErrorMsg(s:ERROR,getline(1),5)
+ NetrwKeepj call netrw#ErrorMsg(s:ERROR,getline(1),5)
endif
endif
@@ -1379,8 +1488,7 @@ fun! netrw#Obtain(islocal,fname,...)
else
let localfile= a:fname
endif
-" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_sftp_cmd." ".shellescape(g:netrw_machine.":".b:netrw_fname,1).shellescape(localfile)." ".shellescape(tgtdir))
- exe s:netrw_silentxfer."!".g:netrw_sftp_cmd." ".shellescape(g:netrw_machine.":".b:netrw_fname,1).shellescape(localfile)." ".shellescape(tgtdir)
+ call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_sftp_cmd." ".shellescape(g:netrw_machine.":".b:netrw_fname,1).shellescape(localfile)." ".shellescape(tgtdir))
elseif !exists("b:netrw_method") || b:netrw_method < 0
" probably a badly formed url; protocol not recognized
@@ -1390,7 +1498,7 @@ fun! netrw#Obtain(islocal,fname,...)
else
" protocol recognized but not supported for Obtain (yet?)
if !exists("g:netrw_quiet")
- keepj call netrw#ErrorMsg(s:ERROR,"current protocol not supported for obtaining file",97)
+ NetrwKeepj call netrw#ErrorMsg(s:ERROR,"current protocol not supported for obtaining file",97)
endif
" call Dret("netrw#Obtain : current protocol not supported for obtaining file")
return
@@ -1398,7 +1506,7 @@ fun! netrw#Obtain(islocal,fname,...)
" restore status line
if type(a:fname) == 1 && exists("s:netrw_users_stl")
- keepj call s:SetupNetrwStatusLine(s:netrw_users_stl)
+ NetrwKeepj call s:SetupNetrwStatusLine(s:netrw_users_stl)
endif
endif
@@ -1440,7 +1548,7 @@ fun! s:NetrwOptionRestore(vt)
if !exists("{a:vt}netrw_optionsave")
if exists("s:nbcd_curpos_{bufnr('%')}")
" call Decho("restoring previous position (s:nbcd_curpos_".bufnr('%')." exists)")
- keepj call netrw#RestorePosn(s:nbcd_curpos_{bufnr('%')})
+ NetrwKeepj call netrw#RestorePosn(s:nbcd_curpos_{bufnr('%')})
" call Decho("win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> winnr($)=".winnr("$"))
" call Decho("unlet s:nbcd_curpos_".bufnr('%'))
unlet s:nbcd_curpos_{bufnr('%')}
@@ -1481,7 +1589,9 @@ fun! s:NetrwOptionRestore(vt)
if exists("{a:vt}netrw_cpokeep") |let &l:cpo = {a:vt}netrw_cpokeep |unlet {a:vt}netrw_cpokeep |endif
if exists("{a:vt}netrw_diffkeep") |let &l:diff = {a:vt}netrw_diffkeep |unlet {a:vt}netrw_diffkeep |endif
if exists("{a:vt}netrw_fenkeep") |let &l:fen = {a:vt}netrw_fenkeep |unlet {a:vt}netrw_fenkeep |endif
- if exists("{a:vt}netrw_ffkeep") |let &l:ff = {a:vt}netrw_ffkeep |unlet {a:vt}netrw_ffkeep |endif
+ if exists("g:netrw_ffkep") && g:netrw_ffkeep
+ if exists("{a:vt}netrw_ffkeep") |let &l:ff = {a:vt}netrw_ffkeep |unlet {a:vt}netrw_ffkeep |endif
+ endif
if exists("{a:vt}netrw_fokeep") |let &l:fo = {a:vt}netrw_fokeep |unlet {a:vt}netrw_fokeep |endif
if exists("{a:vt}netrw_gdkeep") |let &l:gd = {a:vt}netrw_gdkeep |unlet {a:vt}netrw_gdkeep |endif
if exists("{a:vt}netrw_hidkeep") |let &l:hidden = {a:vt}netrw_hidkeep |unlet {a:vt}netrw_hidkeep |endif
@@ -1535,7 +1645,7 @@ fun! s:NetrwOptionRestore(vt)
if exists("{a:vt}netrw_regslash")|sil! let @/= {a:vt}netrw_regslash|unlet {a:vt}netrw_regslash|endif
if exists("s:nbcd_curpos_{bufnr('%')}")
" call Decho("restoring previous position (s:nbcd_curpos_".bufnr('%')." exists)")
- keepj call netrw#RestorePosn(s:nbcd_curpos_{bufnr('%')})
+ NetrwKeepj call netrw#RestorePosn(s:nbcd_curpos_{bufnr('%')})
" call Decho("unlet s:nbcd_curpos_".bufnr('%'))
if exists("s:nbcd_curpos_".bufnr('%'))
unlet s:nbcd_curpos_{bufnr('%')}
@@ -1599,7 +1709,7 @@ fun! s:NetrwOptionSave(vt)
let {a:vt}netrw_cpokeep = &l:cpo
let {a:vt}netrw_diffkeep = &l:diff
let {a:vt}netrw_fenkeep = &l:fen
- if !exists("g:netrw_ffkeep") || g:netrw_ffkeep == 1
+ if !exists("g:netrw_ffkeep") || g:netrw_ffkeep
let {a:vt}netrw_ffkeep = &l:ff
endif
let {a:vt}netrw_fokeep = &l:fo " formatoptions
@@ -1686,10 +1796,10 @@ fun! s:NetrwSafeOptions()
" call Decho("ft<".&ft."> ei=".&ei)
if &ft == "netrw"
" call Decho("do any netrw FileType autocmds (doau FileType netrw)")
- sil! keepalt keepj doau FileType netrw
+ sil! keepalt NetrwKeepj doau FileType netrw
endif
-" call Decho("fo=".&fo.(exists("+acd")? " acd=".&acd : " acd doesn't exist")." bh=".&l:bh)
+" call Decho("fo=".&fo.(exists("+acd")? " acd=".&acd : " acd doesn't exist")." bh=".&l:bh." bt<".&bt.">")
" call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo)
" call Dret("s:NetrwSafeOptions")
endfun
@@ -1744,6 +1854,10 @@ fun! netrw#NetRead(mode,...)
call s:NetrwOptionSave("w:")
call s:NetrwSafeOptions()
call s:RestoreCursorline()
+ " NetrwSafeOptions sets a buffer up for a netrw listing, which includes buflisting off.
+ " However, this setting is not wanted for a remote editing session. The buffer should be "nofile", still.
+ setl bl
+" call Decho("(netrw#NetRead) buf#".bufnr("%")."<".bufname("%")."> bl=".&bl." bt=".&bt." bh=".&bh)
" NetRead: interpret mode into a readcmd {{{3
if a:mode == 0 " read remote file before current line
@@ -1790,6 +1904,7 @@ fun! netrw#NetRead(mode,...)
echomsg ':Nread fetch://machine/path uses fetch'
echomsg ':Nread ftp://[user@]machine[:port]/path uses ftp autodetects <.netrc>'
echomsg ':Nread http://[user@]machine/path uses http wget'
+ echomsg ':Nread file:///path uses elinks'
echomsg ':Nread https://[user@]machine/path uses http wget'
echomsg ':Nread rcp://[user@]machine/path uses rcp'
echomsg ':Nread rsync://machine[:port]/path uses rsync'
@@ -1841,7 +1956,7 @@ fun! netrw#NetRead(mode,...)
" call Decho("checking if NetrwBrowse() should handle choice<".choice."> with netrw_list_cmd<".g:netrw_list_cmd.">")
if choice =~ "^.*[\/]$" && b:netrw_method != 5 && choice !~ '^https\=://'
" call Decho("yes, choice matches '^.*[\/]$'")
- keepj call s:NetrwBrowse(0,choice)
+ NetrwKeepj call s:NetrwBrowse(0,choice)
" call Dret("netrw#NetRead :3 getcwd<".getcwd().">")
return
endif
@@ -1875,8 +1990,7 @@ fun! netrw#NetRead(mode,...)
let uid_machine = g:netrw_machine
endif
endif
-" call Decho("executing: !".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".shellescape(uid_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile,1))
- exe s:netrw_silentxfer."!".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".shellescape(uid_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile,1)
+ call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".shellescape(uid_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile,1))
let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method)
let b:netrw_lastfile = choice
@@ -1885,29 +1999,27 @@ fun! netrw#NetRead(mode,...)
elseif b:netrw_method == 2 " read with ftp + <.netrc>
" call Decho("read via ftp+.netrc (method #2)")
let netrw_fname= b:netrw_fname
- keepj call s:SaveBufVars()|new|keepj call s:RestoreBufVars()
+ NetrwKeepj call s:SaveBufVars()|new|NetrwKeepj call s:RestoreBufVars()
let filtbuf= bufnr("%")
setl ff=unix
- keepj put =g:netrw_ftpmode
+ NetrwKeepj put =g:netrw_ftpmode
" call Decho("filter input: ".getline(line("$")))
if exists("g:netrw_ftpextracmd")
- keepj put =g:netrw_ftpextracmd
+ NetrwKeepj put =g:netrw_ftpextracmd
" call Decho("filter input: ".getline(line("$")))
endif
call setline(line("$")+1,'get "'.netrw_fname.'" '.tmpfile)
" call Decho("filter input: ".getline(line("$")))
if exists("g:netrw_port") && g:netrw_port != ""
-" call Decho("executing: %!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1))
- exe s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1)
+ call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1))
else
-" call Decho("executing: %!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1))
- exe s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)
+ call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1))
endif
" If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
if getline(1) !~ "^$" && !exists("g:netrw_quiet") && getline(1) !~ '^Trying '
let debugkeep = &debug
setl debug=msg
- keepj call netrw#ErrorMsg(s:ERROR,getline(1),4)
+ NetrwKeepj call netrw#ErrorMsg(s:ERROR,getline(1),4)
let &debug = debugkeep
endif
call s:SaveBufVars()
@@ -1926,49 +2038,48 @@ fun! netrw#NetRead(mode,...)
" Construct execution string (four lines) which will be passed through filter
" call Decho("read via ftp+mipf (method #3)")
let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape)
- keepj call s:SaveBufVars()|new|keepj call s:RestoreBufVars()
+ NetrwKeepj call s:SaveBufVars()|new|NetrwKeepj call s:RestoreBufVars()
let filtbuf= bufnr("%")
setl ff=unix
if exists("g:netrw_port") && g:netrw_port != ""
- keepj put ='open '.g:netrw_machine.' '.g:netrw_port
+ NetrwKeepj put ='open '.g:netrw_machine.' '.g:netrw_port
" call Decho("filter input: ".getline('.'))
else
- keepj put ='open '.g:netrw_machine
+ NetrwKeepj put ='open '.g:netrw_machine
" call Decho("filter input: ".getline('.'))
endif
if exists("g:netrw_uid") && g:netrw_uid != ""
if exists("g:netrw_ftp") && g:netrw_ftp == 1
- keepj put =g:netrw_uid
+ NetrwKeepj put =g:netrw_uid
" call Decho("filter input: ".getline('.'))
if exists("s:netrw_passwd")
- keepj put ='\"'.s:netrw_passwd.'\"'
+ NetrwKeepj put ='\"'.s:netrw_passwd.'\"'
endif
" call Decho("filter input: ".getline('.'))
elseif exists("s:netrw_passwd")
- keepj put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"'
+ NetrwKeepj put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"'
" call Decho("filter input: ".getline('.'))
endif
endif
if exists("g:netrw_ftpmode") && g:netrw_ftpmode != ""
- keepj put =g:netrw_ftpmode
+ NetrwKeepj put =g:netrw_ftpmode
" call Decho("filter input: ".getline('.'))
endif
if exists("g:netrw_ftpextracmd")
- keepj put =g:netrw_ftpextracmd
+ NetrwKeepj put =g:netrw_ftpextracmd
" call Decho("filter input: ".getline('.'))
endif
- keepj put ='get \"'.netrw_fname.'\" '.tmpfile
+ NetrwKeepj put ='get \"'.netrw_fname.'\" '.tmpfile
" call Decho("filter input: ".getline('.'))
" perform ftp:
" -i : turns off interactive prompting from ftp
" -n unix : DON'T use <.netrc>, even though it exists
" -n win32: quit being obnoxious about password
- keepj norm! 1Gdd
-" call Decho("executing: %!".s:netrw_ftp_cmd." ".g:netrw_ftp_options)
- exe s:netrw_silentxfer."%!".s:netrw_ftp_cmd." ".g:netrw_ftp_options
+ NetrwKeepj norm! 1Gdd
+ call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." ".g:netrw_ftp_options)
" If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
if getline(1) !~ "^$"
" call Decho("error<".getline(1).">")
@@ -1989,8 +2100,14 @@ fun! netrw#NetRead(mode,...)
else
let useport= ""
endif
-" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile,1))
- exe s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile,1)
+ " 'C' in 'C:\path\to\file' is handled as hostname on windows.
+ " This is workaround to avoid mis-handle windows local-path:
+ if g:netrw_scp_cmd =~ '^scp' && (has("win32") || has("win95") || has("win64") || has("win16"))
+ let tmpfile_get = substitute(tr(tmpfile, '\', '/'), '^\(\a\):[/\\]\(.*\)$', '/\1/\2', '')
+ else
+ let tmpfile_get = tmpfile
+ endif
+ call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile_get,1))
let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method)
let b:netrw_lastfile = choice
@@ -2010,11 +2127,9 @@ fun! netrw#NetRead(mode,...)
" using g:netrw_http_cmd (usually elinks, links, curl, wget, or fetch)
" call Decho('using '.g:netrw_http_cmd.' (# not in b:netrw_fname<'.b:netrw_fname.">)")
if exists("g:netrw_http_xcmd")
-" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(b:netrw_http."://".g:netrw_machine.b:netrw_fname,1)." ".g:netrw_http_xcmd." ".shellescape(tmpfile,1))
- exe s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(b:netrw_http."://".g:netrw_machine.b:netrw_fname,1)." ".g:netrw_http_xcmd." ".shellescape(tmpfile,1)
+ call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(b:netrw_http."://".g:netrw_machine.b:netrw_fname,1)." ".g:netrw_http_xcmd." ".shellescape(tmpfile,1))
else
-" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile,1)." ".shellescape(b:netrw_http."://".g:netrw_machine.b:netrw_fname,1))
- exe s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile,1)." ".shellescape(b:netrw_http."://".g:netrw_machine.b:netrw_fname,1)
+ call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile,1)." ".shellescape(b:netrw_http."://".g:netrw_machine.b:netrw_fname,1))
endif
let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method)
@@ -2025,11 +2140,10 @@ fun! netrw#NetRead(mode,...)
let netrw_tag = substitute(b:netrw_fname,"^.*#","","")
" call Decho("netrw_html<".netrw_html.">")
" call Decho("netrw_tag <".netrw_tag.">")
-" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile,1)." ".shellescape(b:netrw_http."://".g:netrw_machine.netrw_html,1))
- exe s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile,1)." ".shellescape(b:netrw_http."://".g:netrw_machine.netrw_html,1)
+ call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile,1)." ".shellescape(b:netrw_http."://".g:netrw_machine.netrw_html,1))
let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method)
" call Decho('<\s*a\s*name=\s*"'.netrw_tag.'"/')
- exe 'keepj norm! 1G/<\s*a\s*name=\s*"'.netrw_tag.'"/'."\<CR>"
+ exe 'NetrwKeepj norm! 1G/<\s*a\s*name=\s*"'.netrw_tag.'"/'."\<CR>"
endif
let b:netrw_lastfile = choice
" call Decho("setl ro")
@@ -2046,28 +2160,26 @@ fun! netrw#NetRead(mode,...)
return
endif
if g:netrw_dav_cmd =~ "curl"
-" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_dav_cmd." ".shellescape("dav://".g:netrw_machine.b:netrw_fname,1)." ".shellescape(tmpfile,1))
- exe s:netrw_silentxfer."!".g:netrw_dav_cmd." ".shellescape("dav://".g:netrw_machine.b:netrw_fname,1)." ".shellescape(tmpfile,1)
+ call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_dav_cmd." ".shellescape("dav://".g:netrw_machine.b:netrw_fname,1)." ".shellescape(tmpfile,1))
else
" Construct execution string (four lines) which will be passed through filter
let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape)
new
setl ff=unix
if exists("g:netrw_port") && g:netrw_port != ""
- keepj put ='open '.g:netrw_machine.' '.g:netrw_port
+ NetrwKeepj put ='open '.g:netrw_machine.' '.g:netrw_port
else
- keepj put ='open '.g:netrw_machine
+ NetrwKeepj put ='open '.g:netrw_machine
endif
if exists("g:netrw_uid") && exists("s:netrw_passwd") && g:netrw_uid != ""
- keepj put ='user '.g:netrw_uid.' '.s:netrw_passwd
+ NetrwKeepj put ='user '.g:netrw_uid.' '.s:netrw_passwd
endif
- keepj put ='get '.netrw_fname.' '.tmpfile
- keepj put ='quit'
+ NetrwKeepj put ='get '.netrw_fname.' '.tmpfile
+ NetrwKeepj put ='quit'
" perform cadaver operation:
- keepj norm! 1Gdd
-" call Decho("executing: %!".g:netrw_dav_cmd)
- exe s:netrw_silentxfer."%!".g:netrw_dav_cmd
+ NetrwKeepj norm! 1Gdd
+ call s:NetrwExe(s:netrw_silentxfer."%!".g:netrw_dav_cmd)
bd!
endif
let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method)
@@ -2077,8 +2189,7 @@ fun! netrw#NetRead(mode,...)
" NetRead: (rsync) NetRead Method #7 {{{3
elseif b:netrw_method == 7
" call Decho("read via rsync (method #7)")
-" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_rsync_cmd." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile,1))
- exe s:netrw_silentxfer."!".g:netrw_rsync_cmd." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile,1)
+ call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_rsync_cmd." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile,1))
let result = s:NetrwGetFile(readcmd,tmpfile, b:netrw_method)
let b:netrw_lastfile = choice
@@ -2089,7 +2200,7 @@ fun! netrw#NetRead(mode,...)
" call Decho("read via fetch (method #8)")
if g:netrw_fetch_cmd == ""
if !exists("g:netrw_quiet")
- keepj call netrw#ErrorMsg(s:ERROR,"fetch command not available",7)
+ NetrwKeepj call netrw#ErrorMsg(s:ERROR,"fetch command not available",7)
endif
" call Dret("NetRead")
return
@@ -2102,11 +2213,9 @@ fun! netrw#NetRead(mode,...)
" call Decho("read via fetch for ".netrw_option)
if exists("g:netrw_uid") && g:netrw_uid != "" && exists("s:netrw_passwd") && s:netrw_passwd != ""
-" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_fetch_cmd." ".shellescape(tmpfile,1)." ".shellescape(netrw_option."://".g:netrw_uid.':'.s:netrw_passwd.'@'.g:netrw_machine."/".b:netrw_fname,1))
- exe s:netrw_silentxfer."!".g:netrw_fetch_cmd." ".shellescape(tmpfile,1)." ".shellescape(netrw_option."://".g:netrw_uid.':'.s:netrw_passwd.'@'.g:netrw_machine."/".b:netrw_fname,1)
+ call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_fetch_cmd." ".shellescape(tmpfile,1)." ".shellescape(netrw_option."://".g:netrw_uid.':'.s:netrw_passwd.'@'.g:netrw_machine."/".b:netrw_fname,1))
else
-" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_fetch_cmd." ".shellescape(tmpfile,1)." ".shellescape(netrw_option."://".g:netrw_machine."/".b:netrw_fname,1))
- exe s:netrw_silentxfer."!".g:netrw_fetch_cmd." ".shellescape(tmpfile,1)." ".shellescape(netrw_option."://".g:netrw_machine."/".b:netrw_fname,1)
+ call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_fetch_cmd." ".shellescape(tmpfile,1)." ".shellescape(netrw_option."://".g:netrw_machine."/".b:netrw_fname,1))
endif
let result = s:NetrwGetFile(readcmd,tmpfile, b:netrw_method)
@@ -2118,12 +2227,19 @@ fun! netrw#NetRead(mode,...)
" NetRead: (sftp) NetRead Method #9 {{{3
elseif b:netrw_method == 9
" call Decho("read via sftp (method #9)")
-" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_sftp_cmd." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".tmpfile)
- exe s:netrw_silentxfer."!".g:netrw_sftp_cmd." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".tmpfile
+ call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_sftp_cmd." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".tmpfile)
let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method)
let b:netrw_lastfile = choice
".........................................
+ " NetRead: (file) NetRead Method #10 {{{3
+ elseif b:netrw_method == 10 && exists("g:netrw_file_cmd")
+" " call Decho("read via ".b:netrw_file_cmd." (method #10)")
+ call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_file_cmd." ".shellescape(b:netrw_fname,1)." ".tmpfile)
+ let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method)
+ let b:netrw_lastfile = choice
+
+ ".........................................
" NetRead: Complain {{{3
else
call netrw#ErrorMsg(s:WARNING,"unable to comply with your request<" . choice . ">",8)
@@ -2138,9 +2254,9 @@ fun! netrw#NetRead(mode,...)
endif
if s:FileReadable(tmpfile) && tmpfile !~ '.tar.bz2$' && tmpfile !~ '.tar.gz$' && tmpfile !~ '.zip' && tmpfile !~ '.tar' && readcmd != 't' && tmpfile !~ '.tar.xz$' && tmpfile !~ '.txz'
" call Decho("cleanup by deleting tmpfile<".tmpfile.">")
- keepj call s:NetrwDelete(tmpfile)
+ NetrwKeepj call s:NetrwDelete(tmpfile)
endif
- keepj call s:NetrwOptionRestore("w:")
+ NetrwKeepj call s:NetrwOptionRestore("w:")
" call Dret("netrw#NetRead :5 getcwd<".getcwd().">")
endfun
@@ -2175,16 +2291,16 @@ fun! netrw#NetWrite(...) range
" (line numbers don't really make sense for that).
" Also supports the writing of tar and zip files.
" call Decho("(write entire file) sil exe w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile))
- exe "sil keepj w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile)
+ exe "sil NetrwKeepj w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile)
elseif g:netrw_cygwin
" write (selected portion of) file to temporary
let cygtmpfile= substitute(tmpfile,g:netrw_cygdrive.'/\(.\)','\1:','')
" call Decho("(write selected portion) sil exe ".a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(cygtmpfile))
- exe "sil keepj ".a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(cygtmpfile)
+ exe "sil NetrwKeepj ".a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(cygtmpfile)
else
" write (selected portion of) file to temporary
" call Decho("(write selected portion) sil exe ".a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile))
- exe "sil keepj ".a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile)
+ exe "sil NetrwKeepj ".a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile)
endif
if curbufname == ""
@@ -2251,7 +2367,7 @@ fun! netrw#NetWrite(...) range
" call Decho("choice<" . choice . "> ichoice=".ichoice)
" Determine method of write (ftp, rcp, etc) {{{4
- keepj call s:NetrwMethod(choice)
+ NetrwKeepj call s:NetrwMethod(choice)
if !exists("b:netrw_method") || b:netrw_method < 0
" call Dfunc("netrw#NetWrite : unsupported method")
return
@@ -2282,8 +2398,7 @@ fun! netrw#NetWrite(...) range
let uid_machine = g:netrw_machine
endif
endif
-" call Decho("executing: !".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".shellescape(tmpfile,1)." ".shellescape(uid_machine.":".b:netrw_fname,1))
- exe s:netrw_silentxfer."!".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".shellescape(tmpfile,1)." ".shellescape(uid_machine.":".b:netrw_fname,1)
+ call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".shellescape(tmpfile,1)." ".shellescape(uid_machine.":".b:netrw_fname,1))
let b:netrw_lastfile = choice
".........................................
@@ -2300,26 +2415,24 @@ fun! netrw#NetWrite(...) range
" call Decho("filter input window#".winnr())
setl ff=unix
- keepj put =g:netrw_ftpmode
+ NetrwKeepj put =g:netrw_ftpmode
" call Decho("filter input: ".getline('$'))
if exists("g:netrw_ftpextracmd")
- keepj put =g:netrw_ftpextracmd
+ NetrwKeepj put =g:netrw_ftpextracmd
" call Decho("filter input: ".getline("$"))
endif
- keepj call setline(line("$")+1,'put "'.tmpfile.'" "'.netrw_fname.'"')
+ NetrwKeepj call setline(line("$")+1,'put "'.tmpfile.'" "'.netrw_fname.'"')
" call Decho("filter input: ".getline("$"))
if exists("g:netrw_port") && g:netrw_port != ""
-" call Decho("executing: %!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1))
- exe s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1)
+ call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1))
else
" call Decho("filter input window#".winnr())
-" call Decho("executing: %!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1))
- exe s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)
+ call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1))
endif
" If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
if getline(1) !~ "^$"
if !exists("g:netrw_quiet")
- keepj call netrw#ErrorMsg(s:ERROR,getline(1),14)
+ NetrwKeepj call netrw#ErrorMsg(s:ERROR,getline(1),14)
endif
let mod=1
endif
@@ -2347,32 +2460,32 @@ fun! netrw#NetWrite(...) range
setl ff=unix
if exists("g:netrw_port") && g:netrw_port != ""
- keepj put ='open '.g:netrw_machine.' '.g:netrw_port
+ NetrwKeepj put ='open '.g:netrw_machine.' '.g:netrw_port
" call Decho("filter input: ".getline('.'))
else
- keepj put ='open '.g:netrw_machine
+ NetrwKeepj put ='open '.g:netrw_machine
" call Decho("filter input: ".getline('.'))
endif
if exists("g:netrw_uid") && g:netrw_uid != ""
if exists("g:netrw_ftp") && g:netrw_ftp == 1
- keepj put =g:netrw_uid
+ NetrwKeepj put =g:netrw_uid
" call Decho("filter input: ".getline('.'))
if exists("s:netrw_passwd") && s:netrw_passwd != ""
- keepj put ='\"'.s:netrw_passwd.'\"'
+ NetrwKeepj put ='\"'.s:netrw_passwd.'\"'
endif
" call Decho("filter input: ".getline('.'))
elseif exists("s:netrw_passwd") && s:netrw_passwd != ""
- keepj put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"'
+ NetrwKeepj put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"'
" call Decho("filter input: ".getline('.'))
endif
endif
- keepj put =g:netrw_ftpmode
+ NetrwKeepj put =g:netrw_ftpmode
" call Decho("filter input: ".getline('$'))
if exists("g:netrw_ftpextracmd")
- keepj put =g:netrw_ftpextracmd
+ NetrwKeepj put =g:netrw_ftpextracmd
" call Decho("filter input: ".getline("$"))
endif
- keepj put ='put \"'.tmpfile.'\" \"'.netrw_fname.'\"'
+ NetrwKeepj put ='put \"'.tmpfile.'\" \"'.netrw_fname.'\"'
" call Decho("filter input: ".getline('.'))
" save choice/id/password for future use
let b:netrw_lastfile = choice
@@ -2381,9 +2494,8 @@ fun! netrw#NetWrite(...) range
" -i : turns off interactive prompting from ftp
" -n unix : DON'T use <.netrc>, even though it exists
" -n win32: quit being obnoxious about password
- keepj norm! 1Gdd
-" call Decho("executing: %!".s:netrw_ftp_cmd." ".g:netrw_ftp_options)
- exe s:netrw_silentxfer."%!".s:netrw_ftp_cmd." ".g:netrw_ftp_options
+ NetrwKeepj norm! 1Gdd
+ call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." ".g:netrw_ftp_options)
" If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
if getline(1) !~ "^$"
if !exists("g:netrw_quiet")
@@ -2407,8 +2519,7 @@ fun! netrw#NetWrite(...) range
else
let useport= ""
endif
-" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".shellescape(tmpfile,1)." ".shellescape(g:netrw_machine.":".b:netrw_fname,1))
- exe s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".shellescape(tmpfile,1)." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)
+ call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".shellescape(tmpfile,1)." ".shellescape(g:netrw_machine.":".b:netrw_fname,1))
let b:netrw_lastfile = choice
".........................................
@@ -2418,8 +2529,7 @@ fun! netrw#NetWrite(...) range
let curl= substitute(g:netrw_http_put_cmd,'\s\+.*$',"","")
if executable(curl)
let url= g:netrw_choice
-" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_http_put_cmd." ".shellescape(tmpfile,1)." ".shellescape(url,1) )
- exe s:netrw_silentxfer."!".g:netrw_http_put_cmd." ".shellescape(tmpfile,1)." ".shellescape(url,1)
+ call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_http_put_cmd." ".shellescape(tmpfile,1)." ".shellescape(url,1) )
elseif !exists("g:netrw_quiet")
call netrw#ErrorMsg(s:ERROR,"can't write to http using <".g:netrw_http_put_cmd".">".",16)
endif
@@ -2440,19 +2550,18 @@ fun! netrw#NetWrite(...) range
setl ff=unix
if exists("g:netrw_port") && g:netrw_port != ""
- keepj put ='open '.g:netrw_machine.' '.g:netrw_port
+ NetrwKeepj put ='open '.g:netrw_machine.' '.g:netrw_port
else
- keepj put ='open '.g:netrw_machine
+ NetrwKeepj put ='open '.g:netrw_machine
endif
if exists("g:netrw_uid") && exists("s:netrw_passwd") && g:netrw_uid != ""
- keepj put ='user '.g:netrw_uid.' '.s:netrw_passwd
+ NetrwKeepj put ='user '.g:netrw_uid.' '.s:netrw_passwd
endif
- keepj put ='put '.tmpfile.' '.netrw_fname
+ NetrwKeepj put ='put '.tmpfile.' '.netrw_fname
" perform cadaver operation:
- keepj norm! 1Gdd
-" call Decho("executing: %!".g:netrw_dav_cmd)
- exe s:netrw_silentxfer."%!".g:netrw_dav_cmd
+ NetrwKeepj norm! 1Gdd
+ call s:NetrwExe(s:netrw_silentxfer."%!".g:netrw_dav_cmd)
" remove enew buffer (quietly)
let filtbuf= bufnr("%")
@@ -2466,8 +2575,7 @@ fun! netrw#NetWrite(...) range
" NetWrite: (rsync) NetWrite Method #7 {{{3
elseif b:netrw_method == 7
" call Decho("write via rsync (method #7)")
-" call Decho("executing: !".g:netrw_rsync_cmd." ".shellescape(tmpfile,1)." ".shellescape(g:netrw_machine.":".b:netrw_fname,1))
- exe s:netrw_silentxfer."!".g:netrw_rsync_cmd." ".shellescape(tmpfile,1)." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)
+ call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_rsync_cmd." ".shellescape(tmpfile,1)." ".shellescape(g:netrw_machine.":".b:netrw_fname,1))
let b:netrw_lastfile = choice
".........................................
@@ -2490,9 +2598,8 @@ fun! netrw#NetWrite(...) range
setl ff=unix
call setline(1,'put "'.escape(tmpfile,'\').'" '.netrw_fname)
" call Decho("filter input: ".getline('.'))
-" call Decho("executing: %!".g:netrw_sftp_cmd.' '.shellescape(uid_machine,1))
let sftpcmd= substitute(g:netrw_sftp_cmd,"%TEMPFILE%",escape(tmpfile,'\'),"g")
- exe s:netrw_silentxfer."%!".sftpcmd.' '.shellescape(uid_machine,1)
+ call s:NetrwExe(s:netrw_silentxfer."%!".sftpcmd.' '.shellescape(uid_machine,1))
let filtbuf= bufnr("%")
exe curbuf."b!"
let &l:bh = bhkeep
@@ -2670,12 +2777,12 @@ fun! s:NetrwGetFile(readcmd, tfile, method)
call tar#Browse(tfile)
else
" call Decho("edit temporary file")
- e!
+ NetrwKeepj e!
endif
" rename buffer back to remote filename
" call Decho("exe sil! keepalt file ".fnameescape(rfile))
- exe "sil! keepj keepalt file ".fnameescape(rfile)
+ exe "sil! NetrwKeepj keepalt file ".fnameescape(rfile)
" Detect filetype of local version of remote file.
" Note that isk must not include a "/" for scripts.vim
@@ -2690,7 +2797,7 @@ fun! s:NetrwGetFile(readcmd, tfile, method)
elseif !&ma
" attempting to read a file after the current line in the file, but the buffer is not modifiable
- keepj call netrw#ErrorMsg(s:WARNING,"attempt to read<".a:tfile."> into a non-modifiable buffer!",94)
+ NetrwKeepj call netrw#ErrorMsg(s:WARNING,"attempt to read<".a:tfile."> into a non-modifiable buffer!",94)
" call Dret("NetrwGetFile : attempt to read<".a:tfile."> into a non-modifiable buffer!")
return
@@ -2700,7 +2807,7 @@ fun! s:NetrwGetFile(readcmd, tfile, method)
let curline = line(".")
let lastline= line("$")
" call Decho("exe<".a:readcmd." ".fnameescape(v:cmdarg)." ".fnameescape(a:tfile)."> line#".curline)
- exe "keepj ".a:readcmd." ".fnameescape(v:cmdarg)." ".fnameescape(a:tfile)
+ exe "NetrwKeepj ".a:readcmd." ".fnameescape(v:cmdarg)." ".fnameescape(a:tfile)
let line1= curline + 1
let line2= line("$") - lastline + 1
@@ -2708,7 +2815,7 @@ fun! s:NetrwGetFile(readcmd, tfile, method)
" not readable
" call Decho(" ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
" call Decho("tfile<".a:tfile."> not readable")
- keepj call netrw#ErrorMsg(s:WARNING,"file <".a:tfile."> not readable",9)
+ NetrwKeepj call netrw#ErrorMsg(s:WARNING,"file <".a:tfile."> not readable",9)
" call Dret("NetrwGetFile : tfile<".a:tfile."> not readable")
return
endif
@@ -2716,14 +2823,14 @@ fun! s:NetrwGetFile(readcmd, tfile, method)
" User-provided (ie. optional) fix-it-up command
if exists("*NetReadFixup")
" call Decho("calling NetReadFixup(method<".a:method."> line1=".line1." line2=".line2.")")
- keepj call NetReadFixup(a:method, line1, line2)
+ NetrwKeepj call NetReadFixup(a:method, line1, line2)
" else " Decho
" call Decho("NetReadFixup() not called, doesn't exist (line1=".line1." line2=".line2.")")
endif
if has("gui") && has("menu") && has("gui_running") && &go =~# 'm' && g:netrw_menu
" update the Buffers menu
- keepj call s:UpdateBuffersMenu()
+ NetrwKeepj call s:UpdateBuffersMenu()
endif
" call Decho("readcmd<".a:readcmd."> cmdarg<".v:cmdarg."> tfile<".a:tfile."> readable=".s:FileReadable(a:tfile))
@@ -2749,6 +2856,7 @@ endfun
" 7: rsync
" 8: fetch
" 9: sftp
+" 10: file
" g:netrw_machine= hostname
" b:netrw_fname = filename
" g:netrw_port = optional port number (for ftp)
@@ -2799,11 +2907,9 @@ fun! s:NetrwMethod(choice)
" rsyncurm : rsync://host[:port]/path Use rsync
" fetchurm : fetch://[user@]host[:http]/filename Use fetch (defaults to ftp, override for http)
" sftpurm : sftp://[user@]host/filename Use scp
+ " fileurm : file://[user@]host/filename Use elinks or links
let mipf = '^\(\S\+\)\s\+\(\S\+\)\s\+\(\S\+\)\s\+\(\S\+\)$'
let mf = '^\(\S\+\)\s\+\(\S\+\)$'
-" let ftpurm = '^ftp://\(\([^/@]\{-}\)@\)\=\([^/#:]\{-}\)\([#:]\d\+\)\=/\(.*\)$'
-" let rcpurm = '^rcp://\%(\([^/@]\{-}\)@\)\=\([^/]\{-}\)/\(.*\)$'
-" let fetchurm = '^fetch://\(\([^/@]\{-}\)@\)\=\([^/#:]\{-}\)\(:http\)\=/\(.*\)$'
let ftpurm = '^ftp://\(\([^/]*\)@\)\=\([^/#:]\{-}\)\([#:]\d\+\)\=/\(.*\)$'
let rcpurm = '^rcp://\%(\([^/]*\)@\)\=\([^/]\{-}\)/\(.*\)$'
let rcphf = '^\(\(\h\w*\)@\)\=\(\h\w*\):\([^@]\+\)$'
@@ -2813,6 +2919,7 @@ fun! s:NetrwMethod(choice)
let rsyncurm = '^rsync://\([^/]\{-}\)/\(.*\)\=$'
let fetchurm = '^fetch://\(\([^/]*\)@\)\=\([^/#:]\{-}\)\(:http\)\=/\(.*\)$'
let sftpurm = '^sftp://\([^/]\{-}\)/\(.*\)\=$'
+ let fileurm = '^file\=://\(.*\)$'
" call Decho("determine method:")
" Determine Method
@@ -2969,6 +3076,13 @@ fun! s:NetrwMethod(choice)
let g:netrw_uid= userid
endif
+ " Method#10: file://user@hostname/...path-to-file {{{3
+ elseif match(a:choice,fileurm) == 0 && exists("g:netrw_file_cmd")
+" call Decho("http[s]://...")
+ let b:netrw_method = 10
+ let b:netrw_fname = substitute(a:choice,fileurm,'\1',"")
+" call Decho('\1<'.substitute(a:choice,fileurm,'\1',"").">")
+
" Cannot Determine Method {{{3
else
if !exists("g:netrw_quiet")
@@ -3023,7 +3137,7 @@ if has("win95") && exists("g:netrw_win95ftp") && g:netrw_win95ftp
if method == 3 " ftp (no <.netrc>)
let fourblanklines= line2 - 3
if fourblanklines >= line1
- exe "sil keepj ".fourblanklines.",".line2."g/^\s*$/d"
+ exe "sil NetrwKeepj ".fourblanklines.",".line2."g/^\s*$/d"
call histdel("/",-1)
endif
endif
@@ -3163,9 +3277,9 @@ endfun
" 0: (user: <mb>) bookmark current directory
" 1: (user: <gb>) change to the bookmarked directory
" 2: (user: <qb>) list bookmarks
-" 3: (browsing) record current directory history
-" 4: (user: <u>) go up (previous) bookmark
-" 5: (user: <U>) go down (next) bookmark
+" 3: (browsing) records current directory history
+" 4: (user: <u>) go up (previous) directory, using history
+" 5: (user: <U>) go down (next) directory, using history
" 6: (user: <mB>) delete bookmark
fun! s:NetrwBookHistHandler(chg,curdir)
" call Dfunc("s:NetrwBookHistHandler(chg=".a:chg." curdir<".a:curdir.">) cnt=".v:count." histcnt=".g:netrw_dirhist_cnt." histmax=".g:netrw_dirhistmax)
@@ -3174,26 +3288,26 @@ fun! s:NetrwBookHistHandler(chg,curdir)
return
endif
- let ykeep= @@
+ let ykeep = @@
+ let curbufnr = bufnr("%")
+
if a:chg == 0
" bookmark the current directory
" call Decho("(user: <b>) bookmark the current directory")
- if !exists("g:netrw_bookmarklist")
- let g:netrw_bookmarklist= []
- endif
- if index(g:netrw_bookmarklist,a:curdir) == -1
- " curdir not currently in g:netrw_bookmarklist, so include it
- call add(g:netrw_bookmarklist,a:curdir)
- call sort(g:netrw_bookmarklist)
+ if exists("s:netrwmarkfilelist_{curbufnr}")
+ call s:NetrwBookmark(0)
+ echo "bookmarked marked files"
+ else
+ call s:MakeBookmark(a:curdir)
+ echo "bookmarked the current directory"
endif
- echo "bookmarked the current directory"
elseif a:chg == 1
" change to the bookmarked directory
" call Decho("(user: <".v:count."gb>) change to the bookmarked directory")
if exists("g:netrw_bookmarklist[v:count-1]")
" call Decho("(user: <".v:count."gb>) bookmarklist=".string(g:netrw_bookmarklist))
- exe "keepj e ".fnameescape(g:netrw_bookmarklist[v:count-1])
+ exe "NetrwKeepj e ".fnameescape(g:netrw_bookmarklist[v:count-1])
else
echomsg "Sorry, bookmark#".v:count." doesn't exist!"
endif
@@ -3267,13 +3381,13 @@ fun! s:NetrwBookHistHandler(chg,curdir)
if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("b:netrw_curdir")
setl ma noro
" call Decho("setl ma noro")
- sil! keepj %d
+ sil! NetrwKeepj %d
setl nomod
" call Decho("setl nomod")
" call Decho(" ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
endif
" call Decho("exe e! ".fnameescape(g:netrw_dirhist_{g:netrw_dirhist_cnt}))
- exe "keepj e! ".fnameescape(g:netrw_dirhist_{g:netrw_dirhist_cnt})
+ exe "NetrwKeepj e! ".fnameescape(g:netrw_dirhist_{g:netrw_dirhist_cnt})
else
if g:netrw_dirhistmax > 0
let g:netrw_dirhist_cnt= ( g:netrw_dirhist_cnt + v:count1 ) % g:netrw_dirhistmax
@@ -3293,14 +3407,14 @@ fun! s:NetrwBookHistHandler(chg,curdir)
if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("b:netrw_curdir")
" call Decho("setl ma noro")
setl ma noro
- sil! keepj %d
+ sil! NetrwKeepj %d
" call Decho("removed all lines from buffer (%d)")
" call Decho("setl nomod")
setl nomod
" call Decho("(set nomod) ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
endif
" call Decho("exe e! ".fnameescape(g:netrw_dirhist_{g:netrw_dirhist_cnt}))
- exe "keepj e! ".fnameescape(g:netrw_dirhist_{g:netrw_dirhist_cnt})
+ exe "NetrwKeepj e! ".fnameescape(g:netrw_dirhist_{g:netrw_dirhist_cnt})
else
let g:netrw_dirhist_cnt= ( g:netrw_dirhist_cnt - 1 ) % g:netrw_dirhistmax
if g:netrw_dirhist_cnt < 0
@@ -3314,17 +3428,17 @@ fun! s:NetrwBookHistHandler(chg,curdir)
endif
elseif a:chg == 6
- " delete the v:count'th bookmark
-" call Decho("delete bookmark#".v:count."<".g:netrw_bookmarklist[v:count-1].">")
- let savefile= s:NetrwHome()."/.netrwbook"
- if filereadable(savefile)
-" call Decho("merge bookmarks (active and file)")
- keepj call s:NetrwBookHistSave() " done here to merge bookmarks first
-" call Decho("bookmark delete savefile<".savefile.">")
- keepj call delete(savefile)
- endif
+ if exists("s:netrwmarkfilelist_{curbufnr}")
+ call s:NetrwBookmark(1)
+ echo "removed marked files from bookmarks"
+ else
+ " delete the v:count'th bookmark
+" call Decho("delete bookmark#".v:count."<".g:netrw_bookmarklist[v:count-1].">")
+ call s:MergeBookmarks()
" call Decho("remove g:netrw_bookmarklist[".(v:count-1)."]")
- keepj call remove(g:netrw_bookmarklist,v:count-1)
+ NetrwKeepj call remove(g:netrw_bookmarklist,v:count-1)
+ echo "removed current directory from bookmarks"
+ endif
" call Decho("resulting g:netrw_bookmarklist=".string(g:netrw_bookmarklist))
endif
call s:NetrwBookmarkMenu()
@@ -3335,6 +3449,7 @@ endfun
" ---------------------------------------------------------------------
" s:NetrwBookHistRead: this function reads bookmarks and history {{{2
+" Will source the history file (.netrwhist) only if the g:netrw_disthistmax is > 0.
" Sister function: s:NetrwBookHistSave()
fun! s:NetrwBookHistRead()
" call Dfunc("s:NetrwBookHistRead()")
@@ -3348,13 +3463,13 @@ fun! s:NetrwBookHistRead()
let savefile= home."/.netrwbook"
if filereadable(savefile)
" call Decho("sourcing .netrwbook")
- exe "keepalt keepj so ".savefile
+ exe "keepalt NetrwKeepj so ".savefile
endif
if g:netrw_dirhistmax > 0
let savefile= home."/.netrwhist"
if filereadable(savefile)
" call Decho("sourcing .netrwhist")
- exe "keepalt keepj so ".savefile
+ exe "keepalt NetrwKeepj so ".savefile
endif
let s:netrw_initbookhist= 1
au VimLeave * call s:NetrwBookHistSave()
@@ -3369,6 +3484,8 @@ endfun
" Sister function: s:NetrwBookHistRead()
" I used to do this via viminfo but that appears to
" be unreliable for long-term storage
+" If g:netrw_dirhistmax is <= 0, no history or bookmarks
+" will be saved.
fun! s:NetrwBookHistSave()
" call Dfunc("s:NetrwBookHistSave() dirhistmax=".g:netrw_dirhistmax)
if !exists("g:netrw_dirhistmax") || g:netrw_dirhistmax <= 0
@@ -3383,7 +3500,7 @@ fun! s:NetrwBookHistSave()
setl nocin noai noci magic nospell nohid wig= noaw
setl ma noro write
if exists("+acd") | setl noacd | endif
- sil! keepj keepalt %d
+ sil! NetrwKeepj keepalt %d
" save .netrwhist -- no attempt to merge
sil! keepalt file .netrwhist
@@ -3397,21 +3514,20 @@ fun! s:NetrwBookHistSave()
endwhile
exe "sil! w! ".savefile
- sil keepj %d
+ sil NetrwKeepj %d
if exists("g:netrw_bookmarklist") && g:netrw_bookmarklist != []
" merge and write .netrwbook
let savefile= s:NetrwHome()."/.netrwbook"
if filereadable(savefile)
let booklist= deepcopy(g:netrw_bookmarklist)
- exe "sil keepj keepalt so ".savefile
+ exe "sil NetrwKeepj keepalt so ".savefile
for bdm in booklist
if index(g:netrw_bookmarklist,bdm) == -1
call add(g:netrw_bookmarklist,bdm)
endif
endfor
call sort(g:netrw_bookmarklist)
- exe "sil! w! ".savefile
endif
" construct and save .netrwbook
@@ -3436,12 +3552,18 @@ fun! s:NetrwBrowse(islocal,dirname)
" call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")." modified=".&modified." modifiable=".&modifiable." readonly=".&readonly)
" call Dredir("ls!")
- " s:NetrwBrowse: initialize history {{{3
+ " save alternate-file's filename if w:netrw_rexlocal doesn't exist
+ " This is useful when one edits a local file, then :e ., then :Rex
+ if a:islocal && !exists("w:netrw_rexfile") && bufname("#") != ""
+ let w:netrw_rexfile= bufname("#")
+ endif
+
+ " s:NetrwBrowse : initialize history {{{3
if !exists("s:netrw_initbookhist")
- keepj call s:NetrwBookHistRead()
+ NetrwKeepj call s:NetrwBookHistRead()
endif
- " s:NetrwBrowse: simplify the dirname (especially for ".."s in dirnames) {{{3
+ " s:NetrwBrowse : simplify the dirname (especially for ".."s in dirnames) {{{3
if a:dirname !~ '^\a\+://'
let dirname= simplify(a:dirname)
else
@@ -3455,77 +3577,83 @@ fun! s:NetrwBrowse(islocal,dirname)
return
endif
- " s:NetrwBrowse: sanity checks: {{{3
+ " s:NetrwBrowse : sanity checks: {{{3
if !exists("*shellescape")
- keepj call netrw#ErrorMsg(s:ERROR,"netrw can't run -- your vim is missing shellescape()",69)
+ NetrwKeepj call netrw#ErrorMsg(s:ERROR,"netrw can't run -- your vim is missing shellescape()",69)
" call Dret("s:NetrwBrowse : missing shellescape()")
return
endif
if !exists("*fnameescape")
- keepj call netrw#ErrorMsg(s:ERROR,"netrw can't run -- your vim is missing fnameescape()",70)
+ NetrwKeepj call netrw#ErrorMsg(s:ERROR,"netrw can't run -- your vim is missing fnameescape()",70)
" call Dret("s:NetrwBrowse : missing fnameescape()")
return
endif
- " s:NetrwBrowse: save options: {{{3
+ " s:NetrwBrowse : save options: {{{3
call s:NetrwOptionSave("w:")
- " s:NetrwBrowse: re-instate any marked files {{{3
+ " s:NetrwBrowse : re-instate any marked files {{{3
if exists("s:netrwmarkfilelist_{bufnr('%')}")
" call Decho("clearing marked files")
exe "2match netrwMarkFile /".s:netrwmarkfilemtch_{bufnr("%")}."/"
endif
if a:islocal && exists("w:netrw_acdkeep") && w:netrw_acdkeep
- " s:NetrwBrowse: set up "safe" options for local directory/file {{{3
+ " s:NetrwBrowse : set up "safe" options for local directory/file {{{3
" call Decho("handle w:netrw_acdkeep:")
-" call Decho("keepjumps lcd ".fnameescape(dirname)." (due to w:netrw_acdkeep=".w:netrw_acdkeep." - acd=".&acd.")")
+" call Decho("NetrwKeepj lcd ".fnameescape(dirname)." (due to w:netrw_acdkeep=".w:netrw_acdkeep." - acd=".&acd.")")
call s:NetrwLcd(dirname)
call s:NetrwSafeOptions()
" call Decho("getcwd<".getcwd().">")
elseif !a:islocal && dirname !~ '[\/]$' && dirname !~ '^"'
- " s:NetrwBrowse: looks like a remote regular file, attempt transfer {{{3
-" call Decho("attempt transfer as regular file<".dirname.">")
-
- " remove any filetype indicator from end of dirname, except for the
- " "this is a directory" indicator (/).
- " There shouldn't be one of those here, anyway.
- let path= substitute(dirname,'[*=@|]\r\=$','','e')
-" call Decho("new path<".path.">")
- call s:RemotePathAnalysis(dirname)
-
- " s:NetrwBrowse: remote-read the requested file into current buffer {{{3
- keepj mark '
- call s:NetrwEnew(dirname)
- call s:NetrwSafeOptions()
- setl ma noro
-" call Decho("setl ma noro")
- let b:netrw_curdir = dirname
- let url = s:method."://".s:user.s:machine.(s:port ? ":".s:port : "")."/".s:path
-" call Decho("exe sil! keepalt file ".fnameescape(url)." (bt=".&bt.")")
- exe "sil! keepj keepalt file ".fnameescape(url)
- exe "sil! keepj keepalt doau BufReadPre ".fnameescape(s:fname)
- sil call netrw#NetRead(2,url)
- " netrw.vim and tar.vim have already handled decompression of the tarball; avoiding gzip.vim error
-" call Decho("url<".url.">")
-" call Decho("s:path<".s:path.">")
-" call Decho("s:fname<".s:fname.">")
- if s:path =~ '.bz2'
- exe "sil keepj keepalt doau BufReadPost ".fnameescape(substitute(s:fname,'\.bz2$','',''))
- elseif s:path =~ '.gz'
- exe "sil keepj keepalt doau BufReadPost ".fnameescape(substitute(s:fname,'\.gz$','',''))
- elseif s:path =~ '.gz'
- exe "sil keepj keepalt doau BufReadPost ".fnameescape(substitute(s:fname,'\.txz$','',''))
+ " s:NetrwBrowse : remote regular file handler {{{3
+" call Decho("handle remote regular file: dirname<".dirname.">")
+ if bufname(dirname) != ""
+" call Decho("edit buf#".bufname(dirname)." in win#".winnr())
+ exe "NetrwKeepj b ".bufname(dirname)
else
- exe "sil keepj keepalt doau BufReadPost ".fnameescape(s:fname)
+ " attempt transfer of remote regular file
+" call Decho("attempt transfer as regular file<".dirname.">")
+
+ " remove any filetype indicator from end of dirname, except for the
+ " "this is a directory" indicator (/).
+ " There shouldn't be one of those here, anyway.
+ let path= substitute(dirname,'[*=@|]\r\=$','','e')
+" call Decho("new path<".path.">")
+ call s:RemotePathAnalysis(dirname)
+
+ " s:NetrwBrowse : remote-read the requested file into current buffer {{{3
+ call s:NetrwEnew(dirname)
+ call s:NetrwSafeOptions()
+ setl ma noro
+" call Decho("setl ma noro")
+ let b:netrw_curdir = dirname
+ let url = s:method."://".((s:user == "")? "" : s:user."@").s:machine.(s:port ? ":".s:port : "")."/".s:path
+" call Decho("exe sil! keepalt file ".fnameescape(url)." (bt=".&bt.")")
+ exe "sil! NetrwKeepj keepalt file ".fnameescape(url)
+ exe "sil! NetrwKeepj keepalt doau BufReadPre ".fnameescape(s:fname)
+ sil call netrw#NetRead(2,url)
+ " netrw.vim and tar.vim have already handled decompression of the tarball; avoiding gzip.vim error
+" call Decho("url<".url.">")
+" call Decho("s:path<".s:path.">")
+" call Decho("s:fname<".s:fname.">")
+ if s:path =~ '.bz2'
+ exe "sil NetrwKeepj keepalt doau BufReadPost ".fnameescape(substitute(s:fname,'\.bz2$','',''))
+ elseif s:path =~ '.gz'
+ exe "sil NetrwKeepj keepalt doau BufReadPost ".fnameescape(substitute(s:fname,'\.gz$','',''))
+ elseif s:path =~ '.gz'
+ exe "sil NetrwKeepj keepalt doau BufReadPost ".fnameescape(substitute(s:fname,'\.txz$','',''))
+ else
+ exe "sil NetrwKeepj keepalt doau BufReadPost ".fnameescape(s:fname)
+ endif
endif
- " s:NetrwBrowse: save certain window-oriented variables into buffer-oriented variables {{{3
+ " s:NetrwBrowse : save certain window-oriented variables into buffer-oriented variables {{{3
call s:SetBufWinVars()
call s:NetrwOptionRestore("w:")
" call Decho("setl ma nomod")
- setl ma nomod
+ setl ma nomod noro
" call Decho(" ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
" call Dret("s:NetrwBrowse : file<".s:fname.">")
@@ -3541,9 +3669,11 @@ fun! s:NetrwBrowse(islocal,dirname)
let s:last_sort_by = g:netrw_sort_by
" set up menu {{{3
- keepj call s:NetrwMenu(1)
+ NetrwKeepj call s:NetrwMenu(1)
" get/set-up buffer {{{3
+" call Decho("saving position across a buffer refresh")
+ let svpos = netrw#SavePosn()
let reusing= s:NetrwGetBuffer(a:islocal,dirname)
" maintain markfile highlighting
if exists("s:netrwmarkfilemtch_{bufnr('%')}") && s:netrwmarkfilemtch_{bufnr("%")} != ""
@@ -3559,7 +3689,7 @@ fun! s:NetrwBrowse(islocal,dirname)
" call Decho("setl noma nomod nowrap")
setl noma nomod nowrap
" call Decho("(set noma nomod nowrap) ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
-" call Dret("s:NetrwBrowse : re-using buffer")
+" call Dret("s:NetrwBrowse : re-using not-cleared buffer")
return
endif
@@ -3631,9 +3761,9 @@ fun! s:NetrwBrowse(islocal,dirname)
let dirpat = '^\(\w\{-}\)://\(\w\+@\)\=\([^/]\+\)/\(.*\)$'
if dirname !~ dirpat
if !exists("g:netrw_quiet")
- keepj call netrw#ErrorMsg(s:ERROR,"netrw doesn't understand your dirname<".dirname.">",20)
+ NetrwKeepj call netrw#ErrorMsg(s:ERROR,"netrw doesn't understand your dirname<".dirname.">",20)
endif
- keepj call s:NetrwOptionRestore("w:")
+ NetrwKeepj call s:NetrwOptionRestore("w:")
" call Decho("setl noma nomod nowrap")
setl noma nomod nowrap
" call Decho(" ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
@@ -3647,9 +3777,9 @@ fun! s:NetrwBrowse(islocal,dirname)
" -----------------------
" Directory Listing: {{{3
" -----------------------
- keepj call s:NetrwMaps(a:islocal)
- keepj call s:NetrwCommands(a:islocal)
- keepj call s:PerformListing(a:islocal)
+ NetrwKeepj call s:NetrwMaps(a:islocal)
+ NetrwKeepj call s:NetrwCommands(a:islocal)
+ NetrwKeepj call s:PerformListing(a:islocal)
if v:version >= 700 && has("balloon_eval") && &beval == 0 && &l:bexpr == "" && !exists("g:netrw_nobeval")
let &l:bexpr= "netrw#BalloonHelp()"
" call Decho("set up balloon help: l:bexpr=".&l:bexpr)
@@ -3657,6 +3787,12 @@ fun! s:NetrwBrowse(islocal,dirname)
endif
call s:NetrwOptionRestore("w:")
+ " restore position and jumplist entry
+ if !reusing
+" call Decho("restoring position across buffer refresh")
+ call netrw#RestorePosn(svpos)
+ endif
+
" The s:LocalBrowseRefresh() function is called by an autocmd
" installed by s:LocalFastBrowser() when g:netrw_fastbrowse <= 1 (ie. slow, medium speed).
" However, s:NetrwBrowse() causes the FocusGained event to fire the firstt time.
@@ -3738,7 +3874,7 @@ fun! s:NetrwGetBuffer(islocal,dirname)
exe "sil! noswapfile keepalt b ".w:netrw_treebufnr
let &ei= eikeep
setl ma
- sil! keepj %d
+ sil! NetrwKeepj %d
" call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo)
" call Dret("s:NetrwGetBuffer 0<buffer cleared> : bufnum#".w:netrw_treebufnr."<NetrwTreeListing>")
return 0
@@ -3819,7 +3955,7 @@ fun! s:NetrwGetBuffer(islocal,dirname)
" get enew buffer and name it -or- re-use buffer {{{3
" call Decho(" get enew buffer and name it OR re-use buffer")
- sil! keepj keepalt mark '
+ sil! NetrwKeepj keepalt mark '
if bufnum < 0 || !bufexists(bufnum)
" call Decho("--get enew buffer and name it (bufnum#".bufnum."<0 OR bufexists(".bufnum.")=".bufexists(bufnum)."==0)")
call s:NetrwEnew(dirname)
@@ -3843,8 +3979,8 @@ fun! s:NetrwGetBuffer(islocal,dirname)
nnoremap <silent> <buffer> ]] :sil call <SID>TreeListMove(']')<cr>
" call Decho(" tree listing#".s:netrw_treelistnum." bufnr=".w:netrw_treebufnr)
else
-" let v:errmsg= "" " Decho
- let escdirname= fnameescape(dirname)
+" let v:errmsg = "" " Decho
+ let escdirname = fnameescape(dirname)
" call Decho(" errmsg<".v:errmsg."> bufnr(escdirname<".escdirname.">)=".bufnr(escdirname)." bufname()<".bufname(bufnr(escdirname)).">")
" call Decho(' exe sil! keepalt file '.escdirname)
" let v:errmsg= "" " Decho
@@ -3869,25 +4005,30 @@ fun! s:NetrwGetBuffer(islocal,dirname)
exe "sil! keepalt file ".fnameescape(getcwd())
endif
let &ei= eikeep
+
if line("$") <= 1
- keepj call s:NetrwListSettings(a:islocal)
+ NetrwKeepj call s:NetrwListSettings(a:islocal)
" call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo)
" call Dret("s:NetrwGetBuffer 0<buffer empty> : re-using buffer#".bufnr("%").", but its empty, so refresh it")
return 0
+
elseif g:netrw_fastbrowse == 0 || (a:islocal && g:netrw_fastbrowse == 1)
- keepj call s:NetrwListSettings(a:islocal)
- sil keepj %d
+" call Decho("g:netrw_fastbrowse=".g:netrw_fastbrowse." a:islocal=".a:islocal.": clear buffer")
+ NetrwKeepj call s:NetrwListSettings(a:islocal)
+ sil NetrwKeepj %d
" call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo)
" call Dret("s:NetrwGetBuffer 0<cleared buffer> : re-using buffer#".bufnr("%").", but refreshing due to g:netrw_fastbrowse=".g:netrw_fastbrowse)
return 0
+
elseif exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST
" call Decho("--re-use tree listing--")
" call Decho(" clear buffer<".expand("%")."> with :%d")
- sil keepj %d
- keepj call s:NetrwListSettings(a:islocal)
+ sil NetrwKeepj %d
+ NetrwKeepj call s:NetrwListSettings(a:islocal)
" call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo)
" call Dret("s:NetrwGetBuffer 0<cleared buffer> : re-using buffer#".bufnr("%").", but treelist mode always needs a refresh")
return 0
+
else
" call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo)
" call Dret("s:NetrwGetBuffer 1<buffer not cleared> : buf#".bufnr("%"))
@@ -3902,14 +4043,14 @@ fun! s:NetrwGetBuffer(islocal,dirname)
" fast 2 H H
" call Decho("--do netrw settings: make this buffer#".bufnr("%")." not-a-file, modifiable, not line-numbered, etc--")
let fname= expand("%")
- keepj call s:NetrwListSettings(a:islocal)
+ NetrwKeepj call s:NetrwListSettings(a:islocal)
" call Decho("exe sil! keepalt file ".fnameescape(fname))
- exe "sil! keepj keepalt file ".fnameescape(fname)
+ exe "sil! NetrwKeepj keepalt file ".fnameescape(fname)
" delete all lines from buffer {{{3
" call Decho("--delete all lines from buffer--")
" call Decho(" clear buffer<".expand("%")."> with :%d")
- sil! keepalt keepj %d
+ sil! keepalt NetrwKeepj %d
" call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo)
" call Dret("s:NetrwGetBuffer 0<cleared buffer> : tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%"))
@@ -3936,7 +4077,7 @@ endfun
" ---------------------------------------------------------------------
" s:NetrwGetWord: it gets the directory/file named under the cursor {{{2
fun! s:NetrwGetWord()
-" call Dfunc("s:NetrwGetWord() line#".line(".")." liststyle=".g:netrw_liststyle." virtcol=".virtcol("."))
+" call Dfunc("s:NetrwGetWord() line#".line(".")." liststyle=".s:ShowStyle()." virtcol=".virtcol("."))
call s:UseBufWinVars()
" insure that w:netrw_liststyle is set up
@@ -3946,18 +4087,18 @@ fun! s:NetrwGetWord()
else
let w:netrw_liststyle= s:THINLIST
endif
-" call Decho("w:netrw_liststyle=".w:netrw_liststyle)
+" "call Decho("w:netrw_liststyle=".w:netrw_liststyle)
endif
if exists("w:netrw_bannercnt") && line(".") < w:netrw_bannercnt
" Active Banner support
-" call Decho("active banner handling")
- keepj norm! 0
+" "call Decho("active banner handling")
+ NetrwKeepj norm! 0
let dirname= "./"
let curline= getline('.')
if curline =~ '"\s*Sorted by\s'
- keepj norm s
+ NetrwKeepj norm s
let s:netrw_skipbrowse= 1
echo 'Pressing "s" also works'
@@ -3966,67 +4107,67 @@ fun! s:NetrwGetWord()
echo 'Press "S" to edit sorting sequence'
elseif curline =~ '"\s*Quick Help:'
- keepj norm ?
+ NetrwKeepj norm ?
let s:netrw_skipbrowse= 1
- echo 'Pressing "?" also works'
elseif curline =~ '"\s*\%(Hiding\|Showing\):'
- keepj norm a
+ NetrwKeepj norm a
let s:netrw_skipbrowse= 1
echo 'Pressing "a" also works'
elseif line("$") > w:netrw_bannercnt
- exe 'sil keepj '.w:netrw_bannercnt
+ exe 'sil NetrwKeepj '.w:netrw_bannercnt
endif
elseif w:netrw_liststyle == s:THINLIST
-" call Decho("thin column handling")
- keepj norm! 0
- let dirname= getline('.')
+" "call Decho("thin column handling")
+ NetrwKeepj norm! 0
+ let dirname= substitute(getline('.'),'\t -->.*$','','')
elseif w:netrw_liststyle == s:LONGLIST
-" call Decho("long column handling")
- keepj norm! 0
+" "call Decho("long column handling")
+ NetrwKeepj norm! 0
let dirname= substitute(getline('.'),'^\(\%(\S\+ \)*\S\+\).\{-}$','\1','e')
elseif w:netrw_liststyle == s:TREELIST
-" call Decho("treelist handling")
+" "call Decho("treelist handling")
let dirname= substitute(getline('.'),'^\('.s:treedepthstring.'\)*','','e')
+ let dirname= substitute(dirname,'\t -->.*$','','')
else
-" call Decho("obtain word from wide listing")
+" "call Decho("obtain word from wide listing")
let dirname= getline('.')
if !exists("b:netrw_cpf")
let b:netrw_cpf= 0
- exe 'sil keepj '.w:netrw_bannercnt.',$g/^./if virtcol("$") > b:netrw_cpf|let b:netrw_cpf= virtcol("$")|endif'
+ exe 'sil NetrwKeepj '.w:netrw_bannercnt.',$g/^./if virtcol("$") > b:netrw_cpf|let b:netrw_cpf= virtcol("$")|endif'
call histdel("/",-1)
-" call Decho("computed cpf=".b:netrw_cpf)
+" "call Decho("computed cpf=".b:netrw_cpf)
endif
-" call Decho("buf#".bufnr("%")."<".bufname("%").">")
+" "call Decho("buf#".bufnr("%")."<".bufname("%").">")
let filestart = (virtcol(".")/b:netrw_cpf)*b:netrw_cpf
-" call Decho("filestart= ([virtcol=".virtcol(".")."]/[b:netrw_cpf=".b:netrw_cpf."])*b:netrw_cpf=".filestart." bannercnt=".w:netrw_bannercnt)
-" call Decho("1: dirname<".dirname.">")
+" "call Decho("filestart= ([virtcol=".virtcol(".")."]/[b:netrw_cpf=".b:netrw_cpf."])*b:netrw_cpf=".filestart." bannercnt=".w:netrw_bannercnt)
+" "call Decho("1: dirname<".dirname.">")
if filestart == 0
- keepj norm! 0ma
+ NetrwKeepj norm! 0ma
else
call cursor(line("."),filestart+1)
- keepj norm! ma
+ NetrwKeepj norm! ma
endif
let rega= @a
let eofname= filestart + b:netrw_cpf + 1
if eofname <= col("$")
call cursor(line("."),filestart+b:netrw_cpf+1)
- keepj norm! "ay`a
+ NetrwKeepj norm! "ay`a
else
- keepj norm! "ay$
+ NetrwKeepj norm! "ay$
endif
let dirname = @a
let @a = rega
-" call Decho("2: dirname<".dirname.">")
+" "call Decho("2: dirname<".dirname.">")
let dirname= substitute(dirname,'\s\+$','','e')
-" call Decho("3: dirname<".dirname.">")
+" "call Decho("3: dirname<".dirname.">")
endif
" symlinks are indicated by a trailing "@". Remove it before further processing.
@@ -4101,7 +4242,7 @@ fun! s:NetrwListStyle(islocal)
let g:netrw_list_cmd = substitute(g:netrw_list_cmd,' -l','','ge')
else
- keepj call netrw#ErrorMsg(s:WARNING,"bad value for g:netrw_liststyle (=".w:netrw_liststyle.")",46)
+ NetrwKeepj call netrw#ErrorMsg(s:WARNING,"bad value for g:netrw_liststyle (=".w:netrw_liststyle.")",46)
let g:netrw_liststyle = s:THINLIST
let w:netrw_liststyle = g:netrw_liststyle
let g:netrw_list_cmd = substitute(g:netrw_list_cmd,' -l','','ge')
@@ -4111,7 +4252,7 @@ fun! s:NetrwListStyle(islocal)
" clear buffer - this will cause NetrwBrowse/LocalBrowseCheck to do a refresh
" call Decho("clear buffer<".expand("%")."> with :%d")
- sil! keepj %d
+ sil! NetrwKeepj %d
" following prevents tree listing buffer from being marked "modified"
" call Decho("setl nomod")
setl nomod
@@ -4119,11 +4260,11 @@ fun! s:NetrwListStyle(islocal)
" refresh the listing
" call Decho("refresh the listing")
- keepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
- keepj call s:NetrwCursor()
+ NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+ NetrwKeepj call s:NetrwCursor()
" restore position; keep cursor on the filename
- keepj call netrw#RestorePosn(svpos)
+ NetrwKeepj call netrw#RestorePosn(svpos)
let @@= ykeep
" call Dret("NetrwListStyle".(exists("w:netrw_liststyle")? ' : w:netrw_liststyle='.w:netrw_liststyle : ""))
@@ -4144,17 +4285,87 @@ fun! s:NetrwBannerCtrl(islocal)
" keep cursor on the filename
let fname= s:NetrwGetWord()
- sil keepj $
+ sil NetrwKeepj $
let result= search('\%(^\%(|\+\s\)\=\|\s\{2,}\)\zs'.escape(fname,'.\[]*$^').'\%(\s\{2,}\|$\)','bc')
" call Decho("search result=".result." w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'N/A'))
if result <= 0 && exists("w:netrw_bannercnt")
- exe "keepj ".w:netrw_bannercnt
+ exe "NetrwKeepj ".w:netrw_bannercnt
endif
let @@= ykeep
" call Dret("s:NetrwBannerCtrl : g:netrw_banner=".g:netrw_banner)
endfun
" ---------------------------------------------------------------------
+" s:NetrwBookmark: supports :NetrwMB[!] [file]s {{{2
+"
+" No bang: enters files/directories into Netrw's bookmark system
+" No argument and in netrw buffer:
+" if there are marked files: bookmark marked files
+" otherwise : bookmark file/directory under cursor
+" No argument and not in netrw buffer: bookmarks current open file
+" Has arguments: globs them individually and bookmarks them
+"
+" With bang: deletes files/directories from Netrw's bookmark system
+fun! s:NetrwBookmark(del,...)
+" call Dfunc("s:NetrwBookmark(del=".a:del.",...) a:0=".a:0)
+ if a:0 == 0
+ if &ft == "netrw"
+ let curbufnr = bufnr("%")
+
+ if exists("s:netrwmarkfilelist_{curbufnr}")
+ " for every filename in the marked list
+" call Decho("bookmark every filename in marked list")
+ let svpos = netrw#SavePosn()
+ let islocal= expand("%") !~ '^\a\+://'
+ for fname in s:netrwmarkfilelist_{curbufnr}
+ if a:del|call s:DeleteBookmark(fname)|else|call s:MakeBookmark(fname)|endif
+ endfor
+ let curdir = exists("b:netrw_curdir")? b:netrw_curdir : getcwd()
+ call s:NetrwUnmarkList(curbufnr,curdir)
+ NetrwKeepj call s:NetrwRefresh(islocal,s:NetrwBrowseChgDir(islocal,'./'))
+ NetrwKeepj call netrw#RestorePosn(svpos)
+ else
+ let fname= s:NetrwGetWord()
+ if a:del|call s:DeleteBookmark(fname)|else|call s:MakeBookmark(fname)|endif
+ endif
+
+ else
+ " bookmark currently open file
+" call Decho("bookmark currently open file")
+ let fname= expand("%")
+ if a:del|call s:DeleteBookmark(fname)|else|call s:MakeBookmark(fname)|endif
+ endif
+
+ else
+ " bookmark specified files
+ " attempts to infer if working remote or local
+ " by deciding if the current file begins with an url
+ " Globbing cannot be done remotely.
+ let islocal= expand("%") !~ '^\a\+://'
+" call Decho("bookmark specified file".((a:0>1)? "s" : ""))
+ let i = 1
+ while i <= a:0
+ if islocal
+ let mbfiles= glob(a:{i},0,1)
+ else
+ let mbfiles= [a:{i}]
+ endif
+" call Decho("mbfiles".string(mbfiles))
+ for mbfile in mbfiles
+" call Decho("mbfile<".mbfile.">")
+ if a:del|call s:DeleteBookmark(mbfile)|else|call s:MakeBookmark(mbfile)|endif
+ endfor
+ let i= i + 1
+ endwhile
+ endif
+
+ " update the menu
+ call s:NetrwBookmarkMenu()
+
+" call Dret("s:NetrwBookmark")
+endfun
+
+" ---------------------------------------------------------------------
" s:NetrwBookmarkMenu: Uses menu priorities {{{2
" .2.[cnt] for bookmarks, and
" .3.[cnt] for history
@@ -4241,8 +4452,8 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
" NetrwBrowseChgDir: save options and initialize {{{3
" call Decho("saving options")
- keepj call s:NetrwOptionSave("s:")
- keepj call s:NetrwSafeOptions()
+ NetrwKeepj call s:NetrwOptionSave("s:")
+ NetrwKeepj call s:NetrwSafeOptions()
let nbcd_curpos = netrw#SavePosn()
let s:nbcd_curpos_{bufnr('%')} = nbcd_curpos
" call Decho("setting s:nbcd_curpos_".bufnr('%')." to SavePosn")
@@ -4257,6 +4468,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
" call Decho("dirname<".dirname.">")
" ignore <cr>s when done in the banner
+" call Decho('ignore <cr>s when done in banner (g:netrw_banner='.g:netrw_banner.")")
if g:netrw_banner
" call Decho("w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'n/a')." line(.)#".line('.')." line($)#".line("#"))
if exists("w:netrw_bannercnt") && line(".") < w:netrw_bannercnt && line("$") >= w:netrw_bannercnt
@@ -4265,10 +4477,10 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
let g:netrw_quickhelp= (g:netrw_quickhelp + 1)%len(s:QuickHelp)
" call Decho("#2: quickhelp=".g:netrw_quickhelp." ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
setl ma noro nowrap
- keepj call setline(line('.'),'" Quick Help: <F1>:help '.s:QuickHelp[g:netrw_quickhelp])
+ NetrwKeepj call setline(line('.'),'" Quick Help: <F1>:help '.s:QuickHelp[g:netrw_quickhelp])
setl noma nomod nowrap
- keepj call netrw#RestorePosn(nbcd_curpos)
- keepj call s:NetrwOptionRestore("s:")
+ NetrwKeepj call netrw#RestorePosn(nbcd_curpos)
+ NetrwKeepj call s:NetrwOptionRestore("s:")
" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
endif
endif
@@ -4291,8 +4503,9 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
let dirname= dirname.'/'
" call Decho("adjusting dirname<".dirname.">")
endif
+" call Decho("newdir<".newdir."> !~ dirpat<".dirpat.">? ".((newdir !~ dirpat)? "yes" : "no"))
- if newdir !~ dirpat
+ if newdir !~ dirpat && !(a:islocal && isdirectory(newdir))
" ------------------------------
" NetrwBrowseChgDir: edit a file {{{3
" ------------------------------
@@ -4308,7 +4521,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("w:netrw_treedict") && newdir !~ '^\(/\|\a:\)'
" call Decho("edit-a-file: handle tree listing: w:netrw_treedict<".(exists("w:netrw_treedict")? string(w:netrw_treedict) : 'n/a').">")
" call Decho("edit-a-file: newdir<".newdir.">")
- let dirname= s:NetrwTreeDir()
+ let dirname= s:NetrwTreeDir(a:islocal)
if dirname =~ '/$'
let dirname= dirname.newdir
else
@@ -4322,29 +4535,40 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
let dirname= s:ComposePath(dirname,newdir)
endif
" call Decho("edit-a-file: handling a file: dirname<".dirname."> (a:0=".a:0.")")
- " this lets NetrwBrowseX avoid the edit
+ " this lets netrw#BrowseX avoid the edit
if a:0 < 1
" call Decho("edit-a-file: set up windows for editing<".fnameescape(dirname)."> didsplit=".(exists("s:didsplit")? s:didsplit : "doesn't exist"))
- keepj call s:NetrwOptionRestore("s:")
+ NetrwKeepj call s:NetrwOptionRestore("s:")
if !exists("s:didsplit")
-" call Decho("edit-a-file: s:didsplit does not exist; g:netrw_browse_split=".g:netrw_browse_split." win#".winnr())
- if g:netrw_browse_split == 1
+" call Decho("edit-a-file: s:didsplit does not exist; g:netrw_browse_split=".string(g:netrw_browse_split)." win#".winnr())
+ if type(g:netrw_browse_split) == 3
+ " open file in server
+ " Note that g:netrw_browse_split is a List: [servername,tabnr,winnr]
+" call Decho("edit-a-file: open file in server")
+ call s:NetrwServerEdit(a:islocal,dirname)
+" call Dret("s:NetrwBrowseChgDir")
+ return
+ elseif g:netrw_browse_split == 1
" horizontally splitting the window first
+" call Decho("edit-a-file: horizontally splitting window prior to edit")
keepalt new
if !&ea
keepalt wincmd _
endif
elseif g:netrw_browse_split == 2
" vertically splitting the window first
+" call Decho("edit-a-file: vertically splitting window prior to edit")
keepalt rightb vert new
if !&ea
keepalt wincmd |
endif
elseif g:netrw_browse_split == 3
" open file in new tab
+" call Decho("edit-a-file: opening new tab prior to edit")
keepalt tabnew
elseif g:netrw_browse_split == 4
" act like "P" (ie. open previous window)
+" call Decho("edit-a-file: use previous window for edit")
if s:NetrwPrevWinOpen(2) == 3
let @@= ykeep
" call Dret("s:NetrwBrowseChgDir")
@@ -4356,15 +4580,16 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
call s:NetrwMenu(0)
" optional change to window
if g:netrw_chgwin >= 1
+" call Decho("edit-a-file: changing window to #".g:netrw_chgwin)
if winnr("$")+1 == g:netrw_chgwin
" if g:netrw_chgwin is set to one more than the last window, then
" vertically split the last window to make that window available.
let curwin= winnr()
- exe "keepj keepalt ".g:netrw_chgwin."wincmd ".winnr("$")
+ exe "NetrwKeepj keepalt ".g:netrw_chgwin."wincmd ".winnr("$")
vs
- exe "keepj keepalt ".g:netrw_chgwin."wincmd ".curwin
+ exe "NetrwKeepj keepalt ".g:netrw_chgwin."wincmd ".curwin
endif
- exe "keepj keepalt ".g:netrw_chgwin."wincmd w"
+ exe "NetrwKeepj keepalt ".g:netrw_chgwin."wincmd w"
endif
endif
endif
@@ -4377,13 +4602,12 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
" some like c-^ to return to the last edited file
" others like c-^ to return to the netrw buffer
if exists("g:netrw_altfile") && g:netrw_altfile
- exe "keepj keepalt e! ".fnameescape(dirname)
+ exe "NetrwKeepj keepalt e! ".fnameescape(dirname)
else
- exe "keepj e! ".fnameescape(dirname)
+ exe "NetrwKeepj e! ".fnameescape(dirname)
endif
-" call Decho("after e! ".dirname.": hidden=".&hidden." bufhidden<".&bufhidden."> mod=".&mod)
+" call Decho("edit-a-file: after e! ".dirname.": hidden=".&hidden." bufhidden<".&bufhidden."> mod=".&mod)
call s:NetrwCursor()
-" call Decho("COMBAK#1: after e! ".dirname.": hidden=".&hidden." bufhidden<".&bufhidden."> mod=".&mod)
if &hidden || &bufhidden == "hide"
" file came from vim's hidden storage. Don't "restore" options with it.
let dorestore= 0
@@ -4392,7 +4616,6 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
" call Decho("edit-a-file: remote file: NetrwBrowse will edit it")
endif
let dolockout= 1
-" call Decho("COMBAK#2: after e! ".dirname.": hidden=".&hidden." bufhidden<".&bufhidden."> mod=".&mod)
" handle g:Netrw_funcref -- call external-to-netrw functions
" This code will handle g:Netrw_funcref as an individual function reference
@@ -4402,12 +4625,12 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
" call Decho("edit-a-file: handle optional Funcrefs")
if type(g:Netrw_funcref) == 2
" call Decho("edit-a-file: handling a g:Netrw_funcref")
- keepj call g:Netrw_funcref()
+ NetrwKeepj call g:Netrw_funcref()
elseif type(g:Netrw_funcref) == 3
" call Decho("edit-a-file: handling a list of g:Netrw_funcrefs")
for Fncref in g:Netrw_funcref
if type(FncRef) == 2
- keepj call FncRef()
+ NetrwKeepj call FncRef()
endif
endfor
endif
@@ -4419,16 +4642,16 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
" NetrwBrowseChgDir: just go to the new directory spec {{{3
" ----------------------------------------------------
" call Decho('goto-newdir: case "just go to new directory spec": newdir<'.newdir.'>')
- let dirname = newdir
- keepj call s:SetRexDir(a:islocal,dirname)
- keepj call s:NetrwOptionRestore("s:")
+ let dirname = newdir
+ NetrwKeepj call s:SetRexDir(a:islocal,dirname)
+ NetrwKeepj call s:NetrwOptionRestore("s:")
elseif newdir == './'
" ---------------------------------------------
" NetrwBrowseChgDir: refresh the directory list {{{3
" ---------------------------------------------
" call Decho('refresh-dirlist: case "refresh directory listing": newdir == "./"')
- keepj call s:SetRexDir(a:islocal,dirname)
+ NetrwKeepj call s:SetRexDir(a:islocal,dirname)
elseif newdir == '../'
" --------------------------------------
@@ -4441,7 +4664,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
" call Decho("go-up: clear buffer<".expand("%")."> with :%d")
" call Decho("go-up: setl noro ma")
setl noro ma
- keepj %d
+ NetrwKeepj %d
endif
if has("amiga")
@@ -4483,7 +4706,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
endif
" call Decho("go-up: unix: dirname<".dirname."> (go up one dir)")
endif
- keepj call s:SetRexDir(a:islocal,dirname)
+ NetrwKeepj call s:SetRexDir(a:islocal,dirname)
elseif exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("w:netrw_treedict")
" --------------------------------------
@@ -4495,14 +4718,15 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
setl noro ma
if !(exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("b:netrw_curdir"))
" call Decho("tree-list: clear buffer<".expand("%")."> with :%d")
- keepj %d
+ NetrwKeepj %d
endif
- let treedir = s:NetrwTreeDir()
+ let treedir = s:NetrwTreeDir(a:islocal)
let s:treecurpos = nbcd_curpos
- let haskey= 0
+ let haskey = 0
" call Decho("tree-list: w:netrw_treedict<".string(w:netrw_treedict).">")
" search treedict for tree dir as-is
+" call Decho("search treedict for tree dir as-is")
if has_key(w:netrw_treedict,treedir)
" call Decho('tree-list: ....searched for treedir<'.treedir.'> : found it!')
let haskey= 1
@@ -4511,6 +4735,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
endif
" search treedict for treedir with a / appended
+" call Decho("search treedict for treedir with a / appended")
if !haskey && treedir !~ '/$'
if has_key(w:netrw_treedict,treedir."/")
let treedir= treedir."/"
@@ -4522,6 +4747,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
endif
" search treedict for treedir with any trailing / elided
+" call Decho("search treedict for treedir with any trailing / elided")
if !haskey && treedir =~ '/$'
let treedir= substitute(treedir,'/$','','')
if has_key(w:netrw_treedict,treedir)
@@ -4532,6 +4758,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
endif
endif
+" call Decho("haskey=".haskey)
if haskey
" close tree listing for selected subdirectory
" call Decho("tree-list: closing selected subdirectory<".dirname.">")
@@ -4543,8 +4770,10 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
" go down one directory
let dirname= substitute(treedir,'/*$','/','')
" call Decho("tree-list: go down one dir: treedir<".treedir.">")
+" call Decho("tree-list: ... : dirname<".dirname.">")
endif
- keepj call s:SetRexDir(a:islocal,dirname)
+ NetrwKeepj call s:SetRexDir(a:islocal,dirname)
+" call Decho("setting s:treeforceredraw to true")
let s:treeforceredraw = 1
else
@@ -4553,22 +4782,20 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
" ----------------------------------------
let dirname = s:ComposePath(dirname,newdir)
" call Decho("go down one dir: dirname<".dirname."> newdir<".newdir.">")
- keepj call s:SetRexDir(a:islocal,dirname)
+ NetrwKeepj call s:SetRexDir(a:islocal,dirname)
endif
" --------------------------------------
" NetrwBrowseChgDir: Restore and Cleanup {{{3
" --------------------------------------
-" call Decho("COMBAK#3: after e! ".dirname.": hidden=".&hidden." bufhidden<".&bufhidden."> mod=".&mod)
if dorestore
" dorestore is zero'd when a local file was hidden or bufhidden;
" in such a case, we want to keep whatever settings it may have.
" call Decho("doing option restore (dorestore=".dorestore.")")
- keepj call s:NetrwOptionRestore("s:")
+ NetrwKeepj call s:NetrwOptionRestore("s:")
" else " Decho
" call Decho("skipping option restore (dorestore==0): hidden=".&hidden." bufhidden=".&bufhidden." mod=".&mod)
endif
-" call Decho("COMBAK#4: after e! ".dirname.": hidden=".&hidden." bufhidden<".&bufhidden."> mod=".&mod)
if dolockout && dorestore
" call Decho("restore: filewritable(dirname<".dirname.">)=".filewritable(dirname))
if filewritable(dirname)
@@ -4583,7 +4810,6 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
" call Decho("restore: ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
endif
endif
-" call Decho("COMBAK#5: after e! ".dirname.": hidden=".&hidden." bufhidden<".&bufhidden."> mod=".&mod)
let @@= ykeep
" call Dret("s:NetrwBrowseChgDir <".dirname."> : curpos<".string(getpos(".")).">")
@@ -4596,9 +4822,18 @@ endfun
" for tree, keeps cursor on current filename
fun! s:NetrwBrowseUpDir(islocal)
" call Dfunc("s:NetrwBrowseUpDir(islocal=".a:islocal.")")
+ if exists("w:netrw_bannercnt") && line(".") < w:netrw_bannercnt-1
+ " this test needed because occasionally this function seems to be incorrectly called
+ " when multiple leftmouse clicks are taken when atop the one line help in the banner.
+ " I'm allowing the very bottom line to permit a "-" exit so that one may escape empty
+ " directories.
+" call Dret("s:NetrwBrowseUpDir : cursor not in file area")
+ return
+ endif
+
norm! 0
if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("w:netrw_treedict")
-" call Decho("ftp + treestyle")
+" call Decho("case: treestyle")
let curline= getline(".")
let swwline= winline() - 1
if exists("w:netrw_treetop")
@@ -4611,19 +4846,19 @@ fun! s:NetrwBrowseUpDir(islocal)
endif
if !search('\c^'.s:treedepthstring.curline,'cw')
if !search('\c^'.curline,'cw')
- sil! keepj 1
+ sil! NetrwKeepj 1
endif
endif
- exe "sil! keepj norm! z\<cr>"
+ exe "sil! NetrwKeepj norm! z\<cr>"
while winline() < swwline
let curwinline= winline()
- exe "sil! keepj norm! \<c-y>"
+ exe "sil! NetrwKeepj norm! \<c-y>"
if curwinline == winline()
break
endif
endwhile
else
-" call Decho("ftp + not treestyle")
+" call Decho("case: not treestyle")
if a:islocal
call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,'../'))
else
@@ -4640,15 +4875,26 @@ fun! s:NetrwBrowseUpDir(islocal)
endfun
" ---------------------------------------------------------------------
-" s:NetrwBrowseX: (implements "x") executes a special "viewer" script or program for the {{{2
+" netrw#BrowseX: (implements "x") executes a special "viewer" script or program for the {{{2
" given filename; typically this means given their extension.
" 0=local, 1=remote
-fun! netrw#NetrwBrowseX(fname,remote)
-" call Dfunc("NetrwBrowseX(fname<".a:fname."> remote=".a:remote.")")
+fun! netrw#BrowseX(fname,remote)
+" call Dfunc("netrw#BrowseX(fname<".a:fname."> remote=".a:remote.")")
+
+ " if its really just a directory, then do a "gf" instead
+ if a:fname =~ '/$'
+ norm! gf
+" call Dret("netrw#BrowseX : did gf instead")
+ endif
+
let ykeep = @@
let screenposn = netrw#SavePosn()
+ " need to save and restore aw setting as gx can invoke this function from non-netrw buffers
+ let awkeep = &aw
+ set noaw
+
" special core dump handler
if a:fname =~ '/core\(\.\d\+\)\=$'
if exists("g:Netrw_corehandler")
@@ -4667,7 +4913,8 @@ fun! netrw#NetrwBrowseX(fname,remote)
endif
call netrw#RestorePosn(screenposn)
let @@= ykeep
-" call Dret("NetrwBrowseX : coredump handler invoked")
+ let &aw= awkeep
+" call Dret("netrw#BrowseX : coredump handler invoked")
return
endif
endif
@@ -4680,21 +4927,6 @@ fun! netrw#NetrwBrowseX(fname,remote)
endif
" call Decho("exten<".exten.">")
- " seems kde systems often have gnome-open due to dependencies, even though
- " gnome-open's subsidiary display tools are largely absent. Kde systems
- " usually have "kdeinit" running, though... (tnx Mikolaj Machowski)
- if !exists("s:haskdeinit")
- if has("unix") && executable("ps") && !has("win32unix")
- let s:haskdeinit= system("ps -e") =~ 'kdeinit'
- if v:shell_error
- let s:haskdeinit = 0
- endif
- else
- let s:haskdeinit= 0
- endif
-" call Decho("setting s:haskdeinit=".s:haskdeinit)
- endif
-
if a:remote == 1
" create a local copy
" call Decho("remote: a:remote=".a:remote.": create a local copy of <".a:fname.">")
@@ -4769,18 +5001,15 @@ fun! netrw#NetrwBrowseX(fname,remote)
elseif exists("g:netrw_browsex_viewer") && executable(viewer)
" call Decho("g:netrw_browsex_viewer<".g:netrw_browsex_viewer.">")
-" call Decho("exe sil !".viewer." ".viewopt.shellescape(fname,1).redir)
- exe "sil !".viewer." ".viewopt.shellescape(fname,1).redir
+ call s:NetrwExe("sil !".viewer." ".viewopt.shellescape(fname,1).redir)
let ret= v:shell_error
elseif has("win32") || has("win64")
" call Decho("windows")
if executable("start")
-" call Decho('exe sil !start rundll32 url.dll,FileProtocolHandler '.shellescape(fname,1))
- exe 'sil !start rundll32 url.dll,FileProtocolHandler '.shellescape(fname,1)
+ call s:NetrwExe('sil! !start rundll32 url.dll,FileProtocolHandler '.shellescape(fname,1))
elseif executable("rundll32")
-" call Decho('exe sil !rundll32 url.dll,FileProtocolHandler '.shellescape(fname,1))
- exe 'sil !rundll32 url.dll,FileProtocolHandler '.shellescape(fname,1)
+ call s:NetrwExe('sil! !rundll32 url.dll,FileProtocolHandler '.shellescape(fname,1))
else
call netrw#ErrorMsg(s:WARNING,"rundll32 not on path",74)
endif
@@ -4791,33 +5020,30 @@ fun! netrw#NetrwBrowseX(fname,remote)
let winfname= 'c:\cygwin'.substitute(fname,'/','\\','g')
" call Decho("cygwin: winfname<".shellescape(winfname,1).">")
if executable("start")
-" call Decho('exe sil !start rundll32 url.dll,FileProtocolHandler '.shellescape(winfname,1))
- exe 'sil !start rundll32 url.dll,FileProtocolHandler '.shellescape(winfname,1)
+ call s:NetrwExe('sil !start rundll32 url.dll,FileProtocolHandler '.shellescape(winfname,1))
elseif executable("rundll32")
-" call Decho('exe sil !rundll32 url.dll,FileProtocolHandler '.shellescape(winfname,1))
- exe 'sil !rundll32 url.dll,FileProtocolHandler '.shellescape(winfname,1)
+ call s:NetrwExe('sil !rundll32 url.dll,FileProtocolHandler '.shellescape(winfname,1))
+ elseif executable("cygstart")
+ call s:NetrwExe('sil !cygstart '.shellescape(fname,1))
else
call netrw#ErrorMsg(s:WARNING,"rundll32 not on path",74)
endif
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
let ret= v:shell_error
- elseif has("unix") && executable("xdg-open") && !s:haskdeinit
+ elseif has("unix") && executable("xdg-open") && !s:CheckIfKde()
" call Decho("unix and xdg-open")
-" call Decho("exe sil !xdg-open ".shellescape(fname,1)." ".redir)
- exe "sil !xdg-open ".shellescape(fname,1).redir
+ call s:NetrwExe("sil !xdg-open ".shellescape(fname,1).redir)
let ret= v:shell_error
- elseif has("unix") && executable("kfmclient") && s:haskdeinit
+ elseif has("unix") && executable("kfmclient") && s:CheckIfKde()
" call Decho("unix and kfmclient")
-" call Decho("exe sil !kfmclient exec ".shellescape(fname,1)." ".redir)
- exe "sil !kfmclient exec ".shellescape(fname,1)." ".redir
+ call s:NetrwExe("sil !kfmclient exec ".shellescape(fname,1)." ".redir)
let ret= v:shell_error
elseif has("macunix") && executable("open")
" call Decho("macunix and open")
-" call Decho("exe sil !open ".shellescape(fname,1)." ".redir)
- exe "sil !open ".shellescape(fname,1)." ".redir
+ call s:NetrwExe("sil !open ".shellescape(fname,1)." ".redir)
let ret= v:shell_error
else
@@ -4848,13 +5074,39 @@ fun! netrw#NetrwBrowseX(fname,remote)
if g:netrw_use_noswf
setl noswf
endif
- exe "sil! keepj norm! \<c-o>"
+ exe "sil! NetrwKeepj norm! \<c-o>"
" redraw!
endif
call netrw#RestorePosn(screenposn)
- let @@= ykeep
+ let @@ = ykeep
+ let &aw= awkeep
-" call Dret("NetrwBrowseX")
+" call Dret("netrw#BrowseX")
+endfun
+
+" ---------------------------------------------------------------------
+" netrw#BrowseXVis: used by gx in visual mode to select a file for browsing {{{2
+fun! netrw#BrowseXVis()
+" call Dfunc("netrw#BrowseXVis()")
+ let atkeep = @@
+ norm! gvy
+" call Decho("@@<".@@.">")
+ call netrw#BrowseX(@@,netrw#CheckIfRemote())
+ let @@ = atkeep
+" call Dret("netrw#BrowseXVis")
+endfun
+
+" ---------------------------------------------------------------------
+" netrw#CheckIfRemote: returns 1 if current file looks like an url, 0 else {{{2
+fun! netrw#CheckIfRemote()
+" call Dfunc("netrw#CheckIfRemote()")
+ if expand("%") =~ '^\a\+://'
+" call Dret("netrw#CheckIfRemote 1")
+ return 1
+ else
+" call Dret("netrw#CheckIfRemote 0")
+ return 0
+ endif
endfun
" ---------------------------------------------------------------------
@@ -4870,16 +5122,41 @@ fun! s:NetrwChgPerm(islocal,curdir)
" call Decho("chgperm<".chgperm.">")
call system(chgperm)
if v:shell_error != 0
- keepj call netrw#ErrorMsg(1,"changing permission on file<".expand("<cfile>")."> seems to have failed",75)
+ NetrwKeepj call netrw#ErrorMsg(1,"changing permission on file<".expand("<cfile>")."> seems to have failed",75)
endif
if a:islocal
- keepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+ NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
endif
let @@= ykeep
" call Dret("s:NetrwChgPerm")
endfun
" ---------------------------------------------------------------------
+" s:CheckIfKde: checks if kdeinit is running {{{2
+" Returns 0: kdeinit not running
+" 1: kdeinit is running
+fun! s:CheckIfKde()
+" call Dfunc("s:CheckIfKde()")
+ " seems kde systems often have gnome-open due to dependencies, even though
+ " gnome-open's subsidiary display tools are largely absent. Kde systems
+ " usually have "kdeinit" running, though... (tnx Mikolaj Machowski)
+ if !exists("s:haskdeinit")
+ if has("unix") && executable("ps") && !has("win32unix")
+ let s:haskdeinit= system("ps -e") =~ '\<kdeinit'
+ if v:shell_error
+ let s:haskdeinit = 0
+ endif
+ else
+ let s:haskdeinit= 0
+ endif
+" call Decho("setting s:haskdeinit=".s:haskdeinit)
+ endif
+
+" call Dret("s:CheckIfKde ".s:haskdeinit)
+ return s:haskdeinit
+endfun
+
+" ---------------------------------------------------------------------
" s:NetrwClearExplore: clear explore variables (if any) {{{2
fun! s:NetrwClearExplore()
" call Dfunc("s:NetrwClearExplore()")
@@ -4994,24 +5271,24 @@ fun! s:NetrwHide(islocal)
" call Decho("hide: g:netrw_list_hide<".g:netrw_list_hide.">")
endif
endfor
- keepj call s:NetrwUnmarkList(bufnr("%"),b:netrw_curdir)
+ NetrwKeepj call s:NetrwUnmarkList(bufnr("%"),b:netrw_curdir)
let g:netrw_hide= 1
else
" switch between show-all/show-not-hidden/show-hidden
let g:netrw_hide=(g:netrw_hide+1)%3
- exe "keepj norm! 0"
+ exe "NetrwKeepj norm! 0"
if g:netrw_hide && g:netrw_list_hide == ""
- keepj call netrw#ErrorMsg(s:WARNING,"your hiding list is empty!",49)
+ NetrwKeepj call netrw#ErrorMsg(s:WARNING,"your hiding list is empty!",49)
let @@= ykeep
" call Dret("NetrwHide")
return
endif
endif
- keepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
- keepj call netrw#RestorePosn(svpos)
+ NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+ NetrwKeepj call netrw#RestorePosn(svpos)
let @@= ykeep
" call Dret("NetrwHide")
endfun
@@ -5034,8 +5311,8 @@ fun! s:NetrwHidden(islocal)
endif
" refresh screen and return to saved position
- keepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
- keepj call netrw#RestorePosn(svpos)
+ NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+ NetrwKeepj call netrw#RestorePosn(svpos)
let @@= ykeep
" call Dret("s:NetrwHidden")
endfun
@@ -5101,22 +5378,24 @@ fun! s:NetrwLeftmouse(islocal)
" call Dret("s:NetrwLeftmouse : detected a status bar leftmouse click")
return
endif
- " NOTE: following test is preventing leftmouse selection/deselection of directories and files in treelist mode (Dec 04, 2013)
+ " Dec 04, 2013: following test prevents leftmouse selection/deselection of directories and files in treelist mode
" Windows are separated by vertical separator bars - but the mouse seems to be doing what it should when dragging that bar
- " without this test.
-" if v:mouse_col != col('.')
-" let @@= ykeep
-" call Dret("s:NetrwLeftmouse : detected a vertical separator bar leftmouse click")
-" return
-" endif
+ " without this test when its disabled.
+ " May 26, 2014: edit file, :Lex, resize window -- causes refresh. Reinstated a modified test. See if problems develop.
+" call Decho("v:mouse_col=".v:mouse_col." col#".col('.')." virtcol#".virtcol('.')." col($)#".col("$")." virtcol($)#".virtcol("$"))
+ if v:mouse_col > virtcol('.')
+ let @@= ykeep
+" call Dret("s:NetrwLeftmouse : detected a vertical separator bar leftmouse click")
+ return
+ endif
if a:islocal
if exists("b:netrw_curdir")
- keepj call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,s:NetrwGetWord()))
+ NetrwKeepj call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,s:NetrwGetWord()))
endif
else
if exists("b:netrw_curdir")
- keepj call s:NetrwBrowse(0,s:NetrwBrowseChgDir(0,s:NetrwGetWord()))
+ NetrwKeepj call s:NetrwBrowse(0,s:NetrwBrowseChgDir(0,s:NetrwGetWord()))
endif
endif
let @@= ykeep
@@ -5124,6 +5403,128 @@ fun! s:NetrwLeftmouse(islocal)
endfun
" ---------------------------------------------------------------------
+" s:NetrwServerEdit: edit file in a server gvim, usually NETRWSERVER (implements <c-r>){{{2
+" a:islocal=0 : <c-r> not used, remote
+" a:islocal=1 : <c-r> no used, local
+" a:islocal=2 : <c-r> used, remote
+" a:islocal=3 : <c-r> used, local
+fun! s:NetrwServerEdit(islocal,fname)
+" call Dfunc("s:NetrwServerEdit(islocal=".a:islocal.",fname<".a:fname.">)")
+ let islocal = a:islocal%2 " =0: remote =1: local
+ let ctrlr = a:islocal >= 2 " =0: <c-r> not used =1: <c-r> used
+
+ if (islocal && isdirectory(a:fname)) || (!islocal && a:fname =~ '/$')
+ " handle directories in the local window -- not in the remote vim server
+ " user must have closed the NETRWSERVER window. Treat as a normal editing from netrw.
+ let g:netrw_browse_split= 0
+ if exists("s:netrw_browse_split_".winnr())
+ let g:netrw_browse_split= s:netrw_browse_split_{winnr()}
+ unlet s:netrw_browse_split_{winnr()}
+ endif
+ call s:NetrwBrowse(islocal,s:NetrwBrowseChgDir(islocal,a:fname))
+" call Dret("s:NetrwServerEdit")
+ return
+ endif
+
+ if has("clientserver") && executable("gvim")
+" call Decho("has clientserver and gvim")
+
+ if exists("g:netrw_browse_split") && type(g:netrw_browse_split) == 3
+" call Decho("g:netrw_browse_split=".string(g:netrw_browse_split))
+ let srvrname = g:netrw_browse_split[0]
+ let tabnum = g:netrw_browse_split[1]
+ let winnum = g:netrw_browse_split[2]
+
+ if serverlist() !~ '\<'.srvrname.'\>'
+" call Decho("server not available; ctrlr=".ctrlr)
+
+ if !ctrlr
+ " user must have closed the server window and the user did not use <c-r>, but
+ " used something like <cr>.
+" call Decho("user must have closed server AND did not use ctrl-r")
+ if exists("g:netrw_browse_split")
+ unlet g:netrw_browse_split
+ endif
+ let g:netrw_browse_split= 0
+ if exists("s:netrw_browse_split_".winnr())
+ let g:netrw_browse_split= s:netrw_browse_split_{winnr()}
+ endif
+ call s:NetrwBrowseChgDir(islocal,a:fname)
+" call Dret("s:NetrwServerEdit")
+ return
+
+ elseif has("win32") && executable("start")
+ " start up remote netrw server under windows
+" call Decho("starting up gvim server<".srvrname."> for windows")
+ call system("start gvim --servername ".srvrname)
+
+ else
+ " start up remote netrw server under linux
+" call Decho("starting up gvim server<".srvrname.">")
+ call system("gvim --servername ".srvrname)
+ endif
+ endif
+
+" call Decho("srvrname<".srvrname."> tabnum=".tabnum." winnum=".winnum." server-editing<".a:fname.">")
+ call remote_send(srvrname,":tabn ".tabnum."\<cr>")
+ call remote_send(srvrname,":".winnum."wincmd w\<cr>")
+ call remote_send(srvrname,":e ".fnameescape(a:fname)."\<cr>")
+
+ else
+
+ if serverlist() !~ '\<'.g:netrw_servername.'\>'
+
+ if !ctrlr
+" call Decho("server<".g:netrw_servername."> not available and ctrl-r not used")
+ if exists("g:netrw_browse_split")
+ unlet g:netrw_browse_split
+ endif
+ let g:netrw_browse_split= 0
+ call s:NetrwBrowse(islocal,s:NetrwBrowseChgDir(islocal,a:fname))
+" call Dret("s:NetrwServerEdit")
+ return
+
+ else
+" call Decho("server<".g:netrw_servername."> not available but ctrl-r used")
+ if has("win32") && executable("start")
+ " start up remote netrw server under windows
+" call Decho("starting up gvim server<".g:netrw_servername."> for windows")
+ call system("start gvim --servername ".g:netrw_servername)
+ else
+ " start up remote netrw server under linux
+" call Decho("starting up gvim server<".g:netrw_servername.">")
+ call system("gvim --servername ".g:netrw_servername)
+ endif
+ endif
+ endif
+
+ while 1
+ try
+" call Decho("remote-send: e ".a:fname)
+ call remote_send(g:netrw_servername,":e ".fnameescape(a:fname)."\<cr>")
+ break
+ catch /^Vim\%((\a\+)\)\=:E241/
+ sleep 200m
+ endtry
+ endwhile
+
+ if exists("g:netrw_browse_split")
+ if type(g:netrw_browse_split) != 3
+ let s:netrw_browse_split_{winnr()}= g:netrw_browse_split
+ endif
+ unlet g:netrw_browse_split
+ endif
+ let g:netrw_browse_split= [g:netrw_servername,1,1]
+ endif
+
+ else
+ call netrw#ErrorMsg(s:ERROR,"you need a gui-capable vim and client-server to use <ctrl-r>",98)
+ endif
+
+" call Dret("s:NetrwServerEdit")
+endfun
+
+" ---------------------------------------------------------------------
" s:NetrwSLeftmouse: marks the file under the cursor. May be dragged to select additional files {{{2
fun! s:NetrwSLeftmouse(islocal)
" call Dfunc("s:NetrwSLeftmouse(islocal=".a:islocal.")")
@@ -5177,7 +5578,7 @@ endfun
" s:NetrwListHide: uses [range]g~...~d to delete files that match comma {{{2
" separated patterns given in g:netrw_list_hide
fun! s:NetrwListHide()
-" call Dfunc("NetrwListHide() g:netrw_hide=".g:netrw_hide." g:netrw_list_hide<".g:netrw_list_hide.">")
+" call Dfunc("s:NetrwListHide() g:netrw_hide=".g:netrw_hide." g:netrw_list_hide<".g:netrw_list_hide.">")
let ykeep= @@
" find a character not in the "hide" string to use as a separator for :g and :v commands
@@ -5200,23 +5601,23 @@ fun! s:NetrwListHide()
" Prune the list by hiding any files which match
if g:netrw_hide == 1
" call Decho("hiding<".hide."> listhide<".listhide.">")
- exe 'sil! keepj '.w:netrw_bannercnt.',$g'.sep.hide.sep.'d'
+ exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$g'.sep.hide.sep.'d'
elseif g:netrw_hide == 2
" call Decho("showing<".hide."> listhide<".listhide.">")
- exe 'sil! keepj '.w:netrw_bannercnt.',$g'.sep.hide.sep.'s@^@ /-KEEP-/ @'
+ exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$g'.sep.hide.sep.'s@^@ /-KEEP-/ @'
endif
endwhile
if g:netrw_hide == 2
- exe 'sil! keepj '.w:netrw_bannercnt.',$v@^ /-KEEP-/ @d'
- exe 'sil! keepj '.w:netrw_bannercnt.',$s@^\%( /-KEEP-/ \)\+@@e'
+ exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$v@^ /-KEEP-/ @d'
+ exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$s@^\%( /-KEEP-/ \)\+@@e'
endif
" remove any blank lines that have somehow remained.
" This seems to happen under Windows.
- exe 'sil! keepj 1,$g@^\s*$@d'
+ exe 'sil! NetrwKeepj 1,$g@^\s*$@d'
let @@= ykeep
-" call Dret("NetrwListHide")
+" call Dret("s:NetrwListHide")
endfun
" ---------------------------------------------------------------------
@@ -5236,7 +5637,7 @@ fun! s:NetrwHideEdit(islocal)
" call Decho("new g:netrw_list_hide<".g:netrw_list_hide.">")
" refresh the listing
- sil keepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,"./"))
+ sil NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,"./"))
" restore cursor position
call netrw#RestorePosn(svpos)
@@ -5258,8 +5659,8 @@ fun! s:NetSortSequence(islocal)
" refresh the listing
let g:netrw_sort_sequence= newsortseq
- keepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
- keepj call netrw#RestorePosn(svpos)
+ NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+ NetrwKeepj call netrw#RestorePosn(svpos)
let @@= ykeep
" call Dret("NetSortSequence")
@@ -5267,6 +5668,7 @@ endfun
" ---------------------------------------------------------------------
" s:NetrwMakeDir: this function makes a directory (both local and remote) {{{2
+" implements the "d" mapping.
fun! s:NetrwMakeDir(usrhost)
" call Dfunc("s:NetrwMakeDir(usrhost<".a:usrhost.">)")
@@ -5294,7 +5696,7 @@ fun! s:NetrwMakeDir(usrhost)
" call Decho("fullnewdir<".fullnewdir.">")
if isdirectory(fullnewdir)
if !exists("g:netrw_quiet")
- keepj call netrw#ErrorMsg(s:WARNING,"<".newdirname."> is already a directory!",24)
+ NetrwKeepj call netrw#ErrorMsg(s:WARNING,"<".newdirname."> is already a directory!",24)
endif
let @@= ykeep
" call Dret("s:NetrwMakeDir : directory<".newdirname."> exists previously")
@@ -5302,7 +5704,7 @@ fun! s:NetrwMakeDir(usrhost)
endif
if s:FileReadable(fullnewdir)
if !exists("g:netrw_quiet")
- keepj call netrw#ErrorMsg(s:WARNING,"<".newdirname."> is already a file!",25)
+ NetrwKeepj call netrw#ErrorMsg(s:WARNING,"<".newdirname."> is already a file!",25)
endif
let @@= ykeep
" call Dret("s:NetrwMakeDir : file<".newdirname."> exists previously")
@@ -5321,8 +5723,7 @@ fun! s:NetrwMakeDir(usrhost)
let netrw_origdir= s:NetrwGetcwd(1)
call s:NetrwLcd(b:netrw_curdir)
" call Decho("netrw_origdir<".netrw_origdir.">: lcd b:netrw_curdir<".fnameescape(b:netrw_curdir).">")
-" call Decho("exe sil! !".g:netrw_localmkdir.' '.shellescape(newdirname,1))
- exe "sil! !".g:netrw_localmkdir.' '.shellescape(newdirname,1)
+ call s:NetrwExe("sil! !".g:netrw_localmkdir.' '.shellescape(newdirname,1))
if v:shell_error != 0
let @@= ykeep
call netrw#ErrorMsg(s:ERROR,"consider setting g:netrw_localmkdir<".g:netrw_localmkdir."> to something that works",80)
@@ -5351,15 +5752,14 @@ fun! s:NetrwMakeDir(usrhost)
" call Decho("remote mkdir")
let mkdircmd = s:MakeSshCmd(g:netrw_mkdir_cmd)
let newdirname= substitute(b:netrw_curdir,'^\%(.\{-}/\)\{3}\(.*\)$','\1','').newdirname
-" call Decho("exe sil! !".mkdircmd." ".shellescape(newdirname,1))
- exe "sil! !".mkdircmd." ".shellescape(newdirname,1)
+ call s:NetrwExe("sil! !".mkdircmd." ".shellescape(newdirname,1))
if v:shell_error == 0
" refresh listing
let svpos= netrw#SavePosn()
- keepj call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./'))
- keepj call netrw#RestorePosn(svpos)
+ NetrwKeepj call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./'))
+ NetrwKeepj call netrw#RestorePosn(svpos)
elseif !exists("g:netrw_quiet")
- keepj call netrw#ErrorMsg(s:ERROR,"unable to make directory<".newdirname.">",27)
+ NetrwKeepj call netrw#ErrorMsg(s:ERROR,"unable to make directory<".newdirname.">",27)
endif
" redraw!
@@ -5374,8 +5774,8 @@ fun! s:NetrwMakeDir(usrhost)
let remotepath= ""
endif
call s:NetrwRemoteFtpCmd(remotepath,g:netrw_remote_mkdir.' "'.newdirname.'"')
- keepj call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./'))
- keepj call netrw#RestorePosn(svpos)
+ NetrwKeepj call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./'))
+ NetrwKeepj call netrw#RestorePosn(svpos)
elseif b:netrw_method == 3
" Remote mkdir: using ftp + machine, id, passwd, and fname (ie. no .netrc)
@@ -5388,8 +5788,8 @@ fun! s:NetrwMakeDir(usrhost)
let remotepath= ""
endif
call s:NetrwRemoteFtpCmd(remotepath,g:netrw_remote_mkdir.' "'.newdirname.'"')
- keepj call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./'))
- keepj call netrw#RestorePosn(svpos)
+ NetrwKeepj call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./'))
+ NetrwKeepj call netrw#RestorePosn(svpos)
endif
let @@= ykeep
@@ -5452,6 +5852,7 @@ fun! s:NetrwMaps(islocal)
nnoremap <buffer> <silent> C :<c-u>call <SID>NetrwSetChgwin()<cr>
nnoremap <buffer> <silent> <cr> :call netrw#LocalBrowseCheck(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord()))<cr>
nnoremap <buffer> <silent> <s-cr> :call <SID>TreeSqueezeDir(1)<cr>
+ nnoremap <buffer> <silent> <c-r> :call <SID>NetrwServerEdit(3,<SID>NetrwGetWord())<cr>
nnoremap <buffer> <silent> d :call <SID>NetrwMakeDir("")<cr>
nnoremap <buffer> <silent> - :call <SID>NetrwBrowseUpDir(1)<cr>
nnoremap <buffer> <silent> gb :<c-u>call <SID>NetrwBookHistHandler(1,b:netrw_curdir)<cr>
@@ -5477,8 +5878,9 @@ fun! s:NetrwMaps(islocal)
nnoremap <buffer> <silent> mt :<c-u>call <SID>NetrwMarkFileTgt(1)<cr>
nnoremap <buffer> <silent> mT :<c-u>call <SID>NetrwMarkFileTag(1)<cr>
nnoremap <buffer> <silent> mu :<c-u>call <SID>NetrwUnMarkFile(1)<cr>
- nnoremap <buffer> <silent> mx :<c-u>call <SID>NetrwMarkFileExe(1)<cr>
- nnoremap <buffer> <silent> mX :<c-u>call <SID>NetrwMarkFileVimCmd(1)<cr>
+ nnoremap <buffer> <silent> mv :<c-u>call <SID>NetrwMarkFileVimCmd(1)<cr>
+ nnoremap <buffer> <silent> mx :<c-u>call <SID>NetrwMarkFileExe(1,0)<cr>
+ nnoremap <buffer> <silent> mX :<c-u>call <SID>NetrwMarkFileExe(1,1)<cr>
nnoremap <buffer> <silent> mz :<c-u>call <SID>NetrwMarkFileCompress(1)<cr>
nnoremap <buffer> <silent> O :call <SID>NetrwObtain(1)<cr>
nnoremap <buffer> <silent> o :call <SID>NetrwSplit(3)<cr>
@@ -5496,11 +5898,11 @@ fun! s:NetrwMaps(islocal)
nnoremap <buffer> <silent> u :<c-u>call <SID>NetrwBookHistHandler(4,expand("%"))<cr>
nnoremap <buffer> <silent> U :<c-u>call <SID>NetrwBookHistHandler(5,expand("%"))<cr>
nnoremap <buffer> <silent> v :call <SID>NetrwSplit(5)<cr>
- nnoremap <buffer> <silent> x :call netrw#NetrwBrowseX(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),0),0)"<cr>
+ nnoremap <buffer> <silent> x :call netrw#BrowseX(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),0),0)"<cr>
nnoremap <buffer> <silent> X :call <SID>NetrwLocalExecute(expand("<cword>"))"<cr>
" local insert-mode maps
inoremap <buffer> <silent> a <c-o>:call <SID>NetrwHide(1)<cr>
- inoremap <buffer> <silent> c <c-o>:exe "keepjumps lcd ".fnameescape(b:netrw_curdir)<cr>
+ inoremap <buffer> <silent> c <c-o>:exe "NetrwKeepj lcd ".fnameescape(b:netrw_curdir)<cr>
inoremap <buffer> <silent> c <c-o>:call <SID>NetrwLcd(b:netrw_curdir)<cr>
inoremap <buffer> <silent> C <c-o>:call <SID>NetrwSetChgwin()<cr>
inoremap <buffer> <silent> % <c-o>:call <SID>NetrwOpenFile(1)<cr>
@@ -5528,8 +5930,9 @@ fun! s:NetrwMaps(islocal)
inoremap <buffer> <silent> mT <c-o>:<c-u>call <SID>NetrwMarkFileTag(1)<cr>
inoremap <buffer> <silent> mt <c-o>:<c-u>call <SID>NetrwMarkFileTgt(1)<cr>
inoremap <buffer> <silent> mu <c-o>:<c-u>call <SID>NetrwUnMarkFile(1)<cr>
- inoremap <buffer> <silent> mx <c-o>:<c-u>call <SID>NetrwMarkFileExe(1)<cr>
- inoremap <buffer> <silent> mX <c-o>:<c-u>call <SID>NetrwMarkFileVimCmd(1)<cr>
+ inoremap <buffer> <silent> mv <c-o>:<c-u>call <SID>NetrwMarkFileVimCmd(1)<cr>
+ inoremap <buffer> <silent> mx <c-o>:<c-u>call <SID>NetrwMarkFileExe(1,0)<cr>
+ inoremap <buffer> <silent> mX <c-o>:<c-u>call <SID>NetrwMarkFileExe(1,1)<cr>
inoremap <buffer> <silent> mz <c-o>:<c-u>call <SID>NetrwMarkFileCompress(1)<cr>
inoremap <buffer> <silent> O <c-o>:call <SID>NetrwObtain(1)<cr>
inoremap <buffer> <silent> o <c-o>:call <SID>NetrwSplit(3)<cr>
@@ -5547,7 +5950,7 @@ fun! s:NetrwMaps(islocal)
inoremap <buffer> <silent> u <c-o>:<c-u>call <SID>NetrwBookHistHandler(4,expand("%"))<cr>
inoremap <buffer> <silent> U <c-o>:<c-u>call <SID>NetrwBookHistHandler(5,expand("%"))<cr>
inoremap <buffer> <silent> v <c-o>:call <SID>NetrwSplit(5)<cr>
- inoremap <buffer> <silent> x <c-o>:call netrw#NetrwBrowseX(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),0),0)"<cr>
+ inoremap <buffer> <silent> x <c-o>:call netrw#BrowseX(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),0),0)"<cr>
if !hasmapto('<Plug>NetrwHideEdit')
nmap <buffer> <unique> <c-h> <Plug>NetrwHideEdit
imap <buffer> <unique> <c-h> <Plug>NetrwHideEdit
@@ -5608,6 +6011,7 @@ fun! s:NetrwMaps(islocal)
nnoremap <buffer> <silent> <cr> :call <SID>NetrwBrowse(0,<SID>NetrwBrowseChgDir(0,<SID>NetrwGetWord()))<cr>
nnoremap <buffer> <silent> <s-cr> :call <SID>TreeSqueezeDir(0)<cr>
nnoremap <buffer> <silent> <c-l> :call <SID>NetrwRefresh(0,<SID>NetrwBrowseChgDir(0,'./'))<cr>
+ nnoremap <buffer> <silent> <c-r> :call <SID>NetrwServerEdit(2,<SID>NetrwGetWord())<cr>
nnoremap <buffer> <silent> - :call <SID>NetrwBrowseUpDir(0)<cr>
nnoremap <buffer> <silent> a :call <SID>NetrwHide(0)<cr>
nnoremap <buffer> <silent> mb :<c-u>call <SID>NetrwBookHistHandler(0,b:netrw_curdir)<cr>
@@ -5625,8 +6029,9 @@ fun! s:NetrwMaps(islocal)
nnoremap <buffer> <silent> mt :<c-u>call <SID>NetrwMarkFileTgt(0)<cr>
nnoremap <buffer> <silent> mT :<c-u>call <SID>NetrwMarkFileTag(0)<cr>
nnoremap <buffer> <silent> mu :<c-u>call <SID>NetrwUnMarkFile(0)<cr>
- nnoremap <buffer> <silent> mx :<c-u>call <SID>NetrwMarkFileExe(0)<cr>
- nnoremap <buffer> <silent> mX :<c-u>call <SID>NetrwMarkFileVimCmd(0)<cr>
+ nnoremap <buffer> <silent> mv :<c-u>call <SID>NetrwMarkFileVimCmd(0)<cr>
+ nnoremap <buffer> <silent> mx :<c-u>call <SID>NetrwMarkFileExe(0,0)<cr>
+ nnoremap <buffer> <silent> mX :<c-u>call <SID>NetrwMarkFileExe(0,1)<cr>
nnoremap <buffer> <silent> mz :<c-u>call <SID>NetrwMarkFileCompress(0)<cr>
nnoremap <buffer> <silent> gb :<c-u>call <SID>NetrwBookHistHandler(1,b:netrw_curdir)<cr>
nnoremap <buffer> <silent> gd :<c-u>call <SID>NetrwForceChgDir(0,<SID>NetrwGetWord())<cr>
@@ -5653,7 +6058,7 @@ fun! s:NetrwMaps(islocal)
nnoremap <buffer> <silent> u :<c-u>call <SID>NetrwBookHistHandler(4,b:netrw_curdir)<cr>
nnoremap <buffer> <silent> U :<c-u>call <SID>NetrwBookHistHandler(5,b:netrw_curdir)<cr>
nnoremap <buffer> <silent> v :call <SID>NetrwSplit(2)<cr>
- nnoremap <buffer> <silent> x :call netrw#NetrwBrowseX(<SID>NetrwBrowseChgDir(0,<SID>NetrwGetWord()),1)<cr>
+ nnoremap <buffer> <silent> x :call netrw#BrowseX(<SID>NetrwBrowseChgDir(0,<SID>NetrwGetWord()),1)<cr>
nnoremap <buffer> <silent> % :call <SID>NetrwOpenFile(0)<cr>
" remote insert-mode maps
inoremap <buffer> <silent> <cr> <c-o>:call <SID>NetrwBrowse(0,<SID>NetrwBrowseChgDir(0,<SID>NetrwGetWord()))<cr>
@@ -5675,8 +6080,10 @@ fun! s:NetrwMaps(islocal)
inoremap <buffer> <silent> mt <c-o>:<c-u>call <SID>NetrwMarkFileTgt(0)<cr>
inoremap <buffer> <silent> mT <c-o>:<c-u>call <SID>NetrwMarkFileTag(0)<cr>
inoremap <buffer> <silent> mu <c-o>:<c-u>call <SID>NetrwUnMarkFile(0)<cr>
- inoremap <buffer> <silent> mx <c-o>:<c-u>call <SID>NetrwMarkFileExe(0)<cr>
- inoremap <buffer> <silent> mX <c-o>:<c-u>call <SID>NetrwMarkFileVimCmd(0)<cr>
+ nnoremap <buffer> <silent> mv :<c-u>call <SID>NetrwMarkFileVimCmd(1)<cr>
+ inoremap <buffer> <silent> mx <c-o>:<c-u>call <SID>NetrwMarkFileExe(0,0)<cr>
+ inoremap <buffer> <silent> mX <c-o>:<c-u>call <SID>NetrwMarkFileExe(0,1)<cr>
+ inoremap <buffer> <silent> mv <c-o>:<c-u>call <SID>NetrwMarkFileVimCmd(0)<cr>
inoremap <buffer> <silent> mz <c-o>:<c-u>call <SID>NetrwMarkFileCompress(0)<cr>
inoremap <buffer> <silent> gb <c-o>:<c-u>call <SID>NetrwBookHistHandler(1,b:netrw_curdir)<cr>
inoremap <buffer> <silent> gh <c-o>:<c-u>call <SID>NetrwHidden(0)<cr>
@@ -5701,7 +6108,7 @@ fun! s:NetrwMaps(islocal)
inoremap <buffer> <silent> u <c-o>:<c-u>call <SID>NetrwBookHistHandler(4,b:netrw_curdir)<cr>
inoremap <buffer> <silent> U <c-o>:<c-u>call <SID>NetrwBookHistHandler(5,b:netrw_curdir)<cr>
inoremap <buffer> <silent> v <c-o>:call <SID>NetrwSplit(2)<cr>
- inoremap <buffer> <silent> x <c-o>:call netrw#NetrwBrowseX(<SID>NetrwBrowseChgDir(0,<SID>NetrwGetWord()),1)<cr>
+ inoremap <buffer> <silent> x <c-o>:call netrw#BrowseX(<SID>NetrwBrowseChgDir(0,<SID>NetrwGetWord()),1)<cr>
inoremap <buffer> <silent> % <c-o>:call <SID>NetrwOpenFile(0)<cr>
if !hasmapto('<Plug>NetrwHideEdit')
nmap <buffer> <c-h> <Plug>NetrwHideEdit
@@ -5714,7 +6121,7 @@ fun! s:NetrwMaps(islocal)
endif
let mapsafepath = escape(s:path, s:netrw_map_escape)
- let mapsafeusermach = escape(s:user.s:machine, s:netrw_map_escape)
+ let mapsafeusermach = escape(((s:user == "")? "" : s:user."@").s:machine, s:netrw_map_escape)
nnoremap <buffer> <silent> <Plug>NetrwRefresh :call <SID>NetrwRefresh(0,<SID>NetrwBrowseChgDir(0,'./'))<cr>
if g:netrw_mousemaps == 1
@@ -5755,23 +6162,31 @@ fun! s:NetrwMaps(islocal)
inoremap <buffer> <F1> <c-o>:he netrw-quickhelp<cr>
endif
- keepj call s:SetRexDir(a:islocal,b:netrw_curdir)
+ NetrwKeepj call s:SetRexDir(a:islocal,b:netrw_curdir)
" call Dret("s:NetrwMaps")
endfun
" ---------------------------------------------------------------------
-" s:NetrwCommands: sets up commands available only in the netrw buffer windows {{{2
+" s:NetrwCommands: sets up commands {{{2
+" If -buffer, the command is only available from within netrw buffers
+" Otherwise, the command is available from any window, so long as netrw
+" has been used at least once in the session.
fun! s:NetrwCommands(islocal)
" call Dfunc("s:NetrwCommands(islocal=".a:islocal.")")
+ com! -nargs=* -complete=file -bang NetrwMB call s:NetrwBookmark(<bang>0,<f-args>)
+ com! -nargs=* NetrwC call s:NetrwSetChgwin(<q-args>)
com! Rexplore if exists("w:netrw_rexlocal")|call s:NetrwRexplore(w:netrw_rexlocal,exists("w:netrw_rexdir")? w:netrw_rexdir : ".")|else|call netrw#ErrorMsg(s:WARNING,"not a former netrw window",79)|endif
if a:islocal
- com! -buffer -nargs=+ -complete=file MF call s:NetrwMarkFiles(1,<f-args>)
+ com! -buffer -nargs=+ -complete=file MF call s:NetrwMarkFiles(1,<f-args>)
else
- com! -buffer -nargs=+ -complete=file MF call s:NetrwMarkFiles(0,<f-args>)
+ com! -buffer -nargs=+ -complete=file MF call s:NetrwMarkFiles(0,<f-args>)
endif
- com! -buffer -nargs=? -complete=file MT call s:NetrwMarkTarget(<q-args>)
+ com! -buffer -nargs=? -complete=file MT call s:NetrwMarkTarget(<q-args>)
+ " the following two commands are intended to be used for testing only, so I'm not advertising them in the manual
+ com! -buffer -nargs=0 CRL call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,s:NetrwGetWord()))
+ com! -buffer -nargs=0 CRR call <SID>NetrwBrowse(0,<SID>NetrwBrowseChgDir(0,<SID>NetrwGetWord()))
" call Dret("s:NetrwCommands")
endfun
@@ -5964,7 +6379,7 @@ fun! s:NetrwMarkFileCompress(islocal)
" sanity check
if !exists("s:netrwmarkfilelist_{curbufnr}") || empty(s:netrwmarkfilelist_{curbufnr})
- keepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
+ NetrwKeepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
" call Dret("s:NetrwMarkFileCompress")
return
endif
@@ -5992,10 +6407,10 @@ fun! s:NetrwMarkFileCompress(islocal)
if a:islocal
call system(exe." ".fname)
else
- keepj call s:RemoteSystem(exe." ".fname)
+ NetrwKeepj call s:RemoteSystem(exe." ".fname)
endif
else
- keepj call netrw#ErrorMsg(s:WARNING,"unable to apply<".exe."> to file<".fname.">",50)
+ NetrwKeepj call netrw#ErrorMsg(s:WARNING,"unable to apply<".exe."> to file<".fname.">",50)
endif
endif
unlet sfx
@@ -6007,13 +6422,13 @@ fun! s:NetrwMarkFileCompress(islocal)
call system(netrw#WinPath(g:netrw_compress)." ".shellescape(s:ComposePath(b:netrw_curdir,fname)))
else
" fname not a compressed file, so compress it
- keepj call s:RemoteSystem(netrw#WinPath(g:netrw_compress)." ".shellescape(fname))
+ NetrwKeepj call s:RemoteSystem(netrw#WinPath(g:netrw_compress)." ".shellescape(fname))
endif
endfor " for every file in the marked list
call s:NetrwUnmarkList(curbufnr,curdir)
- keepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
- keepj call netrw#RestorePosn(svpos)
+ NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+ NetrwKeepj call netrw#RestorePosn(svpos)
endif
" call Dret("s:NetrwMarkFileCompress")
endfun
@@ -6037,14 +6452,14 @@ fun! s:NetrwMarkFileCopy(islocal,...)
" sanity check
if !exists("s:netrwmarkfilelist_{curbufnr}") || empty(s:netrwmarkfilelist_{curbufnr})
- keepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
+ NetrwKeepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
" call Dret("s:NetrwMarkFileCopy")
return
endif
" call Decho("sanity chk passed: s:netrwmarkfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}))
if !exists("s:netrwmftgt")
- keepj call netrw#ErrorMsg(s:ERROR,"your marked file target is empty! (:help netrw-mt)",67)
+ NetrwKeepj call netrw#ErrorMsg(s:ERROR,"your marked file target is empty! (:help netrw-mt)",67)
" call Dret("s:NetrwMarkFileCopy 0")
return 0
endif
@@ -6063,14 +6478,17 @@ fun! s:NetrwMarkFileCopy(islocal,...)
if simplify(s:netrwmftgt) == simplify(b:netrw_curdir)
if len(s:netrwmarkfilelist_{bufnr('%')}) == 1
" only one marked file
+" call Decho("case: only one marked file")
let args = shellescape(b:netrw_curdir."/".s:netrwmarkfilelist_{bufnr('%')}[0])
let oldname = s:netrwmarkfilelist_{bufnr('%')}[0]
elseif a:0 == 1
+" call Decho("case: handling one input argument")
" this happens when the next case was used to recursively call s:NetrwMarkFileCopy()
let args = shellescape(b:netrw_curdir."/".a:1)
let oldname = a:1
else
" copy multiple marked files inside the same directory
+" call Decho("case: handling a multiple marked files")
let s:recursive= 1
for oldname in s:netrwmarkfilelist_{bufnr("%")}
let ret= s:NetrwMarkFileCopy(a:islocal,oldname)
@@ -6101,18 +6519,34 @@ fun! s:NetrwMarkFileCopy(islocal,...)
let args= substitute(args,'/','\\','g')
let tgt = substitute(tgt, '/','\\','g')
endif
+ if args =~ "'"|let args= substitute(args,"'\\(.*\\)'",'\1','')|endif
+ if tgt =~ "'"|let tgt = substitute(tgt,"'\\(.*\\)'",'\1','') |endif
+ if isdirectory(args)
+" call Decho("args<".args."> is a directory")
+ let copycmd= g:netrw_localcopydircmd
+" call Decho("using copydircmd<".copycmd.">")
+ if !g:netrw_cygwin && (has("win32") || has("win95") || has("win64") || has("win16"))
+ " window's xcopy doesn't copy a directory to a target properly. Instead, it copies a directory's
+ " contents to a target. One must append the source directory name to the target to get xcopy to
+ " do the right thing.
+ let tgt= tgt.'\'.substitute(a:1,'^.*[\\/]','','')
+" call Decho("modified tgt for xcopy")
+ endif
+ else
+ let copycmd= g:netrw_localcopycmd
+ endif
if g:netrw_localcopycmd =~ '\s'
- let copycmd = substitute(g:netrw_localcopycmd,'\s.*$','','')
- let copycmdargs = substitute(g:netrw_localcopycmd,'^.\{-}\(\s.*\)$','\1','')
+ let copycmd = substitute(copycmd,'\s.*$','','')
+ let copycmdargs = substitute(copycmd,'^.\{-}\(\s.*\)$','\1','')
let copycmd = netrw#WinPath(copycmd).copycmdargs
else
- let copycmd = netrw#WinPath(g:netrw_localcopycmd)
+ let copycmd = netrw#WinPath(copycmd)
endif
" call Decho("args <".args.">")
" call Decho("tgt <".tgt.">")
" call Decho("copycmd<".copycmd.">")
-" call Decho("system(".copycmd." ".args." ".tgt.")")
- call system(copycmd." ".args." ".tgt)
+" call Decho("system(".copycmd." '".args."' '".tgt."')")
+ call system(copycmd." '".args."' '".tgt."'")
if v:shell_error != 0
call netrw#ErrorMsg(s:ERROR,"tried using g:netrw_localcopycmd<".g:netrw_localcopycmd.">; it doesn't work!",80)
" call Dret("s:NetrwMarkFileCopy 0 : failed: system(".g:netrw_localcopycmd." ".args." ".shellescape(s:netrwmftgt))
@@ -6122,12 +6556,12 @@ fun! s:NetrwMarkFileCopy(islocal,...)
elseif a:islocal && !s:netrwmftgt_islocal
" Copy marked files, local directory to remote directory
" call Decho("copy from local to remote")
- keepj call s:NetrwUpload(s:netrwmarkfilelist_{bufnr('%')},s:netrwmftgt)
+ NetrwKeepj call s:NetrwUpload(s:netrwmarkfilelist_{bufnr('%')},s:netrwmftgt)
elseif !a:islocal && s:netrwmftgt_islocal
" Copy marked files, remote directory to local directory
" call Decho("copy from remote to local")
- keepj call netrw#Obtain(a:islocal,s:netrwmarkfilelist_{bufnr('%')},s:netrwmftgt)
+ NetrwKeepj call netrw#Obtain(a:islocal,s:netrwmarkfilelist_{bufnr('%')},s:netrwmftgt)
elseif !a:islocal && !s:netrwmftgt_islocal
" Copy marked files, remote directory to remote directory
@@ -6140,7 +6574,7 @@ fun! s:NetrwMarkFileCopy(islocal,...)
if exists("*mkdir")
call mkdir(tmpdir)
else
- exe "sil! !".g:netrw_localmkdir.' '.shellescape(tmpdir,1)
+ call s:NetrwExe("sil! !".g:netrw_localmkdir.' '.shellescape(tmpdir,1))
if v:shell_error != 0
call netrw#ErrorMsg(s:WARNING,"consider setting g:netrw_localmkdir<".g:netrw_localmkdir."> to something that works",80)
" call Dret("s:NetrwMarkFileCopy : failed: sil! !".g:netrw_localmkdir.' '.shellescape(tmpdir,1) )
@@ -6149,15 +6583,15 @@ fun! s:NetrwMarkFileCopy(islocal,...)
endif
if isdirectory(tmpdir)
call s:NetrwLcd(tmpdir)
- keepj call netrw#Obtain(a:islocal,s:netrwmarkfilelist_{bufnr('%')},tmpdir)
+ NetrwKeepj call netrw#Obtain(a:islocal,s:netrwmarkfilelist_{bufnr('%')},tmpdir)
let localfiles= map(deepcopy(s:netrwmarkfilelist_{bufnr('%')}),'substitute(v:val,"^.*/","","")')
- keepj call s:NetrwUpload(localfiles,s:netrwmftgt)
+ NetrwKeepj call s:NetrwUpload(localfiles,s:netrwmftgt)
if getcwd() == tmpdir
for fname in s:netrwmarkfilelist_{bufnr('%')}
- keepj call s:NetrwDelete(fname)
+ NetrwKeepj call s:NetrwDelete(fname)
endfor
call s:NetrwLcd(curdir)
- exe "sil !".g:netrw_localrmdir." ".shellescape(tmpdir,1)
+ call s:NetrwExe("sil !".g:netrw_localrmdir." ".shellescape(tmpdir,1))
if v:shell_error != 0
call netrw#ErrorMsg(s:WARNING,"consider setting g:netrw_localrmdir<".g:netrw_localrmdir."> to something that works",80)
" call Dret("s:NetrwMarkFileCopy : failed: sil !".g:netrw_localrmdir." ".shellescape(tmpdir,1) )
@@ -6183,10 +6617,10 @@ fun! s:NetrwMarkFileCopy(islocal,...)
call s:NetrwRefreshDir(s:netrwmftgt_islocal,s:netrwmftgt)
endif
if a:islocal
- keepj call s:NetrwRefreshDir(a:islocal,curdir)
+ NetrwKeepj call s:NetrwRefreshDir(a:islocal,curdir)
endif
if g:netrw_fastbrowse <= 1
- keepj call s:LocalBrowseRefresh()
+ NetrwKeepj call s:LocalBrowseRefresh()
endif
" call Dret("s:NetrwMarkFileCopy 1")
@@ -6204,7 +6638,7 @@ fun! s:NetrwMarkFileDiff(islocal)
" sanity check
if !exists("s:netrwmarkfilelist_{curbufnr}") || empty(s:netrwmarkfilelist_{curbufnr})
- keepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
+ NetrwKeepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
" call Dret("s:NetrwMarkFileDiff")
return
endif
@@ -6217,13 +6651,13 @@ fun! s:NetrwMarkFileDiff(islocal)
let cnt= cnt + 1
if cnt == 1
" call Decho("diffthis: fname<".fname.">")
- exe "e ".fnameescape(fname)
+ exe "NetrwKeepj e ".fnameescape(fname)
diffthis
elseif cnt == 2 || cnt == 3
vsplit
wincmd l
" call Decho("diffthis: ".fname)
- exe "e ".fnameescape(fname)
+ exe "NetrwKeepj e ".fnameescape(fname)
diffthis
else
break
@@ -6246,7 +6680,7 @@ fun! s:NetrwMarkFileEdit(islocal)
" sanity check
if !exists("s:netrwmarkfilelist_{curbufnr}") || empty(s:netrwmarkfilelist_{curbufnr})
- keepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
+ NetrwKeepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
" call Dret("s:NetrwMarkFileEdit")
return
endif
@@ -6298,72 +6732,106 @@ fun! s:NetrwMarkFileQFEL(islocal,qfel)
endfun
" ---------------------------------------------------------------------
-" s:NetrwMarkFileExe: (invoked by mx) execute arbitrary system command on marked files, one at a time {{{2
-" Uses the local marked-file list.
-fun! s:NetrwMarkFileExe(islocal)
-" call Dfunc("s:NetrwMarkFileExe(islocal=".a:islocal.")")
+" s:NetrwMarkFileExe: (invoked by mx and mX) execute arbitrary system command on marked files {{{2
+" mx enbloc=0: Uses the local marked-file list, applies command to each file individually
+" mX enbloc=1: Uses the global marked-file list, applies command to entire list
+fun! s:NetrwMarkFileExe(islocal,enbloc)
+" call Dfunc("s:NetrwMarkFileExe(islocal=".a:islocal.",enbloc=".a:enbloc.")")
let svpos = netrw#SavePosn()
let curdir = b:netrw_curdir
let curbufnr = bufnr("%")
- " sanity check
- if !exists("s:netrwmarkfilelist_{curbufnr}") || empty(s:netrwmarkfilelist_{curbufnr})
- keepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
-" call Dret("s:NetrwMarkFileExe")
- return
- endif
-" call Decho("sanity chk passed: s:netrwmarkfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}))
-
- if exists("s:netrwmarkfilelist_{curbufnr}")
- " get the command
- call inputsave()
- let cmd= input("Enter command: ","","file")
- call inputrestore()
-" call Decho("cmd<".cmd.">")
- if cmd == ""
-" " call Dret("s:NetrwMarkFileExe : early exit, empty command")
- return
- endif
+ if a:enbloc == 0
+ " individually apply command to files, one at a time
+ " sanity check
+ if !exists("s:netrwmarkfilelist_{curbufnr}") || empty(s:netrwmarkfilelist_{curbufnr})
+ NetrwKeepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
+" call Dret("s:NetrwMarkFileExe")
+ return
+ endif
+" call Decho("sanity chk passed: s:netrwmarkfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}))
- " apply command to marked files. Substitute: filename -> %
- " If no %, then append a space and the filename to the command
- for fname in s:netrwmarkfilelist_{curbufnr}
- if a:islocal
- if g:netrw_keepdir
- let fname= shellescape(netrw#WinPath(s:ComposePath(curdir,fname)))
+ if exists("s:netrwmarkfilelist_{curbufnr}")
+ " get the command
+ call inputsave()
+ let cmd= input("Enter command: ","","file")
+ call inputrestore()
+" call Decho("cmd<".cmd.">")
+ if cmd == ""
+" call Dret("s:NetrwMarkFileExe : early exit, empty command")
+ return
endif
- else
- let fname= shellescape(netrw#WinPath(b:netrw_curdir.fname))
- endif
- if cmd =~ '%'
- let xcmd= substitute(cmd,'%',fname,'g')
- else
- let xcmd= cmd.' '.fname
- endif
- if a:islocal
-" call Decho("local: xcmd<".xcmd.">")
- let ret= system(xcmd)
- else
-" call Decho("remote: xcmd<".xcmd.">")
- let ret= s:RemoteSystem(xcmd)
- endif
- if v:shell_error < 0
- keepj call netrw#ErrorMsg(s:ERROR,"command<".xcmd."> failed, aborting",54)
- break
- else
- echo ret
- endif
- endfor
+
+ " apply command to marked files, individually. Substitute: filename -> %
+ " If no %, then append a space and the filename to the command
+ for fname in s:netrwmarkfilelist_{curbufnr}
+ if a:islocal
+ if g:netrw_keepdir
+ let fname= shellescape(netrw#WinPath(s:ComposePath(curdir,fname)))
+ endif
+ else
+ let fname= shellescape(netrw#WinPath(b:netrw_curdir.fname))
+ endif
+ if cmd =~ '%'
+ let xcmd= substitute(cmd,'%',fname,'g')
+ else
+ let xcmd= cmd.' '.fname
+ endif
+ if a:islocal
+" call Decho("local: xcmd<".xcmd.">")
+ let ret= system(xcmd)
+ else
+" call Decho("remote: xcmd<".xcmd.">")
+ let ret= s:RemoteSystem(xcmd)
+ endif
+ if v:shell_error < 0
+ NetrwKeepj call netrw#ErrorMsg(s:ERROR,"command<".xcmd."> failed, aborting",54)
+ break
+ else
+ echo ret
+ endif
+ endfor
" unmark marked file list
call s:NetrwUnmarkList(curbufnr,curdir)
" refresh the listing
- keepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
- keepj call netrw#RestorePosn(svpos)
+ NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+ NetrwKeepj call netrw#RestorePosn(svpos)
else
- keepj call netrw#ErrorMsg(s:ERROR,"no files marked!",59)
+ NetrwKeepj call netrw#ErrorMsg(s:ERROR,"no files marked!",59)
endif
+
+ else " apply command to global list of files, en bloc
+
+ call inputsave()
+ let cmd= input("Enter command: ","","file")
+ call inputrestore()
+" call Decho("cmd<".cmd.">")
+ if cmd == ""
+" call Dret("s:NetrwMarkFileExe : early exit, empty command")
+ return
+ endif
+ if cmd =~ '%'
+ let cmd= substitute(cmd,'%',join(map(s:netrwmarkfilelist,'shellescape(v:val)'),' '),'g')
+ else
+ let cmd= cmd.' '.join(map(s:netrwmarkfilelist,'shellescape(v:val)'),' ')
+ endif
+ if a:islocal
+ call system(cmd)
+ if v:shell_error < 0
+ NetrwKeepj call netrw#ErrorMsg(s:ERROR,"command<".xcmd."> failed, aborting",54)
+ endif
+ else
+ let ret= s:RemoteSystem(cmd)
+ endif
+ call s:NetrwUnmarkAll()
+
+ " refresh the listing
+ NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+ NetrwKeepj call netrw#RestorePosn(svpos)
+
+ endif
" call Dret("s:NetrwMarkFileExe")
endfun
@@ -6416,17 +6884,17 @@ fun! s:NetrwMarkHideSfx(islocal)
endfor
" refresh the listing
- keepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
- keepj call netrw#RestorePosn(svpos)
+ NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+ NetrwKeepj call netrw#RestorePosn(svpos)
else
- keepj call netrw#ErrorMsg(s:ERROR,"no files marked!",59)
+ NetrwKeepj call netrw#ErrorMsg(s:ERROR,"no files marked!",59)
endif
" call Dret("s:NetrwMarkHideSfx")
endfun
" ---------------------------------------------------------------------
-" s:NetrwMarkFileVimCmd: (invoked by mX) execute arbitrary vim command on marked files, one at a time {{{2
+" s:NetrwMarkFileVimCmd: (invoked by mv) execute arbitrary vim command on marked files, one at a time {{{2
" Uses the local marked-file list.
fun! s:NetrwMarkFileVimCmd(islocal)
" call Dfunc("s:NetrwMarkFileVimCmd(islocal=".a:islocal.")")
@@ -6436,7 +6904,7 @@ fun! s:NetrwMarkFileVimCmd(islocal)
" sanity check
if !exists("s:netrwmarkfilelist_{curbufnr}") || empty(s:netrwmarkfilelist_{curbufnr})
- keepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
+ NetrwKeepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
" call Dret("s:NetrwMarkFileVimCmd")
return
endif
@@ -6459,13 +6927,13 @@ fun! s:NetrwMarkFileVimCmd(islocal)
" call Decho("fname<".fname.">")
if a:islocal
1split
- exe "sil! keepalt e ".fnameescape(fname)
+ exe "sil! NetrwKeepj keepalt e ".fnameescape(fname)
" call Decho("local<".fname.">: exe ".cmd)
exe cmd
exe "sil! keepalt wq!"
else
" call Decho("remote<".fname.">: exe ".cmd." : NOT SUPPORTED YET")
- echo "sorry, \"mX\" not supported yet for remote files"
+ echo "sorry, \"mv\" not supported yet for remote files"
endif
endfor
@@ -6473,10 +6941,10 @@ fun! s:NetrwMarkFileVimCmd(islocal)
call s:NetrwUnmarkList(curbufnr,curdir)
" refresh the listing
- keepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
- keepj call netrw#RestorePosn(svpos)
+ NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+ NetrwKeepj call netrw#RestorePosn(svpos)
else
- keepj call netrw#ErrorMsg(s:ERROR,"no files marked!",59)
+ NetrwKeepj call netrw#ErrorMsg(s:ERROR,"no files marked!",59)
endif
" call Dret("s:NetrwMarkFileVimCmd")
@@ -6530,10 +6998,10 @@ fun! s:NetrwMarkHideSfx(islocal)
endfor
" refresh the listing
- keepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
- keepj call netrw#RestorePosn(svpos)
+ NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+ NetrwKeepj call netrw#RestorePosn(svpos)
else
- keepj call netrw#ErrorMsg(s:ERROR,"no files marked!",59)
+ NetrwKeepj call netrw#ErrorMsg(s:ERROR,"no files marked!",59)
endif
" call Dret("s:NetrwMarkHideSfx")
@@ -6575,16 +7043,16 @@ fun! s:NetrwMarkFileGrep(islocal)
" use vimgrep for both local and remote
" call Decho("exe vimgrep".patbang." ".pat." ".netrwmarkfilelist)
try
- exe "keepj noautocmd vimgrep".patbang." ".pat." ".netrwmarkfilelist
+ exe "NetrwKeepj noautocmd vimgrep".patbang." ".pat." ".netrwmarkfilelist
catch /^Vim\%((\a\+)\)\=:E480/
- keepj call netrw#ErrorMsg(s:WARNING,"no match with pattern<".pat.">",76)
+ NetrwKeepj call netrw#ErrorMsg(s:WARNING,"no match with pattern<".pat.">",76)
" call Dret("s:NetrwMarkFileGrep : unable to find pattern<".pat.">")
return
endtry
echo "(use :cn, :cp to navigate, :Rex to return)"
2match none
- keepj call netrw#RestorePosn(svpos)
+ NetrwKeepj call netrw#RestorePosn(svpos)
if exists("nonisi")
" original, user-supplied pattern did not begin with a character from isident
@@ -6609,14 +7077,14 @@ fun! s:NetrwMarkFileMove(islocal)
" sanity check
if !exists("s:netrwmarkfilelist_{curbufnr}") || empty(s:netrwmarkfilelist_{curbufnr})
- keepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
+ NetrwKeepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
" call Dret("s:NetrwMarkFileMove")
return
endif
" call Decho("sanity chk passed: s:netrwmarkfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}))
if !exists("s:netrwmftgt")
- keepj call netrw#ErrorMsg(2,"your marked file target is empty! (:help netrw-mt)",67)
+ NetrwKeepj call netrw#ErrorMsg(2,"your marked file target is empty! (:help netrw-mt)",67)
" call Dret("s:NetrwMarkFileCopy 0")
return 0
endif
@@ -6666,7 +7134,7 @@ fun! s:NetrwMarkFileMove(islocal)
" call Decho("move from local to remote")
" call Decho("copy")
let mflist= s:netrwmarkfilelist_{bufnr("%")}
- keepj call s:NetrwMarkFileCopy(a:islocal)
+ NetrwKeepj call s:NetrwMarkFileCopy(a:islocal)
" call Decho("remove")
for fname in mflist
let barefname = substitute(fname,'^\(.*/\)\(.\{-}\)$','\2','')
@@ -6679,7 +7147,7 @@ fun! s:NetrwMarkFileMove(islocal)
" call Decho("move from remote to local")
" call Decho("copy")
let mflist= s:netrwmarkfilelist_{bufnr("%")}
- keepj call s:NetrwMarkFileCopy(a:islocal)
+ NetrwKeepj call s:NetrwMarkFileCopy(a:islocal)
" call Decho("remove")
for fname in mflist
let barefname = substitute(fname,'^\(.*/\)\(.\{-}\)$','\2','')
@@ -6692,7 +7160,7 @@ fun! s:NetrwMarkFileMove(islocal)
" call Decho("move from remote to remote")
" call Decho("copy")
let mflist= s:netrwmarkfilelist_{bufnr("%")}
- keepj call s:NetrwMarkFileCopy(a:islocal)
+ NetrwKeepj call s:NetrwMarkFileCopy(a:islocal)
" call Decho("remove")
for fname in mflist
let barefname = substitute(fname,'^\(.*/\)\(.\{-}\)$','\2','')
@@ -6712,15 +7180,15 @@ fun! s:NetrwMarkFileMove(islocal)
" refresh buffers
if !s:netrwmftgt_islocal
" call Decho("refresh netrwmftgt<".s:netrwmftgt.">")
- keepj call s:NetrwRefreshDir(s:netrwmftgt_islocal,s:netrwmftgt)
+ NetrwKeepj call s:NetrwRefreshDir(s:netrwmftgt_islocal,s:netrwmftgt)
endif
if a:islocal
" call Decho("refresh b:netrw_curdir<".b:netrw_curdir.">")
- keepj call s:NetrwRefreshDir(a:islocal,b:netrw_curdir)
+ NetrwKeepj call s:NetrwRefreshDir(a:islocal,b:netrw_curdir)
endif
if g:netrw_fastbrowse <= 1
" call Decho("since g:netrw_fastbrowse=".g:netrw_fastbrowse.", perform shell cmd refresh")
- keepj call s:LocalBrowseRefresh()
+ NetrwKeepj call s:LocalBrowseRefresh()
endif
" call Dret("s:NetrwMarkFileMove")
@@ -6735,7 +7203,7 @@ fun! s:NetrwMarkFilePrint(islocal)
" sanity check
if !exists("s:netrwmarkfilelist_{curbufnr}") || empty(s:netrwmarkfilelist_{curbufnr})
- keepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
+ NetrwKeepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
" call Dret("s:NetrwMarkFilePrint")
return
endif
@@ -6755,7 +7223,7 @@ fun! s:NetrwMarkFilePrint(islocal)
1split
" the autocmds will handle both local and remote files
" call Decho("exe sil e ".escape(fname,' '))
- exe "sil e ".fnameescape(fname)
+ exe "sil NetrwKeepj e ".fnameescape(fname)
" call Decho("hardcopy")
hardcopy
q
@@ -6788,7 +7256,7 @@ fun! s:NetrwMarkFileRegexp(islocal)
" mark the list of files
for fname in filelist
" call Decho("fname<".fname.">")
- keepj call s:NetrwMarkFile(a:islocal,substitute(fname,'^.*/','',''))
+ NetrwKeepj call s:NetrwMarkFile(a:islocal,substitute(fname,'^.*/','',''))
endfor
else
@@ -6797,38 +7265,38 @@ fun! s:NetrwMarkFileRegexp(islocal)
" convert displayed listing into a filelist
let eikeep = &ei
let areg = @a
- sil keepj %y a
+ sil NetrwKeepj %y a
setl ei=all ma
" call Decho("setl ei=all ma")
1split
- keepj call s:NetrwEnew()
- keepj call s:NetrwSafeOptions()
- sil keepj norm! "ap
- keepj 2
+ NetrwKeepj call s:NetrwEnew()
+ NetrwKeepj call s:NetrwSafeOptions()
+ sil NetrwKeepj norm! "ap
+ NetrwKeepj 2
let bannercnt= search('^" =====','W')
- exe "sil keepj 1,".bannercnt."d"
+ exe "sil NetrwKeepj 1,".bannercnt."d"
setl bt=nofile
if g:netrw_liststyle == s:LONGLIST
- sil keepj %s/\s\{2,}\S.*$//e
+ sil NetrwKeepj %s/\s\{2,}\S.*$//e
call histdel("/",-1)
elseif g:netrw_liststyle == s:WIDELIST
- sil keepj %s/\s\{2,}/\r/ge
+ sil NetrwKeepj %s/\s\{2,}/\r/ge
call histdel("/",-1)
elseif g:netrw_liststyle == s:TREELIST
- exe 'sil keepj %s/^'.s:treedepthstring.' //e'
- sil! keepj g/^ .*$/d
+ exe 'sil NetrwKeepj %s/^'.s:treedepthstring.' //e'
+ sil! NetrwKeepj g/^ .*$/d
call histdel("/",-1)
call histdel("/",-1)
endif
" convert regexp into the more usual glob-style format
let regexp= substitute(regexp,'\*','.*','g')
" call Decho("regexp<".regexp.">")
- exe "sil! keepj v/".escape(regexp,'/')."/d"
+ exe "sil! NetrwKeepj v/".escape(regexp,'/')."/d"
call histdel("/",-1)
let filelist= getline(1,line("$"))
q!
for filename in filelist
- keepj call s:NetrwMarkFile(a:islocal,substitute(filename,'^.*/','',''))
+ NetrwKeepj call s:NetrwMarkFile(a:islocal,substitute(filename,'^.*/','',''))
endfor
unlet filelist
let @a = areg
@@ -6848,7 +7316,7 @@ fun! s:NetrwMarkFileSource(islocal)
" sanity check
if !exists("s:netrwmarkfilelist_{curbufnr}") || empty(s:netrwmarkfilelist_{curbufnr})
- keepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
+ NetrwKeepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
" call Dret("s:NetrwMarkFileSource")
return
endif
@@ -6885,7 +7353,7 @@ fun! s:NetrwMarkFileTag(islocal)
" sanity check
if !exists("s:netrwmarkfilelist_{curbufnr}") || empty(s:netrwmarkfilelist_{curbufnr})
- keepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
+ NetrwKeepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
" call Dret("s:NetrwMarkFileTag")
return
endif
@@ -6908,10 +7376,10 @@ fun! s:NetrwMarkFileTag(islocal)
call netrw#Obtain(a:islocal,"tags")
let curdir= b:netrw_curdir
1split
- e tags
+ NetrwKeepj e tags
let path= substitute(curdir,'^\(.*\)/[^/]*$','\1/','')
" call Decho("curdir<".curdir."> path<".path.">")
- exe 'keepj %s/\t\(\S\+\)\t/\t'.escape(path,"/\n\r\\").'\1\t/e'
+ exe 'NetrwKeepj %s/\t\(\S\+\)\t/\t'.escape(path,"/\n\r\\").'\1\t/e'
call histdel("/",-1)
wq!
endif
@@ -6990,7 +7458,7 @@ fun! s:NetrwMarkFileTgt(islocal)
call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
call netrw#RestorePosn(svpos)
if !hadtgt
- sil! keepj norm! j
+ sil! NetrwKeepj norm! j
endif
" call Dret("s:NetrwMarkFileTgt : netrwmftgt<".(exists("s:netrwmftgt")? s:netrwmftgt : "").">")
@@ -7011,7 +7479,7 @@ fun! s:NetrwOpenFile(islocal)
endif
let g:netrw_quiet = 1
if b:netrw_curdir =~ '/$'
- exe "e ".fnameescape(b:netrw_curdir.fname)
+ exe "NetrwKeepj e ".fnameescape(b:netrw_curdir.fname)
else
exe "e ".fnameescape(b:netrw_curdir."/".fname)
endif
@@ -7022,7 +7490,7 @@ fun! s:NetrwOpenFile(islocal)
endif
endif
else
- exe "e ".fnameescape(fname)
+ exe "NetrwKeepj e ".fnameescape(fname)
endif
let @@= ykeep
" call Dret("s:NetrwOpenFile")
@@ -7149,6 +7617,7 @@ fun! s:NetrwMenu(domenu)
exe 'sil! menu '.g:NetrwMenuPriority.'.11.2 '.g:NetrwTopLvlMenu.'Edit\ File/Dir.Preview\ File/Directory<tab>p p'
exe 'sil! menu '.g:NetrwMenuPriority.'.11.3 '.g:NetrwTopLvlMenu.'Edit\ File/Dir.In\ Previous\ Window<tab>P P'
exe 'sil! menu '.g:NetrwMenuPriority.'.11.4 '.g:NetrwTopLvlMenu.'Edit\ File/Dir.In\ New\ Window<tab>o o'
+ exe 'sil! menu '.g:NetrwMenuPriority.'.11.5 '.g:NetrwTopLvlMenu.'Edit\ File/Dir.In\ New\ Tab<tab>t t'
exe 'sil! menu '.g:NetrwMenuPriority.'.11.5 '.g:NetrwTopLvlMenu.'Edit\ File/Dir.In\ New\ Vertical\ Window<tab>v v'
exe 'sil! menu '.g:NetrwMenuPriority.'.12.1 '.g:NetrwTopLvlMenu.'Explore.Directory\ Name :Explore '
exe 'sil! menu '.g:NetrwMenuPriority.'.12.2 '.g:NetrwTopLvlMenu.'Explore.Filenames\ Matching\ Pattern\ (curdir\ only)<tab>:Explore\ */ :Explore */'
@@ -7249,7 +7718,7 @@ fun! s:NetrwPrevWinOpen(islocal)
let lastwinnr = winnr("$")
let curword = s:NetrwGetWord()
let choice = 0
- let s:treedir = s:NetrwTreeDir()
+ let s:treedir = s:NetrwTreeDir(a:islocal)
let curdir = s:treedir
" call Decho("winnr($)#".lastwinnr." curword<".curword.">")
@@ -7258,10 +7727,12 @@ fun! s:NetrwPrevWinOpen(islocal)
" if only one window, open a new one first
" call Decho("only one window, so open a new one (g:netrw_alto=".g:netrw_alto.")")
if g:netrw_preview
+ " vertically split preview window
let winsz= (g:netrw_winsize > 0)? (g:netrw_winsize*winheight(0))/100 : -g:netrw_winsize
" call Decho("exe ".(g:netrw_alto? "top " : "bot ")."vert ".winsz."wincmd s")
exe (g:netrw_alto? "top " : "bot ")."vert ".winsz."wincmd s"
else
+ " horizontally split preview window
let winsz= (g:netrw_winsize > 0)? (g:netrw_winsize*winwidth(0))/100 : -g:netrw_winsize
" call Decho("exe ".(g:netrw_alto? "bel " : "abo ").winsz."wincmd s")
exe (g:netrw_alto? "bel " : "abo ").winsz."wincmd s"
@@ -7270,7 +7741,7 @@ fun! s:NetrwPrevWinOpen(islocal)
" call Decho("did split")
else
- keepj call s:SaveBufVars()
+ NetrwKeepj call s:SaveBufVars()
let eikeep= &ei
setl ei=all
wincmd p
@@ -7284,7 +7755,7 @@ fun! s:NetrwPrevWinOpen(islocal)
let prevbufname = bufname("%")
let prevmod = &mod
let bnrcnt = 0
- keepj call s:RestoreBufVars()
+ NetrwKeepj call s:RestoreBufVars()
" call Decho("after wincmd p: win#".winnr()." win($)#".winnr("$")." origwin#".origwin." &mod=".&mod." bufname(%)<".bufname("%")."> prevbufnr=".prevbufnr)
" if the previous window's buffer has been changed (ie. its modified flag is set),
@@ -7376,7 +7847,7 @@ fun! s:NetrwUpload(fname,tgt,...)
" call Decho("handle uploading a single file via NetWrite")
1split
" call Decho("exe e ".fnameescape(a:fname))
- exe "e ".fnameescape(a:fname)
+ exe "NetrwKeepj e ".fnameescape(a:fname)
" call Decho("now locally editing<".expand("%").">, has ".line("$")." lines")
if a:tgt =~ '/$'
let wfname= substitute(a:fname,'^.*/','','')
@@ -7404,8 +7875,7 @@ fun! s:NetrwUpload(fname,tgt,...)
endif
let machine = substitute(a:tgt,'^scp://\([^/:]\+\).*$','\1','')
let tgt = substitute(a:tgt,'^scp://[^/]\+/\(.*\)$','\1','')
-" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_scp_cmd.shellescape(useport,1)." ".args." ".shellescape(machine.":".tgt,1))
- exe s:netrw_silentxfer."!".g:netrw_scp_cmd.shellescape(useport,1)." ".args." ".shellescape(machine.":".tgt,1)
+ call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_scp_cmd.shellescape(useport,1)." ".args." ".shellescape(machine.":".tgt,1))
call s:NetrwLcd(curdir)
elseif a:tgt =~ '^ftp:'
@@ -7414,41 +7884,39 @@ fun! s:NetrwUpload(fname,tgt,...)
if b:netrw_method == 2
" handle uploading a list of files via ftp+.netrc
let netrw_fname = b:netrw_fname
- sil keepj new
+ sil NetrwKeepj new
" call Decho("filter input window#".winnr())
- keepj put =g:netrw_ftpmode
+ NetrwKeepj put =g:netrw_ftpmode
" call Decho("filter input: ".getline('$'))
if exists("g:netrw_ftpextracmd")
- keepj put =g:netrw_ftpextracmd
+ NetrwKeepj put =g:netrw_ftpextracmd
" call Decho("filter input: ".getline('$'))
endif
- keepj call setline(line("$")+1,'lcd "'.fromdir.'"')
+ NetrwKeepj call setline(line("$")+1,'lcd "'.fromdir.'"')
" call Decho("filter input: ".getline('$'))
if tgtdir == ""
let tgtdir= '/'
endif
- keepj call setline(line("$")+1,'cd "'.tgtdir.'"')
+ NetrwKeepj call setline(line("$")+1,'cd "'.tgtdir.'"')
" call Decho("filter input: ".getline('$'))
for fname in a:fname
- keepj call setline(line("$")+1,'put "'.fname.'"')
+ NetrwKeepj call setline(line("$")+1,'put "'.fname.'"')
" call Decho("filter input: ".getline('$'))
endfor
if exists("g:netrw_port") && g:netrw_port != ""
-" call Decho("executing: ".s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1))
- exe s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1)
+ call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1))
else
" call Decho("filter input window#".winnr())
-" call Decho("executing: ".s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1))
- exe s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)
+ call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1))
endif
" If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
- sil keepj g/Local directory now/d
+ sil NetrwKeepj g/Local directory now/d
call histdel("/",-1)
if getline(1) !~ "^$" && !exists("g:netrw_quiet") && getline(1) !~ '^Trying '
call netrw#ErrorMsg(s:ERROR,getline(1),14)
@@ -7459,47 +7927,47 @@ fun! s:NetrwUpload(fname,tgt,...)
elseif b:netrw_method == 3
" upload with ftp + machine, id, passwd, and fname (ie. no .netrc)
let netrw_fname= b:netrw_fname
- keepj call s:SaveBufVars()|sil keepj new|keepj call s:RestoreBufVars()
+ NetrwKeepj call s:SaveBufVars()|sil NetrwKeepj new|NetrwKeepj call s:RestoreBufVars()
let tmpbufnr= bufnr("%")
setl ff=unix
if exists("g:netrw_port") && g:netrw_port != ""
- keepj put ='open '.g:netrw_machine.' '.g:netrw_port
+ NetrwKeepj put ='open '.g:netrw_machine.' '.g:netrw_port
" call Decho("filter input: ".getline('$'))
else
- keepj put ='open '.g:netrw_machine
+ NetrwKeepj put ='open '.g:netrw_machine
" call Decho("filter input: ".getline('$'))
endif
if exists("g:netrw_uid") && g:netrw_uid != ""
if exists("g:netrw_ftp") && g:netrw_ftp == 1
- keepj put =g:netrw_uid
+ NetrwKeepj put =g:netrw_uid
" call Decho("filter input: ".getline('$'))
if exists("s:netrw_passwd")
- keepj call setline(line("$")+1,'"'.s:netrw_passwd.'"')
+ NetrwKeepj call setline(line("$")+1,'"'.s:netrw_passwd.'"')
endif
" call Decho("filter input: ".getline('$'))
elseif exists("s:netrw_passwd")
- keepj put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"'
+ NetrwKeepj put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"'
" call Decho("filter input: ".getline('$'))
endif
endif
- keepj call setline(line("$")+1,'lcd "'.fromdir.'"')
+ NetrwKeepj call setline(line("$")+1,'lcd "'.fromdir.'"')
" call Decho("filter input: ".getline('$'))
if exists("b:netrw_fname") && b:netrw_fname != ""
- keepj call setline(line("$")+1,'cd "'.b:netrw_fname.'"')
+ NetrwKeepj call setline(line("$")+1,'cd "'.b:netrw_fname.'"')
" call Decho("filter input: ".getline('$'))
endif
if exists("g:netrw_ftpextracmd")
- keepj put =g:netrw_ftpextracmd
+ NetrwKeepj put =g:netrw_ftpextracmd
" call Decho("filter input: ".getline('$'))
endif
for fname in a:fname
- keepj call setline(line("$")+1,'put "'.fname.'"')
+ NetrwKeepj call setline(line("$")+1,'put "'.fname.'"')
" call Decho("filter input: ".getline('$'))
endfor
@@ -7507,11 +7975,10 @@ fun! s:NetrwUpload(fname,tgt,...)
" -i : turns off interactive prompting from ftp
" -n unix : DON'T use <.netrc>, even though it exists
" -n win32: quit being obnoxious about password
- keepj norm! 1Gdd
-" call Decho("executing: ".s:netrw_silentxfer."%!".s:netrw_ftp_cmd." ".g:netrw_ftp_options)
- exe s:netrw_silentxfer."%!".s:netrw_ftp_cmd." ".g:netrw_ftp_options
+ NetrwKeepj norm! 1Gdd
+ call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." ".g:netrw_ftp_options)
" If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
- sil keepj g/Local directory now/d
+ sil NetrwKeepj g/Local directory now/d
call histdel("/",-1)
if getline(1) !~ "^$" && !exists("g:netrw_quiet") && getline(1) !~ '^Trying '
let debugkeep= &debug
@@ -7539,8 +8006,8 @@ endfun
fun! s:NetrwPreview(path) range
" call Dfunc("NetrwPreview(path<".a:path.">)")
let ykeep= @@
- keepj call s:NetrwOptionSave("s:")
- keepj call s:NetrwSafeOptions()
+ NetrwKeepj call s:NetrwOptionSave("s:")
+ NetrwKeepj call s:NetrwSafeOptions()
if has("quickfix")
if !isdirectory(a:path)
if g:netrw_preview && !g:netrw_alto
@@ -7553,12 +8020,12 @@ fun! s:NetrwPreview(path) range
let &pvh= pvhkeep
endif
elseif !exists("g:netrw_quiet")
- keepj call netrw#ErrorMsg(s:WARNING,"sorry, cannot preview a directory such as <".a:path.">",38)
+ NetrwKeepj call netrw#ErrorMsg(s:WARNING,"sorry, cannot preview a directory such as <".a:path.">",38)
endif
elseif !exists("g:netrw_quiet")
- keepj call netrw#ErrorMsg(s:WARNING,"sorry, to preview your vim needs the quickfix feature compiled in",39)
+ NetrwKeepj call netrw#ErrorMsg(s:WARNING,"sorry, to preview your vim needs the quickfix feature compiled in",39)
endif
- keepj call s:NetrwOptionRestore("s:")
+ NetrwKeepj call s:NetrwOptionRestore("s:")
let @@= ykeep
" call Dret("NetrwPreview")
endfun
@@ -7566,7 +8033,7 @@ endfun
" ---------------------------------------------------------------------
" s:NetrwRefresh: {{{2
fun! s:NetrwRefresh(islocal,dirname)
-" call Dfunc("NetrwRefresh(islocal<".a:islocal.">,dirname=".a:dirname.") hide=".g:netrw_hide." sortdir=".g:netrw_sort_direction)
+" call Dfunc("s:NetrwRefresh(islocal<".a:islocal.">,dirname=".a:dirname.") hide=".g:netrw_hide." sortdir=".g:netrw_sort_direction)
" at the current time (Mar 19, 2007) all calls to NetrwRefresh() call NetrwBrowseChgDir() first.
setl ma noro
" call Decho("setl ma noro")
@@ -7577,15 +8044,15 @@ fun! s:NetrwRefresh(islocal,dirname)
let screenposn = netrw#SavePosn()
" call Decho("win#".winnr().": ".winheight(0)."x".winwidth(0)." curfile<".expand("%").">")
" call Decho("clearing buffer prior to refresh")
- sil! keepj %d
+ sil! NetrwKeepj %d
if a:islocal
- keepj call netrw#LocalBrowseCheck(a:dirname)
+ NetrwKeepj call netrw#LocalBrowseCheck(a:dirname)
else
- keepj call s:NetrwBrowse(a:islocal,a:dirname)
+ NetrwKeepj call s:NetrwBrowse(a:islocal,a:dirname)
endif
" restore position
- keepj call netrw#RestorePosn(screenposn)
+ NetrwKeepj call netrw#RestorePosn(screenposn)
" restore file marks
if exists("s:netrwmarkfilemtch_{bufnr('%')}") && s:netrwmarkfilemtch_{bufnr("%")} != ""
@@ -7598,7 +8065,7 @@ fun! s:NetrwRefresh(islocal,dirname)
" restore
let @@= ykeep
-" call Dret("NetrwRefresh")
+" call Dret("s:NetrwRefresh")
endfun
" ---------------------------------------------------------------------
@@ -7618,7 +8085,7 @@ fun! s:NetrwRefreshDir(islocal,dirname)
let curwin= winnr()
" call Decho("refresh tgtwin#".tgtwin." (curwin#".curwin.")")
exe tgtwin."wincmd w"
- keepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+ NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
exe curwin."wincmd w"
elseif bufnr(a:dirname) > 0
@@ -7629,7 +8096,7 @@ fun! s:NetrwRefreshDir(islocal,dirname)
elseif g:netrw_fastbrowse <= 1
" call Decho("medium-speed mode: refresh local buffers only")
- keepj call s:LocalBrowseRefresh()
+ NetrwKeepj call s:LocalBrowseRefresh()
endif
" call Dret("s:NetrwRefreshDir")
endfun
@@ -7639,14 +8106,21 @@ endfun
" window number to do its editing in.
" Supports [count]C where the count, if present, is used to specify
" a window to use for editing via the <cr> mapping.
-fun! s:NetrwSetChgwin()
+fun! s:NetrwSetChgwin(...)
" call Dfunc("s:NetrwSetChgwin() v:count=".v:count)
- if v:count > 0
+ if a:0 > 0
+" call Decho("a:1<".a:1.">")
+ if a:1 == "" " :NetrwC win#
+ let g:netrw_chgwin= winnr()
+ else " :NetrwC
+ let g:netrw_chgwin= a:1
+ endif
+ elseif v:count > 0 " [count]C
let g:netrw_chgwin= v:count
- else
+ else " C
let g:netrw_chgwin= winnr()
endif
-" call Dret("s:NetrwSetChgwin")
+" call Dret("s:NetrwSetChgwin : g:netrw_chgwin=".g:netrw_chgwin)
endfun
" ---------------------------------------------------------------------
@@ -7696,18 +8170,18 @@ fun! s:NetrwSetSort()
if seq == '*'
let starpriority= spriority
else
- exe 'sil keepj '.w:netrw_bannercnt.',$g/'.seq.'/s/^/'.spriority.'/'
+ exe 'sil NetrwKeepj '.w:netrw_bannercnt.',$g/'.seq.'/s/^/'.spriority.'/'
call histdel("/",-1)
" sometimes multiple sorting patterns will match the same file or directory.
" The following substitute is intended to remove the excess matches.
- exe 'sil keepj '.w:netrw_bannercnt.',$g/^\d\{3}'.g:netrw_sepchr.'\d\{3}\//s/^\d\{3}'.g:netrw_sepchr.'\(\d\{3}\/\).\@=/\1/e'
- keepj call histdel("/",-1)
+ exe 'sil NetrwKeepj '.w:netrw_bannercnt.',$g/^\d\{3}'.g:netrw_sepchr.'\d\{3}\//s/^\d\{3}'.g:netrw_sepchr.'\(\d\{3}\/\).\@=/\1/e'
+ NetrwKeepj call histdel("/",-1)
endif
let priority = priority + 1
endwhile
if exists("starpriority")
- exe 'sil keepj '.w:netrw_bannercnt.',$v/^\d\{3}'.g:netrw_sepchr.'/s/^/'.starpriority.'/e'
- keepj call histdel("/",-1)
+ exe 'sil NetrwKeepj '.w:netrw_bannercnt.',$v/^\d\{3}'.g:netrw_sepchr.'/s/^/'.starpriority.'/e'
+ NetrwKeepj call histdel("/",-1)
endif
" Following line associated with priority -- items that satisfy a priority
@@ -7716,8 +8190,8 @@ fun! s:NetrwSetSort()
" priority pattern needs to be retained. So, at this point, these excess
" priority prefixes need to be removed, but not directories that happen to
" be just digits themselves.
- exe 'sil keepj '.w:netrw_bannercnt.',$s/^\(\d\{3}'.g:netrw_sepchr.'\)\%(\d\{3}'.g:netrw_sepchr.'\)\+\ze./\1/e'
- keepj call histdel("/",-1)
+ exe 'sil NetrwKeepj '.w:netrw_bannercnt.',$s/^\(\d\{3}'.g:netrw_sepchr.'\)\%(\d\{3}'.g:netrw_sepchr.'\)\+\ze./\1/e'
+ NetrwKeepj call histdel("/",-1)
let @@= ykeep
" call Dret("SetSort")
@@ -7758,13 +8232,13 @@ endfun
" s:NetrwSortStyle: change sorting style (name - time - size) and refresh display {{{2
fun! s:NetrwSortStyle(islocal)
" call Dfunc("s:NetrwSortStyle(islocal=".a:islocal.") netrw_sort_by<".g:netrw_sort_by.">")
- keepj call s:NetrwSaveWordPosn()
+ NetrwKeepj call s:NetrwSaveWordPosn()
let svpos= netrw#SavePosn()
let g:netrw_sort_by= (g:netrw_sort_by =~ 'n')? 'time' : (g:netrw_sort_by =~ 't')? 'size' : 'name'
- keepj norm! 0
- keepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
- keepj call netrw#RestorePosn(svpos)
+ NetrwKeepj norm! 0
+ NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+ NetrwKeepj call netrw#RestorePosn(svpos)
" call Dret("s:NetrwSortStyle : netrw_sort_by<".g:netrw_sort_by.">")
endfun
@@ -7790,8 +8264,8 @@ fun! s:NetrwSplit(mode)
" call Decho("exe ".(g:netrw_alto? "bel " : "abo ").winsz."wincmd s")
exe (g:netrw_alto? "bel " : "abo ").winsz."wincmd s"
let s:didsplit= 1
- keepj call s:RestoreWinVars()
- keepj call s:NetrwBrowse(0,s:NetrwBrowseChgDir(0,s:NetrwGetWord()))
+ NetrwKeepj call s:RestoreWinVars()
+ NetrwKeepj call s:NetrwBrowse(0,s:NetrwBrowseChgDir(0,s:NetrwGetWord()))
unlet s:didsplit
elseif a:mode == 1
@@ -7800,8 +8274,8 @@ fun! s:NetrwSplit(mode)
" call Decho("tabnew")
tabnew
let s:didsplit= 1
- keepj call s:RestoreWinVars()
- keepj call s:NetrwBrowse(0,newdir)
+ NetrwKeepj call s:RestoreWinVars()
+ NetrwKeepj call s:NetrwBrowse(0,newdir)
unlet s:didsplit
elseif a:mode == 2
@@ -7811,8 +8285,8 @@ fun! s:NetrwSplit(mode)
" call Decho("exe ".(g:netrw_altv? "rightb " : "lefta ").winsz."wincmd v")
exe (g:netrw_altv? "rightb " : "lefta ").winsz."wincmd v"
let s:didsplit= 1
- keepj call s:RestoreWinVars()
- keepj call s:NetrwBrowse(0,s:NetrwBrowseChgDir(0,s:NetrwGetWord()))
+ NetrwKeepj call s:RestoreWinVars()
+ NetrwKeepj call s:NetrwBrowse(0,s:NetrwBrowseChgDir(0,s:NetrwGetWord()))
unlet s:didsplit
elseif a:mode == 3
@@ -7822,8 +8296,8 @@ fun! s:NetrwSplit(mode)
" call Decho("exe ".(g:netrw_alto? "bel " : "abo ").winsz."wincmd s")
exe (g:netrw_alto? "bel " : "abo ").winsz."wincmd s"
let s:didsplit= 1
- keepj call s:RestoreWinVars()
- keepj call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,s:NetrwGetWord()))
+ NetrwKeepj call s:RestoreWinVars()
+ NetrwKeepj call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,s:NetrwGetWord()))
unlet s:didsplit
elseif a:mode == 4
@@ -7833,23 +8307,23 @@ fun! s:NetrwSplit(mode)
let netrw_winnr = winnr()
let netrw_line = line(".")
let netrw_col = virtcol(".")
- keepj norm! H0
+ NetrwKeepj norm! H0
let netrw_hline = line(".")
setl ei=all
- exe "keepj norm! ".netrw_hline."G0z\<CR>"
- exe "keepj norm! ".netrw_line."G0".netrw_col."\<bar>"
+ exe "NetrwKeepj norm! ".netrw_hline."G0z\<CR>"
+ exe "NetrwKeepj norm! ".netrw_line."G0".netrw_col."\<bar>"
let &ei= eikeep
- let netrw_curdir= s:NetrwTreeDir()
+ let netrw_curdir= s:NetrwTreeDir(0)
" call Decho("tabnew")
tabnew
let b:netrw_curdir = netrw_curdir
let s:didsplit = 1
- keepj call s:RestoreWinVars()
- keepj call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,cursorword))
+ NetrwKeepj call s:RestoreWinVars()
+ NetrwKeepj call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,cursorword))
if &ft == "netrw"
setl ei=all
- exe "keepj norm! ".netrw_hline."G0z\<CR>"
- exe "keepj norm! ".netrw_line."G0".netrw_col."\<bar>"
+ exe "NetrwKeepj norm! ".netrw_hline."G0z\<CR>"
+ exe "NetrwKeepj norm! ".netrw_line."G0".netrw_col."\<bar>"
let &ei= eikeep
endif
unlet s:didsplit
@@ -7861,12 +8335,13 @@ fun! s:NetrwSplit(mode)
" call Decho("exe ".(g:netrw_altv? "rightb " : "lefta ").winsz."wincmd v")
exe (g:netrw_altv? "rightb " : "lefta ").winsz."wincmd v"
let s:didsplit= 1
- keepj call s:RestoreWinVars()
- keepj call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,s:NetrwGetWord()))
+ NetrwKeepj call s:RestoreWinVars()
+ NetrwKeepj call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,s:NetrwGetWord()))
+ "call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,s:NetrwGetWord()))
unlet s:didsplit
else
- keepj call netrw#ErrorMsg(s:ERROR,"(NetrwSplit) unsupported mode=".a:mode,45)
+ NetrwKeepj call netrw#ErrorMsg(s:ERROR,"(NetrwSplit) unsupported mode=".a:mode,45)
endif
let @@= ykeep
@@ -7926,8 +8401,8 @@ endfun
" ---------------------------------------------------------------------
" s:NetrwTreeDir: determine tree directory given current cursor position {{{2
" (full path directory with trailing slash returned)
-fun! s:NetrwTreeDir()
-" call Dfunc("s:NetrwTreeDir() getline(".line(".").")"."<".getline('.')."> b:netrw_curdir<".b:netrw_curdir."> tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> ft=".&ft)
+fun! s:NetrwTreeDir(islocal)
+" call Dfunc("s:NetrwTreeDir(islocal=".a:islocal.") getline(".line(".").")"."<".getline('.')."> b:netrw_curdir<".b:netrw_curdir."> tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> ft=".&ft)
if exists("s:treedir")
" s:NetrwPrevWinOpen opens a "previous" window -- and thus needs to and does call s:NetrwTreeDir early
@@ -7948,7 +8423,8 @@ fun! s:NetrwTreeDir()
" call Decho("line#".line(".")." getline(.)<".getline('.')."> treecurpos<".string(s:treecurpos).">")
" extract tree directory if on a line specifying a subdirectory (ie. ends with "/")
- if getline('.') =~ '/$'
+ let curline= substitute(getline('.'),"\t -->.*$",'','')
+ if curline =~ '/$'
" call Decho("extract tree subdirectory from current line")
let treedir= substitute(getline('.'),'^\%('.s:treedepthstring.'\)*\([^'.s:treedepthstring.'].\{-}\)$','\1','e')
" call Decho("treedir<".treedir.">")
@@ -7958,24 +8434,38 @@ fun! s:NetrwTreeDir()
endif
" detect user attempting to close treeroot
-" call Decho("win#".winnr()." buf#".bufnr("%")."<".bufname("%").">")
-" call Decho("getline(".line(".").")<".getline('.').'> '.((getline('.') =~ '^'.s:treedepthstring)? '=~' : '!~').' ^'.s:treedepthstring)
- if getline('.') !~ '^'.s:treedepthstring && getline('.') != '..'
-" call Decho("user may have attempted to close treeroot")
+" call Decho("check if user is attempting to close treeroot")
+" call Decho(".win#".winnr()." buf#".bufnr("%")."<".bufname("%").">")
+" call Decho(".getline(".line(".").")<".getline('.').'> '.((getline('.') =~ '^'.s:treedepthstring)? '=~' : '!~').' ^'.s:treedepthstring)
+ if curline !~ '^'.s:treedepthstring && getline('.') != '..'
+" call Decho(".user may have attempted to close treeroot")
" now force a refresh
-" call Decho("clear buffer<".expand("%")."> with :%d")
- sil! keepj %d
+" call Decho(".force refresh: clear buffer<".expand("%")."> with :%d")
+ sil! NetrwKeepj %d
" call Dret("s:NetrwTreeDir <".treedir."> : (side effect) s:treecurpos<".string(s:treecurpos).">")
return b:netrw_curdir
" else " Decho
-" call Decho("user did not attempt to close treeroot")
+" call Decho(".user did not attempt to close treeroot")
endif
- let treedir = s:NetrwTreePath(w:netrw_treetop)
+" call Decho("islocal=".a:islocal." curline<".curline.">")
+" call Decho("after subst<".substitute(curline,'^'.s:treedepthstring.'\+ \(.*\)$','\1','').">")
+ let potentialdir= substitute(curline,'^'.s:treedepthstring.'* \(.*\)@$','\1','')
+" call Decho("potentialdir<".potentialdir."> isdir=".isdirectory(potentialdir))
+
+ if a:islocal && curline =~ '@$' && isdirectory(potentialdir)
+ let newdir = w:netrw_treetop.'/'.potentialdir
+ let treedir = s:NetrwTreePath(newdir)
+ let w:netrw_treetop = newdir
+" call Decho("newdir <".newdir.">")
+ else
+ let treedir = s:NetrwTreePath(w:netrw_treetop)
+ endif
endif
" sanity maintenance: keep those //s away...
let treedir= substitute(treedir,'//$','/','')
+" call Decho("treedir<".treedir.">")
" call Dret("s:NetrwTreeDir <".treedir."> : (side effect) s:treecurpos<".string(s:treecurpos).">")
return treedir
@@ -8022,13 +8512,13 @@ fun! s:NetrwTreeDisplay(dir,depth)
" call Decho("dir<".dir."> entry<".entry."> direntry<".direntry.">")
if entry =~ '/$' && has_key(w:netrw_treedict,direntry)
" call Decho("<".direntry."> is a key in treedict - display subtree for it")
- keepj call s:NetrwTreeDisplay(direntry,depth)
+ NetrwKeepj call s:NetrwTreeDisplay(direntry,depth)
elseif entry =~ '/$' && has_key(w:netrw_treedict,direntry.'/')
" call Decho("<".direntry."/> is a key in treedict - display subtree for it")
- keepj call s:NetrwTreeDisplay(direntry.'/',depth)
+ NetrwKeepj call s:NetrwTreeDisplay(direntry.'/',depth)
else
" call Decho("<".entry."> is not a key in treedict (no subtree)")
- sil! keepj call setline(line("$")+1,depth.entry)
+ sil! NetrwKeepj call setline(line("$")+1,depth.entry)
endif
endfor
@@ -8062,10 +8552,10 @@ fun! s:NetrwTreeListing(dirname)
" update the directory listing for the current directory
" call Decho("updating dictionary with ".a:dirname.":[..directory listing..]")
" call Decho("w:netrw_bannercnt=".w:netrw_bannercnt." line($)=".line("$"))
- exe "sil! keepj ".w:netrw_bannercnt.',$g@^\.\.\=/$@d'
+ exe "sil! NetrwKeepj ".w:netrw_bannercnt.',$g@^\.\.\=/$@d'
let w:netrw_treedict[a:dirname]= getline(w:netrw_bannercnt,line("$"))
" call Decho("w:treedict[".a:dirname."]= ".string(w:netrw_treedict[a:dirname]))
- exe "sil! keepj ".w:netrw_bannercnt.",$d"
+ exe "sil! NetrwKeepj ".w:netrw_bannercnt.",$d"
" if past banner, record word
if exists("w:netrw_bannercnt") && line(".") > w:netrw_bannercnt
@@ -8077,7 +8567,7 @@ fun! s:NetrwTreeListing(dirname)
" call Decho("g:netrw_banner=".g:netrw_banner.": banner ".(g:netrw_banner? "enabled" : "suppressed").": (line($)=".line("$")." byte2line(1)=".byte2line(1)." bannercnt=".w:netrw_bannercnt.")")
" display from treetop on down
- keepj call s:NetrwTreeDisplay(w:netrw_treetop,"")
+ NetrwKeepj call s:NetrwTreeDisplay(w:netrw_treetop,"")
" call Decho("s:NetrwTreeDisplay) setl noma nomod ro")
" remove any blank line remaining as line#1 (happens in treelisting mode with banner suppressed)
@@ -8145,8 +8635,8 @@ fun! s:NetrwWideListing()
" call Decho("setl ma noro")
let b:netrw_cpf= 0
if line("$") >= w:netrw_bannercnt
- exe 'sil keepj '.w:netrw_bannercnt.',$g/^./if virtcol("$") > b:netrw_cpf|let b:netrw_cpf= virtcol("$")|endif'
- keepj call histdel("/",-1)
+ exe 'sil NetrwKeepj '.w:netrw_bannercnt.',$g/^./if virtcol("$") > b:netrw_cpf|let b:netrw_cpf= virtcol("$")|endif'
+ NetrwKeepj call histdel("/",-1)
else
" call Dret("NetrwWideListing")
return
@@ -8162,8 +8652,8 @@ fun! s:NetrwWideListing()
" call Decho("fpl= [winwidth=".winwidth(0)."]/[b:netrw_cpf=".b:netrw_cpf.']='.w:netrw_fpl)
" make wide display
- exe 'sil keepj '.w:netrw_bannercnt.',$s/^.*$/\=escape(printf("%-'.b:netrw_cpf.'s",submatch(0)),"\\")/'
- keepj call histdel("/",-1)
+ exe 'sil NetrwKeepj '.w:netrw_bannercnt.',$s/^.*$/\=escape(printf("%-'.b:netrw_cpf.'s",submatch(0)),"\\")/'
+ NetrwKeepj call histdel("/",-1)
let fpc = (line("$") - w:netrw_bannercnt + w:netrw_fpl)/w:netrw_fpl
let newcolstart = w:netrw_bannercnt + fpc
let newcolend = newcolstart + fpc - 1
@@ -8176,20 +8666,20 @@ fun! s:NetrwWideListing()
let newcolqty= newcolend - newcolstart
exe newcolstart
if newcolqty == 0
- exe "sil! keepj norm! 0\<c-v>$hx".w:netrw_bannercnt."G$p"
+ exe "sil! NetrwKeepj norm! 0\<c-v>$hx".w:netrw_bannercnt."G$p"
else
- exe "sil! keepj norm! 0\<c-v>".newcolqty.'j$hx'.w:netrw_bannercnt.'G$p'
+ exe "sil! NetrwKeepj norm! 0\<c-v>".newcolqty.'j$hx'.w:netrw_bannercnt.'G$p'
endif
- exe "sil! keepj ".newcolstart.','.newcolend.'d'
- exe 'sil! keepj '.w:netrw_bannercnt
+ exe "sil! NetrwKeepj ".newcolstart.','.newcolend.'d'
+ exe 'sil! NetrwKeepj '.w:netrw_bannercnt
endwhile
if has("clipboard")
sil! let @*= keepregstar
endif
- exe "sil! keepj ".w:netrw_bannercnt.',$s/\s\+$//e'
- keepj call histdel("/",-1)
- exe "nmap <buffer> <silent> w /^\\\\|\\s\\s\\zs\\S/\<cr>"
- exe "nmap <buffer> <silent> b ?^\\\\|\\s\\s\\zs\\S?\<cr>"
+ exe "sil! NetrwKeepj ".w:netrw_bannercnt.',$s/\s\+$//e'
+ NetrwKeepj call histdel("/",-1)
+ exe 'nno <buffer> <silent> w :call search(''^.\\|\s\s\zs\S'',''W'')'."\<cr>"
+ exe 'nno <buffer> <silent> b :call search(''^.\\|\s\s\zs\S'',''bW'')'."\<cr>"
" call Decho("NetrwWideListing) setl noma nomod ro")
exe "setl ".g:netrw_bufsettings
" call Decho("(NetrwWideListing) ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
@@ -8213,18 +8703,10 @@ fun! s:PerformListing(islocal)
" call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo. " (enter)")
" set up syntax highlighting {{{3
-" call Decho("set up syntax highlighting")
- if has("syntax")
- if !exists("g:syntax_on") || !g:syntax_on
-" call Decho("but g:syntax_on".(exists("g:syntax_on")? "=".g:syntax_on : "<doesn't exist>"))
- setl ft=
- elseif &ft != "netrw"
-" call Decho("setl ft=netrw")
- setl ft=netrw
- endif
- endif
+" call Decho("set up syntax highlighting (ie. setl ft=netrw)")
+ sil! setl ft=netrw
- keepj call s:NetrwSafeOptions()
+ NetrwKeepj call s:NetrwSafeOptions()
setl noro ma
" call Decho("setl noro ma bh=".&bh)
@@ -8236,26 +8718,26 @@ fun! s:PerformListing(islocal)
if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("w:netrw_treedict")
" force a refresh for tree listings
" call Decho("force refresh for treelisting: clear buffer<".expand("%")."> with :%d")
- sil! keepj %d
+ sil! NetrwKeepj %d
endif
" save current directory on directory history list
- keepj call s:NetrwBookHistHandler(3,b:netrw_curdir)
+ NetrwKeepj call s:NetrwBookHistHandler(3,b:netrw_curdir)
" Set up the banner {{{3
if g:netrw_banner
" call Decho("set up banner")
- keepj call setline(1,'" ============================================================================')
- keepj call setline(2,'" Netrw Directory Listing (netrw '.g:loaded_netrw.')')
+ NetrwKeepj call setline(1,'" ============================================================================')
+ NetrwKeepj call setline(2,'" Netrw Directory Listing (netrw '.g:loaded_netrw.')')
if exists("g:netrw_bannerbackslash") && g:netrw_bannerbackslash
- keepj call setline(3,'" '.substitute(b:netrw_curdir,'/','\\','g'))
+ NetrwKeepj call setline(3,'" '.substitute(b:netrw_curdir,'/','\\','g'))
else
- keepj call setline(3,'" '.b:netrw_curdir)
+ NetrwKeepj call setline(3,'" '.b:netrw_curdir)
endif
let w:netrw_bannercnt= 3
- keepj exe "sil! keepj ".w:netrw_bannercnt
+ NetrwKeepj exe "sil! NetrwKeepj ".w:netrw_bannercnt
else
- keepj 1
+ NetrwKeepj 1
let w:netrw_bannercnt= 1
endif
" call Decho("w:netrw_bannercnt=".w:netrw_bannercnt." win#".winnr())
@@ -8271,16 +8753,16 @@ fun! s:PerformListing(islocal)
if g:netrw_sort_by =~ "^n"
" call Decho("directories will be sorted by name")
" sorted by name
- keepj put ='\" Sorted by '.sortby
- keepj put ='\" Sort sequence: '.g:netrw_sort_sequence
+ NetrwKeepj put ='\" Sorted by '.sortby
+ NetrwKeepj put ='\" Sort sequence: '.g:netrw_sort_sequence
let w:netrw_bannercnt= w:netrw_bannercnt + 2
else
" call Decho("directories will be sorted by size or time")
" sorted by size or date
- keepj put ='\" Sorted by '.sortby
+ NetrwKeepj put ='\" Sorted by '.sortby
let w:netrw_bannercnt= w:netrw_bannercnt + 1
endif
- exe "sil! keepj ".w:netrw_bannercnt
+ exe "sil! NetrwKeepj ".w:netrw_bannercnt
" else " Decho
" call Decho("g:netrw_banner=".g:netrw_banner.": banner ".(g:netrw_banner? "enabled" : "suppressed").": (line($)=".line("$")." byte2line(1)=".byte2line(1)." bannercnt=".w:netrw_bannercnt.")")
endif
@@ -8289,17 +8771,17 @@ fun! s:PerformListing(islocal)
if g:netrw_banner
if exists("s:netrwmftgt") && exists("s:netrwmftgt_islocal")
" call Decho("show copy/move target<".s:netrwmftgt.">")
- keepj put =''
+ NetrwKeepj put =''
if s:netrwmftgt_islocal
- sil! keepj call setline(line("."),'" Copy/Move Tgt: '.s:netrwmftgt.' (local)')
+ sil! NetrwKeepj call setline(line("."),'" Copy/Move Tgt: '.s:netrwmftgt.' (local)')
else
- sil! keepj call setline(line("."),'" Copy/Move Tgt: '.s:netrwmftgt.' (remote)')
+ sil! NetrwKeepj call setline(line("."),'" Copy/Move Tgt: '.s:netrwmftgt.' (remote)')
endif
let w:netrw_bannercnt= w:netrw_bannercnt + 1
else
" call Decho("s:netrwmftgt does not exist, don't make Copy/Move Tgt")
endif
- exe "sil! keepj ".w:netrw_bannercnt
+ exe "sil! NetrwKeepj ".w:netrw_bannercnt
endif
" Hiding... -or- Showing... {{{3
@@ -8307,20 +8789,20 @@ fun! s:PerformListing(islocal)
" call Decho("handle hiding/showing (g:netrw_hide=".g:netrw_list_hide." g:netrw_list_hide<".g:netrw_list_hide.">)")
if g:netrw_list_hide != "" && g:netrw_hide
if g:netrw_hide == 1
- keepj put ='\" Hiding: '.g:netrw_list_hide
+ NetrwKeepj put ='\" Hiding: '.g:netrw_list_hide
else
- keepj put ='\" Showing: '.g:netrw_list_hide
+ NetrwKeepj put ='\" Showing: '.g:netrw_list_hide
endif
let w:netrw_bannercnt= w:netrw_bannercnt + 1
endif
- exe "keepjumps ".w:netrw_bannercnt
+ exe "NetrwKeepj ".w:netrw_bannercnt
" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
let quickhelp = g:netrw_quickhelp%len(s:QuickHelp)
" call Decho("quickhelp =".quickhelp)
- keepj put ='\" Quick Help: <F1>:help '.s:QuickHelp[quickhelp]
+ NetrwKeepj put ='\" Quick Help: <F1>:help '.s:QuickHelp[quickhelp]
" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
- keepj put ='\" =============================================================================='
+ NetrwKeepj put ='\" =============================================================================='
let w:netrw_bannercnt= w:netrw_bannercnt + 2
" else " Decho
" call Decho("g:netrw_banner=".g:netrw_banner.": banner ".(g:netrw_banner? "enabled" : "suppressed").": (line($)=".line("$")." byte2line(1)=".byte2line(1)." bannercnt=".w:netrw_bannercnt.")")
@@ -8329,7 +8811,7 @@ fun! s:PerformListing(islocal)
" bannercnt should index the line just after the banner
if g:netrw_banner
let w:netrw_bannercnt= w:netrw_bannercnt + 1
- exe "sil! keepj ".w:netrw_bannercnt
+ exe "sil! NetrwKeepj ".w:netrw_bannercnt
" call Decho("w:netrw_bannercnt=".w:netrw_bannercnt." (should index line just after banner) line($)=".line("$"))
" else " Decho
" call Decho("g:netrw_banner=".g:netrw_banner.": banner ".(g:netrw_banner? "enabled" : "suppressed").": (line($)=".line("$")." byte2line(1)=".byte2line(1)." bannercnt=".w:netrw_bannercnt.")")
@@ -8338,9 +8820,9 @@ fun! s:PerformListing(islocal)
" get list of files
" call Decho("Get list of files - islocal=".a:islocal)
if a:islocal
- keepj call s:LocalListing()
+ NetrwKeepj call s:LocalListing()
else " remote
- keepj let badresult= s:NetrwRemoteListing()
+ NetrwKeepj let badresult= s:NetrwRemoteListing()
if badresult
" call Decho("w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'n/a')." win#".winnr()." buf#".bufnr("%")."<".bufname("%").">")
" call Dret("s:PerformListing : error detected by NetrwRemoteListing")
@@ -8359,49 +8841,49 @@ fun! s:PerformListing(islocal)
" call Decho("manipulate directory listing (hide)")
" call Decho("g:netrw_hide=".g:netrw_hide." g:netrw_list_hide<".g:netrw_list_hide.">")
if g:netrw_hide && g:netrw_list_hide != ""
- keepj call s:NetrwListHide()
+ NetrwKeepj call s:NetrwListHide()
endif
if !g:netrw_banner || line("$") >= w:netrw_bannercnt
" call Decho("manipulate directory listing (sort) : g:netrw_sort_by<".g:netrw_sort_by.">")
if g:netrw_sort_by =~ "^n"
" sort by name
- keepj call s:NetrwSetSort()
+ NetrwKeepj call s:NetrwSetSort()
if !g:netrw_banner || w:netrw_bannercnt < line("$")
" call Decho("g:netrw_sort_direction=".g:netrw_sort_direction." (bannercnt=".w:netrw_bannercnt.")")
if g:netrw_sort_direction =~ 'n'
" normal direction sorting
- exe 'sil keepj '.w:netrw_bannercnt.',$sort'.' '.g:netrw_sort_options
+ exe 'sil NetrwKeepj '.w:netrw_bannercnt.',$sort'.' '.g:netrw_sort_options
else
" reverse direction sorting
- exe 'sil keepj '.w:netrw_bannercnt.',$sort!'.' '.g:netrw_sort_options
+ exe 'sil NetrwKeepj '.w:netrw_bannercnt.',$sort!'.' '.g:netrw_sort_options
endif
endif
" remove priority pattern prefix
" call Decho("remove priority pattern prefix")
- exe 'sil! keepj '.w:netrw_bannercnt.',$s/^\d\{3}'.g:netrw_sepchr.'//e'
- keepj call histdel("/",-1)
+ exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$s/^\d\{3}'.g:netrw_sepchr.'//e'
+ NetrwKeepj call histdel("/",-1)
elseif a:islocal
if !g:netrw_banner || w:netrw_bannercnt < line("$")
" call Decho("g:netrw_sort_direction=".g:netrw_sort_direction)
if g:netrw_sort_direction =~ 'n'
-" call Decho('exe sil keepjumps '.w:netrw_bannercnt.',$sort')
- exe 'sil! keepj '.w:netrw_bannercnt.',$sort'.' '.g:netrw_sort_options
+" call Decho('exe sil NetrwKeepj '.w:netrw_bannercnt.',$sort')
+ exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$sort'.' '.g:netrw_sort_options
else
-" call Decho('exe sil keepjumps '.w:netrw_bannercnt.',$sort!')
- exe 'sil! keepj '.w:netrw_bannercnt.',$sort!'.' '.g:netrw_sort_options
+" call Decho('exe sil NetrwKeepj '.w:netrw_bannercnt.',$sort!')
+ exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$sort!'.' '.g:netrw_sort_options
endif
- exe 'sil! keepj '.w:netrw_bannercnt.',$s/^\d\{-}\///e'
- keepj call histdel("/",-1)
+ exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$s/^\d\{-}\///e'
+ NetrwKeepj call histdel("/",-1)
endif
endif
elseif g:netrw_sort_direction =~ 'r'
" call Decho('(s:PerformListing) reverse the sorted listing')
if !g:netrw_banner || w:netrw_bannercnt < line('$')
- exe 'sil! keepj '.w:netrw_bannercnt.',$g/^/m '.w:netrw_bannercnt
+ exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$g/^/m '.w:netrw_bannercnt
call histdel("/",-1)
endif
endif
@@ -8411,16 +8893,21 @@ fun! s:PerformListing(islocal)
" convert to wide/tree listing {{{3
" call Decho("modify display if wide/tree listing style")
" call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo. " (internal#1)")
- keepj call s:NetrwWideListing()
+ NetrwKeepj call s:NetrwWideListing()
" call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo. " (internal#2)")
- keepj call s:NetrwTreeListing(b:netrw_curdir)
+ NetrwKeepj call s:NetrwTreeListing(b:netrw_curdir)
" call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo. " (internal#3)")
+ " resolve symbolic links if local and (thin or tree)
+ if a:islocal && (w:netrw_liststyle == s:THINLIST || w:netrw_liststyle == s:TREELIST)
+ g/@$/call s:ShowLink()
+ endif
+
if exists("w:netrw_bannercnt") && (line("$") > w:netrw_bannercnt || !g:netrw_banner)
" place cursor on the top-left corner of the file listing
" call Decho("place cursor on top-left corner of file listing")
- exe 'sil! keepj '.w:netrw_bannercnt
- sil! keepj norm! 0
+ exe 'sil! NetrwKeepj '.w:netrw_bannercnt
+ sil! NetrwKeepj norm! 0
endif
" record previous current directory
@@ -8429,9 +8916,9 @@ fun! s:PerformListing(islocal)
" save certain window-oriented variables into buffer-oriented variables {{{3
" call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo. " (internal#4)")
- keepj call s:SetBufWinVars()
+ NetrwKeepj call s:SetBufWinVars()
" call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo. " (internal#5)")
- keepj call s:NetrwOptionRestore("w:")
+ NetrwKeepj call s:NetrwOptionRestore("w:")
" call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo. " (internal#6)")
" set display to netrw display settings
@@ -8445,7 +8932,7 @@ fun! s:PerformListing(islocal)
if exists("s:treecurpos")
" call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo. " (internal#8)")
- keepj call netrw#RestorePosn(s:treecurpos)
+ NetrwKeepj call netrw#RestorePosn(s:treecurpos)
unlet s:treecurpos
endif
@@ -8526,27 +9013,27 @@ fun! s:NetrwRemoteFtpCmd(path,listcmd)
" clear off any older non-banner lines " {{{3
" note that w:netrw_bannercnt indexes the line after the banner
-" call Decho('exe sil! keepjumps '.w:netrw_bannercnt.",$d (clear off old non-banner lines)")
- exe "sil! keepjumps ".w:netrw_bannercnt.",$d"
+" call Decho('exe sil! NetrwKeepj '.w:netrw_bannercnt.",$d (clear off old non-banner lines)")
+ exe "sil! NetrwKeepj ".w:netrw_bannercnt.",$d"
".........................................
if w:netrw_method == 2 || w:netrw_method == 5 " {{{3
" ftp + <.netrc>: Method #2
if a:path != ""
- keepj put ='cd \"'.a:path.'\"'
+ NetrwKeepj put ='cd \"'.a:path.'\"'
endif
if exists("g:netrw_ftpextracmd")
- keepj put =g:netrw_ftpextracmd
+ NetrwKeepj put =g:netrw_ftpextracmd
" call Decho("filter input: ".getline('.'))
endif
- keepj call setline(line("$")+1,a:listcmd)
-" exe "keepjumps ".w:netrw_bannercnt.',$g/^./call Decho("ftp#".line(".").": ".getline("."))'
+ NetrwKeepj call setline(line("$")+1,a:listcmd)
+" exe "NetrwKeepj ".w:netrw_bannercnt.',$g/^./call Decho("ftp#".line(".").": ".getline("."))'
if exists("g:netrw_port") && g:netrw_port != ""
" call Decho("exe ".s:netrw_silentxfer.w:netrw_bannercnt.",$!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1))
- exe s:netrw_silentxfer." keepj ".w:netrw_bannercnt.",$!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1)
+ exe s:netrw_silentxfer." NetrwKeepj ".w:netrw_bannercnt.",$!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1)
else
" call Decho("exe ".s:netrw_silentxfer.w:netrw_bannercnt.",$!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1))
- exe s:netrw_silentxfer." keepj ".w:netrw_bannercnt.",$!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)
+ exe s:netrw_silentxfer." NetrwKeepj ".w:netrw_bannercnt.",$!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)
endif
".........................................
@@ -8554,9 +9041,9 @@ fun! s:NetrwRemoteFtpCmd(path,listcmd)
" ftp + machine,id,passwd,filename: Method #3
setl ff=unix
if exists("g:netrw_port") && g:netrw_port != ""
- keepj put ='open '.g:netrw_machine.' '.g:netrw_port
+ NetrwKeepj put ='open '.g:netrw_machine.' '.g:netrw_port
else
- keepj put ='open '.g:netrw_machine
+ NetrwKeepj put ='open '.g:netrw_machine
endif
" handle userid and password
@@ -8567,23 +9054,23 @@ fun! s:NetrwRemoteFtpCmd(path,listcmd)
endif
if exists("g:netrw_uid") && g:netrw_uid != ""
if exists("g:netrw_ftp") && g:netrw_ftp == 1
- keepj put =g:netrw_uid
+ NetrwKeepj put =g:netrw_uid
if exists("s:netrw_passwd") && s:netrw_passwd != ""
- keepj put ='\"'.s:netrw_passwd.'\"'
+ NetrwKeepj put ='\"'.s:netrw_passwd.'\"'
endif
elseif exists("s:netrw_passwd")
- keepj put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"'
+ NetrwKeepj put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"'
endif
endif
if a:path != ""
- keepj put ='cd \"'.a:path.'\"'
+ NetrwKeepj put ='cd \"'.a:path.'\"'
endif
if exists("g:netrw_ftpextracmd")
- keepj put =g:netrw_ftpextracmd
+ NetrwKeepj put =g:netrw_ftpextracmd
" call Decho("filter input: ".getline('.'))
endif
- keepj call setline(line("$")+1,a:listcmd)
+ NetrwKeepj call setline(line("$")+1,a:listcmd)
" perform ftp:
" -i : turns off interactive prompting from ftp
@@ -8591,11 +9078,10 @@ fun! s:NetrwRemoteFtpCmd(path,listcmd)
" -n win32: quit being obnoxious about password
if exists("w:netrw_bannercnt")
" exe w:netrw_bannercnt.',$g/^./call Decho("ftp#".line(".").": ".getline("."))'
-" call Decho("exe ".s:netrw_silentxfer.w:netrw_bannercnt.",$!".s:netrw_ftp_cmd." ".g:netrw_ftp_options)
- exe s:netrw_silentxfer.w:netrw_bannercnt.",$!".s:netrw_ftp_cmd." ".g:netrw_ftp_options
+ call s:NetrwExe(s:netrw_silentxfer.w:netrw_bannercnt.",$!".s:netrw_ftp_cmd." ".g:netrw_ftp_options)
" else " Decho
" call Decho("WARNING: w:netrw_bannercnt doesn't exist!")
-" g/^./call Decho("SKIPPING ftp#".line(".").": ".getline(".")) " COMBAK
+" g/^./call Decho("SKIPPING ftp#".line(".").": ".getline("."))
endif
".........................................
@@ -8611,34 +9097,34 @@ fun! s:NetrwRemoteFtpCmd(path,listcmd)
".........................................
else " {{{3
- keepj call netrw#ErrorMsg(s:WARNING,"unable to comply with your request<" . bufname("%") . ">",23)
+ NetrwKeepj call netrw#ErrorMsg(s:WARNING,"unable to comply with your request<" . bufname("%") . ">",23)
endif
" cleanup for Windows " {{{3
if has("win32") || has("win95") || has("win64") || has("win16")
- sil! keepj %s/\r$//e
- keepj call histdel("/",-1)
+ sil! NetrwKeepj %s/\r$//e
+ NetrwKeepj call histdel("/",-1)
endif
if a:listcmd == "dir"
" infer directory/link based on the file permission string
- sil! keepj g/d\%([-r][-w][-x]\)\{3}/keepj s@$@/@e
- sil! keepj g/l\%([-r][-w][-x]\)\{3}/keepj s/$/@/e
- keepj call histdel("/",-1)
- keepj call histdel("/",-1)
+ sil! NetrwKeepj g/d\%([-r][-w][-x]\)\{3}/NetrwKeepj s@$@/@e
+ sil! NetrwKeepj g/l\%([-r][-w][-x]\)\{3}/NetrwKeepj s/$/@/e
+ NetrwKeepj call histdel("/",-1)
+ NetrwKeepj call histdel("/",-1)
if w:netrw_liststyle == s:THINLIST || w:netrw_liststyle == s:WIDELIST || w:netrw_liststyle == s:TREELIST
- exe "sil! keepj ".w:netrw_bannercnt.',$s/^\%(\S\+\s\+\)\{8}//e'
- keepj call histdel("/",-1)
+ exe "sil! NetrwKeepj ".w:netrw_bannercnt.',$s/^\%(\S\+\s\+\)\{8}//e'
+ NetrwKeepj call histdel("/",-1)
endif
endif
" ftp's listing doesn't seem to include ./ or ../ " {{{3
if !search('^\.\/$\|\s\.\/$','wn')
- exe 'keepj '.w:netrw_bannercnt
- keepj put ='./'
+ exe 'NetrwKeepj '.w:netrw_bannercnt
+ NetrwKeepj put ='./'
endif
if !search('^\.\.\/$\|\s\.\.\/$','wn')
- exe 'keepj '.w:netrw_bannercnt
- keepj put ='../'
+ exe 'NetrwKeepj '.w:netrw_bannercnt
+ NetrwKeepj put ='../'
endif
" restore settings " {{{3
@@ -8677,13 +9163,13 @@ fun! s:NetrwRemoteListing()
" call Decho("g:netrw_list_cmd<",(exists("g:netrw_list_cmd")? 'n/a' : "-empty-").">")
if !exists("g:netrw_quiet")
if g:netrw_list_cmd == ""
- keepj call netrw#ErrorMsg(s:ERROR,"your g:netrw_list_cmd is empty; perhaps ".g:netrw_ssh_cmd." is not executable on your system",47)
+ NetrwKeepj call netrw#ErrorMsg(s:ERROR,"your g:netrw_list_cmd is empty; perhaps ".g:netrw_ssh_cmd." is not executable on your system",47)
else
- keepj call netrw#ErrorMsg(s:ERROR,"this system doesn't support remote directory listing via ".g:netrw_list_cmd,19)
+ NetrwKeepj call netrw#ErrorMsg(s:ERROR,"this system doesn't support remote directory listing via ".g:netrw_list_cmd,19)
endif
endif
- keepj call s:NetrwOptionRestore("w:")
+ NetrwKeepj call s:NetrwOptionRestore("w:")
" call Dret("s:NetrwRemoteListing -1")
return -1
endif " (remote handling sanity check)
@@ -8706,7 +9192,7 @@ fun! s:NetrwRemoteListing()
endif
" call Decho("listcmd<".listcmd."> (using g:netrw_ftp_list_cmd)")
call s:NetrwRemoteFtpCmd(s:path,listcmd)
-" exe "sil! keepalt keepj ".w:netrw_bannercnt.',$g/^./call Decho("raw listing: ".getline("."))'
+" exe "sil! keepalt NetrwKeepj ".w:netrw_bannercnt.',$g/^./call Decho("raw listing: ".getline("."))'
" report on missing file or directory messages
if search('[Nn]o such file or directory\|Failed to change directory')
@@ -8716,7 +9202,7 @@ fun! s:NetrwRemoteListing()
exe w:netrw_bannercnt.",$d"
setl noma
endif
- keepj call s:NetrwOptionRestore("w:")
+ NetrwKeepj call s:NetrwOptionRestore("w:")
call netrw#ErrorMsg(s:WARNING,mesg,96)
" call Dret("s:NetrwRemoteListing : -1")
return -1
@@ -8725,41 +9211,41 @@ fun! s:NetrwRemoteListing()
if w:netrw_liststyle == s:THINLIST || w:netrw_liststyle == s:WIDELIST || w:netrw_liststyle == s:TREELIST
" shorten the listing
" call Decho("generate short listing")
- exe "sil! keepalt keepj ".w:netrw_bannercnt
+ exe "sil! keepalt NetrwKeepj ".w:netrw_bannercnt
" cleanup
if g:netrw_ftp_browse_reject != ""
- exe "sil! keepalt keepj g/".g:netrw_ftp_browse_reject."/keepj d"
- keepj call histdel("/",-1)
+ exe "sil! keepalt NetrwKeepj g/".g:netrw_ftp_browse_reject."/NetrwKeepj d"
+ NetrwKeepj call histdel("/",-1)
endif
- sil! keepj %s/\r$//e
- keepj call histdel("/",-1)
+ sil! NetrwKeepj %s/\r$//e
+ NetrwKeepj call histdel("/",-1)
" if there's no ../ listed, then put ../ in
let line1= line(".")
- exe "sil! keepj ".w:netrw_bannercnt
+ exe "sil! NetrwKeepj ".w:netrw_bannercnt
let line2= search('\.\.\/\%(\s\|$\)','cnW')
" call Decho("search(".'\.\.\/\%(\s\|$\)'."','cnW')=".line2." w:netrw_bannercnt=".w:netrw_bannercnt)
if line2 == 0
" call Decho("netrw is putting ../ into listing")
- sil! keepj put='../'
+ sil! NetrwKeepj put='../'
endif
- exe "sil! keepj ".line1
- sil! keepj norm! 0
+ exe "sil! NetrwKeepj ".line1
+ sil! NetrwKeepj norm! 0
" call Decho("line1=".line1." line2=".line2." line(.)=".line("."))
if search('^\d\{2}-\d\{2}-\d\{2}\s','n') " M$ ftp site cleanup
" call Decho("M$ ftp cleanup")
- exe 'sil! keepj '.w:netrw_bannercnt.',$s/^\d\{2}-\d\{2}-\d\{2}\s\+\d\+:\d\+[AaPp][Mm]\s\+\%(<DIR>\|\d\+\)\s\+//'
- keepj call histdel("/",-1)
+ exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$s/^\d\{2}-\d\{2}-\d\{2}\s\+\d\+:\d\+[AaPp][Mm]\s\+\%(<DIR>\|\d\+\)\s\+//'
+ NetrwKeepj call histdel("/",-1)
else " normal ftp cleanup
" call Decho("normal ftp cleanup")
- exe 'sil! keepj '.w:netrw_bannercnt.',$s/^\(\%(\S\+\s\+\)\{7}\S\+\)\s\+\(\S.*\)$/\2/e'
- exe "sil! keepj ".w:netrw_bannercnt.',$g/ -> /s# -> .*/$#/#e'
- exe "sil! keepj ".w:netrw_bannercnt.',$g/ -> /s# -> .*$#/#e'
- keepj call histdel("/",-1)
- keepj call histdel("/",-1)
- keepj call histdel("/",-1)
+ exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$s/^\(\%(\S\+\s\+\)\{7}\S\+\)\s\+\(\S.*\)$/\2/e'
+ exe "sil! NetrwKeepj ".w:netrw_bannercnt.',$g/ -> /s# -> .*/$#/#e'
+ exe "sil! NetrwKeepj ".w:netrw_bannercnt.',$g/ -> /s# -> .*$#/#e'
+ NetrwKeepj call histdel("/",-1)
+ NetrwKeepj call histdel("/",-1)
+ NetrwKeepj call histdel("/",-1)
endif
endif
@@ -8769,35 +9255,35 @@ fun! s:NetrwRemoteListing()
let listcmd= s:MakeSshCmd(g:netrw_list_cmd)
" call Decho("listcmd<".listcmd."> (using g:netrw_list_cmd)")
if g:netrw_scp_cmd =~ '^pscp'
-" call Decho("1: exe sil r! ".shellescape(listcmd.s:path, 1))
- exe "sil! keepj r! ".listcmd.shellescape(s:path, 1)
+" call Decho("1: exe r! ".shellescape(listcmd.s:path, 1))
+ exe "NetrwKeepj r! ".listcmd.shellescape(s:path, 1)
" remove rubbish and adjust listing format of 'pscp' to 'ssh ls -FLa' like
- sil! keepj g/^Listing directory/keepj d
- sil! keepj g/^d[-rwx][-rwx][-rwx]/keepj s+$+/+e
- sil! keepj g/^l[-rwx][-rwx][-rwx]/keepj s+$+@+e
- keepj call histdel("/",-1)
- keepj call histdel("/",-1)
- keepj call histdel("/",-1)
+ sil! NetrwKeepj g/^Listing directory/NetrwKeepj d
+ sil! NetrwKeepj g/^d[-rwx][-rwx][-rwx]/NetrwKeepj s+$+/+e
+ sil! NetrwKeepj g/^l[-rwx][-rwx][-rwx]/NetrwKeepj s+$+@+e
+ NetrwKeepj call histdel("/",-1)
+ NetrwKeepj call histdel("/",-1)
+ NetrwKeepj call histdel("/",-1)
if g:netrw_liststyle != s:LONGLIST
- sil! keepj g/^[dlsp-][-rwx][-rwx][-rwx]/keepj s/^.*\s\(\S\+\)$/\1/e
- keepj call histdel("/",-1)
+ sil! NetrwKeepj g/^[dlsp-][-rwx][-rwx][-rwx]/NetrwKeepj s/^.*\s\(\S\+\)$/\1/e
+ NetrwKeepj call histdel("/",-1)
endif
else
if s:path == ""
-" call Decho("2: exe sil r! ".listcmd)
- exe "sil! keepj keepalt r! ".listcmd
+" call Decho("2: exe r! ".listcmd)
+ exe "NetrwKeepj keepalt r! ".listcmd
else
-" call Decho("3: exe sil r! ".listcmd.' '.shellescape(fnameescape(s:path),1))
- exe "sil! keepj keepalt r! ".listcmd.' '.shellescape(fnameescape(s:path),1)
+" call Decho("3: exe r! ".listcmd.' '.shellescape(fnameescape(s:path),1))
+ exe "NetrwKeepj keepalt r! ".listcmd.' '.shellescape(fnameescape(s:path),1)
" call Decho("listcmd<".listcmd."> path<".s:path.">")
endif
endif
" cleanup
if g:netrw_ssh_browse_reject != ""
-" call Decho("cleanup: exe sil! g/".g:netrw_ssh_browse_reject."/keepjumps d")
- exe "sil! g/".g:netrw_ssh_browse_reject."/keepj d"
- keepj call histdel("/",-1)
+" call Decho("cleanup: exe sil! g/".g:netrw_ssh_browse_reject."/NetrwKeepj d")
+ exe "sil! g/".g:netrw_ssh_browse_reject."/NetrwKeepj d"
+ NetrwKeepj call histdel("/",-1)
endif
endif
@@ -8807,40 +9293,40 @@ fun! s:NetrwRemoteListing()
if s:method == "ftp"
" cleanup
- exe "sil! keepj ".w:netrw_bannercnt
+ exe "sil! NetrwKeepj ".w:netrw_bannercnt
while getline('.') =~ g:netrw_ftp_browse_reject
- sil! keepj d
+ sil! NetrwKeepj d
endwhile
" if there's no ../ listed, then put ../ in
let line1= line(".")
- sil! keepj 1
- sil! keepj call search('^\.\.\/\%(\s\|$\)','W')
+ sil! NetrwKeepj 1
+ sil! NetrwKeepj call search('^\.\.\/\%(\s\|$\)','W')
let line2= line(".")
if line2 == 0
if b:netrw_curdir != '/'
- exe 'sil! keepj '.w:netrw_bannercnt."put='../'"
+ exe 'sil! NetrwKeepj '.w:netrw_bannercnt."put='../'"
endif
endif
- exe "sil! keepj ".line1
- sil! keepj norm! 0
+ exe "sil! NetrwKeepj ".line1
+ sil! NetrwKeepj norm! 0
endif
if search('^\d\{2}-\d\{2}-\d\{2}\s','n') " M$ ftp site cleanup
" call Decho("M$ ftp site listing cleanup")
- exe 'sil! keepj '.w:netrw_bannercnt.',$s/^\(\d\{2}-\d\{2}-\d\{2}\s\+\d\+:\d\+[AaPp][Mm]\s\+\%(<DIR>\|\d\+\)\s\+\)\(\w.*\)$/\2\t\1/'
+ exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$s/^\(\d\{2}-\d\{2}-\d\{2}\s\+\d\+:\d\+[AaPp][Mm]\s\+\%(<DIR>\|\d\+\)\s\+\)\(\w.*\)$/\2\t\1/'
elseif exists("w:netrw_bannercnt") && w:netrw_bannercnt <= line("$")
" call Decho("normal ftp site listing cleanup: bannercnt=".w:netrw_bannercnt." line($)=".line("$"))
- exe 'sil keepj '.w:netrw_bannercnt.',$s/ -> .*$//e'
- exe 'sil keepj '.w:netrw_bannercnt.',$s/^\(\%(\S\+\s\+\)\{7}\S\+\)\s\+\(\S.*\)$/\2\t\1/e'
- exe 'sil keepj '.w:netrw_bannercnt
- keepj call histdel("/",-1)
- keepj call histdel("/",-1)
- keepj call histdel("/",-1)
+ exe 'sil NetrwKeepj '.w:netrw_bannercnt.',$s/ -> .*$//e'
+ exe 'sil NetrwKeepj '.w:netrw_bannercnt.',$s/^\(\%(\S\+\s\+\)\{7}\S\+\)\s\+\(\S.*\)$/\2\t\1/e'
+ exe 'sil NetrwKeepj '.w:netrw_bannercnt
+ NetrwKeepj call histdel("/",-1)
+ NetrwKeepj call histdel("/",-1)
+ NetrwKeepj call histdel("/",-1)
endif
endif
" if exists("w:netrw_bannercnt") && w:netrw_bannercnt <= line("$") " Decho
-" exe "keepj ".w:netrw_bannercnt.',$g/^./call Decho("listing: ".getline("."))'
+" exe "NetrwKeepj ".w:netrw_bannercnt.',$g/^./call Decho("listing: ".getline("."))'
" endif " Decho
" call Dret("s:NetrwRemoteListing 0")
@@ -8877,7 +9363,7 @@ fun! s:NetrwRemoteRm(usrhost,path) range
" remove multiple files and directories
while ctr <= a:lastline
- exe "keepj ".ctr
+ exe "NetrwKeepj ".ctr
let ok= s:NetrwRemoteRmFile(a:path,s:NetrwGetWord(),all)
if ok =~ 'q\%[uit]'
break
@@ -8890,8 +9376,8 @@ fun! s:NetrwRemoteRm(usrhost,path) range
" refresh the (remote) directory listing
" call Decho("refresh remote directory listing")
- keepj call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./'))
- keepj call netrw#RestorePosn(svpos)
+ NetrwKeepj call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./'))
+ NetrwKeepj call netrw#RestorePosn(svpos)
" call Dret("s:NetrwRemoteRm")
endfun
@@ -8931,14 +9417,14 @@ fun! s:NetrwRemoteRmFile(path,rmfile,all)
if path =~ '^\a\+://'
let path= substitute(path,'^\a\+://[^/]\+/','','')
endif
- sil! keepj .,$d
+ sil! NetrwKeepj .,$d
call s:NetrwRemoteFtpCmd(path,"delete ".'"'.a:rmfile.'"')
else
" call Decho("case ssh: g:netrw_rm_cmd<".g:netrw_rm_cmd.">")
let netrw_rm_cmd= s:MakeSshCmd(g:netrw_rm_cmd)
" call Decho("netrw_rm_cmd<".netrw_rm_cmd.">")
if !exists("b:netrw_curdir")
- keepj call netrw#ErrorMsg(s:ERROR,"for some reason b:netrw_curdir doesn't exist!",53)
+ NetrwKeepj call netrw#ErrorMsg(s:ERROR,"for some reason b:netrw_curdir doesn't exist!",53)
let ok="q"
else
let remotedir= substitute(b:netrw_curdir,'^.*//[^/]\+/\(.*\)$','\1','')
@@ -8953,7 +9439,7 @@ fun! s:NetrwRemoteRmFile(path,rmfile,all)
" call Decho("call system(".netrw_rm_cmd.")")
let ret= system(netrw_rm_cmd)
if ret != 0
- keepj call netrw#ErrorMsg(s:WARNING,"cmd<".netrw_rm_cmd."> failed",60)
+ NetrwKeepj call netrw#ErrorMsg(s:WARNING,"cmd<".netrw_rm_cmd."> failed",60)
endif
" call Decho("returned=".ret." errcode=".v:shell_error)
endif
@@ -8980,7 +9466,7 @@ fun! s:NetrwRemoteRmFile(path,rmfile,all)
if all || ok =~ 'y\%[es]' || ok == ""
if exists("w:netrw_method") && (w:netrw_method == 2 || w:netrw_method == 3)
- keepj call s:NetrwRemoteFtpCmd(a:path,"rmdir ".a:rmfile)
+ NetrwKeepj call s:NetrwRemoteFtpCmd(a:path,"rmdir ".a:rmfile)
else
let rmfile = substitute(a:path.a:rmfile,'/$','','')
let netrw_rmdir_cmd = s:MakeSshCmd(netrw#WinPath(g:netrw_rmdir_cmd)).' '.shellescape(netrw#WinPath(rmfile))
@@ -8996,7 +9482,7 @@ fun! s:NetrwRemoteRmFile(path,rmfile,all)
" call Decho("returned=".ret." errcode=".v:shell_error)
if v:shell_error != 0 && !exists("g:netrw_quiet")
- keepj call netrw#ErrorMsg(s:ERROR,"unable to remove directory<".rmfile."> -- is it empty?",22)
+ NetrwKeepj call netrw#ErrorMsg(s:ERROR,"unable to remove directory<".rmfile."> -- is it empty?",22)
endif
endif
endif
@@ -9040,7 +9526,7 @@ fun! s:NetrwRemoteRename(usrhost,path) range
endif
if exists("w:netrw_method") && (w:netrw_method == 2 || w:netrw_method == 3)
- keepj call s:NetrwRemoteFtpCmd(a:path,"rename ".oldname." ".newname)
+ NetrwKeepj call s:NetrwRemoteFtpCmd(a:path,"rename ".oldname." ".newname)
else
let oldname= shellescape(a:path.oldname)
let newname= shellescape(a:path.newname)
@@ -9055,7 +9541,7 @@ fun! s:NetrwRemoteRename(usrhost,path) range
" attempt to rename files/directories
while ctr <= a:lastline
- exe "keepj ".ctr
+ exe "NetrwKeepj ".ctr
let oldname= s:NetrwGetWord()
" call Decho("oldname<".oldname.">")
@@ -9078,8 +9564,8 @@ fun! s:NetrwRemoteRename(usrhost,path) range
endif
" refresh the directory
- keepj call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./'))
- keepj call netrw#RestorePosn(svpos)
+ NetrwKeepj call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./'))
+ NetrwKeepj call netrw#RestorePosn(svpos)
" call Dret("NetrwRemoteRename")
endfun
@@ -9127,10 +9613,10 @@ fun! netrw#FileUrlRead(fname)
" call Decho("fname2396<".fname2396.">")
" call Decho("plainfname<".plainfname.">")
exe "sil doau BufReadPre ".fname2396e
- exe 'keepj r '.plainfname
+ exe 'NetrwKeepj r '.plainfname
exe 'sil! bdelete '.plainfname
exe 'keepalt file! '.plainfname
- keepj 1d
+ NetrwKeepj 1d
" call Decho("setl nomod")
setl nomod
" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
@@ -9152,26 +9638,28 @@ fun! netrw#LocalBrowseCheck(dirname)
" call Decho("isdir<".a:dirname.">=".isdirectory(a:dirname).((exists("s:treeforceredraw")? " treeforceredraw" : "")))
" call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo)
" call Dredir("ls!","ls!")
+ norm! m`
let ykeep= @@
if isdirectory(a:dirname)
" call Decho("is-directory ft<".&ft."> b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : " doesn't exist")."> dirname<".a:dirname.">"." line($)=".line("$")." ft<".&ft."> g:netrw_fastbrowse=".g:netrw_fastbrowse)
let svposn= netrw#SavePosn()
+
if &ft != "netrw" || (exists("b:netrw_curdir") && b:netrw_curdir != a:dirname) || g:netrw_fastbrowse <= 1
" call Decho("case 1 : ft=".&ft)
- sil! keepj keepalt call s:NetrwBrowse(1,a:dirname)
- keepalt call netrw#RestorePosn(svposn)
+ sil! NetrwKeepj keepalt call s:NetrwBrowse(1,a:dirname)
+ NetrwKeepj keepalt call netrw#RestorePosn(svposn)
elseif &ft == "netrw" && line("$") == 1
" call Decho("case 2 (ft≡netrw && line($)≡1)")
- sil! keepj keepalt call s:NetrwBrowse(1,a:dirname)
- keepalt call netrw#RestorePosn(svposn)
+ sil! NetrwKeepj keepalt call s:NetrwBrowse(1,a:dirname)
+ NetrwKeepj keepalt call netrw#RestorePosn(svposn)
elseif exists("s:treeforceredraw")
" call Decho("case 3 (treeforceredraw)")
unlet s:treeforceredraw
- sil! keepj keepalt call s:NetrwBrowse(1,a:dirname)
- keepalt call netrw#RestorePosn(svposn)
+ sil! NetrwKeepj keepalt call s:NetrwBrowse(1,a:dirname)
+ NetrwKeepj keepalt call netrw#RestorePosn(svposn)
endif
" call Dret("netrw#LocalBrowseCheck")
@@ -9257,7 +9745,7 @@ fun! s:LocalBrowseRefresh()
let g:netrw_quickhelp= g:netrw_quickhelp - 1
endif
" call Decho("#3: quickhelp=".g:netrw_quickhelp)
- keepj call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./'))
+ NetrwKeepj call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./'))
endif
let ibl= ibl + 1
endfor
@@ -9353,7 +9841,7 @@ fun! s:LocalListing()
let dirnamelen = strlen(b:netrw_curdir)
let filelist = glob(s:ComposePath(dirname,"*"),0,1)
let filelist = filelist + glob(s:ComposePath(dirname,".*"),0,1)
-" call Decho("filelist=".filelist)
+" call Decho("filelist=".string(filelist))
if g:netrw_cygwin == 0 && (has("win32") || has("win95") || has("win64") || has("win16"))
" call Decho("filelist=".string(filelist))
@@ -9446,29 +9934,29 @@ fun! s:LocalListing()
" call Decho("getftime(".filename.")=".getftime(filename))
let t = getftime(filename)
let ft = strpart("000000000000000000",1,18-strlen(t)).t
-" call Decho("exe keepjumps put ='".ft.'/'.filename."'")
+" call Decho("exe NetrwKeepj put ='".ft.'/'.filename."'")
let ftpfile= ft.'/'.pfile
- sil! keepj put=ftpfile
+ sil! NetrwKeepj put=ftpfile
elseif g:netrw_sort_by =~ "^s"
" sort by size (handles file sizes up to 1 quintillion bytes, US)
" call Decho("getfsize(".filename.")=".getfsize(filename))
let sz = getfsize(filename)
let fsz = strpart("000000000000000000",1,18-strlen(sz)).sz
-" call Decho("exe keepj put ='".fsz.'/'.filename."'")
+" call Decho("exe NetrwKeepj put ='".fsz.'/'.filename."'")
let fszpfile= fsz.'/'.pfile
- sil! keepj put =fszpfile
+ sil! NetrwKeepj put =fszpfile
else
" sort by name
-" call Decho("exe keepjumps put ='".pfile."'")
- sil! keepj put=pfile
+" call Decho("exe NetrwKeepj put ='".pfile."'")
+ sil! NetrwKeepj put=pfile
endif
endfor
" cleanup any windows mess at end-of-line
- sil! keepj g/^$/d
- sil! keepj %s/\r$//e
+ sil! NetrwKeepj g/^$/d
+ sil! NetrwKeepj %s/\r$//e
call histdel("/",-1)
" call Decho("exe setl ts=".(g:netrw_maxfilenamelen+1))
exe "setl ts=".(g:netrw_maxfilenamelen+1)
@@ -9505,7 +9993,7 @@ fun! s:NetrwLocalExecute(cmd)
endfun
" ---------------------------------------------------------------------
-" s:NetrwLocalRename: rename a remote file or directory {{{2
+" s:NetrwLocalRename: rename a local file or directory {{{2
fun! s:NetrwLocalRename(path) range
" call Dfunc("NetrwLocalRename(path<".a:path.">)")
@@ -9540,7 +10028,7 @@ fun! s:NetrwLocalRename(path) range
" attempt to rename files/directories
while ctr <= a:lastline
- exe "keepj ".ctr
+ exe "NetrwKeepj ".ctr
" sanity checks
if line(".") < w:netrw_bannercnt
@@ -9553,7 +10041,7 @@ fun! s:NetrwLocalRename(path) range
continue
endif
- keepj norm! 0
+ NetrwKeepj norm! 0
let oldname= s:ComposePath(a:path,curword)
" call Decho("oldname<".oldname.">")
@@ -9570,8 +10058,8 @@ fun! s:NetrwLocalRename(path) range
" refresh the directory
" call Decho("refresh the directory listing")
- keepj call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./'))
- keepj call netrw#RestorePosn(svpos)
+ NetrwKeepj call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./'))
+ NetrwKeepj call netrw#RestorePosn(svpos)
let @@= ykeep
" call Dret("NetrwLocalRename")
@@ -9608,7 +10096,7 @@ fun! s:NetrwLocalRm(path) range
let ctr = a:firstline
while ctr <= a:lastline
- exe "keepj ".ctr
+ exe "NetrwKeepj ".ctr
" sanity checks
if line(".") < w:netrw_bannercnt
@@ -9633,8 +10121,8 @@ fun! s:NetrwLocalRm(path) range
" refresh the directory
" call Decho("bufname<".bufname("%").">")
if bufname("%") != "NetrwMessage"
- keepj call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./'))
- keepj call netrw#RestorePosn(svpos)
+ NetrwKeepj call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./'))
+ NetrwKeepj call netrw#RestorePosn(svpos)
endif
let @@= ykeep
@@ -9649,7 +10137,7 @@ fun! s:NetrwLocalRmFile(path,fname,all)
let all= a:all
let ok = ""
- keepj norm! 0
+ NetrwKeepj norm! 0
let rmfile= s:ComposePath(a:path,a:fname)
" call Decho("rmfile<".rmfile.">")
@@ -9745,7 +10233,7 @@ fun! netrw#Access(ilist)
endfun
" ------------------------------------------------------------------------
-" netrw#RestorePosn: restores the cursor and file position as saved by NetrwSavePosn() {{{2
+" netrw#RestorePosn: restores the cursor and file position as saved by netrw#SavePosn() {{{2
fun! netrw#RestorePosn(...)
" call Dfunc("netrw#RestorePosn() a:0=".a:0." winnr=".(exists("w:netrw_winnr")? w:netrw_winnr : -1)." line=".(exists("w:netrw_line")? w:netrw_line : -1)." col=".(exists("w:netrw_col")? w:netrw_col : -1)." hline=".(exists("w:netrw_hline")? w:netrw_hline : -1))
let eikeep= &ei
@@ -9759,60 +10247,60 @@ fun! netrw#RestorePosn(...)
if a:0 > 0
exe "keepj ".a:1
endif
-" call Decho("a:1 = ".((a:0 > 0)? a:1 : 'n/a'))
-" call Decho("liststyle = ".(exists("liststyle")? liststyle : 'n/a'). " w:netrw_liststyle=".(exists("w:netrw_liststyle")? w:netrw_liststyle : 'n/a'))
+" "call Decho("a:1 = ".((a:0 > 0)? a:1 : 'n/a'))
+" "call Decho("liststyle = ".(exists("liststyle")? liststyle : 'n/a'). " w:netrw_liststyle=".(exists("w:netrw_liststyle")? w:netrw_liststyle : 'n/a'))
if exists("liststyle") && exists("w:netrw_liststyle") && liststyle != w:netrw_liststyle
let usesrch= 1
else
let usesrch= 0
endif
-" call Decho("winh = ".(exists("w:netrw_winh")? w:netrw_winh : -1))
-" call Decho("winw = ".(exists("w:netrw_winw")? w:netrw_winw : -1))
-" call Decho("cur winheight=".winheight(0)." winwidth=".winwidth(0))
-" call Decho("w:netrw_winfile = ".(exists("w:netrw_winfile")? w:netrw_winfile : 'n/a'))
+" "call Decho("winh = ".(exists("w:netrw_winh")? w:netrw_winh : -1))
+" "call Decho("winw = ".(exists("w:netrw_winw")? w:netrw_winw : -1))
+" "call Decho("cur winheight=".winheight(0)." winwidth=".winwidth(0))
+" "call Decho("w:netrw_winfile = ".(exists("w:netrw_winfile")? w:netrw_winfile : 'n/a'))
" restore window
if exists("w:netrw_winnr")
-" call Decho("restore window: exe sil! ".w:netrw_winnr."wincmd w")
+" "call Decho("restore window: exe sil! ".w:netrw_winnr."wincmd w")
exe "sil! ".w:netrw_winnr."wincmd w"
endif
- if v:shell_error == 0
+" if v:shell_error == 0
" as suggested by Bram M: redraw on no error
" allows protocol error messages to remain visible
" redraw!
- endif
+" endif
" restore top-of-screen line
if exists("w:netrw_hline")
-" call Decho("restore topofscreen: exe keepj norm! ".w:netrw_hline."G0z")
+" "call Decho("restore topofscreen: exe keepj norm! ".w:netrw_hline."G0z")
exe "keepj norm! ".w:netrw_hline."G0z\<CR>"
endif
" restore position
" when the window's height x width has changed, the line,col is no longer useful
if w:netrw_winh == winheight(0) && w:netrw_winw == winwidth(0) && exists("w:netrw_line") && exists("w:netrw_col") && !usesrch
-" call Decho("using posn: exe keepj norm! ".w:netrw_line."G0".w:netrw_col."|")
+" "call Decho("using posn: exe keepj norm! ".w:netrw_line."G0".w:netrw_col."|")
exe "keepj norm! ".w:netrw_line."G0".w:netrw_col."\<bar>"
elseif exists("w:netrw_winfile")
if !search('\<'.escape(w:netrw_winfile,g:netrw_fname_escape),'cw')
if exists("w:netrw_bannercnt")
-" call Decho("using bannercnt: win#".winnr()." ".winheight(0)."x".winwidth(0)." w:netrw_winfile<".w:netrw_winfile.">")
+" "call Decho("using bannercnt: win#".winnr()." ".winheight(0)."x".winwidth(0)." w:netrw_winfile<".w:netrw_winfile.">")
exe "keepj ".w:netrw_bannercnt
norm! 0
else
" go to upper left corner
-" call Decho("goto ulc: win#".winnr()." ".winheight(0)."x".winwidth(0)." w:netrw_winfile<".w:netrw_winfile.">")
+" "call Decho("goto ulc: win#".winnr()." ".winheight(0)."x".winwidth(0)." w:netrw_winfile<".w:netrw_winfile.">")
keepj 1
norm! 0
endif
else
-" call Decho("used search: w:netrw_winfile<".w:netrw_winfile.">")
+" "call Decho("used search: w:netrw_winfile<".w:netrw_winfile.">")
endif
else
-" call Decho("goto ulc: win#".winnr()." ".winheight(0)."x".winwidth(0))
+" "call Decho("goto ulc: win#".winnr()." ".winheight(0)."x".winwidth(0))
keepj 1
norm! 0
endif
@@ -9838,22 +10326,22 @@ fun! netrw#SavePosn()
let w:netrw_winnr= winnr()
let w:netrw_line = line(".")
let w:netrw_col = virtcol(".")
-" call Decho("currently, win#".w:netrw_winnr." line#".w:netrw_line." col#".w:netrw_col)
+" "call Decho("currently, win#".w:netrw_winnr." line#".w:netrw_line." col#".w:netrw_col)
" save filename under cursor
-" call Decho("line#".line(".")." w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'n/a'))
+" "call Decho("line#".line(".")." w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'n/a'))
if exists("w:netrw_bannercnt") && line(".") >= w:netrw_bannercnt && &ft == "netrw"
- let winfile = "|let w:netrw_winfile='".s:NetrwGetWord()."'"
+ let winfile = "|let w:netrw_winfile=\"".fnameescape(s:NetrwGetWord())."\""
else
let winfile= ""
endif
-" call Decho("winfile<".winfile.">")
+" "call Decho("winfile<".winfile.">")
if exists("w:netrw_liststyle")
let liststyle = "|let liststyle=".w:netrw_liststyle
else
let liststyle= ""
endif
-" call Decho("liststyle=".liststyle)
+" "call Decho("liststyle=".liststyle)
" Save top-of-screen line
keepj norm! H0
@@ -9951,6 +10439,33 @@ fun! s:ComposePath(base,subdir)
endfun
" ---------------------------------------------------------------------
+" s:DeleteBookmark: deletes a file/directory from Netrw's bookmark system {{{2
+" Related Functions: s:MakeBookmark() s:NetrwBookHistHandler() s:NetrwBookmark()
+fun! s:DeleteBookmark(fname)
+" call Dfunc("s:DeleteBookmark(fname<".a:fname.">)")
+ call s:MergeBookmarks()
+
+ if exists("g:netrw_bookmarklist")
+ let indx= index(g:netrw_bookmarklist,a:fname)
+ if indx == -1
+ let indx= 0
+ while indx < len(g:netrw_bookmarklist)
+ if g:netrw_bookmarklist[indx] =~ a:fname
+ call remove(g:netrw_bookmarklist,indx)
+ let indx= indx - 1
+ endif
+ let indx= indx + 1
+ endwhile
+ else
+ " remove exact match
+ call remove(g:netrw_bookmarklist,indx)
+ endif
+ endif
+
+" call Dret("s:DeleteBookmark")
+endfun
+
+" ---------------------------------------------------------------------
" s:FileReadable: o/s independent filereadable {{{2
fun! s:FileReadable(fname)
" call Dfunc("s:FileReadable(fname<".a:fname.">)")
@@ -9983,13 +10498,13 @@ fun! s:GetTempfile(fname)
" sanity check -- does the temporary file's directory exist?
if !isdirectory(substitute(tmpfile,'[^/]\+$','','e'))
" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
- keepj call netrw#ErrorMsg(s:ERROR,"your <".substitute(tmpfile,'[^/]\+$','','e')."> directory is missing!",2)
+ NetrwKeepj call netrw#ErrorMsg(s:ERROR,"your <".substitute(tmpfile,'[^/]\+$','','e')."> directory is missing!",2)
" call Dret("s:GetTempfile getcwd<".getcwd().">")
return ""
endif
" let netrw#NetSource() know about the tmpfile
- let s:netrw_tmpfile= tmpfile " used by netrw#NetSource() and netrw#NetrwBrowseX()
+ let s:netrw_tmpfile= tmpfile " used by netrw#NetSource() and netrw#BrowseX()
" call Decho("tmpfile<".tmpfile."> s:netrw_tmpfile<".s:netrw_tmpfile.">")
" o/s dependencies
@@ -10057,6 +10572,45 @@ fun! s:MakeSshCmd(sshcmd)
endfun
" ---------------------------------------------------------------------
+" s:MakeBookmark: enters a bookmark into Netrw's bookmark system {{{2
+fun! s:MakeBookmark(fname)
+" call Dfunc("s:MakeBookmark(fname<".a:fname.">)")
+
+ if !exists("g:netrw_bookmarklist")
+ let g:netrw_bookmarklist= []
+ endif
+
+ if index(g:netrw_bookmarklist,a:fname) == -1
+ " curdir not currently in g:netrw_bookmarklist, so include it
+ if isdirectory(a:fname) && a:fname !~ '/$'
+ call add(g:netrw_bookmarklist,a:fname.'/')
+ elseif a:fname !~ '/'
+ call add(g:netrw_bookmarklist,getcwd()."/".a:fname)
+ else
+ call add(g:netrw_bookmarklist,a:fname)
+ endif
+ call sort(g:netrw_bookmarklist)
+ endif
+
+" call Dret("s:MakeBookmark")
+endfun
+
+" ---------------------------------------------------------------------
+" s:MergeBookmarks: merge current bookmarks with saved bookmarks {{{2
+fun! s:MergeBookmarks()
+" call Dfunc("s:MergeBookmarks()")
+ " get bookmarks from .netrwbook file
+ let savefile= s:NetrwHome()."/.netrwbook"
+ if filereadable(savefile)
+" call Decho("merge bookmarks (active and file)")
+ NetrwKeepj call s:NetrwBookHistSave()
+" call Decho("bookmark delete savefile<".savefile.">")
+ NetrwKeepj call delete(savefile)
+ endif
+" call Dret("s:MergeBookmarks")
+endfun
+
+" ---------------------------------------------------------------------
" s:NetrwBMShow: {{{2
fun! s:NetrwBMShow()
" call Dfunc("s:NetrwBMShow()")
@@ -10069,7 +10623,7 @@ fun! s:NetrwBMShow()
if bmshowfuncs != []
let bmshowfunc = substitute(bmshowfuncs[0],'^.*:\(call.*BMShow()\).*$','\1','')
if bmshowfunc =~ '^call.*BMShow()'
- exe "sil! keepj ".bmshowfunc
+ exe "sil! NetrwKeepj ".bmshowfunc
endif
endif
endif
@@ -10176,7 +10730,7 @@ fun! s:NetrwDelete(path)
let result= delete(path)
endif
if result < 0
- keepj call netrw#ErrorMsg(s:WARNING,"delete(".path.") failed!",71)
+ NetrwKeepj call netrw#ErrorMsg(s:WARNING,"delete(".path.") failed!",71)
endif
" call Dret("s:NetrwDelete ".result)
@@ -10208,13 +10762,13 @@ fun! s:NetrwEnew(...)
if exists("b:netrw_option") |let netrw_option = b:netrw_option |endif
if exists("b:netrw_prvdir") |let netrw_prvdir = b:netrw_prvdir |endif
- keepj call s:NetrwOptionRestore("w:")
-" call Decho("generate a buffer with keepjumps keepalt enew!")
+ NetrwKeepj call s:NetrwOptionRestore("w:")
+" call Decho("generate a buffer with NetrwKeepj keepalt enew!")
let netrw_keepdiff= &l:diff
- noswapfile keepj keepalt enew!
+ noswapfile NetrwKeepj keepalt enew!
let &l:diff= netrw_keepdiff
" call Decho("bufnr($)=".bufnr("$")." winnr($)=".winnr("$"))
- keepj call s:NetrwOptionSave("w:")
+ NetrwKeepj call s:NetrwOptionSave("w:")
" copy function-local-variables to buffer variable equivalents
" call Decho("copy function-local variables back to buffer netrw variables")
@@ -10253,6 +10807,22 @@ fun! s:NetrwEnew(...)
endfun
" ---------------------------------------------------------------------
+" s:NetrwExe: executes a string using "!" {{{2
+fun! s:NetrwExe(cmd)
+" call Dfunc("s:NetrwExe(a:cmd)")
+ if has("win32") && &shell !~? 'cmd' && !g:netrw_cygwin
+ let savedShell=[&shell,&shellcmdflag,&shellxquote,&shellxescape,&shellquote,&shellpipe,&shellredir,&shellslash]
+ set shell& shellcmdflag& shellxquote& shellxescape&
+ set shellquote& shellpipe& shellredir& shellslash&
+ exe a:cmd
+ let [&shell,&shellcmdflag,&shellxquote,&shellxescape,&shellquote,&shellpipe,&shellredir,&shellslash] = savedShell
+ else
+ exe a:cmd
+ endif
+" call Dret("s:NetrwExe")
+endfun
+
+" ---------------------------------------------------------------------
" s:NetrwInsureWinVars: insure that a netrw buffer has its w: variables in spite of a wincmd v or s {{{2
fun! s:NetrwInsureWinVars()
" call Dfunc("s:NetrwInsureWinVars() win#".winnr())
@@ -10286,7 +10856,7 @@ fun! s:NetrwLcd(newdir)
" call Dfunc("s:NetrwLcd(newdir<".a:newdir.">)")
try
- exe 'keepj sil lcd '.fnameescape(a:newdir)
+ exe 'NetrwKeepj sil lcd '.fnameescape(a:newdir)
catch /^Vim\%((\a\+)\)\=:E344/
" Vim's lcd fails with E344 when attempting to go above the 'root' of a Windows share.
" Therefore, detect if a Windows share is present, and if E344 occurs, just settle at
@@ -10296,7 +10866,7 @@ fun! s:NetrwLcd(newdir)
if (has("win32") || has("win95") || has("win64") || has("win16")) && !g:netrw_cygwin
if a:newdir =~ '^\\\\\w\+' || a:newdir =~ '^//\w\+'
let dirname = '\'
- exe 'keepj sil lcd '.fnameescape(dirname)
+ exe 'NetrwKeepj sil lcd '.fnameescape(dirname)
endif
endif
catch /^Vim\%((\a\+)\)\=:E472/
@@ -10388,9 +10958,9 @@ endfun
fun! s:RemoteSystem(cmd)
" call Dfunc("s:RemoteSystem(cmd<".a:cmd.">)")
if !executable(g:netrw_ssh_cmd)
- keepj call netrw#ErrorMsg(s:ERROR,"g:netrw_ssh_cmd<".g:netrw_ssh_cmd."> is not executable!",52)
+ NetrwKeepj call netrw#ErrorMsg(s:ERROR,"g:netrw_ssh_cmd<".g:netrw_ssh_cmd."> is not executable!",52)
elseif !exists("b:netrw_curdir")
- keepj call netrw#ErrorMsg(s:ERROR,"for some reason b:netrw_curdir doesn't exist!",53)
+ NetrwKeepj call netrw#ErrorMsg(s:ERROR,"for some reason b:netrw_curdir doesn't exist!",53)
else
let cmd = s:MakeSshCmd(g:netrw_ssh_cmd." USEPORT HOSTNAME")
let remotedir= substitute(b:netrw_curdir,'^.*//[^/]\+/\(.*\)$','\1','')
@@ -10447,13 +11017,21 @@ fun! s:NetrwRexplore(islocal,dirname)
" call Decho("ft=".&ft." win#".winnr()." w:netrw_rexfile<".(exists("w:netrw_rexfile")? w:netrw_rexfile : 'n/a').">")
if &ft == "netrw" && exists("w:netrw_rexfile") && w:netrw_rexfile != ""
+ " a :Rex while in a netrw buffer means: edit the file in w:netrw_rexfile
" call Decho("in netrw buffer, will edit file<".w:netrw_rexfile.">")
- exe "e ".w:netrw_rexfile
+ exe "NetrwKeepj e ".w:netrw_rexfile
unlet w:netrw_rexfile
" call Dret("s:NetrwRexplore returning from netrw to buf#".bufnr("%")."<".bufname("%")."> (ft=".&ft.")")
return
+" else " Decho
+" call Decho("treating as not-netrw-buffer: ft=".&ft.((&ft == "netrw")? " == netrw" : "!= netrw"))
+" call Decho("treating as not-netrw-buffer: w:netrw_rexfile<".((exists("w:netrw_rexfile"))? w:netrw_rexfile : 'n/a').">")
endif
+ " ---------------------------
+ " :Rex issued while in a file
+ " ---------------------------
+
" record current file so :Rex can return to it from netrw
let w:netrw_rexfile= expand("%")
@@ -10463,16 +11041,26 @@ fun! s:NetrwRexplore(islocal,dirname)
endif
" call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo)
if w:netrw_rexlocal
- keepj call netrw#LocalBrowseCheck(w:netrw_rexdir)
- else
+ if g:netrw_keepj =~ "keepj"
+ keepj call netrw#LocalBrowseCheck(w:netrw_rexdir)
+ else
+ call netrw#LocalBrowseCheck(w:netrw_rexdir)
+ endif
+ elseif g:netrw_keepj =~ "keepj"
keepj call s:NetrwBrowse(0,w:netrw_rexdir)
+ else
+ call s:NetrwBrowse(0,w:netrw_rexdir)
endif
if exists("s:initbeval")
setl beval
endif
if exists("s:rexposn_".bufnr("%"))
" call Decho("restore posn, then unlet s:rexposn_".bufnr('%'))
- keepj call netrw#RestorePosn(s:rexposn_{bufnr('%')})
+ if g:netrw_keepj =~ "keepj"
+ keepj call netrw#RestorePosn(s:rexposn_{bufnr('%')})
+ else
+ call netrw#RestorePosn(s:rexposn_{bufnr('%')})
+ endif
unlet s:rexposn_{bufnr('%')}
else
" call Decho("s:rexposn_".bufnr('%')." doesn't exist")
@@ -10559,6 +11147,54 @@ fun! s:SetRexDir(islocal,dirname)
endfun
" ---------------------------------------------------------------------
+" s:ShowLink: used to modify thin and tree listings to show links {{{2
+fun! s:ShowLink()
+" " call Dfunc("s:ShowLink()")
+" " call Decho("b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : "doesn't exist").">")
+" " call Decho(printf("line#%4d: %s",line("."),getline(".")))
+ if exists("b:netrw_curdir")
+ norm! $?\a
+ let fname = b:netrw_curdir.'/'.s:NetrwGetWord()
+ let resname = resolve(fname)
+ if resname =~ '^\M'.b:netrw_curdir
+ let dirlen = strlen(b:netrw_curdir)
+ let resname = strpart(resname,dirlen+1)
+" " call Decho("resname<".resname."> (b:netrw_curdir elided)")
+" " else " Decho
+" " call Decho("resname<".fname.">")
+ endif
+ let modline = getline(".")."\t --> ".resname
+" " call Decho("fname <".fname.">")
+" " call Decho("modline<".modline.">")
+ setl noro ma
+ call setline(".",modline)
+ setl ro noma nomod
+ endif
+" " call Dret("s:ShowLink".((exists("fname")? ' : '.fname : 'n/a')))
+endfun
+
+" ---------------------------------------------------------------------
+" s:ShowStyle: {{{2
+fun! s:ShowStyle()
+ if !exists("w:netrw_liststyle")
+ let liststyle= g:netrw_liststyle
+ else
+ let liststyle= w:netrw_liststyle
+ endif
+ if liststyle == s:THINLIST
+ return s:THINLIST.":thin"
+ elseif liststyle == s:LONGLIST
+ return s:LONGLIST.":long"
+ elseif liststyle == s:WIDELIST
+ return s:WIDELIST.":wide"
+ elseif liststyle == s:TREELIST
+ return s:TREELIST.":tree"
+ else
+ return 'n/a'
+ endif
+endfun
+
+" ---------------------------------------------------------------------
" s:Strlen: this function returns the length of a string, even if its using multi-byte characters. {{{2
" Solution from Nicolai Weibull, vim docs (:help strlen()),
" Tony Mechelynck, and my own invention.
@@ -10593,7 +11229,7 @@ fun! s:Strlen(x)
call setline(line("."),a:x)
let ret= virtcol("$") - 1
d
- keepj norm! k
+ NetrwKeepj norm! k
let &l:mod= modkeep
else
@@ -10622,17 +11258,17 @@ fun! s:TreeListMove(dir)
if curline !~ '/$'
" call Decho('regfile')
if a:dir == '[' && prvline != ''
- keepj norm! 0
+ NetrwKeepj norm! 0
let nl = search('^'.indentm1.'[^'.s:treedepthstring.']','bWe') " search backwards from regular file
" call Decho("regfile srch back: ".nl)
elseif a:dir == ']' && nxtline != ''
- keepj norm! $
+ NetrwKeepj norm! $
let nl = search('^'.indentm1.'[^'.s:treedepthstring.']','We') " search forwards from regular file
" call Decho("regfile srch fwd: ".nl)
endif
elseif a:dir == '[' && prvline != ''
- keepj norm! 0
+ NetrwKeepj norm! 0
let curline= line(".")
let nl = search('^'.curindent.'[^'.s:treedepthstring.']','bWe') " search backwards From directory, same indentation
" call Decho("dir srch back ind: ".nl)
@@ -10644,7 +11280,7 @@ fun! s:TreeListMove(dir)
endif
elseif a:dir == ']' && nxtline != ''
- keepj norm! $
+ NetrwKeepj norm! $
let curline = line(".")
let nl = search('^'.curindent.'[^'.s:treedepthstring.']','We') " search forwards from directory, same indentation
" call Decho("dir srch fwd ind: ".nl)
@@ -10672,7 +11308,7 @@ fun! s:UpdateBuffersMenu()
sil emenu Buffers.Refresh\ menu
catch /^Vim\%((\a\+)\)\=:E/
let v:errmsg= ""
- sil keepj call s:NetrwBMShow()
+ sil NetrwKeepj call s:NetrwBMShow()
endtry
endif
" call Dret("s:UpdateBuffersMenu")
diff --git a/runtime/autoload/netrwSettings.vim b/runtime/autoload/netrwSettings.vim
index 541ee65cc..4639909ee 100644
--- a/runtime/autoload/netrwSettings.vim
+++ b/runtime/autoload/netrwSettings.vim
@@ -1,7 +1,7 @@
" netrwSettings.vim: makes netrw settings simpler
-" Date: Aug 27, 2013
+" Date: Dec 30, 2014
" Maintainer: Charles E Campbell <drchipNOSPAM at campbellfamily dot biz>
-" Version: 14
+" Version: 15
" Copyright: Copyright (C) 1999-2007 Charles E. Campbell {{{1
" Permission is hereby granted to use and distribute this code,
" with or without modifications, provided that this copyright
@@ -19,7 +19,7 @@
if exists("g:loaded_netrwSettings") || &cp
finish
endif
-let g:loaded_netrwSettings = "v14"
+let g:loaded_netrwSettings = "v15"
if v:version < 700
echohl WarningMsg
echo "***warning*** this version of netrwSettings needs vim 7.0"
@@ -31,7 +31,7 @@ endif
" NetrwSettings: {{{1
fun! netrwSettings#NetrwSettings()
" this call is here largely just to insure that netrw has been loaded
- call netrw#NetrwSavePosn()
+ call netrw#SavePosn()
if !exists("g:loaded_netrw")
echohl WarningMsg | echomsg "***sorry*** netrw needs to be loaded prior to using NetrwSettings" | echohl None
return
@@ -177,6 +177,7 @@ fun! netrwSettings#NetrwSettings()
put = 'let g:netrw_sort_direction = '.g:netrw_sort_direction
put = 'let g:netrw_sort_options = '.g:netrw_sort_options
put = 'let g:netrw_sort_sequence = '.g:netrw_sort_sequence
+ put = 'let g:netrw_servername = '.g:netrw_servername
put = 'let g:netrw_special_syntax = '.g:netrw_special_syntax
put = 'let g:netrw_ssh_browse_reject = '.g:netrw_ssh_browse_reject
put = 'let g:netrw_ssh_cmd = '.g:netrw_ssh_cmd
diff --git a/runtime/autoload/netrw_gitignore.vim b/runtime/autoload/netrw_gitignore.vim
index 0de902cbb..da3f50bca 100644
--- a/runtime/autoload/netrw_gitignore.vim
+++ b/runtime/autoload/netrw_gitignore.vim
@@ -61,9 +61,16 @@ function! netrw_gitignore#Hide(...)
" convert gitignore patterns to Netrw/Vim regex patterns
let escaped_lines = []
for line in gitignore_lines
- let escaped = line
- let escaped = substitute(escaped, '\.', '\\.', 'g')
- let escaped = substitute(escaped, '*', '.*', 'g')
+ let escaped = line
+ let escaped = substitute(escaped, '\*\*', '*', 'g')
+ let escaped = substitute(escaped, '\.', '\\.', 'g')
+ let escaped = substitute(escaped, '\$', '\\$', 'g')
+ let escaped = substitute(escaped, '*', '.*', 'g')
+ " correction: dot, dollar and asterisks chars shouldn't be escaped when
+ " within regex matching groups.
+ let escaped = substitute(escaped, '\(\[[^]]*\)\zs\\\.', '\.', 'g')
+ let escaped = substitute(escaped, '\(\[[^]]*\)\zs\\\$', '\$', 'g')
+ let escaped = substitute(escaped, '\(\[[^]]*\)\zs\.\*', '*', 'g')
let escaped_lines = add(escaped_lines, escaped)
endfor
diff --git a/runtime/autoload/phpcomplete.vim b/runtime/autoload/phpcomplete.vim
index 0bdcd5d5f..5ddad8887 100644
--- a/runtime/autoload/phpcomplete.vim
+++ b/runtime/autoload/phpcomplete.vim
@@ -3,7 +3,7 @@
" Maintainer: Dávid Szabó ( complex857 AT gmail DOT com )
" Previous Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
" URL: https://github.com/shawncplus/phpcomplete.vim
-" Last Change: 2014 May 30
+" Last Change: 2014 Dec 01
"
" OPTIONS:
"
@@ -94,9 +94,9 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{
" Check if we are inside of PHP markup
let pos = getpos('.')
let phpbegin = searchpairpos('<?', '', '?>', 'bWn',
- \ 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\|comment"')
+ \ 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"')
let phpend = searchpairpos('<?', '', '?>', 'Wn',
- \ 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\|comment"')
+ \ 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"')
if phpbegin == [0,0] && phpend == [0,0]
" We are outside of any PHP markup. Complete HTML
@@ -277,7 +277,7 @@ endfunction
" }}}
function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{
- " Complete everything else -
+ " Complete everything
" + functions, DONE
" + keywords of language DONE
" + defines (constant definitions), DONE
@@ -803,7 +803,7 @@ function! phpcomplete#CompleteClassName(base, kinds, current_namespace, imports)
endif
let relative_name = namespace_part.tag.name
" match base without the namespace part for namespaced base but not namespaced tags, for tagfiles with old ctags
- if !has_key(tag, 'namespace') && index(kinds, tag.kind) != -1 && stridx(tag.name, base[len(namespace_part):]) == 0
+ if !has_key(tag, 'namespace') && index(kinds, tag.kind) != -1 && stridx(tolower(tag.name), tolower(base[len(namespace_part):])) == 0
call add(no_namespace_matches, {'word': leading_slash.relative_name, 'kind': tag.kind, 'menu': tag.filename, 'info': tag.filename })
endif
if has_key(tag, 'namespace') && index(kinds, tag.kind) != -1 && tag.namespace ==? namespace_for_class
@@ -949,12 +949,11 @@ function! phpcomplete#CompleteUserClass(context, base, sccontent, visibility) "
endif
endfor
- let jvars = join(variables, ' ')
- let svars = split(jvars, '\$')
+ let static_vars = split(join(variables, ' '), '\$')
let c_variables = {}
let var_index = 0
- for i in svars
+ for i in static_vars
let c_var = matchstr(i,
\ '^\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze')
if c_var != ''
@@ -1083,7 +1082,6 @@ endfunction
" }}}
function! phpcomplete#GetTaglist(pattern) " {{{
-
let cache_checksum = ''
if g:phpcomplete_cache_taglists == 1
" build a string with format of "<tagfile>:<mtime>$<tagfile2>:<mtime2>..."
@@ -1174,11 +1172,11 @@ function! phpcomplete#GetCurrentInstruction(line_number, col_number, phpbegin) "
" break if we are on a "naked" stop_char (operators, colon, openparent...)
if index(stop_chars, current_char) != -1
let do_break = 1
- " dont break does not look like a "->"
+ " dont break if it does look like a "->"
if (prev_char == '-' && current_char == '>') || (current_char == '-' && next_char == '>')
let do_break = 0
endif
- " dont break if its looks like a "::"
+ " dont break if it does look like a "::"
if (prev_char == ':' && current_char == ':') || (current_char == ':' && next_char == ':')
let do_break = 0
endif
@@ -1358,8 +1356,12 @@ function! phpcomplete#GetCallChainReturnType(classname_candidate, class_candidat
endif
" make @return self, static, $this the same way
" (not exactly what php means by these)
- if returnclass == 'self' || returnclass == 'static' || returnclass == '$this'
- let classname_candidate = a:classname_candidate
+ if returnclass == 'self' || returnclass == 'static' || returnclass == '$this' || returnclass == 'self[]' || returnclass == 'static[]' || returnclass == '$this[]'
+ if returnclass =~ '\[\]$'
+ let classname_candidate = a:classname_candidate.'[]'
+ else
+ let classname_candidate = a:classname_candidate
+ endif
let class_candidate_namespace = a:class_candidate_namespace
else
let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(returnclass, fullnamespace, a:imports)
@@ -1447,6 +1449,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
" Get class name
" Class name can be detected in few ways:
" @var $myVar class
+ " @var class $myVar
" in the same line (php 5.4 (new Class)-> syntax)
" line above
" or line in tags file
@@ -1525,6 +1528,11 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
let object_is_array = (object =~ '\v^[^[]+\[' ? 1 : 0)
let object = matchstr(object, variable_name_pattern)
+ let function_boundary = phpcomplete#GetCurrentFunctionBoundaries()
+ let search_end_line = max([1, function_boundary[0][0]])
+ " -1 makes us ignore the current line (where the completion was invoked
+ let lines = reverse(getline(search_end_line, a:start_line - 1))
+
" check Constant lookup
let constant_object = matchstr(a:context, '\zs'.class_name_pattern.'\ze::')
if constant_object != ''
@@ -1533,21 +1541,20 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
if classname_candidate == ''
" scan the file backwards from current line for explicit type declaration (@var $variable Classname)
- let i = 1 " start from the current line - 1
- while i < a:start_line
- let line = getline(a:start_line - i)
+ for line in lines
" in file lookup for /* @var $foo Class */
if line =~# '@var\s\+'.object.'\s\+'.class_name_pattern
let classname_candidate = matchstr(line, '@var\s\+'.object.'\s\+\zs'.class_name_pattern.'\(\[\]\)\?')
let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, a:current_namespace, a:imports)
break
- elseif line !~ '^\s*$'
- " type indicator comments should be next to the variable
- " non empty lines break the search
+ endif
+ " in file lookup for /* @var Class $foo */
+ if line =~# '@var\s\+'.class_name_pattern.'\s\+'.object
+ let classname_candidate = matchstr(line, '@var\s\+\zs'.class_name_pattern.'\(\[\]\)\?\ze'.'\s\+'.object)
+ let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, a:current_namespace, a:imports)
break
endif
- let i += 1
- endwhile
+ endfor
endif
if classname_candidate != ''
@@ -1555,12 +1562,9 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
" return absolute classname, without leading \
return (class_candidate_namespace == '\' || class_candidate_namespace == '') ? classname_candidate : class_candidate_namespace.'\'.classname_candidate
endif
-
" scan the file backwards from the current line
let i = 1
- while i < a:start_line " {{{
- let line = getline(a:start_line - i)
-
+ for line in lines " {{{
" do in-file lookup of $var = new Class
if line =~# '^\s*'.object.'\s*=\s*new\s\+'.class_name_pattern && !object_is_array
let classname_candidate = matchstr(line, object.'\c\s*=\s*new\s*\zs'.class_name_pattern.'\ze')
@@ -1607,6 +1611,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
for arg in args
if arg =~# object.'\(,\|$\)'
let classname_candidate = matchstr(arg, '\s*\zs'.class_name_pattern.'\ze\s\+'.object)
+ let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, a:current_namespace, a:imports)
break
endif
endfor
@@ -1625,6 +1630,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
for param in docblock.params
if param.name =~? object
let classname_candidate = matchstr(param.type, class_name_pattern.'\(\[\]\)\?')
+ let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, a:current_namespace, a:imports)
break
endif
endfor
@@ -1636,9 +1642,32 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
" assignment for the variable in question with a variable on the right hand side
if line =~# '^\s*'.object.'\s*=&\?\s*'.variable_name_pattern
- let tailing_semicolon = match(line, ';\s*$')
- let tailing_semicolon = tailing_semicolon != -1 ? tailing_semicolon : strlen(getline(a:start_line - i))
- let prev_context = phpcomplete#GetCurrentInstruction(a:start_line - i, tailing_semicolon - 1, b:phpbegin)
+
+ " try to find the next non-comment or string ";" char
+ let start_col = match(line, '^\s*'.object.'\C\s*=\zs&\?\s*'.variable_name_pattern)
+ let filelines = reverse(lines)
+ let [pos, char] = s:getNextCharWithPos(filelines, [a:start_line - i - 1, start_col])
+ let chars_read = 1
+ " read while end of the file
+ while char != 'EOF' && chars_read < 1000
+ let last_pos = pos
+ let [pos, char] = s:getNextCharWithPos(filelines, pos)
+ let chars_read += 1
+ " we got a candidate
+ if char == ';'
+ let synIDName = synIDattr(synID(pos[0] + 1, pos[1] + 1, 0), 'name')
+ " it's not a comment or string, end search
+ if synIDName !~? 'comment\|string'
+ break
+ endif
+ endif
+ endwhile
+
+ let prev_context = phpcomplete#GetCurrentInstruction(last_pos[0] + 1, last_pos[1], b:phpbegin)
+ if prev_context == ''
+ " cannot get previous context give up
+ return
+ endif
let prev_class = phpcomplete#GetClassName(a:start_line - i, prev_context, a:current_namespace, a:imports)
if stridx(prev_class, '\') != -1
@@ -1654,9 +1683,32 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
" assignment for the variable in question with a function on the right hand side
if line =~# '^\s*'.object.'\s*=&\?\s*'.function_invocation_pattern
- let tailing_semicolon = match(line, ';\s*$')
- let tailing_semicolon = tailing_semicolon != -1 ? tailing_semicolon : strlen(getline(a:start_line - i))
- let prev_context = phpcomplete#GetCurrentInstruction(a:start_line - i, tailing_semicolon - 1, b:phpbegin)
+
+ " try to find the next non-comment or string ";" char
+ let start_col = match(line, '\C^\s*'.object.'\s*=\zs&\?\s*'.function_invocation_pattern)
+ let filelines = reverse(lines)
+ let [pos, char] = s:getNextCharWithPos(filelines, [a:start_line - i - 1, start_col])
+ let chars_read = 1
+ " read while end of the file
+ while char != 'EOF' && chars_read < 1000
+ let last_pos = pos
+ let [pos, char] = s:getNextCharWithPos(filelines, pos)
+ let chars_read += 1
+ " we got a candidate
+ if char == ';'
+ let synIDName = synIDattr(synID(pos[0] + 1, pos[1] + 1, 0), 'name')
+ " it's not a comment or string, end search
+ if synIDName !~? 'comment\|string'
+ break
+ endif
+ endif
+ endwhile
+
+ let prev_context = phpcomplete#GetCurrentInstruction(last_pos[0] + 1, last_pos[1], b:phpbegin)
+ if prev_context == ''
+ " cannot get previous context give up
+ return
+ endif
let function_name = matchstr(prev_context, '^'.function_invocation_pattern.'\ze')
let function_name = matchstr(function_name, '^\zs.\+\ze\s*($') " strip the trailing (
@@ -1722,7 +1774,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
endif
let i += 1
- endwhile " }}}
+ endfor " }}}
if classname_candidate != ''
let [classname_candidate, class_candidate_namespace] = phpcomplete#GetCallChainReturnType(classname_candidate, class_candidate_namespace, class_candidate_imports, methodstack)
@@ -1934,7 +1986,7 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam
call search('{')
let endline = line('.')
- let content = join(getline(cfline, endline),"\n")
+ let content = join(getline(cfline, endline), "\n")
" Catch extends
if content =~? 'extends'
let extends_class = matchstr(content, 'class\_s\+'.a:class_name.'\_s\+extends\_s\+\zs'.class_name_pattern.'\ze')
@@ -1962,7 +2014,9 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam
let namespace = '\'
endif
let classlocation = phpcomplete#GetClassLocation(extends_class, namespace)
- if classlocation != '' && filereadable(classlocation)
+ if classlocation == "VIMPHP_BUILTINOBJECT"
+ let result += [phpcomplete#GenerateBuiltinClassStub(g:php_builtin_classes[tolower(extends_class)])]
+ elseif classlocation != '' && filereadable(classlocation)
let full_file_path = fnamemodify(classlocation, ':p')
let result += phpcomplete#GetClassContentsStructure(full_file_path, readfile(full_file_path), extends_class)
elseif tolower(current_namespace) == tolower(namespace)
@@ -1985,6 +2039,51 @@ function! phpcomplete#GetClassContents(classlocation, class_name) " {{{
endfunction
" }}}
+function! phpcomplete#GenerateBuiltinClassStub(class_info) " {{{
+ let re = 'class '.a:class_info['name']." {"
+ for [name, initializer] in items(a:class_info.constants)
+ let re .= "\n\tconst ".name." = ".initializer.";"
+ endfor
+ for [name, info] in items(a:class_info.properties)
+ let re .= "\n\t// @var $".name." ".info.type
+ let re .= "\n\tpublic $".name.";"
+ endfor
+ for [name, info] in items(a:class_info.static_properties)
+ let re .= "\n\t// @var ".name." ".info.type
+ let re .= "\n\tpublic static ".name." = ".info.initializer.";"
+ endfor
+ for [name, info] in items(a:class_info.methods)
+ if name =~ '^__'
+ continue
+ endif
+ let re .= "\n\t/**"
+ let re .= "\n\t * ".name
+ let re .= "\n\t *"
+ let re .= "\n\t * @return ".info.return_type
+ let re .= "\n\t */"
+ let re .= "\n\tpublic function ".name."(".info.signature."){"
+ let re .= "\n\t}"
+ endfor
+ for [name, info] in items(a:class_info.static_methods)
+ let re .= "\n\t/**"
+ let re .= "\n\t * ".name
+ let re .= "\n\t *"
+ let re .= "\n\t * @return ".info.return_type
+ let re .= "\n\t */"
+ let re .= "\n\tpublic static function ".name."(".info.signature."){"
+ let re .= "\n\t}"
+ endfor
+ let re .= "\n}"
+
+ return { 'class': a:class_info['name'],
+ \ 'content': re,
+ \ 'namespace': '',
+ \ 'imports': {},
+ \ 'file': 'VIMPHP_BUILTINOBJECT',
+ \ 'mtime': 0,
+ \ }
+endfunction " }}}
+
function! phpcomplete#GetDocBlock(sccontent, search) " {{{
let i = 0
let l = 0
@@ -2295,6 +2394,9 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
endfor
endif
endif
+ if exists('no_namespace_candidate')
+ unlet no_namespace_candidate
+ endif
endfor
endif
let i += 1
@@ -2307,6 +2409,40 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
endfunction
" }}}
+function! phpcomplete#GetCurrentFunctionBoundaries() " {{{
+ let old_cursor_pos = [line('.'), col('.')]
+ let current_line_no = old_cursor_pos[0]
+ let function_pattern = '\c\(.*\%#\)\@!\_^\s*\zs\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function\_.\{-}(\_.\{-})\_.\{-}{'
+
+ let func_start_pos = searchpos(function_pattern, 'Wbc')
+ if func_start_pos == [0, 0]
+ call cursor(old_cursor_pos[0], old_cursor_pos[1])
+ return 0
+ endif
+
+ " get the line where the function declaration actually started
+ call search('\cfunction\_.\{-}(\_.\{-})\_.\{-}{', 'Wce')
+
+ " get the position of the function block's closing "}"
+ let func_end_pos = searchpairpos('{', '', '}', 'W')
+ if func_end_pos == [0, 0]
+ " there is a function start but no end found, assume that we are in a
+ " function but the user did not typed the closing "}" yet and the
+ " function runs to the end of the file
+ let func_end_pos = [line('$'), len(getline(line('$')))]
+ endif
+
+ " Decho func_start_pos[0].' <= '.current_line_no.' && '.current_line_no.' <= '.func_end_pos[0]
+ if func_start_pos[0] <= current_line_no && current_line_no <= func_end_pos[0]
+ call cursor(old_cursor_pos[0], old_cursor_pos[1])
+ return [func_start_pos, func_end_pos]
+ endif
+
+ call cursor(old_cursor_pos[0], old_cursor_pos[1])
+ return 0
+endfunction
+" }}}
+
function! phpcomplete#ExpandClassName(classname, current_namespace, imports) " {{{
" if there's an imported class, just use that class's information
if has_key(a:imports, a:classname) && (a:imports[a:classname].kind == 'c' || a:imports[a:classname].kind == 'i')
diff --git a/runtime/compiler/go.vim b/runtime/compiler/go.vim
new file mode 100644
index 000000000..cf638f23d
--- /dev/null
+++ b/runtime/compiler/go.vim
@@ -0,0 +1,29 @@
+" Vim compiler file
+" Compiler: Go
+" Maintainer: David Barnett (https://github.com/google/vim-ft-go)
+" Last Change: 2014 Aug 16
+
+if exists('current_compiler')
+ finish
+endif
+let current_compiler = 'go'
+
+if exists(':CompilerSet') != 2
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+let s:save_cpo = &cpo
+set cpo-=C
+
+CompilerSet makeprg=go\ build
+CompilerSet errorformat=
+ \%-G#\ %.%#,
+ \%A%f:%l:%c:\ %m,
+ \%A%f:%l:\ %m,
+ \%C%*\\s%m,
+ \%-G%.%#
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: sw=2 sts=2 et
diff --git a/runtime/compiler/msvc.vim b/runtime/compiler/msvc.vim
index 99fd35eb1..efe36c4da 100644
--- a/runtime/compiler/msvc.vim
+++ b/runtime/compiler/msvc.vim
@@ -1,7 +1,7 @@
" Vim compiler file
-" Compiler: Miscrosoft Visual C
+" Compiler: Microsoft Visual C
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2005 Nov 30
+" Last Change: 2014 Sep 20
if exists("current_compiler")
finish
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 2a8becebf..fed1a4814 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -1,4 +1,4 @@
-*autocmd.txt* For Vim version 7.4. Last change: 2014 May 02
+*autocmd.txt* For Vim version 7.4. Last change: 2014 Sep 23
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -278,6 +278,7 @@ Name triggered by ~
|ShellCmdPost| after executing a shell command
|ShellFilterPost| after filtering with a shell command
+|CmdUndefined| a user command is used but it isn't defined
|FuncUndefined| a user function is used but it isn't defined
|SpellFileMissing| a spell file is used but it can't be found
|SourcePre| before sourcing a Vim script
@@ -465,6 +466,16 @@ BufWriteCmd Before writing the whole buffer to a file.
*BufWritePost*
BufWritePost After writing the whole buffer to a file
(should undo the commands for BufWritePre).
+ *CmdUndefined*
+CmdUndefined When a user command is used but it isn't
+ defined. Useful for defining a command only
+ when it's used. The pattern is matched
+ against the command name. Both <amatch> and
+ <afile> are set to the name of the command.
+ NOTE: Autocompletion won't work until the
+ command is defined. An alternative is to
+ always define the user command and have it
+ invoke an autoloaded function. See |autoload|.
*CmdwinEnter*
CmdwinEnter After entering the command-line window.
Useful for setting options specifically for
@@ -508,6 +519,11 @@ CursorHold When the user doesn't press a key for the time
operator.
While recording the CursorHold event is not
triggered. |q|
+ *<CursorHold>*
+ Internally the autocommand is triggered by the
+ <CursorHold> key. In an expression mapping
+ |getchar()| may see this character.
+
Note: Interactive commands cannot be used for
this event. There is no hit-enter prompt,
the screen is updated directly (when needed).
@@ -670,6 +686,8 @@ FuncUndefined When a user function is used but it isn't
when it's used. The pattern is matched
against the function name. Both <amatch> and
<afile> are set to the name of the function.
+ NOTE: When writing Vim scripts a better
+ alternative is to use an autoloaded function.
See |autoload-functions|.
*GUIEnter*
GUIEnter After starting the GUI successfully, and after
diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt
index f58389af8..d3da61ceb 100644
--- a/runtime/doc/cmdline.txt
+++ b/runtime/doc/cmdline.txt
@@ -1,4 +1,4 @@
-*cmdline.txt* For Vim version 7.4. Last change: 2014 Feb 23
+*cmdline.txt* For Vim version 7.4. Last change: 2014 Sep 06
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -56,7 +56,7 @@ history tables:
These are completely separate. Each history can only be accessed when
entering the same type of line.
Use the 'history' option to set the number of lines that are remembered
-(default: 20).
+(default: 50).
Notes:
- When you enter a command-line that is exactly the same as an older one, the
old one is removed (to avoid repeated commands moving older commands out of
@@ -1084,6 +1084,9 @@ another window, or drag statuslines of other windows. You can drag the
statusline of the command-line window itself and the statusline above it.
Thus you can resize the command-line window, but not others.
+The |getcmdwintype()| function returns the type of the command-line being
+edited as described in |cmdwin-char|.
+
AUTOCOMMANDS
diff --git a/runtime/doc/diff.txt b/runtime/doc/diff.txt
index 0ee587834..be17b0c73 100644
--- a/runtime/doc/diff.txt
+++ b/runtime/doc/diff.txt
@@ -1,4 +1,4 @@
-*diff.txt* For Vim version 7.4. Last change: 2014 May 20
+*diff.txt* For Vim version 7.4. Last change: 2014 Oct 31
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -266,13 +266,17 @@ that the buffers will be equal within the specified range.
See below for [range].
*do*
-do Same as ":diffget" without argument or range. The "o" stands
- for "obtain" ("dg" can't be used, it could be the start of
- "dgg"!). Note: this doesn't work in Visual mode.
+[count]do Same as ":diffget" without range. The "o" stands for "obtain"
+ ("dg" can't be used, it could be the start of "dgg"!). Note:
+ this doesn't work in Visual mode.
+ If you give a [count], it is used as the [bufspec] argument
+ for ":diffget".
*dp*
-dp Same as ":diffput" without argument or range.
- Note: this doesn't work in Visual mode.
+[count]dp Same as ":diffput" without range. Note: this doesn't work in
+ Visual mode.
+ If you give a [count], it is used as the [bufspec] argument
+ for ":diffput".
When no [range] is given, the diff at the cursor position or just above it is
diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt
index 9b465e846..4b8e536df 100644
--- a/runtime/doc/editing.txt
+++ b/runtime/doc/editing.txt
@@ -1,4 +1,4 @@
-*editing.txt* For Vim version 7.4. Last change: 2014 May 02
+*editing.txt* For Vim version 7.4. Last change: 2015 Jan 04
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -609,7 +609,10 @@ list of the current window.
{not in Vi}
:[count]arga[dd] {name} .. *:arga* *:argadd* *E479*
- Add the {name}s to the argument list.
+:[count]arga[dd]
+ Add the {name}s to the argument list. When {name} is
+ omitted add the current buffer name to the argument
+ list.
If [count] is omitted, the {name}s are added just
after the current entry in the argument list.
Otherwise they are added after the [count]'th file.
@@ -619,7 +622,8 @@ list of the current window.
:argadd x a b x c
:0argadd x x a b c
:1argadd x a x b c
- :99argadd x a b c x
+ :$argadd x a b c x
+ :+2argadd y a b c x y
There is no check for duplicates, it is possible to
add a file to the argument list twice.
The currently edited file is not changed.
@@ -641,11 +645,19 @@ list of the current window.
< {not in Vi} {not available when compiled without the
|+listcmds| feature}
-:{range}argd[elete] Delete the {range} files from the argument list.
+:[range]argd[elete] Delete the {range} files from the argument list.
+ Example: >
+ :10,$argdel
+< Deletes arguments 10 and further, keeping 1-9. >
+ :$argd
+< Deletes just the last one. >
+ :argd
+ :.argd
+< Deletes the current argument. >
+ :%argd
+< Removes all the files from the arglist.
When the last number in the range is too high, up to
- the last argument is deleted. Example: >
- :10,1000argdel
-< Deletes arguments 10 and further, keeping 1-9.
+ the last argument is deleted.
{not in Vi} {not available when compiled without the
|+listcmds| feature}
@@ -820,8 +832,9 @@ current window. The two windows then share this list, until one of them uses
USING THE ARGUMENT LIST
*:argdo*
-:argdo[!] {cmd} Execute {cmd} for each file in the argument list.
- It works like doing this: >
+:[range]argdo[!] {cmd} Execute {cmd} for each file in the argument list or
+ if [range] is specified only for arguments in that
+ range. It works like doing this: >
:rewind
:{cmd}
:next
@@ -1077,9 +1090,12 @@ The names can be in upper- or lowercase.
the last file in the argument list has not been
edited. See |:confirm| and 'confirm'. {not in Vi}
-:q[uit]! Quit without writing, also when visible buffers have
- changes. Does not exit when there are changed hidden
- buffers. Use ":qall!" to exit always.
+:q[uit]! Quit without writing, also when currently visible
+ buffers have changes. Does not exit when this is the
+ last window and there is a changed hidden buffer.
+ In this case, the first changed hidden buffer becomes
+ the current buffer.
+ Use ":qall!" to exit always.
:cq[uit] Quit always, without writing, and return an error
code. See |:cq|. Used for Manx's QuickFix mode (see
@@ -1362,11 +1378,21 @@ cannot be read without the right key.
{only available when compiled with the |+cryptv| feature} *E833*
The text in the swap file and the undo file is also encrypted. *E843*
+However, this is done block-by-block and may reduce the time needed to crack a
+password. You can disable the swap file, but then a crash will cause you to
+lose your work. The undo file can be disabled without much disadvantage. >
+ :set noundofile
+ :noswapfile edit secrets
Note: The text in memory is not encrypted. A system administrator may be able
to see your text while you are editing it. When filtering text with
-":!filter" or using ":w !command" the text is not encrypted, this may reveal
-it to others. The 'viminfo' file is not encrypted.
+":!filter" or using ":w !command" the text is also not encrypted, this may
+reveal it to others. The 'viminfo' file is not encrypted.
+
+You could do this to edit very secret text: >
+ :set noundofile viminfo=
+ :noswapfile edit secrets.txt
+Keep in mind that without a swap file you risk losing your work in a crash.
WARNING: If you make a typo when entering the key and then write the file and
exit, the text will be lost!
@@ -1393,18 +1419,23 @@ To disable the encryption, reset the 'key' option to an empty value: >
:set key=
You can use the 'cryptmethod' option to select the type of encryption, use one
-of these two: >
- :setlocal cm=zip " weak method, backwards compatible
- :setlocal cm=blowfish " strong method
+of these: >
+ :setlocal cm=zip " weak method, backwards compatible
+ :setlocal cm=blowfish " method with flaws
+ :setlocal cm=blowfish2 " medium strong method
+
Do this before writing the file. When reading an encrypted file it will be
set automatically to the method used when that file was written. You can
change 'cryptmethod' before writing that file to change the method.
-To set the default method, used for new files, use one of these in your
-|vimrc| file: >
- set cm=zip
- set cm=blowfish
+
+To set the default method, used for new files, use this in your |vimrc|
+file: >
+ set cm=blowfish2
+Using "blowfish2" is highly recommended. Only use another method if you
+must use an older Vim version that does not support it.
+
The message given for reading and writing a file will show "[crypted]" when
-using zip, "[blowfish]" when using blowfish.
+using zip, "[blowfish]" when using blowfish, etc.
When writing an undo file, the same key and method will be used for the text
in the undo file. |persistent-undo|.
@@ -1439,7 +1470,7 @@ lines to "/etc/magic", "/usr/share/misc/magic" or wherever your system has the
0 string VimCrypt~ Vim encrypted file
>9 string 01 - "zip" cryptmethod
>9 string 02 - "blowfish" cryptmethod
-
+ >9 string 03 - "blowfish2" cryptmethod
Notes:
- Encryption is not possible when doing conversion with 'charconvert'.
@@ -1463,6 +1494,10 @@ Notes:
- Pkzip uses the same encryption as 'cryptmethod' "zip", and US Govt has no
objection to its export. Pkzip's public file APPNOTE.TXT describes this
algorithm in detail.
+- The implementation of 'cryptmethod' "blowfish" has a flaw. It is possible
+ to crack the first 64 bytes of a file and in some circumstances more of the
+ file. Use of it is not recommended, but it's still the strongest method
+ supported by Vim 7.3 and 7.4. The "zip" method is even weaker.
- Vim originates from the Netherlands. That is where the sources come from.
Thus the encryption code is not exported from the USA.
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index d75799ab5..69ab0a641 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,4 +1,4 @@
-*eval.txt* For Vim version 7.4. Last change: 2014 Jul 06
+*eval.txt* For Vim version 7.4. Last change: 2014 Dec 07
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1102,9 +1102,9 @@ are known inside the current Vim session. Using expand() will first try using
the environment variables known inside the current Vim session. If that
fails, a shell will be used to expand the variable. This can be slow, but it
does expand all variables that the shell knows about. Example: >
- :echo $version
- :echo expand("$version")
-The first one probably doesn't echo anything, the second echoes the $version
+ :echo $shell
+ :echo expand("$shell")
+The first one probably doesn't echo anything, the second echoes the $shell
variable (if your shell supports it).
@@ -1457,10 +1457,10 @@ v:foldstart Used for 'foldtext': first line of closed fold.
Read-only in the |sandbox|. |fold-foldtext|
*v:hlsearch* *hlsearch-variable*
-v:hlsearch Variable that determines whether search highlighting is on.
- Makes sense only if 'hlsearch' is enabled which requires
- |+extra_search|. Setting this variable to zero acts the like
- |:nohlsearch| command, setting it to one acts like >
+v:hlsearch Variable that indicates whether search highlighting is on.
+ Setting it makes sense only if 'hlsearch' is enabled which
+ requires |+extra_search|. Setting this variable to zero acts
+ the like |:nohlsearch| command, setting it to one acts like >
let &hlsearch = &hlsearch
<
*v:insertmode* *insertmode-variable*
@@ -1751,12 +1751,12 @@ confirm( {msg} [, {choices} [, {default} [, {type}]]])
copy( {expr}) any make a shallow copy of {expr}
cos( {expr}) Float cosine of {expr}
cosh( {expr}) Float hyperbolic cosine of {expr}
-count( {list}, {expr} [, {start} [, {ic}]])
+count( {list}, {expr} [, {ic} [, {start}]])
Number count how many {expr} are in {list}
cscope_connection( [{num} , {dbpath} [, {prepend}]])
Number checks existence of cscope connection
-cursor( {lnum}, {col} [, {coladd}])
- Number move cursor to {lnum}, {col}, {coladd}
+cursor( {lnum}, {col} [, {off}])
+ Number move cursor to {lnum}, {col}, {off}
cursor( {list}) Number move cursor to position in {list}
deepcopy( {expr} [, {noref}]) any make a full copy of {expr}
delete( {fname}) Number delete file {fname}
@@ -1807,7 +1807,8 @@ getchar( [expr]) Number get one character from the user
getcharmod( ) Number modifiers for the last typed character
getcmdline() String return the current command-line
getcmdpos() Number return cursor position in command-line
-getcmdtype() String return the current command-line type
+getcmdtype() String return current command-line type
+getcmdwintype() String return current command-line window type
getcurpos() List position of the cursor
getcwd() String the current working directory
getfontname( [{name}]) String name of font being used
@@ -2040,7 +2041,7 @@ winrestcmd() String returns command to restore window sizes
winrestview( {dict}) none restore view of current window
winsaveview() Dict save view of current window
winwidth( {nr}) Number width of window {nr}
-writefile( {list}, {fname} [, {binary}])
+writefile( {list}, {fname} [, {flags}])
Number write list of lines to file {fname}
xor( {expr}, {expr}) Number bitwise XOR
@@ -2112,8 +2113,8 @@ argidx() The result is the current index in the argument list. 0 is
arglistid([{winnr}, [ {tabnr} ]])
Return the argument list ID. This is a number which
identifies the argument list being used. Zero is used for the
- global argument list.
- Return zero if the arguments are invalid.
+ global argument list. See |arglist|.
+ Return -1 if the arguments are invalid.
Without arguments use the current window.
With {winnr} only use this window in the current tab page.
@@ -2394,6 +2395,10 @@ col({expr}) The result is a Number, which is the byte index of the column
number of bytes in the cursor line plus one)
'x position of mark x (if the mark is not set, 0 is
returned)
+ v In Visual mode: the start of the Visual area (the
+ cursor is the end). When not in Visual mode
+ returns the cursor position. Differs from |'<| in
+ that it's updated right away.
Additionally {expr} can be [lnum, col]: a |List| with the line
and column number. Most useful when the column is "$", to get
the last column of a specific line. When "lnum" or "col" is
@@ -2621,7 +2626,8 @@ cursor({list})
line.
If {col} is zero, the cursor will stay in the current column.
If {curswant} is given it is used to set the preferred column
- for vertical movment. Otherwise {col} is used.
+ for vertical movement. Otherwise {col} is used.
+
When 'virtualedit' is used {off} specifies the offset in
screen columns from the start of the character. E.g., a
position within a <Tab> or after the last character.
@@ -2912,7 +2918,8 @@ expand({expr} [, {nosuf} [, {list}]]) *expand()*
<
Expand() can also be used to expand variables and environment
variables that are only known in a shell. But this can be
- slow, because a shell must be started. See |expr-env-expand|.
+ slow, because a shell may be used to do the expansion. See
+ |expr-env-expand|.
The expanded variable is still handled like a list of file
names. When an environment variable cannot be expanded, it is
left unchanged. Thus ":echo expand('$FOOBAR')" results in
@@ -3302,6 +3309,17 @@ getchar([expr]) *getchar()*
: endif
: endwhile
:endfunction
+<
+ You may also receive syntetic characters, such as
+ |<CursorHold>|. Often you will want to ignore this and get
+ another character: >
+ :function GetKey()
+ : let c = getchar()
+ : while c == "\<CursorHold>"
+ : let c = getchar()
+ : endwhile
+ : return c
+ :endfunction
getcharmod() *getcharmod()*
The result is a Number which is the state of the modifiers for
@@ -3344,11 +3362,17 @@ getcmdtype() *getcmdtype()*
? backward search command
@ |input()| command
- |:insert| or |:append| command
+ = |i_CTRL-R_=|
Only works when editing the command line, thus requires use of
|c_CTRL-\_e| or |c_CTRL-R_=| or an expression mapping.
Returns an empty string otherwise.
Also see |getcmdpos()|, |setcmdpos()| and |getcmdline()|.
+getcmdwintype() *getcmdwintype()*
+ Return the current |command-line-window| type. Possible return
+ values are the same as |getcmdtype()|. Returns an empty string
+ when not in the command-line window.
+
*getcurpos()*
getcurpos() Get the position of the cursor. This is like getpos('.'), but
includes an extra item in the list:
@@ -3359,7 +3383,7 @@ getcurpos() Get the position of the cursor. This is like getpos('.'), but
let save_cursor = getcurpos()
MoveTheCursorAround
call setpos('.', save_cursor)
-
+<
*getcwd()*
getcwd() The result is a String, which is the name of the current
working directory.
@@ -3506,7 +3530,7 @@ getpos({expr}) Get the position for {expr}. For possible values of {expr}
This can be used to save and restore the position of a mark: >
let save_a_mark = getpos("'a")
...
- call setpos(''a', save_a_mark
+ call setpos("'a", save_a_mark)
< Also see |getcurpos()| and |setpos()|.
@@ -3568,6 +3592,8 @@ gettabvar({tabnr}, {varname} [, {def}]) *gettabvar()*
Get the value of a tab-local variable {varname} in tab page
{tabnr}. |t:var|
Tabs are numbered starting with one.
+ When {varname} is empty a dictionary with all tab-local
+ variables is returned.
Note that the name without "t:" must be used.
When the tab or variable doesn't exist {def} or an empty
string is returned, there is no error message.
@@ -4841,7 +4867,7 @@ readfile({fname} [, {binary} [, {max}]])
separated with CR will result in a single long line (unless a
NL appears somewhere).
All NUL characters are replaced with a NL character.
- When {binary} is equal to "b" binary mode is used:
+ When {binary/append} contains "b" binary mode is used:
- When the last line ends in a NL an extra empty list item is
added.
- No CR characters are removed.
@@ -5484,7 +5510,7 @@ setreg({regname}, {value} [,{options}])
Returns zero for success, non-zero for failure.
*E883*
- Note: you may not use |List| containing more then one item to
+ Note: you may not use |List| containing more than one item to
set search and expression registers. Lists containing no
items act like empty strings.
@@ -5634,7 +5660,7 @@ sort({list} [, {func} [, {dict}]]) *sort()* *E702*
after Strings, |Lists| after Numbers. For sorting text in the
current buffer use |:sort|.
- When {func} is given and it is is '1' or 'i' then case is
+ When {func} is given and it is '1' or 'i' then case is
ignored.
When {func} is given and it is 'n' then all items will be
@@ -6086,6 +6112,12 @@ system({expr} [, {input}]) *system()* *E677*
list items converted to NULs).
Pipes are not used.
+ When prepended by |:silent| the shell will not be set to
+ cooked mode. This is meant to be used for commands that do
+ not need the user to type. It avoids stray characters showing
+ up on the screen which require |CTRL-L| to remove. >
+ :silent let f = system('ls *.vim')
+<
Note: Use |shellescape()| or |::S| with |expand()| or
|fnamemodify()| to escape special characters in a command
argument. Newlines in {expr} may cause the command to fail.
@@ -6390,6 +6422,10 @@ virtcol({expr}) *virtcol()*
plus one)
'x position of mark x (if the mark is not set, 0 is
returned)
+ v In Visual mode: the start of the Visual area (the
+ cursor is the end). When not in Visual mode
+ returns the cursor position. Differs from |'<| in
+ that it's updated right away.
Note that only marks in the current file can be used.
Examples: >
virtcol(".") with text "foo^Lbar", with cursor on the "^L", returns 5
@@ -6512,7 +6548,7 @@ winsaveview() Returns a |Dictionary| that contains information to restore
buffer and you want to go back to the original view.
This does not save fold information. Use the 'foldenable'
option to temporarily switch off folding, so that folds are
- not opened when moving around.
+ not opened when moving around. This may have side effects.
The return value includes:
lnum cursor line number
col cursor column (Note: the first column
@@ -6539,14 +6575,20 @@ winwidth({nr}) *winwidth()*
:endif
<
*writefile()*
-writefile({list}, {fname} [, {binary}])
+writefile({list}, {fname} [, {flags}])
Write |List| {list} to file {fname}. Each list item is
separated with a NL. Each list item must be a String or
Number.
- When {binary} is equal to "b" binary mode is used: There will
+ When {flags} contains "b" then binary mode is used: There will
not be a NL after the last list item. An empty item at the
end does cause the last line in the file to end in a NL.
- All NL characters are replaced with a NUL character.
+
+ When {flags} contains "a" then append mode is used, lines are
+ append to the file: >
+ :call writefile(["foo"], "event.log", "a")
+ :call writefile(["bar"], "event.log", "a")
+>
+< All NL characters are replaced with a NUL character.
Inserting CR characters needs to be done before passing {list}
to writefile().
An existing file is overwritten, if possible.
@@ -6622,6 +6664,7 @@ dialog_con Compiled with console dialog support.
dialog_gui Compiled with GUI dialog support.
diff Compiled with |vimdiff| and 'diff' support.
digraphs Compiled with support for digraphs.
+directx Compiled with support for Direct-X and 'renderoptions'.
dnd Compiled with support for the "~ register |quote_~|.
dos16 16 bits DOS version of Vim.
dos32 32 bits DOS (DJGPP) version of Vim.
diff --git a/runtime/doc/gui_w32.txt b/runtime/doc/gui_w32.txt
index fbe3f35e7..5674bbad0 100644
--- a/runtime/doc/gui_w32.txt
+++ b/runtime/doc/gui_w32.txt
@@ -1,4 +1,4 @@
-*gui_w32.txt* For Vim version 7.4. Last change: 2012 Aug 04
+*gui_w32.txt* For Vim version 7.4. Last change: 2014 Dec 20
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -452,9 +452,10 @@ detailed elsewhere: see |'mouse'|, |win32-hidden-menus|.
You can drag and drop one or more files into the Vim window, where they will
be opened as normal. See |drag-n-drop|.
- *:simalt* *:si*
+ *:simalt* *:sim*
:sim[alt] {key} simulate pressing {key} while holding Alt pressed.
{not in Vi} {only for Win32 versions}
+ Note: ":si" means ":s" with the "i" flag.
Normally, Vim takes control of all Alt-<Key> combinations, to increase the
number of possible mappings. This clashes with the standard use of Alt as the
diff --git a/runtime/doc/helphelp.txt b/runtime/doc/helphelp.txt
index 87f095e56..4ef436c5d 100644
--- a/runtime/doc/helphelp.txt
+++ b/runtime/doc/helphelp.txt
@@ -1,4 +1,4 @@
-*helphelp.txt* For Vim version 7.4. Last change: 2012 Nov 28
+*helphelp.txt* For Vim version 7.4. Last change: 2014 Sep 19
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -96,6 +96,9 @@ Help on help files *helphelp*
find a tag in a file with the same language as the
current file. See |help-translated|.
+ *:helpc* *:helpclose*
+:helpc[lose] Close one help window, if there is one.
+
*:helpg* *:helpgrep*
:helpg[rep] {pattern}[@xx]
Search all help text files and make a list of lines
diff --git a/runtime/doc/if_pyth.txt b/runtime/doc/if_pyth.txt
index 889101b19..4ed8eac74 100644
--- a/runtime/doc/if_pyth.txt
+++ b/runtime/doc/if_pyth.txt
@@ -1,4 +1,4 @@
-*if_pyth.txt* For Vim version 7.4. Last change: 2013 Jul 10
+*if_pyth.txt* For Vim version 7.4. Last change: 2014 Jul 23
VIM REFERENCE MANUAL by Paul Moore
@@ -28,7 +28,7 @@ Both can be available at the same time, but read |python-2-and-3|.
==============================================================================
1. Commands *python-commands*
- *:python* *:py* *E205* *E263* *E264*
+ *:python* *:py* *E263* *E264* *E887*
:[range]py[thon] {stmt}
Execute Python statement {stmt}. A simple check if
the `:python` command is working: >
diff --git a/runtime/doc/indent.txt b/runtime/doc/indent.txt
index fc16b1a7e..3f61e2865 100644
--- a/runtime/doc/indent.txt
+++ b/runtime/doc/indent.txt
@@ -1,4 +1,4 @@
-*indent.txt* For Vim version 7.4. Last change: 2014 Apr 23
+*indent.txt* For Vim version 7.4. Last change: 2014 Dec 06
VIM REFERENCE MANUAL by Bram Moolenaar
diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt
index cda17681f..1e0134d68 100644
--- a/runtime/doc/index.txt
+++ b/runtime/doc/index.txt
@@ -1,4 +1,4 @@
-*index.txt* For Vim version 7.4. Last change: 2014 Mar 25
+*index.txt* For Vim version 7.4. Last change: 2015 Jan 07
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1244,6 +1244,7 @@ tag command action ~
|:gvim| :gv[im] start the GUI
|:hardcopy| :ha[rdcopy] send text to the printer
|:help| :h[elp] open a help window
+|:helpclose| :helpc[lose] close one help window
|:helpfind| :helpf[ind] dialog to open a help window
|:helpgrep| :helpg[rep] like ":grep" but searches help files
|:helptags| :helpt[ags] generate help tags for a directory
@@ -1464,7 +1465,7 @@ tag command action ~
buffer list
|:sbrewind| :sbr[ewind] split window and go to first file in the
buffer list
-|:scriptnames| :scrip[tnames] list names of all sourced Vim scripts
+|:scriptnames| :scr[iptnames] list names of all sourced Vim scripts
|:scriptencoding| :scripte[ncoding] encoding used in sourced Vim script
|:scscope| :scs[cope] split window and execute cscope command
|:set| :se[t] show or set options
diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt
index 4136c9189..2a114bc09 100644
--- a/runtime/doc/insert.txt
+++ b/runtime/doc/insert.txt
@@ -1,4 +1,4 @@
-*insert.txt* For Vim version 7.4. Last change: 2014 Jul 06
+*insert.txt* For Vim version 7.4. Last change: 2014 Aug 04
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -51,6 +51,8 @@ char action ~
abbreviation.
Note: If your <Esc> key is hard to hit on your keyboard, train
yourself to use CTRL-[.
+ If Esc doesn't work and you are using a Mac, try CTRL-Esc.
+ Or disable Listening under Accessibility preferences.
*i_CTRL-C*
CTRL-C Quit insert mode, go back to Normal mode. Do not check for
abbreviations. Does not trigger the |InsertLeave| autocommand
diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
index 3ac8e5db9..fb041c6a5 100644
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -1,4 +1,4 @@
-*map.txt* For Vim version 7.4. Last change: 2014 Jun 02
+*map.txt* For Vim version 7.4. Last change: 2014 Dec 08
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -923,9 +923,11 @@ Examples: ({CURSOR} is where you type a non-keyword character) >
< "test;;" is not expanded
"test ;;" is expanded to "test <endofline>"
-To avoid the abbreviation in insert mode: Type part of the abbreviation, exit
-insert mode with <Esc>, re-enter insert mode with "a" and type the rest. Or
-type CTRL-V before the character after the abbreviation.
+To avoid the abbreviation in Insert mode: Type CTRL-V before the character
+that would trigger the abbreviation. E.g. CTRL-V <Space>. Or type part of
+the abbreviation, exit insert mode with <Esc>, re-enter insert mode with "a"
+and type the rest.
+
To avoid the abbreviation in Command-line mode: Type CTRL-V twice somewhere in
the abbreviation to avoid it to be replaced. A CTRL-V in front of a normal
character is mostly ignored otherwise.
@@ -1283,6 +1285,8 @@ completion can be enabled:
-complete=custom,{func} custom completion, defined via {func}
-complete=customlist,{func} custom completion, defined via {func}
+Note: That some completion methods might expand environment variables.
+
Custom completion *:command-completion-custom*
*:command-completion-customlist*
@@ -1354,6 +1358,19 @@ Possible attributes are:
Note that -range=N and -count=N are mutually exclusive - only one should be
specified.
+ *E889* *:command-addr*
+It is possible that the special characters in the range like ., $ or % which
+by default correspond to the current line, last line and the whole buffer,
+relate to arguments, (loaded) buffers, windows or tab pages.
+
+Possible values are:
+ -addr=lines Range of lines (this is the default)
+ -addr=arguments Range for arguments
+ -addr=buffers Range for buffers (also not loaded buffers)
+ -addr=loaded_buffers Range for loaded buffers
+ -addr=windows Range for windows
+ -addr=tabs Range for tab pages
+
Special cases *:command-bang* *:command-bar*
*:command-register* *:command-buffer*
There are some special cases as well:
diff --git a/runtime/doc/netbeans.txt b/runtime/doc/netbeans.txt
index e0ac2bf82..82db022d0 100644
--- a/runtime/doc/netbeans.txt
+++ b/runtime/doc/netbeans.txt
@@ -470,7 +470,7 @@ raise Bring the editor to the foreground.
New in version 2.1.
removeAnno serNum
- Remove a previously place annotation for this buffer.
+ Remove a previously placed annotation for this buffer.
"serNum" is the same number used in addAnno.
save Save the buffer when it was modified. The other side of the
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 763dab178..d62bb4e8e 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,4 +1,4 @@
-*options.txt* For Vim version 7.4. Last change: 2014 Jun 26
+*options.txt* For Vim version 7.4. Last change: 2014 Dec 17
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -730,8 +730,6 @@ A jump table for the options with a short description can be found at |Q_op|.
open a file, switch buffers, delete a buffer or open/close a window.
It will change to the directory containing the file which was opened
or selected.
- This option is provided for backward compatibility with the Vim
- released with Sun ONE Studio 4 Enterprise Edition.
Note: When this option is on some plugins may not work.
*'arabic'* *'arab'* *'noarabic'* *'noarab'*
@@ -921,7 +919,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'backupcopy'* *'bkc'*
'backupcopy' 'bkc' string (Vi default for Unix: "yes", otherwise: "auto")
- global
+ global or local to buffer |global-local|
{not in Vi}
When writing a file and a backup is made, this option tells how it's
done. This is a comma separated list of words.
@@ -2221,7 +2219,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'cryptmethod'* *'cm'*
-'cryptmethod' string (default "zip")
+'cryptmethod' 'cm' string (default "zip")
global or local to buffer |global-local|
{not in Vi}
Method used for encryption when the buffer is written to a file:
@@ -2229,10 +2227,18 @@ A jump table for the options with a short description can be found at |Q_op|.
zip PkZip compatible method. A weak kind of encryption.
Backwards compatible with Vim 7.2 and older.
*blowfish*
- blowfish Blowfish method. Strong encryption. Requires Vim 7.3
- or later, files can NOT be read by Vim 7.2 and older.
- This adds a "seed" to the file, every time you write
- the file the encrypted bytes will be different.
+ blowfish Blowfish method. Medium strong encryption but it has
+ an implementation flaw. Requires Vim 7.3 or later,
+ files can NOT be read by Vim 7.2 and older. This adds
+ a "seed" to the file, every time you write the file
+ the encrypted bytes will be different.
+ *blowfish2*
+ blowfish2 Blowfish method. Medium strong encryption. Requires
+ Vim 7.4.399 or later, files can NOT be read by Vim 7.3
+ and older. This adds a "seed" to the file, every time
+ you write the file the encrypted bytes will be
+ different. The whole undo file is encrypted, not just
+ the pieces of text.
When reading an encrypted file 'cryptmethod' will be set automatically
to the detected method of the file being read. Thus if you write it
@@ -3361,7 +3367,7 @@ A jump table for the options with a short description can be found at |Q_op|.
NOTE: This option is reset when 'compatible' is set.
*'grepformat'* *'gfm'*
-'grepformat' 'gfm' string (default "%f:%l%m,%f %l%m")
+'grepformat' 'gfm' string (default "%f:%l:%m,%f:%l%m,%f %l%m")
global
{not in Vi}
Format to recognize for the ":grep" command output.
@@ -4001,6 +4007,7 @@ A jump table for the options with a short description can be found at |Q_op|.
When Vim was compiled with HAVE_X11 defined, the original icon will be
restored if possible |X11|. See |X11-icon| for changing the icon on
X11.
+ For MS-Windows the icon can be changed, see |windows-icon|.
*'iconstring'*
'iconstring' string (default "")
@@ -4525,6 +4532,8 @@ A jump table for the options with a short description can be found at |Q_op|.
be able to execute Normal mode commands.
This is the opposite of the 'keymap' option, where characters are
mapped in Insert mode.
+ Also consider setting 'langnoremap' to avoid 'langmap' applies to
+ characters resulting from a mapping.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
@@ -4580,6 +4589,18 @@ A jump table for the options with a short description can be found at |Q_op|.
:source $VIMRUNTIME/menu.vim
< Warning: This deletes all menus that you defined yourself!
+ *'langnoremap'* *'lnr'*
+'langnoremap' 'lnr' boolean (default off)
+ global
+ {not in Vi}
+ {only available when compiled with the |+langmap|
+ feature}
+ When on, setting 'langmap' does not apply to characters resulting from
+ a mapping. This basically means, if you noticed that setting
+ 'langmap' disables some of your mappings, try setting this option.
+ This option defaults to off for backwards compatibility. Set it on if
+ that works for you to avoid mappings to break.
+
*'laststatus'* *'ls'*
'laststatus' 'ls' number (default 1)
global
@@ -5369,7 +5390,7 @@ A jump table for the options with a short description can be found at |Q_op|.
Expression which is evaluated to apply a patch to a file and generate
the resulting new version of the file. See |diff-patchexpr|.
- *'patchmode'* *'pm'* *E206*
+ *'patchmode'* *'pm'* *E205* *E206*
'patchmode' 'pm' string (default "")
global
{not in Vi}
@@ -5617,6 +5638,10 @@ A jump table for the options with a short description can be found at |Q_op|.
Note that when using the NFA engine and the pattern contains something
that is not supported the pattern will not match. This is only useful
for debugging the regexp engine.
+ Using automatic selection enables Vim to switch the engine, if the
+ default engine becomes too costly. E.g., when the NFA engine uses too
+ many states. This should prevent Vim from hanging on a combination of
+ a complex pattern with long text.
*'relativenumber'* *'rnu'* *'norelativenumber'* *'nornu'*
'relativenumber' 'rnu' boolean (default off)
@@ -5650,6 +5675,77 @@ A jump table for the options with a short description can be found at |Q_op|.
this option at the default "on". Only switch it off when working with
old Vi scripts.
+ *'renderoptions'* *'rop'*
+'renderoptions' 'rop' string (default: empty)
+ global
+ {not in Vi}
+ {only available when compiled with GUI and DIRECTX on
+ MS-Windows}
+ Select a text renderer and set its options. The options depend on the
+ renderer.
+
+ Syntax: >
+ set rop=type:{renderer}(,{name}:{value})*
+<
+ Currently, only one optional renderer is available.
+
+ render behavior ~
+ directx Vim will draw text using DirectX (DirectWrite). It makes
+ drawn glyphs more beautiful than default GDI.
+ It requires 'encoding' is "utf-8", and only works on
+ MS-Windows Vista or newer version.
+
+ Options:
+ name meaning type value ~
+ gamma gamma float 1.0 - 2.2 (maybe)
+ contrast enhancedContrast float (unknown)
+ level clearTypeLevel float (unknown)
+ geom pixelGeometry int 0 - 2 (see below)
+ renmode renderingMode int 0 - 6 (see below)
+ taamode textAntialiasMode int 0 - 3 (see below)
+
+ See this URL for detail:
+ http://msdn.microsoft.com/en-us/library/dd368190.aspx
+
+ For geom: structure of a device pixel.
+ 0 - DWRITE_PIXEL_GEOMETRY_FLAT
+ 1 - DWRITE_PIXEL_GEOMETRY_RGB
+ 2 - DWRITE_PIXEL_GEOMETRY_BGR
+
+ See this URL for detail:
+ http://msdn.microsoft.com/en-us/library/dd368114.aspx
+
+ For renmode: method of rendering glyphs.
+ 0 - DWRITE_RENDERING_MODE_DEFAULT
+ 1 - DWRITE_RENDERING_MODE_ALIASED
+ 2 - DWRITE_RENDERING_MODE_GDI_CLASSIC
+ 3 - DWRITE_RENDERING_MODE_GDI_NATURAL
+ 4 - DWRITE_RENDERING_MODE_NATURAL
+ 5 - DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC
+ 6 - DWRITE_RENDERING_MODE_OUTLINE
+
+ See this URL for detail:
+ http://msdn.microsoft.com/en-us/library/dd368118.aspx
+
+ For taamode: antialiasing mode used for drawing text.
+ 0 - D2D1_TEXT_ANTIALIAS_MODE_DEFAULT
+ 1 - D2D1_TEXT_ANTIALIAS_MODE_CLEARTYPE
+ 2 - D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE
+ 3 - D2D1_TEXT_ANTIALIAS_MODE_ALIASED
+
+ See this URL for detail:
+ http://msdn.microsoft.com/en-us/library/dd368170.aspx
+
+ Example: >
+ set encoding=utf-8
+ set gfn=Ricty_Diminished:h12:cSHIFTJIS
+ set rop=type:directx
+<
+ If select a raster font (Courier, Terminal or FixedSys) to
+ 'guifont', it fallbacks to be drawn by GDI automatically.
+
+ Other render types are currently not supported.
+
*'report'*
'report' number (default 2)
global
@@ -7664,6 +7760,9 @@ A jump table for the options with a short description can be found at |Q_op|.
current buffer: >
setlocal ul=-1
< This helps when you run out of memory for a single change.
+
+ The local value is set to -123456 when the global value is to be used.
+
Also see |clear-undo|.
*'undoreload'* *'ur'*
@@ -7771,6 +7870,7 @@ A jump table for the options with a short description can be found at |Q_op|.
fold options
options options and mappings local to a window or buffer (not
global values for local options)
+ localoptions same as "options"
slash backslashes in file names replaced with forward
slashes
unix with Unix end-of-line format (single <NL>), even when
diff --git a/runtime/doc/os_vms.txt b/runtime/doc/os_vms.txt
index 03b11ba87..3e5c05c69 100644
--- a/runtime/doc/os_vms.txt
+++ b/runtime/doc/os_vms.txt
@@ -1,4 +1,4 @@
-*os_vms.txt* For Vim version 7.4. Last change: 2014 Feb 24
+*os_vms.txt* For Vim version 7.4. Last change: 2014 Aug 29
VIM REFERENCE MANUAL
@@ -774,7 +774,7 @@ Version 7.4
- correct RealWaitForChar
- after 7.4-119 use different functions lib$cvtf_to_internal_time because Alpha and VAX have
G_FLOAT but IA64 uses IEEE float otherwise Vim crashes
-- guard agains crashes that are caused by mixed filenames
+- guard against crashes that are caused by mixed filenames
- [TESTDIR]make_vms.mms changed to see the output files
- Improve tests, update known issues
- minor compiler warnings fixed
diff --git a/runtime/doc/os_win32.txt b/runtime/doc/os_win32.txt
index a01a06c8e..9637d7e82 100644
--- a/runtime/doc/os_win32.txt
+++ b/runtime/doc/os_win32.txt
@@ -1,4 +1,4 @@
-*os_win32.txt* For Vim version 7.4. Last change: 2012 May 18
+*os_win32.txt* For Vim version 7.4. Last change: 2014 Sep 25
VIM REFERENCE MANUAL by George Reilly
@@ -334,7 +334,7 @@ A. You have two possible solutions depending on what you want:
:!start /min ctags -R .
< When it has finished you should see file named "tags" in your current
directory. You should notice the window title blinking on your taskbar.
- This is more noticable for commands that take longer.
+ This is more noticeable for commands that take longer.
Now delete the "tags" file and run this command: >
:!start /b ctags -R .
< You should have the same "tags" file, but this time there will be no
@@ -367,4 +367,10 @@ Q. I use Vim under Win32s and NT. In NT, I can define the console to default to
A. Edit SYSTEM.INI and add 'ScreenLines=50' to the [NonWindowsApp] section. DOS
prompts and external DOS commands will now run in a 50-line window.
+ *windows-icon*
+Q. I don't like the Vim icon, can I change it?
+A. Yes, place your favorite icon in bitmaps/vim.ico in a directory of
+ 'runtimepath'. For example ~/vimfiles/bitmaps/vim.ico.
+
+
vim:tw=78:fo=tcq2:ts=8:ft=help:norl:
diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt
index 207a43d87..322811b7c 100644
--- a/runtime/doc/pattern.txt
+++ b/runtime/doc/pattern.txt
@@ -1,4 +1,4 @@
-*pattern.txt* For Vim version 7.4. Last change: 2014 May 28
+*pattern.txt* For Vim version 7.4. Last change: 2014 Sep 06
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -706,11 +706,18 @@ overview.
But to limit the time needed, only the line where what follows matches
is searched, and one line before that (if there is one). This should
be sufficient to match most things and not be too slow.
- The part of the pattern after "\@<=" and "\@<!" are checked for a
- match first, thus things like "\1" don't work to reference \(\) inside
- the preceding atom. It does work the other way around:
- Example matches ~
- \1\@<=,\([a-z]\+\) ",abc" in "abc,abc"
+
+ In the old regexp engine the part of the pattern after "\@<=" and
+ "\@<!" are checked for a match first, thus things like "\1" don't work
+ to reference \(\) inside the preceding atom. It does work the other
+ way around:
+ Bad example matches ~
+ \%#=1\1\@<=,\([a-z]\+\) ",abc" in "abc,abc"
+
+ However, the new regexp engine works differently, it is better to not
+ rely on this behavior, do not use \@<= if it can be avoided:
+ Example matches ~
+ \([a-z]\+\)\zs,\1 ",abc" in "abc,abc"
\@123<=
Like "\@<=" but only look back 123 bytes. This avoids trying lots
@@ -822,6 +829,7 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
branch is used. Example: >
/\(.\{-}\zsFab\)\{3}
< Finds the third occurrence of "Fab".
+ This cannot be followed by a multi. *E888*
{not in Vi} {not available when compiled without the |+syntax| feature}
*/\ze*
\ze Matches at any position, and sets the end of the match there: The
@@ -830,6 +838,7 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
branch is used.
Example: "end\ze\(if\|for\)" matches the "end" in "endif" and
"endfor".
+ This cannot be followed by a multi. |E888|
{not in Vi} {not available when compiled without the |+syntax| feature}
*/\%^* *start-of-file*
diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt
index 32f576af6..5e629aaf4 100644
--- a/runtime/doc/pi_netrw.txt
+++ b/runtime/doc/pi_netrw.txt
@@ -1,4 +1,4 @@
-*pi_netrw.txt* For Vim version 7.4. Last change: 2014 May 13
+*pi_netrw.txt* For Vim version 7.4. Last change: 2015 Jan 05
------------------------------------------------
NETRW REFERENCE MANUAL by Charles E. Campbell
@@ -6,7 +6,7 @@
Author: Charles E. Campbell <NdrOchip@ScampbellPfamily.AbizM>
(remove NOSPAM from Campbell's email first)
-Copyright: Copyright (C) 1999-2014 Charles E Campbell *netrw-copyright*
+Copyright: Copyright (C) 1999-2015 Charles E Campbell *netrw-copyright*
The VIM LICENSE applies to the files in this package, including
netrw.vim, pi_netrw.txt, netrwFileHandlers.vim, netrwSettings.vim, and
syntax/netrw.vim. Like anything else that's free, netrw.vim and its
@@ -18,9 +18,10 @@ Copyright: Copyright (C) 1999-2014 Charles E Campbell *netrw-copyright*
software. Use at your own risk!
+ *netrw*
*dav* *ftp* *netrw-file* *rcp* *scp*
*davs* *http* *netrw.vim* *rsync* *sftp*
- *fetch* *netrw* *network*
+ *fetch* *network*
==============================================================================
1. Contents *netrw-contents* {{{1
@@ -57,7 +58,7 @@ Copyright: Copyright (C) 1999-2014 Charles E Campbell *netrw-copyright*
Changing To A Bookmarked Directory..................|netrw-gb|
Changing To A Predecessor Directory.................|netrw-u|
Changing To A Successor Directory...................|netrw-U|
- Customizing Browsing With A User Function...........|netrw-x|
+ Customizing Browsing With A Special Handler.........|netrw-x|
Deleting Bookmarks..................................|netrw-mB|
Deleting Files Or Directories.......................|netrw-D|
Directory Exploring Commands........................|netrw-explore|
@@ -76,7 +77,9 @@ Copyright: Copyright (C) 1999-2014 Charles E Campbell *netrw-copyright*
Unmarking Files.....................................|netrw-mF|
Marking Files By QuickFix List......................|netrw-qF|
Marking Files By Regular Expression.................|netrw-mr|
- Marked Files: Arbitrary Command.....................|netrw-mx|
+ Marked Files: Arbitrary Shell Command...............|netrw-mx|
+ Marked Files: Arbitrary Shell Command, En Bloc......|netrw-mX|
+ Marked Files: Arbitrary Vim Command.................|netrw-mv|
Marked Files: Compression And Decompression.........|netrw-mz|
Marked Files: Copying...............................|netrw-mc|
Marked Files: Diff..................................|netrw-md|
@@ -209,6 +212,7 @@ EXTERNAL APPLICATIONS AND PROTOCOLS *netrw-externapp* {{{2
rsync: *g:netrw_rsync_cmd* = "rsync -a"
scp: *g:netrw_scp_cmd* = "scp -q"
sftp: *g:netrw_sftp_cmd* = "sftp"
+ file: *g:netrw_file_cmd* = "elinks" or "links"
*g:netrw_http_xcmd* : the option string for http://... protocols are
specified via this variable and may be independently overridden. By
@@ -346,7 +350,7 @@ settings are described below, in |netrw-browser-options|, and in
per-buffer basis (supports plain :Nw )
*g:netrw_bufsettings* the settings that netrw buffers have
- (default) noma nomod nonu nowrap ro nobl
+ (default) noma nomod nonu nowrap ro nobl
*g:netrw_chgwin* specifies a window number where subsequent file edits
will take place. (also see |netrw-C|)
@@ -399,18 +403,26 @@ settings are described below, in |netrw-browser-options|, and in
be available (see |netrw-gx|)
*g:netrw_uid* (ftp) user-id, retained on a per-vim-session basis
- *s:netrw_passwd* (ftp) password, retained on a per-vim-session basis
+ *s:netrw_passwd* (ftp) password, retained on a per-vim-session basis
*g:netrw_preview* =0 (default) preview window shown in a horizontally
split window
=1 preview window shown in a vertically split window.
Also affects the "previous window" (see |netrw-P|)
in the same way.
+ The |g:netrw_alto| variable may be used to provide
+ additional splitting control:
+ g:netrw_preview g:netrw_alto result
+ 0 0 |:aboveleft|
+ 0 1 |:belowright|
+ 1 0 |:topleft|
+ 1 1 |:botright|
+ To control sizing, see |g:netrw_winsize|
*g:netrw_scpport* = "-P" : option to use to set port for scp
*g:netrw_sshport* = "-p" : option to use to set port for ssh
- *g:netrw_sepchr* =\0xff
+ *g:netrw_sepchr* =\0xff
=\0x01 for enc == euc-jp (and perhaps it should be for
others, too, please let me know)
Separates priority codes from filenames internally.
@@ -430,7 +442,7 @@ settings are described below, in |netrw-browser-options|, and in
lines that o/s's ftp "provides" on transfers
=0 force normal ftp behavior (no trailing line removal)
- *g:netrw_cygwin* =1 assume scp under windows is from cygwin. Also
+ *g:netrw_cygwin* =1 assume scp under windows is from cygwin. Also
permits network browsing to use ls with time and
size sorting (default if windows)
=0 assume Windows' scp accepts windows-style paths
@@ -681,6 +693,16 @@ your <.vimrc> customization file: >
filetype plugin indent on
endif
<
+By also including the following lines in your .vimrc, one may have netrw
+immediately activate when using [g]vim without any filenames, showing the
+current directory: >
+
+ " Augroup VimStartup:
+ augroup VimStartup
+ au!
+ au VimEnter * if expand("%") == "" | e . | endif
+ augroup END
+<
==============================================================================
6. Transparent Remote File Editing *netrw-transparent* {{{1
@@ -838,7 +860,7 @@ variables listed below, and may be modified by the user.
g:netrw_http_cmd var ="fetch -o" if fetch is available
g:netrw_http_cmd var ="wget -O" else if wget is available
g:netrw_http_put_cmd var ="curl -T"
- g:netrw_list_cmd var ="ssh USEPORT HOSTNAME ls -Fa"
+ |g:netrw_list_cmd| var ="ssh USEPORT HOSTNAME ls -Fa"
g:netrw_rcp_cmd var ="rcp"
g:netrw_rsync_cmd var ="rsync -a"
g:netrw_scp_cmd var ="scp -q"
@@ -1042,6 +1064,9 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
< <F1> Causes Netrw to issue help
<cr> Netrw will enter the directory or read the file |netrw-cr|
<del> Netrw will attempt to remove the file/directory |netrw-del|
+ <c-h> Edit file hiding list |netrw-ctrl-h|
+ <c-l> Causes Netrw to refresh the directory listing |netrw-ctrl-l|
+ <c-r> Browse using a gvim server |netrw-ctrl-r|
- Makes Netrw go up one directory |netrw--|
a Toggles between normal display, |netrw-a|
hiding (suppress display of files matching g:netrw_list_hide)
@@ -1051,23 +1076,27 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
d Make a directory |netrw-d|
D Attempt to remove the file(s)/directory(ies) |netrw-D|
gb Go to previous bookmarked directory |netrw-gb|
+ gd Force treatment as directory |netrw-gd|
+ gf Force treatment as file |netrw-gf|
gh Quick hide/unhide of dot-files |netrw-gh|
- <c-h> Edit file hiding list |netrw-ctrl-h|
i Cycle between thin, long, wide, and tree listings |netrw-i|
- <c-l> Causes Netrw to refresh the directory listing |netrw-ctrl-l|
mb Bookmark current directory |netrw-mb|
mc Copy marked files to marked-file target directory |netrw-mc|
md Apply diff to marked files (up to 3) |netrw-md|
me Place marked files on arg list and edit them |netrw-me|
mf Mark a file |netrw-mf|
+ mF Unmark files |netrw-mF|
+ mg Apply vimgrep to marked files |netrw-mg|
mh Toggle marked file suffices' presence on hiding list |netrw-mh|
mm Move marked files to marked-file target directory |netrw-mm|
mp Print marked files |netrw-mp|
- mr Mark files satisfying a shell-style |regexp| |netrw-mr|
+ mr Mark files using a shell-style |regexp| |netrw-mr|
mt Current browsing directory becomes markfile target |netrw-mt|
mT Apply ctags to marked files |netrw-mT|
mu Unmark all marked files |netrw-mu|
+ mv Apply arbitrary vim command to marked files |netrw-mv|
mx Apply arbitrary shell command to marked files |netrw-mx|
+ mX Apply arbitrary shell command to marked files en bloc|netrw-mX|
mz Compress/decompress marked files |netrw-mz|
o Enter the file/directory under the cursor in a new |netrw-o|
browser window. A horizontal split is used.
@@ -1076,6 +1105,7 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
P Browse in the previously used window |netrw-P|
qb List bookmarked directories and history |netrw-qb|
qf Display information on file |netrw-qf|
+ qF Mark files using a quickfix list |netrw-qF|
r Reverse sorting order |netrw-r|
R Rename the designed file(s)/directory(ies) |netrw-R|
s Select sorting style: by name, time, or file size |netrw-s|
@@ -1099,7 +1129,7 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
mouse
<2-leftmouse> (gvim only) when:
* in a netrw-selected file, AND
- * |g:netrw_retmap| == 1 AND
+ * |g:netrw_retmap| == 1 AND
* the user doesn't already have a <2-leftmouse>
mapping defined before netrw is autoloaded,
then a double clicked leftmouse button will return
@@ -1117,7 +1147,7 @@ QUICK REFERENCE: COMMANDS *netrw-explore-cmds* *netrw-browse-cmds* {{{2
:Ntree....................................................|netrw-ntree|
:Explore[!] [dir] Explore directory of current file......|netrw-explore|
:Hexplore[!] [dir] Horizontal Split & Explore.............|netrw-explore|
- :Lexplore [dir] Left Explorer Toggle...................|netrw-explore|
+ :Lexplore[!] [dir] Left Explorer Toggle...................|netrw-explore|
:Nexplore[!] [dir] Vertical Split & Explore...............|netrw-explore|
:Pexplore[!] [dir] Vertical Split & Explore...............|netrw-explore|
:Rexplore Return to Explorer.....................|netrw-explore|
@@ -1125,19 +1155,45 @@ QUICK REFERENCE: COMMANDS *netrw-explore-cmds* *netrw-browse-cmds* {{{2
:Texplore[!] [dir] Tab & Explore..........................|netrw-explore|
:Vexplore[!] [dir] Vertical Split & Explore...............|netrw-explore|
-BOOKMARKING A DIRECTORY *netrw-mb* *netrw-bookmark* *netrw-bookmarks* {{{2
+BOOKMARKING A DIRECTORY *netrw-mb* *netrw-bookmark* *netrw-bookmarks* {{{2
-One may easily "bookmark" a directory by using >
+One may easily "bookmark" the currently browsed directory by using >
mb
<
+ *.netrwbook*
Bookmarks are retained in between sessions in a $HOME/.netrwbook file, and are
kept in sorted order.
+If there are marked files and/or directories, mb will add them to the bookmark
+list.
+
+*netrw-:NetrwMB*
+Addtionally, one may use :NetrwMB to bookmark files or directories. >
+
+ :NetrwMB[!] [files/directories]
+
+< No bang: enters files/directories into Netrw's bookmark system
+
+ No argument and in netrw buffer:
+ if there are marked files: bookmark marked files
+ otherwise : bookmark file/directory under cursor
+ No argument and not in netrw buffer: bookmarks current open file
+ Has arguments: globs them individually and bookmarks them
+
+ With bang: deletes files/directories from Netrw's bookmark system
+
+The :NetrwMB command is available outside of netrw buffers (once netrw has been
+invoked in the session).
+
+The file ".netrwbook" holds bookmarks when netrw (and vim) is not active. By
+default, its stored on the first directory on the user's |'runtimepath'|.
+
Related Topics:
|netrw-gb| how to return (go) to a bookmark
|netrw-mB| how to delete bookmarks
|netrw-qb| how to list bookmarks
+ |g:netrw_home| controls where .netrwbook is kept
BROWSING *netrw-cr* {{{2
@@ -1163,7 +1219,7 @@ horizontally or vertically, respectively. When the option is set to three, a
When using the gui (gvim), one may select a file by pressing the <leftmouse>
button. In addition, if
- *|g:netrw_retmap| == 1 AND (its default value is 0)
+ * |g:netrw_retmap| == 1 AND (its default value is 0)
* in a netrw-selected file, AND
* the user doesn't already have a <2-leftmouse> mapping defined before
netrw is loaded
@@ -1181,19 +1237,20 @@ The price for such re-use is that when changes are made (such as new files
are introduced into a directory), the listing may become out-of-date. One may
always refresh directory listing buffers by pressing ctrl-L (see
|netrw-ctrl-l|).
-
*:netrw-s-cr*
Squeezing the Current Tree-Listing Directory~
When the tree listing style is enabled (see |netrw-i|) and one is using
gvim, then the <s-cr> mapping may be used to squeeze (close) the
directory currently containing the cursor.
-
-Related topics: |netrw-o| |netrw-p| |netrw-P| |netrw-t| |netrw-v|
-Associated setting variables: |g:netrw_browse_split| |g:netrw_fastbrowse|
- |g:netrw_ftp_list_cmd| |g:netrw_ftp_sizelist_cmd|
- |g:netrw_ftp_timelist_cmd| |g:netrw_ssh_cmd|
- |g:netrw_ssh_browse_reject| |g:netrw_use_noswf|
+Related topics:
+ |netrw-ctrl-r| |netrw-o| |netrw-p|
+ |netrw-P| |netrw-t| |netrw-v|
+Associated setting variables:
+ |g:netrw_browse_split| |g:netrw_fastbrowse|
+ |g:netrw_ftp_list_cmd| |g:netrw_ftp_sizelist_cmd|
+ |g:netrw_ftp_timelist_cmd| |g:netrw_ssh_browse_reject|
+ |g:netrw_ssh_cmd| |g:netrw_use_noswf|
BROWSING WITH A HORIZONTALLY SPLIT WINDOW *netrw-o* *netrw-horiz* {{{2
@@ -1207,12 +1264,14 @@ cursor at the top.
Associated setting variables: |g:netrw_alto| |g:netrw_winsize|
-Related Actions |netrw-cr| |netrw-p| |netrw-t| |netrw-v|
+Related topics:
+ |netrw-ctrl-r| |netrw-o| |netrw-p|
+ |netrw-P| |netrw-t| |netrw-v|
Associated setting variables:
|g:netrw_alto| control above/below splitting
|g:netrw_winsize| control initial sizing
-BROWSING WITH A NEW TAB *netrw-t*
+BROWSING WITH A NEW TAB *netrw-t* {{{2
Normally one enters a file or directory using the <cr>. The "t" map
allows one to open a new window holding the new directory listing or file in
@@ -1220,7 +1279,9 @@ a new tab.
If you'd like to have the new listing in a background tab, use |gT|.
-Related Actions |netrw-cr| |netrw-o| |netrw-p| |netrw-v|
+Related topics:
+ |netrw-ctrl-r| |netrw-o| |netrw-p|
+ |netrw-P| |netrw-t| |netrw-v|
Associated setting variables:
|g:netrw_winsize| control initial sizing
@@ -1236,13 +1297,30 @@ cursor at the left.
There is only one tree listing buffer; using "v" on a displayed subdirectory
will split the screen, but the same buffer will be shown twice.
-Related Actions: |netrw-cr| |netrw-o| |netrw-t| |netrw-v|
+Related topics:
+ |netrw-ctrl-r| |netrw-o| |netrw-p|
+ |netrw-P| |netrw-t| |netrw-v|
Associated setting variables:
|g:netrw_altv| control right/left splitting
|g:netrw_winsize| control initial sizing
-CHANGE LISTING STYLE (THIN LONG WIDE TREE) *netrw-i* {{{2
+BROWSING USING A GVIM SERVER *netrw-ctrl-r* {{{2
+
+One may keep a browsing gvim separate from the gvim being used to edit.
+Use the <c-r> map on a file (not a directory) in the netrw browser, and it
+will use a gvim server (see |g:netrw_servername|). Subsequent use of <cr>
+(see |netrw-cr|) will re-use that server for editing files.
+
+Related topics:
+ |netrw-ctrl-r| |netrw-o| |netrw-p|
+ |netrw-P| |netrw-t| |netrw-v|
+Associated setting variables:
+ |g:netrw_servername| : sets name of server
+ |g:netrw_browse_split| : controls how <cr> will open files
+
+
+CHANGE LISTING STYLE (THIN LONG WIDE TREE) *netrw-i* {{{2
The "i" map cycles between the thin, long, wide, and tree listing formats.
@@ -1267,7 +1345,7 @@ name.
One may make a preferred listing style your default; see |g:netrw_liststyle|.
As an example, by putting the following line in your .vimrc, >
- let g:netrw_liststyle= 4
+ let g:netrw_liststyle= 3
the tree style will become your default listing style.
One typical way to use the netrw tree display is to: >
@@ -1321,8 +1399,15 @@ The "u" map also accepts counts to go back in the history several slots.
For your convenience, |netrw-qb| lists the history number which can be
re-used in that count.
+ *.netrwhist*
See |g:netrw_dirhistmax| for how to control the quantity of history stack
-slots.
+slots. The file ".netrwhist" holds history when netrw (and vim) is not
+active. By default, its stored on the first directory on the user's
+|'runtimepath'|.
+
+Related Topics:
+ |netrw-U| changing to a successor directory
+ |g:netrw_home| controls where .netrwhist is kept
CHANGING TO A SUCCESSOR DIRECTORY *netrw-U* *netrw-downdir* {{{2
@@ -1337,7 +1422,7 @@ See |g:netrw_dirhistmax| for how to control the quantity of history stack
slots.
-CHANGING TREE TOP *netrw-ntree* *:Ntree*
+CHANGING TREE TOP *netrw-ntree* *:Ntree* {{{2
One may specify a new tree top for tree listings using >
@@ -1348,7 +1433,7 @@ information is elided).
With a "dirname", the specified directory name is used.
-NETRW CLEAN *netrw-clean* *:NetrwClean*
+NETRW CLEAN *netrw-clean* *:NetrwClean* {{{2
With :NetrwClean one may easily remove netrw from one's home directory;
more precisely, from the first directory on your |'runtimepath'|.
@@ -1361,17 +1446,16 @@ that the removal is in fact what you want to do. If netrw doesn't have
permission to remove a file, it will issue an error message.
*netrw-gx*
-CUSTOMIZING BROWSING WITH A USER FUNCTION *netrw-x* *netrw-handler* {{{2
+CUSTOMIZING BROWSING WITH A SPECIAL HANDLER *netrw-x* *netrw-handler* {{{2
(also see |netrw_filehandler|)
Certain files, such as html, gif, jpeg, (word/office) doc, etc, files, are
-best seen with a special handler (ie. a tool provided with your computer).
-Netrw allows one to invoke such special handlers by: >
+best seen with a special handler (ie. a tool provided with your computer's
+operating system). Netrw allows one to invoke such special handlers by: >
* when Exploring, hit the "x" key
* when editing, hit gx with the cursor atop the special filename
-< (not available if the |g:netrw_nogx| variable exists)
-
+< (latter not available if the |g:netrw_nogx| variable exists)
Netrw determines which special handler by the following method:
* if |g:netrw_browsex_viewer| exists, then it will be used to attempt to
@@ -1379,14 +1463,14 @@ Netrw determines which special handler by the following method:
:let g:netrw_browsex_viewer= "kfmclient exec"
< or >
- :let g:netrw_browsex_viewer= "gnome-open"
+ :let g:netrw_browsex_viewer= "xdg-open"
<
- If g:netrw_browsex_viewer == '-', then netrwFileHandler() will be
- invoked first (see |netrw_filehandler|).
+ If g:netrw_browsex_viewer == '-', then netrwFileHandlers#Invoke() will be
+ used instead (see |netrw_filehandler|).
* for Windows 32 or 64, the url and FileProtocolHandler dlls are used.
* for Gnome (with gnome-open): gnome-open is used.
- * for KDE (with kfmclient) : kfmclient is used.
+ * for KDE (with kfmclient) : kfmclient is used
* for Mac OS X : open is used.
* otherwise the netrwFileHandler plugin is used.
@@ -1395,17 +1479,31 @@ appropriate application to use to "handle" these files. Such things as
OpenOffice (*.sfx), visualization (*.jpg, *.gif, etc), and PostScript (*.ps,
*.eps) can be handled.
+The gx mapping extends to all buffers; apply "gx" while atop a word and netrw
+will apply a special handler to it (like "x" works when in a netrw buffer).
+One may also use visual mode (see |visual-start|) to select the text that the
+special handler will use. Normally gx uses expand("<cfile>") to pick up the
+text under the cursor; one may change what |expand()| uses via the
+|g:netrw_gx| variable. Alternatively, one may select the text to be used by
+gx via first making a visual selection (see |visual-block|).
+
+Associated setting variables:
+ |g:netrw_gx| control how gx picks up the text under the cursor
+ |g:netrw_nogx| prevent gx map while editing
+
*netrw_filehandler*
-The "x" map applies a function to a file, based on its extension. Of course,
-the handler function must exist for it to be called!
+When |g:netrw_browsex_viewer| exists and is "-", then netrw will attempt to
+handle the special file with a vim function. The "x" map applies a function
+to a file, based on its extension. Of course, the handler function must exist
+for it to be called!
>
- Ex. mypgm.html x ->
- NFH_html("scp://user@host/some/path/mypgm.html")
-<
-Users may write their own netrw File Handler functions to support more
-suffixes with special handling. See <autoload/netrwFileHandlers.vim> for
-examples on how to make file handler functions. As an example: >
+ Ex. mypgm.html x -> NFH_html("scp://user@host/some/path/mypgm.html")
+
+< Users may write their own netrw File Handler functions to
+ support more suffixes with special handling. See
+ <autoload/netrwFileHandlers.vim> for examples on how to make
+ file handler functions. As an example: >
" NFH_suffix(filename)
fun! NFH_suffix(filename)
@@ -1439,7 +1537,14 @@ DELETING BOOKMARKS *netrw-mB* {{{2
To delete a bookmark, use >
{cnt}mB
-<
+
+If there are marked files, then mB will remove them from the
+bookmark list.
+
+Alternatively, one may use :NetrwMB! (see |netrw-:NetrwMB|). >
+
+ :NetrwMB! [files/directories]
+
Related Topics:
|netrw-gb| how to return (go) to a bookmark
|netrw-mb| how to make a bookmark
@@ -1498,11 +1603,11 @@ DIRECTORY EXPLORATION COMMANDS {{{2
:[N]Explore[!] [dir]... Explore directory of current file *:Explore*
:[N]Hexplore[!] [dir]... Horizontal Split & Explore *:Hexplore*
- :Rexplore ... Return to/from Explorer *:Rexplore*
+ :[N]Lexplore[!] [dir]... Left Explorer Toggle *:Lexplore*
:[N]Sexplore[!] [dir]... Split&Explore current file's directory *:Sexplore*
- :Texplore [dir]... Tab & Explore *:Texplore*
:[N]Vexplore[!] [dir]... Vertical Split & Explore *:Vexplore*
- :Lexplore [dir]... Left Explorer Toggle *:Lexplore*
+ :Texplore [dir]... Tab & Explore *:Texplore*
+ :Rexplore ... Return to/from Explorer *:Rexplore*
Used with :Explore **/pattern : (also see |netrw-starstar|)
:Nexplore............. go to next matching file *:Nexplore*
@@ -1511,54 +1616,73 @@ DIRECTORY EXPLORATION COMMANDS {{{2
*netrw-:Explore*
:Explore will open the local-directory browser on the current file's
directory (or on directory [dir] if specified). The window will be
- split only if the file has been modified, otherwise the browsing
- window will take over that window. Normally the splitting is taken
- horizontally.
+ split only if the file has been modified and |'hidden'| is not set,
+ otherwise the browsing window will take over that window. Normally
+ the splitting is taken horizontally.
Also see: |netrw-:Rexplore|
:Explore! is like :Explore, but will use vertical splitting.
- *netrw-:Lexplore*
-:Lexplore [dir] toggles an Explorer window on the left hand side
- of the current tab It will open a netrw window on the current
- directory if [dir] is omitted; a :Lexplore [dir] will show
- the specified directory in the left-hand side browser display
- no matter from which window the command is issued. By default,
- :Lexplore will change an uninitialized |g:netrw_chgwin| to 2;
- edits will thus be preferentially made in window#2.
- Also see: |netrw-C|| |g:netrw_chgwin| |g:netrw_winsize|
- |netrw-p| |netrw-P|| |g:netrw_browse_split|
- *netrw-:Sexplore*
-:Sexplore will always split the window before invoking the local-directory
- browser. As with Explore, the splitting is normally done
- horizontally.
-:Sexplore! [dir] is like :Sexplore, but the splitting will be done vertically.
+
*netrw-:Hexplore*
:Hexplore [dir] does an :Explore with |:belowright| horizontal splitting.
:Hexplore! [dir] does an :Explore with |:aboveleft| horizontal splitting.
- *netrw-:Vexplore*
-:Vexplore [dir] does an :Explore with |:leftabove| vertical splitting.
-:Vexplore! [dir] does an :Explore with |:rightbelow| vertical splitting.
+
+ *netrw-:Lexplore*
+:[N]Lexplore [dir] toggles a full height Explorer window on the left hand side
+ of the current tab. It will open a netrw window on the current
+ directory if [dir] is omitted; a :Lexplore [dir] will show the
+ specified directory in the left-hand side browser display no matter
+ from which window the command is issued. By default, :Lexplore will
+ change an uninitialized |g:netrw_chgwin| to 2; edits will thus
+ preferentially be made in window#2.
+ The [N] specifies a |g:netrw_winsize| just for the new :Lexplore
+ window.
+ Those who like this method often also like tree style displays;
+ see |g:netrw_liststyle|.
+
+ Also see: |netrw-C| |g:netrw_chgwin| |g:netrw_winsize|
+ |netrw-p| |netrw-P| |g:netrw_browse_split|
+
+:[N]Lexplore! is like :Lexplore, except that the full-height Explorer window
+ will open on the right hand side, and an uninitialized |g:netrw_chgwin|
+ will be set to 1.
+
+ *netrw-:Sexplore*
+:[N]Sexplore will always split the window before invoking the local-directory
+ browser. As with Explore, the splitting is normally done
+ horizontally.
+:[N]Sexplore! [dir] is like :Sexplore, but the splitting will be done vertically.
+
*netrw-:Texplore*
:Texplore [dir] does a |:tabnew| before generating the browser window
-By default, these commands use the current file's directory. However, one may
-explicitly provide a directory (path) to use.
+ *netrw-:Vexplore*
+:[N]Vexplore [dir] does an :Explore with |:leftabove| vertical splitting.
+:[N]Vexplore! [dir] does an :Explore with |:rightbelow| vertical splitting.
-The [N] will override |g:netrw_winsize| to specify the quantity of rows and/or
-columns the new explorer window should have.
+The optional parameters are:
-Otherwise, the |g:netrw_winsize| variable, if it has been specified by the
-user, is used to control the quantity of rows and/or columns new explorer
-windows should have.
+ [N]: This parameter will override |g:netrw_winsize| to specify the quantity of
+ rows and/or columns the new explorer window should have.
+ Otherwise, the |g:netrw_winsize| variable, if it has been specified by the
+ user, is used to control the quantity of rows and/or columns new
+ explorer windows should have.
+ [dir]: By default, these explorer commands use the current file's directory.
+ However, one may explicitly provide a directory (path) to use instead;
+ ie. >
+
+ :Explore /some/path
+<
*netrw-:Rexplore*
-:Rexplore This command is a little different from the others as it doesn't
- necessarily open an Explorer window.
+:Rexplore This command is a little different from the other Explore commands
+ as it doesn't necessarily open an Explorer window.
Return to Explorer~
- When one edits a file, for example by pressing <cr> when the
- cursor is atop a file in a netrw browser window, :Rexplore will
- return the display to that of the last netrw browser display
- in that window.
+ When one edits a file using netrw which can occur, for example,
+ when pressing <cr> while the cursor is atop a filename in a netrw
+ browser window, a :Rexplore issued while editing that file will
+ return the display to that of the last netrw browser display in
+ that window.
Return from Explorer~
Conversely, when one is editing a directory, issuing a :Rexplore
@@ -1571,11 +1695,11 @@ windows should have.
Also see: |g:netrw_alto| |g:netrw_altv| |g:netrw_winsize|
-*netrw-star* *netrw-starpat* *netrw-starstar* *netrw-starstarpat*
-EXPLORING WITH STARS AND PATTERNS
+*netrw-star* *netrw-starpat* *netrw-starstar* *netrw-starstarpat* *netrw-grep*
+EXPLORING WITH STARS AND PATTERNS {{{2
When Explore, Sexplore, Hexplore, or Vexplore are used with one of the
-following four styles, Explore generates a list of files which satisfy
+following four patterns Explore generates a list of files which satisfy
the request. >
*/filepat files in current directory which satisfy filepat
@@ -1597,7 +1721,7 @@ will clear the explore list.
If your console or gui produces recognizable shift-up or shift-down sequences,
then you'll likely find using shift-downarrow and shift-uparrow convenient.
-They're mapped by netrw:
+They're mapped by netrw as follows:
<s-down> == Nexplore, and
<s-up> == Pexplore.
@@ -1678,7 +1802,7 @@ Related topics: |netrw-s| |netrw-S|
Associated setting variables: |g:netrw_sort_sequence| |g:netrw_sort_options|
-EXECUTING FILE UNDER CURSOR VIA SYSTEM() *netrw-X*
+EXECUTING FILE UNDER CURSOR VIA SYSTEM() *netrw-X* {{{2
Pressing X while the cursor is atop an executable file will yield a prompt
using the filename asking for any arguments. Upon pressing a [return], netrw
@@ -1769,18 +1893,19 @@ Associated topics: |netrw-a| |netrw-ctrl-h| |netrw-mh|
Netrw provides a helper function 'netrw_gitignore#Hide()' that, when used with
|g:netrw_list_hide| automatically hides all git-ignored files.
-'netrw_gitignore#Hide' searches for patterns in the following files:
+'netrw_gitignore#Hide' searches for patterns in the following files: >
+
'./.gitignore'
'./.git/info/exclude'
global gitignore file: `git config --global core.excludesfile`
system gitignore file: `git config --system core.excludesfile`
-
+<
Files that do not exist, are ignored.
Git-ignore patterns are taken from existing files, and converted to patterns for
hiding files. For example, if you had '*.log' in your '.gitignore' file, it
would be converted to '.*\.log'.
-To use this function, simply assign it's output to |g:netrw_list_hide| option.
+To use this function, simply assign its output to |g:netrw_list_hide| option. >
Example: let g:netrw_list_hide= netrw_gitignore#Hide()
Git-ignored files are hidden in Netrw.
@@ -1790,7 +1915,7 @@ To use this function, simply assign it's output to |g:netrw_list_hide| option.
Example: g:netrw_list_hide= netrw_gitignore#Hide() . '.*\.swp$'
Combining 'netrw_gitignore#Hide' with custom patterns.
-
+<
IMPROVING BROWSING *netrw-listhack* *netrw-ssh-hack* {{{2
@@ -1926,7 +2051,7 @@ Associated setting variable: |g:netrw_keepdir|
MARKING FILES *netrw-:MF* *netrw-mf* {{{2
(also see |netrw-mr|)
-Netrw has several ways of marking files:
+Netrw provides several ways to mark files:
* One may mark files with the cursor atop a filename and
then pressing "mf".
@@ -1949,6 +2074,8 @@ The following netrw maps make use of marked files:
|netrw-a| Hide marked files/directories
|netrw-D| Delete marked files/directories
+ |netrw-mb| Append marked files to bookmarks
+ |netrw-mB| Delete marked files from bookmarks
|netrw-mc| Copy marked files to target
|netrw-md| Apply vimdiff to marked files
|netrw-me| Edit marked files
@@ -1958,7 +2085,9 @@ The following netrw maps make use of marked files:
|netrw-mp| Print marked files
|netrw-mt| Set target for |netrw-mm| and |netrw-mc|
|netrw-mT| Generate tags using marked files
+ |netrw-mv| Apply vim command to marked files
|netrw-mx| Apply shell command to marked files
+ |netrw-mX| Apply shell command to marked files, en bloc
|netrw-mz| Compress/Decompress marked files
|netrw-O| Obtain marked files
|netrw-R| Rename marked files
@@ -1982,13 +2111,13 @@ If the mouse is enabled and works with your vim, you may use <s-leftmouse> to
mark one or more files. You may mark multiple files by dragging the shifted
leftmouse. (see |netrw-mouse|)
-*markfilelist* *global_markfilelist* *local_markfilelist*
+ *markfilelist* *global_markfilelist* *local_markfilelist*
All marked files are entered onto the global marked file list; there is only
-one such list. In addition, every netrw buffer also has its own local marked
-file list; since netrw buffers are associated with specific directories, this
-means that each directory has its own local marked file list. The various
-commands which operate on marked files use one or the other of the marked file
-lists.
+one such list. In addition, every netrw buffer also has its own buffer-local
+marked file list; since netrw buffers are associated with specific
+directories, this means that each directory has its own local marked file
+list. The various commands which operate on marked files use one or the other
+of the marked file lists.
Known Problem: if one is using tree mode (|g:netrw_liststyle|) and several
directories have files with the same name, then marking such a file will
@@ -2004,7 +2133,7 @@ This command will unmark all files in the current buffer. One may also use
mf (|netrw-mf|) on a specific file to unmark just that file.
-MARKING FILES BY QUICKFIX LIST *netrw-qF*
+MARKING FILES BY QUICKFIX LIST *netrw-qF* {{{2
(also see |netrw-mf|)
One may convert the |quickfix-error-lists| into a marked file list using
@@ -2024,7 +2153,20 @@ future I may make it possible to use |regexp|s instead of glob()-style
expressions (yet-another-option).
-MARKED FILES: ARBITRARY COMMAND *netrw-mx* {{{2
+MARKED FILES, ARBITRARY VIM COMMAND *netrw-mv* {{{2
+ (See |netrw-mf| and |netrw-mr| for how to mark files)
+ (uses the local marked-file list)
+
+The "mv" map causes netrw execute an arbitrary vim command on each file
+on the local marked file list, individually:
+
+ * 1split
+ * sil! keepalt e file
+ * run vim command
+ * sil! keepalt wq!
+
+
+MARKED FILES, ARBITRARY SHELL COMMAND *netrw-mx* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files)
(uses the local marked-file list)
@@ -2033,6 +2175,37 @@ command to be applied to all marked files. All "%"s in the command will be
substituted with the name of each marked file in turn. If no "%"s are in the
command, then the command will be followed by a space and a marked filename.
+Example:
+ (mark files)
+ mx
+ Enter command: cat
+
+ The result is a series of shell commands:
+ cat 'file1'
+ cat 'file2'
+ ...
+
+
+MARKED FILES, ARBITRARY SHELL COMMAND, EN BLOC *netrw-mX* {{{2
+ (See |netrw-mf| and |netrw-mr| for how to mark files)
+ (uses the global marked-file list)
+
+Upon activation of the 'mX' map, netrw will query the user for some (external)
+command to be applied to all marked files on the global marked file list. The
+"en bloc" means that one command will be executed on all the files at once: >
+
+ command files
+
+It is useful, for example, to select files and make a tarball:
+
+ (mark files)
+ mX
+ Enter command: tar cf mynewtarball.tar
+
+The command that will be run in this example:
+
+ tar cf mynewtarball.tar 'file1' 'file2' ...
+
MARKED FILES: COMPRESSION AND DECOMPRESSION *netrw-mz* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files)
@@ -2046,6 +2219,10 @@ that's "gzip".
For decompression, netrw provides a |Dictionary| of suffices and their
associated decompressing utilities; see |g:netrw_decompress|.
+Remember that one can mark multiple files by regular expression
+(see |netrw-mr|); this is particularly useful to facilitate compressing and
+decompressing a large number of files.
+
Associated setting variables: |g:netrw_compress| |g:netrw_decompress|
MARKED FILES: COPYING *netrw-mc* {{{2
@@ -2056,7 +2233,16 @@ Select a target directory with mt (|netrw-mt|). Then change directory,
select file(s) (see |netrw-mf|), and press "mc". The copy is done
from the current window (where one does the mf) to the target.
-Associated setting variable: |g:netrw_localcopycmd| |g:netrw_ssh_cmd|
+If one does not have a target directory set with |netrw-mt|, then netrw
+will query you for a directory to copy to.
+
+One may also copy directories and their contents (local only) to a target
+directory.
+
+Associated setting variables:
+ |g:netrw_localcopycmd|
+ |g:netrw_localcopydircmd|
+ |g:netrw_ssh_cmd|
MARKED FILES: DIFF *netrw-md* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files)
@@ -2090,7 +2276,7 @@ Thus, one may use >
mr ...file-pattern
mg ..contents-pattern
to have a marked file list satisfying the file-pattern but containing the
-desried contents-pattern.
+desired contents-pattern.
MARKED FILES: HIDING AND UNHIDING BY SUFFIX *netrw-mh* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files)
@@ -2148,7 +2334,7 @@ Set the marked file copy/move-to target (see |netrw-mc| and |netrw-mm|):
* Also, if the cursor is in the banner, then the netrw window's currently
displayed directory is used for the copy/move-to target.
Unless the target already is the current directory. In which case,
- remove the target.
+ typing "mf" clears the target.
* However, if the cursor is atop a directory name, then that directory is
used for the copy/move-to target
@@ -2157,9 +2343,9 @@ Set the marked file copy/move-to target (see |netrw-mc| and |netrw-mm|):
This command uses |<q-args>|, so spaces in the directory name are
permitted without escaping.
-There is only one copy/move-to target per vim session; ie. the target is a
-script variable (see |s:var|) and is shared between all netrw windows (in an
-instance of vim).
+There is only one copy/move-to target at a time in a vim session; ie. the
+target is a script variable (see |s:var|) and is shared between all netrw
+windows (in an instance of vim).
When using menus and gvim, netrw provides a "Targets" entry which allows one
to pick a target from the list of bookmarks and history.
@@ -2196,7 +2382,7 @@ edit the desired file and go to the tag.
Associated setting variables: |g:netrw_ctags| |g:netrw_ssh_cmd|
-MARKED FILES: TARGET DIRECTORY USING BOOKMARKS *netrw-Tb* {{{2
+MARKED FILES: TARGET DIRECTORY USING BOOKMARKS *netrw-Tb* {{{2
Sets the marked file copy/move-to target.
@@ -2214,7 +2400,7 @@ Related topics:
Moving files to target.............................|netrw-mm|
-MARKED FILES: TARGET DIRECTORY USING HISTORY *netrw-Th* {{{2
+MARKED FILES: TARGET DIRECTORY USING HISTORY *netrw-Th* {{{2
Sets the marked file copy/move-to target.
@@ -2269,15 +2455,13 @@ your browsing preferences. (see also: |netrw-settings|)
*g:netrw_banner* enable/suppress the banner
=0: suppress the banner
=1: banner is enabled (default)
- NOTE: suppressing the banner is a new feature
- which may cause problems.
*g:netrw_bannerbackslash* if this variable exists and is not zero, the
banner will be displayed with backslashes
rather than forward slashes.
*g:netrw_browse_split* when browsing, <cr> will open the file by:
- =0: re-using the same window
+ =0: re-using the same window (default)
=1: horizontally splitting the window first
=2: vertically splitting the window first
=3: open file in new tab
@@ -2285,10 +2469,19 @@ your browsing preferences. (see also: |netrw-settings|)
Note that |g:netrw_preview| may be used
to get vertical splitting instead of
horizontal splitting.
+ =[servername,tab-number,window-number]
+ Given a |List| such as this, a remote server
+ named by the "servername" will be used for
+ editing. It will also use the specified tab
+ and window numbers to perform editing
+ (see |clientserver|, |netrw-ctrl-r|)
+ This option does not affect |:Lexplore|
+ windows.
Related topics:
- |netrw-cr| |netrw-C|
- |g:netrw_alto| |g:netrw_altv|
+ |g:netrw_alto| |g:netrw_altv|
+ |netrw-C| |netrw-cr|
+ |netrw-ctrl-r|
*g:netrw_browsex_viewer* specify user's preference for a viewer: >
"kfmclient exec"
@@ -2321,7 +2514,7 @@ your browsing preferences. (see also: |netrw-settings|)
tags
*g:netrw_cursor* = 2 (default)
- This option controls the use of the
+ This option controls the use of the
|'cursorline'| (cul) and |'cursorcolumn'|
(cuc) settings by netrw:
@@ -2385,7 +2578,7 @@ your browsing preferences. (see also: |netrw-settings|)
versus speed.
*g:netrw_ffkeep* (default: doesn't exist)
- If this variable exists and is zero, then
+ If this variable exists and is zero, then
netrw will not do a save and restore for
|'fileformat'|.
@@ -2428,6 +2621,11 @@ your browsing preferences. (see also: |netrw-settings|)
These characters in directory names are
escaped before applying glob()
+ *g:netrw_gx* ="<cfile>"
+ This option controls how gx (|netrw-gx|) picks
+ up the text under the cursor. See |expand()|
+ for possibilities.
+
*g:netrw_hide* Controlled by the "a" map (see |netrw-a|)
=0 : show all
=1 : show not-hidden files
@@ -2447,10 +2645,22 @@ your browsing preferences. (see also: |netrw-settings|)
The current browsing directory is contained in
b:netrw_curdir (also see |netrw-c|)
+ *g:netrw_keepj* ="keepj" (default) netrw attempts to keep the
+ |:jumps| table unaffected.
+ ="" netrw will not use |:keepjumps| with
+ exceptions only for the
+ saving/restoration of position.
+
*g:netrw_list_cmd* command for listing remote directories
default: (if ssh is executable)
"ssh HOSTNAME ls -FLa"
+ *g:netrw_list_cmd_options* If this variable exists, then its contents are
+ appended to the g:netrw_list_cmd. For
+ example, use "2>/dev/null" to get rid of banner
+ messages on unix systems.
+
+
*g:netrw_liststyle* Set the default listing style:
= 0: thin listing (one file per line)
= 1: long listing (one file per line with time
@@ -2468,7 +2678,7 @@ your browsing preferences. (see also: |netrw-settings|)
Examples:
let g:netrw_list_hide= '.*\.swp$'
- let g:netrw_list_hide= netrw_gitignore#Hide().'.*\.swp$'
+ let g:netrw_list_hide= netrw_gitignore#Hide().'.*\.swp$'
default: ""
*g:netrw_localcopycmd* ="cp" Linux/Unix/MacOS/Cygwin
@@ -2476,6 +2686,11 @@ your browsing preferences. (see also: |netrw-settings|)
Copies marked files (|netrw-mf|) to target
directory (|netrw-mt|, |netrw-mc|)
+ *g:netrw_localcopydircmd* ="cp -R" Linux/Unix/MacOS/Cygwin
+ ="xcopy /e /c /h/ /i /k" Windows
+ Copies directories to target directory.
+ (|netrw-mc|, |netrw-mt|)
+
*g:netrw_localmkdir* command for making a local directory
default: "mkdir"
@@ -2499,7 +2714,7 @@ your browsing preferences. (see also: |netrw-settings|)
default: "ssh USEPORT HOSTNAME mkdir"
*g:netrw_mousemaps* =1 (default) enables mouse buttons while
- browsing to:
+ browsing to:
leftmouse : open file/directory
shift-leftmouse : mark file
middlemouse : same as P
@@ -2543,6 +2758,10 @@ your browsing preferences. (see also: |netrw-settings|)
*g:netrw_rmf_cmd* command for removing remote softlinks
default: "ssh USEPORT HOSTNAME rm -f"
+ *g:netrw_servername* use this variable to provide a name for
+ |netrw-ctrl-r| to use for its server.
+ default: "NETRWSERVER"
+
*g:netrw_sort_by* sort by "name", "time", or "size"
default: "name"
@@ -2731,7 +2950,7 @@ Related topics:
directory, see |g:netrw_keepdir|.
*netrw-createfile*
-OPEN A NEW FILE IN NETRW'S CURRENT DIRECTORY *netrw-%*
+OPEN A NEW FILE IN NETRW'S CURRENT DIRECTORY *netrw-%* {{{2
To open a new file in netrw's current directory, press "%". This map
will query the user for a new filename; an empty file by that name will
@@ -2744,9 +2963,9 @@ PREVIEW WINDOW *netrw-p* *netrw-preview* {{{2
One may use a preview window by using the "p" key when the cursor is atop the
desired filename to be previewed. The display will then split to show both
-the browser (where the cursor will remain) and the file (see |:pedit|).
-By default, the split will be taken horizontally; one may use vertical
-splitting if one has set |g:netrw_preview| first.
+the browser (where the cursor will remain) and the file (see |:pedit|). By
+default, the split will be taken horizontally; one may use vertical splitting
+if one has set |g:netrw_preview| first.
An interesting set of netrw settings is: >
@@ -2755,6 +2974,7 @@ An interesting set of netrw settings is: >
let g:netrw_winsize = 30
These will:
+
1. Make vertical splitting the default for previewing files
2. Make the default listing style "tree"
3. When a vertical preview window is opened, the directory listing
@@ -2817,6 +3037,17 @@ If there are marked files: (see |netrw-mf|)
Marked files will be renamed (moved). You will be queried as above in
order to specify where you want the file/directory to be moved.
+ If you answer a renaming query with a "s/frompattern/topattern/", then
+ subsequent files on the marked file list will be renamed by taking each
+ name, applying that substitute, and renaming each file to the result.
+ As an example : >
+
+ mr [query: reply with *.c]
+ R [query: reply with s/^\(.*\)\.c$/\1.cpp/]
+<
+ This example will mark all *.c files and then rename them to *.cpp
+ files.
+
WARNING:~
Note that moving files is a dangerous operation; copies are safer. That's
@@ -2843,17 +3074,24 @@ Related topics: |netrw-r| |netrw-S|
Associated setting variables: |g:netrw_sort_by| |g:netrw_sort_sequence|
-SETTING EDITING WINDOW *netrw-C* {{{2
+SETTING EDITING WINDOW *netrw-C* *netrw-:NetrwC* {{{2
-One may select a netrw window for editing with the "C" mapping, or by setting
-g:netrw_chgwin to the selected window number. Subsequent selection of a file
-to edit (|netrw-cr|) will use that window.
+One may select a netrw window for editing with the "C" mapping, using the
+:NetrwC [win#] command, or by setting g:netrw_chgwin to the selected window
+number. Subsequent selection of a file to edit (|netrw-cr|) will use that
+window.
* C by itself, will select the current window for editing via
|netrw-cr|
* [count]C the count will be used as the window number to be used
for editing via |netrw-cr|.
+
+ * :NetrwC will set |g:netrw_chgwin| to the current window
+
+ * :NetrwC win# will set |g:netrw_chgwin| to the specified window
+ number
+
Using >
let g:netrw_chgwin= -1
will restore the default editing behavior (ie. use the current window).
@@ -3107,7 +3345,7 @@ Associated setting variables: |g:netrw_chgwin|
"let g:netrw_scp_cmd = "d:\\dev\\putty\\PSCP.exe"
<
*netrw-p14*
- P14. I'd would like to speed up writes using Nwrite and scp/ssh
+ P14. I would like to speed up writes using Nwrite and scp/ssh
style connections. How? (Thomer M. Gil)
Try using ssh's ControlMaster and ControlPath (see the ssh_config
@@ -3155,15 +3393,66 @@ Associated setting variables: |g:netrw_chgwin|
directory. Start if from your $HOME or another writable
directory.
+ *netrw-p17*
+ P17. Netrw is closing buffers on its own.
+ What steps will reproduce the problem?
+ 1. :Explore, navigate directories, open a file
+ 2. :Explore, open another file
+ 3. Buffer opened in step 1 will be closed. o
+ What is the expected output? What do you see instead?
+ I expect both buffers to exist, but only the last one does.
+
+ (Lance) Problem is caused by "set autochdir" in .vimrc.
+ (drchip) I am able to duplicate this problem with |'acd'| set.
+ It appears that the buffers are not exactly closed;
+ a ":ls!" will show them (although ":ls" does not).
+
+ *netrw-P18*
+ P18. How to locally edit a file that's only available via
+ another server accessible via ssh?
+ See http://stackoverflow.com/questions/12469645/
+ "Using Vim to Remotely Edit A File on ServerB Only
+ Accessible From ServerA"
+
==============================================================================
11. Debugging Netrw Itself *netrw-debug* {{{1
-The <netrw.vim> script is typically available as something like:
+Step 1: check that the problem you've encountered hasn't already been resolved
+by obtaining a copy of the latest (often developmental) netrw at:
+
+ http://www.drchip.org/astronaut/vim/index.html#NETRW
+
+The <netrw.vim> script is typically installed on systems as something like:
>
/usr/local/share/vim/vim7x/plugin/netrwPlugin.vim
/usr/local/share/vim/vim7x/autoload/netrw.vim
+ (see output of :echo &rtp)
+<
+which is loaded automatically at startup (assuming :set nocp). If you
+installed a new netrw, then it will be located at >
+
+ $HOME/.vim/plugin/netrwPlugin.vim
+ $HOME/.vim/autoload/netrw.vim
<
-which is loaded automatically at startup (assuming :set nocp).
+Step 2: assuming that you've installed the latest version of netrw,
+check that your problem is really due to netrw. Create a file
+called netrw.vimrc with the following contents: >
+
+ set nocp
+ so $HOME/.vim/plugin/netrwPlugin.vim
+<
+Then run netrw as follows: >
+
+ vim -u netrw.vimrc --noplugins [some path here]
+<
+Perform whatever netrw commands you need to, and check that the problem is
+still present. This procedure sidesteps any issues due to personal .vimrc
+settings and other plugins. If the problem does not appear, then you need
+to determine what setting in your .vimrc is causing the conflict with netrw
+or which plugin.
+
+Step 3: If the problem still is present, then get a debugging trace from
+netrw:
1. Get the <Decho.vim> script, available as:
@@ -3192,7 +3481,8 @@ which is loaded automatically at startup (assuming :set nocp).
3. Then bring up vim and attempt to evoke the problem by doing a
transfer or doing some browsing. A set of messages should appear
concerning the steps that <netrw.vim> took in attempting to
- read/write your file over the network in a separate tab.
+ read/write your file over the network in a separate tab or
+ server vim window.
To save the file, use >
@@ -3207,14 +3497,82 @@ which is loaded automatically at startup (assuming :set nocp).
debugging trace is due to which command.
Please send that information to <netrw.vim>'s maintainer along
- with the o/s you're using and vim version you're using
+ with the o/s you're using and the vim version that you're using
(see |:version|) >
NdrOchip at ScampbellPfamily.AbizM - NOSPAM
<
==============================================================================
12. History *netrw-history* {{{1
- v152: Apr 08, 2014 * uses the |'noswapfile'| option (requires
+ v153: May 13, 2014 * added another |g:netrw_ffkeep| usage {{{2
+ May 14, 2014 * changed s:PerformListing() so that it
+ always sets ft=netrw for netrw buffers
+ (ie. even when syntax highlighting is
+ off, not available, etc)
+ May 16, 2014 * introduced the |netrw-ctrl-r| functionality
+ May 17, 2014 * introduced the |netrw-:NetrwMB| functionality
+ * mb and mB (|netrw-mb|, |netrw-mB|) will
+ add/remove marked files from bookmark list
+ May 20, 2014 * (Enno Nagel) reported that :Lex <dirname>
+ wasn't working. Fixed.
+ May 26, 2014 * restored test to prevent leftmouse window
+ resizing from causing refresh.
+ (see s:NetrwLeftmouse())
+ * fixed problem where a refresh caused cursor
+ to go just under the banner instead of
+ staying put
+ May 28, 2014 * (László Bimba) provided a patch for opening
+ the |:Lexplore| window 100% high, optionally
+ on the right, and will work with remote
+ files.
+ May 29, 2014 * implemented :NetrwC (see |netrw-:NetrwC|)
+ Jun 01, 2014 * Removed some "silent"s from commands used
+ to implemented scp://... and pscp://...
+ directory listing. Permits request for
+ password to appear.
+ Jun 05, 2014 * (Enno Nagel) reported that user maps "/"
+ caused problems with "b" and "w", which
+ are mapped (for wide listings only) to
+ skip over files rather than just words.
+ Jun 10, 2014 * |g:netrw_gx| introduced to allow users to
+ override default "<cfile>" with the gx
+ (|netrw-gx|) map
+ Jun 11, 2014 * gx (|netrw-gx|), with |'autowrite'| set,
+ will write modified files. s:NetrwBrowseX()
+ will now save, turn off, and restore the
+ |'autowrite'| setting.
+ Jun 13, 2014 * added visual map for gx use
+ Jun 15, 2014 * (Enno Nagel) reported that with having hls
+ set and wide listing style in use, that the
+ b and w maps caused unwanted highlighting.
+ Jul 05, 2014 * |netrw-mv| and |netrw-mX| commands included
+ Jul 09, 2014 * |g:netrw_keepj| included, allowing optional
+ keepj
+ Jul 09, 2014 * fixing bugs due to previous update
+ Jul 21, 2014 * (Bruno Sutic) provided an updated
+ netrw_gitignore.vim
+ Jul 30, 2014 * (Yavuz Yetim) reported that editing two
+ remote files of the same name caused the
+ second instance to have a "temporary"
+ name. Fixed: now they use the same buffer.
+ Sep 18, 2014 * (Yasuhiro Matsumoto) provided a patch which
+ allows scp and windows local paths to work.
+ Oct 07, 2014 * gx (see |netrw-gx|) when atop a directory,
+ will now do |gf| instead
+ Nov 06, 2014 * For cygwin: cygstart will be available for
+ netrw#BrowseX() to use if its executable.
+ Nov 07, 2014 * Began support for file://... urls. Will use
+ |g:netrw_file_cmd| (typically elinks or links)
+ Dec 02, 2014 * began work on having mc (|netrw-mc|) copy
+ directories. Works for linux machines,
+ cygwin+vim, but not for windows+gvim.
+ Dec 02, 2014 * in tree mode, netrw was not opening
+ directories via symbolic links.
+ Dec 02, 2014 * added resolved link information to
+ thin and tree modes
+ Dec 30, 2014 * (issue#231) |:ls| was not showing
+ remote-file buffers reliably. Fixed.
+ v152: Apr 08, 2014 * uses the |'noswapfile'| option (requires {{{2
vim 7.4 with patch 213)
* (Enno Nagel) turn |'rnu'| off in netrw
buffers.
@@ -3240,7 +3598,7 @@ which is loaded automatically at startup (assuming :set nocp).
chgwin window.
May 09, 2014 * SavePosn was "saving filename under cursor"
from a non-netrw window when using :Rex.
- v151: Jan 22, 2014 * extended :Rexplore to return to buffer
+ v151: Jan 22, 2014 * extended :Rexplore to return to buffer {{{2
prior to Explore or editing a directory
* (Ken Takata) netrw gave error when
clipboard was disabled. Sol'n: Placed
@@ -3287,7 +3645,7 @@ which is loaded automatically at startup (assuming :set nocp).
and it also handles Window's shares
* Fixed |netrw-d| command when applied with ftp
* https: support included for netrw#NetRead()
- v150: Jul 12, 2013 * removed a "keepalt" to allow ":e #" to
+ v150: Jul 12, 2013 * removed a "keepalt" to allow ":e #" to {{{2
return to the netrw directory listing
Jul 13, 2013 * (Jonas Diemer) suggested changing
a <cWORD> to <cfile>.
@@ -3342,7 +3700,7 @@ which is loaded automatically at startup (assuming :set nocp).
style, with a previous window open, that
the wrong directory was being used to open
a file. Fixed. (P21)
- v149: Apr 18, 2013 * in wide listing format, now have maps for
+ v149: Apr 18, 2013 * in wide listing format, now have maps for {{{2
w and b to move to next/previous file
Apr 26, 2013 * one may now copy files in the same
directory; netrw will issue requests for
@@ -3356,133 +3714,9 @@ which is loaded automatically at startup (assuming :set nocp).
requested by Paul Domaskis.
Jul 03, 2013 * Explore now avoids splitting when a buffer
will be hidden.
- v148: Apr 16, 2013 * changed Netrw's Style menu to allow direct
+ v148: Apr 16, 2013 * changed Netrw's Style menu to allow direct {{{2
choice of listing style, hiding style, and
sorting style
- v147: Nov 24, 2012 * (James McCoy) Even with g:netrw_dirhistmax
- at zero, the .vim/ directory would be
- created to support history/bookmarks. I've
- gone over netrw to suppress history and
- bookmarking when g:netrw_dirhistmax is zero.
- For instance, the menus will display
- (disabled) when attempts to use
- bookmarks/history are made.
- Nov 29, 2012 * (Kim Jang-hwan) reported that with
- g:Align_xstrlen set to 3 that the cursor was
- moved (linewise) after invocation. This
- problem also afflicted netrw.
- (see |g:netrw_xstrlen|) Fixed.
- Jan 21, 2013 * (mattn) provided a patch to insert some
- endifs needed with the code implementing
- |netrw-O|.
- Jan 24, 2013 * (John Szakmeister) found that remote file
- editing resulted in filetype options being
- overwritten by NetrwOptionRestore(). I
- moved filetype detect from NetrwGetFile()
- to NetrwOptionRestore.
- Feb 17, 2013 * (Yukhiro Nakadaira) provided a patch
- correcting some syntax errors.
- Feb 28, 2013 * (Ingo Karkat) provided a patch preventing
- receipt of an |E95| when revisiting a
- file://... style url.
- Mar 18, 2013 * (Gary Johnson) pointed out that changing
- cedit to <Esc> caused problems with visincr;
- the cedit setting is now bypassed in netrw too.
- Apr 02, 2013 * (Paul Domaskis) reported an undefined
- variable error (s:didstarstar) was
- occurring. It is now defined at
- initialization.
- * included additional sanity checking for the
- marked file functions.
- * included |netrw-qF| and special "j" option
- handling for |netrw-mg|
- Apr 12, 2013 * |netrw-u| and |netrw-U| now handle counts
- * the former mapping for "T" has been removed;
- in its place are new maps, |netrw-Tb| and |netrw-Th|.
- * the menu now supports a "Targets" entry for
- easier target selection. (see |netrw-mt|)
- * (Paul Domaskis) reported some problems with
- moving/copying files under Windows' gvim
- (ie. not cygwin). Fixed.
- * (Paul Mueller) provided a patch to get
- start and rundll working via |netrw-gx|
- by bypassing the user's |'shellslash'| option.
- v146: Oct 20, 2012 * (David Kotchan) reported that under Windows,
- directories named with unusual characters
- such as "#" or "$" were not being listed
- properly.
- * (Kenny Lee) reported that the buffer list
- was being populated by netrw buffers.
- Netrw will now |:bwipe| netrw buffers
- upon editing a file if g:netrw_fastbrowse
- is zero and its not in tree listing style.
- * fixed a bug with s:NetrwInit() that
- prevented initialization with |Lists| and
- |Dictionaries|.
- * |netrw-mu| now unmarks marked-file lists
- v145: Apr 05, 2012 * moved some command from a g:netrw_local_...
- format to g:netwr_local... format
- * included some NOTE level messages about
- commands that aren't executable
- * |g:netrw_errorlvl| (default: NOTE=0)
- option introduced
- May 18, 2012 * (Ilya Dogolazky) a scenario where a
- |g:netrw_fastbrowse| of zero did not
- have a local directory refreshed fixed.
- Jul 10, 2012 * (Donatas) |netrw-gb| wasn't working due
- to an incorrectly used variable.
- Aug 09, 2012 * (Bart Baker) netrw was doubling
- of entries after a split.
- * (code by Takahiro Yoshihara) implemented
- |g:netrw_dynamic_maxfilenamelen|
- Aug 31, 2012 * (Andrew Wong) netrw refresh overwriting
- the yank buffer.
- v144: Mar 12, 2012 * when |CTRL-W_s| or |CTRL-W_v| are used,
- or their wincmd equivalents, on a netrw
- buffer, the netrw's w: variables were
- not copied over. Fixed.
- Mar 13, 2012 * nbcd_curpos_{bufnr('%')} was commented
- out, and was mistakenly used during
- RestorePosn. Unfortunately, I'm not
- sure why it was commented out, so this
- "fix" may re-introduce an earlier problem.
- Mar 21, 2012 * included s:rexposn internally to make
- :Rex return the cursor to the same pos'n
- upon restoration of netrw buffer
- Mar 27, 2012 * (sjbesse) s:NetrwGetFile() needs to remove
- "/" from the netrw buffer's usual |'isk'|
- in order to allow "filetype detect" to work
- properly for scripts.
- v143: Jun 01, 2011 * |g:netrw_winsize| will accept a negative
- number; the absolute value of it will then
- be used to specify lines/columns instead of
- a percentage.
- Jul 05, 2011 * the "d" map now supports mkdir via ftp
- See |netrw-d| and |g:netrw_remote_mkdir|
- Jul 11, 2011 * Changed Explore!, Sexplore!, and Vexplore
- to use a percentage of |winwidth()| instead
- of a percentage of |winheight()|.
- Jul 11, 2011 * included support for https://... I'm just
- beginning to test this, however.
- Aug 01, 2011 * changed RestoreOptions to also restore
- cursor position in netrw buffers.
- Aug 12, 2011 * added a note about "%" to the balloon
- Aug 30, 2011 * if |g:netrw_nobeval| exists, then balloon
- evaluation is suppressed.
- Aug 31, 2011 * (Benjamin R Haskell) provided a patch that
- implements non-standard port handling for
- files opened via the remote browser.
- Aug 31, 2011 * Fixed a **//pattern Explorer bug
- Sep 15, 2011 * (reported by Francesco Campana) netrw
- now permits the "@" to be part of the
- user id (if there's an @ that appears
- to the right).
- Nov 21, 2011 * New option: |g:netrw_ftp_options|
- Dec 07, 2011 * (James Sinclair) provided a fix handling
- attempts to use a uid and password when
- they weren't defined. This affected
- NetWrite (NetRead already had that fix).
-
==============================================================================
13. Todo *netrw-todo* {{{1
diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt
index 79d87fa91..695d7ceb4 100644
--- a/runtime/doc/quickref.txt
+++ b/runtime/doc/quickref.txt
@@ -1,4 +1,4 @@
-*quickref.txt* For Vim version 7.4. Last change: 2014 Jun 25
+*quickref.txt* For Vim version 7.4. Last change: 2014 Nov 19
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -764,6 +764,7 @@ Short explanation of each option: *option-list*
'keywordprg' 'kp' program to use for the "K" command
'langmap' 'lmap' alphabetic characters for other language mode
'langmenu' 'lm' language to be used for the menus
+'langnoremap' 'lnr' do not apply 'langmap' to mapped characters
'laststatus' 'ls' tells when last window has status lines
'lazyredraw' 'lz' don't redraw while executing macros
'linebreak' 'lbr' wrap long lines at a blank
@@ -831,6 +832,7 @@ Short explanation of each option: *option-list*
'regexpengine' 're' default regexp engine to use
'relativenumber' 'rnu' show relative line number in front of each line
'remap' allow mappings to work recursively
+'renderoptions' 'rop' options for text rendering on Windows
'report' threshold for reporting nr. of lines changed
'restorescreen' 'rs' Win32: restore screen when exiting
'revins' 'ri' inserting characters will work backwards
@@ -1312,11 +1314,16 @@ Context-sensitive completion on the command-line:
|CTRL-W_R| CTRL-W R rotate windows upwards
|CTRL-W_x| CTRL-W x exchange current window with next one
-|CTRL-W_=| CTRL-W = make all windows equal height
+|CTRL-W_=| CTRL-W = make all windows equal height & width
|CTRL-W_-| CTRL-W - decrease current window height
|CTRL-W_+| CTRL-W + increase current window height
|CTRL-W__| CTRL-W _ set current window height (default:
very high)
+
+|CTRL-W_<| CTRL-W < decrease current window width
+|CTRL-W_>| CTRL-W > increase current window width
+|CTRL-W_bar| CTRL-W | set current window width (default:
+ widest possible)
------------------------------------------------------------------------------
*Q_bu* Buffer list commands
diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt
index 4b28e8617..01be75acc 100644
--- a/runtime/doc/repeat.txt
+++ b/runtime/doc/repeat.txt
@@ -1,4 +1,4 @@
-*repeat.txt* For Vim version 7.4. Last change: 2014 Mar 25
+*repeat.txt* For Vim version 7.4. Last change: 2015 Jan 07
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -64,6 +64,9 @@ replacement string.
For the definition of a pattern, see |pattern|.
+NOTE [cmd] may contain a range; see |collapse| and |edit-paragraph-join| for
+examples.
+
The global commands work by first scanning through the [range] lines and
marking each line where a match occurs (for a multi-line pattern, only the
start of the match matters).
@@ -232,8 +235,8 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
command is ignored.
{not in Vi}
- *:scrip* *:scriptnames*
-:scrip[tnames] List all sourced script names, in the order they were
+ *:scr* *:scriptnames*
+:scr[iptnames] List all sourced script names, in the order they were
first sourced. The number is used for the script ID
|<SID>|.
{not in Vi} {not available when compiled without the
diff --git a/runtime/doc/spell.txt b/runtime/doc/spell.txt
index 3ffd8932e..5a802a29f 100644
--- a/runtime/doc/spell.txt
+++ b/runtime/doc/spell.txt
@@ -1,4 +1,4 @@
-*spell.txt* For Vim version 7.4. Last change: 2014 Jul 02
+*spell.txt* For Vim version 7.4. Last change: 2014 Sep 19
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1058,6 +1058,9 @@ this text to start with a "#" so that mistakes don't go unnoticed. Example:
SFX F 0 in [^i]n # Spion > Spionin ~
SFX F 0 nen in # Bauerin > Bauerinnen ~
+However, to avoid lots of errors in affix files written for Myspell, you can
+add the IGNOREEXTRA flag.
+
Apparently Myspell allows an affix name to appear more than once. Since this
might also be a mistake, Vim checks for an extra "S". The affix files for
Myspell that use this feature apparently have this flag. Example:
@@ -1111,6 +1114,14 @@ Specifically, the affix flags can be used for:
- CIRCUMFIX, as explained just below.
+IGNOREEXTRA *spell-IGNOREEXTRA*
+
+Normally Vim gives an error for an extra field that does not start with '#'.
+This avoids errors going unnoticed. However, some files created for Myspell
+or Hunspell may contain many entries with an extra field. Use the IGNOREEXTRA
+flag to avoid lots of errors.
+
+
CIRCUMFIX *spell-CIRCUMFIX*
The CIRCUMFIX flag means a prefix and suffix must be added at the same time.
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index 35ea3ad7b..c4964bcf3 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -1,4 +1,4 @@
-*syntax.txt* For Vim version 7.4. Last change: 2014 Jun 27
+*syntax.txt* For Vim version 7.4. Last change: 2015 Jan 07
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -501,7 +501,7 @@ inserted for that purpose if no line numbers are shown. This ID attribute
takes the form of L123 for single-buffer HTML pages, or W2L123 for diff-view
pages, and is used to jump to a specific line (in a specific window of a diff
view). Javascript is inserted to open any closed dynamic folds
-(|g:html_dynamic_folds|) containing the specificed line before jumping. The
+(|g:html_dynamic_folds|) containing the specified line before jumping. The
javascript also allows omitting the window ID in the url, and the leading L.
For example: >
@@ -1128,6 +1128,14 @@ to standard by placing this in your vimrc file: >
:let enforce_freedesktop_standard = 1
+DIFF *diff.vim*
+
+The diff highlighting normally finds translated headers. This can be slow if
+there are very long lines in the file. To disable translations: >
+
+ :let diff_translations = 0
+
+
DIRCOLORS *dircolors.vim* *ft-dircolors-syntax*
The dircolors utility highlighting definition has one option. It exists to
@@ -2975,6 +2983,7 @@ TEX *tex.vim* *ft-tex-syntax* *latex-syntax*
Tex: Taking Advantage of Conceal Mode |tex-conceal|
Tex: Selective Conceal Mode |g:tex_conceal|
Tex: Controlling iskeyword |g:tex_isk|
+ Tex: Fine Subscript and Superscript Control |tex-supersub|
*tex-folding* *g:tex_fold_enabled*
Tex: Want Syntax Folding? ~
@@ -3068,6 +3077,7 @@ selectively to enable just some syntax highlighting: >
<
As an example, let g:tex_fast= "M" will allow math-associated highlighting
but suppress all the other region-based syntax highlighting.
+(also see: |g:tex_conceal| and |tex-supersub|)
*tex-morecommands* *tex-package*
Tex: Want To Highlight More Commands? ~
@@ -3169,6 +3179,28 @@ syntax highlighting script handles this with the following logic:
* If g:tex_isk exists, then it will be used for the local 'iskeyword'
* Else the local 'iskeyword' will be set to 48-57,a-z,A-Z,192-255
+ *tex-supersub* *g:tex_superscripts* *g:tex_subscripts*
+ Tex: Fine Subscript and Superscript Control~
+
+ See |tex-conceal| for how to enable concealed character replacement.
+
+ See |g:tex_conceal| for selectively concealing accents, bold/italic,
+ math, Greek, and superscripts/subscripts.
+
+ One may exert fine control over which superscripts and subscripts one
+ wants syntax-based concealment for (see |:syn-cchar|). Since not all
+ fonts support all characters, one may override the
+ concealed-replacement lists; by default these lists are given by: >
+
+ let g:tex_superscripts= "[0-9a-zA-W.,:;+-<>/()=]"
+ let g:tex_subscripts= "[0-9aehijklmnoprstuvx,+-/().]"
+<
+ For example, I use Luxi Mono Bold; it doesn't support subscript
+ characters for "hklmnpst", so I put >
+ let g:tex_subscripts= "[0-9aeijoruvx,+-/().]"
+< in ~/.vim/ftplugin/tex/tex.vim in order to avoid having inscrutable
+ utf-8 glyphs appear.
+
TF *tf.vim* *ft-tf-syntax*
@@ -3775,7 +3807,7 @@ The 'foldnestmax' option limits the nesting of syntax folds.
*:syn-contains* *E405* *E406* *E407* *E408* *E409*
-contains={groupname},..
+contains={group-name},..
The "contains" argument is followed by a list of syntax group names. These
groups will be allowed to begin inside the item (they may extend past the
@@ -3828,13 +3860,13 @@ region where contained items do match. Note that this may also limit the
area that is highlighted
-containedin={groupname}... *:syn-containedin*
+containedin={group-name}... *:syn-containedin*
The "containedin" argument is followed by a list of syntax group names. The
item will be allowed to begin inside these groups. This works as if the
containing item has a "contains=" argument that includes this item.
-The {groupname}... can be used just like for "contains", as explained above.
+The {group-name}... can be used just like for "contains", as explained above.
This is useful when adding a syntax item afterwards. An item can be told to
be included inside an already existing item, without changing the definition
@@ -3850,7 +3882,7 @@ keywords never contain another item, thus adding them to "containedin" won't
work.
-nextgroup={groupname},.. *:syn-nextgroup*
+nextgroup={group-name},.. *:syn-nextgroup*
The "nextgroup" argument is followed by a list of syntax group names,
separated by commas (just like with "contains", so you can also use patterns).
@@ -5041,6 +5073,7 @@ This will set the "w:current_syntax" variable to "foo". The value of
restoring "b:current_syntax", since the syntax files do set
"b:current_syntax". The value set by the syntax file is assigned to
"w:current_syntax".
+Note: This resets the 'spell', 'spellcapcheck' and 'spellfile' options.
Once a window has its own syntax, syntax commands executed from other windows
on the same buffer (including :syntax clear) have no effect. Conversely,
diff --git a/runtime/doc/tabpage.txt b/runtime/doc/tabpage.txt
index 3c7ad9fe2..2d44fe2ff 100644
--- a/runtime/doc/tabpage.txt
+++ b/runtime/doc/tabpage.txt
@@ -1,4 +1,4 @@
-*tabpage.txt* For Vim version 7.4. Last change: 2012 Aug 08
+*tabpage.txt* For Vim version 7.4. Last change: 2015 Jan 04
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -61,16 +61,25 @@ In the GUI tab pages line you can use the right mouse button to open menu.
:[count]tabe[dit] *:tabe* *:tabedit* *:tabnew*
:[count]tabnew
Open a new tab page with an empty window, after the current
- tab page. For [count] see |:tab| below.
+ tab page. If [count] is given the new tab page appears after
+ the tab page [count] otherwise the new tab page will appear
+ after the current one. >
+ :tabnew " opens tabpage after the current one
+ :.tabnew " as above
+ :+tabnew " opens tabpage after the next tab page
+ " note: it is one further than :tabnew
+ :-tabnew " opens tabpage before the current one
+ :0tabnew " opens tabpage before the first one
+ :$tabnew " opens tabpage after the last one
:[count]tabe[dit] [++opt] [+cmd] {file}
:[count]tabnew [++opt] [+cmd] {file}
Open a new tab page and edit {file}, like with |:edit|.
- For [count] see |:tab| below.
+ For [count] see |:tabnew| above.
:[count]tabf[ind] [++opt] [+cmd] {file} *:tabf* *:tabfind*
Open a new tab page and edit {file} in 'path', like with
- |:find|. For [count] see |:tab| below.
+ |:find|. For [count] see |:tabnew| above.
{not available when the |+file_in_path| feature was disabled
at compile time}
@@ -110,12 +119,18 @@ something else.
- When 'hidden' is not set, [!] is not used, a buffer has
changes, and there is no other window on this buffer.
Changes to the buffer are not written and won't get lost, so
- this is a "safe" command.
+ this is a "safe" command. >
+ :tabclose " close the current tab page
+:{count}tabc[lose][!]
:tabc[lose][!] {count}
Close tab page {count}. Fails in the same way as `:tabclose`
- above.
-
+ above. >
+ :-tabclose " close the previous tab page
+ :+tabclose " close the next tab page
+ :1tabclose " close the first tab page
+ :$tabclose " close the last tab page
+<
*:tabo* *:tabonly*
:tabo[nly][!] Close all other tab pages.
When the 'hidden' option is set, all buffers in closed windows
@@ -124,7 +139,17 @@ something else.
modified buffers are written. Otherwise, windows that have
buffers that are modified are not removed, unless the [!] is
given, then they become hidden. But modified buffers are
- never abandoned, so changes cannot get lost.
+ never abandoned, so changes cannot get lost. >
+ :tabonly " close all tab pages except the current
+
+:{count}tabo[nly][!]
+ Close all tab pages except the {count}th one. >
+ :.tabonly " one
+ :-tabonly " close all tab pages except the previous
+ " one
+ :+tabonly " close all tab pages except the next one
+ :1tabonly " close all tab pages except the first one
+ :$tabonly " close all tab pages except the last one
SWITCHING TO ANOTHER TAB PAGE:
@@ -176,7 +201,15 @@ REORDERING TAB PAGES:
:[N]tabm[ove]
Move the current tab page to after tab page N. Use zero to
make the current tab page the first one. Without N the tab
- page is made the last one.
+ page is made the last one. >
+ :-tabmove " move the tab page to the left
+ :tabmove " move the tab page to the right
+ :.tabmove " as above
+ :+tabmove " as above
+ :0tabmove " move the tab page to the beginning of the tab
+ " list
+ :$tabmove " move the tab page to the end of the tab list
+<
:tabm[ove] +[N]
:tabm[ove] -[N]
@@ -191,8 +224,10 @@ clarification what +N means in this context see |[range]|.
LOOPING OVER TAB PAGES:
*:tabd* *:tabdo*
-:tabd[o] {cmd} Execute {cmd} in each tab page.
- It works like doing this: >
+:[range]tabd[o] {cmd}
+ Execute {cmd} in each tab page or if [range] is given only in
+ tab pages which tab page number is in the [range]. It works
+ like doing this: >
:tabfirst
:{cmd}
:tabnext
@@ -238,8 +273,8 @@ window on the same buffer and then edit another buffer. Thus ":tabnew"
triggers:
WinLeave leave current window
TabLeave leave current tab page
- TabEnter enter new tab page
WinEnter enter window in new tab page
+ TabEnter enter new tab page
BufLeave leave current buffer
BufEnter enter new empty buffer
diff --git a/runtime/doc/tags b/runtime/doc/tags
index 7605ccc99..027df9ac5 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -392,6 +392,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
'kp' options.txt /*'kp'*
'langmap' options.txt /*'langmap'*
'langmenu' options.txt /*'langmenu'*
+'langnoremap' options.txt /*'langnoremap'*
'laststatus' options.txt /*'laststatus'*
'lazyredraw' options.txt /*'lazyredraw'*
'lbr' options.txt /*'lbr'*
@@ -405,6 +406,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
'listchars' options.txt /*'listchars'*
'lm' options.txt /*'lm'*
'lmap' options.txt /*'lmap'*
+'lnr' options.txt /*'lnr'*
'loadplugins' options.txt /*'loadplugins'*
'lpl' options.txt /*'lpl'*
'ls' options.txt /*'ls'*
@@ -756,6 +758,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
'regexpengine' options.txt /*'regexpengine'*
'relativenumber' options.txt /*'relativenumber'*
'remap' options.txt /*'remap'*
+'renderoptions' options.txt /*'renderoptions'*
'report' options.txt /*'report'*
'restorescreen' options.txt /*'restorescreen'*
'revins' options.txt /*'revins'*
@@ -766,6 +769,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
'rlc' options.txt /*'rlc'*
'rnu' options.txt /*'rnu'*
'ro' options.txt /*'ro'*
+'rop' options.txt /*'rop'*
'rs' options.txt /*'rs'*
'rtp' options.txt /*'rtp'*
'ru' options.txt /*'ru'*
@@ -1171,6 +1175,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
+dialog_gui various.txt /*+dialog_gui*
+diff various.txt /*+diff*
+digraphs various.txt /*+digraphs*
++directx various.txt /*+directx*
+dnd various.txt /*+dnd*
+emacs_tags various.txt /*+emacs_tags*
+eval various.txt /*+eval*
@@ -1393,6 +1398,8 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
.dic spell.txt /*.dic*
.exrc starting.txt /*.exrc*
.gvimrc gui.txt /*.gvimrc*
+.netrwbook pi_netrw.txt /*.netrwbook*
+.netrwhist pi_netrw.txt /*.netrwhist*
.vimrc starting.txt /*.vimrc*
/ pattern.txt /*\/*
/$ pattern.txt /*\/$*
@@ -2052,6 +2059,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
:comc map.txt /*:comc*
:comclear map.txt /*:comclear*
:command map.txt /*:command*
+:command-addr map.txt /*:command-addr*
:command-bang map.txt /*:command-bang*
:command-bar map.txt /*:command-bar*
:command-buffer map.txt /*:command-buffer*
@@ -2245,6 +2253,8 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
:ha print.txt /*:ha*
:hardcopy print.txt /*:hardcopy*
:help helphelp.txt /*:help*
+:helpc helphelp.txt /*:helpc*
+:helpclose helphelp.txt /*:helpclose*
:helpf helphelp.txt /*:helpf*
:helpfind helphelp.txt /*:helpfind*
:helpg helphelp.txt /*:helpg*
@@ -2718,7 +2728,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
:sbr windows.txt /*:sbr*
:sbrewind windows.txt /*:sbrewind*
:sbuffer windows.txt /*:sbuffer*
-:scrip repeat.txt /*:scrip*
+:scr repeat.txt /*:scr*
:scripte repeat.txt /*:scripte*
:scriptencoding repeat.txt /*:scriptencoding*
:scriptnames repeat.txt /*:scriptnames*
@@ -2753,7 +2763,6 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
:sfirst windows.txt /*:sfirst*
:sh various.txt /*:sh*
:shell various.txt /*:shell*
-:si gui_w32.txt /*:si*
:sig sign.txt /*:sig*
:sign sign.txt /*:sign*
:sign-define sign.txt /*:sign-define*
@@ -2766,6 +2775,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
:sign-unplace sign.txt /*:sign-unplace*
:sil various.txt /*:sil*
:silent various.txt /*:silent*
+:sim gui_w32.txt /*:sim*
:simalt gui_w32.txt /*:simalt*
:sl various.txt /*:sl*
:sla windows.txt /*:sla*
@@ -3129,6 +3139,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
<CSI> intro.txt /*<CSI>*
<Char-> map.txt /*<Char->*
<Char> map.txt /*<Char>*
+<CursorHold> autocmd.txt /*<CursorHold>*
<D- intro.txt /*<D-*
<Del> change.txt /*<Del>*
<Down> motion.txt /*<Down>*
@@ -3451,6 +3462,7 @@ CTRL-^ editing.txt /*CTRL-^*
CTRL-{char} intro.txt /*CTRL-{char}*
Chinese mbyte.txt /*Chinese*
Cmd-event autocmd.txt /*Cmd-event*
+CmdUndefined autocmd.txt /*CmdUndefined*
Cmdline cmdline.txt /*Cmdline*
Cmdline-mode cmdline.txt /*Cmdline-mode*
CmdwinEnter autocmd.txt /*CmdwinEnter*
@@ -3592,7 +3604,7 @@ E201 autocmd.txt /*E201*
E202 options.txt /*E202*
E203 autocmd.txt /*E203*
E204 autocmd.txt /*E204*
-E205 if_pyth.txt /*E205*
+E205 options.txt /*E205*
E206 options.txt /*E206*
E207 editing.txt /*E207*
E208 message.txt /*E208*
@@ -4324,6 +4336,9 @@ E883 eval.txt /*E883*
E884 eval.txt /*E884*
E885 sign.txt /*E885*
E886 starting.txt /*E886*
+E887 if_pyth.txt /*E887*
+E888 pattern.txt /*E888*
+E889 map.txt /*E889*
E89 message.txt /*E89*
E90 message.txt /*E90*
E91 options.txt /*E91*
@@ -4901,6 +4916,7 @@ blockwise-operators visual.txt /*blockwise-operators*
blockwise-register change.txt /*blockwise-register*
blockwise-visual visual.txt /*blockwise-visual*
blowfish options.txt /*blowfish*
+blowfish2 options.txt /*blowfish2*
bold syntax.txt /*bold*
bom-bytes mbyte.txt /*bom-bytes*
book intro.txt /*book*
@@ -5401,6 +5417,7 @@ diff-options diff.txt /*diff-options*
diff-original-file diff.txt /*diff-original-file*
diff-patchexpr diff.txt /*diff-patchexpr*
diff.txt diff.txt /*diff.txt*
+diff.vim syntax.txt /*diff.vim*
diff_filler() eval.txt /*diff_filler()*
diff_hlID() eval.txt /*diff_hlID()*
digraph digraph.txt /*digraph*
@@ -5463,6 +5480,7 @@ edit-dialogs editing.txt /*edit-dialogs*
edit-files editing.txt /*edit-files*
edit-intro editing.txt /*edit-intro*
edit-no-break usr_25.txt /*edit-no-break*
+edit-paragraph-join usr_25.txt /*edit-paragraph-join*
editing.txt editing.txt /*editing.txt*
efm-%> quickfix.txt /*efm-%>*
efm-entries quickfix.txt /*efm-entries*
@@ -5993,6 +6011,7 @@ g:netrw_errorlvl pi_netrw.txt /*g:netrw_errorlvl*
g:netrw_fastbrowse pi_netrw.txt /*g:netrw_fastbrowse*
g:netrw_fetch_cmd pi_netrw.txt /*g:netrw_fetch_cmd*
g:netrw_ffkeep pi_netrw.txt /*g:netrw_ffkeep*
+g:netrw_file_cmd pi_netrw.txt /*g:netrw_file_cmd*
g:netrw_fname_escape pi_netrw.txt /*g:netrw_fname_escape*
g:netrw_ftp pi_netrw.txt /*g:netrw_ftp*
g:netrw_ftp_browse_reject pi_netrw.txt /*g:netrw_ftp_browse_reject*
@@ -6004,6 +6023,7 @@ g:netrw_ftp_timelist_cmd pi_netrw.txt /*g:netrw_ftp_timelist_cmd*
g:netrw_ftpextracmd pi_netrw.txt /*g:netrw_ftpextracmd*
g:netrw_ftpmode pi_netrw.txt /*g:netrw_ftpmode*
g:netrw_glob_escape pi_netrw.txt /*g:netrw_glob_escape*
+g:netrw_gx pi_netrw.txt /*g:netrw_gx*
g:netrw_hide pi_netrw.txt /*g:netrw_hide*
g:netrw_home pi_netrw.txt /*g:netrw_home*
g:netrw_http_cmd pi_netrw.txt /*g:netrw_http_cmd*
@@ -6011,10 +6031,13 @@ g:netrw_http_put_cmd pi_netrw.txt /*g:netrw_http_put_cmd*
g:netrw_http_xcmd pi_netrw.txt /*g:netrw_http_xcmd*
g:netrw_ignorenetrc pi_netrw.txt /*g:netrw_ignorenetrc*
g:netrw_keepdir pi_netrw.txt /*g:netrw_keepdir*
+g:netrw_keepj pi_netrw.txt /*g:netrw_keepj*
g:netrw_list_cmd pi_netrw.txt /*g:netrw_list_cmd*
+g:netrw_list_cmd_options pi_netrw.txt /*g:netrw_list_cmd_options*
g:netrw_list_hide pi_netrw.txt /*g:netrw_list_hide*
g:netrw_liststyle pi_netrw.txt /*g:netrw_liststyle*
g:netrw_localcopycmd pi_netrw.txt /*g:netrw_localcopycmd*
+g:netrw_localcopydircmd pi_netrw.txt /*g:netrw_localcopydircmd*
g:netrw_localmkdir pi_netrw.txt /*g:netrw_localmkdir*
g:netrw_localmovecmd pi_netrw.txt /*g:netrw_localmovecmd*
g:netrw_localrmdir pi_netrw.txt /*g:netrw_localrmdir*
@@ -6035,6 +6058,7 @@ g:netrw_rsync_cmd pi_netrw.txt /*g:netrw_rsync_cmd*
g:netrw_scp_cmd pi_netrw.txt /*g:netrw_scp_cmd*
g:netrw_scpport pi_netrw.txt /*g:netrw_scpport*
g:netrw_sepchr pi_netrw.txt /*g:netrw_sepchr*
+g:netrw_servername pi_netrw.txt /*g:netrw_servername*
g:netrw_sftp_cmd pi_netrw.txt /*g:netrw_sftp_cmd*
g:netrw_silent pi_netrw.txt /*g:netrw_silent*
g:netrw_sort_by pi_netrw.txt /*g:netrw_sort_by*
@@ -6074,6 +6098,8 @@ g:tex_isk syntax.txt /*g:tex_isk*
g:tex_no_error syntax.txt /*g:tex_no_error*
g:tex_nospell syntax.txt /*g:tex_nospell*
g:tex_stylish syntax.txt /*g:tex_stylish*
+g:tex_subscripts syntax.txt /*g:tex_subscripts*
+g:tex_superscripts syntax.txt /*g:tex_superscripts*
g:tex_verbspell syntax.txt /*g:tex_verbspell*
g:var eval.txt /*g:var*
g:vimball_home pi_vimball.txt /*g:vimball_home*
@@ -6137,6 +6163,7 @@ getcharmod() eval.txt /*getcharmod()*
getcmdline() eval.txt /*getcmdline()*
getcmdpos() eval.txt /*getcmdpos()*
getcmdtype() eval.txt /*getcmdtype()*
+getcmdwintype() eval.txt /*getcmdwintype()*
getcurpos() eval.txt /*getcurpos()*
getcwd() eval.txt /*getcwd()*
getfontname() eval.txt /*getfontname()*
@@ -6980,6 +7007,8 @@ netrw-:Hexplore pi_netrw.txt /*netrw-:Hexplore*
netrw-:Lexplore pi_netrw.txt /*netrw-:Lexplore*
netrw-:MF pi_netrw.txt /*netrw-:MF*
netrw-:MT pi_netrw.txt /*netrw-:MT*
+netrw-:NetrwC pi_netrw.txt /*netrw-:NetrwC*
+netrw-:NetrwMB pi_netrw.txt /*netrw-:NetrwMB*
netrw-:Rexplore pi_netrw.txt /*netrw-:Rexplore*
netrw-:Sexplore pi_netrw.txt /*netrw-:Sexplore*
netrw-:Texplore pi_netrw.txt /*netrw-:Texplore*
@@ -6988,6 +7017,7 @@ netrw-C pi_netrw.txt /*netrw-C*
netrw-D pi_netrw.txt /*netrw-D*
netrw-O pi_netrw.txt /*netrw-O*
netrw-P pi_netrw.txt /*netrw-P*
+netrw-P18 pi_netrw.txt /*netrw-P18*
netrw-R pi_netrw.txt /*netrw-R*
netrw-S pi_netrw.txt /*netrw-S*
netrw-Tb pi_netrw.txt /*netrw-Tb*
@@ -7017,6 +7047,7 @@ netrw-createfile pi_netrw.txt /*netrw-createfile*
netrw-credits pi_netrw.txt /*netrw-credits*
netrw-ctrl-h pi_netrw.txt /*netrw-ctrl-h*
netrw-ctrl-l pi_netrw.txt /*netrw-ctrl-l*
+netrw-ctrl-r pi_netrw.txt /*netrw-ctrl-r*
netrw-ctrl_l pi_netrw.txt /*netrw-ctrl_l*
netrw-curdir pi_netrw.txt /*netrw-curdir*
netrw-d pi_netrw.txt /*netrw-d*
@@ -7043,6 +7074,7 @@ netrw-gf pi_netrw.txt /*netrw-gf*
netrw-gh pi_netrw.txt /*netrw-gh*
netrw-gitignore pi_netrw.txt /*netrw-gitignore*
netrw-gp pi_netrw.txt /*netrw-gp*
+netrw-grep pi_netrw.txt /*netrw-grep*
netrw-gx pi_netrw.txt /*netrw-gx*
netrw-handler pi_netrw.txt /*netrw-handler*
netrw-help pi_netrw.txt /*netrw-help*
@@ -7064,6 +7096,7 @@ netrw-login pi_netrw.txt /*netrw-login*
netrw-mB pi_netrw.txt /*netrw-mB*
netrw-mF pi_netrw.txt /*netrw-mF*
netrw-mT pi_netrw.txt /*netrw-mT*
+netrw-mX pi_netrw.txt /*netrw-mX*
netrw-mb pi_netrw.txt /*netrw-mb*
netrw-mc pi_netrw.txt /*netrw-mc*
netrw-md pi_netrw.txt /*netrw-md*
@@ -7081,6 +7114,7 @@ netrw-mr pi_netrw.txt /*netrw-mr*
netrw-ms pi_netrw.txt /*netrw-ms*
netrw-mt pi_netrw.txt /*netrw-mt*
netrw-mu pi_netrw.txt /*netrw-mu*
+netrw-mv pi_netrw.txt /*netrw-mv*
netrw-mx pi_netrw.txt /*netrw-mx*
netrw-mz pi_netrw.txt /*netrw-mz*
netrw-netrc pi_netrw.txt /*netrw-netrc*
@@ -7100,6 +7134,7 @@ netrw-p13 pi_netrw.txt /*netrw-p13*
netrw-p14 pi_netrw.txt /*netrw-p14*
netrw-p15 pi_netrw.txt /*netrw-p15*
netrw-p16 pi_netrw.txt /*netrw-p16*
+netrw-p17 pi_netrw.txt /*netrw-p17*
netrw-p2 pi_netrw.txt /*netrw-p2*
netrw-p3 pi_netrw.txt /*netrw-p3*
netrw-p4 pi_netrw.txt /*netrw-p4*
@@ -7815,6 +7850,7 @@ spell-FLAG spell.txt /*spell-FLAG*
spell-FOL spell.txt /*spell-FOL*
spell-FORBIDDENWORD spell.txt /*spell-FORBIDDENWORD*
spell-HOME spell.txt /*spell-HOME*
+spell-IGNOREEXTRA spell.txt /*spell-IGNOREEXTRA*
spell-KEEPCASE spell.txt /*spell-KEEPCASE*
spell-KEY spell.txt /*spell-KEY*
spell-LANG spell.txt /*spell-LANG*
@@ -8292,6 +8328,7 @@ tex-runon syntax.txt /*tex-runon*
tex-slow syntax.txt /*tex-slow*
tex-stopzone syntax.txt /*tex-stopzone*
tex-style syntax.txt /*tex-style*
+tex-supersub syntax.txt /*tex-supersub*
tex-sync syntax.txt /*tex-sync*
tex-verb syntax.txt /*tex-verb*
tex.vim syntax.txt /*tex.vim*
@@ -8767,6 +8804,7 @@ window-variable eval.txt /*window-variable*
windowid-variable eval.txt /*windowid-variable*
windows windows.txt /*windows*
windows-3.1 os_win32.txt /*windows-3.1*
+windows-icon os_win32.txt /*windows-icon*
windows-intro windows.txt /*windows-intro*
windows-starting windows.txt /*windows-starting*
windows.txt windows.txt /*windows.txt*
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index fc954cff0..fe4b5ec31 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt* For Vim version 7.4. Last change: 2014 Jul 10
+*todo.txt* For Vim version 7.4. Last change: 2015 Jan 10
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -34,9 +34,10 @@ not be repeated below, unless there is extra information.
*known-bugs*
-------------------- Known bugs and current work -----------------------
-Forfeit test_listlbr when encoding is not utf8? (Danek Duvall)
-
Regexp problems:
+- The NFA engine does not implement the time limit passed to
+ nfa_regexec_multi()
+- 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.
@@ -44,52 +45,225 @@ Regexp problems:
2013 Dec 11)
- Using \@> and \?. (Brett Stahlman, 2013 Dec 21) Remark from Marcin Szamotulski
Remark from Brett 2014 Jan 6 and 7.
+- Difference in NFA and old engine. (Brett Stahlman, 2014 Nov 5)
- Bug when using \>. (Ramel, 2014 Feb 2) (Aaron Bohannon, 2014 Feb 13)
- 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
+- Bug relating to back references. (Ingo Karkat, 2014 Jul 24)
+- 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.
+- Diff highlighting can be very slow. (Issue 309)
+
+The range for :wincmd is not always a window number, can also be a column
+count. Remove the range check. What to use for ":$wincmd"?
-Patch to set y_width when getting the register from the clipboard.
-(Yukihiro Nakadaira, 2014 Jul 10)
+Still using freed memory after using setloclist(). (lcd, 2014 Jul 23)
+More info Jul 24. Not clear why.
+
+Patch to make getregtype() return the right size for non-linux systems.
+(Yasuhiro Matsumoto, 2014 Jul 8)
+Breaks test_eval. Inefficient, can we only compute y_width when needed?
Problem that a previous silent ":throw" causes a following try/catch not to
work. (ZyX, 2013 Sep 28)
-Completion for :buf does not use 'wildignorecase'. (Akshay H, 2014 May 31)
+Problem using ":try" inside ":execute". (ZyX, 2013 Sep 15)
+
+Patch on Issue 292, recognizing polkit filetype.
+
+Issue 133: patch for config.vim, maintainer not responding.
":cd C:\Windows\System32\drivers\etc*" does not work, even though the
directory exists. (Sergio Gallelli, 2013 Dec 29)
-The entries added by matchaddpos() are returned by getmatches() but can't be
-set with setmatches(). (lcd47, 2014 Jun 29)
-
-Problem using ":try" inside ":execute". (ZyX, 2013 Sep 15)
+Gvim: when both Tab and CTRL-I are mapped, use CTRL-I not for Tab.
Python: ":py raw_input('prompt')" doesn't work. (Manu Hack)
-When using an undo file, also restore the changelist, so that "g;" works.
+MS-Windows: When editing a file with a leading space, writing it uses the
+wrong name. (Aram, 2014 Nov 7) Vim 7.4.
Value returned by virtcol() changes depending on how lines wrap. This is
-inconsistant with the documentation.
+inconsistent with the documentation.
+
+Ukrainian vimtutor. (Issue 288)
+
+Regenerate the Unicode tables in mbyte.c.
+Diff from ZyX, 2014 Dec 6.
+
+Patch to fix relative numbers. (Christian Brabandt, 2014 Nov 17)
+Update Nov 26.
+
+Patch to improve config.vim syntax. Issue 305. Maintainer last update was in
+2008.
+
+Patch on issue 310, matchadd() seems to hang.
+
+Patch to fix that getcurpos() returns a negative number, instead of MAXCOL.
+(Hirohito Higashi, 2014 Dec 8)
+
+Better greek spell checking. Issue 299.
+
+Patch to fix wrong formatting if 'linebreak' is set. (Christian Brabandt, 2014
+Nov 12)
+
+Patch to avoid recognizing polkit as hog files. (Issue 292)
+
+":0argedit foo" puts new argument in second place instead of first.
+Patch from Ingo Karkat, 2014 Dec 19.
+
+Patch 7.4.468 changed how CTRL-C is handled. It does not take care of mapping
+CTRL-C in different modes. (Ingo Karkat, 2014 Dec 12)
+Patch from Christian Brabandt, 2014 Dec 13.
+Needs to be improved.
+
+Patch for greek characters on MS-Windows console. (Yasuhiro Matsumoto, 2014
+Dec 17)
+
+Patch to support hex values for setting option value.
+(Zyx, 2015 Nov 6)
+
+Patch to fix problems with small screen sizes. (Christian Brabandt, 2015 Jan
+8)
+
+On MS-Windows running tests with Mercurial has problems when the fileformat of
+the input files are changed. (Ken Takata, Taro Muraoka, 2014 Sep 25)
+Update Nov 5.
MS-Windows: Crash opening very long file name starting with "\\".
(Christian Brock, 2012 Jun 29)
+Patch for this from Marcin Szamotulski, 2014 Dec 28:
+8 Make the # register writable, so that it can be restored after jumping
+ around in windows.
+
+Using CTRL-L while popup menu is visible behaves like CTRL-P, which is wrong.
+Patch by Yasuhiro Matsumoto, 2015 Jan 5.
+Is this right? Comment from Amadeus Demarzi.
+Another patch from Christian, Jan 6.
+Comment from Hirohito Higashi, Jan 6.
+
+Cursorline background color not mixed with character highlight.
+Patch by Yasuhiro Matsumoto, 2014 Dec 3.
+
+Problem using diff syntax with cp932 encoding. Idea from Yasuhiro Matsumoto,
+patch from Ken Takata (2014 Nov 6)
+
+ml_updatechunk() is slow when retrying for another encoding. (John Little,
+2014 Sep 11)
+
+Patch to add a different escape sequence for replace mode.
+(Omar Sandoval, 2014 Nov 30)
+
+Patch on Issue 166, popup drawing with '$' in 'cpo'.
+
+Calling setreg() with an empty list doesn't work.
+Patch by Yasuhiro Matsumoto, 2014 Dec 14.
+
+Extended file attributes lost on write (backupcopy=no). Issue 306.
+
+Window height computed incorrectly when Vim is minimized.
+Patch to fix this. (Ingo Karkat, 2014 Dec 19)
+
+Patch to allow values greater than 255 for ctermfg/ctermbg on Windows.
+(Yasuhiro Matsumoto, 2014 Dec 5)
+
+Mixup of highlighting when there is a match and SpellBad. (ZyX, 2015 Jan 1)
+
+Problem caused by patch 7.3.638: window->open does not update window
+correctly. Issue 91. With patch.
+
+'ff' is wrong for one-line file without EOL. (Patch on Issue 77)
+
+Patch on Issue 72: 'autochdir' causes problems for :vimgrep.
+
+When 'balloonexpr' returns a list the result has a trailing newline.
+Just remove one trailing newline. (lcd, 2014 Oct 17)
+
+Make comments in the test Makefile silent. (Kartik Agaram, 2014 Sep 24)
+
+Patch to add GUI colors to the terminal, when it supports it. (ZyX, 2013 Jan
+26, update 2013 Dec 14, another 2014 Nov 22)
+
+Result of systemlist() does not show whether text ended in line break.
+(Bjorn Linse, 2014 Nov 27)
+
+When in 'comments' "n:x" follows after three-part comment directly it repeats
+any one-character from the previous line. (Kartik Agaram, 2014 Sep 19)
+
Syntax highlighting slow (hangs) in SASS file. (Niek Bosch, 2013 Aug 21)
+Patch to add the EndOfBuffer highlight group, used instead of NonText for "~"
+lines. (Marco Hinz, 2014 Nov 2)
+
+Patch for fixing a problem of the combination of conceal and linebreak.
+(Christian Brabandt, 2014 Dec 11)
+
Adding "~" to 'cdpath' doesn't work for completion? (Davido, 2013 Aug 19)
+Plugins need to make a lot of effort, lots of mappings, to know what happened
+before pressing the key that triggers a plugin action. How about keeping the
+last N pressed keys, so that they do not need to be mapped?
+
+":q!" should reset modified flag for current buffer, if another buffer is
+modified no need to abandon it again.
+Patch from Yasuhiro Matsumoto, 2014 Nov 21.
+Update from Hirohito Higashi, 2014 Nov 21.
+With test, Nov 23.
+
+Wrong scrolling when using incsearch. Patch by Christian Brabandt, 2014 Dec 4.
+Is this a good solution?
+
+Can assign to s:type when a function s:type has been defined.
+Also the other way around: define a function while a variable with that name
+was already defined.
+(Yasuhiro Matsumoto, 2014 Nov 3)
+
+Patch to make closed folds line up. (Charles Campbell, 2014 Sep 12)
+Remark from Roland Eggner: does it cause crashes? (2014 Dec 12)
+Updated patch by Roland Eggner, Dec 16
+Updated patch from Charles, Dec 29.
+
+Patch to open folds for 'incsearch'. (Christian Brabandt, 2015 Jan 6)
+
+Patch for building a 32bit Vim with 64bit MingW compiler.
+(Michael Soyka, 2014 Oct 15)
+
+Delete old code in os_msdos.c, mch_FullName().
+
+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
+them: ":repeats".
+
+Patch for glob(), adding slash to normal files. (Ingo Karkat, 2014 Dec 22)
+
+Using "." to repeat an Ex command puts that command in history. Probably
+should not happen. If the command is the result of a mapping it's not put in
+history either. (Jacob Niehus, 2014 Nov 2)
+Patch from Jacob, Nov 2.
+
"hi link" does not respect groups with GUI settings only. (Mark Lodato, 2014
Jun 8)
-Syntax file for gnuplot. Existing one is very old. (Andrew Rasmussen, 2014
-Feb 24)
+Bug: Autocompleting ":tag/pat" replaces "/pat" with a match but does not
+insert a space. (Micha Mos, 2014 Nov 7)
+
+Patch to add the :bvimgrep command. (Christian Brabandt, 2014 Nov 12)
+Update Dec 6.
-Issue 174: Detect Mason files.
+Patch to add argument to :cquit. (Thinca, 2014 Oct 12)
No error for missing endwhile. (ZyX, 2014 Mar 20)
-Phpcomplete.vim update. (Complex, 2014 Jan 15)
+start_global_changes() plus end_global_changes() causes problem for
+clip_unnamed_plus. (Jason Pleau, 2014 Sep 12)
+
+The entries added by matchaddpos() are returned by getmatches() but can't be
+set with setmatches(). (lcd47, 2014 Jun 29)
+
+Patch to add :arglocal and :arglists. (Marcin Szamotulski, 2014 Aug 6)
PHP syntax is extremely slow. (Anhad Jai Singh, 2014 Jan 19)
@@ -98,24 +272,28 @@ Spell files use a latin single quote. Unicode also has another single quote:
New OpenOffice spell files support this with ICONV. But they are not
compatible with Vim spell files. The old files can no longer be downloaded.
-Win32: use different args for SearchPath()? (Yasuhiro Matsumoto, 2009 Jan 30)
-Also fixes wrong result from executable().
-Update from Ken Takata, 2014 Jan 10. Newer 2014 Apr 3.
+Patch to make FocusGained and FocusLost work in modern terminals. (Hayaki
+Saito, 2013 Apr 24) Has a problem (email 2015 Jan 7).
+Update 2015 Jan 10.
-Win32: use 64 bit stat() if possible. (Ken Takata, 2014 May 12)
-More tests May 14. Update May 29.
+Win32: patch to use 64 bit stat() if possible. (Ken Takata, 2014 May 12)
+More tests May 14. Update May 29. Update Aug 10.
The garbage collector may use too much stack. Make set_ref_in_item()
iterative instead of recursive. Test program by Marc Weber (2013 Dec 10)
Patch by Ben Fritz, 2014 Jun 22.
+Related: Vim hangs when freeing a lot of objects. Patch by Yasuhiro
+Matsumoto, 2014 Aug 26.
Idea: For a window in the middle (has window above and below it), use
right-mouse-drag on the status line to move a window up/down without changing
-it's height? It's like dragging the status bar above it at the same time.
+its height? It's like dragging the status bar above it at the same time.
Can we make ":unlet $VAR" use unsetenv() to delete the env var?
What for systems that don't have unsetenv()?
+Patch to add a :domodeline command. (Christian Brabandt, 2014 Oct 21)
+
This does not give an error: (Andre Sihera, 2014 Mar 21)
vim -u NONE 1 2 3 -c 'bufdo if 1 | echo 1'
This neither: (ZyX)
@@ -128,9 +306,7 @@ from?
Problem with upwards search on Windows (works OK on Linux). (Brett Stahlman,
2014 Jun 8)
-When 'clipboard' is "unnamed", :g/pat/d is very slow. Only set the clipboard
-after the last delete? (Praful, 2014 May 28)
-Patch by Christian Brabandt, 2014 Jun 18. Update Jun 25.
+Patch to load TCL dynamically. (Ken Takata, 2014 Sep 20)
Include a plugin manager with Vim? Neobundle seems to be the best currently.
Long message about this from ZyX, 2014 Mar 23. And following replies.
@@ -192,7 +368,12 @@ Patch to support sorting on floating point number. (Alex Jakushev, 2010 Oct
Patch to support expression argument to sort() instead of a function name.
Yasuhiro Matsumoto, 2013 May 31.
-Or should we add a more general mechanism, like lambda functions?
+Or should we add a more general mechanism, like a lambda() function?
+Patch by Yasuhiro Matsumoto, 2014 Sep 16.
+
+Patch to fix display of listchars on the cursorline. (Nayuri Aohime, 2013)
+Update suggested by Yasuhiro Matsumoto, 2014 Nov 25:
+https://gist.github.com/presuku/d3d6b230b9b6dcfc0477
VMS: Select() doesn't work properly, typing ESC may hang Vim. Use sys$qiow
instead. (Samuel Ferencik, 2013 Sep 28)
@@ -200,17 +381,15 @@ instead. (Samuel Ferencik, 2013 Sep 28)
Patch for XDG base directory support. (Jean François Bignolles, 2014 Mar 4)
Remark on the docs. Should not be a compile time feature. But then what?
-Completion of ":e" is ":earlier", whould be ":edit". Complete to the matching
+Completion of ":e" is ":earlier", should be ":edit". Complete to the matching
command instead of doing this alphabetically. (Mikel Jorgensen)
Patch to add v:completed_item. (Shougo Matsu, 2013 Nov 29).
-Patch to make test 100 work on MS-Windows. (Taro Muraoka, 2013 Dec 12)
+Patch to get MSVC version in a nicer way. (Ken Takata, 2014 Jul 24)
Patch to define macros for hardcoded values. (Elias Diem, 2013 Dec 14)
-Perl: support for Activestate perl 5.18: Issue 170.
-
Several syntax file match "^\s*" which may get underlined if that's in the
highlight group. Add a "\zs" after it?
@@ -220,15 +399,12 @@ Issue 28.
Go through more coverity reports.
Patch to add ":undorecover", get as much text out of the undo file as
-possible. (Christian Brabandt, 2014 Mar 12)
+possible. (Christian Brabandt, 2014 Mar 12, update Aug 22)
Include Haiku port? (Adrien Destugues, Siarzhuk Zharski, 2013 Oct 24)
Updated spec ftplugin. (Matěj Cepl, 2013 Oct 16)
-Some quickfix messages appear twice. (Gary Johnson, 2014 Feb 16)
-Patch by Christian Brabandt, 2014 Feb 17.
-
Patch to right-align signs. (James Kolb (email james), 2013 Sep 23)
Patch to handle integer overflow. (Aaron Burrow, 2013 Dec 12)
@@ -281,9 +457,6 @@ buffer. (2013 Dec 9)
Patch for drag&drop reordering of GUI tab pages reordering.
(Ken Takata, 2013 Nov 22, second one, also by Masamichi Abe)
-":sign-jump" uses first window in buffer instead of current window.
-Patch by James McCoy, 2013 Nov 22.
-
GTK: problem with 'L' in 'guioptions' changing the window width.
(Aaron Cornelius, 2012 Feb 6)
@@ -311,9 +484,6 @@ Works OK for echo, just not for ":call" and ":call call()". (Ted, 2011 Mar
Patch by Christian Brabandt, 2013 Mar 23.
Not 100% sure this is the right solution.
-Problem caused by patch 7.3.638: window->open does not update window
-correctly. Issue 91.
-
Patch to add {lhs} to :mapclear: clear all maps starting with {lhs}.
(Christian Brabandt, 2013 Dec 9)
@@ -353,17 +523,17 @@ optional. (2013 Jul 12)
Dialog is too big on Linux too. (David Fishburn, 2013 Sep 2)
+Patch to check whether a buffer is quickfix or a location list.
+(Yasuhiro Matsumoto, 2014 Dec 9)
+
Patch to allow setting w:quickfix_title via setqflist() and setloclist()
functions. (Christian Brabandt, 2013 May 8, update May 21)
Patch to add getlocstack() / setlocstack(). (Christian Brabandt, 2013 May 14)
Second one. Update May 22.
-Update by Daniel Hahler, 2014 Jul 4.
+Update by Daniel Hahler, 2014 Jul 4, Aug 14, Oct 14, Oct 15.
Patch to make fold updates much faster. (Christian Brabandt, 2012 Dec)
-MS-Windows: Patch to make tests copy files to avoid changing the fileformat of
-the files under version control. (Taro Muraoka, 2013 Jul 5)
-
Issue 54: document behavior of -complete, also expands arg.
- Add regex for 'paragraphs' and 'sections': 'parare' and 'sectre'. Combine
@@ -372,8 +542,6 @@ Patch by Christian Brabandt, 2013 Apr 20, unfinished.
Bug: findfile("any", "file:///tmp;") does not work.
-'ff' is wrong for one-line file without EOL. (Issue 77)
-
Patch to set antialiasing style on Windows. (Ondrej Balaz, 2013 Mar 14)
Needs a different check for CLEARTYPE_QUALITY.
@@ -412,13 +580,6 @@ signs? Patch by Christian Brabandt, 2013 Aug 22.
Patch to remove flicker from popup menu. (Yasuhiro Matsumoto, 2013 Aug 15)
-Patch to use directX to draw text on Windows. Adds the 'renderoptions'
-option. (Taro Muraoka, 2013 Jan 25, update 2013 Apr 3, May 14)
-Fixes this problem:
-8 Win32: Multi-byte characters are not displayed, even though the same font
- in Notepad can display them. (Srinath Avadhanula) Try with the
- UTF-8-demo.txt page with Andale Mono.
-
Patch to add 'completeselect' option. Specifies how to select a candidate in
insert completion. (Shougo, 2013 May 29)
Update to add to existing 'completeopt'. 2013 May 30
@@ -444,15 +605,10 @@ Patch to improve equivalence classes in regexp patterns.
Patch with suggestions for starting.txt. (Tony Mechelynck, 2012 Oct 24)
But use Gnome instead of GTK?
-Patch to make FocusGained and FocusLost work in modern terminals. (Hayaki
-Saito, 2013 Apr 24)
-
Should be possible to enable/disable matchparen per window or buffer.
Add a check for b:no_match_paren in Highlight_matching_Pair() (Marcin
Szamotulski, 2012 Nov 8)
-Issue 72: 'autochdir' causes problems for :vimgrep.
-
Session file creation: 'autochdir' causes trouble. Keep it off until after
loading all files.
@@ -473,6 +629,14 @@ MS-Windows resizing problems:
causes the window to move unnecessarily. (William E. Skeith III, 2012 Jan
12) Patch: 2012 Jan 13 Needs more work (2012 Feb 2)
+Patch to use Modern UI 2.0 for the Nsis installer. (Guopeng Wen, 2010 Jul 30)
+Latest version: 2011 May 18
+8 Windows install with NSIS: make it possible to do a silent install, see
+ http://nsis.sourceforge.net/Docs/Chapter4.html#4.12
+ Version from Guopeng Wen that does this (2010 Dec 27)
+Alternative: MSI installer: https://github.com/petrkle/vim-msi/
+Or the one on Issue 279
+
'iminsert' global value set when using ":setlocal iminsert"? (Wu, 2012 Jun 23)
Patch to append regexp to tag commands to make it possible to select one out
@@ -493,11 +657,18 @@ Aug 16)
When there are no command line arguments ":next" and ":argu" give E163, which
is confusing. Should say "the argument list is empty".
+xterm supports escape sequences to mark a paste operation. Need to be
+enabled. (Bruno Sutic, 2014 Jul 11) How to know the terminal supports this?
+
URXVT:
- will get stuck if byte sequence does not contain the expected semicolon.
- Use urxvt mouse support also in xterm. Explanations:
http://www.midnight-commander.org/ticket/2662
+Patch to have the fold and sign column and at the last line of the buffer.
+(Marco Hinz, 2014 Sep 25)
+Alternate suggestion: let all columns continue, also the number column.
+
Patch to add tests for if_xcmdsrv.c., Jul 8, need some more work. (Brian Burns)
New tests Jul 13. Update Jul 17. Discussion Jul 18.
@@ -573,6 +744,9 @@ Syntax region with 'concealends' and a 'cchar' value, 'conceallevel' set to 2,
only one of the two ends gets the cchar displayed. (Brett Stahlman, 2010 Aug
21, Ben Fritz, 2010 Sep 14)
+The :syntax cchar value can only be a single character. It would be useful to
+support combining characters. (Charles Campbell)
+
'cursorline' works on a text line only. Add 'cursorscreenline' for
highlighting the screen line. (Christian Brabandt, 2012 Mar 31)
@@ -629,6 +803,7 @@ effects? (Christian Brabandt, 2012 Aug 5, Update 2013 Aug 12)
Would also need to do this for spellbadword() and spellsuggest().
Patch for variable tabstops. On github (Christian Brabandt, 2014 May 15)
+Update Aug 16 (email).
On 64 bit MS-Windows "long" is only 32 bits, but we sometimes need to store a
64 bits value. Change all number options to use nropt_T and define it to the
@@ -696,6 +871,10 @@ Need for CursorHold that retriggers. Use a key that doesn't do anything, or a
function that resets did_cursorhold.
Patch by Christian Brabandt, 2011 May 6.
+Add event for when the text scrolls. A bit like CursorMoved. Also a similar
+one for insert mode. Use the event in matchparen to update the highlight if
+the match scrolls into view.
+
7 Use "++--", "+++--" for different levels instead of "+---" "+----".
Patch by Christian Brabandt, 2011 Jul 27.
Update by Ben Fritz, with fix for TOhtml. (2011 Jul 30)
@@ -783,9 +962,6 @@ names, shell commands and the like. (Kikuchan, 2010 Oct 14)
Assume the system converts between the actual encoding of the filesystem to
the system encoding (usually utf-8).
-Patch to add GUI colors to the terminal, when it supports it. (ZyX, 2013 Jan
-26, update 2013 Dec 14)
-
Problem producing tags file when hebrew.frx is present. It has a BOM.
Results in E670. (Tony Mechelynck, 2010 May 2)
@@ -953,6 +1129,12 @@ to avoid changing 'eventignore'?
Patch for displaying 0x200c and 0x200d. (Ali Gholami Rudi, 2009 May 6)
Probably needs a bit of work.
+Patch to add farsi handling to arabic.c (Ali Gholami Rudi, 2009 May 2)
+Added test, updates, June 23.
+Updated for 7.4: http://litcave.rudi.ir/farsi_vim.diff
+With modification for Tatweel character: https://dpaste.de/VmFw
+Remark from Ameretat Reith (2014 Oct 13)
+
List of encoding aliases. (Takao Fujiwara, 2009 Jul 18)
Are they all OK? Update Jul 22.
@@ -971,10 +1153,6 @@ on the first character. (John Beckett, 2010 Aug 7)
Setting 'tags' to "tagsdir/*" does not find "tagsdir/tags". (Steven K. Wong,
2009 Jul 18)
-Patch to add farsi handling to arabic.c (Ali Gholami Rudi, 2009 May 2)
-Added test, updates, June 23.
-Updated for 7.4: http://litcave.rudi.ir/farsi_vim.diff
-
Patch to add "focusonly" to 'scrollopt', so that scrollbind also applies in
window that doesn't have focus. (Jonathon Mah, 2009 Jan 12)
Needs more work.
@@ -1336,10 +1514,6 @@ Jul 31)
C syntax: {} inside () causes following {} to be highlighted as error.
(Michalis Giannakidis, 2006 Jun 1)
-Can't easily close the help window, like ":pc" closes the preview window and
-":ccl" closes the quickfix window. Add ":hclose". (Chris Gaal)
-Patch for :helpclose, Christian Brabandt, 2010 Sep 6.
-
When 'diffopt' has "context:0" a single deleted line causes two folds to merge
and mess up syncing. (Austin Jennings, 2008 Jan 31)
@@ -1413,8 +1587,8 @@ files with "foo/**" in 'path'. (Kalisiak, 2006 July 15)
Additional info: When using the |wildcards| ** globing, vim hangs
indefinitely on lots of directories. The |file-searching| globing, like in
":set path=/**" does not hang as often as with globing with |wildcards|, like
-in ":1find /**/file". This is for a files that unix "find" can find very
-quick. Merging the 2 kinds of globing might make this an easier fix. (Ian
+in ":1find /**/file". This is for files that unix "find" can find very
+quickly. Merging the 2 kinds of globing might make this an easier fix. (Ian
Kelling, 2008 July 4)
When the file name has parenthesis, e.g., "foo (bar).txt", ":!ls '%'" has the
@@ -1446,13 +1620,6 @@ with "gvim -nb:localhost:55555:foo". From nc do: '1:editFile!0 "foo"'. Then
go to Insert mode and add a few lines. Then backspacing every other time
moves the cursor instead of deleting. (Chris Kaiser, 2007 Sep 25)
-Patch to use Modern UI 2.0 for the Nsis installer. (Guopeng Wen, 2010 Jul 30)
-Latest version: 2011 May 18
-8 Windows install with NSIS: make it possible to do a silent install, see
- http://nsis.sourceforge.net/Docs/Chapter4.html#4.12
- Version from Guopeng Wen that does this (2010 Dec 27)
-Alternative: MSI installer: https://github.com/petrkle/vim-msi/
-
Windows installer should install 32-bit version of right-click handler also on
64-bit systems. (Brian Cunningham, 2011 Dec 28)
@@ -1476,8 +1643,6 @@ Changes for Win32 makefile. (Mike Williams, 2007 Jan 22, Alexei Alexandrov,
Win32: Can't complete shell command names. Why is setting xp_context in
set_one_cmd_context() inside #ifndef BACKSLASH_IN_FILENAME?
-Win32: Patch for convert_filterW(). (Taro Muraoka, 2007 Mar 2)
-
Win32: Patch for cscope external command. (Mike Williams, 2007 Aug 7)
Win32: XPM support only works with path without spaces. Patch by Mathias
@@ -1868,6 +2033,10 @@ restored. (Luc St-Louis)
Patch to support horizontal scroll wheel in GTK. Untested. (Bjorn Winckler,
2010 Jun 30)
+Add an option for a minimal text length before inserting a line break for
+'textwidth'. Avoids very short lines when a very long word follows.
+(Kartik Agaram)
+
At next release:
- Build a huge version by default.
@@ -1906,7 +2075,7 @@ More patches:
- testdir/Make_dos_sh.mak for running tests with MingW. (Bill Mccarthy, 2008
Sep 13)
- Patch for adding "space" item in 'listchars'. (Jérémie Roquet, 2009 Oct 29,
- Docs patch Oct 30, update David Burgin (glts) 2013 Aug 24)
+ Docs patch Oct 30, update David Burgin (glts) 2013 Aug 24, 2014 Oct 10)
- Replace ccomplete.vim by cppcomplete.vim from www.vim.org? script 1520 by
Vissale Neang. (Martin Stubenschrott) Asked Vissale to make the scripts
more friendly for the Vim distribution.
@@ -3035,6 +3204,8 @@ Spell checking:
Diff mode:
+9 When making small changes, e.g. deleting a character, update the diff.
+ Possibly without running diff.
9 Instead invoking an external diff program, use builtin code. One can be
found here: http://www.ioplex.com/~miallen/libmba/dl/src/diff.c
It's quite big and badly documented though.
@@ -3929,7 +4100,6 @@ Autocommands:
when exiting isn't a good idea.
CursorHoldC - CursorHold while command-line editing
WinMoved - when windows have been moved around, e.g, ":wincmd J"
- CmdUndefined - Like FuncUndefined but for user commands.
SearchPost - After doing a search command (e.g. to do "M")
PreDirChanged/PostDirChanged
- Before/after ":cd" has been used (for changing the
@@ -4939,8 +5109,6 @@ Argument list:
Registers:
8 Don't display empty registers with ":display". (Etienne)
-8 Make the # register writable, so that it can be restored after jumping
- around in windows.
8 Add put command that overwrites existing text. Should also work for
blocks. Useful to move text around in a table. Works like using "R ^R r"
for every line.
diff --git a/runtime/doc/usr_04.txt b/runtime/doc/usr_04.txt
index c09cb204c..5f24c8c6f 100644
--- a/runtime/doc/usr_04.txt
+++ b/runtime/doc/usr_04.txt
@@ -1,4 +1,4 @@
-*usr_04.txt* For Vim version 7.4. Last change: 2008 Sep 06
+*usr_04.txt* For Vim version 7.4. Last change: 2014 Aug 29
VIM USER MANUAL - by Bram Moolenaar
@@ -186,7 +186,7 @@ commands:
/four<Enter> find the first string "four"
cwfive<Esc> change the word to "five"
n find the next "four"
- . repeat the change to "five'
+ . repeat the change to "five"
n find the next "four"
. repeat the change
etc.
diff --git a/runtime/doc/usr_25.txt b/runtime/doc/usr_25.txt
index 5a687599b..23d76a8b0 100644
--- a/runtime/doc/usr_25.txt
+++ b/runtime/doc/usr_25.txt
@@ -1,4 +1,4 @@
-*usr_25.txt* For Vim version 7.4. Last change: 2007 May 11
+*usr_25.txt* For Vim version 7.4. Last change: 2014 Oct 29
VIM USER MANUAL - by Bram Moolenaar
@@ -402,7 +402,7 @@ the cursor keys: >
:map <Down> gj
-TURNING A PARAGRAPH INTO ONE LINE
+TURNING A PARAGRAPH INTO ONE LINE *edit-paragraph-join*
If you want to import text into a program like MS-Word, each paragraph should
be a single line. If your paragraphs are currently separated with empty
diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt
index f30b79a2e..28bdbad89 100644
--- a/runtime/doc/usr_41.txt
+++ b/runtime/doc/usr_41.txt
@@ -1,4 +1,4 @@
-*usr_41.txt* For Vim version 7.4. Last change: 2014 May 28
+*usr_41.txt* For Vim version 7.4. Last change: 2014 Aug 16
VIM USER MANUAL - by Bram Moolenaar
@@ -793,6 +793,7 @@ Command line: *command-line-functions*
getcmdpos() get position of the cursor in the command line
setcmdpos() set position of the cursor in the command line
getcmdtype() return the current command-line type
+ getcmdwintype() return the current command-line window type
Quickfix and location lists: *quickfix-functions*
getqflist() list of quickfix errors
diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt
index b264e5be8..4ad328773 100644
--- a/runtime/doc/various.txt
+++ b/runtime/doc/various.txt
@@ -1,4 +1,4 @@
-*various.txt* For Vim version 7.4. Last change: 2014 May 22
+*various.txt* For Vim version 7.4. Last change: 2014 Aug 06
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -337,6 +337,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'|
*+dnd* Support for DnD into the "~ register |quote_~|.
B *+emacs_tags* |emacs-tags| files
N *+eval* expression evaluation |eval.txt|
diff --git a/runtime/doc/version6.txt b/runtime/doc/version6.txt
index f18fea870..2e6fd7323 100644
--- a/runtime/doc/version6.txt
+++ b/runtime/doc/version6.txt
@@ -1,4 +1,4 @@
-*version6.txt* For Vim version 7.4. Last change: 2013 Jul 28
+*version6.txt* For Vim version 7.4. Last change: 2014 Aug 29
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -7816,7 +7816,7 @@ Files: src/buffer.c, src/eval.c, src/ex_docmd.c, src/fileio.c,
Patch 6.1.212
Problem: When Vim was started with "-R" ":new" creates a buffer
'noreadonly' while ":enew" has 'readonly' set. (Preben Guldberg)
-Solution: Don't set 'readonly in a new empty buffer for ":enew".
+Solution: Don't set 'readonly' in a new empty buffer for ":enew".
Files: src/ex_docmd.c
Patch 6.1.213
diff --git a/runtime/doc/version7.txt b/runtime/doc/version7.txt
index 1bff5b5da..3e3e32b39 100644
--- a/runtime/doc/version7.txt
+++ b/runtime/doc/version7.txt
@@ -1,4 +1,4 @@
-*version7.txt* For Vim version 7.4. Last change: 2013 Nov 18
+*version7.txt* For Vim version 7.4. Last change: 2014 Aug 29
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1626,10 +1626,10 @@ and merge it back in.
When running the tests and one of them fails to produce "test.out" the
following tests are still executed. This helps when running out of memory.
-When compiling with EXITFREE defined and the ccmalloc library it is possible
-to detect memory leaks. Some memory will always reported as leaked, such as
-allocated by X11 library functions and the memory allocated in alloc_cmdbuff()
-to store the ":quit" command.
+When compiling with EXITFREE defined and the ccmalloc library, it is possible
+to detect memory leaks. Some memory will always be reported as leaked, such
+as allocated by X11 library functions and the memory allocated in
+alloc_cmdbuff() to store the ":quit" command.
Moved the code for printing to src/hardcopy.c.
@@ -2038,8 +2038,8 @@ Removed the "COUNT" flag from ":argadd", to avoid ":argadd 1*" to be used like
Avoid that $LANG is used for the menus when LC_MESSAGES is "en_US".
-Added backslashes before dashes in the vim.1 manual page to make the appear as
-real dashes. (Pierr Habouzit)
+Added backslashes before dashes in the vim.1 manual page to make them appear
+as real dashes. (Pierre Habouzit)
Where "gq" left the cursor depended on the value of 'formatprg'. Now "gq"
always leaves the cursor at the last line of the formatted text.
@@ -2049,7 +2049,7 @@ detection may try to check the contents of the file while it's still
compressed. Skip setting 'filetype' for compressed files until they have been
decompressed. Required for patterns that end in a "*".
-Starting with an argument "+cmd" or "-S script" causes the cursor the be moved
+Starting with an argument "+cmd" or "-S script" causes the cursor to be moved
to the first line. That breaks a BufReadPost autocommand that uses g`".
Don't move the cursor if it's somewhere past the first line.
@@ -6485,7 +6485,7 @@ Patch 7.1.282 (extra)
Problem: Win64: Edit with Vim context menu isn't installed correctly.
Compiler warnings and a few other things.
Solution: Add [ and ] to entry of class name. Use UINT_PTR instead of UINT.
- And a fixes for the other things. (George V. Reilly)
+ And fixes for other things. (George V. Reilly)
Files: src/GvimExt/Makefile, src/dosinst.c, src/if_ole.cpp, src/if_ole.h,
src/if_ole.idl, src/INSTALLpc.txt, src/Make_mvc.mak,
src/os_win32.c,
@@ -15783,7 +15783,7 @@ Files: src/if_py_both.h, src/if_python3.c, src/testdir/test86.in,
src/testdir/test87.ok
Patch 7.3.944
-Problem: External program receives the termrespone.
+Problem: External program receives the termresponse.
Solution: Insert a delay and discard input. (Hayaki Saito)
Files: src/term.c
diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt
index 4ba28a3c0..532cca3e5 100644
--- a/runtime/doc/windows.txt
+++ b/runtime/doc/windows.txt
@@ -1,4 +1,4 @@
-*windows.txt* For Vim version 7.4. Last change: 2014 Mar 25
+*windows.txt* For Vim version 7.4. Last change: 2014 Dec 05
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -263,28 +263,57 @@ left of the Vim window.
Closing a window
----------------
+:q[uit]
+:{count}q[uit]
CTRL-W q *CTRL-W_q*
CTRL-W CTRL-Q *CTRL-W_CTRL-Q*
-:q[uit] Quit current window. When quitting the last window (not
- counting a help window), exit Vim.
- When 'hidden' is set, and there is only one window for the
- current buffer, it becomes hidden.
- When 'hidden' is not set, and there is only one window for the
- current buffer, and the buffer was changed, the command fails.
- (Note: CTRL-Q does not work on all terminals)
-
-:q[uit]! Quit current window. If this was the last window for a buffer,
- any changes to that buffer are lost. When quitting the last
- window (not counting help windows), exit Vim. The contents of
- the buffer are lost, even when 'hidden' is set.
+ Without {count}: Quit the current window. If {count} is
+ given quit the {count} window.
+ When quitting the last window (not counting a help window),
+ exit Vim.
+
+ When 'hidden' is set, and there is only one window for the
+ current buffer, it becomes hidden. When 'hidden' is not set,
+ and there is only one window for the current buffer, and the
+ buffer was changed, the command fails.
+
+ (Note: CTRL-Q does not work on all terminals).
+
+ If [count] is greater than the last window number the last
+ window will be closed: >
+ :1quit " quit the first window
+ :$quit " quit the last window
+ :9quit " quit the last window
+ " if there are less than 9 windows opened
+ :-quit " quit the previews window
+ :+quit " quit the next window
+ :+2quit " quit the second next window
+<
+:q[uit]!
+:{count}q[uit]!
+ Without {count}: Quit the current window. If {count} is
+ given quit the {count} window.
+
+ If this was the last window for a buffer, any changes to that
+ buffer are lost. When quitting the last window (not counting
+ help windows), exit Vim. The contents of the buffer are lost,
+ even when 'hidden' is set.
+
+:clo[se][!]
+:{count}clo[se][!]
CTRL-W c *CTRL-W_c* *:clo* *:close*
-:clo[se][!] Close current window. When the 'hidden' option is set, or
- when the buffer was changed and the [!] is used, the buffer
- becomes hidden (unless there is another window editing it).
+ Without {count}: Close the current window. If {count} is
+ given close the {count} window.
+
+ When the 'hidden' option is set, or when the buffer was
+ changed and the [!] is used, the buffer becomes hidden (unless
+ there is another window editing it).
+
When there is only one window in the current tab page and
there is another tab page, this closes the current tab page.
|tab-page|.
+
This command fails when: *E444*
- There is only one window on the screen.
- When 'hidden' is not set, [!] is not used, the buffer has
@@ -298,14 +327,19 @@ CTRL-W CTRL-C *CTRL-W_CTRL-C*
command.
*:hide*
-:hid[e] Quit current window, unless it is the last window on the
- screen. The buffer becomes hidden (unless there is another
- window editing it or 'bufhidden' is "unload" or "delete").
+:hid[e]
+:{count}hid[e]
+ Quit the current window, unless it is the last window on the
+ screen. For {count} see |:quit| command.
+
+ The buffer becomes hidden (unless there is another window
+ editing it or 'bufhidden' is "unload", "delete" or "wipe").
If the window is the last one in the current tab page the tab
- page is closed. |tab-page|
- The value of 'hidden' is irrelevant for this command.
- Changes to the buffer are not written and won't get lost, so
- this is a "safe" command.
+ page is closed. |tab-page|
+
+ The value of 'hidden' is irrelevant for this command. Changes
+ to the buffer are not written and won't get lost, so this is a
+ "safe" command.
:hid[e] {cmd} Execute {cmd} with 'hidden' is set. The previous value of
'hidden' is restored after {cmd} has been executed.
@@ -314,12 +348,16 @@ CTRL-W CTRL-C *CTRL-W_CTRL-C*
< This will edit "Makefile", and hide the current buffer if it
has any changes.
+:on[ly][!]
+:{count}on[ly][!]
CTRL-W o *CTRL-W_o* *E445*
CTRL-W CTRL-O *CTRL-W_CTRL-O* *:on* *:only*
-:on[ly][!] Make the current window the only one on the screen. All other
- windows are closed.
+ Make the current window the only one on the screen. All other
+ windows are closed. For {count} see |:quit| command.
+
When the 'hidden' option is set, all buffers in closed windows
become hidden.
+
When 'hidden' is not set, and the 'autowrite' option is set,
modified buffers are written. Otherwise, windows that have
buffers that are modified are not removed, unless the [!] is
@@ -660,8 +698,9 @@ can also get to them with the buffer list commands, like ":bnext".
8. Do a command in all buffers or windows *list-repeat*
*:windo*
-:windo {cmd} Execute {cmd} in each window.
- It works like doing this: >
+:[range]windo {cmd} Execute {cmd} in each window or if [range] is given
+ only in windows for which the window number lies in
+ the [range]. It works like doing this: >
CTRL-W t
:{cmd}
CTRL-W w
@@ -679,8 +718,10 @@ can also get to them with the buffer list commands, like ":bnext".
Also see |:tabdo|, |:argdo| and |:bufdo|.
*:bufdo*
-:bufdo[!] {cmd} Execute {cmd} in each buffer in the buffer list.
- It works like doing this: >
+:[range]bufdo[!] {cmd} Execute {cmd} in each buffer in the buffer list or if
+ [range] is given only for buffers for which their
+ buffer numer is in the [range]. It works like doing
+ this: >
:bfirst
:{cmd}
:bnext
@@ -726,18 +767,21 @@ the buffer. The result is that all buffers will use the 'encoding' encoding
CTRL-W ] *CTRL-W_]* *CTRL-W_CTRL-]*
CTRL-W CTRL-] Split current window in two. Use identifier under cursor as a
- tag and jump to it in the new upper window. Make new window N
- high.
+ tag and jump to it in the new upper window.
+ In Visual mode uses the Visually selected text as a tag.
+ Make new window N high.
*CTRL-W_g]*
CTRL-W g ] Split current window in two. Use identifier under cursor as a
tag and perform ":tselect" on it in the new upper window.
+ In Visual mode uses the Visually selected text as a tag.
Make new window N high.
*CTRL-W_g_CTRL-]*
CTRL-W g CTRL-] Split current window in two. Use identifier under cursor as a
- tag and perform ":tjump" on it in the new upper window. Make
- new window N high.
+ tag and perform ":tjump" on it in the new upper window.
+ In Visual mode uses the Visually selected text as a tag.
+ Make new window N high.
CTRL-W f *CTRL-W_f* *CTRL-W_CTRL-F*
CTRL-W CTRL-F Split current window in two. Edit file name under cursor.
@@ -989,7 +1033,11 @@ list of buffers. |unlisted-buffer|
Actually, the buffer isn't completely deleted, it is removed
from the buffer list |unlisted-buffer| and option values,
variables and mappings/abbreviations for the buffer are
- cleared.
+ cleared. Examples: >
+ :.,$-bdelete " delete buffers from the current one to
+ " last but one
+ :%bdelete " delete all buffers
+<
:bdelete[!] {bufname} *E93* *E94*
Like ":bdelete[!] [N]", but buffer given by name. Note that a
@@ -1013,7 +1061,11 @@ list of buffers. |unlisted-buffer|
Like |:bdelete|, but really delete the buffer. Everything
related to the buffer is lost. All marks in this buffer
become invalid, option settings are lost, etc. Don't use this
- unless you know what you are doing.
+ unless you know what you are doing. Examples: >
+ :.+,$bwipeout " wipe out all buffers after the current
+ " one
+ :%bwipeout " wipe out all buffers
+<
:[N]bun[load][!] *:bun* *:bunload* *E515*
:bun[load][!] [N]
@@ -1042,36 +1094,41 @@ list of buffers. |unlisted-buffer|
a number). Insert a backslash before a space in a buffer
name.
-:[N]b[uffer][!] [N] *:b* *:bu* *:buf* *:buffer* *E86*
+:[N]b[uffer][!] [+cmd] [N] *:b* *:bu* *:buf* *:buffer* *E86*
Edit buffer [N] from the buffer list. If [N] is not given,
the current buffer remains being edited. See |:buffer-!| for
[!]. This will also edit a buffer that is not in the buffer
list, without setting the 'buflisted' flag.
+ Also see ||+cmd|.
-:[N]b[uffer][!] {bufname}
+:[N]b[uffer][!] [+cmd] {bufname}
Edit buffer for {bufname} from the buffer list. See
|:buffer-!| for [!]. This will also edit a buffer that is not
in the buffer list, without setting the 'buflisted' flag.
+ Also see ||+cmd|.
-:[N]sb[uffer] [N] *:sb* *:sbuffer*
+:[N]sb[uffer] [+cmd] [N] *:sb* *:sbuffer*
Split window and edit buffer [N] from the buffer list. If [N]
is not given, the current buffer is edited. Respects the
"useopen" setting of 'switchbuf' when splitting. This will
also edit a buffer that is not in the buffer list, without
setting the 'buflisted' flag.
+ Also see ||+cmd|.
-:[N]sb[uffer] {bufname}
+:[N]sb[uffer] [+cmd] {bufname}
Split window and edit buffer for {bufname} from the buffer
list. This will also edit a buffer that is not in the buffer
list, without setting the 'buflisted' flag.
Note: If what you want to do is split the buffer, make a copy
under another name, you can do it this way: >
:w foobar | sp #
+< Also see ||+cmd|.
-:[N]bn[ext][!] [N] *:bn* *:bnext* *E87*
+:[N]bn[ext][!] [+cmd] [N] *:bn* *:bnext* *E87*
Go to [N]th next buffer in buffer list. [N] defaults to one.
Wraps around the end of the buffer list.
See |:buffer-!| for [!].
+ Also see ||+cmd|.
If you are in a help buffer, this takes you to the next help
buffer (if there is one). Similarly, if you are in a normal
(non-help) buffer, this takes you to the next normal buffer.
@@ -1079,55 +1136,61 @@ list of buffers. |unlisted-buffer|
the way when you're browsing code/text buffers. The next three
commands also work like this.
+
*:sbn* *:sbnext*
-:[N]sbn[ext] [N]
+:[N]sbn[ext] [+cmd] [N]
Split window and go to [N]th next buffer in buffer list.
Wraps around the end of the buffer list. Uses 'switchbuf'
+ Also see ||+cmd|.
-:[N]bN[ext][!] [N] *:bN* *:bNext* *:bp* *:bprevious* *E88*
-:[N]bp[revious][!] [N]
+:[N]bN[ext][!] [+cmd] [N] *:bN* *:bNext* *:bp* *:bprevious* *E88*
+:[N]bp[revious][!] [+cmd] [N]
Go to [N]th previous buffer in buffer list. [N] defaults to
one. Wraps around the start of the buffer list.
See |:buffer-!| for [!] and 'switchbuf'.
+ Also see ||+cmd|.
-:[N]sbN[ext] [N] *:sbN* *:sbNext* *:sbp* *:sbprevious*
-:[N]sbp[revious] [N]
+:[N]sbN[ext] [+cmd] [N] *:sbN* *:sbNext* *:sbp* *:sbprevious*
+:[N]sbp[revious] [+cmd] [N]
Split window and go to [N]th previous buffer in buffer list.
Wraps around the start of the buffer list.
Uses 'switchbuf'.
+ Also see ||+cmd|.
- *:br* *:brewind*
-:br[ewind][!] Go to first buffer in buffer list. If the buffer list is
+:br[ewind][!] [+cmd] *:br* *:brewind*
+ Go to first buffer in buffer list. If the buffer list is
empty, go to the first unlisted buffer.
See |:buffer-!| for [!].
- *:bf* *:bfirst*
-:bf[irst] Same as ":brewind".
+:bf[irst] [+cmd] *:bf* *:bfirst*
+ Same as |:brewind|.
+ Also see |+cmd|.
- *:sbr* *:sbrewind*
-:sbr[ewind] Split window and go to first buffer in buffer list. If the
+:sbr[ewind] [+cmd] *:sbr* *:sbrewind*
+ Split window and go to first buffer in buffer list. If the
buffer list is empty, go to the first unlisted buffer.
Respects the 'switchbuf' option.
+ Also see |+cmd|.
- *:sbf* *:sbfirst*
-:sbf[irst] Same as ":sbrewind".
+:sbf[irst] [+cmd] *:sbf* *:sbfirst*
+ Same as ":sbrewind".
- *:bl* *:blast*
-:bl[ast][!] Go to last buffer in buffer list. If the buffer list is
+:bl[ast][!] [+cmd] *:bl* *:blast*
+ Go to last buffer in buffer list. If the buffer list is
empty, go to the last unlisted buffer.
See |:buffer-!| for [!].
- *:sbl* *:sblast*
-:sbl[ast] Split window and go to last buffer in buffer list. If the
+:sbl[ast] [+cmd] *:sbl* *:sblast*
+ Split window and go to last buffer in buffer list. If the
buffer list is empty, go to the last unlisted buffer.
Respects 'switchbuf' option.
-:[N]bm[odified][!] [N] *:bm* *:bmodified* *E84*
+:[N]bm[odified][!] [+cmd] [N] *:bm* *:bmodified* *E84*
Go to [N]th next modified buffer. Note: this command also
finds unlisted buffers. If there is no modified buffer the
command fails.
-:[N]sbm[odified] [N] *:sbm* *:sbmodified*
+:[N]sbm[odified] [+cmd] [N] *:sbm* *:sbmodified*
Split window and go to [N]th next modified buffer.
Respects 'switchbuf' option.
Note: this command also finds buffers not in the buffer list.
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index 677e9bbdb..019345baf 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2014 Jul 09
+" Last Change: 2015 Jan 07
" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
@@ -530,6 +530,9 @@ au BufNewFile,BufRead configure.in,configure.ac setf config
" CUDA Cumpute Unified Device Architecture
au BufNewFile,BufRead *.cu setf cuda
+" Dockerfile
+au BufNewFile,BufRead Dockerfile setf dockerfile
+
" WildPackets EtherPeek Decoder
au BufNewFile,BufRead *.dcd setf dcd
@@ -779,6 +782,9 @@ au BufNewFile,BufRead *.git/config,.gitconfig,.gitmodules setf gitconfig
au BufNewFile,BufRead *.git/modules/*/COMMIT_EDITMSG setf gitcommit
au BufNewFile,BufRead *.git/modules/*/config setf gitconfig
au BufNewFile,BufRead */.config/git/config setf gitconfig
+if !empty($XDG_CONFIG_HOME)
+ au BufNewFile,BufRead $XDG_CONFIG_HOME/git/config setf gitconfig
+endif
au BufNewFile,BufRead git-rebase-todo setf gitrebase
au BufNewFile,BufRead .msg.[0-9]*
\ if getline(1) =~ '^From.*# This line is ignored.$' |
@@ -811,6 +817,9 @@ au BufNewFile,BufRead {,.}gitolite.rc,example.gitolite.rc setf perl
" Gnuplot scripts
au BufNewFile,BufRead *.gpi setf gnuplot
+" Go (Google)
+au BufNewFile,BufRead *.go setf go
+
" GrADS scripts
au BufNewFile,BufRead *.gs setf grads
@@ -989,7 +998,7 @@ au BufNewFile,BufRead *.java,*.jav setf java
au BufNewFile,BufRead *.jj,*.jjt setf javacc
" JavaScript, ECMAScript
-au BufNewFile,BufRead *.js,*.javascript,*.es,*.jsx,*.json setf javascript
+au BufNewFile,BufRead *.js,*.javascript,*.es,*.jsx setf javascript
" Java Server Pages
au BufNewFile,BufRead *.jsp setf jsp
@@ -1007,6 +1016,9 @@ au BufNewFile,BufRead *.jgr setf jgraph
" Jovial
au BufNewFile,BufRead *.jov,*.j73,*.jovial setf jovial
+" JSON
+au BufNewFile,BufRead *.json,*.jsonp setf json
+
" Kixtart
au BufNewFile,BufRead *.kix setf kix
@@ -1040,6 +1052,9 @@ au BufNewFile,BufRead *.ldif setf ldif
" Ld loader
au BufNewFile,BufRead *.ld setf ld
+" Less
+au BufNewFile,BufRead *.less setf less
+
" Lex
au BufNewFile,BufRead *.lex,*.l,*.lxx,*.l++ setf lex
@@ -1095,6 +1110,9 @@ au BufNewFile,BufRead *.lou,*.lout setf lout
" Lua
au BufNewFile,BufRead *.lua setf lua
+" Luarocks
+au BufNewFile,BufRead *.rockspec setf lua
+
" Linden Scripting Language (Second Life)
au BufNewFile,BufRead *.lsl setf lsl
@@ -1139,10 +1157,10 @@ au BufNewFile,BufRead *.mv,*.mpl,*.mws setf maple
au BufNewFile,BufRead *.map setf map
" Markdown
-au BufNewFile,BufRead *.markdown,*.mdown,*.mkd,*.mkdn,*.mdwn,README.md setf markdown
+au BufNewFile,BufRead *.markdown,*.mdown,*.mkd,*.mkdn,*.mdwn,*.md setf markdown
" Mason
-au BufNewFile,BufRead *.mason,*.mhtml setf mason
+au BufNewFile,BufRead *.mason,*.mhtml,*.comp setf mason
" Matlab or Objective C
au BufNewFile,BufRead *.m call s:FTm()
@@ -1231,8 +1249,8 @@ au BufNewFile,BufRead *.mod
\ setf modsim3 |
\ endif
-" Modula 2
-au BufNewFile,BufRead *.m2,*.DEF,*.MOD,*.md,*.mi setf modula2
+" Modula 2 (.md removed in favor of Markdown)
+au BufNewFile,BufRead *.m2,*.DEF,*.MOD,*.mi setf modula2
" Modula 3 (.m3, .i3, .mg, .ig)
au BufNewFile,BufRead *.[mi][3g] setf modula3
@@ -1841,7 +1859,7 @@ au BufNewFile,BufRead sgml.catalog* call s:StarSetf('catalog')
" Shell scripts (sh, ksh, bash, bash2, csh); Allow .profile_foo etc.
" Gentoo ebuilds are actually bash scripts
-au BufNewFile,BufRead .bashrc*,bashrc,bash.bashrc,.bash_profile*,.bash_logout*,*.bash,*.ebuild call SetFileTypeSH("bash")
+au BufNewFile,BufRead .bashrc*,bashrc,bash.bashrc,.bash_profile*,.bash_logout*,.bash_aliases*,*.bash,*.ebuild call SetFileTypeSH("bash")
au BufNewFile,BufRead .kshrc*,*.ksh call SetFileTypeSH("ksh")
au BufNewFile,BufRead */etc/profile,.profile*,*.sh,*.env call SetFileTypeSH(getline(1))
@@ -2311,6 +2329,9 @@ au BufNewFile,BufRead vgrindefs setf vgrindefs
" VRML V1.0c
au BufNewFile,BufRead *.wrl setf vrml
+" Vroom (vim testing and executable documentation)
+au BufNewFile,BufRead *.vroom setf vroom
+
" Webmacro
au BufNewFile,BufRead *.wm setf webmacro
@@ -2484,6 +2505,8 @@ au BufNewFile,BufRead */etc/yum.conf setf dosini
" Zimbu
au BufNewFile,BufRead *.zu setf zimbu
+" Zimbu Templates
+au BufNewFile,BufRead *.zut setf zimbutempl
" Zope
" dtml (zope dynamic template markup language), pt (zope page template),
diff --git a/runtime/ftplugin/dockerfile.vim b/runtime/ftplugin/dockerfile.vim
new file mode 100644
index 000000000..2e3c447b5
--- /dev/null
+++ b/runtime/ftplugin/dockerfile.vim
@@ -0,0 +1,16 @@
+" Vim filetype plugin
+" Language: Dockerfile
+" Maintainer: Honza Pokorny <http://honza.ca>
+" Last Change: 2014 Aug 29
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+ finish
+endif
+
+" Don't load another plugin for this buffer
+let b:did_ftplugin = 1
+
+let b:undo_ftplugin = "setl commentstring<"
+
+setlocal commentstring=#\ %s
diff --git a/runtime/ftplugin/go.vim b/runtime/ftplugin/go.vim
new file mode 100644
index 000000000..61dc1a13b
--- /dev/null
+++ b/runtime/ftplugin/go.vim
@@ -0,0 +1,18 @@
+" Vim filetype plugin file
+" Language: Go
+" Maintainer: David Barnett (https://github.com/google/vim-ft-go)
+" Last Change: 2014 Aug 16
+
+if exists('b:did_ftplugin')
+ finish
+endif
+let b:did_ftplugin = 1
+
+setlocal formatoptions-=t
+
+setlocal comments=s1:/*,mb:*,ex:*/,://
+setlocal commentstring=//\ %s
+
+let b:undo_ftplugin = 'setl fo< com< cms<'
+
+" vim: sw=2 sts=2 et
diff --git a/runtime/ftplugin/json.vim b/runtime/ftplugin/json.vim
new file mode 100644
index 000000000..c79b13fc6
--- /dev/null
+++ b/runtime/ftplugin/json.vim
@@ -0,0 +1,17 @@
+" Vim filetype plugin
+" Language: JSON
+" Maintainer: David Barnett <daviebdawg+vim@gmail.com>
+" Last Change: 2014 Jul 16
+
+if exists('b:did_ftplugin')
+ finish
+endif
+let b:did_ftplugin = 1
+
+let b:undo_ftplugin = 'setlocal formatoptions< comments< commentstring<'
+
+setlocal formatoptions-=t
+
+" JSON has no comments.
+setlocal comments=
+setlocal commentstring=
diff --git a/runtime/ftplugin/less.vim b/runtime/ftplugin/less.vim
new file mode 100644
index 000000000..637e9d292
--- /dev/null
+++ b/runtime/ftplugin/less.vim
@@ -0,0 +1,20 @@
+" Vim filetype plugin
+" Language: less
+" Maintainer: Alessandro Vioni <jenoma@gmail.com>
+" URL: https://github.com/genoma/vim-less
+" Last Change: 2014 November 24
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+ finish
+endif
+let b:did_ftplugin = 1
+
+let b:undo_ftplugin = "setl cms< def< inc< inex< ofu< sua<"
+
+setlocal formatoptions-=t formatoptions+=croql
+
+setlocal comments=:// commentstring=//\ %s
+
+setlocal omnifunc=csscomplete#CompleteCSS
+setlocal suffixesadd=.less
diff --git a/runtime/ftplugin/man.vim b/runtime/ftplugin/man.vim
index c6e1e9d4f..28b7e245b 100644
--- a/runtime/ftplugin/man.vim
+++ b/runtime/ftplugin/man.vim
@@ -1,7 +1,7 @@
" Vim filetype plugin file
" Language: man
" Maintainer: SungHyun Nam <goweol@gmail.com>
-" Last Change: 2013 Jul 17
+" Last Change: 2014 Dec 29
" To make the ":Man" command available before editing a manual page, source
" this script from your startup vimrc file.
@@ -63,7 +63,9 @@ endtry
func <SID>PreGetPage(cnt)
if a:cnt == 0
let old_isk = &iskeyword
- setl iskeyword+=(,)
+ if &ft == 'man'
+ setl iskeyword+=(,)
+ endif
let str = expand("<cword>")
let &l:iskeyword = old_isk
let page = substitute(str, '(*\(\k\+\).*', '\1', '')
@@ -157,10 +159,10 @@ func <SID>GetPage(...)
silent exec "r!/usr/bin/man ".s:GetCmdArg(sect, page)." | col -b"
" Remove blank lines from top and bottom.
while getline(1) =~ '^\s*$'
- silent norm ggdd
+ silent keepj norm ggdd
endwhile
while getline('$') =~ '^\s*$'
- silent norm Gdd
+ silent keepj norm Gdd
endwhile
1
setl ft=man nomod
diff --git a/runtime/ftplugin/matlab.vim b/runtime/ftplugin/matlab.vim
index 6bfb3d761..205111c3c 100644
--- a/runtime/ftplugin/matlab.vim
+++ b/runtime/ftplugin/matlab.vim
@@ -1,7 +1,10 @@
" Vim filetype plugin file
" Language: matlab
" Maintainer: Jake Wasserman <jwasserman at gmail dot com>
-" Last Changed: 2006 Jan 12
+" Last Changed: 2014 Dec 30
+
+" Contributors:
+" Charles Campbell
if exists("b:did_ftplugin")
finish
@@ -12,10 +15,11 @@ let s:save_cpo = &cpo
set cpo-=C
if exists("loaded_matchit")
- let s:conditionalEnd = '\(([^()]*\)\@!\<end\>\([^()]*)\)\@!'
- let b:match_words = '\<if\>\|\<while\>\|\<for\>\|\<switch\>:' .
- \ s:conditionalEnd . ',\<if\>:\<elseif\>:\<else\>:' .
- \ s:conditionalEnd
+ let s:conditionalEnd = '\%(([^()]*\)\@!\<end\>\%([^()]*)\)\@!'
+ let b:match_words=
+ \ '\<\%(if\|switch\|for\|while\)\>:\<\%(elseif\|case\|break\|continue\|else\|otherwise\)\>:'.s:conditionalEnd.','.
+ \ '\<function\>:\<return\>:\<endfunction\>'
+ unlet s:conditionalEnd
endif
setlocal suffixesadd=.m
diff --git a/runtime/ftplugin/vim.vim b/runtime/ftplugin/vim.vim
index edba37b89..f355d2837 100644
--- a/runtime/ftplugin/vim.vim
+++ b/runtime/ftplugin/vim.vim
@@ -1,7 +1,7 @@
" Vim filetype plugin
" Language: Vim
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2013 Jun 26
+" Last Change: 2014 Sep 07
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
@@ -62,9 +62,12 @@ if exists("loaded_matchit")
\ '\<try\>:\<cat\%[ch]\>:\<fina\%[lly]\>:\<endt\%[ry]\>,' .
\ '\<aug\%[roup]\s\+\%(END\>\)\@!\S:\<aug\%[roup]\s\+END\>,' .
\ '(:)'
- " Ignore ":syntax region" commands, the 'end' argument clobbers if-endif
- let b:match_skip = 'getline(".") =~ "^\\s*sy\\%[ntax]\\s\\+region" ||
- \ synIDattr(synID(line("."),col("."),1),"name") =~? "comment\\|string"'
+ " Ignore syntax region commands and settings, any 'en*' would clobber
+ " if-endif.
+ " - set spl=de,en
+ " - au! FileType javascript syntax region foldBraces start=/{/ end=/}/ …
+ let b:match_skip = 'synIDattr(synID(line("."),col("."),1),"name")
+ \ =~? "comment\\|string\\|vimSynReg\\|vimSet"'
endif
let &cpo = s:cpo_save
diff --git a/runtime/ftplugin/vroom.vim b/runtime/ftplugin/vroom.vim
new file mode 100644
index 000000000..3d9e7835d
--- /dev/null
+++ b/runtime/ftplugin/vroom.vim
@@ -0,0 +1,35 @@
+" Vim filetype plugin file
+" Language: Vroom (vim testing and executable documentation)
+" Maintainer: David Barnett (https://github.com/google/vim-ft-vroom)
+" Last Change: 2014 Jul 23
+
+if exists('b:did_ftplugin')
+ finish
+endif
+let b:did_ftplugin = 1
+
+let s:cpo_save = &cpo
+set cpo-=C
+
+
+let b:undo_ftplugin = 'setlocal formatoptions< shiftwidth< softtabstop<' .
+ \ ' expandtab< iskeyword< comments< commentstring<'
+
+setlocal formatoptions-=t
+
+" The vroom interpreter doesn't accept anything but 2-space indent.
+setlocal shiftwidth=2
+setlocal softtabstop=2
+setlocal expandtab
+
+" To allow tag lookup and autocomplete for whole autoload functions, '#' must be
+" a keyword character. This also conforms to the behavior of ftplugin/vim.vim.
+setlocal iskeyword+=#
+
+" Vroom files have no comments (text is inert documentation unless indented).
+setlocal comments=
+setlocal commentstring=
+
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/indent/ada.vim b/runtime/indent/ada.vim
index 03fbaa3a1..5019f0b73 100644
--- a/runtime/indent/ada.vim
+++ b/runtime/indent/ada.vim
@@ -148,7 +148,7 @@ function s:StatementIndent( current_indent, prev_lnum )
" Get previous non-blank/non-comment-only line
while 1
let line = substitute( getline(lnum), g:ada#Comment, '', '' )
-
+
if line !~ '^\s*$' && line !~ '^\s*#'
break
endif
diff --git a/runtime/indent/go.vim b/runtime/indent/go.vim
new file mode 100644
index 000000000..412ac871c
--- /dev/null
+++ b/runtime/indent/go.vim
@@ -0,0 +1,78 @@
+" Vim indent file
+" Language: Go
+" Maintainer: David Barnett (https://github.com/google/vim-ft-go)
+" Last Change: 2014 Aug 16
+"
+" TODO:
+" - function invocations split across lines
+" - general line splits (line ends in an operator)
+
+if exists('b:did_indent')
+ finish
+endif
+let b:did_indent = 1
+
+" C indentation is too far off useful, mainly due to Go's := operator.
+" Let's just define our own.
+setlocal nolisp
+setlocal autoindent
+setlocal indentexpr=GoIndent(v:lnum)
+setlocal indentkeys+=<:>,0=},0=)
+
+if exists('*GoIndent')
+ finish
+endif
+
+" The shiftwidth() function is relatively new.
+" Don't require it to exist.
+if exists('*shiftwidth')
+ function s:sw() abort
+ return shiftwidth()
+ endfunction
+else
+ function s:sw() abort
+ return &shiftwidth
+ endfunction
+endif
+
+function! GoIndent(lnum)
+ let l:prevlnum = prevnonblank(a:lnum-1)
+ if l:prevlnum == 0
+ " top of file
+ return 0
+ endif
+
+ " grab the previous and current line, stripping comments.
+ let l:prevl = substitute(getline(l:prevlnum), '//.*$', '', '')
+ let l:thisl = substitute(getline(a:lnum), '//.*$', '', '')
+ let l:previ = indent(l:prevlnum)
+
+ let l:ind = l:previ
+
+ if l:prevl =~ '[({]\s*$'
+ " previous line opened a block
+ let l:ind += s:sw()
+ endif
+ if l:prevl =~# '^\s*\(case .*\|default\):$'
+ " previous line is part of a switch statement
+ let l:ind += s:sw()
+ endif
+ " TODO: handle if the previous line is a label.
+
+ if l:thisl =~ '^\s*[)}]'
+ " this line closed a block
+ let l:ind -= s:sw()
+ endif
+
+ " Colons are tricky.
+ " We want to outdent if it's part of a switch ("case foo:" or "default:").
+ " We ignore trying to deal with jump labels because (a) they're rare, and
+ " (b) they're hard to disambiguate from a composite literal key.
+ if l:thisl =~# '^\s*\(case .*\|default\):$'
+ let l:ind -= s:sw()
+ endif
+
+ return l:ind
+endfunction
+
+" vim: sw=2 sts=2 et
diff --git a/runtime/indent/html.vim b/runtime/indent/html.vim
index b5374bd68..d64a0e5cd 100644
--- a/runtime/indent/html.vim
+++ b/runtime/indent/html.vim
@@ -2,7 +2,7 @@
" Header: "{{{
" Maintainer: Bram Moolenaar
" Original Author: Andy Wokula <anwoku@yahoo.de>
-" Last Change: 2014 Jul 04
+" Last Change: 2014 Aug 23
" Version: 1.0
" Description: HTML indent script with cached state for faster indenting on a
" range of lines.
@@ -497,7 +497,7 @@ func! s:FreshState(lnum)
" If previous line ended in a closing tag, line up with the opening tag.
if !swendtag && text =~ '</\w\+\s*>\s*$'
call cursor(state.lnum, 99999)
- normal F<
+ normal! F<
let start_lnum = HtmlIndent_FindStartTag()
if start_lnum > 0
let state.baseindent = indent(start_lnum)
@@ -898,7 +898,7 @@ func! HtmlIndent()
" a tag works very differently. Do not do this when the line starts with
" "<", it gets the "htmlTag" ID but we are not inside a tag then.
if curtext !~ '^\s*<'
- normal ^
+ normal! ^
let stack = synstack(v:lnum, col('.')) " assumes there are no tabs
let foundHtmlString = 0
for synid in reverse(stack)
diff --git a/runtime/indent/json.vim b/runtime/indent/json.vim
new file mode 100644
index 000000000..649f2b8aa
--- /dev/null
+++ b/runtime/indent/json.vim
@@ -0,0 +1,168 @@
+" Vim indent file
+" Language: JSON
+" Mantainer: Eli Parra <eli@elzr.com> https://github.com/elzr/vim-json
+" Last Change: 2014 Aug 29
+" https://github.com/jakar/vim-json/commit/20b650e22aa750c4ab6a66aa646bdd95d7cd548a#diff-e81fc111b2052e306d126bd9989f7b7c
+" Original Author: Rogerz Zhang <rogerz.zhang at gmail.com> http://github.com/rogerz/vim-json
+" Acknowledgement: Based off of vim-javascript maintained by Darrick Wiebe
+" http://www.vim.org/scripts/script.php?script_id=2765
+
+" 0. Initialization {{{1
+" =================
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+
+setlocal nosmartindent
+
+" Now, set up our indentation expression and keys that trigger it.
+setlocal indentexpr=GetJSONIndent()
+setlocal indentkeys=0{,0},0),0[,0],!^F,o,O,e
+
+" Only define the function once.
+if exists("*GetJSONIndent")
+ finish
+endif
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+" 1. Variables {{{1
+" ============
+
+let s:line_term = '\s*\%(\%(\/\/\).*\)\=$'
+" Regex that defines blocks.
+let s:block_regex = '\%({\)\s*\%(|\%([*@]\=\h\w*,\=\s*\)\%(,\s*[*@]\=\h\w*\)*|\)\=' . s:line_term
+
+" 2. Auxiliary Functions {{{1
+" ======================
+
+" Check if the character at lnum:col is inside a string.
+function s:IsInString(lnum, col)
+ return synIDattr(synID(a:lnum, a:col, 1), 'name') == 'jsonString'
+endfunction
+
+" Find line above 'lnum' that isn't empty, or in a string.
+function s:PrevNonBlankNonString(lnum)
+ let lnum = prevnonblank(a:lnum)
+ while lnum > 0
+ " If the line isn't empty or in a string, end search.
+ let line = getline(lnum)
+ if !(s:IsInString(lnum, 1) && s:IsInString(lnum, strlen(line)))
+ break
+ endif
+ let lnum = prevnonblank(lnum - 1)
+ endwhile
+ return lnum
+endfunction
+
+" Check if line 'lnum' has more opening brackets than closing ones.
+function s:LineHasOpeningBrackets(lnum)
+ let open_0 = 0
+ let open_2 = 0
+ let open_4 = 0
+ let line = getline(a:lnum)
+ let pos = match(line, '[][(){}]', 0)
+ while pos != -1
+ let idx = stridx('(){}[]', line[pos])
+ if idx % 2 == 0
+ let open_{idx} = open_{idx} + 1
+ else
+ let open_{idx - 1} = open_{idx - 1} - 1
+ endif
+ let pos = match(line, '[][(){}]', pos + 1)
+ endwhile
+ return (open_0 > 0) . (open_2 > 0) . (open_4 > 0)
+endfunction
+
+function s:Match(lnum, regex)
+ let col = match(getline(a:lnum), a:regex) + 1
+ return col > 0 && !s:IsInString(a:lnum, col) ? col : 0
+endfunction
+
+" 3. GetJSONIndent Function {{{1
+" =========================
+
+function GetJSONIndent()
+ " 3.1. Setup {{{2
+ " ----------
+
+ " Set up variables for restoring position in file. Could use v:lnum here.
+ let vcol = col('.')
+
+ " 3.2. Work on the current line {{{2
+ " -----------------------------
+
+ " Get the current line.
+ let line = getline(v:lnum)
+ let ind = -1
+
+ " If we got a closing bracket on an empty line, find its match and indent
+ " according to it.
+ let col = matchend(line, '^\s*[]}]')
+
+ if col > 0 && !s:IsInString(v:lnum, col)
+ call cursor(v:lnum, col)
+ let bs = strpart('{}[]', stridx('}]', line[col - 1]) * 2, 2)
+
+ let pairstart = escape(bs[0], '[')
+ let pairend = escape(bs[1], ']')
+ let pairline = searchpair(pairstart, '', pairend, 'bW')
+
+ if pairline > 0
+ let ind = indent(pairline)
+ else
+ let ind = virtcol('.') - 1
+ endif
+
+ return ind
+ endif
+
+ " If we are in a multi-line string, don't do anything to it.
+ if s:IsInString(v:lnum, matchend(line, '^\s*') + 1)
+ return indent('.')
+ endif
+
+ " 3.3. Work on the previous line. {{{2
+ " -------------------------------
+
+ let lnum = prevnonblank(v:lnum - 1)
+
+ if lnum == 0
+ return 0
+ endif
+
+ " Set up variables for current line.
+ let line = getline(lnum)
+ let ind = indent(lnum)
+
+ " If the previous line ended with a block opening, add a level of indent.
+ " if s:Match(lnum, s:block_regex)
+ " return indent(lnum) + &sw
+ " endif
+
+ " If the previous line contained an opening bracket, and we are still in it,
+ " add indent depending on the bracket type.
+ if line =~ '[[({]'
+ let counts = s:LineHasOpeningBrackets(lnum)
+ if counts[0] == '1' || counts[1] == '1' || counts[2] == '1'
+ return ind + &sw
+ else
+ call cursor(v:lnum, vcol)
+ end
+ endif
+
+ " }}}2
+
+ return ind
+endfunction
+
+" }}}1
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
+" vim:set sw=2 sts=2 ts=8 noet:
diff --git a/runtime/indent/less.vim b/runtime/indent/less.vim
new file mode 100644
index 000000000..82bf2d87f
--- /dev/null
+++ b/runtime/indent/less.vim
@@ -0,0 +1,13 @@
+" Vim indent file
+" Language: less
+" Maintainer: Alessandro Vioni <jenoma@gmail.com>
+" URL: https://github.com/genoma/vim-less
+" Last Change: 2014 November 24
+
+if exists("b:did_indent")
+ finish
+endif
+
+runtime! indent/css.vim
+
+" vim:set sw=2:
diff --git a/runtime/indent/lua.vim b/runtime/indent/lua.vim
index 21b02f154..5f049d458 100644
--- a/runtime/indent/lua.vim
+++ b/runtime/indent/lua.vim
@@ -2,7 +2,7 @@
" Language: Lua script
" Maintainer: Marcus Aurelius Farias <marcus.cf 'at' bol.com.br>
" First Author: Max Ischenko <mfi 'at' ukr.net>
-" Last Change: 2007 Jul 23
+" Last Change: 2014 Nov 12
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
@@ -54,7 +54,7 @@ function! GetLuaIndent()
" Subtract a 'shiftwidth' on end, else (and elseif), until and '}'
" This is the part that requires 'indentkeys'.
- let midx = match(getline(v:lnum), '^\s*\%(end\|else\|until\|}\)')
+ let midx = match(getline(v:lnum), '^\s*\%(end\>\|else\>\|until\>\|}\)')
if midx != -1 && synIDattr(synID(v:lnum, midx + 1, 1), "name") != "luaComment"
let ind = ind - &shiftwidth
endif
diff --git a/runtime/indent/php.vim b/runtime/indent/php.vim
index b83a1923e..1bffa7f19 100644
--- a/runtime/indent/php.vim
+++ b/runtime/indent/php.vim
@@ -3,8 +3,8 @@
" Author: John Wellesz <John.wellesz (AT) teaser (DOT) fr>
" URL: http://www.2072productions.com/vim/indent/php.vim
" Home: https://github.com/2072/PHP-Indenting-for-VIm
-" Last Change: 2014 April 3rd
-" Version: 1.49
+" Last Change: 2014 November 26th
+" Version: 1.57
"
"
" Type :help php-indent for available options
@@ -48,7 +48,7 @@ endif
let b:did_indent = 1
-let php_sync_method = 0
+let g:php_sync_method = 0
@@ -112,7 +112,7 @@ setlocal nocindent
setlocal nolisp
setlocal indentexpr=GetPhpIndent()
-setlocal indentkeys=0{,0},0),:,!^F,o,O,e,*<Return>,=?>,=<?,=*/
+setlocal indentkeys=0{,0},0),0],:,!^F,o,O,e,*<Return>,=?>,=<?,=*/
@@ -128,11 +128,14 @@ if exists("*GetPhpIndent")
endif
+let s:PHP_validVariable = '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*'
let s:notPhpHereDoc = '\%(break\|return\|continue\|exit\|die\|else\)'
let s:blockstart = '\%(\%(\%(}\s*\)\=else\%(\s\+\)\=\)\=if\>\|\%(}\s*\)\?else\>\|do\>\|while\>\|switch\>\|case\>\|default\>\|for\%(each\)\=\>\|declare\>\|class\>\|trait\>\|use\>\|interface\>\|abstract\>\|final\>\|try\>\|\%(}\s*\)\=catch\>\|\%(}\s*\)\=finally\>\)'
-let s:functionDecl = '\<function\>\%(\s\+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*\)\=\s*(.*'
+let s:functionDecl = '\<function\>\%(\s\+'.s:PHP_validVariable.'\)\=\s*(.*'
let s:endline= '\s*\%(//.*\|#.*\|/\*.*\*/\s*\)\=$'
-let s:terminated = '\%(\%(;\%(\s*\%(?>\|}\)\)\=\|<<<''\=\a\w*''\=$\|^\s*}\)'.s:endline.'\)\|^[^''"`]*[''"`]$'
+
+
+let s:terminated = '\%(\%(;\%(\s*\%(?>\|}\)\)\=\|<<<''\=\a\w*''\=$\|^\s*}\|^\s*'.s:PHP_validVariable.':\)'.s:endline.'\)\|^[^''"`]*[''"`]$'
let s:PHP_startindenttag = '<?\%(.*?>\)\@!\|<script[^>]*>\%(.*<\/script>\)\@!'
@@ -140,7 +143,7 @@ let s:PHP_startindenttag = '<?\%(.*?>\)\@!\|<script[^>]*>\%(.*<\/script>\)\@!'
let s:escapeDebugStops = 0
function! DebugPrintReturn(scriptLine)
- if ! s:escapeDebugStops
+ if ! s:escapeDebugStops
echo "debug:" . a:scriptLine
let c = getchar()
if c == "\<Del>"
@@ -158,8 +161,6 @@ function! GetLastRealCodeLNum(startline) " {{{
let lnum = b:GetLastRealCodeLNum_ADD
endif
- let old_lnum = lnum
-
while lnum > 1
let lnum = prevnonblank(lnum)
let lastline = getline(lnum)
@@ -217,7 +218,7 @@ function! GetLastRealCodeLNum(startline) " {{{
let lnum=0
endif
- if b:InPHPcode_and_script && !b:InPHPcode
+ if b:InPHPcode_and_script && 1 > b:InPHPcode
let b:InPHPcode_and_script = 0
endif
@@ -237,7 +238,7 @@ endfun
function! Skippmatch() " {{{
let synname = synIDattr(synID(line("."), col("."), 0), "name")
- if synname == "Delimiter" || synname == "phpRegionDelimiter" || synname =~# "^phpParent" || synname == "phpArrayParens" || synname =~# '^php\%(Block\|Brace\)' || synname == "javaScriptBraces" || synname =~# "^phpComment" && b:UserIsTypingComment
+ if synname == "Delimiter" || synname == "phpRegionDelimiter" || synname =~# "^phpParent" || synname == "phpArrayParens" || synname =~# '^php\%(Block\|Brace\)' || synname == "javaScriptBraces" || synname =~# '^php\%(Doc\)\?Comment' && b:UserIsTypingComment
return 0
else
return 1
@@ -249,7 +250,7 @@ function! FindOpenBracket(lnum, blockStarter) " {{{
let line = searchpair('{', '', '}', 'bW', 'Skippmatch()')
if a:blockStarter == 1
- while line > 1
+ while line > 1
let linec = getline(line)
if linec =~ s:terminated || linec =~ '^\s*\%(' . s:blockstart . '\)\|'. s:functionDecl . s:endline
@@ -310,7 +311,6 @@ let s:defaultORcase = '^\s*\%(default\|case\).*:'
function! FindTheSwitchIndent (lnum) " {{{
-
let test = GetLastRealCodeLNum(a:lnum - 1)
if test <= 1
@@ -353,7 +353,7 @@ function! IslinePHP (lnum, tofind) " {{{
if synname == 'phpStringSingle' || synname == 'phpStringDouble' || synname == 'phpBacktick'
if cline !~ '^\s*[''"`]'
- return ""
+ return "SpecStringEntrails"
else
return synname
end
@@ -372,7 +372,7 @@ if ! s:autoresetoptions
endif
function! ResetPhpOptions()
- if ! b:optionsset && &filetype == "php"
+ if ! b:optionsset && &filetype =~ "php"
if b:PHP_autoformatcomment
setlocal comments=s1:/*,mb:*,ex:*/,://,:#
@@ -418,7 +418,7 @@ function! GetPhpIndent()
let b:PHP_indentinghuge = 0
let b:PHP_CurrentIndentLevel = b:PHP_default_indenting
endif
- let b:PHP_lastindented = v:lnum
+ let real_PHP_lastindented = v:lnum
let b:PHP_LastIndentedWasComment=0
let b:PHP_InsideMultilineComment=0
let b:PHP_indentbeforelast = 0
@@ -430,9 +430,12 @@ function! GetPhpIndent()
elseif v:lnum > b:PHP_lastindented
let real_PHP_lastindented = b:PHP_lastindented
- let b:PHP_lastindented = v:lnum
+ else
+ let real_PHP_lastindented = v:lnum
endif
+ let b:PHP_lastindented = v:lnum
+
if !b:InPHPcode_checked " {{{ One time check
let b:InPHPcode_checked = 1
@@ -443,11 +446,15 @@ function! GetPhpIndent()
endif
if synname!=""
- if synname != "phpHereDoc" && synname != "phpHereDocDelimiter"
+ if synname == "SpecStringEntrails"
+ let b:InPHPcode = -1 " thumb down
+ let b:UserIsTypingComment = 0
+ let b:InPHPcode_tofind = ""
+ elseif synname != "phpHereDoc" && synname != "phpHereDocDelimiter"
let b:InPHPcode = 1
let b:InPHPcode_tofind = ""
- if synname =~# "^phpComment"
+ if synname =~# '^php\%(Doc\)\?Comment'
let b:UserIsTypingComment = 1
else
let b:UserIsTypingComment = 0
@@ -483,9 +490,16 @@ function! GetPhpIndent()
if b:InPHPcode_tofind!=""
if cline =~? b:InPHPcode_tofind
- let b:InPHPcode = 1
let b:InPHPcode_tofind = ""
let b:UserIsTypingComment = 0
+
+ if b:InPHPcode == -1
+ let b:InPHPcode = 1
+ return -1
+ end
+
+ let b:InPHPcode = 1
+
if cline =~ '\*/'
call cursor(v:lnum, 1)
if cline !~ '^\*/'
@@ -510,7 +524,7 @@ function! GetPhpIndent()
endif
endif
- if b:InPHPcode
+ if 1 == b:InPHPcode
if !b:InPHPcode_and_script && last_line =~ '\%(<?.*\)\@<!?>\%(.*<?\)\@!' && IslinePHP(lnum, '?>')=~"Delimiter"
if cline !~? s:PHP_startindenttag
@@ -520,8 +534,8 @@ function! GetPhpIndent()
let b:InPHPcode_and_script = 1
endif
- elseif last_line =~ '^[^''"`]\+[''"`]$' " a string identifier with nothing after it and no other string identifier before
- let b:InPHPcode = 0
+ elseif last_line =~ '^[^''"`]\+[''"`]$'
+ let b:InPHPcode = -1
let b:InPHPcode_tofind = substitute( last_line, '^.*\([''"`]\).*$', '^[^\1]*\1[;,]$', '')
elseif last_line =~? '<<<''\=\a\w*''\=$'
let b:InPHPcode = 0
@@ -538,7 +552,7 @@ function! GetPhpIndent()
endif " }}}
- if !b:InPHPcode && !b:InPHPcode_and_script
+ if 1 > b:InPHPcode && !b:InPHPcode_and_script
return -1
endif
@@ -568,7 +582,7 @@ function! GetPhpIndent()
endif
endif
- if !b:PHP_InsideMultilineComment && cline =~ '^\s*/\*' && cline !~ '\*/\s*$'
+ if !b:PHP_InsideMultilineComment && cline =~ '^\s*/\*\%(.*\*/\)\@!'
if getline(v:lnum + 1) !~ '^\s*\*'
return -1
endif
@@ -669,17 +683,17 @@ function! GetPhpIndent()
endwhile
elseif last_line =~# unstated && cline !~ '^\s*);\='.endline
- let ind = ind + &sw " we indent one level further when the preceding line is not stated
+ let ind = ind + &sw
return ind + addSpecial
- elseif (ind != b:PHP_default_indenting || last_line =~ '^[)\]]' ) && last_line =~ terminated " Added || last_line =~ '^)' on 2007-12-30 (array indenting problem broke other things)
+ elseif (ind != b:PHP_default_indenting || last_line =~ '^[)\]]' ) && last_line =~ terminated
let previous_line = last_line
let last_line_num = lnum
let LastLineClosed = 1
let isSingleLineBlock = 0
while 1
- if ! isSingleLineBlock && previous_line =~ '^\s*}\|;\s*}'.endline " XXX
+ if ! isSingleLineBlock && previous_line =~ '^\s*}\|;\s*}'.endline
call cursor(last_line_num, 1)
if previous_line !~ '^}'
@@ -740,14 +754,19 @@ function! GetPhpIndent()
endif
endif
- let plinnum = GetLastRealCodeLNum(lnum - 1)
+ if (last_line !~ '^\s*}\%(}}\)\@!')
+ let plinnum = GetLastRealCodeLNum(lnum - 1)
+ else
+ let plinnum = GetLastRealCodeLNum(FindOpenBracket(lnum, 1) - 1)
+ endif
+
let AntepenultimateLine = getline(plinnum)
let last_line = substitute(last_line,"\\(//\\|#\\)\\(\\(\\([^\"']*\\([\"']\\)[^\"']*\\5\\)\\+[^\"']*$\\)\\|\\([^\"']*$\\)\\)",'','')
if ind == b:PHP_default_indenting
- if last_line =~ terminated
+ if last_line =~ terminated && last_line !~# s:defaultORcase
let LastLineClosed = 1
endif
endif
@@ -755,10 +774,10 @@ function! GetPhpIndent()
if !LastLineClosed
- if last_line =~# '[{(\[]'.endline || last_line =~? '\h\w*\s*(.*,$' && AntepenultimateLine !~ '[,(]'.endline
+ if last_line =~# '[{(\[]'.endline || last_line =~? '\h\w*\s*(.*,$' && AntepenultimateLine !~ '[,(\[]'.endline
let dontIndent = 0
- if last_line =~ '\S\+\s*{'.endline && last_line !~ '^\s*\%(' . s:blockstart . '\)\|'. s:functionDecl . s:endline
+ if last_line =~ '\S\+\s*{'.endline && last_line !~ '^\s*)\s*{'.endline && last_line !~ '^\s*\%(' . s:blockstart . '\)\|'. s:functionDecl . s:endline
let dontIndent = 1
endif
@@ -774,7 +793,7 @@ function! GetPhpIndent()
elseif last_line =~ '\S\+\s*),'.endline
call cursor(lnum, 1)
- call search('),'.endline, 'W') " line never begins with ) so no need for 'c' flag
+ call search('),'.endline, 'W')
let openedparent = searchpair('(', '', ')', 'bW', 'Skippmatch()')
if openedparent != lnum
let ind = indent(openedparent)
@@ -784,7 +803,7 @@ function! GetPhpIndent()
let ind = ind + &sw
- elseif AntepenultimateLine =~ '\%(;\%(\s*\%(?>\|}\)\)\=\|<<<''\=\a\w*''\=$\|^\s*}\|{\)'.endline . '\|' . s:defaultORcase
+ elseif AntepenultimateLine =~ '{'.endline || AntepenultimateLine =~ terminated || AntepenultimateLine =~# s:defaultORcase
let ind = ind + &sw
endif
diff --git a/runtime/indent/sh.vim b/runtime/indent/sh.vim
index 68f764ee6..0394ee22e 100644
--- a/runtime/indent/sh.vim
+++ b/runtime/indent/sh.vim
@@ -2,7 +2,7 @@
" Language: Shell Script
" Maintainer: Peter Aronoff <telemachus@arpinum.org>
" Original Author: Nikolai Weibull <now@bitwi.se>
-" Latest Revision: 2013-11-28
+" Latest Revision: 2014-08-22
if exists("b:did_indent")
finish
@@ -91,7 +91,9 @@ function! GetShIndent()
if s:is_case(pine)
let ind = indent(lnum) + s:indent_value('case-labels')
else
- let ind -= s:indent_value('case-statements') - s:indent_value('case-breaks')
+ let ind -= (s:is_case_label(pine, lnum) && s:is_case_ended(pine) ?
+ \ 0 : s:indent_value('case-statements')) -
+ \ s:indent_value('case-breaks')
endif
elseif s:is_case_break(line)
let ind -= s:indent_value('case-breaks')
diff --git a/runtime/indent/vim.vim b/runtime/indent/vim.vim
index 8c215733b..7511325af 100644
--- a/runtime/indent/vim.vim
+++ b/runtime/indent/vim.vim
@@ -1,7 +1,7 @@
" Vim indent file
" Language: Vim script
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2012 Aug 02
+" Last Change: 2014 Dec 12
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
@@ -37,7 +37,8 @@ function GetVimIndentIntern()
" If the current line doesn't start with '\' and below a line that starts
" with '\', use the indent of the line above it.
- if getline(v:lnum) !~ '^\s*\\'
+ let cur_text = getline(v:lnum)
+ if cur_text !~ '^\s*\\'
while lnum > 0 && getline(lnum) =~ '^\s*\\'
let lnum = lnum - 1
endwhile
@@ -47,27 +48,30 @@ function GetVimIndentIntern()
if lnum == 0
return 0
endif
+ let prev_text = getline(lnum)
" Add a 'shiftwidth' after :if, :while, :try, :catch, :finally, :function
" and :else. Add it three times for a line that starts with '\' after
" a line that doesn't (or g:vim_indent_cont if it exists).
let ind = indent(lnum)
- if getline(v:lnum) =~ '^\s*\\' && v:lnum > 1 && getline(lnum) !~ '^\s*\\'
+ if cur_text =~ '^\s*\\' && v:lnum > 1 && prev_text !~ '^\s*\\'
if exists("g:vim_indent_cont")
let ind = ind + g:vim_indent_cont
else
let ind = ind + &sw * 3
endif
- elseif getline(lnum) =~ '^\s*aug\%[roup]' && getline(lnum) !~ '^\s*aug\%[roup]\s*!\=\s\+END'
+ elseif prev_text =~ '^\s*aug\%[roup]' && prev_text !~ '^\s*aug\%[roup]\s*!\=\s\+END'
let ind = ind + &sw
else
- let line = getline(lnum)
- let i = match(line, '\(^\||\)\s*\(if\|wh\%[ile]\|for\|try\|cat\%[ch]\|fina\%[lly]\|fu\%[nction]\|el\%[seif]\)\>')
- if i >= 0
- let ind += &sw
- if strpart(line, i, 1) == '|' && has('syntax_items')
- \ && synIDattr(synID(lnum, i, 1), "name") =~ '\(Comment\|String\)$'
- let ind -= &sw
+ " A line starting with :au does not increment/decrement indent.
+ if prev_text !~ '^\s*au\%[tocmd]'
+ let i = match(prev_text, '\(^\||\)\s*\(if\|wh\%[ile]\|for\|try\|cat\%[ch]\|fina\%[lly]\|fu\%[nction]\|el\%[seif]\)\>')
+ if i >= 0
+ let ind += &sw
+ if strpart(prev_text, i, 1) == '|' && has('syntax_items')
+ \ && synIDattr(synID(lnum, i, 1), "name") =~ '\(Comment\|String\)$'
+ let ind -= &sw
+ endif
endif
endif
endif
@@ -75,9 +79,8 @@ function GetVimIndentIntern()
" If the previous line contains an "end" after a pipe, but not in an ":au"
" command. And not when there is a backslash before the pipe.
" And when syntax HL is enabled avoid a match inside a string.
- let line = getline(lnum)
- let i = match(line, '[^\\]|\s*\(ene\@!\)')
- if i > 0 && line !~ '^\s*au\%[tocmd]'
+ let i = match(prev_text, '[^\\]|\s*\(ene\@!\)')
+ if i > 0 && prev_text !~ '^\s*au\%[tocmd]'
if !has('syntax_items') || synIDattr(synID(lnum, i + 2, 1), "name") !~ '\(Comment\|String\)$'
let ind = ind - &sw
endif
@@ -86,7 +89,7 @@ function GetVimIndentIntern()
" Subtract a 'shiftwidth' on a :endif, :endwhile, :catch, :finally, :endtry,
" :endfun, :else and :augroup END.
- if getline(v:lnum) =~ '^\s*\(ene\@!\|cat\|fina\|el\|aug\%[roup]\s*!\=\s\+END\)'
+ if cur_text =~ '^\s*\(ene\@!\|cat\|fina\|el\|aug\%[roup]\s*!\=\s\+[eE][nN][dD]\)'
let ind = ind - &sw
endif
diff --git a/runtime/indent/vroom.vim b/runtime/indent/vroom.vim
new file mode 100644
index 000000000..d333e2c14
--- /dev/null
+++ b/runtime/indent/vroom.vim
@@ -0,0 +1,21 @@
+" Vim indent file
+" Language: Vroom (vim testing and executable documentation)
+" Maintainer: David Barnett (https://github.com/google/vim-ft-vroom)
+" Last Change: 2014 Jul 23
+
+if exists('b:did_indent')
+ finish
+endif
+let b:did_indent = 1
+
+let s:cpo_save = &cpo
+set cpo-=C
+
+
+let b:undo_indent = 'setlocal autoindent<'
+
+setlocal autoindent
+
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/lang/menu_chinese_gb.936.vim b/runtime/lang/menu_chinese_gb.936.vim
index e636a4231..b3276b536 100644
--- a/runtime/lang/menu_chinese_gb.936.vim
+++ b/runtime/lang/menu_chinese_gb.936.vim
@@ -1,6 +1,7 @@
-" Menu Translations: Simplified Chinese <i18n-translation@lists.linux.net.cn>
-" Translated By: Yuheng Xie <elephant@linux.net.cn>
-" Last Change: Tue Apr 18 22:00:00 2006
+" Menu Translations: Simplified Chinese
+" Maintainer: Shun Bai <baishunde@gmail.com>
+" Previous Maintainer: Yuheng Xie <elephant@linux.net.cn>
+" Last Change: 2014 Oct 15
" vim: ts=8 sw=8 noet
@@ -90,13 +91,14 @@ menutrans Toggle\ &Right\ Scrollbar /Ҷ˹(&R)
menutrans F&ile\ Settings ļ趨(&I)
" Boolean options
-menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! /ʾк(&N)<Tab>:set\ nu!
-menutrans Toggle\ &List\ Mode<Tab>:set\ list! /\ list\ ģʽ(&L)<Tab>:set\ list!
-menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! /(&W)<Tab>:set\ wrap!
-menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! /(&R)<Tab>:set\ lbr!
-menutrans Toggle\ &expand-tab<Tab>:set\ et! /չ\ tab(&E)<Tab>:set\ et!
-menutrans Toggle\ &auto-indent<Tab>:set\ ai! /Զ(&A)<Tab>:set\ ai!
-menutrans Toggle\ &C-indenting<Tab>:set\ cin! /\ C\ (&C)<Tab>:set\ cin!
+menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! /ʾк(&N)<Tab>:set\ nu!
+menutrans Toggle\ relati&ve\ Line\ Numbering<Tab>:set\ rnu! /к(&V)<Tab>:set\ rnu!
+menutrans Toggle\ &List\ Mode<Tab>:set\ list! /\ list\ ģʽ(&L)<Tab>:set\ list!
+menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! /(&W)<Tab>:set\ wrap!
+menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! /(&R)<Tab>:set\ lbr!
+menutrans Toggle\ &expand-tab<Tab>:set\ et! /չ\ tab(&E)<Tab>:set\ et!
+menutrans Toggle\ &auto-indent<Tab>:set\ ai! /Զ(&A)<Tab>:set\ ai!
+menutrans Toggle\ &C-indenting<Tab>:set\ cin! /\ C\ (&C)<Tab>:set\ cin!
" other options
menutrans &Shiftwidth (&S)
diff --git a/runtime/lang/menu_zh_cn.gb2312.vim b/runtime/lang/menu_zh_cn.gb2312.vim
index a12d94daf..0df51885f 100644
--- a/runtime/lang/menu_zh_cn.gb2312.vim
+++ b/runtime/lang/menu_zh_cn.gb2312.vim
@@ -1,6 +1,7 @@
-" Menu Translations: Simplified Chinese <i18n-translation@lists.linux.net.cn>
-" Translated By: Yuheng Xie <elephant@linux.net.cn>
-" Last Change: Tue Apr 18 22:00:00 2006
+" Menu Translations: Simplified Chinese
+" Maintainer: Shun Bai <baishunde@gmail.com>
+" Previous Maintainer: Yuheng Xie <elephant@linux.net.cn>
+" Last Change: 2014 Oct 15
" vim: ts=8 sw=8 noet
@@ -94,6 +95,7 @@ menutrans F&ile\ Settings ļ趨(&I)
" Boolean options
menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! /ʾк(&N)<Tab>:set\ nu!
+menutrans Toggle\ relati&ve\ Line\ Numbering<Tab>:set\ rnu! /к(&V)<Tab>:set\ rnu!
menutrans Toggle\ &List\ Mode<Tab>:set\ list! /\ list\ ģʽ(&L)<Tab>:set\ list!
menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! /(&W)<Tab>:set\ wrap!
menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! /(&R)<Tab>:set\ lbr!
diff --git a/runtime/lang/menu_zh_cn.utf-8.vim b/runtime/lang/menu_zh_cn.utf-8.vim
index 956363d29..cb1288f63 100644
--- a/runtime/lang/menu_zh_cn.utf-8.vim
+++ b/runtime/lang/menu_zh_cn.utf-8.vim
@@ -1,6 +1,7 @@
-" Menu Translations: Simplified Chinese <i18n-translation@lists.linux.net.cn>
-" Translated By: Yuheng Xie <elephant@linux.net.cn>
-" Last Change: Tue Apr 18 22:00:00 2006
+" Menu Translations: Simplified Chinese
+" Maintainer: Shun Bai <baishunde@gmail.com>
+" Previous Maintainer: Yuheng Xie <elephant@linux.net.cn>
+" Last Change: 2014 Oct 15
" vim: ts=8 sw=8 noet
@@ -91,6 +92,7 @@ menutrans F&ile\ Settings 文件设定(&I)
" Boolean options
menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! 开/关显示行号(&N)<Tab>:set\ nu!
+menutrans Toggle\ relati&ve\ Line\ Numbering<Tab>:set\ rnu! 开/关相对行号(&V)<Tab>:set\ rnu!
menutrans Toggle\ &List\ Mode<Tab>:set\ list! 开/关\ list\ 模式(&L)<Tab>:set\ list!
menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! 开/关折行(&W)<Tab>:set\ wrap!
menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! 开/关整词折行(&R)<Tab>:set\ lbr!
diff --git a/runtime/macros/editexisting.vim b/runtime/macros/editexisting.vim
index c18f22569..3530e29dc 100644
--- a/runtime/macros/editexisting.vim
+++ b/runtime/macros/editexisting.vim
@@ -1,6 +1,6 @@
" Vim Plugin: Edit the file with an existing Vim if possible
" Maintainer: Bram Moolenaar
-" Last Change: 2013 Feb 24
+" Last Change: 2014 Dec 06
" This is a plugin, drop it in your (Unix) ~/.vim/plugin or (Win32)
" $VIM/vimfiles/plugin directory. Or make a symbolic link, so that you
@@ -112,7 +112,7 @@ func! EditExisting(fname, command)
endif
if a:command != ''
- exe "normal " . a:command
+ exe "normal! " . a:command
endif
redraw
diff --git a/runtime/optwin.vim b/runtime/optwin.vim
index 0c92f1a79..55353ce66 100644
--- a/runtime/optwin.vim
+++ b/runtime/optwin.vim
@@ -1,7 +1,7 @@
" These commands create the option window.
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2014 Apr 01
+" Last Change: 2014 Nov 19
" If there already is an option window, jump to that one.
if bufwinnr("option-window") > 0
@@ -149,7 +149,7 @@ setlocal ts=15 tw=0 noro buftype=nofile
call append(0, '" Each "set" line shows the current value of an option (on the left).')
call append(1, '" Hit <CR> on a "set" line to execute it.')
call append(2, '" A boolean option will be toggled.')
-call append(3, '" For other options you can edit the value.')
+call append(3, '" For other options you can edit the value before hitting <CR>.')
call append(4, '" Hit <CR> on a help line to open a help window on this option.')
call append(5, '" Hit <CR> on an index line to jump there.')
call append(6, '" Hit <Space> on a "set" line to refresh it.')
@@ -606,6 +606,10 @@ if has("gui")
call append("$", "guiheadroom\troom (in pixels) left above/below the window")
call append("$", " \tset ghr=" . &ghr)
endif
+ if has("directx")
+ call append("$", "renderoptions\toptions for text rendering")
+ call <SID>OptionG("rop", &rop)
+ endif
call append("$", "guipty\tuse a pseudo-tty for I/O to external commands")
call <SID>BinOptionG("guipty", &guipty)
if has("browse")
@@ -724,6 +728,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("$", "undoreload\tmaximum number lines to save for undo on a buffer reload")
call append("$", " \tset ur=" . &ur)
@@ -973,6 +978,7 @@ call <SID>BinOptionG("bk", &bk)
call append("$", "backupskip\tpatterns that specify for which files a backup is not made")
call append("$", " \tset bsk=" . &bsk)
call append("$", "backupcopy\twhether to make the backup as a copy or rename the existing file")
+call append("$", "\t(global or local to buffer)")
call append("$", " \tset bkc=" . &bkc)
call append("$", "backupdir\tlist of directories to put backup files in")
call <SID>OptionG("bdir", &bdir)
@@ -1188,8 +1194,10 @@ if has("keymap")
call <SID>OptionL("kmp")
endif
if has("langmap")
- call append("$", "langmap\ttranslate characters for Normal mode")
+ call append("$", "langmap\tlist of characters that are translated in Normal mode")
call <SID>OptionG("lmap", &lmap)
+ call append("$", "langnoremap\tdon't apply 'langmap' to mapped characters")
+ call <SID>BinOptionG("lnr", &lnr)
endif
if has("xim")
call append("$", "imdisable\twhen set never use IM; overrules following IM options")
diff --git a/runtime/plugin/matchparen.vim b/runtime/plugin/matchparen.vim
index 23c79382f..3804ab949 100644
--- a/runtime/plugin/matchparen.vim
+++ b/runtime/plugin/matchparen.vim
@@ -1,6 +1,6 @@
" Vim plugin for showing matching parens
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2014 Jul 09
+" Last Change: 2014 Jul 19
" Exit quickly when:
" - this plugin was already loaded (or disabled)
@@ -88,14 +88,27 @@ function! s:Highlight_Matching_Pair()
" Find the match. When it was just before the cursor move it there for a
" moment.
if before > 0
- let save_cursor = getcurpos()
+ let has_getcurpos = exists("*getcurpos")
+ if has_getcurpos
+ " getcurpos() is more efficient but doesn't exist before 7.4.313.
+ let save_cursor = getcurpos()
+ else
+ let save_cursor = winsaveview()
+ endif
call cursor(c_lnum, c_col - before)
endif
- " When not in a string or comment ignore matches inside them.
+ " Build an expression that detects whether the current cursor position is in
+ " certain syntax types (string, comment, etc.), for use as searchpairpos()'s
+ " skip argument.
" We match "escape" for special items, such as lispEscapeSpecial.
- let s_skip ='synIDattr(synID(line("."), col("."), 0), "name") ' .
- \ '=~? "string\\|character\\|singlequote\\|escape\\|comment"'
+ let s_skip = '!empty(filter(map(synstack(line("."), col(".")), ''synIDattr(v:val, "name")''), ' .
+ \ '''v:val =~? "string\\|character\\|singlequote\\|escape\\|comment"''))'
+ " If executing the expression determines that the cursor is currently in
+ " one of the syntax types, then we want searchpairpos() to find the pair
+ " within those syntax types (i.e., not skip). Otherwise, the cursor is
+ " outside of the syntax types and s_skip should keep its value so we skip any
+ " matching pair inside the syntax types.
execute 'if' s_skip '| let s_skip = 0 | endif'
" Limit the search to lines visible in the window.
@@ -148,7 +161,11 @@ function! s:Highlight_Matching_Pair()
endtry
if before > 0
- call setpos('.', save_cursor)
+ if has_getcurpos
+ call setpos('.', save_cursor)
+ else
+ call winrestview(save_cursor)
+ endif
endif
" If a match is found setup match highlighting.
diff --git a/runtime/plugin/netrwPlugin.vim b/runtime/plugin/netrwPlugin.vim
index e3e79ddea..cad4d31a0 100644
--- a/runtime/plugin/netrwPlugin.vim
+++ b/runtime/plugin/netrwPlugin.vim
@@ -1,6 +1,6 @@
" netrwPlugin.vim: Handles file transfer and remote directory listing across a network
" PLUGIN SECTION
-" Date: Jan 22, 2014
+" Date: Nov 07, 2014
" Maintainer: Charles E Campbell <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
" Copyright: Copyright (C) 1999-2013 Charles E. Campbell {{{1
@@ -20,7 +20,7 @@
if &cp || exists("g:loaded_netrwPlugin")
finish
endif
-let g:loaded_netrwPlugin = "v152"
+let g:loaded_netrwPlugin = "v153"
if v:version < 702
echohl WarningMsg
echo "***warning*** you need vim version 7.2 for this version of netrw"
@@ -54,15 +54,15 @@ augroup END
" Network Browsing Reading Writing: {{{2
augroup Network
au!
- au BufReadCmd file://* call netrw#FileUrlRead(expand("<amatch>"))
- au BufReadCmd ftp://*,rcp://*,scp://*,http://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau BufReadPre ".fnameescape(expand("<amatch>"))|call netrw#Nread(2,expand("<amatch>"))|exe "sil doau BufReadPost ".fnameescape(expand("<amatch>"))
- au FileReadCmd ftp://*,rcp://*,scp://*,http://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau FileReadPre ".fnameescape(expand("<amatch>"))|call netrw#Nread(1,expand("<amatch>"))|exe "sil doau FileReadPost ".fnameescape(expand("<amatch>"))
- au BufWriteCmd ftp://*,rcp://*,scp://*,http://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau BufWritePre ".fnameescape(expand("<amatch>"))|exe 'Nwrite '.fnameescape(expand("<amatch>"))|exe "sil doau BufWritePost ".fnameescape(expand("<amatch>"))
- au FileWriteCmd ftp://*,rcp://*,scp://*,http://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau FileWritePre ".fnameescape(expand("<amatch>"))|exe "'[,']".'Nwrite '.fnameescape(expand("<amatch>"))|exe "sil doau FileWritePost ".fnameescape(expand("<amatch>"))
- try
- au SourceCmd ftp://*,rcp://*,scp://*,http://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe 'Nsource '.fnameescape(expand("<amatch>"))
- catch /^Vim\%((\a\+)\)\=:E216/
- au SourcePre ftp://*,rcp://*,scp://*,http://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe 'Nsource '.fnameescape(expand("<amatch>"))
+ au BufReadCmd file://* call netrw#FileUrlRead(expand("<amatch>"))
+ au BufReadCmd ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau BufReadPre ".fnameescape(expand("<amatch>"))|call netrw#Nread(2,expand("<amatch>"))|exe "sil doau BufReadPost ".fnameescape(expand("<amatch>"))
+ au FileReadCmd ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau FileReadPre ".fnameescape(expand("<amatch>"))|call netrw#Nread(1,expand("<amatch>"))|exe "sil doau FileReadPost ".fnameescape(expand("<amatch>"))
+ au BufWriteCmd ftp://*,rcp://*,scp://*,http://*,file://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau BufWritePre ".fnameescape(expand("<amatch>"))|exe 'Nwrite '.fnameescape(expand("<amatch>"))|exe "sil doau BufWritePost ".fnameescape(expand("<amatch>"))
+ au FileWriteCmd ftp://*,rcp://*,scp://*,http://*,file://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau FileWritePre ".fnameescape(expand("<amatch>"))|exe "'[,']".'Nwrite '.fnameescape(expand("<amatch>"))|exe "sil doau FileWritePost ".fnameescape(expand("<amatch>"))
+ try
+ au SourceCmd ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe 'Nsource '.fnameescape(expand("<amatch>"))
+ catch /^Vim\%((\a\+)\)\=:E216/
+ au SourcePre ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe 'Nsource '.fnameescape(expand("<amatch>"))
endtry
augroup END
@@ -81,18 +81,26 @@ com! -nargs=* -bar -bang -count=0 -complete=dir Vexplore call netrw#Explore(<cou
com! -nargs=* -bar -count=0 -complete=dir Texplore call netrw#Explore(<count>,0,6 ,<q-args>)
com! -nargs=* -bar -bang Nexplore call netrw#Explore(-1,0,0,<q-args>)
com! -nargs=* -bar -bang Pexplore call netrw#Explore(-2,0,0,<q-args>)
-com! -nargs=* -bar -complete=dir Lexplore call netrw#Lexplore(<q-args>)
+com! -nargs=* -bar -bang -count=0 -complete=dir Lexplore call netrw#Lexplore(<count>,<bang>0,<q-args>)
" Commands: NetrwSettings {{{2
com! -nargs=0 NetrwSettings call netrwSettings#NetrwSettings()
com! -bang NetrwClean call netrw#Clean(<bang>0)
" Maps:
-if !exists("g:netrw_nogx") && maparg('gx','n') == ""
- if !hasmapto('<Plug>NetrwBrowseX')
- nmap <unique> gx <Plug>NetrwBrowseX
+if !exists("g:netrw_nogx")
+ if maparg('gx','n') == ""
+ if !hasmapto('<Plug>NetrwBrowseX')
+ nmap <unique> gx <Plug>NetrwBrowseX
+ endif
+ nno <silent> <Plug>NetrwBrowseX :call netrw#BrowseX(expand((exists("g:netrw_gx")? g:netrw_gx : '<cfile>')),netrw#CheckIfRemote())<cr>
+ endif
+ if maparg('gx','v') == ""
+ if !hasmapto('<Plug>NetrwBrowseXVis')
+ vmap <unique> gx <Plug>NetrwBrowseXVis
+ endif
+ vno <silent> <Plug>NetrwBrowseXVis :<c-u>call netrw#BrowseXVis()<cr>
endif
- nno <silent> <Plug>NetrwBrowseX :call netrw#NetrwBrowseX(expand("<cfile>"),0)<cr>
endif
" ---------------------------------------------------------------------
@@ -119,7 +127,7 @@ fun! s:LocalBrowse(dirname)
" call Decho("(LocalBrowse) dirname<".a:dirname."> (isdirectory, amiga)")
if a:dirname != '' && isdirectory(a:dirname)
sil! call netrw#LocalBrowseCheck(a:dirname)
- if exists("w:netrw_bannercnt")
+ if exists("w:netrw_bannercnt") && line('.') < w:netrw_bannercnt
exe w:netrw_bannercnt
endif
endif
@@ -128,7 +136,7 @@ fun! s:LocalBrowse(dirname)
" call Decho("(LocalBrowse) dirname<".a:dirname."> ft=".&ft." (isdirectory, not amiga)")
" call Dredir("LocalBrowse ft last set: ","verbose set ft")
sil! call netrw#LocalBrowseCheck(a:dirname)
- if exists("w:netrw_bannercnt")
+ if exists("w:netrw_bannercnt") && line('.') < w:netrw_bannercnt
exe w:netrw_bannercnt
endif
diff --git a/runtime/scripts.vim b/runtime/scripts.vim
index e48c133c6..0e7465638 100644
--- a/runtime/scripts.vim
+++ b/runtime/scripts.vim
@@ -1,7 +1,7 @@
" Vim support file to detect file types in scripts
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last change: 2013 May 24
+" Last change: 2014 Aug 24
" This file is called by an autocommand for every file that has just been
" loaded into a buffer. It checks if the type of file can be recognized by
@@ -319,6 +319,10 @@ else
elseif s:line1 =~ '^==\d\+== valgrind' || s:line3 =~ '^==\d\+== Using valgrind'
set ft=valgrind
+ " Go docs
+ elseif s:line1 =~ '^PACKAGE DOCUMENTATION$'
+ set ft=godoc
+
" Renderman Interface Bytestream
elseif s:line1 =~ '^##RenderMan'
set ft=rib
diff --git a/runtime/spell/ro/main.aap b/runtime/spell/ro/main.aap
index c07e2712c..8f2379dc3 100644
--- a/runtime/spell/ro/main.aap
+++ b/runtime/spell/ro/main.aap
@@ -9,35 +9,43 @@
SPELLDIR = ..
FILES = ro_RO.aff ro_RO.dic
-all: $SPELLDIR/ro.iso-8859-2.spl $SPELLDIR/ro.utf-8.spl \
- $SPELLDIR/ro.cp1250.spl ../README_ro.txt
-
-$SPELLDIR/ro.iso-8859-2.spl : $FILES
- :sys env LANG=ro_RO.ISO8859-2 $VIM -u NONE -e -c "mkspell! $SPELLDIR/ro ro_RO" -c q
+all: $SPELLDIR/ro.utf-8.spl \
+ $SPELLDIR/ro.iso-8859-2.spl \
+ $SPELLDIR/ro.cp1250.spl \
+ ../README_ro.txt
$SPELLDIR/ro.utf-8.spl : $FILES
- :sys env LANG=ro_RO.UTF-8 $VIM -u NONE -e -c "mkspell! $SPELLDIR/ro ro_RO" -c q
+ :sys env LANG=ro_RO.utf8 $VIM -u NONE -e -c "mkspell! $SPELLDIR/ro ro_RO" -c q
+# Note: this generates conversion errors, because not all characters can be
+# represented in iso-8859-2.
+$SPELLDIR/ro.iso-8859-2.spl : $FILES
+ :sys env LANG=ro_RO.iso88592 $VIM -u NONE -e -c "mkspell! $SPELLDIR/ro ro_RO" -c q
+
+# Note: this generates conversion errors, because not all characters can be
+# represented in cp1250.
$SPELLDIR/ro.cp1250.spl : $FILES
:sys $VIM -u NONE -e -c "set enc=cp1250" -c "mkspell! $SPELLDIR/ro ro_RO" -c q
-../README_ro.txt: README_ro_RO.txt
+../README_ro.txt: README
:copy $source $target
#
# Fetching the files from OpenOffice.org.
#
-OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
-:attr {fetch = $OODIR/%file%} ro_RO.zip
+#OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
+OODIR = http://sourceforge.net/projects/rospell/files/Romanian%20dictionaries/dict-3.3.10
+ZIPFILE = ro_RO.3.3.10.zip
+:attr {fetch = $OODIR/%file%} $ZIPFILE
# 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.
# This is a bit tricky, since the file name includes the date.
ro_RO.aff ro_RO.dic: {buildcheck=}
:assertpkg unzip patch
- :fetch ro_RO.zip
- :sys $UNZIP ro_RO.zip
- :delete ro_RO.zip
+ :fetch $ZIPFILE
+ :sys $UNZIP $ZIPFILE
+ :delete $ZIPFILE
@if not os.path.exists('ro_RO.orig.aff'):
:copy ro_RO.aff ro_RO.orig.aff
@if not os.path.exists('ro_RO.orig.dic'):
@@ -60,12 +68,12 @@ diff:
check:
:assertpkg unzip diff
- :fetch ro_RO.zip
+ :fetch $ZIPFILE
:mkdir tmp
:cd tmp
@try:
@import stat
- :sys $UNZIP ../ro_RO.zip
+ :sys $UNZIP ../$ZIPFILE
:sys {force} diff ../ro_RO.orig.aff ro_RO.aff >d
@if os.stat('d')[stat.ST_SIZE] > 0:
:copy ro_RO.aff ../ro_RO.new.aff
@@ -75,7 +83,19 @@ check:
@finally:
:cd ..
:delete {r}{f}{q} tmp
- :delete ro_RO.zip
-
+ :delete $ZIPFILE
+
+# Remove all the downloaded and generated files.
+clean:
+ :delete ro_RO.aff
+ :delete ro_RO.dic
+ :delete ro_RO.orig.aff
+ :delete ro_RO.orig.dic
+ :delete ro_RO-ante1993.aff
+ :delete ro_RO-ante1993.dic
+ :delete COPYING.GPL
+ :delete COPYING.LGPL
+ :delete COPYING.MPL
+ :delete README
# vim: set sts=4 sw=4 :
diff --git a/runtime/spell/ro/ro_RO.diff b/runtime/spell/ro/ro_RO.diff
index 5477030ab..2c1822872 100644
--- a/runtime/spell/ro/ro_RO.diff
+++ b/runtime/spell/ro/ro_RO.diff
@@ -1,42 +1,34 @@
-*** ro_RO.orig.aff Wed Aug 31 20:34:38 2005
---- ro_RO.aff Wed Aug 31 20:39:57 2005
+*** ro_RO.orig.aff 2014-08-29 16:29:21.162457824 +0200
+--- ro_RO.aff 2014-09-19 15:29:52.354413307 +0200
***************
-*** 3,4 ****
---- 3,8 ----
+*** 3,5 ****
+ TRY iaăâșțîertolncusmpdbgfzvhjxkwyqACDM
+! KEY qwertyuiop|asdfghjkl|zxcvbnm
-+ FOL
-+ LOW
-+ UPP
-+
- PFX E Y 1
-***************
-*** 12,15 ****
- SFX L 0 l u
-! SFX L 0 le [^cg] i
-! SFX L 0 i [cg] i
- SFX L 0 le e
---- 16,19 ----
- SFX L 0 l u
-! SFX L 0 le [^cg]i
-! SFX L 0 i [cg]i
- SFX L 0 le e
-***************
-*** 18,20 ****
- SFX U 0 a re
-! SFX U 0 i [^i] ii
-
---- 22,24 ----
- SFX U 0 a re
-! SFX U 0 i [^i]ii
+--- 3,9 ----
+ TRY iaăâșțîertolncusmpdbgfzvhjxkwyqACDM
+! # KEY qwertyuiop|asdfghjkl|zxcvbnm
+!
+! # ignore extra field (specifies type of word?)
+! IGNOREEXTRA
+!
***************
-*** 38,41 ****
- SFX I 0 ului [^ua]
-! SFX I a ii [gc] a
-! SFX I a ei [^cg] a
-
---- 42,45 ----
- SFX I 0 ului [^ua]
-! SFX I a ii [gc]a
-! SFX I a ei [^cg]a
-
+*** 1546,1553 ****
+ SFX q 0 ilor . adj. m. pl. dat.
+! SFX q 0 ă
+! SFX q 0 a
+! SFX q 0 ei
+! SFX q 0 e
+! SFX q 0 ele
+! SFX q 0 elor
+ PFX q Y 1
+--- 1550,1557 ----
+ SFX q 0 ilor . adj. m. pl. dat.
+! SFX q 0 ă .
+! SFX q 0 a .
+! SFX q 0 ei .
+! SFX q 0 e .
+! SFX q 0 ele .
+! SFX q 0 elor .
+ PFX q Y 1
diff --git a/runtime/synmenu.vim b/runtime/synmenu.vim
index be88f1c53..2db72a2b6 100644
--- a/runtime/synmenu.vim
+++ b/runtime/synmenu.vim
@@ -2,7 +2,7 @@
" This file is normally sourced from menu.vim.
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2013 Jun 24
+" Last Change: 2014 Aug 13
" Define the SetSyn function, used for the Syntax menu entries.
" Set 'filetype' and also 'syntax' if it is manually selected.
@@ -326,6 +326,7 @@ an 50.70.270 &Syntax.M.Messages\ (/var/log) :cal SetSyn("messages")<CR>
an 50.70.280 &Syntax.M.Metafont :cal SetSyn("mf")<CR>
an 50.70.290 &Syntax.M.MetaPost :cal SetSyn("mp")<CR>
an 50.70.300 &Syntax.M.MGL :cal SetSyn("mgl")<CR>
+an 50.70.305 &Syntax.M.MIX :cal SetSyn("mix")<CR>
an 50.70.310 &Syntax.M.MMIX :cal SetSyn("mmix")<CR>
an 50.70.320 &Syntax.M.Modconf :cal SetSyn("modconf")<CR>
an 50.70.330 &Syntax.M.Model :cal SetSyn("model")<CR>
diff --git a/runtime/syntax/amiga.vim b/runtime/syntax/amiga.vim
index e70f995f6..4ccab1950 100644
--- a/runtime/syntax/amiga.vim
+++ b/runtime/syntax/amiga.vim
@@ -1,9 +1,9 @@
" Vim syntax file
" Language: AmigaDos
-" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
-" Last Change: Sep 11, 2006
-" Version: 6
-" URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
+" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
+" Last Change: Oct 23, 2014
+" Version: 7
+" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_AMIGA
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
diff --git a/runtime/syntax/asciidoc.vim b/runtime/syntax/asciidoc.vim
index 1303db7cf..ccb079e06 100644
--- a/runtime/syntax/asciidoc.vim
+++ b/runtime/syntax/asciidoc.vim
@@ -5,6 +5,7 @@
" URL: http://asciidoc.org/
" Licence: GPL (http://www.gnu.org)
" Remarks: Vim 6 or greater
+" Last Update: 2014 Aug 29 (see Issue 240)
" Limitations:
"
" - Nested quoted text formatting is highlighted according to the outer
@@ -155,7 +156,8 @@ hi def link asciidocQuotedAttributeList Special
hi def link asciidocQuotedBold Special
hi def link asciidocQuotedDoubleQuoted Label
hi def link asciidocQuotedEmphasized2 Type
-hi def link asciidocQuotedEmphasized Type
+hi asciidocQuotedEmphasizedItalic term=italic cterm=italic gui=italic
+hi def link asciidocQuotedEmphasized asciidocQuotedEmphasizedItalic
hi def link asciidocQuotedMonospaced2 Identifier
hi def link asciidocQuotedMonospaced Identifier
hi def link asciidocQuotedSingleQuoted Label
diff --git a/runtime/syntax/c.vim b/runtime/syntax/c.vim
index d99154048..128e1a2a4 100644
--- a/runtime/syntax/c.vim
+++ b/runtime/syntax/c.vim
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: C
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2014 May 26
+" Last Change: 2014 Nov 13
" Quit when a (custom) syntax file was already loaded
if exists("b:current_syntax")
@@ -35,28 +35,36 @@ syn match cSpecial display contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)"
if !exists("c_no_utf")
syn match cSpecial display contained "\\\(u\x\{4}\|U\x\{8}\)"
endif
-if exists("c_no_cformat")
- syn region cString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,@Spell extend
- " cCppString: same as cString, but ends at end of line
- if !exists("cpp_no_cpp11") " ISO C++11
- syn region cCppString start=+\(L\|u\|u8\|U\|R\|LR\|u8R\|uR\|UR\)\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell
- else
- syn region cCppString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell
- endif
- syn region cCppOut2 contained start="0" end="^\s*\(%:\|#\)\s*\(endif\>\|else\>\|elif\>\)" contains=cSpaceError,cCppSkip
- syn region cCppSkip contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppSkip
-else
+
+if !exists("c_no_cformat")
+ " Highlight % items in strings.
if !exists("c_no_c99") " ISO C99
syn match cFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlLjzt]\|ll\|hh\)\=\([aAbdiuoxXDOUfFeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
else
syn match cFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlL]\|ll\)\=\([bdiuoxXDOUfeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
endif
syn match cFormat display "%%" contained
+endif
+
+" cCppString: same as cString, but ends at end of line
+if s:ft ==# "cpp" && !exists("cpp_no_cpp11")
+ " ISO C++11
+ syn region cString start=+\(L\|u\|u8\|U\|R\|LR\|u8R\|uR\|UR\)\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell extend
+ syn region cCppString start=+\(L\|u\|u8\|U\|R\|LR\|u8R\|uR\|UR\)\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell
+elseif s:ft ==# "c" && !exists("c_no_c11")
+ " ISO C99
+ syn region cString start=+\%(L\|U\|u8\)\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell extend
+ syn region cCppString start=+\%(L\|U\|u8\)\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell
+else
+ " older C or C++
syn region cString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell extend
- " cCppString: same as cString, but ends at end of line
syn region cCppString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell
endif
+syn region cCppSkip contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppSkip
+
+syn cluster cStringGroup contains=cCppString,cCppSkip
+
syn match cCharacter "L\='[^\\]'"
syn match cCharacter "L'[^']*'" contains=cSpecial
if exists("c_gnu")
@@ -70,12 +78,9 @@ syn match cSpecialCharacter display "L\='\\\o\{1,3}'"
syn match cSpecialCharacter display "'\\x\x\{1,2}'"
syn match cSpecialCharacter display "L'\\x\x\+'"
-if !exists("c_no_c11") " ISO C11
- if exists("c_no_cformat")
- syn region cString start=+\%(U\|u8\=\)"+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,@Spell extend
- else
- syn region cString start=+\%(U\|u8\=\)"+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell extend
- endif
+if (s:ft ==# "c" && !exists("c_no_c11")) || (s:ft ==# "cpp" && !exists("cpp_no_cpp11"))
+ " ISO C11 or ISO C++ 11
+ syn region cString start=+\%(U\|u8\=\)"+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell extend
syn match cCharacter "[Uu]'[^\\]'"
syn match cCharacter "[Uu]'[^']*'" contains=cSpecial
if exists("c_gnu")
@@ -102,24 +107,24 @@ endif
" This should be before cErrInParen to avoid problems with #define ({ xxx })
if exists("c_curly_error")
syn match cCurlyError "}"
- syn region cBlock start="{" end="}" contains=ALLBUT,cBadBlock,cCurlyError,@cParenGroup,cErrInParen,cCppParen,cErrInBracket,cCppBracket,cCppString,@Spell fold
+ syn region cBlock start="{" end="}" contains=ALLBUT,cBadBlock,cCurlyError,@cParenGroup,cErrInParen,cCppParen,cErrInBracket,cCppBracket,@cStringGroup,@Spell fold
else
syn region cBlock start="{" end="}" transparent fold
endif
-"catch errors caused by wrong parenthesis and brackets
-" also accept <% for {, %> for }, <: for [ and :> for ] (C99)
+" Catch errors caused by wrong parenthesis and brackets.
+" Also accept <% for {, %> for }, <: for [ and :> for ] (C99)
" But avoid matching <::.
syn cluster cParenGroup contains=cParenError,cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserLabel,cBitField,cOctalZero,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom
if exists("c_no_curly_error")
if s:ft ==# 'cpp' && !exists("cpp_no_cpp11")
- syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cCppString,@Spell
+ syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,@cStringGroup,@Spell
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
syn match cParenError display ")"
syn match cErrInParen display contained "^^<%\|^%>"
else
- syn region cParen transparent start='(' end=')' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cCppParen,cCppString,@Spell
+ syn region cParen transparent start='(' end=')' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cCppParen,@cStringGroup,@Spell
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
syn match cParenError display ")"
@@ -127,13 +132,13 @@ if exists("c_no_curly_error")
endif
elseif exists("c_no_bracket_error")
if s:ft ==# 'cpp' && !exists("cpp_no_cpp11")
- syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cCppString,@Spell
+ syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,@cStringGroup,@Spell
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
syn match cParenError display ")"
syn match cErrInParen display contained "<%\|%>"
else
- syn region cParen transparent start='(' end=')' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cCppParen,cCppString,@Spell
+ syn region cParen transparent start='(' end=')' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cCppParen,@cStringGroup,@Spell
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
syn match cParenError display ")"
@@ -141,19 +146,19 @@ elseif exists("c_no_bracket_error")
endif
else
if s:ft ==# 'cpp' && !exists("cpp_no_cpp11")
- syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cErrInBracket,cCppBracket,cCppString,@Spell
+ syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cErrInBracket,cCppBracket,@cStringGroup,@Spell
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cErrInBracket,cParen,cBracket,cString,@Spell
syn match cParenError display "[\])]"
syn match cErrInParen display contained "<%\|%>"
- syn region cBracket transparent start='\[\|<::\@!' end=']\|:>' contains=ALLBUT,@cParenGroup,cErrInParen,cCppParen,cCppBracket,cCppString,@Spell
+ syn region cBracket transparent start='\[\|<::\@!' end=']\|:>' contains=ALLBUT,@cParenGroup,cErrInParen,cCppParen,cCppBracket,@cStringGroup,@Spell
else
- syn region cParen transparent start='(' end=')' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cCppParen,cErrInBracket,cCppBracket,cCppString,@Spell
+ syn region cParen transparent start='(' end=')' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cCppParen,cErrInBracket,cCppBracket,@cStringGroup,@Spell
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cErrInBracket,cParen,cBracket,cString,@Spell
syn match cParenError display "[\])]"
syn match cErrInParen display contained "[\]{}]\|<%\|%>"
- syn region cBracket transparent start='\[\|<::\@!' end=']\|:>' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cErrInParen,cCppParen,cCppBracket,cCppString,@Spell
+ syn region cBracket transparent start='\[\|<::\@!' end=']\|:>' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cErrInParen,cCppParen,cCppBracket,@cStringGroup,@Spell
endif
" cCppBracket: same as cParen but ends at end-of-line; used in cDefine
syn region cCppBracket transparent start='\[\|<::\@!' skip='\\$' excludenl end=']\|:>' end='$' contained contains=ALLBUT,@cParenGroup,cErrInParen,cParen,cBracket,cString,@Spell
@@ -376,7 +381,7 @@ syn region cPreProc start="^\s*\(%:\|#\)\s*\(pragma\>\|line\>\|warning\>\|warn\>
" Highlight User Labels
syn cluster cMultiGroup contains=cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserCont,cUserLabel,cBitField,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cCppParen,cCppBracket,cCppString
if s:ft ==# 'c' || exists("cpp_no_cpp11")
- syn region cMulti transparent start='?' skip='::' end=':' contains=ALLBUT,@cMultiGroup,@Spell
+ syn region cMulti transparent start='?' skip='::' end=':' contains=ALLBUT,@cMultiGroup,@Spell,@cStringGroup
endif
" Avoid matching foo::bar() in C++ by requiring that the next char is not ':'
syn cluster cLabelGroup contains=cUserLabel
@@ -456,8 +461,7 @@ hi def link cTodo Todo
hi def link cBadContinuation Error
hi def link cCppOutSkip cCppOutIf2
hi def link cCppInElse2 cCppOutIf2
-hi def link cCppOutIf2 cCppOut2 " Old syntax group for #if 0 body
-hi def link cCppOut2 cCppOut " Old syntax group for #if of #if 0
+hi def link cCppOutIf2 cCppOut
hi def link cCppOut Comment
let b:current_syntax = "c"
diff --git a/runtime/syntax/csh.vim b/runtime/syntax/csh.vim
index 39603fa15..a67cb0918 100644
--- a/runtime/syntax/csh.vim
+++ b/runtime/syntax/csh.vim
@@ -1,9 +1,9 @@
" Vim syntax file
" Language: C-shell (csh)
-" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
-" Version: 10
-" Last Change: Sep 11, 2006
-" URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
+" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
+" Version: 11
+" Last Change: Oct 23, 2014
+" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_CSH
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
diff --git a/runtime/syntax/dcl.vim b/runtime/syntax/dcl.vim
index b051b08cf..0c3e59857 100644
--- a/runtime/syntax/dcl.vim
+++ b/runtime/syntax/dcl.vim
@@ -1,9 +1,9 @@
" Vim syntax file
" Language: DCL (Digital Command Language - vms)
-" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
-" Last Change: Sep 11, 2006
-" Version: 6
-" URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
+" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
+" Last Change: Oct 23, 2014
+" Version: 7
+" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_DCL
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
diff --git a/runtime/syntax/debchangelog.vim b/runtime/syntax/debchangelog.vim
index 4b3cbc7b3..6206fa388 100644
--- a/runtime/syntax/debchangelog.vim
+++ b/runtime/syntax/debchangelog.vim
@@ -3,7 +3,7 @@
" Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
" Former Maintainers: Gerfried Fuchs <alfie@ist.org>
" Wichert Akkerman <wakkerma@debian.org>
-" Last Change: 2014 Jan 20
+" Last Change: 2014 Jul 11
" URL: http://anonscm.debian.org/hg/pkg-vim/vim/raw-file/unstable/runtime/syntax/debchangelog.vim
" Standard syntax initialization
@@ -19,7 +19,7 @@ syn case ignore
" Define some common expressions we can use later on
syn match debchangelogName contained "^[[:alnum:]][[:alnum:].+-]\+ "
syn match debchangelogUrgency contained "; urgency=\(low\|medium\|high\|critical\|emergency\)\( \S.*\)\="
-syn match debchangelogTarget contained "\v %(frozen|unstable|%(testing|%(old)=stable)%(-proposed-updates|-security)=|experimental|squeeze-%(backports%(-sloppy)=|volatile)|wheezy-backports|%(lucid|precise|quantal|saucy|trusty)%(-%(security|proposed|updates|backports|commercial|partner))=)+"
+syn match debchangelogTarget contained "\v %(frozen|unstable|%(testing|%(old)=stable)%(-proposed-updates|-security)=|experimental|squeeze-%(backports%(-sloppy)=|volatile)|wheezy-backports|%(devel|lucid|precise|trusty|utopic)%(-%(security|proposed|updates|backports|commercial|partner))=)+"
syn match debchangelogVersion contained "(.\{-})"
syn match debchangelogCloses contained "closes:\_s*\(bug\)\=#\=\_s\=\d\+\(,\_s*\(bug\)\=#\=\_s\=\d\+\)*"
syn match debchangelogLP contained "\clp:\s\+#\d\+\(,\s*#\d\+\)*"
diff --git a/runtime/syntax/debcontrol.vim b/runtime/syntax/debcontrol.vim
index 2a14b67f0..5d9d45d02 100644
--- a/runtime/syntax/debcontrol.vim
+++ b/runtime/syntax/debcontrol.vim
@@ -3,7 +3,7 @@
" Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
" Former Maintainers: Gerfried Fuchs <alfie@ist.org>
" Wichert Akkerman <wakkerma@debian.org>
-" Last Change: 2013 Oct 28
+" Last Change: 2014 May 01
" URL: http://anonscm.debian.org/hg/pkg-vim/vim/raw-file/unstable/runtime/syntax/debcontrol.vim
" Standard syntax initialization
@@ -13,6 +13,9 @@ elseif exists("b:current_syntax")
finish
endif
+let s:cpo_save = &cpo
+set cpo&vim
+
" Should match case except for the keys of each field
syn case match
@@ -23,8 +26,17 @@ syn match debcontrolElse "^.*$"
syn match debControlComma ", *"
syn match debControlSpace " "
+let s:kernels = '\%(linux\|hurd\|kfreebsd\|knetbsd\|kopensolaris\|netbsd\)'
+let s:archs = '\%(alpha\|amd64\|armeb\|armel\|armhf\|arm64\|avr32\|hppa\|i386'
+ \ . '\|ia64\|lpia\|m32r\|m68k\|mipsel\|mips\|powerpcspe\|powerpc\|ppc64el'
+ \ . '\|ppc64\|s390x\|s390\|sh3eb\|sh3\|sh4eb\|sh4\|sh\|sparc64\|sparc\|x32\)'
+let s:pairs = 'hurd-i386\|kfreebsd-i386\|kfreebsd-amd64\|knetbsd-i386\|kopensolaris-i386\|netbsd-alpha\|netbsd-i386'
+
" Define some common expressions we can use later on
-syn match debcontrolArchitecture contained "\%(all\|linux-any\|\%(any-\)\=\%(alpha\|amd64\|arm\%(e[bl]\|hf\|64\)\=\|avr32\|hppa\|i386\|ia64\|lpia\|m32r\|m68k\|mips\%(el\)\=\|powerpc\%(spe\)\=\|ppc64\|s390x\=\|sh[34]\(eb\)\=\|sh\|sparc\%(64\)\=\)\|x32\|hurd-\%(i386\|any\)\|kfreebsd-\%(i386\|amd64\|any\)\|knetbsd-\%(i386\|any\)\|kopensolaris-\%(i386\|any\)\|netbsd-\%(alpha\|i386\|any\)\|any\)"
+exe 'syn match debcontrolArchitecture contained "\%(all\|'. s:kernels .'-any\|\%(any-\)\='. s:archs .'\|'. s:pairs .'\|any\)"'
+
+unlet s:kernels s:archs s:pairs
+
syn match debcontrolMultiArch contained "\%(no\|foreign\|allowed\|same\)"
syn match debcontrolName contained "[a-z0-9][a-z0-9+.-]\+"
syn match debcontrolPriority contained "\(extra\|important\|optional\|required\|standard\)"
@@ -108,4 +120,7 @@ endif
let b:current_syntax = "debcontrol"
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
" vim: ts=8 sw=2
diff --git a/runtime/syntax/debsources.vim b/runtime/syntax/debsources.vim
index 0146d3d00..e877b06ae 100644
--- a/runtime/syntax/debsources.vim
+++ b/runtime/syntax/debsources.vim
@@ -2,7 +2,7 @@
" Language: Debian sources.list
" Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
" Former Maintainer: Matthijs Mohlmann <matthijs@cacholong.nl>
-" Last Change: 2014 Jan 20
+" Last Change: 2014 Jul 11
" URL: http://anonscm.debian.org/hg/pkg-vim/vim/raw-file/unstable/runtime/syntax/debsources.vim
" Standard syntax initialization
@@ -23,7 +23,7 @@ syn match debsourcesComment /#.*/ contains=@Spell
" Match uri's
syn match debsourcesUri +\(http://\|ftp://\|[rs]sh://\|debtorrent://\|\(cdrom\|copy\|file\):\)[^' <>"]\++
-syn match debsourcesDistrKeyword +\([[:alnum:]_./]*\)\(squeeze\|wheezy\|\(old\)\=stable\|testing\|unstable\|sid\|rc-buggy\|experimental\|lucid\|precise\|quantal\|saucy\|trusty\)\([-[:alnum:]_./]*\)+
+syn match debsourcesDistrKeyword +\([[:alnum:]_./]*\)\(squeeze\|wheezy\|jessie\|\(old\)\=stable\|testing\|unstable\|sid\|rc-buggy\|experimental\|devel\|lucid\|precise\|trusty\|utopic\)\([-[:alnum:]_./]*\)+
" Associate our matches and regions with pretty colours
hi def link debsourcesLine Error
diff --git a/runtime/syntax/diff.vim b/runtime/syntax/diff.vim
index aa5be3f6f..ff69c5860 100644
--- a/runtime/syntax/diff.vim
+++ b/runtime/syntax/diff.vim
@@ -2,7 +2,7 @@
" Language: Diff (context or unified)
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Translations by Jakson Alves de Aquino.
-" Last Change: 2013 Oct 06
+" Last Change: 2015 Jan 07
" Quit when a (custom) syntax file was already loaded
if exists("b:current_syntax")
@@ -18,6 +18,9 @@ syn match diffIsA "^File .* is a .* while file .* is a .*"
syn match diffNoEOL "^\\ No newline at end of file .*"
syn match diffCommon "^Common subdirectories: .*"
+" Disable the translations by setting diff_translations to zero.
+if !exists("diff_translations") || diff_translations
+
" ca
syn match diffOnly "^Només a .*"
syn match diffIdentical "^Els fitxers .* i .* són idèntics$"
@@ -125,7 +128,7 @@ syn match diffIdentical "^םיהז םניה .*-ו .* םיצבקה$"
syn match diffDiffer "^הזמ הז םינוש `.*'-ו `.*' םיצבקה$"
syn match diffBDiffer "^הזמ הז םינוש `.*'-ו `.*' םיירניב םיצבק$"
syn match diffIsA "^.* .*-ל .* .* תוושהל ןתינ אל$"
-syn match diffNoEOL "^\\ ץבוקה ףוסב השדח-הרוש ות רסח"
+syn match diffNoEOL "^\\ ץבוקה ףוסב השד.-הרוש ות רס."
syn match diffCommon "^.*-ו .* :תוהז תויקית-תת$"
" hr
@@ -320,6 +323,8 @@ syn match diffIsA "^檔案 .* 是.*而檔案 .* 是.*"
syn match diffNoEOL "^\\ 檔案末沒有 newline 字元"
syn match diffCommon "^.* 和 .* 有共同的副目錄$"
+endif
+
syn match diffRemoved "^-.*"
syn match diffRemoved "^<.*"
diff --git a/runtime/syntax/django.vim b/runtime/syntax/django.vim
index 04abcc9c0..da315ac30 100644
--- a/runtime/syntax/django.vim
+++ b/runtime/syntax/django.vim
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: Django template
" Maintainer: Dave Hodder <dmh@dmh.org.uk>
-" Last Change: 2012 Apr 09
+" Last Change: 2014 Jul 13
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
@@ -64,7 +64,7 @@ syn region djangoTagBlock start="{%" end="%}" contains=djangoStatement,djangoFil
syn region djangoVarBlock start="{{" end="}}" contains=djangoFilter,djangoArgument,djangoVarError display
" Django template 'comment' tag and comment block
-syn region djangoComment start="{%\s*comment\s*%}" end="{%\s*endcomment\s*%}" contains=djangoTodo
+syn region djangoComment start="{%\s*comment\(\s\+.\{-}\)\?%}" end="{%\s*endcomment\s*%}" contains=djangoTodo
syn region djangoComBlock start="{#" end="#}" contains=djangoTodo
" Define the default highlighting.
diff --git a/runtime/syntax/dockerfile.vim b/runtime/syntax/dockerfile.vim
new file mode 100644
index 000000000..d1693cba4
--- /dev/null
+++ b/runtime/syntax/dockerfile.vim
@@ -0,0 +1,24 @@
+" dockerfile.vim - Syntax highlighting for Dockerfiles
+" Maintainer: Honza Pokorny <http://honza.ca>
+" Version: 0.5
+" Last Change: 2014 Aug 29
+" License: BSD
+
+
+if exists("b:current_syntax")
+ finish
+endif
+
+let b:current_syntax = "dockerfile"
+
+syntax case ignore
+
+syntax match dockerfileKeyword /\v^\s*(ONBUILD\s+)?(ADD|CMD|ENTRYPOINT|ENV|EXPOSE|FROM|MAINTAINER|RUN|USER|VOLUME|WORKDIR|COPY)\s/
+
+syntax region dockerfileString start=/\v"/ skip=/\v\\./ end=/\v"/
+
+syntax match dockerfileComment "\v^\s*#.*$"
+
+hi def link dockerfileString String
+hi def link dockerfileKeyword Keyword
+hi def link dockerfileComment Comment
diff --git a/runtime/syntax/elmfilt.vim b/runtime/syntax/elmfilt.vim
index 0afa1694c..e7d5df22a 100644
--- a/runtime/syntax/elmfilt.vim
+++ b/runtime/syntax/elmfilt.vim
@@ -1,9 +1,9 @@
" Vim syntax file
" Language: Elm Filter rules
-" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
-" Last Change: Sep 11, 2006
-" Version: 5
-" URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
+" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
+" Last Change: Oct 23, 2014
+" Version: 6
+" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_ELMFILT
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
diff --git a/runtime/syntax/exports.vim b/runtime/syntax/exports.vim
index 40b4b8806..f695dc8d2 100644
--- a/runtime/syntax/exports.vim
+++ b/runtime/syntax/exports.vim
@@ -1,10 +1,10 @@
" Vim syntax file
" Language: exports
-" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
-" Last Change: Sep 06, 2005
-" Version: 4
+" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
+" Last Change: Oct 23, 2014
+" Version: 5
" Notes: This file includes both SysV and BSD 'isms
-" URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
+" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_EXPORTS
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
diff --git a/runtime/syntax/gnuplot.vim b/runtime/syntax/gnuplot.vim
index 5a381c7cd..03d813c99 100644
--- a/runtime/syntax/gnuplot.vim
+++ b/runtime/syntax/gnuplot.vim
@@ -1,176 +1,505 @@
" Vim syntax file
-" Language: gnuplot 3.8i.0
-" Maintainer: John Hoelzel johnh51@users.sourceforge.net
-" Last Change: Mon May 26 02:33:33 UTC 2003
-" Filenames: *.gpi *.gih scripts: #!*gnuplot
-" URL: http://johnh51.get.to/vim/syntax/gnuplot.vim
-"
-
-" thanks to "David Necas (Yeti)" <yeti@physics.muni.cz> for heads up - working on more changes .
-" *.gpi = GnuPlot Input - what I use because there is no other guideline. jeh 11/2000
-" *.gih = makes using cut/pasting from gnuplot.gih easier ...
-" #!*gnuplot = for Linux bash shell scripts of gnuplot commands.
-" emacs used a suffix of '<gp?>'
-" gnuplot demo files show no preference.
-" I will post mail and newsgroup comments on a standard suffix in 'URL' directory.
-
-" For version 5.x: Clear all syntax items
-" For version 6.x: Quit when a syntax file was already loaded
+" Language: gnuplot 4.7.0
+" Maintainer: Andrew Rasmussen andyras@users.sourceforge.net
+" Original Maintainer: John Hoelzel johnh51@users.sourceforge.net
+" Last Change: 2014-02-24
+" Filenames: *.gnu *.plt *.gpi *.gih *.gp *.gnuplot scripts: #!*gnuplot
+" URL: http://www.vim.org/scripts/script.php?script_id=4873
+" Original URL: http://johnh51.get.to/vim/syntax/gnuplot.vim
+
+" thanks to "David Necas (Yeti)" <yeti@physics.muni.cz>
+
+" credit also to Jim Eberle <jim.eberle@fastnlight.com>
+" for the script http://www.vim.org/scripts/script.php?script_id=1737
+
+" some shortened names to make demo files look clean... jeh. 11/2000
+" demos -> 3.8i ... jeh. 5/2003 - a work in progress...
+" added current commands, keywords, variables, todos, macros... amr 2014-02-24
+
+" For vim version 5.x: Clear all syntax items
+" For vim version 6.x: Quit when a syntax file was already loaded
+
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
-" some shortened names to make demo files look clean... jeh. 11/2000
-" demos -> 3.8i ... jeh. 5/2003 - a work in progress...
+" ---- Special characters ---- "
+
+" no harm in just matching any \[char] within double quotes, right?
+syn match gnuplotSpecial "\\." contained
+" syn match gnuplotSpecial "\\\o\o\o\|\\x\x\x\|\\c[^"]\|\\[a-z\\]" contained
+
+" measurements in the units in, cm and pt are special
+syn match gnuplotUnit "[0-9]+in"
+syn match gnuplotUnit "[0-9]+cm"
+syn match gnuplotUnit "[0-9]+pt"
+
+" external (shell) commands are special
+syn region gnuplotExternal start="!" end="$"
+
+" ---- Comments ---- "
+
+syn region gnuplotComment start="#" end="$" contains=gnuplotTodo
-" commands
+" ---- Constants ---- "
-syn keyword gnuplotStatement cd call clear exit set unset plot splot help
-syn keyword gnuplotStatement load pause quit fit rep[lot] if
-syn keyword gnuplotStatement FIT_LIMIT FIT_MAXITER FIT_START_LAMBDA
-syn keyword gnuplotStatement FIT_LAMBDA_FACTOR FIT_LOG FIT_SCRIPT
-syn keyword gnuplotStatement print pwd reread reset save show test ! functions var
-syn keyword gnuplotConditional if
-" if is cond + stmt - ok?
+" strings
+syn region gnuplotString start=+"+ skip=+\\"+ end=+"+ contains=gnuplotSpecial
+syn region gnuplotString start="'" end="'"
-" numbers fm c.vim
+" built-in variables
+syn keyword gnuplotNumber GNUTERM GPVAL_TERM GPVAL_TERMOPTIONS GPVAL_SPLOT
+syn keyword gnuplotNumber GPVAL_OUTPUT GPVAL_ENCODING GPVAL_VERSION
+syn keyword gnuplotNumber GPVAL_PATCHLEVEL GPVAL_COMPILE_OPTIONS
+syn keyword gnuplotNumber GPVAL_MULTIPLOT GPVAL_PLOT GPVAL_VIEW_ZSCALE
+syn keyword gnuplotNumber GPVAL_TERMINALS GPVAL_pi GPVAL_NaN
+syn keyword gnuplotNumber GPVAL_ERRNO GPVAL_ERRMSG GPVAL_PWD
+syn keyword gnuplotNumber pi NaN GPVAL_LAST_PLOT GPVAL_TERM_WINDOWID
+syn keyword gnuplotNumber GPVAL_X_MIN GPVAL_X_MAX GPVAL_X_LOG
+syn keyword gnuplotNumber GPVAL_DATA_X_MIN GPVAL_DATA_X_MAX GPVAL_Y_MIN
+syn keyword gnuplotNumber GPVAL_Y_MAX GPVAL_Y_LOG GPVAL_DATA_Y_MIN
+syn keyword gnuplotNumber GPVAL_DATA_Y_MAX GPVAL_X2_MIN GPVAL_X2_MAX
+syn keyword gnuplotNumber GPVAL_X2_LOG GPVAL_DATA_X2_MIN GPVAL_DATA_X2_MAX
+syn keyword gnuplotNumber GPVAL_Y2_MIN GPVAL_Y2_MAX GPVAL_Y2_LOG
+syn keyword gnuplotNumber GPVAL_DATA_Y2_MIN GPVAL_DATA_Y2_MAX GPVAL_Z_MIN
+syn keyword gnuplotNumber GPVAL_Z_MAX GPVAL_Z_LOG GPVAL_DATA_Z_MIN
+syn keyword gnuplotNumber GPVAL_DATA_Z_MAX GPVAL_CB_MIN GPVAL_CB_MAX
+syn keyword gnuplotNumber GPVAL_CB_LOG GPVAL_DATA_CB_MIN GPVAL_DATA_CB_MAX
+syn keyword gnuplotNumber GPVAL_T_MIN GPVAL_T_MAX GPVAL_T_LOG GPVAL_U_MIN
+syn keyword gnuplotNumber GPVAL_U_MAX GPVAL_U_LOG GPVAL_V_MIN GPVAL_V_MAX
+syn keyword gnuplotNumber GPVAL_V_LOG GPVAL_R_MIN GPVAL_R_LOG
+syn keyword gnuplotNumber GPVAL_TERM_XMIN GPVAL_TERM_XMAX GPVAL_TERM_YMIN
+syn keyword gnuplotNumber GPVAL_TERM_YMAX GPVAL_TERM_XSIZE
+syn keyword gnuplotNumber GPVAL_TERM_YSIZE GPVAL_VIEW_MAP GPVAL_VIEW_ROT_X
+syn keyword gnuplotNumber GPVAL_VIEW_ROT_Z GPVAL_VIEW_SCALE
-" integer number, or floating point number without a dot and with "f".
+" function name variables
+syn match gnuplotNumber "GPFUN_[a-zA-Z_]*"
+
+" stats variables
+syn keyword gnuplotNumber STATS_records STATS_outofrange STATS_invalid
+syn keyword gnuplotNumber STATS_blank STATS_blocks STATS_columns STATS_min
+syn keyword gnuplotNumber STATS_max STATS_index_min STATS_index_max
+syn keyword gnuplotNumber STATS_lo_quartile STATS_median STATS_up_quartile
+syn keyword gnuplotNumber STATS_mean STATS_stddev STATS_sum STATS_sumsq
+syn keyword gnuplotNumber STATS_correlation STATS_slope STATS_intercept
+syn keyword gnuplotNumber STATS_sumxy STATS_pos_min_y STATS_pos_max_y
+syn keyword gnuplotNumber STATS_mean STATS_stddev STATS_mean_x STATS_sum_x
+syn keyword gnuplotNumber STATS_stddev_x STATS_sumsq_x STATS_min_x
+syn keyword gnuplotNumber STATS_max_x STATS_median_x STATS_lo_quartile_x
+syn keyword gnuplotNumber STATS_up_quartile_x STATS_index_min_x
+syn keyword gnuplotNumber STATS_index_max_x STATS_mean_y STATS_stddev_y
+syn keyword gnuplotNumber STATS_sum_y STATS_sumsq_y STATS_min_y
+syn keyword gnuplotNumber STATS_max_y STATS_median_y STATS_lo_quartile_y
+syn keyword gnuplotNumber STATS_up_quartile_y STATS_index_min_y
+syn keyword gnuplotNumber STATS_index_max_y STATS_correlation STATS_sumxy
+
+" deprecated fit variables
+syn keyword gnuplotError FIT_LIMIT FIT_MAXITER FIT_START_LAMBDA
+syn keyword gnuplotError FIT_LAMBDA_FACTOR FIT_LOG FIT_SCRIPT
+
+" numbers, from c.vim
+
+" integer number, or floating point number without a dot and with "f".
syn case ignore
syn match gnuplotNumber "\<[0-9]\+\(u\=l\=\|lu\|f\)\>"
-" floating point number, with dot, optional exponent
+
+" floating point number, with dot, optional exponent
syn match gnuplotFloat "\<[0-9]\+\.[0-9]*\(e[-+]\=[0-9]\+\)\=[fl]\=\>"
-" floating point number, starting with a dot, optional exponent
+
+" floating point number, starting with a dot, optional exponent
syn match gnuplotFloat "\.[0-9]\+\(e[-+]\=[0-9]\+\)\=[fl]\=\>"
-" floating point number, without dot, with exponent
+
+" floating point number, without dot, with exponent
syn match gnuplotFloat "\<[0-9]\+e[-+]\=[0-9]\+[fl]\=\>"
-" hex number
+
+" hex number
syn match gnuplotNumber "\<0x[0-9a-f]\+\(u\=l\=\|lu\)\>"
syn case match
-" flag an octal number with wrong digits by not hilighting
+
+" flag an octal number with wrong digits by not highlighting
syn match gnuplotOctalError "\<0[0-7]*[89]"
-" plot args
-
-syn keyword gnuplotType u[sing] tit[le] notit[le] wi[th] steps fs[teps]
-syn keyword gnuplotType title notitle t
-syn keyword gnuplotType with w
-syn keyword gnuplotType li[nes] l
-" t - too much? w - too much? l - too much?
-syn keyword gnuplotType linespoints via
-
-" funcs
-
-syn keyword gnuplotFunc abs acos acosh arg asin asinh atan atanh atan2
-syn keyword gnuplotFunc besj0 besj1 besy0 besy1
-syn keyword gnuplotFunc ceil column cos cosh erf erfc exp floor gamma
-syn keyword gnuplotFunc ibeta inverf igamma imag invnorm int lgamma
-syn keyword gnuplotFunc log log10 norm rand real sgn sin sinh sqrt tan
-syn keyword gnuplotFunc lambertw
-syn keyword gnuplotFunc tanh valid
-syn keyword gnuplotFunc tm_hour tm_mday tm_min tm_mon tm_sec
-syn keyword gnuplotFunc tm_wday tm_yday tm_year
-
-" set vars
-
-syn keyword gnuplotType xdata timefmt grid noytics ytics fs
-syn keyword gnuplotType logscale time notime mxtics nomxtics style mcbtics
-syn keyword gnuplotType nologscale
-syn keyword gnuplotType axes x1y2 unique acs[plines]
-syn keyword gnuplotType size origin multiplot xtics xr[ange] yr[ange] square nosquare ratio noratio
-syn keyword gnuplotType binary matrix index every thru sm[ooth]
-syn keyword gnuplotType all angles degrees radians
-syn keyword gnuplotType arrow noarrow autoscale noautoscale arrowstyle
-" autoscale args = x y xy z t ymin ... - too much?
-" needs code to: using title vs autoscale t
-syn keyword gnuplotType x y z zcb
-syn keyword gnuplotType linear cubicspline bspline order level[s]
-syn keyword gnuplotType auto disc[rete] incr[emental] from to head nohead
-syn keyword gnuplotType graph base both nosurface table out[put] data
-syn keyword gnuplotType bar border noborder boxwidth
-syn keyword gnuplotType clabel noclabel clip noclip cntrp[aram]
-syn keyword gnuplotType contour nocontour
-syn keyword gnuplotType dgrid3d nodgrid3d dummy encoding format
-" set encoding args not included - yet.
-syn keyword gnuplotType function grid nogrid hidden[3d] nohidden[3d] isosample[s] key nokey
-syn keyword gnuplotType historysize nohistorysize
-syn keyword gnuplotType defaults offset nooffset trianglepattern undefined noundefined altdiagonal bentover noaltdiagonal nobentover
-syn keyword gnuplotType left right top bottom outside below samplen spacing width height box nobox linestyle ls linetype lt linewidth lw
-syn keyword gnuplotType Left Right autotitles noautotitles enhanced noenhanced
-syn keyword gnuplotType isosamples
-syn keyword gnuplotType label nolabel logscale nolog[scale] missing center font locale
-syn keyword gnuplotType mapping margin bmargin lmargin rmargin tmargin spherical cylindrical cartesian
-syn keyword gnuplotType linestyle nolinestyle linetype lt linewidth lw pointtype pt pointsize ps
-syn keyword gnuplotType mouse nomouse
-syn keyword gnuplotType nooffsets data candlesticks financebars linespoints lp vector nosurface
-syn keyword gnuplotType term[inal] linux aed767 aed512 gpic
-syn keyword gnuplotType regis tek410x tek40 vttek kc-tek40xx
-syn keyword gnuplotType km-tek40xx selanar bitgraph xlib x11 X11
-" x11 args
-syn keyword gnuplotType aifm cgm dumb fig gif small large size nofontlist winword6 corel dxf emf
-syn keyword gnuplotType hpgl
-" syn keyword gnuplotType transparent hp2623a hp2648 hp500c pcl5 why jeh
-syn keyword gnuplotType hp2623a hp2648 hp500c pcl5
-syn match gnuplotType "\<transparent\>"
-syn keyword gnuplotType hpljii hpdj hppj imagen mif pbm png svg
-syn keyword gnuplotType postscript enhanced_postscript qms table
-" postscript editing values?
-syn keyword gnuplotType tgif tkcanvas epson-180dpi epson-60dpi
-syn keyword gnuplotType epson-lx800 nec-cp6 okidata starc
-syn keyword gnuplotType tandy-60dpi latex emtex pslatex pstex epslatex
-syn keyword gnuplotType eepic tpic pstricks texdraw mf metafont mpost mp
-syn keyword gnuplotType timestamp notimestamp
-syn keyword gnuplotType variables version
-syn keyword gnuplotType x2data y2data ydata zdata
-syn keyword gnuplotType reverse writeback noreverse nowriteback
-syn keyword gnuplotType axis mirror autofreq nomirror rotate autofreq norotate
-syn keyword gnuplotType update
-syn keyword gnuplotType multiplot nomultiplot mytics
-syn keyword gnuplotType nomytics mztics nomztics mx2tics nomx2tics
-syn keyword gnuplotType my2tics nomy2tics offsets origin output
-syn keyword gnuplotType para[metric] nopara[metric] pointsize polar nopolar
-syn keyword gnuplotType zrange x2range y2range rrange cbrange
-syn keyword gnuplotType trange urange vrange sample[s] size
-syn keyword gnuplotType bezier boxerrorbars boxes bargraph bar[s]
-syn keyword gnuplotType boxxy[errorbars] csplines dots fsteps histeps impulses
-syn keyword gnuplotType line[s] linesp[oints] points poiinttype sbezier splines steps
-" w lt lw ls = optional
-syn keyword gnuplotType vectors xerr[orbars] xyerr[orbars] yerr[orbars] financebars candlesticks vector
-syn keyword gnuplotType errorb[ars] surface
-syn keyword gnuplotType filledcurve[s] pm3d x1 x2 y1 y2 xy closed
-syn keyword gnuplotType at pi front
-syn keyword gnuplotType errorlines xerrorlines yerrorlines xyerrorlines
-syn keyword gnuplotType tics ticslevel ticscale time timefmt view
-syn keyword gnuplotType xdata xdtics noxdtics ydtics noydtics
-syn keyword gnuplotType zdtics nozdtics x2dtics nox2dtics y2dtics noy2dtics
-syn keyword gnuplotType xlab[el] ylab[el] zlab[el] cblab[el] x2label y2label xmtics
-syn keyword gnuplotType xmtics noxmtics ymtics noymtics zmtics nozmtics
-syn keyword gnuplotType x2mtics nox2mtics y2mtics noy2mtics
-syn keyword gnuplotType cbdtics nocbdtics cbmtics nocbmtics cbtics nocbtics
-syn keyword gnuplotType xtics noxtics ytics noytics
-syn keyword gnuplotType ztics noztics x2tics nox2tics
-syn keyword gnuplotType y2tics noy2tics zero nozero zeroaxis nozeroaxis
-syn keyword gnuplotType xzeroaxis noxzeroaxis yzeroaxis noyzeroaxis
-syn keyword gnuplotType x2zeroaxis nox2zeroaxis y2zeroaxis noy2zeroaxis
-syn keyword gnuplotType angles one two fill empty solid pattern
-syn keyword gnuplotType default
-syn keyword gnuplotType scansautomatic flush b[egin] noftriangles implicit
-" b too much? - used in demo
-syn keyword gnuplotType palette positive negative ps_allcF nops_allcF maxcolors
-syn keyword gnuplotType push fontfile pop
-syn keyword gnuplotType rgbformulae defined file color model gradient colornames
-syn keyword gnuplotType RGB HSV CMY YIQ XYZ
-syn keyword gnuplotType colorbox vertical horizontal user bdefault
-syn keyword gnuplotType loadpath fontpath decimalsign in out
-
-" comments + strings
-syn region gnuplotComment start="#" end="$"
-syn region gnuplotComment start=+"+ skip=+\\"+ end=+"+
-syn region gnuplotComment start=+'+ end=+'+
-
-" Define the default highlighting.
+" ---- Identifiers: Functions ---- "
+
+" numerical functions
+syn keyword gnuplotFunc abs acos acosh airy arg asin asinh atan atan2
+syn keyword gnuplotFunc atanh EllipticK EllipticE EllipticPi besj0 besj1
+syn keyword gnuplotFunc besy0 besy1 ceil cos cosh erf erfc exp expint
+syn keyword gnuplotFunc floor gamma ibeta inverf igamma imag invnorm int
+syn keyword gnuplotFunc lambertw lgamma log log10 norm rand real sgn sin
+syn keyword gnuplotFunc sin sinh sqrt tan tanh voigt
+
+" string functions
+syn keyword gnuplotFunc gprintf sprintf strlen strstrt substr strftime
+syn keyword gnuplotFunc strptime system word words
+
+" other functions
+syn keyword gnuplotFunc column columnhead columnheader defined exists
+syn keyword gnuplotFunc hsv2rgb stringcolumn timecolumn tm_hour tm_mday
+syn keyword gnuplotFunc tm_min tm_mon tm_sec tm_wday tm_yday tm_year
+syn keyword gnuplotFunc time valid value
+
+" ---- Statements ---- "
+
+" common (builtin) variable names
+syn keyword gnuplotKeyword x y t u v z s
+
+" conditionals
+syn keyword gnuplotConditional if else
+
+" repeats
+syn keyword gnuplotRepeat do for while
+
+" operators
+syn match gnuplotOperator "[-+*/^|&?:]"
+syn match gnuplotOperator "\*\*"
+syn match gnuplotOperator "&&"
+syn match gnuplotOperator "||"
+
+" Keywords
+
+" keywords for 'fit' command
+syn keyword gnuplotKeyword via z x:z x:z:s x:y:z:s
+syn keyword gnuplotKeyword x:y:t:z:s x:y:t:u:z:s x:y:t:u:v:z:s
+
+" keywords for 'plot' command
+" 'axes' keyword
+syn keyword gnuplotKeyword axes x1y1 x1y2 x2y1 x2y2
+" 'binary' keyword
+syn keyword gnuplotKeyword binary matrix general array record format endian
+syn keyword gnuplotKeyword filetype avs edf png scan transpose dx dy dz
+syn keyword gnuplotKeyword flipx flipy flipz origin center rotate using
+syn keyword gnuplotKeyword perpendicular skip every
+" datafile keywords
+syn keyword gnuplotKeyword binary nonuniform matrix index every using
+syn keyword gnuplotKeyword smooth volatile noautoscale every index
+" 'smooth' keywords
+syn keyword gnuplotKeyword unique frequency cumulative cnormal kdensity
+syn keyword gnuplotKeyword csplines acsplines bezer sbezier
+" deprecated 'thru' keyword
+syn keyword gnuplotError thru
+" 'using' keyword
+syn keyword gnuplotKeyword using u xticlabels yticlabels zticlabels
+syn keyword gnuplotKeyword x2ticlabels y2ticlabels xtic ytic ztic
+" 'errorbars' keywords
+syn keyword gnuplotKeyword errorbars xerrorbars yerrorbars xyerrorbars
+" 'errorlines' keywords
+syn keyword gnuplotKeyword errorlines xerrorlines yerrorlines xyerrorlines
+" 'title' keywords
+syn keyword gnuplotKeyword title t tit notitle columnheader at beginning
+syn keyword gnuplotKeyword end
+" 'with' keywords
+syn keyword gnuplotKeyword with w linestyle ls linetype lt linewidth
+syn keyword gnuplotKeyword lw linecolor lc pointtype pt pointsize ps
+syn keyword gnuplotKeyword fill fs nohidden3d nocontours nosurface palette
+" styles for 'with'
+syn keyword gnuplotKeyword lines l points p linespoints lp surface dots
+syn keyword gnuplotKeyword impulses labels vectors steps fsteps histeps
+syn keyword gnuplotKeyword errorbars errorlines financebars xerrorbars
+syn keyword gnuplotKeyword xerrorlines xyerrorbars yerrorbars yerrorlines
+syn keyword gnuplotKeyword boxes boxerrorbars boxxyerrorbars boxplot
+syn keyword gnuplotKeyword candlesticks circles ellipses filledcurves
+syn keyword gnuplotKeyword histogram image rgbimage rgbalpha pm3d variable
+
+" keywords for 'save' command
+syn keyword gnuplotKeyword save functions func variables all var terminal
+syn keyword gnuplotKeyword term set
+
+" keywords for 'set/show' command
+" set angles
+syn keyword gnuplotKeyword angles degrees deg radians rad
+" set arrow
+syn keyword gnuplotKeyword arrow from to rto length angle arrowstyle as
+syn keyword gnuplotKeyword nohead head backhead heads size filled empty
+syn keyword gnuplotKeyword nofilled front back linestyle linetype linewidth
+" set autoscale
+" TODO regexp here
+syn keyword gnuplotKeyword autoscale x y z cb x2 y2 zy min max fixmin
+syn keyword gnuplotKeyword fixmax fix keepfix noextend
+" set bars
+syn keyword gnuplotKeyword bars small large fullwidth front back
+" set bind
+syn keyword gnuplotKeyword bind
+" set margins
+" TODO regexp
+syn keyword gnuplotKeyword margin bmargin lmargin rmargin tmargin
+" set border
+syn keyword gnuplotKeyword border front back
+" set boxwidth
+syn keyword gnuplotKeyword boxwidth absolute relative
+" deprecated set clabel
+syn keyword gnuplotError clabel
+" set clip
+syn keyword gnuplotKeyword clip points one two
+" set cntrlabel
+syn keyword gnuplotKeyword cntrlabel format font start interval onecolor
+" set cntrparam
+syn keyword gnuplotKeyword cntrparam linear cubicspline bspline points
+syn keyword gnuplotKeyword order levels auto discrete incremental
+" set colorbox
+syn keyword gnuplotKeyword colorbox vertical horizontal default user origin
+syn keyword gnuplotKeyword size front back noborder bdefault border
+" show colornames
+syn keyword gnuplotKeyword colornames
+" set contour
+syn keyword gnuplotKeyword contour base surface both
+" set datafile
+syn keyword gnuplotKeyword datafile fortran nofpe_trap missing separator
+syn keyword gnuplotKeyword whitespace tab comma commentschars binary
+" set decimalsign
+syn keyword gnuplotKeyword decimalsign locale
+" set dgrid3d
+syn keyword gnuplotKeyword dgrid3d splines qnorm gauss cauchy exp box hann
+syn keyword gnuplotKeyword kdensity
+" set dummy
+syn keyword gnuplotKeyword dummy
+" set encoding
+syn keyword gnuplotKeyword encoding default iso_8859_1 iso_8859_15
+syn keyword gnuplotKeyword iso_8859_2 iso_8859_9 koi8r koi8u cp437 cp850
+syn keyword gnuplotKeyword cp852 cp950 cp1250 cp1251 cp1254 sjis utf8
+" set fit
+syn keyword gnuplotKeyword fit logfile default quiet noquiet results brief
+syn keyword gnuplotKeyword verbose errorvariables noerrorvariables
+syn keyword gnuplotKeyword errorscaling noerrorscaling prescale noprescale
+syn keyword gnuplotKeyword maxiter none limit limit_abs start-lambda script
+syn keyword gnuplotKeyword lambda-factor
+" set fontpath
+syn keyword gnuplotKeyword fontpath
+" set format
+syn keyword gnuplotKeyword format
+" show functions
+syn keyword gnuplotKeyword functions
+" set grid
+syn keyword gnuplotKeyword grid polar layerdefault xtics ytics ztics x2tics
+syn keyword gnuplotKeyword y2tics cbtics mxtics mytics mztics mx2tics
+syn keyword gnuplotKeyword my2tics mcbtics xmtics ymtics zmtics x2mtics
+syn keyword gnuplotKeyword y2mtics cbmtics noxtics noytics noztics nox2tics
+syn keyword gnuplotKeyword noy2tics nocbtics nomxtics nomytics nomztics
+syn keyword gnuplotKeyword nomx2tics nomy2tics nomcbtics
+" set hidden3d
+syn keyword gnuplotKeyword hidden3d offset trianglepattern undefined
+syn keyword gnuplotKeyword altdiagonal noaltdiagonal bentover nobentover
+syn keyword gnuplotKeyword noundefined
+" set historysize
+syn keyword gnuplotKeyword historysize
+" set isosamples
+syn keyword gnuplotKeyword isosamples
+" set key
+syn keyword gnuplotKeyword key on off inside outside at left right center
+syn keyword gnuplotKeyword top bottom vertical horizontal Left Right
+syn keyword gnuplotKeyword opaque noopaque reverse noreverse invert maxrows
+syn keyword gnuplotKeyword noinvert samplen spacing width height autotitle
+syn keyword gnuplotKeyword noautotitle title enhanced noenhanced font
+syn keyword gnuplotKeyword textcolor box nobox linetype linewidth maxcols
+" set label
+syn keyword gnuplotKeyword label left center right rotate norotate by font
+syn keyword gnuplotKeyword front back textcolor point nopoint offset boxed
+syn keyword gnuplotKeyword hypertext
+" set linetype
+syn keyword gnuplotKeyword linetype
+" set link
+syn keyword gnuplotKeyword link via inverse
+" set loadpath
+syn keyword gnuplotKeyword loadpath
+" set locale
+syn keyword gnuplotKeyword locale
+" set logscale
+syn keyword gnuplotKeyword logscale log
+" set macros
+syn keyword gnuplotKeyword macros
+" set mapping
+syn keyword gnuplotKeyword mapping cartesian spherical cylindrical
+" set mouse
+syn keyword gnuplotKeyword mouse doubleclick nodoubleclick zoomcoordinates
+syn keyword gnuplotKeyword nozoomcoordinates ruler noruler at polardistance
+syn keyword gnuplotKeyword nopolardistance deg tan format clipboardformat
+syn keyword gnuplotKeyword mouseformat labels nolabels zoomjump nozoomjump
+syn keyword gnuplotKeyword verbose noverbose
+" set multiplot
+syn keyword gnuplotKeyword multiplot title font layout rowsfirst downwards
+syn keyword gnuplotKeyword downwards upwards scale offset
+" set object
+syn keyword gnuplotKeyword object behind fillcolor fc fs rectangle ellipse
+syn keyword gnuplotKeyword circle polygon at center size units xy xx yy to
+syn keyword gnuplotKeyword from
+" set offsets
+syn keyword gnuplotKeyword offsets
+" set origin
+syn keyword gnuplotKeyword origin
+" set output
+syn keyword gnuplotKeyword output
+" set parametric
+syn keyword gnuplotKeyword parametric
+" show plot
+syn keyword gnuplotKeyword plot add2history
+" set pm3d
+syn keyword gnuplotKeyword hidden3d interpolate scansautomatic scansforward
+syn keyword gnuplotKeyword scansbackward depthorder flush begin center end
+syn keyword gnuplotKeyword ftriangles noftriangles clip1in clip4in mean map
+syn keyword gnuplotKeyword corners2color geomean harmean rms median min max
+syn keyword gnuplotKeyword c1 c2 c3 c4 pm3d at nohidden3d implicit explicit
+" set palette
+syn keyword gnuplotKeyword palette gray color gamma rgbformulae defined
+syn keyword gnuplotKeyword file functions cubehelix start cycles saturation
+syn keyword gnuplotKeyword model RGB HSV CMY YIQ XYZ positive negative
+syn keyword gnuplotKeyword nops_allcF ps_allcF maxcolors float int gradient
+syn keyword gnuplotKeyword fit2rgbformulae rgbformulae
+" set pointintervalbox
+syn keyword gnuplotKeyword pointintervalbox
+" set pointsize
+syn keyword gnuplotKeyword pointsize
+" set polar
+syn keyword gnuplotKeyword polar
+" set print
+syn keyword gnuplotKeyword print append
+" set psdir
+syn keyword gnuplotKeyword psdir
+" set raxis
+syn keyword gnuplotKeyword raxis rrange rtics
+" set samples
+syn keyword gnuplotKeyword samples
+" set size
+syn keyword gnuplotKeyword size square nosquare ratio noratio
+" set style
+syn keyword gnuplotKeyword style function data noborder rectangle arrow
+syn keyword gnuplotKeyword default nohead head heads size filled empty
+syn keyword gnuplotKeyword nofilled front back boxplot range fraction
+syn keyword gnuplotKeyword outliers nooutliers pointtype candlesticks
+syn keyword gnuplotKeyword separation labels off auto x x2 sorted unsorted
+syn keyword gnuplotKeyword fill empty transparent solid pattern border
+syn keyword gnuplotKeyword increment userstyles financebars line default
+syn keyword gnuplotKeyword linetype lt linecolor lc linewidth lw pointtype
+syn keyword gnuplotKeyword pt pointsize ps pointinterval pi palette circle
+syn keyword gnuplotKeyword radius graph screen wedge nowedge ellipse size
+syn keyword gnuplotKeyword units xx xy yy histogram line textbox opaque
+syn keyword gnuplotKeyword border noborder
+" set surface
+syn keyword gnuplotKeyword surface implicit explicit
+" set table
+syn keyword gnuplotKeyword table
+" set terminal (list of terminals)
+syn keyword gnuplotKeyword terminal term push pop aed512 aed767 aifm aqua
+syn keyword gnuplotKeyword be cairo cairolatex canvas cgm context corel
+syn keyword gnuplotKeyword debug dumb dxf dxy800a eepic emf emxvga epscairo
+syn keyword gnuplotKeyword epslatex epson_180dpi excl fig ggi gif gpic hpgl
+syn keyword gnuplotKeyword grass hp2623a hp2648 hp500c hpljii hppj imagen
+syn keyword gnuplotKeyword jpeg kyo latex linux lua mf mif mp next openstep
+syn keyword gnuplotKeyword pbm pdf pdfcairo pm png pngcairo postscript
+syn keyword gnuplotKeyword pslatex pstex pstricks qms qt regis sun svg svga
+syn keyword gnuplotKeyword tek40 tek410x texdraw tgif tikz tkcanvas tpic
+syn keyword gnuplotKeyword vgagl vws vx384 windows wx wxt x11 xlib
+" keywords for 'set terminal'
+syn keyword gnuplotKeyword color monochrome dashlength dl eps pdf fontscale
+syn keyword gnuplotKeyword standalone blacktext colortext colourtext header
+syn keyword gnuplotKeyword noheader mono color solid dashed notransparent
+syn keyword gnuplotKeyword crop crop background input rounded butt square
+syn keyword gnuplotKeyword size fsize standalone name jsdir defaultsize
+syn keyword gnuplotKeyword timestamp notimestamp colour mitered beveled
+syn keyword gnuplotKeyword round squared palfuncparam blacktext nec_cp6
+syn keyword gnuplotKeyword mppoints inlineimages externalimages defaultfont
+syn keyword gnuplotKeyword aspect feed nofeed rotate small tiny standalone
+syn keyword gnuplotKeyword oldstyle newstyle level1 leveldefault level3
+syn keyword gnuplotKeyword background nobackground solid clip noclip
+syn keyword gnuplotKeyword colortext colourtext epson_60dpi epson_lx800
+syn keyword gnuplotKeyword okidata starc tandy_60dpi dpu414 nec_cp6 draft
+syn keyword gnuplotKeyword medium large normal landscape portrait big
+syn keyword gnuplotKeyword inches pointsmax textspecial texthidden
+syn keyword gnuplotKeyword thickness depth version acceleration giant
+syn keyword gnuplotKeyword delay loop optimize nooptimize pspoints
+syn keyword gnuplotKeyword FNT9X17 FNT13X25 interlace nointerlace courier
+syn keyword gnuplotKeyword originreset nooriginreset gparrows nogparrows
+syn keyword gnuplotKeyword picenvironment nopicenvironment tightboundingbox
+syn keyword gnuplotKeyword notightboundingbox charsize gppoints nogppoints
+syn keyword gnuplotKeyword fontscale textscale fulldoc nofulldoc standalone
+syn keyword gnuplotKeyword preamble header tikzplot tikzarrows notikzarrows
+syn keyword gnuplotKeyword cmykimages externalimages noexternalimages
+syn keyword gnuplotKeyword polyline vectors magnification psnfss nopsnfss
+syn keyword gnuplotKeyword psnfss-version7 prologues a4paper amstex fname
+syn keyword gnuplotKeyword fsize server persist widelines interlace
+syn keyword gnuplotKeyword truecolor notruecolor defaultplex simplex duplex
+syn keyword gnuplotKeyword nofontfiles adobeglyphnames noadobeglyphnames
+syn keyword gnuplotKeyword nostandalone metric textrigid animate nopspoints
+syn keyword gnuplotKeyword hpdj FNT5X9 roman emtex rgbimages bitmap
+syn keyword gnuplotKeyword nobitmap providevars nointerlace add delete
+syn keyword gnuplotKeyword auxfile hacktext unit raise palfuncparam
+syn keyword gnuplotKeyword noauxfile nohacktext nounit noraise ctrl noctrl
+syn keyword gnuplotKeyword close widget fixed dynamic tek40xx vttek
+syn keyword gnuplotKeyword kc-tek40xx km-tek40xx bitgraph perltk
+syn keyword gnuplotKeyword interactive red green blue interpolate mode
+syn keyword gnuplotKeyword position ctrlq replotonresize position noctrlq
+syn keyword gnuplotKeyword noreplotonresize
+" set termoption
+syn keyword gnuplotKeyword termoption font fontscale solid dashed
+" set tics
+syn keyword gnuplotKeyword tics add axis border mirror nomirror in out
+syn keyword gnuplotKeyword scale rotate norotate by offset nooffset left
+syn keyword gnuplotKeyword autojustify format font textcolor right center
+" deprecated set ticslevel
+syn keyword gnuplotError ticslevel ticscale
+" set timestamp
+syn keyword gnuplotKeyword timestamp top bottom offset font
+" set timefmt
+syn keyword gnuplotKeyword timefmt
+" set title
+syn keyword gnuplotKeyword title offset font textcolor tc
+" set ranges
+syn keyword gnuplotKeyword trange urange vrange
+" show variables
+syn keyword gnuplotKeyword variables
+" show version
+syn keyword gnuplotKeyword version
+" set view
+syn keyword gnuplotKeyword view map equal noequal xy xyz
+" set x2data
+syn keyword gnuplotKeyword xdata ydata zdata x2data y2data cbdata xdtics
+syn keyword gnuplotKeyword ydtics zdtics x2dtics y2dtics cbdtics xzeroaxis
+syn keyword gnuplotKeyword yzeroaxis zzeroaxis x2zeroaxis y2zeroaxis
+syn keyword gnuplotKeyword cbzeroaxis time geographic
+" set label
+syn keyword gnuplotKeyword xlabel ylabel zlabel x2label y2label cblabel
+syn keyword gnuplotKeyword offset font textcolor by parallel
+" set range
+syn keyword gnuplotKeyword xrange yrange zrange x2range y2range cbrange
+" set xyplane
+syn keyword gnuplotKeyword xyplane
+" set zeroaxis
+" set zero
+syn keyword gnuplotKeyword zero
+" set zeroaxis
+syn keyword gnuplotKeyword zeroaxis
+
+" keywords for 'stats' command
+syn keyword gnuplotKeyword nooutput
+
+" keywords for 'test' command
+syn keyword gnuplotKeyword terminal palette rgb rbg grb gbr brg bgr
+
+" ---- Macros ---- "
+
+syn region gnuplotMacro start="@" end=" "
+
+" ---- Todos ---- "
+
+syn keyword gnuplotTodo contained TODO FIXME XXX
+
+" ---- Types: gnuplot commands ---- "
+
+" I set the commands as Types to distinguish them visually from keywords for the
+" commands. This comes at the end of the syntax file because some commands
+" are redundant with keywords. It's probably too much trouble to go and
+" create special regions for each redundant keyword/command pair, which means
+" that some keywords (e.g. 'p') will be highlighted as commands.
+
+syn keyword gnuplotStatement cd call clear evaluate exit fit help history
+syn keyword gnuplotStatement load lower pause plot p print pwd quit raise
+syn keyword gnuplotStatement refresh replot rep reread reset save set show
+syn keyword gnuplotStatement shell splot spstats system test undefine unset
+syn keyword gnuplotStatement update
+
+" ---- Define the default highlighting ---- "
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_gnuplot_syntax_inits")
@@ -181,14 +510,41 @@ if version >= 508 || !exists("did_gnuplot_syntax_inits")
command -nargs=+ HiLink hi def link <args>
endif
- HiLink gnuplotStatement Statement
- HiLink gnuplotConditional Conditional
+ " ---- Comments ---- "
+ HiLink gnuplotComment Comment
+
+ " ---- Constants ---- "
+ HiLink gnuplotString String
HiLink gnuplotNumber Number
HiLink gnuplotFloat Float
+
+ " ---- Identifiers ---- "
+ HiLink gnuplotIdentifier Identifier
+
+ " ---- Statements ---- "
+ HiLink gnuplotConditional Conditional
+ HiLink gnuplotRepeat Repeat
+ HiLink gnuplotKeyword Keyword
+ HiLink gnuplotOperator Operator
+
+ " ---- PreProcs ---- "
+ HiLink gnuplotMacro Macro
+
+ " ---- Types ---- "
+ HiLink gnuplotStatement Type
+ HiLink gnuplotFunc Identifier
+
+ " ---- Specials ---- "
+ HiLink gnuplotSpecial Special
+ HiLink gnuplotUnit Special
+ HiLink gnuplotExternal Special
+
+ " ---- Errors ---- "
+ HiLink gnuplotError Error
HiLink gnuplotOctalError Error
- HiLink gnuplotFunc Type
- HiLink gnuplotType Type
- HiLink gnuplotComment Comment
+
+ " ---- Todos ---- "
+ HiLink gnuplotTodo Todo
delcommand HiLink
endif
diff --git a/runtime/syntax/go.vim b/runtime/syntax/go.vim
new file mode 100644
index 000000000..e78f8cf27
--- /dev/null
+++ b/runtime/syntax/go.vim
@@ -0,0 +1,208 @@
+" Vim syntax file
+" Language: Go
+" Maintainer: David Barnett (https://github.com/google/vim-ft-go)
+" Last Change: 2014 Aug 16
+
+" Options:
+" There are some options for customizing the highlighting; the recommended
+" settings are the default values, but you can write:
+" let OPTION_NAME = 0
+" in your ~/.vimrc file to disable particular options. You can also write:
+" let OPTION_NAME = 1
+" to enable particular options. At present, all options default to on.
+"
+" - g:go_highlight_array_whitespace_error
+" Highlights white space after "[]".
+" - g:go_highlight_chan_whitespace_error
+" Highlights white space around the communications operator that don't
+" follow the standard style.
+" - g:go_highlight_extra_types
+" Highlights commonly used library types (io.Reader, etc.).
+" - g:go_highlight_space_tab_error
+" Highlights instances of tabs following spaces.
+" - g:go_highlight_trailing_whitespace_error
+" Highlights trailing white space.
+
+" Quit when a (custom) syntax file was already loaded
+if exists('b:current_syntax')
+ finish
+endif
+
+if !exists('g:go_highlight_array_whitespace_error')
+ let g:go_highlight_array_whitespace_error = 1
+endif
+if !exists('g:go_highlight_chan_whitespace_error')
+ let g:go_highlight_chan_whitespace_error = 1
+endif
+if !exists('g:go_highlight_extra_types')
+ let g:go_highlight_extra_types = 1
+endif
+if !exists('g:go_highlight_space_tab_error')
+ let g:go_highlight_space_tab_error = 1
+endif
+if !exists('g:go_highlight_trailing_whitespace_error')
+ let g:go_highlight_trailing_whitespace_error = 1
+endif
+
+syn case match
+
+syn keyword goDirective package import
+syn keyword goDeclaration var const type
+syn keyword goDeclType struct interface
+
+hi def link goDirective Statement
+hi def link goDeclaration Keyword
+hi def link goDeclType Keyword
+
+" Keywords within functions
+syn keyword goStatement defer go goto return break continue fallthrough
+syn keyword goConditional if else switch select
+syn keyword goLabel case default
+syn keyword goRepeat for range
+
+hi def link goStatement Statement
+hi def link goConditional Conditional
+hi def link goLabel Label
+hi def link goRepeat Repeat
+
+" Predefined types
+syn keyword goType chan map bool string error
+syn keyword goSignedInts int int8 int16 int32 int64 rune
+syn keyword goUnsignedInts byte uint uint8 uint16 uint32 uint64 uintptr
+syn keyword goFloats float32 float64
+syn keyword goComplexes complex64 complex128
+
+hi def link goType Type
+hi def link goSignedInts Type
+hi def link goUnsignedInts Type
+hi def link goFloats Type
+hi def link goComplexes Type
+
+" Treat func specially: it's a declaration at the start of a line, but a type
+" elsewhere. Order matters here.
+syn match goType /\<func\>/
+syn match goDeclaration /^func\>/
+
+" Predefined functions and values
+syn keyword goBuiltins append cap close complex copy delete imag len
+syn keyword goBuiltins make new panic print println real recover
+syn keyword goConstants iota true false nil
+
+hi def link goBuiltins Keyword
+hi def link goConstants Keyword
+
+" Comments; their contents
+syn keyword goTodo contained TODO FIXME XXX BUG
+syn cluster goCommentGroup contains=goTodo
+syn region goComment start="/\*" end="\*/" contains=@goCommentGroup,@Spell
+syn region goComment start="//" end="$" contains=@goCommentGroup,@Spell
+
+hi def link goComment Comment
+hi def link goTodo Todo
+
+" Go escapes
+syn match goEscapeOctal display contained "\\[0-7]\{3}"
+syn match goEscapeC display contained +\\[abfnrtv\\'"]+
+syn match goEscapeX display contained "\\x\x\{2}"
+syn match goEscapeU display contained "\\u\x\{4}"
+syn match goEscapeBigU display contained "\\U\x\{8}"
+syn match goEscapeError display contained +\\[^0-7xuUabfnrtv\\'"]+
+
+hi def link goEscapeOctal goSpecialString
+hi def link goEscapeC goSpecialString
+hi def link goEscapeX goSpecialString
+hi def link goEscapeU goSpecialString
+hi def link goEscapeBigU goSpecialString
+hi def link goSpecialString Special
+hi def link goEscapeError Error
+
+" Strings and their contents
+syn cluster goStringGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU,goEscapeError
+syn region goString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup
+syn region goRawString start=+`+ end=+`+
+
+hi def link goString String
+hi def link goRawString String
+
+" Characters; their contents
+syn cluster goCharacterGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU
+syn region goCharacter start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@goCharacterGroup
+
+hi def link goCharacter Character
+
+" Regions
+syn region goBlock start="{" end="}" transparent fold
+syn region goParen start='(' end=')' transparent
+
+" Integers
+syn match goDecimalInt "\<\d\+\([Ee]\d\+\)\?\>"
+syn match goHexadecimalInt "\<0x\x\+\>"
+syn match goOctalInt "\<0\o\+\>"
+syn match goOctalError "\<0\o*[89]\d*\>"
+
+hi def link goDecimalInt Integer
+hi def link goHexadecimalInt Integer
+hi def link goOctalInt Integer
+hi def link Integer Number
+
+" Floating point
+syn match goFloat "\<\d\+\.\d*\([Ee][-+]\d\+\)\?\>"
+syn match goFloat "\<\.\d\+\([Ee][-+]\d\+\)\?\>"
+syn match goFloat "\<\d\+[Ee][-+]\d\+\>"
+
+hi def link goFloat Float
+
+" Imaginary literals
+syn match goImaginary "\<\d\+i\>"
+syn match goImaginary "\<\d\+\.\d*\([Ee][-+]\d\+\)\?i\>"
+syn match goImaginary "\<\.\d\+\([Ee][-+]\d\+\)\?i\>"
+syn match goImaginary "\<\d\+[Ee][-+]\d\+i\>"
+
+hi def link goImaginary Number
+
+" Spaces after "[]"
+if go_highlight_array_whitespace_error != 0
+ syn match goSpaceError display "\(\[\]\)\@<=\s\+"
+endif
+
+" Spacing errors around the 'chan' keyword
+if go_highlight_chan_whitespace_error != 0
+ " receive-only annotation on chan type
+ syn match goSpaceError display "\(<-\)\@<=\s\+\(chan\>\)\@="
+ " send-only annotation on chan type
+ syn match goSpaceError display "\(\<chan\)\@<=\s\+\(<-\)\@="
+ " value-ignoring receives in a few contexts
+ syn match goSpaceError display "\(\(^\|[={(,;]\)\s*<-\)\@<=\s\+"
+endif
+
+" Extra types commonly seen
+if go_highlight_extra_types != 0
+ syn match goExtraType /\<bytes\.\(Buffer\)\>/
+ syn match goExtraType /\<io\.\(Reader\|Writer\|ReadWriter\|ReadWriteCloser\)\>/
+ syn match goExtraType /\<reflect\.\(Kind\|Type\|Value\)\>/
+ syn match goExtraType /\<unsafe\.Pointer\>/
+endif
+
+" Space-tab error
+if go_highlight_space_tab_error != 0
+ syn match goSpaceError display " \+\t"me=e-1
+endif
+
+" Trailing white space error
+if go_highlight_trailing_whitespace_error != 0
+ syn match goSpaceError display excludenl "\s\+$"
+endif
+
+hi def link goExtraType Type
+hi def link goSpaceError Error
+
+" Search backwards for a global declaration to start processing the syntax.
+"syn sync match goSync grouphere NONE /^\(const\|var\|type\|func\)\>/
+
+" There's a bug in the implementation of grouphere. For now, use the
+" following as a more expensive/less precise workaround.
+syn sync minlines=500
+
+let b:current_syntax = 'go'
+
+" vim: sw=2 sts=2 et
diff --git a/runtime/syntax/godoc.vim b/runtime/syntax/godoc.vim
new file mode 100644
index 000000000..3a07903a7
--- /dev/null
+++ b/runtime/syntax/godoc.vim
@@ -0,0 +1,21 @@
+" Vim syntax file
+" Language: Godoc (generated documentation for go)
+" Maintainer: David Barnett (https://github.com/google/vim-ft-go)
+" Last Change: 2014 Aug 16
+
+if exists('b:current_syntax')
+ finish
+endif
+
+syn case match
+syn match godocTitle "^\([A-Z][A-Z ]*\)$"
+
+command -nargs=+ HiLink hi def link <args>
+
+HiLink godocTitle Title
+
+delcommand HiLink
+
+let b:current_syntax = 'godoc'
+
+" vim: sw=2 sts=2 et
diff --git a/runtime/syntax/html.vim b/runtime/syntax/html.vim
index d59126ded..ab1f9b3c1 100644
--- a/runtime/syntax/html.vim
+++ b/runtime/syntax/html.vim
@@ -2,7 +2,8 @@
" Language: HTML
" Maintainer: Claudio Fleiner <claudio@fleiner.com>
" URL: http://www.fleiner.com/vim/syntax/html.vim
-" Last Change: 2012 Oct 05
+" Last Change: 2015 Jan 07
+" included patch from David Felix
" Please check :help html.vim for some comments and a description of the options
@@ -168,7 +169,7 @@ if main_syntax != 'java' || exists("java_javascript")
" JAVA SCRIPT
syn include @htmlJavaScript syntax/javascript.vim
unlet b:current_syntax
- syn region javaScript start=+<script\_[^>]*>+ keepend end=+</script>+me=s-1 contains=@htmlJavaScript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc
+ syn region javaScript start=+<script\_[^>]*>+ keepend end=+</script\_[^>]*>+me=s-1 contains=@htmlJavaScript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc
syn region htmlScriptTag contained start=+<script+ end=+>+ fold contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent
HtmlHiLink htmlScriptTag htmlTag
@@ -193,7 +194,7 @@ if main_syntax != 'java' || exists("java_vb")
" VB SCRIPT
syn include @htmlVbScript syntax/vb.vim
unlet b:current_syntax
- syn region javaScript start=+<script \_[^>]*language *=\_[^>]*vbscript\_[^>]*>+ keepend end=+</script>+me=s-1 contains=@htmlVbScript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc
+ syn region javaScript start=+<script \_[^>]*language *=\_[^>]*vbscript\_[^>]*>+ keepend end=+</script\_[^>]*>+me=s-1 contains=@htmlVbScript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc
endif
syn cluster htmlJavaScript add=@htmlPreproc
diff --git a/runtime/syntax/htmldjango.vim b/runtime/syntax/htmldjango.vim
index 4b13863c0..58afd1b62 100644
--- a/runtime/syntax/htmldjango.vim
+++ b/runtime/syntax/htmldjango.vim
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: Django HTML template
" Maintainer: Dave Hodder <dmh@dmh.org.uk>
-" Last Change: 2007 Jan 26
+" Last Change: 2014 Jul 13
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
@@ -28,7 +28,7 @@ syn cluster djangoBlocks add=djangoTagBlock,djangoVarBlock,djangoComment,djangoC
syn region djangoTagBlock start="{%" end="%}" contains=djangoStatement,djangoFilter,djangoArgument,djangoTagError display containedin=ALLBUT,@djangoBlocks
syn region djangoVarBlock start="{{" end="}}" contains=djangoFilter,djangoArgument,djangoVarError display containedin=ALLBUT,@djangoBlocks
-syn region djangoComment start="{%\s*comment\s*%}" end="{%\s*endcomment\s*%}" contains=djangoTodo containedin=ALLBUT,@djangoBlocks
+syn region djangoComment start="{%\s*comment\(\s\+.\{-}\)\?%}" end="{%\s*endcomment\s*%}" contains=djangoTodo containedin=ALLBUT,@djangoBlocks
syn region djangoComBlock start="{#" end="#}" contains=djangoTodo containedin=ALLBUT,@djangoBlocks
let b:current_syntax = "htmldjango"
diff --git a/runtime/syntax/j.vim b/runtime/syntax/j.vim
index bde954506..0cdd59b88 100644
--- a/runtime/syntax/j.vim
+++ b/runtime/syntax/j.vim
@@ -2,7 +2,7 @@
" Language: J
" Maintainer: David Bürgin <676c7473@gmail.com>
" URL: https://github.com/glts/vim-j
-" Last Change: 2014-05-25
+" Last Change: 2014-10-05
if exists('b:current_syntax')
finish
@@ -12,7 +12,7 @@ let s:save_cpo = &cpo
set cpo&vim
syntax case match
-syntax sync minlines=50
+syntax sync minlines=100
syntax cluster jStdlibItems contains=jStdlibNoun,jStdlibAdverb,jStdlibConjunction,jStdlibVerb
syntax cluster jPrimitiveItems contains=jNoun,jAdverb,jConjunction,jVerb,jCopula
@@ -30,26 +30,32 @@ syntax keyword jStdlibVerb AND Endian IFDEF Note OR XOR alpha17 alpha27 anddf an
syntax match jStdlibNoun /\<\%(adverb\|conjunction\|dyad\|monad\|noun\|verb\)\>/
syntax match jStdlibVerb /\<\%(assert\|break\|do\)\>\.\@!/
-" Numbers. Matching J numbers is difficult. The regular expression used for
-" the general case roughly embodies this grammar sketch:
+" Numbers. Matching J numbers is difficult. In fact, the job cannot be done
+" with regular expressions alone. Below is a sketch of the pattern used. It
+" accepts most well-formed numbers and rejects most of the ill-formed ones.
+" See http://www.jsoftware.com/help/dictionary/dcons.htm for reference.
"
-" BASE := /_?\d+(\.\d*)?([eE]_?\d+)?/
-" RATIONAL := BASE | BASE r BASE
-" COMPLEX := BASE | BASE (j|a[dr]) BASE
-" JNUMBER := RATIONAL | RATIONAL [px] RATIONAL | COMPLEX | COMPLEX [px] COMPLEX
+" "double1" and "double2" patterns:
+" (_?\d+(\.\d*)?|_\.\d+)([eE]_?\d+)?
+" (_?\d+(\.\d*)?|_\.\d+|\.\d+)([eE]_?\d+)?
"
-" The grammar is implemented as shown in this pseudo-regexp:
+" "rational1" and "rational2" patterns:
+" \k<double1>(r\k<double2>)?|__?
+" \k<double2>(r\k<double2>)?|__?
"
-" base rational complex remainder
-" /\< B ( [r]B ([px]B([r]B)?)? | (j|a[dr])B ([px]B((j|a[dr])B)?)? | [px]B ((j|a[dr]|r)B)? )?/
+" "complex1" and "complex2" patterns:
+" \k<rational1>((j|a[dr])\k<rational2>)?
+" \k<rational2>((j|a[dr])\k<rational2>)?
"
-" All in all, a compromise between correctness and practicality had to be
-" made. See http://www.jsoftware.com/help/dictionary/dcons.htm for reference.
-syntax match jNumber /\<_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\%(\%(r_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\%([px]_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\%(r_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\)\=\)\=\)\|\%(\%(j\|a[dr]\)_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\%([px]_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\%(\%(j\|a[dr]\)_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\)\=\)\=\)\|\%([px]_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\%(\%(j\|a[dr]\|r\)_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\)\=\)\)\=/
-syntax match jNumber /\<_\=\d\+\%([eE]\d\+\)\=b_\=[0-9a-z]\+\%(\.[0-9a-z]\+\)\=/
-syntax match jNumber /\<__\=\>/
-syntax match jNumber /\<_\./
-syntax match jNumber /\<_\=\d\+x\>/
+" "basevalue" pattern:
+" _?[0-9a-z]+(\.[0-9a-z]*)?|_?\.[0-9a-z]+
+"
+" all numbers:
+" \b\k<complex1>([px]\k<complex2>)?(b\k<basevalue>)?(?![0-9A-Za-z_.])
+syntax match jNumber /\<_\.[0-9A-Za-z_.]\@!/
+syntax match jNumber /\<_\=\d\+x[0-9A-Za-z_.]\@!/
+syntax match jNumber /\<\%(__\=r_\=\d\+\|_\=\d\+r__\=\)[0-9A-Za-z_.]\@!/
+syntax match jNumber /\<\%(\%(_\=\d\+\%(\.\d*\)\=\|_\.\d\+\)\%([eE]_\=\d\+\)\=\%(r\%(_\=\d\+\%(\.\d*\)\=\|_\.\d\+\|\.\d\+\)\%([eE]_\=\d\+\)\=\)\=\|__\=\)\%(\%(j\|a[dr]\)\%(\%(_\=\d\+\%(\.\d*\)\=\|_\.\d\+\|\.\d\+\)\%([eE]_\=\d\+\)\=\%(r\%(_\=\d\+\%(\.\d*\)\=\|_\.\d\+\|\.\d\+\)\%([eE]_\=\d\+\)\=\)\=\|__\=\)\)\=\%([px]\%(\%(_\=\d\+\%(\.\d*\)\=\|_\.\d\+\|\.\d\+\)\%([eE]_\=\d\+\)\=\%(r\%(_\=\d\+\%(\.\d*\)\=\|_\.\d\+\|\.\d\+\)\%([eE]_\=\d\+\)\=\)\=\|__\=\)\%(\%(j\|a[dr]\)\%(\%(_\=\d\+\%(\.\d*\)\=\|_\.\d\+\|\.\d\+\)\%([eE]_\=\d\+\)\=\%(r\%(_\=\d\+\%(\.\d*\)\=\|_\.\d\+\|\.\d\+\)\%([eE]_\=\d\+\)\=\)\=\|__\=\)\)\=\)\=\%(b\%(_\=[0-9a-z]\+\%(\.[0-9a-z]*\)\=\|_\=\.[0-9a-z]\+\)\)\=[0-9A-Za-z_.]\@!/
syntax region jString oneline start=/'/ skip=/''/ end=/'/
diff --git a/runtime/syntax/json.vim b/runtime/syntax/json.vim
new file mode 100644
index 000000000..1fdfea2d0
--- /dev/null
+++ b/runtime/syntax/json.vim
@@ -0,0 +1,143 @@
+" Vim syntax file
+" Language: JSON
+" Maintainer: Eli Parra <eli@elzr.com>
+" Last Change: 2014 Aug 23
+" Version: 0.12
+
+if !exists("main_syntax")
+ if version < 600
+ syntax clear
+ elseif exists("b:current_syntax")
+ finish
+ endif
+ let main_syntax = 'json'
+endif
+
+syntax match jsonNoise /\%(:\|,\)/
+
+" NOTE that for the concealing to work your conceallevel should be set to 2
+
+" Syntax: Strings
+" Separated into a match and region because a region by itself is always greedy
+syn match jsonStringMatch /"\([^"]\|\\\"\)\+"\ze[[:blank:]\r\n]*[,}\]]/ contains=jsonString
+if has('conceal')
+ syn region jsonString oneline matchgroup=jsonQuote start=/"/ skip=/\\\\\|\\"/ end=/"/ concealends contains=jsonEscape contained
+else
+ syn region jsonString oneline matchgroup=jsonQuote start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=jsonEscape contained
+endif
+
+" Syntax: JSON does not allow strings with single quotes, unlike JavaScript.
+syn region jsonStringSQError oneline start=+'+ skip=+\\\\\|\\"+ end=+'+
+
+" Syntax: JSON Keywords
+" Separated into a match and region because a region by itself is always greedy
+syn match jsonKeywordMatch /"\([^"]\|\\\"\)\+"[[:blank:]\r\n]*\:/ contains=jsonKeyword
+if has('conceal')
+ syn region jsonKeyword matchgroup=jsonQuote start=/"/ end=/"\ze[[:blank:]\r\n]*\:/ concealends contained
+else
+ syn region jsonKeyword matchgroup=jsonQuote start=/"/ end=/"\ze[[:blank:]\r\n]*\:/ contained
+endif
+
+" Syntax: Escape sequences
+syn match jsonEscape "\\["\\/bfnrt]" contained
+syn match jsonEscape "\\u\x\{4}" contained
+
+" Syntax: Numbers
+syn match jsonNumber "-\=\<\%(0\|[1-9]\d*\)\%(\.\d\+\)\=\%([eE][-+]\=\d\+\)\=\>\ze[[:blank:]\r\n]*[,}\]]"
+
+" ERROR WARNINGS **********************************************
+if (!exists("g:vim_json_warnings") || g:vim_json_warnings==1)
+ " Syntax: Strings should always be enclosed with quotes.
+ syn match jsonNoQuotesError "\<[[:alpha:]][[:alnum:]]*\>"
+ syn match jsonTripleQuotesError /"""/
+
+ " Syntax: An integer part of 0 followed by other digits is not allowed.
+ syn match jsonNumError "-\=\<0\d\.\d*\>"
+
+ " Syntax: Decimals smaller than one should begin with 0 (so .1 should be 0.1).
+ syn match jsonNumError "\:\@<=[[:blank:]\r\n]*\zs\.\d\+"
+
+ " Syntax: No comments in JSON, see http://stackoverflow.com/questions/244777/can-i-comment-a-json-file
+ syn match jsonCommentError "//.*"
+ syn match jsonCommentError "\(/\*\)\|\(\*/\)"
+
+ " Syntax: No semicolons in JSON
+ syn match jsonSemicolonError ";"
+
+ " Syntax: No trailing comma after the last element of arrays or objects
+ syn match jsonTrailingCommaError ",\_s*[}\]]"
+
+ " Syntax: Watch out for missing commas between elements
+ syn match jsonMissingCommaError /\("\|\]\|\d\)\zs\_s\+\ze"/
+ syn match jsonMissingCommaError /\(\]\|\}\)\_s\+\ze"/ "arrays/objects as values
+ syn match jsonMissingCommaError /}\_s\+\ze{/ "objects as elements in an array
+ syn match jsonMissingCommaError /\(true\|false\)\_s\+\ze"/ "true/false as value
+endif
+
+" ********************************************** END OF ERROR WARNINGS
+" Allowances for JSONP: function call at the beginning of the file,
+" parenthesis and semicolon at the end.
+" Function name validation based on
+" http://stackoverflow.com/questions/2008279/validate-a-javascript-function-name/2008444#2008444
+syn match jsonPadding "\%^[[:blank:]\r\n]*[_$[:alpha:]][_$[:alnum:]]*[[:blank:]\r\n]*("
+syn match jsonPadding ");[[:blank:]\r\n]*\%$"
+
+" Syntax: Boolean
+syn match jsonBoolean /\(true\|false\)\(\_s\+\ze"\)\@!/
+
+" Syntax: Null
+syn keyword jsonNull null
+
+" Syntax: Braces
+syn region jsonFold matchgroup=jsonBraces start="{" end=/}\(\_s\+\ze\("\|{\)\)\@!/ transparent fold
+syn region jsonFold matchgroup=jsonBraces start="\[" end=/]\(\_s\+\ze"\)\@!/ transparent fold
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_json_syn_inits")
+ if version < 508
+ let did_json_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+ HiLink jsonPadding Operator
+ HiLink jsonString String
+ HiLink jsonTest Label
+ HiLink jsonEscape Special
+ HiLink jsonNumber Number
+ HiLink jsonBraces Delimiter
+ HiLink jsonNull Function
+ HiLink jsonBoolean Boolean
+ HiLink jsonKeyword Label
+
+ if (!exists("g:vim_json_warnings") || g:vim_json_warnings==1)
+ HiLink jsonNumError Error
+ HiLink jsonCommentError Error
+ HiLink jsonSemicolonError Error
+ HiLink jsonTrailingCommaError Error
+ HiLink jsonMissingCommaError Error
+ HiLink jsonStringSQError Error
+ HiLink jsonNoQuotesError Error
+ HiLink jsonTripleQuotesError Error
+ endif
+ HiLink jsonQuote Quote
+ HiLink jsonNoise Noise
+ delcommand HiLink
+endif
+
+let b:current_syntax = "json"
+if main_syntax == 'json'
+ unlet main_syntax
+endif
+
+" Vim settings
+" vim: ts=8 fdm=marker
+
+" MIT License
+" Copyright (c) 2013, Jeroen Ruigrok van der Werven, Eli Parra
+"Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+"The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+"THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+"See https://twitter.com/elzr/status/294964017926119424
diff --git a/runtime/syntax/less.vim b/runtime/syntax/less.vim
new file mode 100644
index 000000000..5cc8c6d7b
--- /dev/null
+++ b/runtime/syntax/less.vim
@@ -0,0 +1,79 @@
+" Vim syntax file
+" Language: less
+" Maintainer: Alessandro Vioni <jenoma@gmail.com>
+" URL: https://github.com/genoma/vim-less
+" Last Change: 2014 November 24
+
+if exists("b:current_syntax")
+ finish
+endif
+
+runtime! syntax/css.vim
+runtime! after/syntax/css.vim
+
+syn case ignore
+
+syn cluster lessCssProperties contains=cssFontProp,cssFontDescriptorProp,cssColorProp,cssTextProp,cssBoxProp,cssGeneratedContentProp,cssPagingProp,cssUIProp,cssRenderProp,cssAuralProp,cssTableProp
+syn cluster lessCssAttributes contains=css.*Attr,lessEndOfLineComment,lessComment,cssValue.*,cssColor,cssURL,lessDefault,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssRenderProp
+
+syn region lessDefinition matchgroup=cssBraces start="{" end="}" contains=TOP
+
+syn match lessProperty "\%([{};]\s*\|^\)\@<=\%([[:alnum:]-]\|#{[^{}]*}\)\+\s*:" contains=css.*Prop skipwhite nextgroup=lessCssAttribute contained containedin=lessDefinition
+syn match lessProperty "^\s*\zs\s\%(\%([[:alnum:]-]\|#{[^{}]*}\)\+\s*:\|:[[:alnum:]-]\+\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=lessCssAttribute
+syn match lessProperty "^\s*\zs\s\%(:\=[[:alnum:]-]\+\s*=\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=lessCssAttribute
+syn match lessCssAttribute +\%("\%([^"]\|\\"\)*"\|'\%([^']\|\\'\)*'\|#{[^{}]*}\|[^{};]\)*+ contained contains=@lessCssAttributes,lessVariable,lessFunction,lessInterpolation
+syn match lessDefault "!default\>" contained
+
+" less variables and media queries
+syn match lessVariable "@[[:alnum:]_-]\+" nextgroup=lessCssAttribute skipwhite
+syn match lessMedia "@media" nextgroup=lessCssAttribute skipwhite
+
+" Less functions
+syn match lessFunction "\<\%(escape\|e\|unit\)\>(\@=" contained
+syn match lessFunction "\<\%(ceil\|floor\|percentage\|round\|sqrt\|abs\|sin\|asin\|cos\|acos\|tan\|atan\|pi\|pow\|min\|max\)\>(\@=" contained
+syn match lessFunction "\<\%(rgb\|rgba\|argb\|argb\|hsl\|hsla\|hsv\|hsva\)\>(\@=" contained
+syn match lessFunction "\<\%(hue\|saturation\|lightness\|red\|green\|blue\|alpha\|luma\)\>(\@=" contained
+syn match lessFunction "\<\%(saturate\|desaturate\|lighten\|darken\|fadein\|fadeout\|fade\|spin\|mix\|greyscale\|contrast\)\>(\@=" contained
+syn match lessFunction "\<\%(multiply\|screen\|overlay\|softlight\|hardlight\|difference\|exclusion\|average\|negation\)\>(\@=" contained
+
+" Less id class visualization
+syn match lessIdChar "#[[:alnum:]_-]\@=" nextgroup=lessId,lessClassIdCall
+syn match lessId "[[:alnum:]_-]\+" contained
+syn match lessClassIdCall "[[:alnum:]_-]\+()" contained
+
+syn match lessClassChar "\.[[:alnum:]_-]\@=" nextgroup=lessClass,lessClassCall
+syn match lessClass "[[:alnum:]_-]\+" contained
+syn match lessClassCall "[[:alnum:]_-]\+()" contained
+
+syn match lessAmpersand "&" contains=lessIdChar,lessClassChar
+
+syn region lessInclude start="@import" end=";\|$" contains=lessComment,cssURL,cssUnicodeEscape,cssMediaType,cssStringQ,cssStringQQ
+
+syn keyword lessTodo FIXME NOTE TODO OPTIMIZE XXX contained
+syn region lessComment start="^\z(\s*\)//" end="^\%(\z1 \)\@!" contains=lessTodo,@Spell
+syn region lessCssComment start="^\z(\s*\)/\*" end="^\%(\z1 \)\@!" contains=lessTodo,@Spell
+syn match lessEndOfLineComment "//.*" contains=lessComment,lessTodo,@Spell
+
+hi def link lessEndOfLineComment lessComment
+hi def link lessCssComment lessComment
+hi def link lessComment Comment
+hi def link lessDefault cssImportant
+hi def link lessVariable Identifier
+hi def link lessFunction PreProc
+hi def link lessTodo Todo
+hi def link lessInclude Include
+hi def link lessIdChar Special
+hi def link lessClassChar Special
+hi def link lessAmpersand Character
+hi def link lessId Identifier
+hi def link lessClass Type
+hi def link lessCssAttribute PreProc
+hi def link lessClassCall Type
+hi def link lessClassIdCall Type
+hi def link lessTagName cssTagName
+hi def link lessDeprecated cssDeprecated
+hi def link lessMedia cssMedia
+
+let b:current_syntax = "less"
+
+" vim:set sw=2:
diff --git a/runtime/syntax/lisp.vim b/runtime/syntax/lisp.vim
index 74ec20bb4..2528f4f9b 100644
--- a/runtime/syntax/lisp.vim
+++ b/runtime/syntax/lisp.vim
@@ -1,28 +1,23 @@
" Vim syntax file
" Language: Lisp
-" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
-" Last Change: Nov 16, 2010
-" Version: 22
-" URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
+" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
+" Last Change: Oct 06, 2014
+" Version: 23
+" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_LISP
"
-" Thanks to F Xavier Noria for a list of 978 Common Lisp symbols
-" taken from the HyperSpec
+" Thanks to F Xavier Noria for a list of 978 Common Lisp symbols taken from HyperSpec
" Clisp additions courtesy of http://clisp.cvs.sourceforge.net/*checkout*/clisp/clisp/emacs/lisp.vim
" ---------------------------------------------------------------------
" Load Once: {{{1
-" For vim-version 5.x: Clear all syntax items
-" For vim-version 6.x: Quit when a syntax file was already loaded
-if version < 600
- syntax clear
-elseif exists("b:current_syntax")
- finish
+if exists("b:current_syntax")
+ finish
endif
-if version >= 600
- setlocal iskeyword=38,42,43,45,47-58,60-62,64-90,97-122,_
+if exists("g:lisp_isk")
+ exe "setl isk=".g:lisp_isk
else
- set iskeyword=38,42,43,45,47-58,60-62,64-90,97-122,_
+ setl isk=38,42,43,45,47-58,60-62,64-90,97-122,_
endif
if exists("g:lispsyntax_ignorecase") || exists("g:lispsyntax_clisp")
diff --git a/runtime/syntax/maple.vim b/runtime/syntax/maple.vim
index b6e4ae924..9c9464383 100644
--- a/runtime/syntax/maple.vim
+++ b/runtime/syntax/maple.vim
@@ -1,9 +1,9 @@
" Vim syntax file
" Language: Maple V (based on release 4)
-" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
-" Last Change: Jan 05, 2010
-" Version: 10
-" URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
+" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
+" Last Change: Oct 23, 2014
+" Version: 11
+" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_MAPLE
"
" Package Function Selection: {{{1
" Because there are a lot of packages, and because of the potential for namespace
diff --git a/runtime/syntax/netrw.vim b/runtime/syntax/netrw.vim
index 16e3c90c4..980fe5dde 100644
--- a/runtime/syntax/netrw.vim
+++ b/runtime/syntax/netrw.vim
@@ -1,7 +1,7 @@
" Language : Netrw Remote-Directory Listing Syntax
-" Maintainer : Charles E. Campbell, Jr.
-" Last change: Mar 07, 2014
-" Version : 18
+" Maintainer : Charles E. Campbell
+" Last change: Oct 06, 2014
+" Version : 19
" ---------------------------------------------------------------------
" Syntax Clearing: {{{1
@@ -16,7 +16,7 @@ endif
syn cluster NetrwGroup contains=netrwHide,netrwSortBy,netrwSortSeq,netrwQuickHelp,netrwVersion,netrwCopyTgt
syn cluster NetrwTreeGroup contains=netrwDir,netrwSymLink,netrwExe
-syn match netrwPlain "\(\S\+ \)*\S\+" contains=@NoSpell
+syn match netrwPlain "\(\S\+ \)*\S\+" contains=netrwLink,@NoSpell
syn match netrwSpecial "\%(\S\+ \)*\S\+[*|=]\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell
syn match netrwDir "\.\{1,2}/" contains=netrwClassify,@NoSpell
"syn match netrwDir "\%(\S\+ \)*\S\+/" contains=netrwClassify,@NoSpell
@@ -24,7 +24,11 @@ syn match netrwDir "\%(\S\+ \)*\S\+/\ze\%(\s\{2,}\|$\)" contains=netrwClassi
syn match netrwSizeDate "\<\d\+\s\d\{1,2}/\d\{1,2}/\d\{4}\s" skipwhite contains=netrwDateSep,@NoSpell nextgroup=netrwTime
syn match netrwSymLink "\%(\S\+ \)*\S\+@\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell
syn match netrwExe "\%(\S\+ \)*\S*[^~]\*\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell
+if has("gui_running") && (&enc == 'utf-8' || &enc == 'utf-16' || &enc == 'ucs-4')
syn match netrwTreeBar "^\%([-+|│] \)\+" contains=netrwTreeBarSpace nextgroup=@netrwTreeGroup
+else
+syn match netrwTreeBar "^\%([-+|] \)\+" contains=netrwTreeBarSpace nextgroup=@netrwTreeGroup
+endif
syn match netrwTreeBarSpace " " contained
syn match netrwClassify "[*=|@/]\ze\%(\s\{2,}\|$\)" contained
@@ -44,10 +48,11 @@ syn match netrwList ".*$" contained contains=netrwComma,@NoSpell
syn match netrwComma "," contained
syn region netrwQuickHelp matchgroup=Comment start="Quick Help:\s\+" end="$" contains=netrwHelpCmd,netrwQHTopic,@NoSpell keepend contained
syn match netrwHelpCmd "\S\+\ze:" contained skipwhite contains=@NoSpell nextgroup=netrwCmdSep
-syn match netrwQHTopic "-\a\+-" contained skipwhite
+syn match netrwQHTopic "([a-zA-Z &]\+)" contained skipwhite
syn match netrwCmdSep ":" contained nextgroup=netrwCmdNote
syn match netrwCmdNote ".\{-}\ze " contained contains=@NoSpell
syn match netrwVersion "(netrw.*)" contained contains=@NoSpell
+syn match netrwLink "-->" contained skipwhite
" -----------------------------
" Special filetype highlighting {{{1
@@ -95,6 +100,7 @@ if !exists("did_drchip_netrwlist_syntax")
hi default link netrwComma netrwComment
hi default link netrwHide netrwComment
hi default link netrwMarkFile TabLineSel
+ hi default link netrwLink Special
" special syntax highlighting (see :he g:netrw_special_syntax)
hi default link netrwBak NonText
diff --git a/runtime/syntax/php.vim b/runtime/syntax/php.vim
index f27d92340..5ec5d5a39 100644
--- a/runtime/syntax/php.vim
+++ b/runtime/syntax/php.vim
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: php PHP 3/4/5
" Maintainer: Jason Woofenden <jason@jasonwoof.com>
-" Last Change: Aug 28, 2013
+" Last Change: Sep 18, 2014
" URL: https://gitorious.org/jasonwoof/vim-syntax/blobs/master/php.vim
" Former Maintainers: Peter Hodge <toomuchphp-vim@yahoo.com>
" Debian VIM Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
@@ -123,7 +123,11 @@ syn keyword phpEnvVar GATEWAY_INTERFACE SERVER_NAME SERVER_SOFTWARE SERVER_PROTO
syn keyword phpIntVar GLOBALS PHP_ERRMSG PHP_SELF HTTP_GET_VARS HTTP_POST_VARS HTTP_COOKIE_VARS HTTP_POST_FILES HTTP_ENV_VARS HTTP_SERVER_VARS HTTP_SESSION_VARS HTTP_RAW_POST_DATA HTTP_STATE_VARS _GET _POST _COOKIE _FILES _SERVER _ENV _SERVER _REQUEST _SESSION contained
" Constants
-syn keyword phpCoreConstant PHP_VERSION PHP_OS DEFAULT_INCLUDE_PATH PEAR_INSTALL_DIR PEAR_EXTENSION_DIR PHP_EXTENSION_DIR PHP_BINDIR PHP_LIBDIR PHP_DATADIR PHP_SYSCONFDIR PHP_LOCALSTATEDIR PHP_CONFIG_FILE_PATH PHP_OUTPUT_HANDLER_START PHP_OUTPUT_HANDLER_CONT PHP_OUTPUT_HANDLER_END E_ERROR E_WARNING E_PARSE E_NOTICE E_CORE_ERROR E_CORE_WARNING E_COMPILE_ERROR E_COMPILE_WARNING E_USER_ERROR E_USER_WARNING E_USER_NOTICE E_ALL contained
+syn keyword phpCoreConstant PHP_VERSION PHP_OS DEFAULT_INCLUDE_PATH PEAR_INSTALL_DIR PEAR_EXTENSION_DIR PHP_EXTENSION_DIR PHP_BINDIR PHP_LIBDIR PHP_DATADIR PHP_SYSCONFDIR PHP_LOCALSTATEDIR PHP_CONFIG_FILE_PATH PHP_OUTPUT_HANDLER_START PHP_OUTPUT_HANDLER_CONT PHP_OUTPUT_HANDLER_END contained
+
+" Predefined constants
+" Generated by: curl -q http://php.net/manual/en/errorfunc.constants.php | grep -oP 'E_\w+' | sort -u
+syn keyword phpCoreConstant E_ALL E_COMPILE_ERROR E_COMPILE_WARNING E_CORE_ERROR E_CORE_WARNING E_DEPRECATED E_ERROR E_NOTICE E_PARSE E_RECOVERABLE_ERROR E_STRICT E_USER_DEPRECATED E_USER_ERROR E_USER_NOTICE E_USER_WARNING E_WARNING contained
syn case ignore
@@ -502,11 +506,6 @@ syn keyword phpStructure trait
" Some of these changes (highlighting isset/unset/echo etc) are not so
" critical, but they make things more colourful. :-)
-" highlight constant E_STRICT
-syntax case match
-syntax keyword phpCoreConstant E_STRICT contained
-syntax case ignore
-
" different syntax highlighting for 'echo', 'print', 'switch', 'die' and 'list' keywords
" to better indicate what they are.
syntax keyword phpDefine echo print contained
diff --git a/runtime/syntax/python.vim b/runtime/syntax/python.vim
index 71b4405e9..a4ffcd424 100644
--- a/runtime/syntax/python.vim
+++ b/runtime/syntax/python.vim
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: Python
" Maintainer: Neil Schemenauer <nas@python.ca>
-" Last Change: 2013 Feb 26
+" Last Change: 2014 Jul 16
" Credits: Zvezdan Petkovic <zpetkovic@acm.org>
" Neil Schemenauer <nas@python.ca>
" Dmitry Vasiliev
@@ -113,7 +113,7 @@ syn match pythonEscape "\\\o\{1,3}" contained
syn match pythonEscape "\\x\x\{2}" contained
syn match pythonEscape "\%(\\u\x\{4}\|\\U\x\{8}\)" contained
" Python allows case-insensitive Unicode IDs: http://www.unicode.org/charts/
-syn match pythonEscape "\\N{\a\+\%(\s\a\+\)*}" contained
+syn match pythonEscape "\\N{.\{-}}" contained
syn match pythonEscape "\\$"
if exists("python_highlight_all")
diff --git a/runtime/syntax/r.vim b/runtime/syntax/r.vim
index 85a6eaa2a..9677823fb 100644
--- a/runtime/syntax/r.vim
+++ b/runtime/syntax/r.vim
@@ -3,12 +3,11 @@
" Maintainer: Jakson Aquino <jalvesaq@gmail.com>
" Former Maintainers: Vaidotas Zemlys <zemlys@gmail.com>
" Tom Payne <tom@tompayne.org>
-" Last Change: Wed Jul 09, 2014 10:29PM
+" Last Change: Wed Dec 31, 2014 12:36AM
" Filenames: *.R *.r *.Rhistory *.Rt
-"
-" NOTE: The highlighting of R functions is defined in the
-" r-plugin/functions.vim, which is part of vim-r-plugin2:
-" http://www.vim.org/scripts/script.php?script_id=2628
+"
+" NOTE: The highlighting of R functions is defined in
+" runtime files created by a filetype plugin, if installed.
"
" CONFIGURATION:
" syntax folding can be turned on by
@@ -37,9 +36,9 @@ syn match rComment contains=@Spell,rCommentTodo "#.*"
syn match rOKeyword contained "@\(param\|return\|name\|rdname\|examples\|include\|docType\)"
syn match rOKeyword contained "@\(S3method\|TODO\|aliases\|alias\|assignee\|author\|callGraphDepth\|callGraph\)"
syn match rOKeyword contained "@\(callGraphPrimitives\|concept\|exportClass\|exportMethod\|exportPattern\|export\|formals\)"
-syn match rOKeyword contained "@\(format\|importClassesFrom\|importFrom\|importMethodsFrom\|import\|keywords\)"
+syn match rOKeyword contained "@\(format\|importClassesFrom\|importFrom\|importMethodsFrom\|import\|keywords\|useDynLib\)"
syn match rOKeyword contained "@\(method\|noRd\|note\|references\|seealso\|setClass\|slot\|source\|title\|usage\)"
-syn match rOKeyword contained "@\(family\|template\|templateVar\|description\|details\|inheritsParams\)"
+syn match rOKeyword contained "@\(family\|template\|templateVar\|description\|details\|inheritParams\)"
syn match rOComment contains=@Spell,rOKeyword "#'.*"
@@ -79,12 +78,12 @@ syn keyword rRepeat for in repeat while
syn keyword rConstant T F LETTERS letters month.abb month.name pi
syn keyword rConstant R.version.string
-syn keyword rNumber NA_integer_ NA_real_ NA_complex_ NA_character_
+syn keyword rNumber NA_integer_ NA_real_ NA_complex_ NA_character_
" Constants
syn keyword rConstant NULL
syn keyword rBoolean FALSE TRUE
-syn keyword rNumber NA Inf NaN
+syn keyword rNumber NA Inf NaN
" integer
syn match rInteger "\<\d\+L"
@@ -93,7 +92,7 @@ syn match rInteger "\<\d\+[Ee]+\=\d\+L"
" number with no fractional part or exponent
syn match rNumber "\<\d\+\>"
-" hexadecimal number
+" hexadecimal number
syn match rNumber "\<0x\([0-9]\|[a-f]\|[A-F]\)\+"
" floating point number with integer and fractional parts and optional exponent
@@ -111,17 +110,19 @@ syn match rComplex "\<\d\+\.\d*\([Ee][-+]\=\d\+\)\=i"
syn match rComplex "\<\.\d\+\([Ee][-+]\=\d\+\)\=i"
syn match rComplex "\<\d\+[Ee][-+]\=\d\+i"
+syn match rAssign '='
syn match rOperator "&"
syn match rOperator '-'
syn match rOperator '\*'
syn match rOperator '+'
-syn match rOperator '='
if &filetype != "rmd" && &filetype != "rrst"
syn match rOperator "[|!<>^~/:]"
else
syn match rOperator "[|!<>^~`/:]"
endif
syn match rOperator "%\{2}\|%\S\{-}%"
+syn match rOperator '\([!><]\)\@<=='
+syn match rOperator '=='
syn match rOpError '\*\{3}'
syn match rOpError '//'
syn match rOpError '&&&'
@@ -129,8 +130,8 @@ syn match rOpError '|||'
syn match rOpError '<<'
syn match rOpError '>>'
-syn match rArrow "<\{1,2}-"
-syn match rArrow "->\{1,2}"
+syn match rAssign "<\{1,2}-"
+syn match rAssign "->\{1,2}"
" Special
syn match rDelimiter "[,;:]"
@@ -151,9 +152,14 @@ syn match rBraceError "[)}]" contained
syn match rCurlyError "[)\]]" contained
syn match rParenError "[\]}]" contained
-" Source list of R functions. The list is produced by the Vim-R-plugin
-" http://www.vim.org/scripts/script.php?script_id=2628
-runtime r-plugin/functions.vim
+" Source list of R functions produced by a filetype plugin (if installed)
+if has("nvim")
+ " Nvim-R
+ runtime R/functions.vim
+else
+ " Vim-R-plugin
+ runtime r-plugin/functions.vim
+endif
syn match rDollar display contained "\$"
syn match rDollar display contained "@"
@@ -171,7 +177,7 @@ if &filetype == "rhelp"
endif
" Type
-syn keyword rType array category character complex double function integer list logical matrix numeric vector data.frame
+syn keyword rType array category character complex double function integer list logical matrix numeric vector data.frame
" Name of object with spaces
if &filetype != "rmd" && &filetype != "rrst"
@@ -179,13 +185,19 @@ if &filetype != "rmd" && &filetype != "rrst"
endif
if &filetype == "rhelp"
- syn match rhPreProc "^#ifdef.*"
- syn match rhPreProc "^#endif.*"
+ syn match rhPreProc "^#ifdef.*"
+ syn match rhPreProc "^#endif.*"
syn match rhSection "\\dontrun\>"
endif
+if exists("r_syn_minlines")
+ exe "syn sync minlines=" . r_syn_minlines
+else
+ syn sync minlines=40
+endif
+
" Define the default highlighting.
-hi def link rArrow Statement
+hi def link rAssign Statement
hi def link rBoolean Boolean
hi def link rBraceError Error
hi def link rComment Comment
@@ -204,7 +216,7 @@ hi def link rHelpIdent Identifier
hi def link rhPreProc PreProc
hi def link rhSection PreCondit
hi def link rInteger Number
-hi def link rLstElmt Normal
+hi def link rLstElmt Normal
hi def link rNameWSpace Normal
hi def link rNumber Number
hi def link rOperator Operator
diff --git a/runtime/syntax/registry.vim b/runtime/syntax/registry.vim
index e9ff8fcab..4524247a0 100644
--- a/runtime/syntax/registry.vim
+++ b/runtime/syntax/registry.vim
@@ -1,8 +1,9 @@
" Vim syntax file
" Language: Windows Registry export with regedit (*.reg)
-" Maintainer: Dominique Stphan (dominique@mggen.com)
-" URL: http://www.mggen.com/vim/syntax/registry.zip
-" Last change: 2004 Apr 23
+" Maintainer: Dominique Stéphan (dominique@mggen.com)
+" URL: http://www.mggen.com/vim/syntax/registry.zip (doesn't work)
+" Last change: 2014 Oct 31
+" Included patch from Alexander A. Ulitin
" clear any unwanted syntax defs
" For version 5.x: Clear all syntax items
@@ -17,7 +18,7 @@ endif
syn case ignore
" Head of regedit .reg files, it's REGEDIT4 on Win9#/NT
-syn match registryHead "^REGEDIT[0-9]*$"
+syn match registryHead "^REGEDIT[0-9]*\s*$\|^Windows Registry Editor Version \d*\.\d*\s*$"
" Comment
syn match registryComment "^;.*$"
@@ -58,7 +59,7 @@ syn region registryRemove start="\[\-" end="\]" contains=registryHKEY,registryGU
" Subkey
syn match registrySubKey "^\".*\"="
" Default value
-syn match registrySubKey "^\@="
+syn match registrySubKey "^@="
" Numbers
diff --git a/runtime/syntax/rpcgen.vim b/runtime/syntax/rpcgen.vim
index 548f8c807..86b997c29 100644
--- a/runtime/syntax/rpcgen.vim
+++ b/runtime/syntax/rpcgen.vim
@@ -1,9 +1,9 @@
" Vim syntax file
" Language: rpcgen
-" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
-" Last Change: Sep 06, 2005
-" Version: 8
-" URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
+" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
+" Last Change: Oct 23, 2014
+" Version: 9
+" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_RPCGEN
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
diff --git a/runtime/syntax/rst.vim b/runtime/syntax/rst.vim
index 425d22511..c1f25699e 100644
--- a/runtime/syntax/rst.vim
+++ b/runtime/syntax/rst.vim
@@ -1,7 +1,8 @@
" Vim syntax file
-" Language: reStructuredText documentation format
-" Maintainer: Nikolai Weibull <now@bitwi.se>
-" Latest Revision: 2013-11-26
+" Language: reStructuredText documentation format
+" Maintainer: Marshall Ward <marshall.ward@gmail.com>
+" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
+" Latest Revision: 2014-10-03
if exists("b:current_syntax")
finish
@@ -47,7 +48,7 @@ syn match rstSimpleTableLines contained display
syn cluster rstDirectives contains=rstFootnote,rstCitation,
\ rstHyperlinkTarget,rstExDirective
-syn match rstExplicitMarkup '^\.\.\_s'
+syn match rstExplicitMarkup '^\s*\.\.\_s'
\ nextgroup=@rstDirectives,rstComment,rstSubstitutionDefinition
let s:ReferenceName = '[[:alnum:]]\+\%([_.-][[:alnum:]]\+\)*'
@@ -99,11 +100,11 @@ function! s:DefineInlineMarkup(name, start, middle, end)
\ ""
call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, "'", "'")
- call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '"', '"')
- call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '(', ')')
- call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '\[', '\]')
- call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '{', '}')
- call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '<', '>')
+ call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '"', '"')
+ call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '(', ')')
+ call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '\[', '\]')
+ call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '{', '}')
+ call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '<', '>')
call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '\%(^\|\s\|[/:]\)', '')
@@ -136,24 +137,32 @@ syn match rstStandaloneHyperlink contains=@NoSpell
\ "\<\%(\%(\%(https\=\|file\|ftp\|gopher\)://\|\%(mailto\|news\):\)[^[:space:]'\"<>]\+\|www[[:alnum:]_-]*\.[[:alnum:]_-]\+\.[^[:space:]'\"<>]\+\)[[:alnum:]/]"
syn region rstCodeBlock contained matchgroup=rstDirective
- \ start=+\%(sourcecode\|code\%(-block\)\=\)::\s+
+ \ start=+\%(sourcecode\|code\%(-block\)\=\)::\_s*\n\ze\z(\s\+\)+
\ skip=+^$+
- \ end=+^\s\@!+
+ \ end=+^\z1\@!+
\ contains=@NoSpell
syn cluster rstDirectives add=rstCodeBlock
if !exists('g:rst_syntax_code_list')
- let g:rst_syntax_code_list = ['vim', 'java', 'cpp', 'lisp', 'php', 'python', 'perl']
+ let g:rst_syntax_code_list = ['vim', 'java', 'cpp', 'lisp', 'php',
+ \ 'python', 'perl', 'sh']
endif
for code in g:rst_syntax_code_list
unlet! b:current_syntax
+ " guard against setting 'isk' option which might cause problems (issue #108)
+ let prior_isk = &l:iskeyword
exe 'syn include @rst'.code.' syntax/'.code.'.vim'
exe 'syn region rstDirective'.code.' matchgroup=rstDirective fold '
- \.'start=#\%(sourcecode\|code\%(-block\)\=\)::\s\+'.code.'\s*$# '
+ \.'start=#\%(sourcecode\|code\%(-block\)\=\)::\s\+'.code.'\_s*\n\ze\z(\s\+\)# '
\.'skip=#^$# '
- \.'end=#^\s\@!# contains=@NoSpell,@rst'.code.' keepend'
+ \.'end=#^\z1\@!# contains=@NoSpell,@rst'.code
exe 'syn cluster rstDirectives add=rstDirective'.code
+ " reset 'isk' setting, if it has been changed
+ if &l:iskeyword !=# prior_isk
+ let &l:iskeyword = prior_isk
+ endif
+ unlet! prior_isk
endfor
" TODO: Use better syncing.
diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim
index 5ca5bc641..f3218ffcb 100644
--- a/runtime/syntax/sh.vim
+++ b/runtime/syntax/sh.vim
@@ -2,10 +2,10 @@
" Language: shell (sh) Korn shell (ksh) bash (sh)
" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
" Previous Maintainer: Lennart Schultz <Lennart.Schultz@ecmwf.int>
-" Last Change: Mar 20, 2014
-" Version: 132
-" URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
-" For options and settings, please use: :help ft-sh-syntax
+" Last Change: Jan 08, 2015
+" Version: 134
+" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH
+" For options and settings, please use: :help ft-sh-syntax
" This file includes many ideas from ?ric Brunet (eric.brunet@ens.fr)
" For version 5.x: Clear all syntax items {{{1
@@ -17,7 +17,7 @@ elseif exists("b:current_syntax")
endif
" AFAICT "." should be considered part of the iskeyword. Using iskeywords in
-" syntax is dicey, so the following code permits the user to
+" syntax is dicey, so the following code permits the user to prevent/override
" g:sh_isk set to a string : specify iskeyword.
" g:sh_noisk exists : don't change iskeyword
" g:sh_noisk does not exist : (default) append "." to iskeyword
@@ -104,7 +104,7 @@ syn cluster shErrorList contains=shDoError,shIfError,shInError,shCaseError,shEsa
if exists("b:is_kornshell")
syn cluster ErrorList add=shDTestError
endif
-syn cluster shArithParenList contains=shArithmetic,shCaseEsac,shDeref,shDerefSimple,shEcho,shEscape,shNumber,shOperator,shPosnParm,shExSingleQuote,shExDoubleQuote,shRedir,shSingleQuote,shDoubleQuote,shStatement,shVariable,shAlias,shTest,shCtrlSeq,shSpecial,shParen,bashSpecialVariables,bashStatement
+syn cluster shArithParenList contains=shArithmetic,shCaseEsac,shComment,shDeref,shDerefSimple,shDo,shEcho,shEscape,shIf,shFor,shNumber,shOperator,shPosnParm,shExSingleQuote,shExDoubleQuote,shRedir,shSingleQuote,shDoubleQuote,shStatement,shVariable,shAlias,shTest,shCtrlSeq,shSpecial,shParen,bashSpecialVariables,bashStatement
syn cluster shArithList contains=@shArithParenList,shParenError
syn cluster shCaseEsacList contains=shCaseStart,shCase,shCaseBar,shCaseIn,shComment,shDeref,shDerefSimple,shCaseCommandSub,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote,shCtrlSeq,@shErrorList,shStringSpecial,shCaseRange
syn cluster shCaseList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shRedir,shSetList,shSource,shStatement,shVariable,shCtrlSeq
@@ -127,7 +127,7 @@ syn cluster shHereList contains=shBeginHere,shHerePayload
syn cluster shHereListDQ contains=shBeginHere,@shDblQuoteList,shHerePayload
syn cluster shIdList contains=shCommandSub,shWrapLineOperator,shSetOption,shDeref,shDerefSimple,shRedir,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shExpr,shCtrlSeq,shStringSpecial,shAtExpr
syn cluster shIfList contains=@shLoopList,shDblBrace,shDblParen,shFunctionKey,shFunctionOne,shFunctionTwo
-syn cluster shLoopList contains=@shCaseList,shTestOpr,shExpr,shDblBrace,shConditional,shCaseEsac,shTest,@shErrorList,shSet,shOption
+syn cluster shLoopList contains=@shCaseList,shIf,shFor,shForPP,shTestOpr,shExpr,shDblBrace,shConditional,shCaseEsac,shTest,@shErrorList,shSet,shOption
syn cluster shSubShList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shIf,shRedir,shSetList,shSource,shStatement,shVariable,shCtrlSeq,shOperator
syn cluster shTestList contains=shCharClass,shComment,shCommandSub,shDeref,shDerefSimple,shExDoubleQuote,shDoubleQuote,shExpr,shNumber,shOperator,shExSingleQuote,shSingleQuote,shTestOpr,shTest,shCtrlSeq
" Echo: {{{1
@@ -151,18 +151,18 @@ endif
" Error Codes: {{{1
" ============
if !exists("g:sh_no_error")
- syn match shDoError "\<done\>"
- syn match shIfError "\<fi\>"
- syn match shInError "\<in\>"
- syn match shCaseError ";;"
- syn match shEsacError "\<esac\>"
- syn match shCurlyError "}"
- syn match shParenError ")"
- syn match shOK '\.\(done\|fi\|in\|esac\)'
+ syn match shDoError "\<done\>"
+ syn match shIfError "\<fi\>"
+ syn match shInError "\<in\>"
+ syn match shCaseError ";;"
+ syn match shEsacError "\<esac\>"
+ syn match shCurlyError "}"
+ syn match shParenError ")"
+ syn match shOK '\.\(done\|fi\|in\|esac\)'
if exists("b:is_kornshell")
- syn match shDTestError "]]"
+ syn match shDTestError "]]"
endif
- syn match shTestError "]"
+ syn match shTestError "]"
endif
" Options: {{{1
@@ -197,9 +197,10 @@ syn region shTest transparent matchgroup=shStatement start="\<test\s" skip=+\\\\
syn match shTestOpr contained "<=\|>=\|!=\|==\|-.\>\|-\(nt\|ot\|ef\|eq\|ne\|lt\|le\|gt\|ge\)\>\|[!<>]"
syn match shTestOpr contained '=' skipwhite nextgroup=shTestDoubleQuote,shTestSingleQuote,shTestPattern
syn match shTestPattern contained '\w\+'
-syn match shTestDoubleQuote contained '\%(\%(\\\\\)*\\\)\@<!"[^"]*"'
+syn region shTestDoubleQuote contained start='"' skip='\\"' end='"' contains=shBQpairs
syn match shTestSingleQuote contained '\\.'
syn match shTestSingleQuote contained "'[^']*'"
+syn match shBQpairs contained '\\\\'
if exists("b:is_kornshell") || exists("b:is_bash")
syn region shDblBrace matchgroup=Delimiter start="\[\[" skip=+\\\\\|\\$+ end="\]\]" contains=@shTestList
syn region shDblParen matchgroup=Delimiter start="((" skip=+\\\\\|\\$+ end="))" contains=@shTestList
@@ -216,11 +217,11 @@ if s:sh_fold_ifdofor
syn region shIf fold transparent matchgroup=shConditional start="\<if\_s" matchgroup=shConditional skip=+-fi\>+ end="\<;\_s*then\>" end="\<fi\>" contains=@shIfList
syn region shFor fold matchgroup=shLoop start="\<for\ze\_s\s*\%(((\)\@!" end="\<in\_s" end="\<do\>"me=e-2 contains=@shLoopList,shDblParen skipwhite nextgroup=shCurlyIn
else
- syn region shDo transparent matchgroup=shConditional start="\<do\>" matchgroup=shConditional end="\<done\>" contains=@shLoopList
+ syn region shDo transparent matchgroup=shConditional start="\<do\>" matchgroup=shConditional end="\<done\>" contains=@shLoopList
syn region shIf transparent matchgroup=shConditional start="\<if\_s" matchgroup=shConditional skip=+-fi\>+ end="\<;\_s*then\>" end="\<fi\>" contains=@shIfList
syn region shFor matchgroup=shLoop start="\<for\ze\_s\s*\%(((\)\@!" end="\<in\>" end="\<do\>"me=e-2 contains=@shLoopList,shDblParen skipwhite nextgroup=shCurlyIn
- syn match shForPP '\<for\>\ze\_s*(('
endif
+syn region shForPP matchgroup=shLoop start='\<for\>\_s*((' end='))' contains=shTestOpr
if exists("b:is_kornshell") || exists("b:is_bash")
syn cluster shCaseList add=shRepeat
syn cluster shFunctionList add=shRepeat
@@ -280,7 +281,7 @@ if exists("b:is_kornshell") || exists("b:is_bash")
elseif !exists("g:sh_no_error")
syn region shCommandSub matchgroup=Error start="\$(" end=")" contains=@shCommandSubList
endif
-syn region shCmdParenRegion matchgroup=shCmdSubRegion start="(" skip='\\\\\|\\.' end=")" contains=@shCommandSubList
+syn region shCmdParenRegion matchgroup=shCmdSubRegion start="(\ze[^(]" skip='\\\\\|\\.' end=")" contains=@shCommandSubList
if exists("b:is_bash")
syn cluster shCommandSubList add=bashSpecialVariables,bashStatement
@@ -321,12 +322,12 @@ elseif !exists("g:sh_no_error")
endif
syn region shSingleQuote matchgroup=shQuote start=+'+ end=+'+ contains=@Spell
syn region shDoubleQuote matchgroup=shQuote start=+\%(\%(\\\\\)*\\\)\@<!"+ skip=+\\"+ end=+"+ contains=@shDblQuoteList,shStringSpecial,@Spell
+"syn region shDoubleQuote matchgroup=shQuote start=+"+ skip=+\\"+ end=+"+ contains=@shDblQuoteList,shStringSpecial,@Spell
syn match shStringSpecial "[^[:print:] \t]" contained
syn match shStringSpecial "\%(\\\\\)*\\[\\"'`$()#]"
-"syn match shSpecial "[^\\]\zs\%(\\\\\)*\\[\\"'`$()#]" nextgroup=shMoreSpecial,shComment
-syn match shSpecial "[^\\]\zs\%(\\\\\)*\\[\\"'`$()#]" nextgroup=shMoreSpecial
-syn match shSpecial "^\%(\\\\\)*\\[\\"'`$()#]" nextgroup=shComment
-syn match shMoreSpecial "\%(\\\\\)*\\[\\"'`$()#]" contained nextgroup=shMoreSpecial
+syn match shSpecial "[^\\]\zs\%(\\\\\)*\\[\\"'`$()#]" nextgroup=shMoreSpecial,shComment
+syn match shSpecial "^\%(\\\\\)*\\[\\"'`$()#]" nextgroup=shComment
+syn match shMoreSpecial "\%(\\\\\)*\\[\\"'`$()#]" nextgroup=shMoreSpecial contained
" Comments: {{{1
"==========
@@ -363,9 +364,9 @@ elseif s:sh_fold_heredoc
syn region shHereDoc matchgroup=shRedir19 fold start="<<\\\z([^ \t|]*\)" matchgroup=shRedir19 end="^\z1\s*$"
else
- syn region shHereDoc matchgroup=shRedir20 start="<<\s*\\\=\z([^ \t|]*\)" matchgroup=shRedir20 end="^\z1\s*$" contains=@shDblQuoteList
+ syn region shHereDoc matchgroup=shRedir20 start="<<\s*\\\=\z([^ \t|]*\)" matchgroup=shRedir20 end="^\z1\s*$" contains=@shDblQuoteList
syn region shHereDoc matchgroup=shRedir21 start="<<\s*\"\z([^ \t|]*\)\"" matchgroup=shRedir21 end="^\z1\s*$"
- syn region shHereDoc matchgroup=shRedir22 start="<<-\s*\z([^ \t|]*\)" matchgroup=shRedir22 end="^\s*\z1\s*$" contains=@shDblQuoteList
+ syn region shHereDoc matchgroup=shRedir22 start="<<-\s*\z([^ \t|]*\)" matchgroup=shRedir22 end="^\s*\z1\s*$" contains=@shDblQuoteList
syn region shHereDoc matchgroup=shRedir23 start="<<-\s*'\z([^ \t|]*\)'" matchgroup=shRedir23 end="^\s*\z1\s*$"
syn region shHereDoc matchgroup=shRedir24 start="<<\s*'\z([^ \t|]*\)'" matchgroup=shRedir24 end="^\z1\s*$"
syn region shHereDoc matchgroup=shRedir25 start="<<-\s*\"\z([^ \t|]*\)\"" matchgroup=shRedir25 end="^\s*\z1\s*$"
@@ -450,21 +451,21 @@ syn match shDerefSpecial contained "\({[#!]\)\@<=[[:alnum:]*@_]\+" nextgroup=@s
syn match shDerefVar contained "{\@<=\k\+" nextgroup=@shDerefVarList
" sh ksh bash : ${var[... ]...} array reference: {{{1
-syn region shDerefVarArray contained matchgroup=shDeref start="\[" end="]" contains=@shCommandSubList nextgroup=shDerefOp,shDerefOpError
+syn region shDerefVarArray contained matchgroup=shDeref start="\[" end="]" contains=@shCommandSubList nextgroup=shDerefOp,shDerefOpError
" Special ${parameter OPERATOR word} handling: {{{1
-" sh ksh bash : ${parameter:-word} word is default value
-" sh ksh bash : ${parameter:=word} assign word as default value
-" sh ksh bash : ${parameter:?word} display word if parameter is null
-" sh ksh bash : ${parameter:+word} use word if parameter is not null, otherwise nothing
-" ksh bash : ${parameter#pattern} remove small left pattern
-" ksh bash : ${parameter##pattern} remove large left pattern
-" ksh bash : ${parameter%pattern} remove small right pattern
-" ksh bash : ${parameter%%pattern} remove large right pattern
-" bash : ${parameter^pattern} Case modification
-" bash : ${parameter^^pattern} Case modification
-" bash : ${parameter,pattern} Case modification
-" bash : ${parameter,,pattern} Case modification
+" sh ksh bash : ${parameter:-word} word is default value
+" sh ksh bash : ${parameter:=word} assign word as default value
+" sh ksh bash : ${parameter:?word} display word if parameter is null
+" sh ksh bash : ${parameter:+word} use word if parameter is not null, otherwise nothing
+" ksh bash : ${parameter#pattern} remove small left pattern
+" ksh bash : ${parameter##pattern} remove large left pattern
+" ksh bash : ${parameter%pattern} remove small right pattern
+" ksh bash : ${parameter%%pattern} remove large right pattern
+" bash : ${parameter^pattern} Case modification
+" bash : ${parameter^^pattern} Case modification
+" bash : ${parameter,pattern} Case modification
+" bash : ${parameter,,pattern} Case modification
syn cluster shDerefPatternList contains=shDerefPattern,shDerefString
if !exists("g:sh_no_error")
syn match shDerefOpError contained ":[[:punct:]]"
@@ -576,7 +577,7 @@ hi def link shDoubleQuote shString
hi def link shEcho shString
hi def link shEchoDelim shOperator
hi def link shEchoQuote shString
-hi def link shForPP shLoop
+"hi def link shForPP shLoop
hi def link shEmbeddedEcho shString
hi def link shEscape shCommandSub
hi def link shExDoubleQuote shDoubleQuote
@@ -598,12 +599,12 @@ hi def link shSetOption shOption
hi def link shSingleQuote shString
hi def link shSource shOperator
hi def link shStringSpecial shSpecial
-hi def link shStringSpecial Unique
hi def link shSubShRegion shOperator
hi def link shTestOpr shConditional
hi def link shTestPattern shString
hi def link shTestDoubleQuote shString
hi def link shTestSingleQuote shString
+hi def link shBQpairs shString
hi def link shVariable shSetList
hi def link shWrapLineOperator shOperator
diff --git a/runtime/syntax/sisu.vim b/runtime/syntax/sisu.vim
index 23d73254e..0e0f2dbe0 100644
--- a/runtime/syntax/sisu.vim
+++ b/runtime/syntax/sisu.vim
@@ -1,8 +1,9 @@
" SiSU Vim syntax file
-" SiSU Maintainer: Ralph Amissah <ralph@amissah.com>
-" SiSU Markup: SiSU (sisu-4.0.9)
-" Last Change: 2013-02-22
-" URL (sisu-4.1.0): <http://git.sisudoc.org/?p=code/sisu.git;a=blob;f=data/sisu/conf/editor-syntax-etc/vim/syntax/sisu.vim;hb=HEAD>
+" SiSU Maintainer: Ralph Amissah <ralph.amissah@gmail.com>
+" SiSU Markup: SiSU (sisu-5.6.7)
+" Last Change: 2014-09-14
+" URL: <http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=blob;f=data/sisu/conf/editor-syntax-etc/vim/syntax/sisu.vim;hb=HEAD>
+" <http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=blob_plain;f=data/sisu/conf/editor-syntax-etc/vim/syntax/sisu.vim;hb=HEAD>
"(originally looked at Ruby Vim by Mirko Nasato)
if version < 600
@@ -23,15 +24,14 @@ if !exists("sisu_no_identifiers")
syn match sisu_break contains=@NoSpell " \\\\\( \|$\)\|<br>\|<br />"
syn match sisu_control contains=@NoSpell "^\(-\\\\-\|=\\\\=\|-\.\.-\|<:p[bn]>\)\s*$"
syn match sisu_control contains=@NoSpell "^<:\(bo\|---\)>\s*$"
+ syn match sisu_marktail contains=@NoSpell "^--[+~-]#\s*$"
syn match sisu_marktail "[~-]#"
syn match sisu_control "\""
syn match sisu_underline "\(^\| \)_[a-zA-Z0-9]\+_\([ .,]\|$\)"
syn match sisu_number contains=@NoSpell "[0-9a-f]\{32\}\|[0-9a-f]\{64\}"
syn match sisu_link contains=@NoSpell "\(_\?https\?://\|\.\.\/\)\S\+"
syn match sisu_link " \*\~\S\+"
- syn match sisu_action "^<:insert\d\+>"
- syn match sisu_require contains=@NoSpell "^<<\s*[a-zA-Z0-9^._-]\+\.ss[it]$"
- syn match sisu_require contains=@NoSpell "^<<{[a-zA-Z0-9^._-]\+\.ss[it]}$"
+ syn match sisu_require contains=@NoSpell "^<<\s*[a-zA-Z0-9^./_-]\+\.ss[it]$"
syn match sisu_structure "^:A\~$"
"% "Document Sub Headers:
@@ -44,6 +44,8 @@ if !exists("sisu_no_identifiers")
syn match sisu_sub_header_original "^\s\+:\(publisher\|date\|language\|lang_char\|institution\|nationality\|source\):\s"
syn match sisu_sub_header_make "^\s\+:\(headings\|num_top\|breaks\|language\|italics\|bold\|emphasis\|substitute\|omit\|plaintext_wrap\|texpdf_font_mono\|texpdf_font\|stamp\|promo\|ad\|manpage\|home_button_text\|home_button_image\|cover_image\|footer\):\s"
syn match sisu_sub_header_notes "^\s\+:\(description\|abstract\|comment\|coverage\|relation\|source\|history\|type\|format\|prefix\|prefix_[ab]\|suffix\):\s"
+ syn match sisu_within_index_ignore "\S\+[:;]\(\s\+\|$\)"
+ syn match sisu_within_index "[:|;]\|+\d\+"
"% "semantic markers: (ignore)
syn match sisu_sem_marker ";{\|};[a-z._]*[a-z]"
@@ -93,17 +95,25 @@ syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_
syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_make matchgroup=sisu_header start="^[@]make:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$"
"% "Headings:
-syn region sisu_heading contains=sisu_mark_endnote,sisu_content_endnote,sisu_marktail,sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_ocn,sisu_error,sisu_error_wspace matchgroup=sisu_structure start="^\([1-8]\|:\?[A-C]\)\~\(\S\+\|[^-]\)" end="$"
+syn region sisu_heading contains=sisu_mark_endnote,sisu_content_endnote,sisu_marktail,sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_ocn,sisu_error,sisu_error_wspace matchgroup=sisu_structure start="^\([1-4]\|:\?[A-D]\)\~\(\S\+\|[^-]\)" end="$"
"% "Block Group Text:
" table
syn region sisu_content_alt contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^table{.\+" end="}table"
" table
+syn region sisu_content_alt contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^```\s\+table" end="^```\(\s\|$\)"
syn region sisu_content_alt contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^{\(t\|table\)\(\~h\)\?\(\sc[0-9]\+;\)\?[0-9; ]*}" end="\n$"
" block, group, poem, alt
-syn region sisu_content_alt contains=sisu_mark_endnote,sisu_content_endnote,sisu_link,sisu_mark,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^\(block\|group\|poem\|alt\){" end="^}\(block\|group\|poem\|alt\)"
+syn region sisu_content_alt contains=sisu_mark_endnote,sisu_content_endnote,sisu_link,sisu_mark,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^\(block\|group\|poem\|alt\){" end="^}\1"
+syn region sisu_content_alt contains=sisu_mark_endnote,sisu_content_endnote,sisu_link,sisu_mark,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^```\s\+\(block\|group\|poem\|alt\)" end="^```\(\s\|$\)"
+" box
+syn region sisu_content_alt contains=sisu_mark_endnote,sisu_content_endnote,sisu_link,sisu_mark,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^box\(\.[a-z]\+\)\?{" end="^}box"
+syn region sisu_content_alt contains=sisu_mark_endnote,sisu_content_endnote,sisu_link,sisu_mark,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^```\s\+\box\(\.[a-z]\+\)\?" end="^```\(\s\|$\)"
" code
-syn region sisu_content_alt contains=sisu_error matchgroup=sisu_contain start="^code{" end="^}code"
+syn region sisu_content_alt contains=sisu_error,@NoSpell matchgroup=sisu_contain start="^code\(\.[a-z][0-9a-z_]\+\)\?{" end="^}code"
+syn region sisu_content_alt contains=sisu_error,@NoSpell matchgroup=sisu_contain start="^```\s\+code\(\.[a-z][0-9a-z_]\+\)\?" end="^```\(\s\|$\)"
+" quote
+syn region sisu_normal contains=sisu_fontface,sisu_bold,sisu_control,sisu_identifier,sisu_content_endnote,sisu_mark_endnote,sisu_link,sisu_sem_block,sisu_sem_content,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker,sisu_linked,sisu_error,sisu_error_wspace matchgroup=sisu_contain start="^```\s\+quote" end="^```\(\s\|$\)"
"% "Endnotes:
" regular endnote or asterisk or plus sign endnote
@@ -138,7 +148,7 @@ syn region sisu_normal contains=sisu_strikeout,sisu_identifier,sisu_content_endn
"% "Font Face Curly Brackets:
"syn region sisu_identifier contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_sem start="\S\+:{" end="}:[^<>,.!?:; ]\+" oneline
" book index:
-syn region sisu_index matchgroup=sisu_index_block start="^={" end="}"
+syn region sisu_index contains=sisu_within_index_ignore,sisu_within_index matchgroup=sisu_index_block start="^={" end="}"
" emphasis:
syn region sisu_bold contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="\*{" end="}\*"
" bold:
@@ -246,6 +256,8 @@ hi def link sisu_index SpecialKey
hi def link sisu_index_block Visual
hi def link sisu_content_endnote Special
hi def link sisu_control Delimiter
+hi def link sisu_within_index Delimiter
+hi def link sisu_within_index_ignore SpecialKey
hi def link sisu_ocn Include
hi def link sisu_number Number
hi def link sisu_identifier Function
diff --git a/runtime/syntax/sm.vim b/runtime/syntax/sm.vim
index 2f9e6d7d0..48df7e578 100644
--- a/runtime/syntax/sm.vim
+++ b/runtime/syntax/sm.vim
@@ -1,9 +1,9 @@
" Vim syntax file
" Language: sendmail
-" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
-" Last Change: Sep 06, 2005
-" Version: 4
-" URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
+" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
+" Last Change: Oct 23, 2014
+" Version: 5
+" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SM
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
diff --git a/runtime/syntax/tags.vim b/runtime/syntax/tags.vim
index 051d65aa6..c86f17a61 100644
--- a/runtime/syntax/tags.vim
+++ b/runtime/syntax/tags.vim
@@ -1,8 +1,8 @@
" Language: tags
-" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchip@PcampbellAfamily.Mbiz>
-" Last Change: Sep 06, 2005
-" Version: 3
-" URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
+" Maintainer: Charles E. Campbell <NdrOchip@PcampbellAfamily.Mbiz>
+" Last Change: Oct 23, 2014
+" Version: 4
+" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_TAGS
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
diff --git a/runtime/syntax/tex.vim b/runtime/syntax/tex.vim
index 31114bc09..dcdeca2e6 100644
--- a/runtime/syntax/tex.vim
+++ b/runtime/syntax/tex.vim
@@ -1,8 +1,8 @@
" Vim syntax file
" Language: TeX
" Maintainer: Charles E. Campbell <NdrchipO@ScampbellPfamily.AbizM>
-" Last Change: Mar 20, 2014
-" Version: 81
+" Last Change: Nov 18, 2014
+" Version: 83
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_TEX
"
" Notes: {{{1
@@ -64,6 +64,8 @@ if version >= 508 || !exists("did_tex_syntax_inits")
endif
if exists("g:tex_no_error") && g:tex_no_error
let s:tex_no_error= 1
+else
+ let s:tex_no_error= 0
endif
" by default, enable all region-based highlighting
@@ -76,7 +78,6 @@ if exists("g:tex_fast")
else
let s:tex_fast= g:tex_fast
endif
- let s:tex_no_error= 1
else
let s:tex_fast= "bcmMprsSvV"
endif
@@ -88,6 +89,12 @@ if !exists("g:tex_conceal")
else
let s:tex_conceal= g:tex_conceal
endif
+if !exists("g:tex_superscripts")
+ let g:tex_superscripts= "[0-9a-zA-W.,:;+-<>/()=]"
+endif
+if !exists("g:tex_subscripts")
+ let g:tex_subscripts= "[0-9aehijklmnoprstuvx,+-/().]"
+endif
" Determine whether or not to use "*.sty" mode {{{1
" The user may override the normal determination by setting
@@ -135,7 +142,7 @@ endif
" Clusters: {{{1
" --------
syn cluster texCmdGroup contains=texCmdBody,texComment,texDefParm,texDelimiter,texDocType,texInput,texLength,texLigature,texMathDelim,texMathOper,texNewCmd,texNewEnv,texRefZone,texSection,texBeginEnd,texBeginEndName,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle
-if !exists("s:tex_no_error")
+if !exists("s:tex_no_error") || !s:tex_no_error
syn cluster texCmdGroup add=texMathError
endif
syn cluster texEnvGroup contains=texMatcher,texMathDelim,texSpecialChar,texStatement
@@ -151,13 +158,13 @@ else
endif
syn cluster texPreambleMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcher,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,texInputFile,texOption,texMathZoneZ
syn cluster texRefGroup contains=texMatcher,texComment,texDelimiter
-if !exists("tex_no_math")
+if !exists("g:tex_no_math")
syn cluster texMathZones contains=texMathZoneV,texMathZoneW,texMathZoneX,texMathZoneY,texMathZoneZ
syn cluster texMatchGroup add=@texMathZones
syn cluster texMathDelimGroup contains=texMathDelimBad,texMathDelimKey,texMathDelimSet1,texMathDelimSet2
syn cluster texMathMatchGroup contains=@texMathZones,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMathDelim,texMathMatcher,texMathOper,texNewCmd,texNewEnv,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone
syn cluster texMathZoneGroup contains=texComment,texDelimiter,texLength,texMathDelim,texMathMatcher,texMathOper,texMathSymbol,texMathText,texRefZone,texSpecialChar,texStatement,texTypeSize,texTypeStyle
- if !exists("s:tex_no_error")
+ if !exists("s:tex_no_error") || !s:tex_no_error
syn cluster texMathMatchGroup add=texMathError
syn cluster texMathZoneGroup add=texMathError
endif
@@ -179,7 +186,7 @@ endif
" Try to flag {} and () mismatches: {{{1
if s:tex_fast =~ 'm'
- if !exists("s:tex_no_error")
+ if !exists("s:tex_no_error") || !s:tex_no_error
syn region texMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" contains=@texMatchGroup,texError
syn region texMatcher matchgroup=Delimiter start="\[" end="]" contains=@texMatchGroup,texError,@NoSpell
else
@@ -192,12 +199,12 @@ if s:tex_fast =~ 'm'
syn region texParen start="(" end=")" contains=@texMatchGroup
endif
endif
-if !exists("s:tex_no_error")
+if !exists("s:tex_no_error") || !s:tex_no_error
syn match texError "[}\])]"
endif
if s:tex_fast =~ 'M'
- if !exists("tex_no_math")
- if !exists("s:tex_no_error")
+ if !exists("g:tex_no_math")
+ if !exists("s:tex_no_error") || !s:tex_no_error
syn match texMathError "}" contained
endif
syn region texMathMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\}" end="}" end="%stopzone\>" contained contains=@texMathMatchGroup
@@ -211,7 +218,7 @@ if exists("g:tex_tex") || b:tex_stylish
syn match texStatement "\\[a-zA-Z@]\+"
else
syn match texStatement "\\\a\+"
- if !exists("s:tex_no_error")
+ if !exists("s:tex_no_error") || !s:tex_no_error
syn match texError "\\\a*@[a-zA-Z@]*"
endif
endif
@@ -331,46 +338,47 @@ syn match texSpaceCodeChar "`\\\=.\(\^.\)\==\(\d\|\"\x\{1,6}\|`.\)" contained
if s:tex_fast =~ 'p'
if !exists("g:tex_nospell") || !g:tex_nospell
if g:tex_fold_enabled && has("folding")
- syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' fold contains=@texFoldGroup,@texDocGroup,@Spell
+ syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' fold contains=@texFoldGroup,@texDocGroup,@Spell
syn region texPartZone matchgroup=texSection start='\\part\>' end='\ze\s*\\\%(part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texPartGroup,@Spell
syn region texChapterZone matchgroup=texSection start='\\chapter\>' end='\ze\s*\\\%(chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texChapterGroup,@Spell
syn region texSectionZone matchgroup=texSection start='\\section\>' end='\ze\s*\\\%(section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSectionGroup,@Spell
- syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSubSectionGroup,@Spell
+ syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSubSectionGroup,@Spell
syn region texSubSubSectionZone matchgroup=texSection start='\\subsubsection\>' end='\ze\s*\\\%(\%(sub\)\{,2}section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSubSubSectionGroup,@Spell
syn region texParaZone matchgroup=texSection start='\\paragraph\>' end='\ze\s*\\\%(paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texParaGroup,@Spell
syn region texSubParaZone matchgroup=texSection start='\\subparagraph\>' end='\ze\s*\\\%(\%(sub\)\=paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@Spell
syn region texTitle matchgroup=texSection start='\\\%(author\|title\)\>\s*{' end='}' fold contains=@texFoldGroup,@Spell
syn region texAbstract matchgroup=texSection start='\\begin\s*{\s*abstract\s*}' end='\\end\s*{\s*abstract\s*}' fold contains=@texFoldGroup,@Spell
else
- syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' contains=@texFoldGroup,@texDocGroup,@Spell
+ syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' contains=@texFoldGroup,@texDocGroup,@Spell
syn region texPartZone matchgroup=texSection start='\\part\>' end='\ze\s*\\\%(part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texPartGroup,@Spell
syn region texChapterZone matchgroup=texSection start='\\chapter\>' end='\ze\s*\\\%(chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texChapterGroup,@Spell
syn region texSectionZone matchgroup=texSection start='\\section\>' end='\ze\s*\\\%(section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSectionGroup,@Spell
- syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSectionGroup,@Spell
+ syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSectionGroup,@Spell
syn region texSubSubSectionZone matchgroup=texSection start='\\subsubsection\>' end='\ze\s*\\\%(\%(sub\)\{,2}section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSubSectionGroup,@Spell
syn region texParaZone matchgroup=texSection start='\\paragraph\>' end='\ze\s*\\\%(paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texParaGroup,@Spell
syn region texSubParaZone matchgroup=texSection start='\\subparagraph\>' end='\ze\s*\\\%(\%(sub\)\=paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@Spell
syn region texTitle matchgroup=texSection start='\\\%(author\|title\)\>\s*{' end='}' contains=@texFoldGroup,@Spell
syn region texAbstract matchgroup=texSection start='\\begin\s*{\s*abstract\s*}' end='\\end\s*{\s*abstract\s*}' contains=@texFoldGroup,@Spell
+ syn region texSpellZone matchgroup=texSpellZone start="%spellzone_start" end="%spellzone_end" contains=@Spell
endif
else
if g:tex_fold_enabled && has("folding")
- syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' fold contains=@texFoldGroup,@texDocGroup
+ syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' fold contains=@texFoldGroup,@texDocGroup
syn region texPartZone matchgroup=texSection start='\\part\>' end='\ze\s*\\\%(part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texPartGroup
syn region texChapterZone matchgroup=texSection start='\\chapter\>' end='\ze\s*\\\%(chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texChapterGroup
syn region texSectionZone matchgroup=texSection start='\\section\>' end='\ze\s*\\\%(section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSectionGroup
- syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSubSectionGroup
+ syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSubSectionGroup
syn region texSubSubSectionZone matchgroup=texSection start='\\subsubsection\>' end='\ze\s*\\\%(\%(sub\)\{,2}section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSubSubSectionGroup
syn region texParaZone matchgroup=texSection start='\\paragraph\>' end='\ze\s*\\\%(paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texParaGroup
syn region texSubParaZone matchgroup=texSection start='\\subparagraph\>' end='\ze\s*\\\%(\%(sub\)\=paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup
syn region texTitle matchgroup=texSection start='\\\%(author\|title\)\>\s*{' end='}' fold contains=@texFoldGroup
syn region texAbstract matchgroup=texSection start='\\begin\s*{\s*abstract\s*}' end='\\end\s*{\s*abstract\s*}' fold contains=@texFoldGroup
else
- syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' contains=@texFoldGroup,@texDocGroup
+ syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' contains=@texFoldGroup,@texDocGroup
syn region texPartZone matchgroup=texSection start='\\part\>' end='\ze\s*\\\%(part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texPartGroup
syn region texChapterZone matchgroup=texSection start='\\chapter\>' end='\ze\s*\\\%(chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texChapterGroup
syn region texSectionZone matchgroup=texSection start='\\section\>' end='\ze\s*\\\%(section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSectionGroup
- syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSectionGroup
+ syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSectionGroup
syn region texSubSubSectionZone matchgroup=texSection start='\\subsubsection\>' end='\ze\s*\\\%(\%(sub\)\{,2}section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSubSectionGroup
syn region texParaZone matchgroup=texSection start='\\paragraph\>' end='\ze\s*\\\%(paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texParaGroup
syn region texSubParaZone matchgroup=texSection start='\\subparagraph\>' end='\ze\s*\\\%(\%(sub\)\=paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup
@@ -391,14 +399,14 @@ if s:tex_fast =~ 'b'
endif
" Bad Math (mismatched): {{{1
-if !exists("g:tex_no_math") && !exists("s:tex_no_error")
+if !exists("g:tex_no_math") && (!exists("s:tex_no_error") || !s:tex_no_error)
syn match texBadMath "\\end\s*{\s*\(array\|gathered\|bBpvV]matrix\|split\|subequations\|smallmatrix\|xxalignat\)\s*}"
syn match texBadMath "\\end\s*{\s*\(align\|alignat\|displaymath\|displaymath\|eqnarray\|equation\|flalign\|gather\|math\|multline\|xalignat\)\*\=\s*}"
syn match texBadMath "\\[\])]"
endif
" Math Zones: {{{1
-if !exists("tex_no_math")
+if !exists("g:tex_no_math")
" TexNewMathZone: function creates a mathzone with the given suffix and mathzone name. {{{2
" Starred forms are created if starform is true. Starred
" forms have syntax group and synchronization groups with a
@@ -535,7 +543,7 @@ else
syn match texSpecialChar "\\[SP@]\A"me=e-1
endif
syn match texSpecialChar "\\\\"
-if !exists("tex_no_math")
+if !exists("g:tex_no_math")
syn match texOnlyMath "[_^]"
endif
syn match texSpecialChar "\^\^[0-9a-f]\{2}\|\^\^\S"
@@ -568,12 +576,14 @@ else
syn match texComment "%.*$" contains=@texCommentGroup
if s:tex_fast =~ 'c'
syn region texComment start="^\zs\s*%.*\_s*%" skip="^\s*%" end='^\ze\s*[^%]' fold
- syn region texNoSpell contained fold matchgroup=texComment start="%\s*nospell\s*{" end="%\s*nospell\s*}" contains=@texFoldGroup,@NoSpell
+ syn region texNoSpell contained matchgroup=texComment start="%\s*nospell\s*{" end="%\s*nospell\s*}" fold contains=@texFoldGroup,@NoSpell
+ syn region texSpellZone matchgroup=texComment start="%\s*spellzone_start" end="%\s*spellzone_end" fold contains=@Spell,@texFoldGroup
endif
else
- syn match texComment "%.*$" contains=@texCommentGroup
+ syn match texComment "%.*$" contains=@texCommentGroup
if s:tex_fast =~ 'c'
- syn region texNoSpell contained matchgroup=texComment start="%\s*nospell\s*{" end="%\s*nospell\s*}" contains=@texFoldGroup,@NoSpell
+ syn region texNoSpell contained matchgroup=texComment start="%\s*nospell\s*{" end="%\s*nospell\s*}" contains=@texFoldGroup,@NoSpell
+ syn region texSpellZone matchgroup=texComment start="%\s*spellzone_start" end="%\s*spellzone_end" contains=@Spell,@texFoldGroup
endif
endif
endif
@@ -620,7 +630,7 @@ if s:tex_fast =~ 'r'
syn region texRefZone matchgroup=texStatement start="\\\(page\|eq\)ref{" end="}\|%stopzone\>" contains=@texRefGroup
syn region texRefZone matchgroup=texStatement start="\\v\=ref{" end="}\|%stopzone\>" contains=@texRefGroup
syn region texRefOption contained matchgroup=Delimiter start='\[' end=']' contains=@texRefGroup,texRefZone nextgroup=texRefOption,texCite
- syn region texCite contained matchgroup=Delimiter start='{' end='}' contains=@texRefGroup,texRefZone,texCite
+ syn region texCite contained matchgroup=Delimiter start='{' end='}' contains=@texRefGroup,texRefZone,texCite
endif
syn match texRefZone '\\cite\%([tp]\*\=\)\=' nextgroup=texRefOption,texCite
@@ -657,7 +667,7 @@ syn match texLength "\<\d\+\([.,]\d\+\)\=\s*\(true\)\=\s*\(bp\|cc\|cm\|dd\|em\
syn match texString "\(``\|''\|,,\)"
" makeatletter -- makeatother sections
-if !exists("s:tex_no_error")
+if !exists("s:tex_no_error") || !s:tex_no_error
if s:tex_fast =~ 'S'
syn region texStyle matchgroup=texStatement start='\\makeatletter' end='\\makeatother' contains=@texStyleGroup contained
endif
@@ -788,8 +798,8 @@ if has("conceal") && &enc == 'utf-8'
\ ['left(' , '('],
\ ['left\[' , '['],
\ ['left\\{' , '{'],
- \ ['leftarrow' , '⟵'],
- \ ['Leftarrow' , '⟸'],
+ \ ['leftarrow' , '←'],
+ \ ['Leftarrow' , '⇐'],
\ ['leftarrowtail' , '↢'],
\ ['leftharpoondown', '↽'],
\ ['leftharpoonup' , '↼'],
@@ -875,8 +885,8 @@ if has("conceal") && &enc == 'utf-8'
\ ['right)' , ')'],
\ ['right]' , ']'],
\ ['right\\}' , '}'],
- \ ['rightarrow' , '⟶'],
- \ ['Rightarrow' , '⟹'],
+ \ ['rightarrow' , '→'],
+ \ ['Rightarrow' , '⇒'],
\ ['rightarrowtail' , '↣'],
\ ['rightleftharpoons', '⇌'],
\ ['rightsquigarrow', '↝'],
@@ -989,6 +999,7 @@ if has("conceal") && &enc == 'utf-8'
syn match texMathSymbol '\\hat{W}' contained conceal cchar=Ŵ
syn match texMathSymbol '\\hat{y}' contained conceal cchar=ŷ
syn match texMathSymbol '\\hat{Y}' contained conceal cchar=Ŷ
+" syn match texMathSymbol '\\bar{a}' contained conceal cchar=a̅
endif
" Greek {{{2
@@ -1005,7 +1016,7 @@ if has("conceal") && &enc == 'utf-8'
call s:Greek('texGreek','\\zeta\>' ,'ζ')
call s:Greek('texGreek','\\eta\>' ,'η')
call s:Greek('texGreek','\\theta\>' ,'θ')
- call s:Greek('texGreek','\\vartheta\>' ,'ϑ')
+ call s:Greek('texGreek','\\vartheta\>' ,'ϑ')
call s:Greek('texGreek','\\kappa\>' ,'κ')
call s:Greek('texGreek','\\lambda\>' ,'λ')
call s:Greek('texGreek','\\mu\>' ,'μ')
@@ -1016,11 +1027,11 @@ if has("conceal") && &enc == 'utf-8'
call s:Greek('texGreek','\\rho\>' ,'ρ')
call s:Greek('texGreek','\\varrho\>' ,'ϱ')
call s:Greek('texGreek','\\sigma\>' ,'σ')
- call s:Greek('texGreek','\\varsigma\>' ,'ς')
+ call s:Greek('texGreek','\\varsigma\>' ,'ς')
call s:Greek('texGreek','\\tau\>' ,'τ')
call s:Greek('texGreek','\\upsilon\>' ,'υ')
- call s:Greek('texGreek','\\phi\>' ,'φ')
- call s:Greek('texGreek','\\varphi\>' ,'ϕ')
+ call s:Greek('texGreek','\\phi\>' ,'ϕ')
+ call s:Greek('texGreek','\\varphi\>' ,'φ')
call s:Greek('texGreek','\\chi\>' ,'χ')
call s:Greek('texGreek','\\psi\>' ,'ψ')
call s:Greek('texGreek','\\omega\>' ,'ω')
@@ -1045,8 +1056,11 @@ if has("conceal") && &enc == 'utf-8'
syn region texSubscript matchgroup=Delimiter start='_{' skip="\\\\\|\\[{}]" end='}' contained concealends contains=texSpecialChar,texSubscripts,texStatement,texSubscript,texSuperscript,texMathMatcher
endif
fun! s:SuperSub(group,leader,pat,cchar)
- exe 'syn match '.a:group." '".a:leader.a:pat."' contained conceal cchar=".a:cchar
- exe 'syn match '.a:group."s '".a:pat."' contained conceal cchar=".a:cchar.' nextgroup='.a:group.'s'
+ if a:pat =~ '^\\' || (a:leader == '\^' && a:pat =~ g:tex_superscripts) || (a:leader == '_' && a:pat =~ g:tex_subscripts)
+" call Decho("SuperSub: group<".a:group."> leader<".a:leader."> pat<".a:pat."> cchar<".a:cchar.">")
+ exe 'syn match '.a:group." '".a:leader.a:pat."' contained conceal cchar=".a:cchar
+ exe 'syn match '.a:group."s '".a:pat."' contained conceal cchar=".a:cchar.' nextgroup='.a:group.'s'
+ endif
endfun
call s:SuperSub('texSuperscript','\^','0','⁰')
call s:SuperSub('texSuperscript','\^','1','¹')
@@ -1170,44 +1184,44 @@ if has("conceal") && &enc == 'utf-8'
let i= i + 1
endfor
endfun
- " \` \' \^ \" \~ \. \= \c \H \k \r \u \v
- call s:Accents('a','à','á','â','ä','ã','ȧ','ā',' ',' ','ą','å','ă','ǎ')
- call s:Accents('A','À','Á','Â','Ä','Ã','Ȧ','Ā',' ',' ','Ą','Å','Ă','Ǎ')
- call s:Accents('c',' ','ć','ĉ',' ',' ','ċ',' ','ç',' ',' ',' ',' ','č')
- call s:Accents('C',' ','Ć','Ĉ',' ',' ','Ċ',' ','Ç',' ',' ',' ',' ','Č')
- call s:Accents('d',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','ď')
- call s:Accents('D',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','Ď')
- call s:Accents('e','è','é','ê','ë','ẽ','ė','ē','ȩ',' ','ę',' ','ĕ','ě')
- call s:Accents('E','È','É','Ê','Ë','Ẽ','Ė','Ē','Ȩ',' ','Ę',' ','Ĕ','Ě')
- call s:Accents('g',' ','ǵ','ĝ',' ',' ','ġ',' ','ģ',' ',' ',' ','ğ','ǧ')
- call s:Accents('G',' ','Ǵ','Ĝ',' ',' ','Ġ',' ','Ģ',' ',' ',' ','Ğ','Ǧ')
- call s:Accents('h',' ',' ','ĥ',' ',' ',' ',' ',' ',' ',' ',' ',' ','ȟ')
- call s:Accents('H',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','Ȟ')
- call s:Accents('i','ì','í','î','ï','ĩ','į','ī',' ',' ','į',' ','ĭ','ǐ')
- call s:Accents('I','Ì','Í','Î','Ï','Ĩ','İ','Ī',' ',' ','Į',' ','Ĭ','Ǐ')
- call s:Accents('J',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','ǰ')
- call s:Accents('k',' ',' ',' ',' ',' ',' ',' ','ķ',' ',' ',' ',' ','ǩ')
- call s:Accents('K',' ',' ',' ',' ',' ',' ',' ','Ķ',' ',' ',' ',' ','Ǩ')
- call s:Accents('l',' ','ĺ','ľ',' ',' ',' ',' ','ļ',' ',' ',' ',' ','ľ')
- call s:Accents('L',' ','Ĺ','Ľ',' ',' ',' ',' ','Ļ',' ',' ',' ',' ','Ľ')
- call s:Accents('n',' ','ń',' ',' ','ñ',' ',' ','ņ',' ',' ',' ',' ','ň')
- call s:Accents('N',' ','Ń',' ',' ','Ñ',' ',' ','Ņ',' ',' ',' ',' ','Ň')
- call s:Accents('o','ò','ó','ô','ö','õ','ȯ','ō',' ','ő','ǫ',' ','ŏ','ǒ')
- call s:Accents('O','Ò','Ó','Ô','Ö','Õ','Ȯ','Ō',' ','Ő','Ǫ',' ','Ŏ','Ǒ')
- call s:Accents('r',' ','ŕ',' ',' ',' ',' ',' ','ŗ',' ',' ',' ',' ','ř')
- call s:Accents('R',' ','Ŕ',' ',' ',' ',' ',' ','Ŗ',' ',' ',' ',' ','Ř')
- call s:Accents('s',' ','ś','ŝ',' ',' ',' ',' ','ş',' ','ȿ',' ',' ','š')
- call s:Accents('S',' ','Ś','Ŝ',' ',' ',' ',' ','Ş',' ',' ',' ',' ','Š')
- call s:Accents('t',' ',' ',' ',' ',' ',' ',' ','ţ',' ',' ',' ',' ','ť')
- call s:Accents('T',' ',' ',' ',' ',' ',' ',' ','Ţ',' ',' ',' ',' ','Ť')
- call s:Accents('u','ù','ú','û','ü','ũ',' ','ū',' ','ű','ų','ů','ŭ','ǔ')
- call s:Accents('U','Ù','Ú','Û','Ü','Ũ',' ','Ū',' ','Ű','Ų','Ů','Ŭ','Ǔ')
- call s:Accents('w',' ',' ','ŵ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ')
- call s:Accents('W',' ',' ','Ŵ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ')
- call s:Accents('y','ỳ','ý','ŷ','ÿ','ỹ',' ',' ',' ',' ',' ',' ',' ',' ')
- call s:Accents('Y','Ỳ','Ý','Ŷ','Ÿ','Ỹ',' ',' ',' ',' ',' ',' ',' ',' ')
- call s:Accents('z',' ','ź',' ',' ',' ','ż',' ',' ',' ',' ',' ',' ','ž')
- call s:Accents('Z',' ','Ź',' ',' ',' ','Ż',' ',' ',' ',' ',' ',' ','Ž')
+ " \` \' \^ \" \~ \. \= \c \H \k \r \u \v
+ call s:Accents('a','à','á','â','ä','ã','ȧ','ā',' ',' ','ą','å','ă','ǎ')
+ call s:Accents('A','À','Á','Â','Ä','Ã','Ȧ','Ā',' ',' ','Ą','Å','Ă','Ǎ')
+ call s:Accents('c',' ','ć','ĉ',' ',' ','ċ',' ','ç',' ',' ',' ',' ','č')
+ call s:Accents('C',' ','Ć','Ĉ',' ',' ','Ċ',' ','Ç',' ',' ',' ',' ','Č')
+ call s:Accents('d',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','ď')
+ call s:Accents('D',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','Ď')
+ call s:Accents('e','è','é','ê','ë','ẽ','ė','ē','ȩ',' ','ę',' ','ĕ','ě')
+ call s:Accents('E','È','É','Ê','Ë','Ẽ','Ė','Ē','Ȩ',' ','Ę',' ','Ĕ','Ě')
+ call s:Accents('g',' ','ǵ','ĝ',' ',' ','ġ',' ','ģ',' ',' ',' ','ğ','ǧ')
+ call s:Accents('G',' ','Ǵ','Ĝ',' ',' ','Ġ',' ','Ģ',' ',' ',' ','Ğ','Ǧ')
+ call s:Accents('h',' ',' ','ĥ',' ',' ',' ',' ',' ',' ',' ',' ',' ','ȟ')
+ call s:Accents('H',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','Ȟ')
+ call s:Accents('i','ì','í','î','ï','ĩ','į','ī',' ',' ','į',' ','ĭ','ǐ')
+ call s:Accents('I','Ì','Í','Î','Ï','Ĩ','İ','Ī',' ',' ','Į',' ','Ĭ','Ǐ')
+ call s:Accents('J',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','ǰ')
+ call s:Accents('k',' ',' ',' ',' ',' ',' ',' ','ķ',' ',' ',' ',' ','ǩ')
+ call s:Accents('K',' ',' ',' ',' ',' ',' ',' ','Ķ',' ',' ',' ',' ','Ǩ')
+ call s:Accents('l',' ','ĺ','ľ',' ',' ',' ',' ','ļ',' ',' ',' ',' ','ľ')
+ call s:Accents('L',' ','Ĺ','Ľ',' ',' ',' ',' ','Ļ',' ',' ',' ',' ','Ľ')
+ call s:Accents('n',' ','ń',' ',' ','ñ',' ',' ','ņ',' ',' ',' ',' ','ň')
+ call s:Accents('N',' ','Ń',' ',' ','Ñ',' ',' ','Ņ',' ',' ',' ',' ','Ň')
+ call s:Accents('o','ò','ó','ô','ö','õ','ȯ','ō',' ','ő','ǫ',' ','ŏ','ǒ')
+ call s:Accents('O','Ò','Ó','Ô','Ö','Õ','Ȯ','Ō',' ','Ő','Ǫ',' ','Ŏ','Ǒ')
+ call s:Accents('r',' ','ŕ',' ',' ',' ',' ',' ','ŗ',' ',' ',' ',' ','ř')
+ call s:Accents('R',' ','Ŕ',' ',' ',' ',' ',' ','Ŗ',' ',' ',' ',' ','Ř')
+ call s:Accents('s',' ','ś','ŝ',' ',' ',' ',' ','ş',' ','ȿ',' ',' ','š')
+ call s:Accents('S',' ','Ś','Ŝ',' ',' ',' ',' ','Ş',' ',' ',' ',' ','Š')
+ call s:Accents('t',' ',' ',' ',' ',' ',' ',' ','ţ',' ',' ',' ',' ','ť')
+ call s:Accents('T',' ',' ',' ',' ',' ',' ',' ','Ţ',' ',' ',' ',' ','Ť')
+ call s:Accents('u','ù','ú','û','ü','ũ',' ','ū',' ','ű','ų','ů','ŭ','ǔ')
+ call s:Accents('U','Ù','Ú','Û','Ü','Ũ',' ','Ū',' ','Ű','Ų','Ů','Ŭ','Ǔ')
+ call s:Accents('w',' ',' ','ŵ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ')
+ call s:Accents('W',' ',' ','Ŵ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ')
+ call s:Accents('y','ỳ','ý','ŷ','ÿ','ỹ',' ',' ',' ',' ',' ',' ',' ',' ')
+ call s:Accents('Y','Ỳ','Ý','Ŷ','Ÿ','Ỹ',' ',' ',' ',' ',' ',' ',' ',' ')
+ call s:Accents('z',' ','ź',' ',' ',' ','ż',' ',' ',' ',' ',' ',' ','ž')
+ call s:Accents('Z',' ','Ź',' ',' ',' ','Ż',' ',' ',' ',' ',' ',' ','Ž')
call s:Accents('\\i','ì','í','î','ï','ĩ','į',' ',' ',' ',' ',' ','ĭ',' ')
" \` \' \^ \" \~ \. \= \c \H \k \r \u \v
delfun s:Accents
@@ -1236,7 +1250,7 @@ syn sync match texSyncStop groupthere NONE "%stopzone\>"
" (one can't tell if a "$$" starts or stops a math zone by itself)
" The following grouptheres coupled with minlines above
" help improve the odds of good syncing.
-if !exists("tex_no_math")
+if !exists("g:tex_no_math")
syn sync match texSyncMathZoneA groupthere NONE "\\end{abstract}"
syn sync match texSyncMathZoneA groupthere NONE "\\end{center}"
syn sync match texSyncMathZoneA groupthere NONE "\\end{description}"
@@ -1252,7 +1266,7 @@ endif
if did_tex_syntax_inits == 1
let did_tex_syntax_inits= 2
" TeX highlighting groups which should share similar highlighting
- if !exists("s:tex_no_error")
+ if !exists("g:tex_no_error")
if !exists("g:tex_no_math")
HiLink texBadMath texError
HiLink texMathDelimBad texError
@@ -1276,7 +1290,7 @@ if did_tex_syntax_inits == 1
HiLink texInputFileOpt texCmdArgs
HiLink texInputCurlies texDelimiter
HiLink texLigature texSpecialChar
- if !exists("tex_no_math")
+ if !exists("g:tex_no_math")
HiLink texMathDelimSet1 texMathDelim
HiLink texMathDelimSet2 texMathDelim
HiLink texMathDelimKey texMathDelim
diff --git a/runtime/syntax/valgrind.vim b/runtime/syntax/valgrind.vim
index 48e9564ac..c247927c2 100644
--- a/runtime/syntax/valgrind.vim
+++ b/runtime/syntax/valgrind.vim
@@ -2,9 +2,11 @@
" Language: Valgrind Memory Debugger Output
" Maintainer: Roger Luethi <rl@hellgate.ch>
" Program URL: http://devel-home.kde.org/~sewardj/
-" Last Change: 2012 Apr 30
+" Last Change: 2014 Oct 02
"
" Notes: mostly based on strace.vim and xml.vim
+"
+" Contributors: Christoph Gysin <christoph.gysin@gmail.com>
" Quit when a syntax file was already loaded
if exists("b:current_syntax")
@@ -65,7 +67,7 @@ syn match valgrindAt "at\s\@=" contained
syn match valgrindAddr "\(\W\)\@<=0x\x\+" contained
syn match valgrindFunc "\(: \)\@<=\w\+" contained
syn match valgrindBin "\((\(with\|\)in \)\@<=\S\+\()\)\@=" contained
-syn match valgrindSrc "\((\)\@<=.*:\d\+\()\)\@=" contained
+syn match valgrindSrc "\((\)\@<=[^)]*:\d\+\()\)\@=" contained
" Define the default highlighting
diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim
index 8d98f7d7d..1d9799846 100644
--- a/runtime/syntax/vim.vim
+++ b/runtime/syntax/vim.vim
@@ -1,8 +1,8 @@
" Vim syntax file
" Language: Vim 7.4 script
" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
-" Last Change: Mar 20, 2014
-" Version: 7.4-27
+" Last Change: Nov 28, 2014
+" Version: 7.4-19
" Automatically generated keyword lists: {{{1
" Quit when a syntax file was already loaded {{{2
@@ -14,26 +14,27 @@ set cpo&vim
" vimTodo: contains common special-notices for comments {{{2
" Use the vimCommentGroup cluster to add your own.
+syn keyword vimTodo contained COMBAK FIXME TODO XXX
syn cluster vimCommentGroup contains=vimTodo,@Spell
" regular vim commands {{{2
-syn keyword vimCommand contained a arga[dd] ar[gs] bd[elete] bN[ext] breakd[el] bufdo cabc[lear] cat[ch] cex[pr] c[hange] cla[st] cnew[er] cNf[ile] con cp[revious] cuna[bbrev] del deletep delm[arks] diffp[atch] dig[raphs] do e echon endf endw[hile] f[ile] fin[d] folddoc[losed] fu[nction] gvim helpt[ags] iabc[lear] intro k l lan lc[d] lefta[bove] lg[etfile] lla[st] lnew[er] lNf[ile] lockv[ar] ls lvimgrepa[dd] mat[ch] mk[exrc] mo n n[ext] o ownsyntax perld[o] pre[serve] promptf[ind] ptl[ast] ptr[ewind] py3do qa[ll] r[ead] redr[aw] retu[rn] rub[y] rv[iminfo] sba[ll] sbN[ext] scripte[ncoding] setf[iletype] sh[ell] sim[alt] sm[ap] sni[ff] sor[t] spelli[nfo] spr[evious] start st[op] sunmenu syn ta tabf[ind] tabnew tabr[ewind] tcld[o] tj[ump] tN tr tu[nmenu] undoj[oin] uns[ilent] ve[rsion] vimgrepa[dd] vs[plit] winc[md] wN[ext] ws[verb] x[it] xnoremenu
-syn keyword vimCommand contained ab argd[elete] argu[ment] bel[owright] bo[tright] breakl[ist] b[uffer] cad cb[uffer] cf[ile] changes cl[ist] cn[ext] col[der] conf[irm] cq[uit] cw[indow] delc[ommand] deletl delp diffpu[t] dir doau ea e[dit] endfo[r] ene[w] files fini[sh] foldd[oopen] g h hi if is[earch] keepa la lan[guage] lch[dir] lex[pr] lgr[ep] lli[st] lne[xt] lo lol[der] lt[ag] lw[indow] menut mks[ession] mod[e] nbc[lose] nmapc[lear] ol[dfiles] p po[p] prev[ious] promptr[epl] ptn pts[elect] pydo q[uit] rec[over] redraws[tatus] rew[ind] rubyd[o] sal[l] sbf[irst] sbp[revious] scrip[tnames] setg[lobal] si sl sme sno[magic] so[urce] spellr[epall] sre[wind] startg[replace] stopi[nsert] sus[pend] sync tab tabfir[st] tabn[ext] tabs tclf[ile] tl[ast] tn[ext] tr[ewind] u undol[ist] up[date] vert[ical] vi[sual] w windo wp[revious] wundo xmapc[lear] xunme
-syn keyword vimCommand contained abc[lear] argdo as[cii] bf[irst] bp[revious] br[ewind] buffers caddb[uffer] cc cfir[st] chd[ir] clo[se] cN[ext] colo[rscheme] con[tinue] cr[ewind] d delel deletp dep diffs[plit] di[splay] dp earlier el[se] endfun ex filet fir[st] foldo[pen] go[to] ha[rdcopy] hid[e] ij[ump] isp[lit] keepalt lad la[st] lcl[ose] lf[ile] lgrepa[dd] lmak[e] lN[ext] loadk lop[en] lua ma menut[ranslate] mksp[ell] m[ove] nb[key] noa omapc[lear] pc[lose] popu p[rint] ps[earch] ptN pu[t] pyf[ile] quita[ll] red reg[isters] ri[ght] rubyf[ile] san[dbox] sbl[ast] sbr[ewind] scs setl[ocal] sig sla[st] smenu snoreme spe spellu[ndo] st star[tinsert] sts[elect] sv[iew] syncbind tabc[lose] tabl[ast] tabN[ext] ta[g] te[aroff] tm tN[ext] try un unh[ide] v vi viu[sage] wa[ll] winp[os] wq wv[iminfo] xme xunmenu
-syn keyword vimCommand contained abo[veleft] arge[dit] au bl[ast] br bro[wse] bun[load] cad[dexpr] ccl[ose] cgetb[uffer] che[ckpath] cmapc[lear] cnf com cope[n] cs de delep delf di difft[his] dj[ump] dr[op] ec elsei[f] endf[unction] exi[t] filetype fix[del] for gr[ep] h[elp] his[tory] il[ist] iuna[bbrev] keepj[umps] laddb[uffer] lat lcs lfir[st] lh[elpgrep] lmapc[lear] lnf loadkeymap lpf[ile] luado mak[e] mes mkv mz nbs[tart] noautocmd on[ly] pe popu[p] pro pta[g] ptn[ext] pw[d] py[thon] r redi[r] res[ize] rightb[elow] rundo sa[rgument] sbm[odified] sb[uffer] scscope sf[ind] sign sl[eep] sn[ext] snoremenu spelld[ump] spellw[rong] sta[g] startr[eplace] sun[hide] sw[apname] syntime tabd[o] tabm[ove] tabo[nly] tags tf[irst] tm[enu] to[pleft] ts[elect] una[bbreviate] unl ve vie[w] vmapc[lear] wh[ile] win[size] wqa[ll] x xmenu xwininfo
-syn keyword vimCommand contained al[l] argg[lobal] bad[d] bm[odified] brea[k] bu bw[ipeout] caddf[ile] cd cgete[xpr] checkt[ime] cn cNf comc[lear] co[py] cscope debug d[elete] delf[unction] diffg[et] diffu[pdate] dl ds[earch] echoe[rr] em[enu] en[dif] exu[sage] fin fo[ld] fu grepa[dd] helpf[ind] i imapc[lear] j[oin] kee[pmarks] lad[dexpr] later lcscope lgetb[uffer] l[ist] lN lNf lo[adview] lp[revious] luafile ma[rk] messages mkvie[w] mzf[ile] ne noh[lsearch] o[pen] ped[it] pp[op] profd[el] ptf[irst] ptN[ext] py python3 re red[o] ret[ab] ru ru[ntime] sav[eas] sbn[ext] scrip se[t] sfir[st] sil[ent] sm[agic] sN[ext] so spe[llgood] sp[lit] star stj[ump] sunme sy t tabe[dit] tabN tabp[revious] tc[l] th[row] tn tp[revious] tu u[ndo] unlo[ckvar] verb[ose] vim[grep] vne[w] win wn[ext] w[rite] xa[ll] xnoreme y[ank]
-syn keyword vimCommand contained ar argl[ocal] ba[ll] bn[ext] breaka[dd] buf c cal[l] ce[nter] cg[etfile] cl cN cnf[ile] comp[iler] cpf[ile] cstag debugg[reedy] deletel dell diffo[ff] dig dli[st] dsp[lit] echom[sg] en endt[ry] f fina[lly] foldc[lose] fun gui helpg[rep] ia in ju[mps] keepp[atterns] laddf[ile] lb[uffer] le[ft] lgete[xpr] ll lne lnf[ile] loc[kmarks] lr[ewind] lv[imgrep] marks mk mkv[imrc] mz[scheme] new nu[mber] opt[ions] pe[rl] pr prof[ile] ptj[ump] ptp[revious] py3 q
-syn match vimCommand contained "\<z[-+^.=]\="
+syn keyword vimCommand contained a arga[dd] ar[gs] bd[elete] bN[ext] breakl[ist] b[uffer] cad cb[uffer] cf[ile] changes cl[ist] cn[ext] col[der] conf[irm] cq[uit] cw[indow] delc[ommand] deletl delp diffpu[t] dir doau ea e[dit] endfo[r] ene[w] files fini[sh] foldd[oopen] g h helpt[ags] iabc[lear] intro k l lan lc[d] lefta[bove] lg[etfile] lla[st] lnew[er] lNf[ile] lockv[ar] ls lvimgrepa[dd] mat[ch] mk[exrc] mo n n[ext] nu[mber] opt[ions] pe[rl] pr prof[ile] ptj[ump] ptp[revious] py3 q r[ead] redr[aw] retu[rn] rub[y] rv[iminfo] sba[ll] sbN[ext] scripte[ncoding] setf[iletype] sh[ell] sim[alt] sm[ap] sni[ff] sor[t] spelli[nfo] spr[evious] start st[op] sunmenu syn ta tabf[ind] tabnew tabr[ewind] tcld[o] tj[ump] tN tr tu[nmenu] undoj[oin] uns[ilent] ve[rsion] vimgrepa[dd] vs[plit] winc[md] wN[ext] ws[verb] x[it] xnoremenu
+syn keyword vimCommand contained ab argd[elete] argu[ment] bel[owright] bo[tright] br[ewind] buffers caddb[uffer] cc cfir[st] chd[ir] clo[se] cN[ext] colo[rscheme] con[tinue] cr[ewind] d delel deletp dep diffs[plit] di[splay] dp earlier el[se] endfun ex filet fir[st] foldo[pen] go[to] ha[rdcopy] hi if is[earch] keepa la lan[guage] lch[dir] lex[pr] lgr[ep] lli[st] lne[xt] lo lol[der] lt[ag] lw[indow] menut mks[ession] mod[e] nbc[lose] nmapc[lear] o ownsyntax perld[o] pre[serve] promptf[ind] ptl[ast] ptr[ewind] py3do qa[ll] rec[over] redraws[tatus] rew[ind] rubyd[o] sal[l] sbf[irst] sbp[revious] scrip[tnames] setg[lobal] si sl sme sno[magic] so[urce] spellr[epall] sre[wind] startg[replace] stopi[nsert] sus[pend] sync tab tabfir[st] tabn[ext] tabs tclf[ile] tl[ast] tn[ext] tr[ewind] u undol[ist] up[date] vert[ical] vi[sual] w windo wp[revious] wundo xmapc[lear] xunme
+syn keyword vimCommand contained abc[lear] argdo as[cii] bf[irst] bp[revious] bro[wse] bun[load] cad[dexpr] ccl[ose] cgetb[uffer] che[ckpath] cmapc[lear] cnf com cope[n] cs de delep delf di difft[his] dj[ump] dr[op] ec elsei[f] endf[unction] exi[t] filetype fix[del] for gr[ep] h[elp] hid[e] ij[ump] isp[lit] keepalt lad la[st] lcl[ose] lf[ile] lgrepa[dd] lmak[e] lN[ext] loadk lop[en] lua ma menut[ranslate] mksp[ell] m[ove] nb[key] noa ol[dfiles] p po[p] prev[ious] promptr[epl] ptn pts[elect] pydo q[uit] red reg[isters] ri[ght] rubyf[ile] san[dbox] sbl[ast] sbr[ewind] scs setl[ocal] sig sla[st] smenu snoreme spe spellu[ndo] st star[tinsert] sts[elect] sv[iew] syncbind tabc[lose] tabl[ast] tabN[ext] ta[g] te[aroff] tm tN[ext] try un unh[ide] v vi viu[sage] wa[ll] winp[os] wq wv[iminfo] xme xunmenu
+syn keyword vimCommand contained abo[veleft] arge[dit] au bl[ast] brea[k] bu bw[ipeout] caddf[ile] cd cgete[xpr] checkt[ime] cn cNf comc[lear] co[py] cscope debug d[elete] delf[unction] diffg[et] diffu[pdate] dl ds[earch] echoe[rr] em[enu] en[dif] exu[sage] fin fo[ld] fu grepa[dd] helpc[lose] his[tory] il[ist] iuna[bbrev] keepj[umps] laddb[uffer] lat lcs lfir[st] lh[elpgrep] lmapc[lear] lnf loadkeymap lpf[ile] luado mak[e] mes mkv mz nbs[tart] noautocmd omapc[lear] pc[lose] popu p[rint] ps[earch] ptN pu[t] pyf[ile] quita[ll] redi[r] res[ize] rightb[elow] rundo sa[rgument] sbm[odified] sb[uffer] scscope sf[ind] sign sl[eep] sn[ext] snoremenu spelld[ump] spellw[rong] sta[g] startr[eplace] sun[hide] sw[apname] syntime tabd[o] tabm[ove] tabo[nly] tags tf[irst] tm[enu] to[pleft] ts[elect] una[bbreviate] unl ve vie[w] vmapc[lear] wh[ile] win[size] wqa[ll] x xmenu xwininfo
+syn keyword vimCommand contained al[l] argg[lobal] bad[d] bm[odified] breaka[dd] buf c cal[l] ce[nter] cg[etfile] cl cN cnf[ile] comp[iler] cpf[ile] cstag debugg[reedy] deletel dell diffo[ff] dig dli[st] dsp[lit] echom[sg] en endt[ry] f fina[lly] foldc[lose] fun gui helpf[ind] i imapc[lear] j[oin] kee[pmarks] lad[dexpr] later lcscope lgetb[uffer] l[ist] lN lNf lo[adview] lp[revious] luafile ma[rk] messages mkvie[w] mzf[ile] ne noh[lsearch] on[ly] pe popu[p] pro pta[g] ptn[ext] pw[d] py[thon] r red[o] ret[ab] ru ru[ntime] sav[eas] sbn[ext] scrip se[t] sfir[st] sil[ent] sm[agic] sN[ext] so spe[llgood] sp[lit] star stj[ump] sunme sy t tabe[dit] tabN tabp[revious] tc[l] th[row] tn tp[revious] tu u[ndo] unlo[ckvar] verb[ose] vim[grep] vne[w] win wn[ext] w[rite] xa[ll] xnoreme y[ank]
+syn keyword vimCommand contained ar argl[ocal] ba[ll] bn[ext] breakd[el] bufdo cabc[lear] cat[ch] cex[pr] c[hange] cla[st] cnew[er] cNf[ile] con cp[revious] cuna[bbrev] del deletep delm[arks] diffp[atch] dig[raphs] do e echon endf endw[hile] f[ile] fin[d] folddoc[losed] fu[nction] gvim helpg[rep] ia in ju[mps] keepp[atterns] laddf[ile] lb[uffer] le[ft] lgete[xpr] ll lne lnf[ile] loc[kmarks] lr[ewind] lv[imgrep] marks mk mkv[imrc] mz[scheme] new noswap[file] o[pen] ped[it] pp[op] profd[el] ptf[irst] ptN[ext] py python3 re
+syn match vimCommand contained "\<z[-+^.=]\=\>"
syn keyword vimStdPlugin contained DiffOrig Man N[ext] P[rint] S TOhtml XMLent XMLns
" vimOptions are caught only when contained in a vimSet {{{2
-syn keyword vimOption contained acd ambiwidth arabicshape autowriteall backupdir bdlay binary breakat bufhidden cd ci cinw co commentstring confirm cpoptions cscoperelative csre cursorcolumn delcombine diffopt ea efm ep et fdc fdo ffs filetype fo foldlevelstart formatexpr ft gfw gtt guipty hh hkmap ic imaf iminsert includeexpr inf isident key langmap lines lmap ma matchtime mco ml modeline mousefocus mousetime nrformats ofu para pdev pi previewwindow printmbfont qe relativenumber rightleftcmd ru sbr scrolloff selection shellcmdflag shellxescape showbreak si smartcase softtabstop spelllang sps sta su swb synmaxcol tagbsearch tbi termencoding thesaurus titlestring tpm ttm ttytype undodir ut vfile vop wcm whichwrap wildignore winaltkeys winminwidth wmnu write
-syn keyword vimOption contained ai ambw ari aw backupext beval biosk brk buflisted cdpath cin cinwords cocu compatible consk cpt cscopetag cst cursorline dex digraph ead ei equalalways eventignore fde fdt fic fillchars foldclose foldmarker formatlistpat gcr ghr guicursor guitablabel hi hkmapp icon imak ims incsearch infercase isk keymap langmenu linespace loadplugins macatsui maxcombine mef mls modelines mousehide mp nu omnifunc paragraphs penc pm printdevice printoptions quoteescape remap rl ruf sc scrollopt selectmode shellpipe shellxquote showcmd sidescroll smartindent sol spellsuggest sr stal sua swf syntax taglength tbidi terse tildeop tl tr tty tw undofile vb vi wa wd wi wildignorecase window winwidth wmw writeany
-syn keyword vimOption contained akm anti arshape awa backupskip bex bioskey browsedir buftype cedit cindent clipboard cole complete conskey crb cscopetagorder csto cwh dg dip eadirection ek equalprg ex fdi fen fileencoding fk foldcolumn foldmethod formatoptions gd go guifont guitabtooltip hid hkp iconstring imc imsearch inde insertmode iskeyword keymodel laststatus lisp lpl magic maxfuncdepth menuitems mm modifiable mousem mps number opendevice paste pex pmbcs printencoding prompt rdt report rlc ruler scb scs sessionoptions shellquote shiftround showfulltag sidescrolloff smarttab sp spf srr startofline suffixes switchbuf ta tagrelative tbis textauto timeout tm ts ttybuiltin tx undolevels vbs viewdir wak weirdinvert wic wildmenu winfixheight wiv wop writebackup
-syn keyword vimOption contained al antialias autochdir background balloondelay bexpr bk bs casemap cf cink cmdheight colorcolumn completefunc copyindent cryptmethod cscopeverbose csverb debug dict dir eb enc errorbells expandtab fdl fenc fileencodings fkmap foldenable foldminlines formatprg gdefault gp guifontset helpfile hidden hl ignorecase imcmdline imsf indentexpr is isp keywordprg lazyredraw lispwords ls makeef maxmapdepth mfd mmd modified mousemodel msm numberwidth operatorfunc pastetoggle pexpr pmbfn printexpr pt re restorescreen rnu rulerformat scr sect sft shellredir shiftwidth showmatch siso smc spc spl ss statusline suffixesadd sws tabline tags tbs textmode timeoutlen to tsl ttyfast uc undoreload vdir viewoptions warn wfh wig wildmode winfixwidth wiw wrap writedelay
-syn keyword vimOption contained aleph ar autoindent backspace ballooneval bg bkc bsdir cb cfu cinkeys cmdwinheight columns completeopt cot cscopepathcomp cspc cuc deco dictionary directory ed encoding errorfile exrc fdls fencs fileformat flp foldexpr foldnestmax fp gfm grepformat guifontwide helpheight highlight hlg im imd imstatusfunc indentkeys isf isprint km lbr list lsp makeprg maxmem mh mmp more mouses mzq nuw opfunc patchexpr pfn popt printfont pumheight readonly revins ro runtimepath scroll sections sh shellslash shm showmode sj smd spell splitbelow ssl stl sw sxe tabpagemax tagstack tenc textwidth title toolbar tsr ttym udf updatecount ve viminfo wb wfw wildchar wildoptions winheight wm wrapmargin ws
-syn keyword vimOption contained allowrevins arab autoread backup balloonexpr bh bl bsk cc ch cino cmp com concealcursor cp cscopeprg csprg cul def diff display edcompatible endofline errorformat fcl fdm fex fileformats fml foldignore foldopen fs gfn grepprg guiheadroom helplang history hls imactivatefunc imdisable inc indk isfname joinspaces kmp lcs listchars lw mat maxmempattern mis mmt mouse mouseshape mzquantum odev osfiletype patchmode ph preserveindent printheader pvh redrawtime ri rs sb scrollbind secure shcf shelltemp shortmess showtabline slm sn spellcapcheck splitright ssop stmp swapfile sxq tabstop tal term tf titlelen toolbariconsize ttimeout ttymouse udir updatetime verbose virtualedit wc wh wildcharm wim winminheight wmh wrapscan ww
-syn keyword vimOption contained altkeymap arabic autowrite backupcopy bdir bin bomb bt ccv charconvert cinoptions cms comments conceallevel cpo cscopequickfix csqf cursorbind define diffexpr dy ef eol esckeys fcs fdn ff fileignorecase fmr foldlevel foldtext fsync gfs gtl guioptions hf hk hlsearch imactivatekey imi include inex isi js kp linebreak lm lz matchpairs maxmemtot mkspellmem mod mousef mouset nf oft pa path pheader previewheight printmbcharset pvw regexpengine rightleft rtp sbo scrolljump sel shell shelltype shortname shq sm so spellfile spr st sts swapsync syn tag tb termbidi tgst titleold top ttimeoutlen ttyscroll ul ur verbosefile visualbell
+syn keyword vimOption contained acd ambiwidth arabicshape autowriteall backupdir bdlay binary breakat bs casemap cf cink cmdheight colorcolumn completefunc copyindent cryptmethod cscopeverbose csverb debug dict dir eb enc errorbells expandtab fdl fenc fileencodings fkmap foldenable foldminlines formatprg gdefault gp guifontset helpfile hidden hl ignorecase imcmdline imsf indentexpr is isp keywordprg laststatus lisp loadplugins macatsui maxcombine mef mls modelines mousehide mp nu omnifunc paragraphs penc pm printdevice printoptions quoteescape remap rightleftcmd rtp sbo scrolljump sel shell shelltype shortname shq sm so spellfile spr st sts swapsync syn tag tb termbidi tgst titleold top ttimeoutlen ttyscroll ul ur verbosefile visualbell wcm wi wildmenu winfixwidth wm wrapscan
+syn keyword vimOption contained ai ambw ari aw backupext beval biosk breakindent bsdir cb cfu cinkeys cmdwinheight columns completeopt cot cscopepathcomp cspc cuc deco dictionary directory ed encoding errorfile exrc fdls fencs fileformat flp foldexpr foldnestmax fp gfm grepformat guifontwide helpheight highlight hlg im imd imstatusfunc indentkeys isf isprint km lazyredraw lispwords lpl magic maxfuncdepth menuitems mm modifiable mousem mps number opendevice paste pex pmbcs printencoding prompt rdt renderoptions rl ru sbr scrolloff selection shellcmdflag shellxescape showbreak si smartcase softtabstop spelllang sps sta su swb synmaxcol tagbsearch tbi termencoding thesaurus titlestring tpm ttm ttytype undodir ut vfile vop wd wic wildmode winheight wmh write
+syn keyword vimOption contained akm anti arshape awa backupskip bex bioskey breakindentopt bsk cc ch cino cmp com concealcursor cp cscopeprg csprg cul def diff display edcompatible endofline errorformat fcl fdm fex fileformats fml foldignore foldopen fs gfn grepprg guiheadroom helplang history hls imactivatefunc imdisable inc indk isfname joinspaces kmp lbr list ls makeef maxmapdepth mfd mmd modified mousemodel msm numberwidth operatorfunc pastetoggle pexpr pmbfn printexpr pt re report rlc ruf sc scrollopt selectmode shellpipe shellxquote showcmd sidescroll smartindent sol spellsuggest sr stal sua swf syntax taglength tbidi terse tildeop tl tr tty tw undofile vb vi wa weirdinvert wig wildoptions winminheight wmnu writeany
+syn keyword vimOption contained al antialias autochdir background balloondelay bexpr bk bri bt ccv charconvert cinoptions cms comments conceallevel cpo cscopequickfix csqf cursorbind define diffexpr dy ef eol esckeys fcs fdn ff fileignorecase fmr foldlevel foldtext fsync gfs gtl guioptions hf hk hlsearch imactivatekey imi include inex isi js kp lcs listchars lsp makeprg maxmem mh mmp more mouses mzq nuw opfunc patchexpr pfn popt printfont pumheight readonly restorescreen rnu ruler scb scs sessionoptions shellquote shiftround showfulltag sidescrolloff smarttab sp spf srr startofline suffixes switchbuf ta tagrelative tbis textauto timeout tm ts ttybuiltin tx undolevels vbs viewdir wak wfh wildchar wim winminwidth wmw writebackup
+syn keyword vimOption contained aleph ar autoindent backspace ballooneval bg bkc briopt bufhidden cd ci cinw co commentstring confirm cpoptions cscoperelative csre cursorcolumn delcombine diffopt ea efm ep et fdc fdo ffs filetype fo foldlevelstart formatexpr ft gfw gtt guipty hh hkmap ic imaf iminsert includeexpr inf isident key langmap linebreak lm lw mat maxmempattern mis mmt mouse mouseshape mzquantum odev osfiletype patchmode ph preserveindent printheader pvh redrawtime revins ro rulerformat scr sect sft shellredir shiftwidth showmatch siso smc spc spl ss statusline suffixesadd sws tabline tags tbs textmode timeoutlen to tsl ttyfast uc undoreload vdir viewoptions warn wfw wildcharm winaltkeys winwidth wop writedelay
+syn keyword vimOption contained allowrevins arab autoread backup balloonexpr bh bl brk buflisted cdpath cin cinwords cocu compatible consk cpt cscopetag cst cursorline dex digraph ead ei equalalways eventignore fde fdt fic fillchars foldclose foldmarker formatlistpat gcr ghr guicursor guitablabel hi hkmapp icon imak ims incsearch infercase isk keymap langmenu lines lmap lz matchpairs maxmemtot mkspellmem mod mousef mouset nf oft pa path pheader previewheight printmbcharset pvw regexpengine ri rop runtimepath scroll sections sh shellslash shm showmode sj smd spell splitbelow ssl stl sw sxe tabpagemax tagstack tenc textwidth title toolbar tsr ttym udf updatecount ve viminfo wb wh wildignore window wiv wrap ws
+syn keyword vimOption contained altkeymap arabic autowrite backupcopy bdir bin bomb browsedir buftype cedit cindent clipboard cole complete conskey crb cscopetagorder csto cwh dg dip eadirection ek equalprg ex fdi fen fileencoding fk foldcolumn foldmethod formatoptions gd go guifont guitabtooltip hid hkp iconstring imc imsearch inde insertmode iskeyword keymodel langnoremap linespace lnr ma matchtime mco ml modeline mousefocus mousetime nrformats ofu para pdev pi previewwindow printmbfont qe relativenumber rightleft rs sb scrollbind secure shcf shelltemp shortmess showtabline slm sn spellcapcheck splitright ssop stmp swapfile sxq tabstop tal term tf titlelen toolbariconsize ttimeout ttymouse udir updatetime verbose virtualedit wc whichwrap wildignorecase winfixheight wiw wrapmargin ww
" vimOptions: These are the turn-off setting variants {{{2
syn keyword vimOption contained noacd noallowrevins noantialias noarabic noarshape noautoread noaw noballooneval nobinary nobk nobuflisted nocin noconfirm nocopyindent nocscoperelative nocsre nocuc nocursorcolumn nodelcombine nodigraph noed noendofline noerrorbells noex nofen nofk nogd nohid nohkmap nohkp nohlsearch noicon noim noimcmdline noimdisable noinf noinsertmode nojoinspaces nolazyredraw nolinebreak nolist nolpl noma nomagic noml nomodeline nomodified nomousef nomousehide nonumber noopendevice nopi nopreviewwindow nopvw norelativenumber norestorescreen nori norl noro noru nosb noscb noscs nosft noshelltemp noshortname noshowfulltag noshowmode nosm nosmartindent nosmd nosol nosplitbelow nospr nossl nostartofline noswapfile nota notagrelative notbi notbs noterse notextmode notgst notimeout noto notr nottybuiltin notx noundofile novisualbell nowarn noweirdinvert nowfw nowildignorecase nowinfixheight nowiv nowrap nowrite nowritebackup
@@ -62,7 +63,7 @@ syn keyword vimErrSetting contained hardtabs ht w1200 w300 w9600
" 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 Cmd-event 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 QuickFixCmdPost QuickFixCmdPre QuitPre RemoteReply SessionLoadPost ShellCmdPost ShellFilterPost SourceCmd SourcePre SpellFileMissing StdinReadPost StdinReadPre SwapExists Syntax TabEnter TabLeave TermChanged TermResponse TextChanged TextChangedI User UserGettingBored VimEnter VimLeave VimLeavePre VimResized WinEnter WinLeave
+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 Cmd-event 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 QuickFixCmdPost QuickFixCmdPre QuitPre RemoteReply SessionLoadPost ShellCmdPost ShellFilterPost SourceCmd SourcePre SpellFileMissing StdinReadPost StdinReadPre SwapExists Syntax TabEnter TabLeave TermChanged TermResponse TextChanged TextChangedI User UserGettingBored VimEnter VimLeave VimLeavePre VimResized WinEnter WinLeave
" 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
@@ -73,9 +74,9 @@ syn match vimHLGroup contained "Conceal"
syn case match
" Function Names {{{2
-syn keyword vimFuncName contained abs and argidx atan browsedir bufloaded bufwinnr byteidxcomp changenr clearmatches complete_add copy count deepcopy diff_filler escape executable expand feedkeys filter float2nr fnameescape foldclosedend foldtextresult garbagecollect getbufvar getcmdline getcwd getfsize getline getpid getreg gettabwinvar getwinvar has hasmapto histget hlID indent inputdialog inputsave invert items len line localtime luaeval mapcheck matcharg matchlist min mzeval or prevnonblank py3eval readfile remote_expr remote_read rename reverse screenchar search searchpairpos serverlist setcmdpos setloclist setpos setreg settabwinvar sha256 shiftwidth sin sort spellbadword split str2float strchars strftime string strpart strtrans submatch synconcealed synIDattr synstack tabpagebuflist tabpagewinnr taglist tanh tolower tr type undotree virtcol wildmenumode wincol winline winrestcmd winsaveview writefile
-syn keyword vimFuncName contained acos append argv atan2 bufexists bufname byte2line call char2nr col complete_check cos cscope_connection delete diff_hlID eval exists expr8 filereadable finddir floor fnamemodify foldlevel foreground get getchar getcmdpos getfontname getftime getloclist getpos getregtype getwinposx glob has_key histadd histnr hostname index inputlist inputsecret isdirectory join libcall line2byte log map match matchdelete matchstr mkdir nextnonblank pathshorten printf pyeval reltime remote_foreground remote_send repeat round screencol searchdecl searchpos setbufvar setline setmatches setqflist settabvar setwinvar shellescape simplify sinh soundfold spellsuggest sqrt str2nr strdisplaywidth stridx strlen strridx strwidth substitute synID synIDtrans system tabpagenr tagfiles tan tempname toupper trunc undofile values visualmode winbufnr winheight winnr winrestview winwidth xor
-syn keyword vimFuncName contained add argc asin browse buflisted bufnr byteidx ceil cindent complete confirm cosh cursor did_filetype empty eventhandler exp extend filewritable findfile fmod foldclosed foldtext function getbufline getcharmod getcmdtype getfperm getftype getmatches getqflist gettabvar getwinposy globpath haslocaldir histdel hlexists iconv input inputrestore insert islocked keys libcallnr lispindent log10 maparg matchadd matchend max mode nr2char pow pumvisible range reltimestr remote_peek remove resolve screenattr screenrow searchpair server2client
+syn keyword vimFuncName contained abs and argidx asin browse buflisted bufnr byteidx ceil cindent complete confirm cosh cursor did_filetype empty eventhandler exists expr8 filereadable finddir floor fnamemodify foldlevel foreground get getchar getcmdpos getcwd getfsize getline getpid getreg gettabwinvar getwinvar has hasmapto histget hlID indent inputdialog inputsave invert items len line localtime luaeval mapcheck matchaddpos matchend max mode nr2char pow pumvisible range reltimestr remote_peek remove resolve screenattr screenrow searchpair server2client setcmdpos setmatches setreg setwinvar shiftwidth sin sort spellbadword split str2float strchars strftime string strpart strtrans submatch synconcealed synIDattr synstack systemlist tabpagenr tagfiles tan tempname toupper trunc undofile uniq virtcol wildmenumode wincol winline winrestcmd winsaveview writefile
+syn keyword vimFuncName contained acos append arglistid atan browsedir bufloaded bufwinnr byteidxcomp changenr clearmatches complete_add copy count deepcopy diff_filler escape executable exp extend filewritable findfile fmod foldclosed foldtext function getbufline getcharmod getcmdtype getfontname getftime getloclist getpos getregtype getwinposx glob has_key histadd histnr hostname index inputlist inputsecret isdirectory join libcall line2byte log map match matcharg matchlist min mzeval or prevnonblank py3eval readfile remote_expr remote_read rename reverse screenchar search searchpairpos serverlist setline setpos settabvar sha256 simplify sinh soundfold spellsuggest sqrt str2nr strdisplaywidth stridx strlen strridx strwidth substitute synID synIDtrans system tabpagebuflist tabpagewinnr taglist tanh tolower tr type undotree values visualmode winbufnr winheight winnr winrestview winwidth xor
+syn keyword vimFuncName contained add argc argv atan2 bufexists bufname byte2line call char2nr col complete_check cos cscope_connection delete diff_hlID eval exepath expand feedkeys filter float2nr fnameescape foldclosedend foldtextresult garbagecollect getbufvar getcmdline getcurpos getfperm getftype getmatches getqflist gettabvar getwinposy globpath haslocaldir histdel hlexists iconv input inputrestore insert islocked keys libcallnr lispindent log10 maparg matchadd matchdelete matchstr mkdir nextnonblank pathshorten printf pyeval reltime remote_foreground remote_send repeat round screencol searchdecl searchpos setbufvar setloclist setqflist settabwinvar shellescape
"--- syntax here and above generated by mkvimvim ---
" Special Vim Highlighting (not automatic) {{{1
@@ -96,17 +97,17 @@ endif
" Numbers {{{2
" =======
-syn match vimNumber "\<\d\+\%(\.\d\+\%([eE][+-]\=\d\+\)\=\)\=" skipwhite nextgroup=vimGlobal,vimSubst,vimCommand
-syn match vimNumber "-\d\+\%(\.\d\+\%([eE][+-]\=\d\+\)\=\)\=" skipwhite nextgroup=vimGlobal,vimSubst,vimCommand
+syn match vimNumber "\<\d\+\([lL]\|\.\d\+\)\="
+syn match vimNumber "-\d\+\([lL]\|\.\d\+\)\="
syn match vimNumber "\<0[xX]\x\+"
-syn match vimNumber "#\x\{6}"
+syn match vimNumber "\%(^\|[^a-zA-Z]\)\zs#\x\{6}"
" All vimCommands are contained by vimIsCommands. {{{2
-syn match vimCmdSep "[:|]\+" skipwhite nextgroup=vimAddress,vimAutoCmd,vimCommand,vimExtCmd,vimFilter,vimLet,vimMap,vimMark,vimSet,vimSyntax,vimUserCmd
+syn match vimCmdSep "[:|]\+" skipwhite nextgroup=vimAddress,vimAutoCmd,vimIsCommand,vimExtCmd,vimFilter,vimLet,vimMap,vimMark,vimSet,vimSyntax,vimUserCmd
syn match vimIsCommand "\<\h\w*\>" contains=vimCommand
-syn match vimVar contained "\<\h[a-zA-Z0-9#_]*\>"
-syn match vimVar "\<[bwglsav]:\h[a-zA-Z0-9#_]*\>"
-syn match vimFBVar contained "\<[bwglsav]:\h[a-zA-Z0-9#_]*\>"
+syn match vimVar "\<[bwglsav]:\K\k*\>"
+syn match vimVar contained "\<\K\k*\>"
+syn match vimFBVar contained "\<[bwglsav]:\K\k*\>"
syn keyword vimCommand contained in
" Insertions And Appends: insert append {{{2
@@ -134,26 +135,25 @@ syn keyword vimFTOption contained detect indent off on plugin
" Augroup : vimAugroupError removed because long augroups caused sync'ing problems. {{{2
" ======= : Trade-off: Increasing synclines with slower editing vs augroup END error checking.
-syn cluster vimAugroupList contains=vimIsCommand,vimCommand,vimUserCmd,vimExecute,vimNotFunc,vimFuncName,vimFunction,vimFunctionError,vimLineComment,vimSpecFile,vimOper,vimNumber,vimOperParen,vimComment,vimString,vimSubst,vimMark,vimRegister,vimAddress,vimFilter,vimCmplxRepeat,vimComment,vimLet,vimSet,vimAutoCmd,vimRegion,vimSynLine,vimNotation,vimCtrlChar,vimFuncVar,vimContinue
+syn cluster vimAugroupList contains=vimAugroup,vimIsCommand,vimCommand,vimUserCmd,vimExecute,vimNotFunc,vimFuncName,vimFunction,vimFunctionError,vimLineComment,vimMap,vimSpecFile,vimOper,vimNumber,vimOperParen,vimComment,vimString,vimSubst,vimMark,vimRegister,vimAddress,vimFilter,vimCmplxRepeat,vimComment,vimLet,vimSet,vimAutoCmd,vimRegion,vimSynLine,vimNotation,vimCtrlChar,vimFuncVar,vimContinue
if exists("g:vimsyn_folding") && g:vimsyn_folding =~ 'a'
- syn region vimAugroup fold start="\<aug\%[roup]\>\s\+\h\w*" end="\<aug\%[roup]\>\s\+[eE][nN][dD]\>" contains=vimAugroupKey,vimAutoCmd,@vimAugroupList keepend
+ syn region vimAugroup fold matchgroup=vimAugroupKey start="\<aug\%[roup]\>\ze\s\+\K\k*" end="\<aug\%[roup]\>\ze\s\+[eE][nN][dD]\>" contains=vimAutoCmd,@vimAugroupList
else
- syn region vimAugroup start="\<aug\%[roup]\>\s\+\h\w*" end="\<aug\%[roup]\>\s\+[eE][nN][dD]\>" contains=vimAugroupKey,vimAutoCmd,@vimAugroupList keepend
+ syn region vimAugroup matchgroup=vimAugroupKey start="\<aug\%[roup]\>\ze\s\+\K\k*" end="\<aug\%[roup]\>\ze\s\+[eE][nN][dD]\>" contains=vimAutoCmd,@vimAugroupList
endif
syn match vimAugroup "aug\%[roup]!" contains=vimAugroupKey
if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noaugrouperror")
syn match vimAugroupError "\<aug\%[roup]\>\s\+[eE][nN][dD]\>"
endif
-syn keyword vimAugroupKey contained aug[roup]
+"syn keyword vimAugroupKey contained aug[roup]
" Operators: {{{2
" =========
-" COMBAK: vimOperParen used to have "oneline"
-syn cluster vimOperGroup contains=vimEnvvar,vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimRegister,vimContinue
+syn cluster vimOperGroup contains=vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimRegister,vimContinue
syn match vimOper "\(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\|=\)[?#]\{0,2}" skipwhite nextgroup=vimString,vimSpecFile
syn match vimOper "||\|&&\|[-+.]" skipwhite nextgroup=vimString,vimSpecFile
-syn region vimOperParen matchgroup=vimParenSep start="(" end=")" contains=@vimOperGroup
-syn region vimOperParen matchgroup=vimSep start="{" end="}" contains=@vimOperGroup nextgroup=vimVar,vimFuncVar
+syn region vimOperParen oneline matchgroup=vimParenSep start="(" end=")" contains=@vimOperGroup
+syn region vimOperParen oneline matchgroup=vimSep start="{" end="}" contains=@vimOperGroup nextgroup=vimVar,vimFuncVar
if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noopererror")
syn match vimOperError ")"
endif
@@ -161,7 +161,7 @@ endif
" Functions : Tag is provided for those who wish to highlight tagged functions {{{2
" =========
syn cluster vimFuncList contains=vimCommand,vimFunctionError,vimFuncKey,Tag,vimFuncSID
-syn cluster vimFuncBodyList contains=vimAbb,vimAddress,vimAugroupKey,vimAutoCmd,vimCmplxRepeat,vimComment,vimComment,vimContinue,vimCtrlChar,vimEcho,vimEchoHL,vimExecute,vimIf,vimIsCommand,vimFBVar,vimFunc,vimFunction,vimFuncVar,vimHighlight,vimIsCommand,vimLet,vimLineComment,vimMap,vimMark,vimNorm,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSet,vimSpecFile,vimString,vimSubst,vimSynLine,vimUnmap,vimUserCommand
+syn cluster vimFuncBodyList contains=vimAbb,vimAddress,vimAugroupKey,vimAutoCmd,vimCmplxRepeat,vimComment,vimComment,vimContinue,vimCtrlChar,vimEcho,vimEchoHL,vimExecute,vimIf,vimIsCommand,vimFBVar,vimFunc,vimFunction,vimFuncVar,vimGlobal,vimHighlight,vimIsCommand,vimLet,vimLineComment,vimMap,vimMark,vimNorm,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSet,vimSpecFile,vimString,vimSubst,vimSynLine,vimUserCommand
syn match vimFunction "\<fu\%[nction]!\=\s\+\%(<[sS][iI][dD]>\|[sSgGbBwWtTlL]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)*\ze\s*(" contains=@vimFuncList nextgroup=vimFuncBody
if exists("g:vimsyn_folding") && g:vimsyn_folding =~ 'f'
@@ -169,7 +169,7 @@ if exists("g:vimsyn_folding") && g:vimsyn_folding =~ 'f'
else
syn region vimFuncBody contained start="\ze(" matchgroup=vimCommand end="\<\(endf\>\|endfu\%[nction]\>\)" contains=@vimFuncBodyList
endif
-syn match vimFuncVar contained "a:\(\h\w*\|\d\+\)"
+syn match vimFuncVar contained "a:\(\K\k*\|\d\+\)"
syn match vimFuncSID contained "\c<sid>\|\<s:"
syn keyword vimFuncKey contained fu[nction]
syn match vimFuncBlank contained "\s\+"
@@ -203,9 +203,9 @@ if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_nousercmderror")
endif
syn case ignore
syn keyword vimUserAttrbKey contained bar ban[g] cou[nt] ra[nge] com[plete] n[args] re[gister]
-syn keyword vimUserAttrbCmplt contained augroup buffer color command compiler cscope dir environment event expression file file_in_path filetype function help highlight locale mapping menu option shellcmd sign syntax tag tag_listfiles var
+syn keyword vimUserAttrbCmplt contained augroup buffer command dir environment event expression file function help highlight mapping menu option shellcmd something tag tag_listfiles var
syn keyword vimUserAttrbCmplt contained custom customlist nextgroup=vimUserAttrbCmpltFunc,vimUserCmdError
-syn match vimUserAttrbCmpltFunc contained ",\%([sS]:\|<[sS][iI][dD]>\)\=\%(\h\w*\%(#\h\w*\)\+\|\h\w*\)"hs=s+1 nextgroup=vimUserCmdError
+syn match vimUserAttrbCmpltFunc contained ",\%([sS]:\|<[sS][iI][dD]>\)\=\%(\h\w*\%(#\u\w*\)\+\|\u\w*\)"hs=s+1 nextgroup=vimUserCmdError
syn case match
syn match vimUserAttrbCmplt contained "custom,\u\w*"
@@ -232,8 +232,8 @@ syn region vimPatSepZone oneline contained matchgroup=vimPatSepZ start="\\%\
syn region vimPatRegion contained transparent matchgroup=vimPatSepR start="\\[z%]\=(" end="\\)" contains=@vimSubstList oneline
syn match vimNotPatSep contained "\\\\"
syn cluster vimStringGroup contains=vimEscapeBrace,vimPatSep,vimNotPatSep,vimPatSepErr,vimPatSepZone,@Spell
-syn region vimString oneline keepend start=+[^:a-zA-Z>!\\@]"+lc=1 skip=+\\\\\|\\"+ end=+"+ contains=@vimStringGroup
-syn region vimString oneline keepend start=+[^:a-zA-Z>!\\@]'+lc=1 end=+'+
+syn region vimString oneline keepend start=+[^a-zA-Z>!\\@]"+lc=1 skip=+\\\\\|\\"+ end=+"+ contains=@vimStringGroup
+syn region vimString oneline keepend start=+[^a-zA-Z>!\\@]'+lc=1 end=+'+
syn region vimString oneline start=+=!+lc=1 skip=+\\\\\|\\!+ end=+!+ contains=@vimStringGroup
syn region vimString oneline start="=+"lc=1 skip="\\\\\|\\+" end="+" contains=@vimStringGroup
syn region vimString oneline start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/" contains=@vimStringGroup
@@ -245,7 +245,7 @@ syn match vimStringCont contained +\(\\\\\|.\)\{-}[^\\]"+
syn cluster vimSubstList contains=vimPatSep,vimPatRegion,vimPatSepErr,vimSubstTwoBS,vimSubstRange,vimNotation
syn cluster vimSubstRepList contains=vimSubstSubstr,vimSubstTwoBS,vimNotation
syn cluster vimSubstList add=vimCollection
-syn match vimSubst "\(:\+\s*\|^\s*\||\s*\)\<\%(s\%[ubstitute]\|sm\%[agic]\|sno\%[magic]\)[:[:alpha:]]\@!" nextgroup=vimSubstPat
+syn match vimSubst "\(:\+\s*\|^\s*\||\s*\)\<s\%[ubstitute][:[:alpha:]]\@!" nextgroup=vimSubstPat
syn match vimSubst "s\%[ubstitute][:#[:alpha:]]\@!" nextgroup=vimSubstPat contained
syn match vimSubst "/\zss\%[ubstitute]\ze/" nextgroup=vimSubstPat
syn match vimSubst1 contained "s\%[ubstitute]\>" nextgroup=vimSubstPat
@@ -289,7 +289,7 @@ syn match vimCmplxRepeat '@[0-9a-z".=@:]\ze\($\|[^a-zA-Z]\>\)'
" Set command and associated set-options (vimOptions) with comment {{{2
syn region vimSet matchgroup=vimCommand start="\<\%(setl\%[ocal]\|setg\%[lobal]\|se\%[t]\)\>" skip="\%(\\\\\)*\\." end="$" matchgroup=vimNotation end="<[cC][rR]>" keepend oneline contains=vimSetEqual,vimOption,vimErrSetting,vimComment,vimSetString,vimSetMod
-syn region vimSetEqual contained start="[=:]\|[-+^]=" skip="\\\\\|\\\s" end="[| \t]\|$"me=e-1 contains=vimCtrlChar,vimSetSep,vimNotation,vimEnvvar oneline
+syn region vimSetEqual contained start="[=:]\|[-+^]=" skip="\%(\\\\\)*\\." end="[| \t]\|$"me=e-1 contains=vimCtrlChar,vimSetSep,vimNotation oneline
syn region vimSetString contained start=+="+hs=s+1 skip=+\\\\\|\\"+ end=+"+ contains=vimCtrlChar
syn match vimSetSep contained "[,:]"
syn match vimSetMod contained "&vim\=\|[!&?<]\|all&"
@@ -326,9 +326,9 @@ syn keyword vimMap mapc[lear] smapc[lear]
syn keyword vimUnmap cu[nmap] iu[nmap] lu[nmap] nun[map] ou[nmap] sunm[ap] unm[ap] unm[ap] vu[nmap] xu[nmap] skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs
syn match vimMapLhs contained "\S\+" contains=vimNotation,vimCtrlChar skipwhite nextgroup=vimMapRhs
syn match vimMapBang contained "!" skipwhite nextgroup=vimMapMod,vimMapLhs
-syn match vimMapMod contained "\c<\(buffer\|expr\|\(local\)\=leader\|plug\|script\|sid\|unique\|silent\)\+>" contains=vimMapModKey,vimMapModErr skipwhite nextgroup=vimMapMod,vimMapLhs
+syn match vimMapMod contained "\c<\(buffer\|expr\|\(local\)\=leader\|nowait\|plug\|script\|sid\|unique\|silent\)\+>" contains=vimMapModKey,vimMapModErr skipwhite nextgroup=vimMapMod,vimMapLhs
syn match vimMapRhs contained ".*" contains=vimNotation,vimCtrlChar skipnl nextgroup=vimMapRhsExtend
-syn match vimMapRhsExtend contained "^\s*\\.*$" contains=vimNotation,vimCtrlChar,vimContinue skipnl nextgroup=vimMapRhsExtend
+syn match vimMapRhsExtend contained "^\s*\\.*$" contains=vimContinue
syn case ignore
syn keyword vimMapModKey contained buffer expr leader localleader plug script sid silent unique
syn case match
@@ -348,7 +348,7 @@ syn match vimMenuBang "!" contained skipwhite nextgroup=@vimMenuList
" Angle-Bracket Notation (tnx to Michael Geddes) {{{2
" ======================
syn case ignore
-syn match vimNotation "\(\\\|<lt>\)\=<\([scamd]-\)\{0,4}x\=\(f\d\{1,2}\|[^ \t:]\|cr\|lf\|linefeed\|return\|k\=del\%[ete]\|bs\|backspace\|tab\|esc\|right\|left\|help\|undo\|insert\|ins\|k\=home\|k\=end\|kplus\|kminus\|kdivide\|kmultiply\|kenter\|kpoint\|space\|k\=\(page\)\=\(\|down\|up\|k\d\>\)\)>" contains=vimBracket
+syn match vimNotation "\(\\\|<lt>\)\=<\([scamd]-\)\{0,4}x\=\(f\d\{1,2}\|[^ \t:]\|cr\|lf\|linefeed\|return\|k\=del\%[ete]\|bs\|backspace\|tab\|esc\|right\|left\|help\|undo\|insert\|ins\|k\=home\|k\=end\|kplus\|kminus\|kdivide\|kmultiply\|kenter\|kpoint\|space\|k\=\(page\)\=\(\|down\|up\|k[0-9]\)\)>" contains=vimBracket
syn match vimNotation "\(\\\|<lt>\)\=<\([scam2-4]-\)\{0,4}\(right\|left\|middle\)\(mouse\)\=\(drag\|release\)\=>" contains=vimBracket
syn match vimNotation "\(\\\|<lt>\)\=<\(bslash\|plug\|sid\|space\|bar\|nop\|nul\|lt\)>" contains=vimBracket
syn match vimNotation '\(\\\|<lt>\)\=<C-R>[0-9a-z"%#:.\-=]'he=e-1 contains=vimBracket
@@ -360,8 +360,8 @@ syn case match
" User Function Highlighting {{{2
" (following Gautam Iyer's suggestion)
" ==========================
-syn match vimFunc "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%([a-zA-Z0-9_]\+\.\)*\I[a-zA-Z0-9_.]*\)\ze\s*(" contains=vimFuncName,vimUserFunc,vimExecute
-syn match vimUserFunc contained "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%([a-zA-Z0-9_]\+\.\)*\I[a-zA-Z0-9_.]*\)\|\<\u[a-zA-Z0-9.]*\>\|\<if\>" contains=vimNotation
+syn match vimFunc "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%([a-zA-Z0-9_.]\+\.\)*\I[a-zA-Z0-9_.]*\)\ze\s*(" contains=vimFuncName,vimUserFunc,vimExecute
+syn match vimUserFunc contained "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%([a-zA-Z0-9_.]\+\.\)*\I[a-zA-Z0-9_.]*\)\|\<\u[a-zA-Z0-9.]*\>\|\<if\>" contains=vimNotation
syn match vimNotFunc "\<if\>\|\<el\%[seif]\>\|\<return\>\|\<while\>"
" Errors And Warnings: {{{2
@@ -407,7 +407,7 @@ syn keyword vimSynType contained clear skipwhite nextgroup=vimGroupList
" Syntax: cluster {{{2
syn keyword vimSynType contained cluster skipwhite nextgroup=vimClusterName
-syn region vimClusterName contained matchgroup=vimGroupName start="\h\w*" skip="\\\\\|\\|" matchgroup=vimSep end="$\||" contains=vimGroupAdd,vimGroupRem,vimSynContains,vimSynError
+syn region vimClusterName contained matchgroup=vimGroupName start="\k\+" skip="\\\\\|\\|" matchgroup=vimSep end="$\||" contains=vimGroupAdd,vimGroupRem,vimSynContains,vimSynError
syn match vimGroupAdd contained "add=" nextgroup=vimGroupList
syn match vimGroupRem contained "remove=" nextgroup=vimGroupList
syn cluster vimFuncBodyList add=vimSynType,vimGroupAdd,vimGroupRem
@@ -419,17 +419,17 @@ syn cluster vimFuncBodyList add=vimSynType
" Syntax: keyword {{{2
syn cluster vimSynKeyGroup contains=vimSynNextgroup,vimSynKeyOpt,vimSynKeyContainedin
syn keyword vimSynType contained keyword skipwhite nextgroup=vimSynKeyRegion
-syn region vimSynKeyRegion contained oneline keepend matchgroup=vimGroupName start="\h\w*" skip="\\\\\|\\|" matchgroup=vimSep end="|\|$" contains=@vimSynKeyGroup
+syn region vimSynKeyRegion contained oneline keepend matchgroup=vimGroupName start="\k\+" skip="\\\\\|\\|" matchgroup=vimSep end="|\|$" contains=@vimSynKeyGroup
syn match vimSynKeyOpt contained "\<\(conceal\|contained\|transparent\|skipempty\|skipwhite\|skipnl\)\>"
syn cluster vimFuncBodyList add=vimSynType
" Syntax: match {{{2
syn cluster vimSynMtchGroup contains=vimMtchComment,vimSynContains,vimSynError,vimSynMtchOpt,vimSynNextgroup,vimSynRegPat,vimNotation
syn keyword vimSynType contained match skipwhite nextgroup=vimSynMatchRegion
-syn region vimSynMatchRegion contained keepend matchgroup=vimGroupName start="\h\w*" matchgroup=vimSep end="|\|$" contains=@vimSynMtchGroup
+syn region vimSynMatchRegion contained keepend matchgroup=vimGroupName start="\k\+" matchgroup=vimSep end="|\|$" contains=@vimSynMtchGroup
syn match vimSynMtchOpt contained "\<\(conceal\|transparent\|contained\|excludenl\|skipempty\|skipwhite\|display\|extend\|skipnl\|fold\)\>"
if has("conceal")
- syn match vimSynMtchOpt contained "\<cchar=" nextgroup=vimSynMtchCchar
+ syn match vimSynMtchOpt contained "\<cchar=" nextgroup=VimSynMtchCchar
syn match vimSynMtchCchar contained "\S"
endif
syn cluster vimFuncBodyList add=vimSynMtchGroup
@@ -441,7 +441,7 @@ syn keyword vimSynType contained enable list manual off on reset
syn cluster vimSynRegPatGroup contains=vimPatSep,vimNotPatSep,vimSynPatRange,vimSynNotPatRange,vimSubstSubstr,vimPatRegion,vimPatSepErr,vimNotation
syn cluster vimSynRegGroup contains=vimSynContains,vimSynNextgroup,vimSynRegOpt,vimSynReg,vimSynMtchGrp
syn keyword vimSynType contained region skipwhite nextgroup=vimSynRegion
-syn region vimSynRegion contained keepend matchgroup=vimGroupName start="\h\w*" skip="\\\\\|\\|" end="|\|$" contains=@vimSynRegGroup
+syn region vimSynRegion contained keepend matchgroup=vimGroupName start="\k\+" skip="\\\\\|\\|" end="|\|$" contains=@vimSynRegGroup
syn match vimSynRegOpt contained "\<\(conceal\(ends\)\=\|transparent\|contained\|excludenl\|skipempty\|skipwhite\|display\|keepend\|oneline\|extend\|skipnl\|fold\)\>"
syn match vimSynReg contained "\(start\|skip\|end\)="he=e-1 nextgroup=vimSynRegPat
syn match vimSynMtchGrp contained "matchgroup=" nextgroup=vimGroup,vimHLGroup
@@ -467,9 +467,9 @@ syn keyword vimSyncRegion contained region skipwhite nextgroup=vimSynReg
syn match vimSyncLinebreak contained "\<linebreaks=" skipwhite nextgroup=vimNumber
syn keyword vimSyncLinecont contained linecont skipwhite nextgroup=vimSynRegPat
syn match vimSyncLines contained "\(min\|max\)\=lines=" nextgroup=vimNumber
-syn match vimSyncGroupName contained "\h\w*" skipwhite nextgroup=vimSyncKey
+syn match vimSyncGroupName contained "\k\+" skipwhite nextgroup=vimSyncKey
syn match vimSyncKey contained "\<groupthere\|grouphere\>" skipwhite nextgroup=vimSyncGroup
-syn match vimSyncGroup contained "\h\w*" skipwhite nextgroup=vimSynRegPat,vimSyncNone
+syn match vimSyncGroup contained "\k\+" skipwhite nextgroup=vimSynRegPat,vimSyncNone
syn keyword vimSyncNone contained NONE
" Additional IsCommand, here by reasons of precedence {{{2
@@ -510,18 +510,17 @@ endif
syn match vimHiTerm contained "\cterm="he=e-1 nextgroup=vimHiAttribList
syn match vimHiStartStop contained "\c\(start\|stop\)="he=e-1 nextgroup=vimHiTermcap,vimOption
syn match vimHiCTerm contained "\ccterm="he=e-1 nextgroup=vimHiAttribList
-syn match vimHiCtermFgBg contained "\ccterm[fb]g="he=e-1 nextgroup=vimHiNmbr,vimHiCtermColor,vimFgBgAttrib,vimHiCtermError
+syn match vimHiCtermFgBg contained "\ccterm[fb]g="he=e-1 nextgroup=vimNumber,vimHiCtermColor,vimFgBgAttrib,vimHiCtermError
syn match vimHiGui contained "\cgui="he=e-1 nextgroup=vimHiAttribList
syn match vimHiGuiFont contained "\cfont="he=e-1 nextgroup=vimHiFontname
syn match vimHiGuiFgBg contained "\cgui\%([fb]g\|sp\)="he=e-1 nextgroup=vimHiGroup,vimHiGuiFontname,vimHiGuiRgb,vimFgBgAttrib
syn match vimHiTermcap contained "\S\+" contains=vimNotation
-syn match vimHiNmbr contained '\d\+'
" Highlight: clear {{{2
syn keyword vimHiClear contained clear nextgroup=vimHiGroup
" Highlight: link {{{2
-syn region vimHiLink contained oneline matchgroup=vimCommand start="\(\<hi\%[ghlight]\s\+\)\@<=\(\(def\%[ault]\s\+\)\=link\>\|\<def\>\)" end="$" contains=vimHiGroup,vimGroup,vimHLGroup,vimNotation
+syn region vimHiLink contained oneline matchgroup=vimCommand start="\<\(def\%[ault]\s\+\)\=link\>\|\<def\>" end="$" contains=vimHiGroup,vimGroup,vimHLGroup,vimNotation
syn cluster vimFuncBodyList add=vimHiLink
" Control Characters {{{2
@@ -540,8 +539,8 @@ syn match vimCommentTitleLeader '"\s\+'ms=s+1 contained
" ====================
syn match vimSearch '^\s*[/?].*' contains=vimSearchDelim
syn match vimSearchDelim '^\s*\zs[/?]\|[/?]$' contained
-syn region vimGlobal matchgroup=Statement start='\<g\%[lobal]!\=/' skip='\\.' end='/' skipwhite nextgroup=vimSubst
-syn region vimGlobal matchgroup=Statement start='\<v\%[global]!\=/' skip='\\.' end='/' skipwhite nextgroup=vimSubst
+syn region vimGlobal matchgroup=Statement start='\<g\%[lobal]!\=/' skip='\\.' end='/'
+syn region vimGlobal matchgroup=Statement start='\<v\%[global]!\=/' skip='\\.' end='/'
" Scripts : perl,ruby : Benoit Cerrina {{{2
" ======= python,tcl: Johannes Zellner
@@ -563,12 +562,7 @@ endif
" [-- lua --] {{{3
let s:luapath= fnameescape(expand("<sfile>:p:h")."/lua.vim")
if !filereadable(s:luapath)
- for s:luapath in split(globpath(&rtp,"syntax/lua.vim"),"\n")
- if filereadable(fnameescape(s:luapath))
- let s:luapath= fnameescape(s:luapath)
- break
- endif
- endfor
+ let s:luapath= fnameescape(globpath(&rtp,"syntax/lua.vim"))
endif
if (g:vimsyn_embed =~ 'l' && has("lua")) && filereadable(s:luapath)
unlet! b:current_syntax
@@ -590,12 +584,7 @@ unlet s:luapath
" [-- perl --] {{{3
let s:perlpath= fnameescape(expand("<sfile>:p:h")."/perl.vim")
if !filereadable(s:perlpath)
- for s:perlpath in split(globpath(&rtp,"syntax/perl.vim"),"\n")
- if filereadable(fnameescape(s:perlpath))
- let s:perlpath= fnameescape(s:perlpath)
- break
- endif
- endfor
+ let s:perlpath= fnameescape(globpath(&rtp,"syntax/perl.vim"))
endif
if (g:vimsyn_embed =~ 'p' && has("perl")) && filereadable(s:perlpath)
unlet! b:current_syntax
@@ -617,12 +606,7 @@ unlet s:perlpath
" [-- ruby --] {{{3
let s:rubypath= fnameescape(expand("<sfile>:p:h")."/ruby.vim")
if !filereadable(s:rubypath)
- for s:rubypath in split(globpath(&rtp,"syntax/ruby.vim"),"\n")
- if filereadable(fnameescape(s:rubypath))
- let s:rubypath= fnameescape(s:rubypath)
- break
- endif
- endfor
+ let s:rubypath= fnameescape(globpath(&rtp,"syntax/ruby.vim"))
endif
if (g:vimsyn_embed =~ 'r' && has("ruby")) && filereadable(s:rubypath)
unlet! b:current_syntax
@@ -643,27 +627,28 @@ unlet s:rubypath
" [-- python --] {{{3
let s:pythonpath= fnameescape(expand("<sfile>:p:h")."/python.vim")
if !filereadable(s:pythonpath)
- for s:pythonpath in split(globpath(&rtp,"syntax/python.vim"),"\n")
- if filereadable(fnameescape(s:pythonpath))
- let s:pythonpath= fnameescape(s:pythonpath)
- break
- endif
- endfor
+ let s:pythonpath= fnameescape(globpath(&rtp,"syntax/python.vim"))
endif
-if g:vimsyn_embed =~ 'P' && (has("python") || has("python3")) && filereadable(s:pythonpath)
+if (g:vimsyn_embed =~ 'P' && has("python")) && filereadable(s:pythonpath)
unlet! b:current_syntax
exe "syn include @vimPythonScript ".s:pythonpath
if exists("g:vimsyn_folding") && g:vimsyn_folding =~ 'P'
syn region vimPythonRegion fold matchgroup=vimScriptDelim start=+py\%[thon]3\=\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimPythonScript
syn region vimPythonRegion fold matchgroup=vimScriptDelim start=+py\%[thon]3\=\s*<<\s*$+ end=+\.$+ contains=@vimPythonScript
+ syn region vimPythonRegion fold matchgroup=vimScriptDelim start=+Py\%[thon]2or3\=\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimPythonScript
+ syn region vimPythonRegion fold matchgroup=vimScriptDelim start=+Py\%[thon]2or3\=\s*<<\s*$+ end=+\.$+ contains=@vimPythonScript
else
syn region vimPythonRegion matchgroup=vimScriptDelim start=+py\%[thon]3\=\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimPythonScript
syn region vimPythonRegion matchgroup=vimScriptDelim start=+py\%[thon]3\=\s*<<\s*$+ end=+\.$+ contains=@vimPythonScript
+ syn region vimPythonRegion matchgroup=vimScriptDelim start=+Py\%[thon]2or3\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimPythonScript
+ syn region vimPythonRegion matchgroup=vimScriptDelim start=+Py\%[thon]2or3\=\s*<<\s*$+ end=+\.$+ contains=@vimPythonScript
endif
syn cluster vimFuncBodyList add=vimPythonRegion
else
syn region vimEmbedError start=+py\%[thon]3\=\s*<<\s*\z(.*\)$+ end=+^\z1$+
syn region vimEmbedError start=+py\%[thon]3\=\s*<<\s*$+ end=+\.$+
+ syn region vimEmbedError start=+Py\%[thon]2or3\=\s*<<\s*\z(.*\)$+ end=+^\z1$+
+ syn region vimEmbedError start=+Py\%[thon]2or3\=\s*<<\s*$+ end=+\.$+
endif
unlet s:pythonpath
@@ -677,12 +662,7 @@ endif
if s:trytcl
let s:tclpath= fnameescape(expand("<sfile>:p:h")."/tcl.vim")
if !filereadable(s:tclpath)
- for s:tclpath in split(globpath(&rtp,"syntax/tcl.vim"),"\n")
- if filereadable(fnameescape(s:tclpath))
- let s:tclpath= fnameescape(s:tclpath)
- break
- endif
- endfor
+ let s:tclpath= fnameescape(globpath(&rtp,"syntax/tcl.vim"))
endif
if (g:vimsyn_embed =~ 't' && has("tcl")) && filereadable(s:tclpath)
unlet! b:current_syntax
@@ -709,12 +689,7 @@ unlet s:trytcl
" [-- mzscheme --] {{{3
let s:mzschemepath= fnameescape(expand("<sfile>:p:h")."/scheme.vim")
if !filereadable(s:mzschemepath)
- for s:mzschemepath in split(globpath(&rtp,"syntax/mzscheme.vim"),"\n")
- if filereadable(fnameescape(s:mzschemepath))
- let s:mzschemepath= fnameescape(s:mzschemepath)
- break
- endif
- endfor
+ let s:mzschemepath= fnameescape(globpath(&rtp,"syntax/scheme.vim"))
endif
if (g:vimsyn_embed =~ 'm' && has("mzscheme")) && filereadable(s:mzschemepath)
unlet! b:current_syntax
@@ -752,6 +727,9 @@ syn sync match vimAugroupSyncA groupthere NONE "\<aug\%[roup]\>\s\+[eE][nN][dD]"
" Highlighting Settings {{{2
" ====================
+hi def link vimAuHighlight vimHighlight
+hi def link vimSubst1 vimSubst
+hi def link vimBehaveModel vimBehave
if !exists("g:vimsyn_noerror")
hi def link vimBehaveError vimError
@@ -774,43 +752,22 @@ endif
hi def link vimAbb vimCommand
hi def link vimAddress vimMark
hi def link vimAugroupKey vimCommand
-hi def link vimAuHighlight vimHighlight
hi def link vimAutoCmdOpt vimOption
hi def link vimAutoCmd vimCommand
-hi def link vimAutoEvent Type
hi def link vimAutoSet vimCommand
-hi def link vimBehaveModel vimBehave
hi def link vimBehave vimCommand
-hi def link vimBracket Delimiter
-hi def link vimCmplxRepeat SpecialChar
-hi def link vimCommand Statement
-hi def link vimComment Comment
hi def link vimCommentString vimString
-hi def link vimCommentTitle PreProc
hi def link vimCondHL vimCommand
-hi def link vimContinue Special
-hi def link vimCtrlChar SpecialChar
hi def link vimEchoHLNone vimGroup
hi def link vimEchoHL vimCommand
-hi def link vimElseIfErr Error
hi def link vimElseif vimCondHL
-hi def link vimEnvvar PreProc
-hi def link vimError Error
-hi def link vimFBVar vimVar
hi def link vimFgBgAttrib vimHiAttrib
-hi def link vimFold Folded
hi def link vimFTCmd vimCommand
hi def link vimFTOption vimSynType
hi def link vimFuncKey vimCommand
-hi def link vimFuncName Function
-hi def link vimFuncSID Special
-hi def link vimFuncVar Identifier
hi def link vimGroupAdd vimSynOption
hi def link vimGroupName vimGroup
hi def link vimGroupRem vimSynOption
-hi def link vimGroupSpecial Special
-hi def link vimGroup Type
-hi def link vimHiAttrib PreProc
hi def link vimHiClear vimHighlight
hi def link vimHiCtermFgBg vimHiTerm
hi def link vimHiCTerm vimHiTerm
@@ -820,94 +777,111 @@ hi def link vimHiGuiFgBg vimHiTerm
hi def link vimHiGuiFont vimHiTerm
hi def link vimHiGuiRgb vimNumber
hi def link vimHiGui vimHiTerm
-hi def link vimHiNmbr Number
hi def link vimHiStartStop vimHiTerm
-hi def link vimHiTerm Type
hi def link vimHLGroup vimGroup
-hi def link vimHLMod PreProc
hi def link vimInsert vimString
hi def link vimKeyCode vimSpecFile
-hi def link vimKeyword Statement
hi def link vimLet vimCommand
hi def link vimLineComment vimComment
hi def link vimMapBang vimCommand
hi def link vimMapModKey vimFuncSID
hi def link vimMapMod vimBracket
hi def link vimMap vimCommand
-hi def link vimMark Number
hi def link vimMarkNumber vimNumber
hi def link vimMenuMod vimMapMod
hi def link vimMenuNameMore vimMenuName
-hi def link vimMenuName PreProc
hi def link vimMtchComment vimComment
hi def link vimNorm vimCommand
-hi def link vimNotation Special
hi def link vimNotFunc vimCommand
hi def link vimNotPatSep vimString
-hi def link vimNumber Number
-hi def link vimOperError Error
-hi def link vimOper Operator
-hi def link vimOption PreProc
-hi def link vimParenSep Delimiter
hi def link vimPatSepErr vimPatSep
hi def link vimPatSepR vimPatSep
-hi def link vimPatSep SpecialChar
hi def link vimPatSepZone vimString
hi def link vimPatSepZ vimPatSep
-hi def link vimPattern Type
hi def link vimPlainMark vimMark
hi def link vimPlainRegister vimRegister
-hi def link vimRegister SpecialChar
-hi def link vimScriptDelim Comment
-hi def link vimSearchDelim Statement
hi def link vimSearch vimString
-hi def link vimSep Delimiter
hi def link vimSetMod vimOption
-hi def link vimSetSep Statement
hi def link vimSetString vimString
-hi def link vimSpecFile Identifier
hi def link vimSpecFileMod vimSpecFile
-hi def link vimSpecial Type
-hi def link vimStatement Statement
hi def link vimStringCont vimString
-hi def link vimString String
-hi def link vimSubst1 vimSubst
-hi def link vimSubstDelim Delimiter
-hi def link vimSubstFlags Special
-hi def link vimSubstSubstr SpecialChar
hi def link vimSubstTwoBS vimString
hi def link vimSubst vimCommand
-hi def link vimSynCaseError Error
-hi def link vimSynCase Type
-hi def link vimSyncC Type
-hi def link vimSyncError Error
hi def link vimSyncGroupName vimGroupName
hi def link vimSyncGroup vimGroupName
-hi def link vimSyncKey Type
-hi def link vimSyncNone Type
hi def link vimSynContains vimSynOption
-hi def link vimSynError Error
hi def link vimSynKeyContainedin vimSynContains
hi def link vimSynKeyOpt vimSynOption
hi def link vimSynMtchGrp vimSynOption
hi def link vimSynMtchOpt vimSynOption
hi def link vimSynNextgroup vimSynOption
hi def link vimSynNotPatRange vimSynRegPat
-hi def link vimSynOption Special
hi def link vimSynPatRange vimString
hi def link vimSynRegOpt vimSynOption
hi def link vimSynRegPat vimString
-hi def link vimSynReg Type
hi def link vimSyntax vimCommand
hi def link vimSynType vimSpecial
-hi def link vimTodo Todo
hi def link vimUnmap vimMap
-hi def link vimUserAttrbCmpltFunc Special
hi def link vimUserAttrbCmplt vimSpecial
hi def link vimUserAttrbKey vimOption
hi def link vimUserAttrb vimSpecial
-hi def link vimUserCmdError Error
hi def link vimUserCommand vimCommand
+
+hi def link vimAutoEvent Type
+hi def link vimBracket Delimiter
+hi def link vimCmplxRepeat SpecialChar
+hi def link vimCommand Statement
+hi def link vimComment Comment
+hi def link vimCommentTitle PreProc
+hi def link vimContinue Special
+hi def link vimCtrlChar SpecialChar
+hi def link vimElseIfErr Error
+hi def link vimEnvvar PreProc
+hi def link vimError Error
+hi def link vimFold Folded
+hi def link vimFuncName Function
+hi def link vimFuncSID Special
+hi def link vimFuncVar Identifier
+hi def link vimGroupSpecial Special
+hi def link vimGroup Type
+hi def link vimHiAttrib PreProc
+hi def link vimHiTerm Type
+hi def link vimHLMod PreProc
+hi def link vimKeyword Statement
+hi def link vimMark Number
+hi def link vimMenuName PreProc
+hi def link vimNotation Special
+hi def link vimNumber Number
+hi def link vimOperError Error
+hi def link vimOper Operator
+hi def link vimOption PreProc
+hi def link vimParenSep Delimiter
+hi def link vimPatSep SpecialChar
+hi def link vimPattern Type
+hi def link vimRegister SpecialChar
+hi def link vimScriptDelim Comment
+hi def link vimSearchDelim Statement
+hi def link vimSep Delimiter
+hi def link vimSetSep Statement
+hi def link vimSpecFile Identifier
+hi def link vimSpecial Type
+hi def link vimStatement Statement
+hi def link vimString String
+hi def link vimSubstDelim Delimiter
+hi def link vimSubstFlags Special
+hi def link vimSubstSubstr SpecialChar
+hi def link vimSynCaseError Error
+hi def link vimSynCase Type
+hi def link vimSyncC Type
+hi def link vimSyncError Error
+hi def link vimSyncKey Type
+hi def link vimSyncNone Type
+hi def link vimSynError Error
+hi def link vimSynOption Special
+hi def link vimSynReg Type
+hi def link vimTodo Todo
+hi def link vimUserAttrbCmpltFunc Special
+hi def link vimUserCmdError Error
hi def link vimUserFunc Normal
hi def link vimVar Identifier
hi def link vimWarn WarningMsg
diff --git a/runtime/syntax/vroom.vim b/runtime/syntax/vroom.vim
new file mode 100644
index 000000000..0cd6ccce1
--- /dev/null
+++ b/runtime/syntax/vroom.vim
@@ -0,0 +1,113 @@
+" Vim syntax file
+" Language: Vroom (vim testing and executable documentation)
+" Maintainer: David Barnett (https://github.com/google/vim-ft-vroom)
+" Last Change: 2014 Jul 23
+
+" For version 5.x: Clear all syntax items.
+" For version 6.x and later: Quit when a syntax file was already loaded.
+if v:version < 600
+ syntax clear
+elseif exists('b:current_syntax')
+ finish
+endif
+
+let s:cpo_save = &cpo
+set cpo-=C
+
+
+syn include @vroomVim syntax/vim.vim
+syn include @vroomShell syntax/sh.vim
+
+syntax region vroomAction
+ \ matchgroup=vroomOutput
+ \ start='\m^ ' end='\m$' keepend
+ \ contains=vroomControlBlock
+
+syntax region vroomAction
+ \ matchgroup=vroomOutput
+ \ start='\m^ & ' end='\m$' keepend
+ \ contains=vroomControlBlock
+
+syntax match vroomOutput '\m^ &$'
+
+syntax region vroomMessageBody
+ \ matchgroup=vroomMessage
+ \ start='\m^ \~ ' end='\m$' keepend
+ \ contains=vroomControlBlock
+
+syntax region vroomColoredAction
+ \ matchgroup=vroomInput
+ \ start='\m^ > ' end='\m$' keepend
+ \ contains=vimNotation,vroomControlBlock
+syntax region vroomAction
+ \ matchgroup=vroomInput
+ \ start='\m^ % ' end='\m$' keepend
+ \ contains=vimNotation,vroomControlBlock
+
+syntax region vroomAction
+ \ matchgroup=vroomContinuation
+ \ start='\m^ |' end='\m$' keepend
+
+syntax region vroomAction
+ \ start='\m^ \ze:' end='\m$' keepend
+ \ contains=@vroomVim,vroomControlBlock
+
+syntax region vroomAction
+ \ matchgroup=vroomDirective
+ \ start='\m^ @\i\+' end='\m$' keepend
+ \ contains=vroomControlBlock
+
+syntax region vroomSystemAction
+ \ matchgroup=vroomSystem
+ \ start='\m^ ! ' end='\m$' keepend
+ \ contains=@vroomShell,vroomControlBlock
+
+syntax region vroomHijackAction
+ \ matchgroup=vroomHijack
+ \ start='\m^ \$ ' end='\m$' keepend
+ \ contains=vroomControlBlock
+
+syntax match vroomControlBlock contains=vroomControlEscape,@vroomControls
+ \ '\v \([^&()][^()]*\)$'
+
+syntax match vroomControlEscape '\m&' contained
+
+syntax cluster vroomControls
+ \ contains=vroomDelay,vroomMode,vroomBuffer,vroomRange
+ \,vroomChannel,vroomBind,vroomStrictness
+syntax match vroomRange '\v\.(,\+?(\d+|\$)?)?' contained
+syntax match vroomRange '\v\d*,\+?(\d+|\$)?' contained
+syntax match vroomBuffer '\v\d+,@!' contained
+syntax match vroomDelay '\v\d+(\.\d+)?s' contained
+syntax match vroomMode '\v<%(regex|glob|verbatim)' contained
+syntax match vroomChannel '\v<%(stderr|stdout|command|status)>' contained
+syntax match vroomBind '\v<bind>' contained
+syntax match vroomStrictness '\v\<%(STRICT|RELAXED|GUESS-ERRORS)\>' contained
+
+highlight default link vroomInput Identifier
+highlight default link vroomDirective vroomInput
+highlight default link vroomControlBlock vroomInput
+highlight default link vroomSystem vroomInput
+highlight default link vroomOutput Statement
+highlight default link vroomContinuation Constant
+highlight default link vroomHijack Special
+highlight default link vroomColoredAction Statement
+highlight default link vroomSystemAction vroomSystem
+highlight default link vroomHijackAction vroomHijack
+highlight default link vroomMessage vroomOutput
+highlight default link vroomMessageBody Constant
+
+highlight default link vroomControlEscape Special
+highlight default link vroomBuffer vroomInput
+highlight default link vroomRange Include
+highlight default link vroomMode Constant
+highlight default link vroomDelay Type
+highlight default link vroomStrictness vroomMode
+highlight default link vroomChannel vroomMode
+highlight default link vroomBind vroomMode
+
+let b:current_syntax = 'vroom'
+
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/syntax/xmath.vim b/runtime/syntax/xmath.vim
index 83efb08db..5434f928c 100644
--- a/runtime/syntax/xmath.vim
+++ b/runtime/syntax/xmath.vim
@@ -1,9 +1,9 @@
" Vim syntax file
" Language: xmath (a simulation tool)
-" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
+" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
" Last Change: Sep 11, 2006
-" Version: 6
-" URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
+" Version: 7
+" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_XMATH
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
diff --git a/runtime/syntax/xxd.vim b/runtime/syntax/xxd.vim
index 50594e1fc..b2b1e4460 100644
--- a/runtime/syntax/xxd.vim
+++ b/runtime/syntax/xxd.vim
@@ -1,10 +1,10 @@
" Vim syntax file
" Language: bin using xxd
-" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
-" Last Change: Sep 06, 2005
-" Version: 7
+" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
+" Last Change: Oct 23, 2014
+" Version: 8
" Notes: use :help xxd to see how to invoke it
-" URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
+" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_XXD
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
diff --git a/runtime/syntax/yacc.vim b/runtime/syntax/yacc.vim
index 17a1cab6b..cc1c84774 100644
--- a/runtime/syntax/yacc.vim
+++ b/runtime/syntax/yacc.vim
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: Yacc
" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
-" Last Change: Mar 20, 2014
+" Last Change: Nov 14, 2012
" Version: 11
" URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
"
@@ -42,7 +42,7 @@ exe "syn include @yaccCode ".s:Cpath
" ---------------------------------------------------------------------
" Yacc Clusters: {{{1
syn cluster yaccInitCluster contains=yaccKey,yaccKeyActn,yaccBrkt,yaccType,yaccString,yaccUnionStart,yaccHeader2,yaccComment,yaccDefines,yaccParseParam,yaccParseOption
-syn cluster yaccRulesCluster contains=yaccNonterminal,yaccString,yaccComment
+syn cluster yaccRulesCluster contains=yaccNonterminal,yaccString
" ---------------------------------------------------------------------
" Yacc Sections: {{{1
diff --git a/runtime/syntax/zimbu.vim b/runtime/syntax/zimbu.vim
index c859a2f81..1a7a485e6 100644
--- a/runtime/syntax/zimbu.vim
+++ b/runtime/syntax/zimbu.vim
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: Zimbu
" Maintainer: Bram Moolenaar
-" Last Change: 2012 Jun 01
+" Last Change: 2014 Nov 23
if exists("b:current_syntax")
finish
@@ -12,7 +12,10 @@ syn include @Ccode syntax/c.vim
syn keyword zimbuTodo TODO FIXME XXX contained
syn match zimbuNoBar "|" contained
syn match zimbuParam "|[^| ]\+|" contained contains=zimbuNoBar
-syn match zimbuComment "#.*$" contains=zimbuTodo,zimbuParam,@Spell
+syn match zimbuNoBacktick "`" contained
+syn match zimbuCode "`[^`]\+`" contained contains=zimbuNoBacktick
+syn match zimbuComment "#.*$" contains=zimbuTodo,zimbuParam,zimbuCode,@Spell
+syn match zimbuComment "/\*.\{-}\*/" contains=zimbuTodo,zimbuParam,zimbuCode,@Spell
syn match zimbuChar "'\\\=.'"
@@ -28,27 +31,32 @@ syn keyword zimbuBasicType fixed1 fixed2 fixed3 fixed4 fixed5 fixed6
syn keyword zimbuBasicType fixed7 fixed8 fixed9 fixed10 fixed11 fixed12
syn keyword zimbuBasicType fixed13 fixed14 fixed15
-syn keyword zimbuCompType string stringval cstring varstring
-syn keyword zimbuCompType bytes varbytes
-syn keyword zimbuCompType tuple array list dict multiDict set multiSet
+syn keyword zimbuCompType string varString
+syn keyword zimbuCompType byteString varByteString
+syn keyword zimbuCompType tuple array list dict dictList set callback
+syn keyword zimbuCompType sortedList multiDict multiDictList multiSet
syn keyword zimbuCompType complex complex32 complex64 complex80 complex128
syn keyword zimbuCompType proc func def thread evalThread lock cond pipe
-syn keyword zimbuType VAR ANY USE GET
+syn keyword zimbuType VAR dyn type USE GET
syn match zimbuType "IO.File"
syn match zimbuType "IO.Stat"
-syn keyword zimbuStatement IF ELSE ELSEIF WHILE REPEAT FOR IN TO STEP
+syn keyword zimbuStatement IF ELSE ELSEIF IFNIL WHILE REPEAT FOR IN TO STEP
syn keyword zimbuStatement DO UNTIL SWITCH WITH
syn keyword zimbuStatement TRY CATCH FINALLY
syn keyword zimbuStatement GENERATE_IF GENERATE_ELSE GENERATE_ELSEIF
+syn keyword zimbuStatement GENERATE_ERROR
+syn keyword zimbuStatement BUILD_IF BUILD_ELSE BUILD_ELSEIF
syn keyword zimbuStatement CASE DEFAULT FINAL ABSTRACT VIRTUAL DEFINE REPLACE
syn keyword zimbuStatement IMPLEMENTS EXTENDS PARENT LOCAL
-syn keyword zimbuStatement PART ALIAS CONNECT WRAP
+syn keyword zimbuStatement PART ALIAS TYPE CONNECT WRAP
syn keyword zimbuStatement BREAK CONTINUE PROCEED
-syn keyword zimbuStatement RETURN EXIT THROW
+syn keyword zimbuStatement RETURN EXIT THROW DEFER
syn keyword zimbuStatement IMPORT AS OPTIONS MAIN
-syn keyword zimbuStatement INTERFACE MODULE ENUM BITS SHARED
+syn keyword zimbuStatement INTERFACE PIECE INCLUDE MODULE ENUM BITS
+syn keyword zimbuStatement SHARED STATIC
+syn keyword zimbuStatement LAMBDA
syn match zimbuStatement "\<\(FUNC\|PROC\|DEF\)\>"
syn match zimbuStatement "\<CLASS\>"
syn match zimbuStatement "}"
@@ -61,10 +69,13 @@ syn match zimbuAttribute "@default\>"
syn match zimbuAttribute "@define\>"
syn match zimbuAttribute "@replace\>"
syn match zimbuAttribute "@final\>"
+syn match zimbuAttribute "@primitive\>"
+syn match zimbuAttribute "@notOnExit\>"
syn match zimbuAttribute "@private\>"
syn match zimbuAttribute "@protected\>"
syn match zimbuAttribute "@public\>"
+syn match zimbuAttribute "@local\>"
syn match zimbuAttribute "@file\>"
syn match zimbuAttribute "@directory\>"
syn match zimbuAttribute "@read=private\>"
@@ -78,15 +89,22 @@ syn match zimbuAttribute "@items=public\>"
syn match zimbuAttribute "@items=file\>"
syn match zimbuAttribute "@items=directory\>"
-syn keyword zimbuMethod NEW EQUAL COPY COMPARE SIZE GET SET
+syn keyword zimbuMethod NEW EQUAL COPY COMPARE SIZE GET SET INIT EARLYINIT
syn keyword zimbuOperator IS ISNOT ISA ISNOTA
-syn keyword zimbuModule ARG CHECK E IO PROTO SYS HTTP ZC ZWT TIME THREAD
+syn keyword zimbuModule ARG CHECK E GC IO LOG PROTO SYS HTTP ZC ZWT T TIME THREAD
-syn match zimbuString +"\([^"\\]\|\\.\)*\("\|$\)+
+syn match zimbuImport "\.\zsPROTO"
+syn match zimbuImport "\.\zsCHEADER"
+
+"syn match zimbuString +"\([^"\\]\|\\.\)*\("\|$\)+ contains=zimbuStringExpr
+syn region zimbuString start=+"+ skip=+[^"\\]\|\\.+ end=+"\|$+ contains=zimbuStringExpr
syn match zimbuString +R"\([^"]\|""\)*\("\|$\)+
-syn region zimbuString start=+'''+ end=+'''+
+syn region zimbuLongString start=+''"+ end=+"''+
+syn match zimbuStringExpr +\\([^)]*)+hs=s+2,he=e-1 contained contains=zimbuString,zimbuParenPairOuter
+syn region zimbuParenPairOuter start=+(+ms=s+1 end=+)+me=e-1 contained contains=zimbuString,zimbuParenPair
+syn region zimbuParenPair start=+(+ end=+)+ contained contains=zimbuString,zimbuParenPair
syn keyword zimbuFixed TRUE FALSE NIL THIS THISTYPE FAIL OK
syn keyword zimbuError NULL
@@ -97,12 +115,18 @@ syn match zimbuSpaceError display excludenl "\S\s\+$"ms=s+1
syn match zimbuSpaceError display " \+\t"
syn match zimbuSpaceError display "\t\+ "
-syn match zimbuUses contained "uses([a-zA-Z_ ,]*)"
+syn match zimbuUses contained "\<uses([a-zA-Z_ ,]*)"
+syn match zimbuBlockgc contained "blockgc"
syn match zimbuBlockComment contained " #.*"
-syn region zimbuCregion matchgroup=zimbuCblock start="^>>>" end="^<<<.*" contains=@Ccode,zimbuUses,zimbuBlockComment keepend
+syn region zimbuCregion matchgroup=zimbuCblock start="^>>>" end="^<<<.*" contains=@Ccode,zimbuUses,zimbuBlockgc,zimbuBlockComment keepend
+
+" Assume long strings and C regions don't take more than 200 lines.
+syn sync minlines=200
-syn sync minlines=2000
+" When we find the start of a long string, without a # or " before it, we are
+" sure to be inside a long string.
+syn sync match zimbuLongStringSync grouphere zimbuLongString +^[^"#]*''\"+
hi def link zimbuBasicType Type
hi def link zimbuCompType Type
@@ -111,17 +135,23 @@ hi def link zimbuStatement Statement
hi def link zimbuOperator Statement
hi def link zimbuMethod PreProc
hi def link zimbuModule PreProc
+hi def link zimbuImport PreProc
hi def link zimbuUses PreProc
+hi def link zimbuBlockgc PreProc
hi def link zimbuAttribute PreProc
hi def link zimbuString Constant
+hi def link zimbuLongString Special
hi def link zimbuChar Constant
hi def link zimbuFixed Constant
hi def link zimbuComment Comment
+hi def link zimbuCommentStart zimbuComment
hi def link zimbuBlockComment Comment
hi def link zimbuCblock Comment
hi def link zimbuTodo Todo
hi def link zimbuParam Constant
+hi def link zimbuCode Statement
hi def link zimbuNoBar Ignore
+hi def link zimbuNoBacktick Ignore
hi def link zimbuSpaceError Error
hi def link zimbuError Error
diff --git a/runtime/tutor/tutor.es.utf-8 b/runtime/tutor/tutor.es.utf-8
index 84db8fda9..b7561e475 100644
--- a/runtime/tutor/tutor.es.utf-8
+++ b/runtime/tutor/tutor.es.utf-8
@@ -121,7 +121,7 @@ NOTA: A medida que vaya avanzando en este tutor no intente memorizar,
h (izquierda) j (abajo) k (arriba) l (derecha)
2. Para acceder a Vim (desde el símbolo del sistema %) escriba:
- vin FILENAME <INTRO>
+ vim FILENAME <INTRO>
3. Para salir de Vim escriba: <ESC> :q! <INTRO> para eliminar todos
los cambios.
diff --git a/runtime/tutor/tutor.fr b/runtime/tutor/tutor.fr
index ec8523584..e35d4914a 100644
--- a/runtime/tutor/tutor.fr
+++ b/runtime/tutor/tutor.fr
@@ -1029,10 +1029,10 @@ NOTE : Le compltement fonctionne pour de nombreuses commandes. Essayez
des Mines du Colorado et reprend des ides fournies par Charles Smith,
Universit d'tat du Colorado. E-mail : bware@mines.colorado.edu.
- Modifi pour Vim par Bram Moolenar.
+ Modifi pour Vim par Bram Moolenaar.
Traduit en franais par Adrien Beau, en avril 2001.
Dernires mises jour par Dominique Pell.
E-mail : dominique.pelle@gmail.com
- Last Change : 2013 May 10
+ Last Change : 2014 Aug 18
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/runtime/tutor/tutor.fr.utf-8 b/runtime/tutor/tutor.fr.utf-8
index d07d1bafa..ac01cfa53 100644
--- a/runtime/tutor/tutor.fr.utf-8
+++ b/runtime/tutor/tutor.fr.utf-8
@@ -1029,10 +1029,10 @@ NOTE : Le complètement fonctionne pour de nombreuses commandes. Essayez
des Mines du Colorado et reprend des idées fournies par Charles Smith,
Université d'État du Colorado. E-mail : bware@mines.colorado.edu.
- Modifié pour Vim par Bram Moolenar.
+ Modifié pour Vim par Bram Moolenaar.
Traduit en français par Adrien Beau, en avril 2001.
Dernières mises à jour par Dominique Pellé.
E-mail : dominique.pelle@gmail.com
- Last Change : 2013 May 10
+ Last Change : 2014 Aug 18
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/runtime/tutor/tutor.ja.euc b/runtime/tutor/tutor.ja.euc
index 2160e00e1..e19505ee7 100644
--- a/runtime/tutor/tutor.ja.euc
+++ b/runtime/tutor/tutor.ja.euc
@@ -55,8 +55,7 @@ NOTE: 륭ǤưǤޤ hjkl ˰ٴƤޤСϤ뤫
2. Τ褦˥: :q! <ENTER>
ˤԽƤ¸˥ǥλޤ
- 3. ץץȤФƤ顢Υ塼ȥꥢϤ٤ˤ˥ޥ
- 򥿥פޤ
+ 3. Υ塼ȥꥢϤ٤Υޥɤ¹Ԥȡޤ
Υޥɤ: vimtutor <ENTER>
4. ޤǤΥƥåפФĤʤСƥå 1 3 ޤǤ
@@ -904,7 +903,7 @@ NOTE: 1Ĥθޥɤʸʸζ̤᤿ʤСե졼 \c
** CTRL-D <TAB> ǥޥɥ饤䴰 **
- 1. ѥ⡼ɤǤʤȤǧޤ: :set nocp
+ 1. ߴ⡼ɤǤʤȤǧޤ: :set nocp
2. ߤΥǥ쥯ȥ˺ߤե :!ls :!dir dzǧޤ
@@ -949,7 +948,7 @@ NOTE: 䴰¿Υޥɤưޤ CTRL-D <TAB> ƤߤƤ
ˤ Vim Υ塼ȥꥢ򽪤ޤǥñˡ⽼ʬ
ȤȤǤ褦ˤȡVim λijǰΤߤ褦Ȥޤ
Vim ˤϤ¿ΥޥɤꡢƤ뤳ȤϤǤޤ
- ʹߤϥ桼ޥ˥奢򻲾Ȥ: ":help user-manual"
+ ʹߤϥ桼ޥ˥奢򻲾Ȥ: ":help user-manual"
ʸγؽΤˡܤޤ
Vim - Vi Improved - by Steve Oualline
diff --git a/runtime/tutor/tutor.ja.sjis b/runtime/tutor/tutor.ja.sjis
index 2a6de3ad7..132af31bf 100644
--- a/runtime/tutor/tutor.ja.sjis
+++ b/runtime/tutor/tutor.ja.sjis
@@ -55,8 +55,7 @@ NOTE: J[\L[łړł܂B hjkl ɈxĂ܂΁A͂邩
2. ̂悤Ƀ^Cv: :q! <ENTER>
ɂҏWeۑɃGfB^I܂B
- 3. VFvvgoĂÃ`[gAn߂ׂɂɃR}h
- ^Cv܂B
+ 3. ̃`[gAn߂ׂ̃R}hsƁAɖ߂܂B
̃R}h: vimtutor <ENTER>
4. ܂ł̃XebvoM‚Ȃ΁AXebv 1 3 ܂ł
@@ -904,7 +903,7 @@ NOTE: 1‚̌R}h啶̋ʂ߂Ȃ΁At[Y \c
** CTRL-D <TAB> ŃR}hC⊮ **
- 1. Rp`[hłȂƂmF܂: :set nocp
+ 1. ݊[hłȂƂmF܂: :set nocp
2. ݂̃fBNgɍ݂t@C :!ls :!dir ŊmF܂B
@@ -949,7 +948,7 @@ NOTE: ⊮͑̃R}hœ삵܂B CTRL-D <TAB> Ă݂Ă
ɂ Vim ̃`[gAI܂BGfB^ȒPɁA[
gƂł悤ɂƁAVim ̎ŠTO̗v_݂̂`悤Ƃ܂B
Vim ɂ͂ɑ̃R}hAőSĂ邱Ƃ͂ł܂B
- ȍ~̓[U}jAQƂ: ":help user-manual"
+ ȍ~̓[U[}jAQƂ: ":help user-manual"
Ȍ̊wK̂߂ɁA̖{𐄑E܂B
Vim - Vi Improved - by Steve Oualline
diff --git a/runtime/tutor/tutor.ja.utf-8 b/runtime/tutor/tutor.ja.utf-8
index 66a818ad9..99cc7d463 100644
--- a/runtime/tutor/tutor.ja.utf-8
+++ b/runtime/tutor/tutor.ja.utf-8
@@ -55,8 +55,7 @@ NOTE: カーソルキーでも移動できます。しかし hjkl に一度慣
2. 次のようにタイプ: :q! <ENTER>
これにより編集した内容を保存せずにエディタが終了します。
- 3. シェルプロンプトが出てきたら、このチュートリアルを始める為ににコマンド
- をタイプします。
+ 3. このチュートリアルを始める為のコマンドを実行すると、ここに戻れます。
そのコマンドは: vimtutor <ENTER>
4. これまでのステップを覚え自信がついたならば、ステップ 1 から 3 までを実
@@ -904,7 +903,7 @@ NOTE: 1つの検索コマンドだけ大文字小文字の区別をやめたい
** CTRL-D と <TAB> でコマンドラインを補完する **
- 1. コンパチモードでないことを確認します: :set nocp
+ 1. 互換モードでないことを確認します: :set nocp
2. 現在のディレクトリに在るファイルを :!ls か :!dir で確認します。
@@ -949,7 +948,7 @@ NOTE: 補完は多くのコマンドで動作します。そして CTRL-D と <T
これにて Vim のチュートリアルを終わります。エディタを簡単に、しかも充分に
使うことができるようにと、Vim の持つ概念の要点のみを伝えようとしました。
Vim にはさらに多くのコマンドがあり、ここで全てを説明することはできません。
- 以降はユーザマニュアルを参照ください: ":help user-manual"
+ 以降はユーザーマニュアルを参照ください: ":help user-manual"
これ以後の学習のために、次の本を推薦します。
Vim - Vi Improved - by Steve Oualline
diff --git a/runtime/tutor/tutor.pt b/runtime/tutor/tutor.pt
index 57b4462ef..b7c74f570 100644
--- a/runtime/tutor/tutor.pt
+++ b/runtime/tutor/tutor.pt
@@ -572,7 +572,7 @@ Nota: Isso muito til para corrigir um programa com parnteses no-casados!
digite :#,#s/velho/novo/g onde #,# so os nmeros das duas linhas.
Digite :%s/velho/novo/g para mudar todas as ocorrncias no arquivo
inteiro.
- Digite :%/velho/novo/gc para mudar todas as ocorrncia no arquivo
+ Digite :%s/velho/novo/gc para mudar todas as ocorrncia no arquivo
inteiro, com a opo de confirmar cada
substituio.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -971,7 +971,7 @@ NOTA: A completao funciona com muitos comandos. Basta pressionar CTRL-D e
Colorado School of Mines, usando idias fornecidas por Charles Smith,
Colorado State University. E-mail: bware@mines.colorado.edu.
- Modificado para o Vim por Bram Moolenar.
+ Modificado para o Vim por Bram Moolenaar.
Verso 1.4 traduzida para o portugus por Marcelo Drudi Miranda, Escola
Politcnica da Universidade de So Paulo.
diff --git a/runtime/tutor/tutor.pt.utf-8 b/runtime/tutor/tutor.pt.utf-8
index fecbcfa63..1309404b4 100644
--- a/runtime/tutor/tutor.pt.utf-8
+++ b/runtime/tutor/tutor.pt.utf-8
@@ -572,7 +572,7 @@ Nota: Isso é muito útil para corrigir um programa com parênteses não-casados
digite :#,#s/velho/novo/g onde #,# são os números das duas linhas.
Digite :%s/velho/novo/g para mudar todas as ocorrências no arquivo
inteiro.
- Digite :%/velho/novo/gc para mudar todas as ocorrência no arquivo
+ Digite :%s/velho/novo/gc para mudar todas as ocorrência no arquivo
inteiro, com a opção de confirmar cada
substituição.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -971,7 +971,7 @@ NOTA: A completação funciona com muitos comandos. Basta pressionar CTRL-D e
Colorado School of Mines, usando idéias fornecidas por Charles Smith,
Colorado State University. E-mail: bware@mines.colorado.edu.
- Modificado para o Vim por Bram Moolenar.
+ Modificado para o Vim por Bram Moolenaar.
Versão 1.4 traduzida para o português por Marcelo Drudi Miranda, Escola
Politécnica da Universidade de São Paulo.
diff --git a/runtime/tutor/tutor.ru b/runtime/tutor/tutor.ru
index 6fd74cf08..1194f6063 100644
--- a/runtime/tutor/tutor.ru
+++ b/runtime/tutor/tutor.ru
@@ -1,29 +1,32 @@
===============================================================================
-= VIM - 1.5 =
+= VIM -- 1.7 =
===============================================================================
- Vim --- , ,
- , ,
- . ,
- Vim
+
+ Vim -- , ,
+ , , .
+ ,
+ ̣ Vim
.
25-30
- , .
+ , .
- . ,
- ( "vimtutor",
- ).
+ ! .
+ , (
+ "vimtutor", ).
,
- . , ,
- . ,
- !
+ . , ,
+ . ,
+ !
- , CapsLock
- j , , 1.1
+ , CapsLock ,
+ j , , 1.1
.
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 1.1:
+ 1.1:
+
** h,j,k,l , . **
^
@@ -33,802 +36,972 @@
v
1. , .
- 2. `' (j) .
----> , .
+ 2. `' (j) Σ .
+ , .
3. `' 1.2.
-: , , <ESC>
- (Normal mode).
- .
+! , , <ESC>
+ (Normal mode).
+ .
+
+! ()
+ . , hjkl
+ , .
-: ()
- . , hjkl
- , .
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 1.2: VIM
+ 1.2: VIM
+
-!! ! , ,
+ !! ! , ,
!!
- 1. <ESC> ( , ,
+ 1. <ESC> ( , ,
(Normal mode)).
2. : :q! <ENTER>.
+ ( , :q!
+ .)
+ .
---->
- . :
- :wq <ENTER>
+ 3. , ,
+ . :
+ vimtutor <ENTER>
- 3. , ,
- .
- vimtutor ru <ENTER>
- : vim tutor.ru <ENTER>
+ 4. , , 1 3
+ .
----> 'vim' vim, 'tutor.ru' --- ,
- .
+! :q! <ENTER> .
+ .
+
+ 5. 1.3.
- 4. , , 1 3
- .
- 1.3.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 1.3: -
+ 1.3: --
-** x, . **
+** x . **
- 1. , --->.
+ 1. , --->.
2. , ,
.
- 3. x .
+ 3. x .
- 4. 2--4 .
+ 4. 2 4 .
---> .
- 5. , , 1.4.
-
-: ,
- .
+ 5. , , 1.4.
+! ,
+ .
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 1.4: -
+ 1.4: --
- ** (Normal mode), i . **
+ ** , i . **
- 1. , --->.
+ 1. , --->.
2. , ,
.
- 3. i .
+ 3. i .
4. <ESC> .
- 2--4, .
+ 2 4, .
----> .
+---> .
---> .
- 5. , .
+ 5. , 1.5.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 1.5: --
+ ** , A . **
+
+ 1. , --->.
+ .
+
+ 2. A .
+
+ 3. <ESC>
+ .
+
+ 4. , --->
+ 2 4 .
+
+--->
+ .
+--->
+ .
+
+ 5. , 1.6.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 1
+ 1.6:
+
+
+ ** :wq Vim. **
+
+ !! ! , ,
+ !!
+
+ 1. Vim, 1.2: :q!
+ , ,
+ Σ.
+
+ 2. :
+ vim tutor <ENTER>
+ `vim' -- Vim, `tutor' --
+ . , .
+
+ 3. , .
+
+ 4. Vim : :wq <ENTER>
+
+ 5. vimtutor 1, vimtutor
+ .
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 1
+
1. , hjkl.
- h () j () k () l ()
+ h () j () k () l ()
- 2. Vim ( % ) :
- vim _ <ENTER>
+ 2. Vim ( ) :
+ vim _ <ENTER>
3. Vim :
- <ESC> :q! <ENTER> .
+ <ESC> :q! <ENTER> .
:
- <ESC> :wq <ENTER> .
+ <ESC> :wq <ENTER> .
- 4. , : x
+ 4. , : x
5. , :
- i <ESC>
+ i <ESC>
+ :
+ a <ESC>
-: <ESC> (Normal mode)
- .
+! <ESC> (Normal mode)
+ ף ۣ .
- 2.
+ 2.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 2.1:
+ 2.1:
- ** dw . **
+ ** dw . **
1. <ESC>, .
- 2. , , --->.
+ 2. , --->.
3. , .
- 4. dw , .
+ 4. dw .
-: dw .
- - , <ESC> .
+! dw
+ . - ң , <ESC>
+ .
---> .
5. 3 4,
2.2.
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 2.2:
+ 2.2:
- ** d$ . **
+ ** d$ . **
1. <ESC>, .
- 2. , , --->.
+ 2. , --->.
- 3. ( . ).
+ 3. ( ).
- 4. , d$ .
+ 4. d$ .
---> - . .
- 5. , 2.3.
-
-
-
-
+ 5. , , 2.3.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 2.3:
+ 2.3:
+
+ , , .
+ d :
- `' d :
+ d
- [] d d []
:
- - (, =1).
- d - .
- - ( ).
+ d - .
+ - ( ).
:
- w - , .
- e - , .
+ w - , .
+ e - , .
$ - .
^ - .
-: (Normal mode)
- ,
- .
+! (Normal mode)
+ ,
+ .
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 2.4:
+
+
+ ** ģ
+ . **
+
+ 1. ---> .
+
+ 2. 2w ң .
+
+ 3. 3e ң .
+
+ 4. 0 () .
+
+ 5. 2 3 .
+
+---> .
+ 6. 2.5.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 2.4: `-'
+ 2.5:
- ** dd . **
+ ** ģ
+ . **
+
+
+ :
+ d
+
+ 1. --->
+ .
+
+ 2. d2w .
+
+ 3. 1 2
+ .
+
+---> .
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 2.6:
+
- ,
- Vim , d .
+ ** dd . **
+
+ , Vi
+ d.
1. , .
+
2. dd .
- 3. .
- 4. 2dd ( `--'),
- .
- 1) ,
- 2) , !
- 3) ``'', ``'' --- !
- 4) !
- 5) ...
- 6) `'
- 7) .
+ 3. ף .
+
+ 4. 2dd .
+
+---> 1) ,
+---> 2) , !
+---> 3) ``'', ``'' --- !
+---> 4) !
+---> 5) ...
+---> 6) `'
+---> 7) .
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 2.5: `'
+ 2.7: `'
- ** u , U
- . **
+ ** u , U
+ . **
- 1. , , --->
+ 1. , --->,
.
- 2. x .
- 3. u () .
- 4. , x .
- 5. U ,
- .
- 6. u U .
- 7. CTRL-R ( CTRL
- R) ( ).
----> `'.
+ 2. x .
- 8. . 2.
+ 3. u () .
+
+ 4. , x .
+
+ 5. U ,
+ .
+
+ 6. u U .
+ 7. CTRL-R (.. CTRL
+ R) ( ).
+
+---> `'.
+
+ 8. . 2.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 2
+ 2
+
+ 1. : dw
- 1. : dw
+ 2. : d$
- 2. : d$
+ 3. : dd
- 3. : dd
+ 4. : 2w
- 4. :
+ 5. :
[] []
:
- -
+ [] - ,
- , d
- , w (),
$ ( ), ..
- 5. () : u ( u)
- () : U ( U)
+ 6. : 0
+
+ 7. () : u ( u)
+ () : U ( U)
: CTRL-R
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 3.1:
+ 3.1:
- ** p . **
+ ** p ̣ . **
- 1. .
+ 1. , --->.
- 2. dd Vim'.
+ 2. dd ţ Vim'.
3. ,
- .
-
- 4. p .
+ ̣ .
- 5. 2--4, .
+ 4. p .
- ) .
- ) ,
- )
- )
+ 5. 2 4, .
+---> ) .
+---> ) ,
+---> )
+---> )
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 3.2:
+ 3.2:
- ** r , . **
+ ** r , . **
- 1. , , --->.
+ 1. , --->.
2. , .
- 3. r , .
+ 3. r , .
- 4. 2 3, .
+ 4. 2 3, .
---> 0 !
---> - !
- 5. 3.2.
-
-: , ,
- .
+ 5. 3.3.
+! , ,
+ .
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 3.3:
+ 3.3:
- ** cw . **
+ ** ce . **
- 1. , , --->.
+ 1. , --->.
2. `o' `'.
- 3. cw ( , `'.)
+ 3. ce ( , `').
4. <ESC> ( ,
- .)
+ ).
- 5. 3--4 .
+ 5. 3 4 .
---> .
---> .
- , cw ,
-.
-
+ , ce ,
+ .
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 3.4: c
+ 3.4: c
-** , . **
+ ** , . **
1. , .
- :
+ :
- [] c c []
+ [] c c []
2. : w (), $ ( ) ..
- 3. , , --->.
+ 3. , --->.
4. .
- 5. c$ ,
+ 5. c$ ,
, <ESC>.
---> , .
----> c$ .
+---> c$ .
+! Backspace .
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 3
+ 3
- 1. , , p .
- ( ,
+ 1. , ̣, p .
+ ̣ ( ,
).
- 2. r .
+ 2. r .
- 3.
- . , cw
- , c$ .
+ 3.
+ . , ce
+ , c$ .
4. :
- [] c c []
-
- .
-
-
-
+ [] c c []
+ .
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 4.1:
+ 4.1:
- ** CTRL-g
- .
- SHIFT-G . **
+ ** CTRL-g
+ . G (SHIFT-G)
+ . **
- : !!
+! !
- 1. Ctrl g .
- , .
+ 1. Ctrl g .
+ , .
, 3.
- 2. shift-G .
-
- 3. , shift-G.
- , , Ctrl-g.
- ( , .)
+ 2. Shift g .
- 4. , 1--3.
+ 3. , Shift-G.
+ Σ , , Ctrl-g.
+ 4. , 1 3.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 4.2:
+ 4.2:
- ** / . **
+
+ ** / . **
1. (Normal mode) / . ,
,
- : .
+ : .
- 2. '' <ENTER>. ,
+ 2. '' <ENTER>. ,
.
- 3. , , n .
- , Shift-N .
+ 3. , , n .
+ , Shift-N .
+
+ 4. ,
+ ? / .
- 4. ,
- ? / .
+ 5. , , Ctrl-O.
+ ( Ctrl o ).
+ . ң Ctrl-I .
----> ,
- .
+---> "" `'; .
- "" `'; .
+! ,
+ .
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.3:
- ** % ),] } . **
+ ** % ), ] } . **
- 1. (, [ { , --->.
+ 1. (, [ { , --->.
- 2. % .
+ 2. % .
3. .
- 4. % .
+ 4. % .
---> ( , (, [ ] { } . ))
-: !
-
-
-
-
-
+! !
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.4:
- ** :s///g '' ''. **
+ ** :s///g '' ''. **
- 1. , , --->.
+ 1. , --->.
- 2. :s// <ENTER> . ,
- .
+ 2. :s// <ENTER> . ,
+ .
- 3. :s///g ,
- . .
+ 3. :s///g , g
+ .
+ .
---> , ,
.
4.
,
- :#,#s///g #,# --- .
- :%s///g .
-
+ :#,#s///g #,# -- .
+ :%s///g .
+ :%s///gc
+ .
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 4
- 1. Ctrl-g .
- Shift-G . , Shift-G
+ 4
+
+
+ 1. Ctrl-g .
+ Shift-G . , Shift-G
.
+ gg .
- 2. /
- .
- ?
+ 2. /
+ .
+ ?
.
- n
+ n
Shift-N
.
- 3. % , (,),[,],{, }
+ 3. % , (,),[,],{, }
.
4. `' `' ,
- :s/old/new
+ :s/old/new
`' `' ,
- :s/old/new/g
+ :s/old/new/g
,
- :#,#s/old/new/g
+ :#,#s/old/new/g
`' `' ,
- :%s/old/new/g
+ :%s/old/new/g
, 'c'
- :%s/old/new/gc
+ :%s/old/new/gc
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 5.1:
+ 5.1:
- ** :! , . **
+ ** :! , . **
- 1. :
- . .
+ 1. :
+ . .
- 2. ! ( ).
+ 2. ! ( ).
, .
- 3. ls ! <ENTER>.
- , ,
- . :!dir ,
- .
-
----> : .
+ 3. ls ! <ENTER>.
+ , ,
+ . :!dir , ls
+ .
----> : , : ,
- <ENTER>.
+!
+ .
+! , : ,
+ <ENTER>. .
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5.2:
-** , , :w _. **
+ ** , ģ ,
+ :w _. **
- 1. :!dir :!ls .
- , <ENTER> .
+ 1. :!dir :!ls
+ . , <ENTER>.
- 2. , , TEST.
+ 2. , ݣ , TEST.
- 3. :w TEST ( TEST --- , .)
+ 3. :w TEST ( TEST -- , .)
- 4. ( Vim) TEST.
- , :!dir .
+ 4. ( Vim) TEST.
+ , :!dir :!ls
+ .
----> , Vim
- TEST, ,
- .
-
- 5. , :!del TEST
+! Vim TEST
+ (.. vim TEST ),
+ , .
+ 5. , MS-DOS :!del TEST
+ Unix :!rm TEST
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5.3:
- ** , :#,# w _ **
-
- 1. :!dir :!ls
- , TEST.
+ ** , v
+ ţ :w _ **
- 2. Ctrl-g
- to. !
+ 1. .
- 3. Ctrl-g.
- !
+ 2. v . ,
+ .
- 4. :#,# w TEST , #,# ---
- , (, ), TEST --- .
+ 3. : :'<,'> .
- 5. , :!dir ,
- .
+ 4. w TEST ( TEST -- , ݣ ).
+ <ENTER>, :'<,'>w TEST.
+ 5. Vim TEST. ,
+ :!dir :!ls . ,
+ .
+! v .
+ .
+ - , , d.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 5.4:
+ 5.4:
- ** , :r FILENAME **
- 1. :!dir , , TEST
- .
+ ** , :r _ **
- 2. .
+ 1. .
-: 3 5.3.
- , .
+! 2 5.3.
+ .
- 3. TEST, :r TEST ,
- TEST --- .
+ 2. TEST, :r TEST , TEST --
+ .
-: ,
- .
+ 3. ,
+ , Σ 5.3:
+ TEST.
- 4. , ,
- , 5.3,
- .
+! . , :r !ls
+ ls .
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 5
+ 5
1. :! .
:
- :!dir --- .
- :!del FILENAME --- FILENAME.
+ (MS-DOS) (Unix)
+ :!dir :!ls -- .
+ :!del :!rm -- .
- 2. :w FILENAME
- FILENAME.
+ 2. :w _ Vim
+ .
- 3. :#,#w FILENAME # # FILENAME.
+ 3. v :w _
+ .
- 4. :r FILENAME FILENAME
- .
+ 4. :r _
+ .
+ 5. :r !dir dir .
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 6.1:
+ ** o
+ (Insert mode) **
+ 1. , --->.
+ 2. o ( ) ,
+ (Insert mode).
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 6.1:
+ 3. - <ESC>
+ .
+---> o ģ .
- ** o
- (Insert mode) **
+ 4. , O ,
+ o . .
- 1. , , --->.
+---> , ţ Shift-O.
- 2. o ( ) ,
- (Insert mode).
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 6.2:
+
+
+ ** a , . **
+
+ 1. , --->.
- 3. ---> <ESC>
- .
+ 2. e c .
----> o .
+ 3. a ( ) ,
+ . ( A
+ .)
- 4. , O,
- o. .
- , Shift-O, .
+ 4. , . <ESC>
+ (Insert mode).
+ 5. e ۣ
+ 3 4.
+---> .
+---> .
+! a , i A ,
+ , .
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 6.2:
+ 6.3:
- ** a , . **
- 1. , , ---> ,
- $ (Normal mode).
+ ** R . **
- 2. a ( ) ,
- . ( A
- .)
+ 1. , --->,
+ xxx.
-: i , ,
- , <ESC>, -, , , x , ,
- !
+ 2. R
+ xxx.
- 3. . ,
- , , ,
- .
+ 3. <ESC> .
+ Σ.
---->
---->
- .
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 6.3:
+ 4. xxx.
+---> 123 xxx xxx.
+---> 123 456 579.
- ** R , . **
+! , ģ
+ .
- 1. , , --->.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 6.4:
- 2. ,
- , ---> ( '').
- 3. R ,
- , .
+ ** y p **
----> , .
----> , R .
+ 1. , --->, `)'.
- 4. , <ESC> ,
- .
+ 2. v
+ `'.
+ 3. y .
+ 4. j$ .
+ 5. p . `' <ESC>.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 6.4:
+---> ) .
+ )
+! yw ( y w )
+ .
-** , **
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 6.5:
- 1. '', :
- /
- , n
+ ** **
- 2. 'ic' ( ), :
- :set ic
+ 1. `', : / <ENTER>.
+ , n .
- 3. '', : n
- , n
+ 2. `ic' ( ), : :set ic
- 4. 'hlsearch' 'incsearch':
- :set hls is
+ 3. `',
+ : n
+ , `' `'.
- 5. , :
- /
+ 4. `hlsearch' `incsearch': :set hls is
+ 5. , :
+ / <ENTER>
+ 6. ޣ : :set noic
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 6
+! : :nohlsearch
+! ,
+ \ : /\c <ENTER>
- 1. o
- .
- O ,
- .
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 6
- 2. a , .
- A
- .
- 3. R ,
- <ESC> .
+ 1. o .
+ O .
- 4. ":set xxx" "xxx"
+ 2. a .
+ A .
+ 3. e .
+ 4. y , p -- .
+ 5. R <ESC> .
+ 6. `:set xxx' `xxx', :
+ `ic' `ignorecase'
+ `is' `incsearch'
+ `hls' `hlsearch'
+ 7. `no' : :set noic
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 7:
+ 7.1:
+
- ** **
+ ** **
Vim .
- :
+ ң :
- <HELP> ( )
- <F1> ( )
- :help <ENTER>
+
+ .
+ CTRL-W CTRL-W .
:q <ENTER> .
- ,
- ":help". (
- <ENTER>):
+ ,
+ `:help'. ( <ENTER>):
+
+ :help w
+ :help c_CTRL-D
+ :help insert-index
+ :help user-manual
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 7.2:
+
- :help w
- :help c_<T
- :help insert-index
+ ** Vim **
+ Vim , Vi,
+ .
+ `vimrc'.
+ 1. `vimrc'.
+ :
+ :e ~/.vimrc Unix
+ :e $VIM/_vimrc MS-Windows
+ 2. `vimrc':
+ :r $VIMRUNTIME/vimrc_example.vim
+ 3. `vimrc':
+ :w
+
+ Vim .
+ , , `vimrc'.
+ :help vimrc-intro
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 8:
+ 7.3:
- ** Vim **
- Vim , Vi,
- . ,
- "vimrc".
+ ** CTRL-D <TAB> **
- 1. "vimrc",
- :
+ 1. , Vim : :set nocp
- :edit ~/.vimrc Unix
- :edit $VIM/_vimrc MS-Windows
+ 2. : :!ls :!dir
- 2. "vimrc":
+ 3. : :e
- :read $VIMRUNTIME/vimrc_example.vim
+ 4. CTRL-D Vim `e'.
- 3. :
+ 5. <TAB> Vim `:edit'.
- :write
+ 6. : :edit
- Vim .
- , , "vimrc".
+ 7. <TAB> Vim , .
+
+! . CTRL-D
+ <TAB>. :help .
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 7
+
+
+ 1. :help <F1>, <Help> .
+
+ 2. :help cmd .
+
+ 3. CTRL-W CTRL-W .
+
+ 4. :q ( ).
+
+ 5. `vimrc'.
+
+ 6. : , CTRL-D
+ . <TAB> .
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Vim. ,
- Vim, ,
- . , Vim
- . : ":help user-manual".
+
+ Vim.
+ Vim, , ̣ .
+ ̣ , Vim .
+ : `:help user-manual'.
:
- Vim - Vi Improved - : Steve Oualline
- : New Riders
- Vim. .
- .
- See http://iccf-holland.org/click5.html
+ Vim - Vi Improved, : Steve Oualline, : New Riders
+
+ Vim. .
+ .
+ . http://iccf-holland.org/click5.html
Vi, Vim,
:
- Learning the Vi Editor - : Linda Lamb
- : O'Reilly & Associates Inc.
- , ,
- Vi. Vim.
+ Learning the Vi Editor, : Linda Lamb,
+ : O'Reilly & Associates Inc.
+
+ , ӣ, Vi.
+ Vim.
- Michael C. Pierce Robert K. Ware, Colorado School
- of Mines , Charles Smith, Colorado State
+ Michael C. Pierce Robert K. Ware, Colorado School of
+ Mines , Charles Smith, Colorado State
University. E-mail: bware@mines.colorado.edu.
- Vim Bram Moolenaar.
+ Vim (Bram Moolenaar).
+
+ :
+ <a_kissel@eudoramail.com>, 2002.
+ ̣ <alyoshin.s@gmail.com>, 2014.
+
+ Translators:
+ Andrey Kiselev <a_kissel@eudoramail.com>, 2002.
+ Sergey Alyoshin <alyoshin.s@gmail.com>, 2014.
- : <a_kissel@eudoramail.com>, 2002.
- Translator: Andrey Kiselev <a_kissel@eudoramail.com>, 2002.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/runtime/tutor/tutor.ru.cp1251 b/runtime/tutor/tutor.ru.cp1251
index 024ca526b..3cd051f3c 100644
--- a/runtime/tutor/tutor.ru.cp1251
+++ b/runtime/tutor/tutor.ru.cp1251
@@ -1,29 +1,32 @@
===============================================================================
-= VIM - 1.5 =
+= VIM -- 1.7 =
===============================================================================
- Vim --- , ,
- , ,
- . ,
- Vim
+
+ Vim -- , ,
+ , , .
+ ,
+ Vim
.
25-30
- , .
+ , .
- . ,
- ( "vimtutor",
- ).
+ ! .
+ , (
+ "vimtutor", ).
,
- . , ,
- . ,
- !
+ . , ,
+ . ,
+ !
- , CapsLock
- j , , 1.1
+ , CapsLock ,
+ j , , 1.1
.
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 1.1:
+ 1.1:
+
** h,j,k,l , . **
^
@@ -33,802 +36,972 @@
v
1. , .
- 2. `' (j) .
----> , .
+ 2. `' (j) .
+ , .
3. `' 1.2.
-: , , <ESC>
- (Normal mode).
- .
+! , , <ESC>
+ (Normal mode).
+ .
+
+! ()
+ . , hjkl
+ , .
-: ()
- . , hjkl
- , .
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 1.2: VIM
+ 1.2: VIM
+
-!! ! , ,
+ !! ! , ,
!!
- 1. <ESC> ( , ,
+ 1. <ESC> ( , ,
(Normal mode)).
2. : :q! <ENTER>.
+ ( , :q!
+ .)
+ .
---->
- . :
- :wq <ENTER>
+ 3. , ,
+ . :
+ vimtutor <ENTER>
- 3. , ,
- .
- vimtutor ru <ENTER>
- : vim tutor.ru <ENTER>
+ 4. , , 1 3
+ .
----> 'vim' vim, 'tutor.ru' --- ,
- .
+! :q! <ENTER> .
+ .
+
+ 5. 1.3.
- 4. , , 1 3
- .
- 1.3.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 1.3: -
+ 1.3: --
-** x, . **
+** x . **
- 1. , --->.
+ 1. , --->.
2. , ,
.
- 3. x .
+ 3. x .
- 4. 2--4 .
+ 4. 2 4 .
---> .
- 5. , , 1.4.
-
-: ,
- .
+ 5. , , 1.4.
+! ,
+ .
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 1.4: -
+ 1.4: --
- ** (Normal mode), i . **
+ ** , i . **
- 1. , --->.
+ 1. , --->.
2. , ,
.
- 3. i .
+ 3. i .
4. <ESC> .
- 2--4, .
+ 2 4, .
----> .
+---> .
---> .
- 5. , .
+ 5. , 1.5.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 1.5: --
+ ** , A . **
+
+ 1. , --->.
+ .
+
+ 2. A .
+
+ 3. <ESC>
+ .
+
+ 4. , --->
+ 2 4 .
+
+--->
+ .
+--->
+ .
+
+ 5. , 1.6.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 1
+ 1.6:
+
+
+ ** :wq Vim. **
+
+ !! ! , ,
+ !!
+
+ 1. Vim, 1.2: :q!
+ , ,
+ .
+
+ 2. :
+ vim tutor <ENTER>
+ `vim' -- Vim, `tutor' --
+ . , .
+
+ 3. , .
+
+ 4. Vim : :wq <ENTER>
+
+ 5. vimtutor 1, vimtutor
+ .
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 1
+
1. , hjkl.
- h () j () k () l ()
+ h () j () k () l ()
- 2. Vim ( % ) :
- vim _ <ENTER>
+ 2. Vim ( ) :
+ vim _ <ENTER>
3. Vim :
- <ESC> :q! <ENTER> .
+ <ESC> :q! <ENTER> .
:
- <ESC> :wq <ENTER> .
+ <ESC> :wq <ENTER> .
- 4. , : x
+ 4. , : x
5. , :
- i <ESC>
+ i <ESC>
+ :
+ a <ESC>
-: <ESC> (Normal mode)
- .
+! <ESC> (Normal mode)
+ .
- 2.
+ 2.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 2.1:
+ 2.1:
- ** dw . **
+ ** dw . **
1. <ESC>, .
- 2. , , --->.
+ 2. , --->.
3. , .
- 4. dw , .
+ 4. dw .
-: dw .
- - , <ESC> .
+! dw
+ . - , <ESC>
+ .
---> .
5. 3 4,
2.2.
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 2.2:
+ 2.2:
- ** d$ . **
+ ** d$ . **
1. <ESC>, .
- 2. , , --->.
+ 2. , --->.
- 3. ( . ).
+ 3. ( ).
- 4. , d$ .
+ 4. d$ .
---> - . .
- 5. , 2.3.
-
-
-
-
+ 5. , , 2.3.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 2.3:
+ 2.3:
+
+ , , .
+ d :
- `' d :
+ d
- [] d d []
:
- - (, =1).
- d - .
- - ( ).
+ d - .
+ - ( ).
:
- w - , .
- e - , .
+ w - , .
+ e - , .
$ - .
^ - .
-: (Normal mode)
- ,
- .
+! (Normal mode)
+ ,
+ .
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 2.4: ר
+
+
+ **
+ . **
+
+ 1. ---> .
+
+ 2. 2w .
+
+ 3. 3e .
+
+ 4. 0 () .
+
+ 5. 2 3 .
+
+---> .
+ 6. 2.5.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 2.4: `-'
+ 2.5: ר
- ** dd . **
+ **
+ . **
+
+
+ :
+ d
+
+ 1. --->
+ .
+
+ 2. d2w .
+
+ 3. 1 2
+ .
+
+---> .
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 2.6:
+
- ,
- Vim , d .
+ ** dd . **
+
+ , Vi
+ d.
1. , .
+
2. dd .
- 3. .
- 4. 2dd ( `--'),
- .
- 1) ,
- 2) , !
- 3) ``'', ``'' --- !
- 4) !
- 5) ...
- 6) `'
- 7) .
+ 3. .
+
+ 4. 2dd .
+
+---> 1) ,
+---> 2) , !
+---> 3) ``'', ``'' --- !
+---> 4) !
+---> 5) ...
+---> 6) `'
+---> 7) .
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 2.5: `'
+ 2.7: `'
- ** u , U
- . **
+ ** u , U
+ . **
- 1. , , --->
+ 1. , --->,
.
- 2. x .
- 3. u () .
- 4. , x .
- 5. U ,
- .
- 6. u U .
- 7. CTRL-R ( CTRL
- R) ( ).
----> `'.
+ 2. x .
- 8. . 2.
+ 3. u () .
+
+ 4. , x .
+
+ 5. U ,
+ .
+
+ 6. u U .
+ 7. CTRL-R (.. CTRL
+ R) ( ).
+
+---> `'.
+
+ 8. . 2.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 2
+ 2
+
+ 1. : dw
- 1. : dw
+ 2. : d$
- 2. : d$
+ 3. : dd
- 3. : dd
+ 4. : 2w
- 4. :
+ 5. :
[] []
:
- -
+ [] - ,
- , d
- , w (),
$ ( ), ..
- 5. () : u ( u)
- () : U ( U)
+ 6. : 0
+
+ 7. () : u ( u)
+ () : U ( U)
: CTRL-R
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 3.1:
+ 3.1:
- ** p . **
+ ** p . **
- 1. .
+ 1. , --->.
- 2. dd Vim'.
+ 2. dd Vim'.
3. ,
- .
-
- 4. p .
+ .
- 5. 2--4, .
+ 4. p .
- ) .
- ) ,
- )
- )
+ 5. 2 4, .
+---> ) .
+---> ) ,
+---> )
+---> )
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 3.2:
+ 3.2:
- ** r , . **
+ ** r , . **
- 1. , , --->.
+ 1. , --->.
2. , .
- 3. r , .
+ 3. r , .
- 4. 2 3, .
+ 4. 2 3, .
---> 0 !
---> - !
- 5. 3.2.
-
-: , ,
- .
+ 5. 3.3.
+! , ,
+ .
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 3.3:
+ 3.3:
- ** cw . **
+ ** ce . **
- 1. , , --->.
+ 1. , --->.
2. `o' `'.
- 3. cw ( , `'.)
+ 3. ce ( , `').
4. <ESC> ( ,
- .)
+ ).
- 5. 3--4 .
+ 5. 3 4 .
---> .
---> .
- , cw ,
-.
-
+ , ce ,
+ .
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 3.4: c
+ 3.4: c
-** , . **
+ ** , . **
1. , .
- :
+ Ÿ :
- [] c c []
+ [] c c []
2. : w (), $ ( ) ..
- 3. , , --->.
+ 3. , --->.
4. .
- 5. c$ ,
+ 5. c$ ,
, <ESC>.
---> , .
----> c$ .
+---> c$ .
+! Backspace .
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 3
+ 3
- 1. , , p .
- ( ,
+ 1. , , p .
+ ( ,
).
- 2. r .
+ 2. r .
- 3.
- . , cw
- , c$ .
+ 3.
+ . , ce
+ , c$ .
4. :
- [] c c []
-
- .
-
-
-
+ [] c c []
+ .
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 4.1:
+ 4.1:
- ** CTRL-g
- .
- SHIFT-G . **
+ ** CTRL-g
+ . G (SHIFT-G)
+ . **
- : !!
+! !
- 1. Ctrl g .
- , .
+ 1. Ctrl g .
+ , .
, 3.
- 2. shift-G .
-
- 3. , shift-G.
- , , Ctrl-g.
- ( , .)
+ 2. Shift g .
- 4. , 1--3.
+ 3. , Shift-G.
+ , , Ctrl-g.
+ 4. , 1 3.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 4.2:
+ 4.2:
- ** / . **
+
+ ** / . **
1. (Normal mode) / . ,
,
- : .
+ : .
- 2. '' <ENTER>. ,
+ 2. '' <ENTER>. ,
.
- 3. , , n .
- , Shift-N .
+ 3. , , n .
+ , Shift-N .
+
+ 4. ,
+ ? / .
- 4. ,
- ? / .
+ 5. , , Ctrl-O.
+ ( Ctrl o ).
+ . Ctrl-I .
----> ,
- .
+---> "" `'; .
- "" `'; .
+! ,
+ .
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.3:
- ** % ),] } . **
+ ** % ), ] } . **
- 1. (, [ { , --->.
+ 1. (, [ { , --->.
- 2. % .
+ 2. % .
3. .
- 4. % .
+ 4. % .
---> ( , (, [ ] { } . ))
-: !
-
-
-
-
-
+! !
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.4:
- ** :s///g '' ''. **
+ ** :s///g '' ''. **
- 1. , , --->.
+ 1. , --->.
- 2. :s// <ENTER> . ,
- .
+ 2. :s// <ENTER> . ,
+ .
- 3. :s///g ,
- . .
+ 3. :s///g , g
+ .
+ .
---> , ,
.
4.
,
- :#,#s///g #,# --- .
- :%s///g .
-
+ :#,#s///g #,# -- .
+ :%s///g .
+ :%s///gc
+ .
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 4
- 1. Ctrl-g .
- Shift-G . , Shift-G
+ 4
+
+
+ 1. Ctrl-g .
+ Shift-G . , Shift-G
.
+ gg .
- 2. /
- .
- ?
+ 2. /
+ Ш .
+ ?
.
- n
+ n
Shift-N
.
- 3. % , (,),[,],{, }
+ 3. % , (,),[,],{, }
.
4. `' `' ,
- :s/old/new
+ :s/old/new
`' `' ,
- :s/old/new/g
+ :s/old/new/g
,
- :#,#s/old/new/g
+ :#,#s/old/new/g
`' `' ,
- :%s/old/new/g
+ :%s/old/new/g
, 'c'
- :%s/old/new/gc
+ :%s/old/new/gc
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 5.1:
+ 5.1:
- ** :! , . **
+ ** :! , . **
- 1. :
- . .
+ 1. :
+ . .
- 2. ! ( ).
+ 2. ! ( ).
, .
- 3. ls ! <ENTER>.
- , ,
- . :!dir ,
- .
-
----> : .
+ 3. ls ! <ENTER>.
+ , ,
+ . :!dir , ls
+ .
----> : , : ,
- <ENTER>.
+!
+ .
+! , : ,
+ <ENTER>. .
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5.2:
-** , , :w _. **
+ ** , ,
+ :w _. **
- 1. :!dir :!ls .
- , <ENTER> .
+ 1. :!dir :!ls
+ . , <ENTER>.
- 2. , , TEST.
+ 2. , , TEST.
- 3. :w TEST ( TEST --- , .)
+ 3. :w TEST ( TEST -- , .)
- 4. ( Vim) TEST.
- , :!dir .
+ 4. ( Vim) TEST.
+ , :!dir :!ls
+ .
----> , Vim
- TEST, ,
- .
-
- 5. , :!del TEST
+! Vim TEST
+ (.. vim TEST ),
+ , .
+ 5. , MS-DOS :!del TEST
+ Unix :!rm TEST
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5.3:
- ** , :#,# w _ **
-
- 1. :!dir :!ls
- , TEST.
+ ** , v
+ :w _ **
- 2. Ctrl-g
- to. !
+ 1. .
- 3. Ctrl-g.
- !
+ 2. v . ,
+ .
- 4. :#,# w TEST , #,# ---
- , (, ), TEST --- .
+ 3. : :'<,'> .
- 5. , :!dir ,
- .
+ 4. w TEST ( TEST -- , ).
+ <ENTER>, :'<,'>w TEST.
+ 5. Vim TEST. ,
+ :!dir :!ls . ,
+ .
+! v .
+ .
+ - , , d.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 5.4:
+ 5.4:
- ** , :r FILENAME **
- 1. :!dir , , TEST
- .
+ ** , :r _ **
- 2. .
+ 1. .
-: 3 5.3.
- , .
+! 2 5.3.
+ .
- 3. TEST, :r TEST ,
- TEST --- .
+ 2. TEST, :r TEST , TEST --
+ .
-: ,
- .
+ 3. ,
+ , 5.3:
+ TEST.
- 4. , ,
- , 5.3,
- .
+! . , :r !ls
+ ls .
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 5
+ 5
1. :! .
:
- :!dir --- .
- :!del FILENAME --- FILENAME.
+ (MS-DOS) (Unix)
+ :!dir :!ls -- .
+ :!del :!rm -- .
- 2. :w FILENAME
- FILENAME.
+ 2. :w _ Vim
+ .
- 3. :#,#w FILENAME # # FILENAME.
+ 3. v :w _
+ .
- 4. :r FILENAME FILENAME
- .
+ 4. :r _
+ .
+ 5. :r !dir dir .
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 6.1:
+ ** o
+ (Insert mode) **
+ 1. , --->.
+ 2. o ( ) ,
+ (Insert mode).
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 6.1:
+ 3. - <ESC>
+ .
+---> o .
- ** o
- (Insert mode) **
+ 4. , O ,
+ o . .
- 1. , , --->.
+---> , Shift-O.
- 2. o ( ) ,
- (Insert mode).
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 6.2:
+
+
+ ** a , . **
+
+ 1. , --->.
- 3. ---> <ESC>
- .
+ 2. e c .
----> o .
+ 3. a ( ) ,
+ . ( A
+ .)
- 4. , O,
- o. .
- , Shift-O, .
+ 4. , . <ESC>
+ (Insert mode).
+ 5. e
+ 3 4.
+---> .
+---> .
+! a , i A ,
+ , .
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 6.2:
+ 6.3: ٨
- ** a , . **
- 1. , , ---> ,
- $ (Normal mode).
+ ** R . **
- 2. a ( ) ,
- . ( A
- .)
+ 1. , --->,
+ xxx.
-: i , ,
- , <ESC>, -, , , x , ,
- !
+ 2. R
+ xxx.
- 3. . ,
- , , ,
- .
+ 3. <ESC> .
+ .
---->
---->
- .
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 6.3:
+ 4. xxx.
+---> 123 xxx xxx.
+---> 123 456 579.
- ** R , . **
+! ,
+ .
- 1. , , --->.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 6.4:
- 2. ,
- , ---> ( '').
- 3. R ,
- , .
+ ** y p **
----> , .
----> , R .
+ 1. , --->, `)'.
- 4. , <ESC> ,
- .
+ 2. v
+ `'.
+ 3. y .
+ 4. j$ .
+ 5. p . `' <ESC>.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 6.4:
+---> ) .
+ )
+! yw ( y w )
+ .
-** , **
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 6.5:
- 1. '', :
- /
- , n
+ ** **
- 2. 'ic' ( ), :
- :set ic
+ 1. `', : / <ENTER>.
+ , n .
- 3. '', : n
- , n
+ 2. `ic' ( ), : :set ic
- 4. 'hlsearch' 'incsearch':
- :set hls is
+ 3. `',
+ : n
+ , `' `'.
- 5. , :
- /
+ 4. `hlsearch' `incsearch': :set hls is
+ 5. , :
+ / <ENTER>
+ 6. : :set noic
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 6
+! : :nohlsearch
+! ,
+ \ : /\c <ENTER>
- 1. o
- .
- O ,
- .
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 6
- 2. a , .
- A
- .
- 3. R ,
- <ESC> .
+ 1. o .
+ O .
- 4. ":set xxx" "xxx"
+ 2. a .
+ A .
+ 3. e .
+ 4. y , p -- .
+ 5. R <ESC> .
+ 6. `:set xxx' `xxx', :
+ `ic' `ignorecase'
+ `is' `incsearch'
+ `hls' `hlsearch'
+ 7. `no' : :set noic
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 7:
+ 7.1:
+
- ** **
+ ** **
Vim .
- :
+ :
- <HELP> ( )
- <F1> ( )
- :help <ENTER>
+
+ .
+ CTRL-W CTRL-W .
:q <ENTER> .
- ,
- ":help". (
- <ENTER>):
+ ,
+ `:help'. ( <ENTER>):
+
+ :help w
+ :help c_CTRL-D
+ :help insert-index
+ :help user-manual
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 7.2:
+
- :help w
- :help c_<T
- :help insert-index
+ ** Vim **
+ Vim , Vi,
+ .
+ `vimrc'.
+ 1. `vimrc'.
+ :
+ :e ~/.vimrc Unix
+ :e $VIM/_vimrc MS-Windows
+ 2. `vimrc':
+ :r $VIMRUNTIME/vimrc_example.vim
+ 3. `vimrc':
+ :w
+
+ Vim .
+ , , `vimrc'.
+ :help vimrc-intro
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 8:
+ 7.3:
- ** Vim **
- Vim , Vi,
- . ,
- "vimrc".
+ ** CTRL-D <TAB> **
- 1. "vimrc",
- :
+ 1. , Vim : :set nocp
- :edit ~/.vimrc Unix
- :edit $VIM/_vimrc MS-Windows
+ 2. : :!ls :!dir
- 2. "vimrc":
+ 3. : :e
- :read $VIMRUNTIME/vimrc_example.vim
+ 4. CTRL-D Vim `e'.
- 3. :
+ 5. <TAB> Vim `:edit'.
- :write
+ 6. : :edit
- Vim .
- , , "vimrc".
+ 7. <TAB> Vim , .
+
+! . CTRL-D
+ <TAB>. :help .
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 7
+
+
+ 1. :help <F1>, <Help> .
+
+ 2. :help cmd .
+
+ 3. CTRL-W CTRL-W .
+
+ 4. :q ( ).
+
+ 5. `vimrc'.
+
+ 6. : , CTRL-D
+ . <TAB> .
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Vim. ,
- Vim, ,
- . , Vim
- . : ":help user-manual".
+
+ Vim.
+ Vim, , .
+ , Vim .
+ : `:help user-manual'.
:
- Vim - Vi Improved - : Steve Oualline
- : New Riders
- Vim. .
- .
- See http://iccf-holland.org/click5.html
+ Vim - Vi Improved, : Steve Oualline, : New Riders
+
+ Vim. .
+ .
+ . http://iccf-holland.org/click5.html
Vi, Vim,
:
- Learning the Vi Editor - : Linda Lamb
- : O'Reilly & Associates Inc.
- , ,
- Vi. Vim.
+ Learning the Vi Editor, : Linda Lamb,
+ : O'Reilly & Associates Inc.
+
+ , , Vi.
+ Vim.
- Michael C. Pierce Robert K. Ware, Colorado School
- of Mines , Charles Smith, Colorado State
+ Michael C. Pierce Robert K. Ware, Colorado School of
+ Mines , Charles Smith, Colorado State
University. E-mail: bware@mines.colorado.edu.
- Vim Bram Moolenaar.
+ Vim (Bram Moolenaar).
+
+ :
+ <a_kissel@eudoramail.com>, 2002.
+ <alyoshin.s@gmail.com>, 2014.
+
+ Translators:
+ Andrey Kiselev <a_kissel@eudoramail.com>, 2002.
+ Sergey Alyoshin <alyoshin.s@gmail.com>, 2014.
- : <a_kissel@eudoramail.com>, 2002.
- Translator: Andrey Kiselev <a_kissel@eudoramail.com>, 2002.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/runtime/tutor/tutor.ru.utf-8 b/runtime/tutor/tutor.ru.utf-8
index c12de27d8..69a237ea7 100644
--- a/runtime/tutor/tutor.ru.utf-8
+++ b/runtime/tutor/tutor.ru.utf-8
@@ -1,29 +1,32 @@
===============================================================================
-= Д о б р о п о ж а л о в а т ь в у ч е б н и к VIM - Версия 1.5 =
+= Д о б р о п о ж а л о в а т ь в у ч е б н и к VIM -- версия 1.7 =
===============================================================================
- Vim --- это очень мощный редактор, имеющий множество команд, слишком
- много для того, чтобы их все можно было описать в таком учебнике, как
- этот. Этот учебник призван объяснить достаточное число команд для того,
- чтобы Вы могли с легкостью использовать Vim в качестве редактора общего
+
+ Vim -- это очень мощный редактор, имеющий множество команд, слишком много
+ для того, чтобы их все можно было описать в таком учебнике, как этот.
+ Этот учебник призван объяснить достаточное число команд для того, чтобы
+ вы могли с лёгкостью использовать Vim в качестве редактора общего
назначения.
Вам потребуется приблизительно 25-30 минут на освоение данного учебника в
- зависимости от того, сколько времени Вы потратите на эксперименты.
+ зависимости от того, сколько времени вы потратите на эксперименты.
- Команды в уроках будут модифицировать текст. Создайте копию этого файла,
- чтобы попрактиковаться на ней (если Вы запустили "vimtutor", то это уже
- копия).
+ Внимание! Командами в уроках вы будете изменять этот текст. Создайте
+ копию этого файла, чтобы попрактиковаться на ней (если вы запустили
+ "vimtutor", то это уже копия).
Важно помнить, что этот учебник предназначен для обучения в процессе
- использования. Это означает, что Вы должны запускать команды для того,
- чтобы как следует их изучить. Если Вы просто прочитаете текст, то
- забудете команды!
+ использования. Это означает, что вы должны запускать команды для того,
+ чтобы как следует их изучить. Если вы просто прочитаете этот текст, то
+ не запомните команды!
- Теперь убедитесь в том, что клавиша CapsLock не включена и нажмите
- клавишу j несколько раз, так, чтобы Урок 1.1 полностью поместился на
+ Теперь убедитесь в том, что клавиша CapsLock не включена, и нажмите
+ клавишу j несколько раз, так, чтобы Урок 1.1 полностью поместился на
экране.
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Урок 1.1: ПЕРЕМЕЩЕНИЕ КУРСОРА
+ Урок 1.1: ПЕРЕМЕЩЕНИЕ КУРСОРА
+
** Для перемещения курсора нажмите клавиши h,j,k,l так, как показано ниже. **
^
@@ -33,802 +36,972 @@
v
1. Подвигайте курсор по экрану, пока не почувствуете себя уверенно.
- 2. Надавите клавишу `вниз' (j) пока она не начнет повторяться.
----> Теперь Вы знаете, как перейти к следующему уроку.
+ 2. Надавите клавишу `вниз' (j) пока она не начнёт повторяться.
+ Теперь вы знаете, как перейти к следующему уроку.
3. Используя клавишу `вниз' перейдите к Уроку 1.2.
-Замечание: Если вы пока не уверены в том, что набираете, нажмите <ESC> для
- перехода в обычный режим (Normal mode). После этого перенаберите
- требуемую команду.
+Замечание! Если вы пока не уверены в том, что набираете, нажмите <ESC> для
+ перехода в обычный режим (Normal mode). После этого перенаберите
+ требуемую команду.
+
+Замечание! Обычные клавиши управления курсором (стрелки) также должны
+ работать. Однако, клавиши hjkl позволят вам перемещаться
+ значительно быстрее, как только вы научитесь ими пользоваться.
-Замечание: Обычные клавиши управления курсором (стрелки) также должны
- работать. Однако, клавиши hjkl позволят Вам перемещаться
- значительно быстрее, как только Вы научитесь ими пользоваться.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Урок 1.2: ЗАПУСК И ЗАВЕРШЕНИЕ РАБОТЫ С VIM
+ Урок 1.2: ЗАВЕРШЕНИЕ РАБОТЫ С VIM
+
-!! ВНИМАНИЕ! Прежде, чем выполнять любой из описанных ниже шагов, прочтите
+ !! ВНИМАНИЕ! Прежде, чем выполнять любой из описанных ниже шагов, прочтите
урок целиком !!
- 1. Нажмите клавишу <ESC> (для того, чтобы удостовериться, что Вы в обычном
+ 1. Нажмите клавишу <ESC> (для того, чтобы удостовериться, что вы в обычном
режиме (Normal mode)).
2. Наберите: :q! <ENTER>.
+ (Это означает, что вы должны набрать три символа :q! и нажать клавишу
+ ввод.) Это позволит вам выйти из редактора БЕЗ СОХРАНЕНИЯ любых сделанных
+ изменений.
----> Это позволит Вам выйти из редактора БЕЗ СОХРАНЕНИЯ любых сделанных
- изменений. Если Вы хотите сохранить изменения и выйти:
- :wq <ENTER>
+ 3. Когда вы увидите приглашение командной оболочки, наберите команду,
+ которая привела вас в этот учебник. Это может быть:
+ vimtutor <ENTER>
- 3. Когда Вы увидите приглашение командной оболочки, наберите команду,
- которая привела Вас в этот учебник. Это может быть
- vimtutor ru <ENTER>
- Обычно можно использовать: vim tutor.ru <ENTER>
+ 4. Если вы уверены в том, что запомнили эти шаги, выполните шаги от 1 до 3
+ чтобы выйти снова запустить редактор.
----> 'vim' позволяет запустить редактор vim, 'tutor.ru' --- это файл, который
- Вы будете редактировать.
+Замечание! :q! <ENTER> отбрасывает любые сделанные вами изменения. Через
+ несколько уроков вы узнаете как сохранять изменения в файл.
+
+ 5. Переместите курсор вниз к Уроку 1.3.
- 4. Если Вы уверены в том, что запомнили эти шаги, выполните шаги от 1 до 3
- чтобы выйти снова запустить редактор. Затем переместите курсор вниз к
- Уроку 1.3.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Урок 1.3: РЕДАКТИРОВАНИЕ ТЕКСТА - УДАЛЕНИЕ
+ Урок 1.3: РЕДАКТИРОВАНИЕ ТЕКСТА -- УДАЛЕНИЕ
-** Находясь в обычном режиме нажмите x, чтобы удалить символ под курсором. **
+** Находясь в обычном режиме нажмите x для удаления символа под курсором. **
- 1. Переместите курсор к строке внизу, помеченной --->.
+ 1. Переместите курсор к строке ниже, помеченной --->.
2. Для исправления ошибок, переместите курсор, пока он не окажется над
удаляемым символом.
- 3. Нажмите клавишу x для удаления требуемого символа.
+ 3. Нажмите клавишу x для удаления требуемого символа.
- 4. Повторите шаги 2--4 пока строка не будет исправлена.
+ 4. Повторите шаги со 2 по 4 пока строка не будет исправлена.
---> От тттопота копытт пппыль ппо ппполю леттитт.
- 5. Теперь, когда строка откорректирована, переходите к уроку 1.4.
-
-ЗАМЕЧАНИЕ: В ходе освоения этого учебника не пытайтесь запоминать, учите
- в процессе использования.
+ 5. Теперь, когда строка откорректирована, переходите к Уроку 1.4.
+Замечание! В ходе освоения этого учебника не пытайтесь запоминать, учите
+ в процессе использования.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Урок 1.4: РЕДАКТИРОВАНИЕ ТЕКСТА - ВСТАВКА
+ Урок 1.4: РЕДАКТИРОВАНИЕ ТЕКСТА -- ВСТАВКА
- ** Находясь в обычном режиме (Normal mode), нажмите i для вставки текста. **
+ ** Находясь в обычном режиме, нажмите i для вставки текста. **
- 1. Переместите курсор к первой строке внизу, помеченной --->.
+ 1. Переместите курсор к первой строке ниже, помеченной --->.
2. Для того, чтобы сделать первую строку идентичной второй, поместите
курсор на символ ПЕРЕД которым следует вставить текст.
- 3. Нажмите i и наберите требуемые добавления.
+ 3. Нажмите i и наберите требуемые добавления.
4. После исправления всех ошибок нажмите <ESC> для возврата в обычный режим.
- Повторите шаги 2--4, пока фраза не будет исправлена полностью.
+ Повторите шаги со 2 по 4, пока фраза не будет исправлена полностью.
----> Часть текста в строке беследно .
+---> Часть текста в строке бесследно .
---> Часть текста в этой строке бесследно пропала.
- 5. Когда освоите вставку текста, переходите дальше к Резюме.
+ 5. Когда освоите вставку текста, переходите к Уроку 1.5.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 1.5: РЕДАКТИРОВАНИЕ ТЕКСТА -- ДОБАВЛЕНИЕ
+ ** Находясь в обычном режиме, нажмите A для добавления текста. **
+
+ 1. Переместите курсор к первой строке ниже, помеченной --->.
+ Не имеет значения на каком символе расположен курсор на этой строке.
+
+ 2. Нажмите A и наберите требуемые добавления.
+
+ 3. После добавления требуемого текста нажмите <ESC> для возврата в обычный
+ режим.
+
+ 4. Переместите курсор на следующую строку, помеченную ---> и повторите шаги
+ со 2 по 4 для исправления этой строки.
+
+---> Часть текста в этой строке бессле
+ Часть текста в этой строке бесследно пропала.
+---> Здесь также не достаёт час
+ Здесь также не достаёт части текста.
+
+ 5. Когда освоите добавление текста, переходите к Уроку 1.6.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- РЕЗЮМЕ УРОКА 1
+ Урок 1.6: РЕДАКТИРОВАНИЕ ФАЙЛА
+
+
+ ** Используйте :wq для сохранения файла и выхода из Vim. **
+
+ !! ВНИМАНИЕ! Прежде, чем выполнять любой из описанных ниже шагов, прочтите
+ урок целиком !!
+
+ 1. Выйдите из Vim, как вы это узнали в Уроке 1.2: :q!
+ Или, если у вас есть доступ к другому терминалу, можете сделать следующее
+ в нём.
+
+ 2. По приглашению командной оболочки введите следующую команду:
+ vim tutor <ENTER>
+ `vim' -- команда для запуска редактора Vim, а `tutor' -- имя файла для
+ редактирования. Используете имя файла, который можно изменять.
+
+ 3. Вставляйте и удаляйте текст, как вы научились в предыдущих уроках.
+
+ 4. Сохраните файл с изменениями и выйдите из Vim выполнив: :wq <ENTER>
+
+ 5. Если вы вышли из vimtutor на шаге 1, перезапустите vimtutor и переходите
+ к следующему Резюме.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ РЕЗЮМЕ УРОКА 1
+
1. Курсор перемещается либо клавишами со стрелками, либо клавишами hjkl.
- h (влево) j (вниз) k (вверх) l (вправо)
+ h (влево) j (вниз) k (вверх) l (вправо)
- 2. Для запуска Vim (из приглашения % командной оболочки) наберите:
- vim ИМЯ_ФАЙЛА <ENTER>
+ 2. Для запуска Vim (из приглашения командной оболочки) наберите:
+ vim ИМЯ_ФАЙЛА <ENTER>
3. Для завершения работы с Vim наберите:
- <ESC> :q! <ENTER> чтобы отказаться от сохранения изменений.
+ <ESC> :q! <ENTER> чтобы отказаться от сохранения изменений.
Или наберите:
- <ESC> :wq <ENTER> чтобы сохранить изменения.
+ <ESC> :wq <ENTER> чтобы сохранить изменения.
- 4. Для удаления символа под курсором в обычном режиме, наберите: x
+ 4. Для удаления символа под курсором в обычном режиме, нажмите: x
5. Чтобы вставить текст перед курсором в обычном режиме, наберите:
- i вводите текст <ESC>
+ i вводите вставляемый текст <ESC>
+ Чтобы добавить текст после курсора:
+ a вводите добавляемый текст <ESC>
-ЗАМЕЧАНИЕ: Нажатие <ESC> переместит Вас в обычный режим (Normal mode) либо
- прервет нежелательную и частично завершенную команду.
+Замечание! Нажатие <ESC> переместит вас в обычный режим (Normal mode) либо
+ прервёт нежелательную и частично завершённую команду.
-Теперь переходим к Уроку 2.
+Теперь переходите к Уроку 2.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Урок 2.1: КОМАНДЫ УДАЛЕНИЯ
+ Урок 2.1: КОМАНДЫ УДАЛЕНИЯ
- ** Наберите dw для удаления участка текста до конца слова. **
+ ** Наберите dw для удаления участка текста до конца слова. **
1. Нажмите <ESC>, чтобы перейти в обычный режим.
- 2. Переместите курсор вниз, к строке, помеченной --->.
+ 2. Переместите курсор вниз, к строке помеченной --->.
3. Переместите курсор в начало слова, которое следует удалить.
- 4. Наберите dw , чтобы удалить это слово.
+ 4. Наберите dw для удаления этого слова.
-ЗАМЕЧАНИЕ: Во время набора буквы dw появятся в последней строке экрана. Если
- Вы что-то наберете неправильно, нажмите <ESC> и начните сначала.
+Замечание! Во время набора буквы dw появятся справа в самой нижней строке
+ экрана. Если вы что-то наберёте неправильно, нажмите <ESC> и начните
+ сначала.
---> Несколько слов рафинад в этом предложении автокран излишни.
5. Повторите шаги 3 и 4, пока не исправите все ошибки и переходите к
Уроку 2.2.
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Урок 2.2: ДОПОЛНИТЕЛЬНЫЕ КОМАНДЫ УДАЛЕНИЯ
+ Урок 2.2: ДОПОЛНИТЕЛЬНЫЕ КОМАНДЫ УДАЛЕНИЯ
- ** Наберите d$ для удаления текста до конца строки. **
+ ** Наберите d$ для удаления текста до конца строки. **
1. Нажмите <ESC>, чтобы перейти в обычный режим.
- 2. Переместите курсор вниз, к строке, помеченной --->.
+ 2. Переместите курсор вниз, к строке помеченной --->.
- 3. Переместите курсор к концу правильной строки (ПОСЛЕ первой . ).
+ 3. Переместите курсор к концу правильной строки (ПОСЛЕ первой точки).
- 4. Чтобы удалить остаток строки, наберите d$ .
+ 4. Наберите d$ для удаления остатка строки.
---> Кто-то набрал окончание этой строки дважды. окончание этой строки дважды.
- 5.Чтобы лучше разобраться в этом, переходите к Уроку 2.3.
-
-
-
-
+ 5. Чтобы лучше разобраться в том, как это происходит, переходите к Уроку 2.3.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Урок 2.3: КОМАНДЫ И ОБЪЕКТЫ
+ Урок 2.3: КОМАНДЫ И ОБЪЕКТЫ
+
+ Многие команды, изменяющие текст, состоят из оператора и объекта. Формат
+ команды удаления с оператором d следующий:
- Формат команды `удаление' d таков:
+ d объект
- [число] d объект ИЛИ d [число] объект
Здесь:
- число - сколько раз исполнить команду (необязательно, по умолчанию=1).
- d - команда удаления.
- объект - с чем команда должна быть выполнена (перечислено ниже).
+ d - оператор удаления.
+ объект - над чем должна быть выполнена команда (перечислено ниже).
Краткий список объектов:
- w - от курсора до конца слова, включая завершающий пробел.
- e - от курсора до конца слова, НЕ включая завершающий пробел.
+ w - от курсора до конца слова, включая последующий пробел.
+ e - от курсора до конца слова, НЕ включая последующий пробел.
$ - от курсора до конца строки.
^ - от курсора до начала строки.
-ЗАМЕЧАНИЕ: Простое нажатие на символ объекта в обычном режиме (Normal mode)
- без дополнительных команд передвинет курсор так, как указано в
- списке объектов.
+Замечание! Простое нажатие на символ объекта в обычном режиме (Normal mode)
+ без предварительного оператора переместит курсор так, как указано
+ в списке объектов.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 2.4: ИСПОЛЬЗОВАНИЕ СЧЁТЧИКА ДЛЯ ПЕРЕМЕЩЕНИЯ
+
+
+ ** Ввод числа перед оператором перемещения приведёт к его повторению
+ заданное количество раз. **
+
+ 1. Переместите курсор к началу строки отмеченной ---> ниже.
+
+ 2. Наберите 2w для перемещения курсора вперёд к началу второго слова.
+
+ 3. Наберите 3e для перемещения курсора вперёд к концу третьего слова.
+
+ 4. Наберите 0 (нуль) для перемещения к началу строки.
+
+ 5. Повторите шаги 2 и 3 с различными числами.
+
+---> Обычная строка из слов для вашего перемещения по ней.
+ 6. Переходите к Уроку 2.5.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Урок 2.4: ИСКЛЮЧЕНИЕ ИЗ ПРАВИЛА `КОМАНДА-ОБЪЕКТ'
+ Урок 2.5: ИСПОЛЬЗОВАНИЕ СЧЁТЧИКА ДЛЯ УДАЛЕНИЯ
- ** Наберите dd для удаления всей строки. **
+ ** Ввод числа перед оператором приведёт к его повторению
+ заданное количество раз. **
+
+ Добавьте число перед перед объектом в комбинацию оператора удаления и
+ перемещения указанную выше для удаления указанного количества объектов:
+ d число объект
+
+ 1. Переместите курсор к первому слову из прописных букв в отмеченной --->
+ строке ниже.
+
+ 2. Наберите d2w для удаления двух слов из прописных букв.
+
+ 3. Повторите шаги 1 и 2 с другими числами для удаления последовательных слов
+ из прописных букв одной командой.
+
+---> эта АБВ ГД строка ЕЖЗИ КЛ МНО из слов П РС ТУФ очищена.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 2.6: ОПЕРАЦИИ СО СТРОКАМИ
+
- Вследствие частого применения операции удаления всей строки, разработчики
- Vim решили, что для этого проще всего просто набрать d дважды.
+ ** Наберите dd для удаления целой строки. **
+
+ В связи с частой необходимостью удаления целой строки, создатели Vi решили
+ для упрощения сделать возможным удаление строки набором двух d.
1. Переместите курсор вниз, ко второй строке фразы.
+
2. Наберите dd для удаления строки.
- 3. Теперь переместитесь к четвертой строке.
- 4. Наберите 2dd (вспомните правило `число-команда-объект'), чтобы удалить
- две строки.
- 1) Летом я хожу на стадион,
- 2) О, как внезапно кончился диван!
- 3) Я болею за ``Зенит'', ``Зенит'' --- чемпион!
- 4) Печально я гляжу на наше поколение!
- 5) Его грядущее иль пусто иль темно...
- 6) Я сижу на скамейке в ложе `Б'
- 7) И играю на большой жестяной трубе.
+ 3. Теперь переместитесь к четвёртой строке.
+
+ 4. Наберите 2dd для удаления двух строк.
+
+---> 1) Летом я хожу на стадион,
+---> 2) О, как внезапно кончился диван!
+---> 3) Я болею за ``Зенит'', ``Зенит'' --- чемпион!
+---> 4) Печально я гляжу на наше поколение!
+---> 5) Его грядущее иль пусто иль темно...
+---> 6) Я сижу на скамейке в ложе `Б'
+---> 7) И играю на большой жестяной трубе.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Урок 2.5: КОМАНДА `ОТКАТ'
+ Урок 2.7: КОМАНДА `ОТМЕНА'
- ** Нажмите u для отмены результата работы предыдущей команды, U для отмены
- исправлений во всей строке. **
+ ** Нажмите u для отмены результата работы предыдущей команды, U для отмены
+ исправлений во всей строке. **
- 1. Переместите курсор вниз, к строке, помеченной ---> и установите его на
+ 1. Переместите курсор вниз, к строке помеченной --->, и установите его на
первую ошибку.
- 2. Нажмите x для удаления первого неправильного символа.
- 3. Теперь нажмите u для отмены (отката) последней выполненной команды.
- 4. Исправьте все ошибки в строке, используя команду x .
- 5. Теперь нажмите заглавную U для того, чтобы вернуть всю строку в исходное
- состояние.
- 6. Нажмите u несколько раз для отмены команды U и предыдущих команд.
- 7. Нажмите теперь CTRL-R (удерживайте клавишу CTRL нажатой в момент нажатия
- R) несколько раз для возврата команд (откат отката).
----> Испрравьте оошибки в этойй строке и вернитте их сс помощьью `отката'.
+ 2. Нажмите x для удаления первого неправильного символа.
- 8. Это были очень полезные команды. Далее переходите к Резюме Урока 2.
+ 3. Теперь нажмите u для отмены (отката) последней выполненной команды.
+
+ 4. Исправьте все ошибки в строке, используя команду x .
+
+ 5. Теперь нажмите заглавную U для того, чтобы вернуть всю строку
+ в исходное состояние.
+
+ 6. Нажмите u несколько раз для отмены команды U и предыдущих команд.
+ 7. Нажмите теперь CTRL-R (т.е. удерживайте клавишу CTRL нажатой в момент
+ нажатия клавиши R) несколько раз для возврата команд (откат отката).
+
+---> Испрравьте оошибки в этойй строке и вернитте их сс помощьью `отмены'.
+
+ 8. Это были очень полезные команды. Далее переходите к Резюме Урока 2.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- РЕЗЮМЕ УРОКА 2
+ РЕЗЮМЕ УРОКА 2
+
+ 1. Для удаления текста от курсора до конца слова наберите: dw
- 1. Для удаления текста от курсора до конца слова наберите: dw
+ 2. Для удаления текста от курсора до конца строки наберите: d$
- 2. Для удаления текста от курсора до конца строки наберите: d$
+ 3. Для удаления всей строки наберите: dd
- 3. Для удаления всей строки наберите: dd
+ 4. Для повтора перемещения введите количество перед командой: 2w
- 4. Формат команды в обычном режиме имеет вид:
+ 5. Формат команды в обычном режиме имеет вид:
[число] команда объект ИЛИ команда [число] объект
где:
- число - сколько раз повторить выполнение команды
+ [число] - сколько раз повторить выполнение команды, опционально
команда - что выполнить, например d для удаления
объект - на что должна воздействовать команда, например w (слово),
$ (до конца строки), и т.д.
- 5. Для отмены (отката) предшествующих действий наберите: u (строчная u)
- Для отмены (отката) всех изменений в строке наберите: U (прописная U)
+ 6. Для перехода к началу строки используйте нуль: 0
+
+ 7. Для отмены (отката) предшествующих действий наберите: u (строчная u)
+ Для отмены (отката) всех изменений в строке наберите: U (прописная U)
Для отмены отката наберите: CTRL-R
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Урок 3.1: КОМАНДА ВСТАВКИ
+ Урок 3.1: КОМАНДА ВСТАВКИ
- ** Наберите p для вставки последнего удаленного текста после курсора. **
+ ** Наберите p для вставки последнего удалённого текста после курсора. **
- 1. Переместите курсор вниз к последней строке из набора.
+ 1. Переместите курсор вниз, к строке помеченной --->.
- 2. Наберите dd для удаления строки и ее сохранения в буфере Vim'а.
+ 2. Наберите dd для удаления строки и её сохранения в буфере Vim'а.
3. Переместите курсор к строке НАД тем местом, куда следует вставить
- удаленную строку.
-
- 4. Находясь в обычном режиме наберите p для замены строки.
+ удалённую строку.
- 5. Повторите шаги 2--4, пока не расставите все строки в нужном порядке.
+ 4. Находясь в обычном режиме наберите p для вставки строки ниже курсора.
- г) И лучше выдумать не мог.
- б) Когда не в шутку занемог,
- в) Он уважать себя заставил
- а) Мой дядя самых честных правил
+ 5. Повторите шаги со 2 по 4, пока не расставите все строки в нужном порядке.
+---> г) И лучше выдумать не мог.
+---> б) Когда не в шутку занемог,
+---> в) Он уважать себя заставил
+---> а) Мой дядя самых честных правил
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Урок 3.2: КОМАНДА ЗАМЕНЫ
+ Урок 3.2: КОМАНДА ЗАМЕНЫ
- ** Наберите r и символ, заменяющий символ под курсором. **
+ ** Наберите r и символ, заменяющий символ под курсором. **
- 1. Переместите курсор вниз, к строке, помеченной --->.
+ 1. Переместите курсор вниз, к строке помеченной --->.
2. Установите курсор так, чтобы он находился над первой ошибкой.
- 3. Наберите r и затем символ, исправляющий ошибку.
+ 3. Наберите r и затем символ, исправляющий ошибку.
- 4. Повторите шаги 2 и 3, пока первая строка не будет исправлена.
+ 4. Повторите шаги 2 и 3, пока первая строка не будет исправлена как вторая.
---> В момегт набтра этой чтроки кое0кто с трудом попвдал по клваишам!
---> В момент набора этой строки кое-кто с трудом попадал по клавишам!
- 5. Теперь переходите к Уроку 3.2.
-
-ЗАМЕЧАНИЕ: Помните, что вы должны учиться в процессе работы, а не просто
- запоминая.
+ 5. Теперь переходите к Уроку 3.3.
+Замечание! Помните, что вы должны учиться в процессе работы, а не просто
+ запоминая.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Урок 3.3: КОМАНДА ИЗМЕНЕНИЯ
+ Урок 3.3: КОМАНДА ИЗМЕНЕНИЯ
- ** Для изменения части слова наберите cw . **
+ ** Для изменения конечной части слова наберите ce . **
- 1. Переместите курсор вниз, к строке, помеченной --->.
+ 1. Переместите курсор вниз, к строке помеченной --->.
2. Расположите курсор над буквой `o' в слове `сола'.
- 3. Наберите cw и исправьте слово (в данном случае, наберите `лов'.)
+ 3. Наберите ce и исправьте слово (в данном случае, наберите `лов').
4. Нажмите <ESC> и переходите к следующей ошибке (к первому символу, который
- надо изменить.)
+ надо изменить).
- 5. Повторите шаги 3--4 пока первое предложение не станет идентичным второму.
+ 5. Повторите шаги 3 и 4 пока первое предложение не станет идентичным второму.
---> Несколько сола в эьгц строке тпгшцбь редалзкуюиесвх.
---> Несколько слов в этой строке требуют редактирования.
-Обратите внимание, что cw не только заменяет слово, но и переводит вас в режим
-вставки.
-
+ Обратите внимание, что ce не только удаляет слово, но и переводит вас в
+ режим вставки.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Урок 3.4: ПРОДОЛЖАЕМ ИЗМЕНЯТЬ С КОМАНДОЙ c
+ Урок 3.4: ПРОДОЛЖАЕМ ИЗМЕНЯТЬ С КОМАНДОЙ c
-** Команда замены используется с теми же объектами, что и команда удаления. **
+ ** Команда замены используется с теми же объектами, что и команда удаления. **
1. Команда изменения применяется таким же образом, как и команда удаления.
- Ее формат таков:
+ Её формат таков:
- [число] c объект ИЛИ c [число] объект
+ [число] c объект ИЛИ c [число] объект
2. Объекты также совпадают: w (слово), $ (конец строки) и т.п.
- 3. Переместите курсор вниз, к строке, помеченной --->.
+ 3. Переместите курсор вниз, к строке помеченной --->.
4. Перейдите к первой ошибке.
- 5. Наберите c$ и отредактируйте первую строку так, чтобы она совпадала со
+ 5. Наберите c$ и отредактируйте первую строку так, чтобы она совпадала со
второй, после чего нажмите <ESC>.
---> Конец этой строки нуждается в помощи, чтобы стать похожим на второй.
----> Конец этой строки нуждается в помощи команды c$ .
+---> Конец этой строки нуждается в помощи команды c$ .
+Замечание! Клавиша Backspace может использоваться для исправления при наборе.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- РЕЗЮМЕ УРОКА 3
+ РЕЗЮМЕ УРОКА 3
- 1. Для вставки текста, который только что был удален, наберите p . Эта
- команда вставит удаленный текст ПОСЛЕ курсора (если была удалена строка,
+ 1. Для вставки текста, который только что был удалён, наберите p . Эта
+ команда вставит удалённый текст ПОСЛЕ курсора (если была удалена строка,
то она будет помещена в строке под курсором).
- 2. Для замены символа под курсором наберите r и затем заменяющий символ.
+ 2. Для замены символа под курсором наберите r и затем заменяющий символ.
- 3. Команда изменения позволяет Вам изменить указанный объект от курсора до
- конца этого объекта. Например, наберите cw для замены от курсора до
- конца слова, c$ для изменения до конца строки.
+ 3. Команда изменения позволяет вам изменить указанный объект от курсора до
+ окончания перемещения. Например, наберите ce для замены от курсора до
+ конца слова, c$ для изменения до конца строки.
4. Формат команды изменения таков:
- [число] c объект ИЛИ c [число] объект
-
-Теперь отправляйтесь к следующему уроку.
-
-
-
+ [число] c объект ИЛИ c [число] объект
+Теперь переходите к следующему уроку.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Урок 4.1: ИНФОРМАЦИЯ О ФАЙЛЕ И РАСПОЛОЖЕНИЕ В НЕМ
+ Урок 4.1: ИНФОРМАЦИЯ О ФАЙЛЕ И РАСПОЛОЖЕНИИ В НЕМ
- ** Наберите CTRL-g чтобы увидеть Ваше месторасположение в файле и информацию
- о нем.
- Наберите SHIFT-G для перемещения к заданной строке в файле. **
+ ** Наберите CTRL-g чтобы увидеть ваше месторасположение в файле и
+ информацию о файле. Наберите G (SHIFT-G) для перемещения к заданной
+ строке в файле. **
- Замечание: Прочитайте весь урок прежде чем выполнять любые команды!!
+Замечание! Прочитайте весь урок прежде чем выполнять любые команды!
- 1. Удерживая клавишу Ctrl нажмите g . Внизу экрана появится строка статуса с
- именем файла и номером строки, в которой Вы находитесь. Запомните номер
+ 1. Удерживая клавишу Ctrl нажмите g . Внизу экрана появится строка статуса
+ с именем файла и номером строки, в которой вы находитесь. Запомните номер
строки, он потребуется на Шаге 3.
- 2. Нажмите shift-G для перемещения к концу файла.
-
- 3. Наберите номер строки, в которой вы находились и затем shift-G. Это
- вернет Вас к строке, в которой Вы были, когда в первый раз нажали Ctrl-g.
- (Когда Вы будете набирать цифры, они НЕ отобразятся на экране.)
+ 2. Удерживая клавишу Shift нажмите g для перемещения к концу файла.
- 4. Если Вы запомнили все вышесказанное, выполните шаги 1--3.
+ 3. Наберите номер строки, в которой вы находились и затем Shift-G. Это
+ вернёт вас к строке, в которой вы были, когда в первый раз нажали Ctrl-g.
+ 4. Если вы запомнили все вышесказанное, выполните шаги с 1 по 3.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Урок 4.2: КОМАНДА ПОИСКА
+ Урок 4.2: КОМАНДА ПОИСКА
- ** Наберите / и затем введите искомую фразу. **
+
+ ** Наберите / и затем введите искомую фразу. **
1. В обычном режиме (Normal mode) наберите символ / . Обратите внимание,
что он вместе с курсором появится внизу экрана, как это происходит с
- командой : .
+ командой : .
- 2. Теперь наберите 'ошшшибка' <ENTER>. Это то слово, которое Вы будете
+ 2. Теперь наберите 'ошшшибка' <ENTER>. Это то слово, которое вы будете
искать.
- 3. Для того, чтобы повторить поиск, просто нажмите n .
- Для поиска этой фразы в обратном направлении, нажмите Shift-N .
+ 3. Для того, чтобы повторить поиск, просто нажмите n .
+ Для поиска этой же фразы в обратном направлении, нажмите Shift-N .
+
+ 4. Если вы желаете сразу искать в обратном направлении, используйте
+ команду ? вместо / .
- 4. Если Вы желаете сразу искать в обратном направлении, используйте
- команду ? вместо / .
+ 5. Для того, чтобы вернуться туда, откуда вы начали поиск нажмите Ctrl-O.
+ (Удерживая нажатой клавишу Ctrl нажмите o ). Повторите несколько раз
+ для дальнейшего перехода. Для перехода вперёд используйте Ctrl-I .
----> Когда Вы при поиске достигнете конца файла, поиск будет продолжен с
- начала.
+---> "ошшшибка" это не способ написания слова `ошибка'; ошшшибка это ошибка.
- "ошшшибка" это не способ произнесения слова `ошибка'; ошшшибка это ошибка.
+Замечание! Если при поиске будет достигнут конц файла, то поиск будет продолжен
+ с начала.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Урок 4.3: ПОИСК ПАРНЫХ СКОБОК
- ** Наберите % для поиска парных ),] или } . **
+ ** Наберите % для поиска парных ), ] или } . **
- 1. Поместите курсор над любой из (, [ или { в строке внизу, помеченной --->.
+ 1. Поместите курсор над любой из (, [ или { в строке ниже, помеченной --->.
- 2. Теперь наберите символ % .
+ 2. Теперь наберите символ % .
3. Курсор должен перескочить на парную скобку.
- 4. Наберите % для возврата курсора назад к первой скобке.
+ 4. Наберите % для возврата курсора назад к первой скобке.
---> Это ( строка, содержащая такие (, такие [ ] и такие { } скобки. ))
-Замечание: Это очень удобно при отладке программ с пропущенными скобками!
-
-
-
-
-
+Замечание! Это очень удобно при отладке программ с пропущенными скобками!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Урок 4.4: СПОСОБ ИСПРАВЛЕНИЯ ОШИБОК
- ** Наберите :s/было/стало/g для замены 'было' на 'стало'. **
+ ** Наберите :s/было/стало/g для замены 'было' на 'стало'. **
- 1. Переместите курсор вниз, к строке, помеченной --->.
+ 1. Переместите курсор вниз, к строке помеченной --->.
- 2. Наберите :s/уводю/увожу <ENTER> . Обратите внимание на то, что эта команда
- заменит только первое найденное вхождение в строке.
+ 2. Наберите :s/уводю/увожу <ENTER> . Обратите внимание на то, что эта
+ команда заменит только первое найденное вхождение в строке.
- 3. Теперь наберите :s/уводю/увожу/g , означающее подстановку глобально во
- всей строке. Это заменит все найденные в строке вхождения.
+ 3. Теперь наберите :s/уводю/увожу/g , добавленная в конце g означает
+ подстановку глобально во всей строке. Это заменит все найденные в строке
+ вхождения.
---> Я уводю к отверженным селеньям, я уводю сквозь вековечный стон, я уводю к
забытым поколеньям.
4. Для замены всех вхождений последовательности символов между двумя
строками,
- наберите :#,#s/было/стало/g где #,# --- номера этих строк.
- Наберите :%s/было/стало/g для замены всех вхождений во всем файле.
-
+ наберите :#,#s/было/стало/g где #,# -- номера этих строк.
+ Наберите :%s/было/стало/g для замены всех вхождений во всем файле.
+ Наберите :%s/было/стало/gc для поиска всех вхождений во всем файле и
+ запроса подтверждения замены.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- РЕЗЮМЕ УРОКА 4
- 1. Ctrl-g показывает ваше положение в файле и информацию о нем.
- Shift-G перемещает Вас в конец файла. Номер, за которым следует Shift-G
+ РЕЗЮМЕ УРОКА 4
+
+
+ 1. Ctrl-g показывает ваше положение в файле и информацию о нем.
+ Shift-G перемещает вас в конец файла. Номер, за которым следует Shift-G
позволяет перейти к строке с этим номером.
+ gg перемещает вас к первой строке файла.
- 2. Нажатие / и затем ввод строки позволяет произвести поиск этой строки
- ВПЕРЕД по тексту.
- Нажатие ? и затем ввод строки позволяет произвести поиск этой строки
+ 2. Нажатие / и затем ввод строки позволяет произвести поиск этой строки
+ ВПЕРЁД по тексту.
+ Нажатие ? и затем ввод строки позволяет произвести поиск этой строки
НАЗАД по тексту.
- После поиска наберите n для перехода к следующему вхождению искомой
+ После поиска наберите n для перехода к следующему вхождению искомой
строки в том же направлении или Shift-N для перехода в противоположном
направлении.
- 3. Нажатие % , когда курсор находится на (,),[,],{, или } позволяет найти
+ 3. Нажатие % , когда курсор находится на (,),[,],{, или } позволяет найти
парную скобку.
4. Для подстановки `стало' вместо первого `было' в строке, наберите
- :s/old/new
+ :s/old/new
Для подстановки `стало' вместо всех `было' в строке, наберите
- :s/old/new/g
+ :s/old/new/g
Для замены в интервале между двумя строками, наберите
- :#,#s/old/new/g
+ :#,#s/old/new/g
Для замены всех вхождений `было' на `стало' в файле, наберите
- :%s/old/new/g
+ :%s/old/new/g
Чтобы редактор каждый раз запрашивал подтверждение, добавьте 'c'
- :%s/old/new/gc
+ :%s/old/new/gc
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Урок 5.1: КАК ВЫПОЛНИТЬ ВНЕШНЮЮ КОМАНДУ
+ Урок 5.1: КАК ВЫПОЛНИТЬ ВНЕШНЮЮ КОМАНДУ
- ** Наберите :! и затем внешнюю команду, которую следует выполнить. **
+ ** Наберите :! и затем внешнюю команду, которую следует выполнить. **
- 1. Наберите уже знакомую Вам команду : для установки курсора в командную
- строку редактора. Это позволит Вам ввести команду.
+ 1. Наберите уже знакомую вам команду : для установки курсора в командную
+ строку редактора. Это позволит вам ввести команду.
- 2. Теперь наберите символ ! (восклицательный знак). Теперь можно исполнить
+ 2. Теперь наберите символ ! (восклицательный знак). Это позволит выполнить
внешнюю команду, используя командную оболочку.
- 3. Для примера наберите ls после ! и нажмите <ENTER>. Эта команда выведет
- список файлов в текущем каталоге, точно также, как если бы Вы ввели эту
- команду в приглашении оболочки. Или попробуйте :!dir , если предыдущая
- команда не сработала.
-
----> Замечание: Таким способом можно выполнить любую внешнюю команду.
+ 3. Для примера наберите ls после ! и нажмите <ENTER>. Команда выведет
+ список файлов в текущем каталоге, точно также, как если бы вы ввели эту
+ команду в приглашении оболочки. Или попробуйте :!dir , если команда ls
+ не сработала.
----> Замечание: Все команды, начинающиеся с : , должны завершаться нажатием
- <ENTER>.
+Замечание! Таким способом можно выполнить любую внешнюю команду с указанием
+ аргументов.
+Замечание! Все команды, начинающиеся с : , должны завершаться нажатием
+ <ENTER>. Далее на это не всегда будет обращаться особое внимание.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Урок 5.2: КАК ЗАПИСАТЬ ФАЙЛ
-** Для сохранения изменений, произведенных в файле, наберите :w ИМЯ_ФАЙЛА. **
+ ** Для сохранения изменений, произведённых в файле,
+ наберите :w ИМЯ_ФАЙЛА. **
- 1. Наберите :!dir или :!ls для получения списка файлов в текущем каталоге.
- Как Вам уже известно, Вы должны нажать <ENTER> после ввода этих команд.
+ 1. Наберите :!dir или :!ls для получения списка файлов в текущем
+ каталоге. Как вам уже известно, после ввода команды надо нажать <ENTER>.
- 2. Придумайте название для файла, которое еще не существует, например TEST.
+ 2. Придумайте название для файла, которое ещё не существует, например TEST.
- 3. Теперь наберите :w TEST (где TEST --- это имя файла, придуманное Вами.)
+ 3. Теперь наберите :w TEST (где TEST -- это имя файла, придуманное вами.)
- 4. Эта команда сохранит весь файл (Учебник по Vim) под именем TEST. Чтобы
- удостовериться в этом, снова наберите :!dir и просмотрите каталог.
+ 4. Команда сохранит весь этот файл (Учебник по Vim) под именем TEST. Чтобы
+ удостовериться в этом, снова наберите :!dir или :!ls и просмотрите
+ каталог.
----> Заметьте, что если Вы выйдете из Vim и затем запустите его снова с
- файлом TEST, этот файл будет точной копией учебника в тот момент, когда
- Вы его сохранили.
-
- 5. Теперь удалите этот файл, набрав :!del TEST
+Замечание! Если вы выйдете из Vim и затем запустите его снова с файлом TEST
+ (т.е. выполните vim TEST ), этот файл будет точной копией учебника
+ в тот момент, когда вы его сохранили.
+ 5. Теперь удалите этот файл, набрав для MS-DOS :!del TEST
+ для Unix :!rm TEST
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Урок 5.3: ВЫБОРОЧНОЕ СОХРАНЕНИЕ
- ** Для сохранения части файла, наберите :#,# w ИМЯ_ФАЙЛА **
-
- 1. Еще раз наберите :!dir или :!ls для получения списка файлов в текущем
- каталоге и выберите подходящее имя, например TEST.
+ ** Для сохранения части файла, наберите v выберите часть
+ и сохраните её :w ИМЯ_ФАЙЛА **
- 2. Переместите курсор к началу этой страницы и нажмите Ctrl-g для нахождения
- номера строкиto. ЗАПОМНИТЕ ЭТОТ НОМЕР!
+ 1. Переместите курсор к этой строке.
- 3. Теперь переместитесь в конец страницы и вновь наберите Ctrl-g. ЗАПОМНИТЕ
- И ЭТОТ НОМЕР ТОЖЕ!
+ 2. Нажмите v и переместите курсор ниже к пятому шагу. Обратите внимание,
+ что текст подсвечен.
- 4. Для сохранения ТОЛЬКО ЧАСТИ файла наберите :#,# w TEST , где #,# --- это
- номера, которые Вы запомнили (начало, конец), а TEST --- имя вашего файла.
+ 3. Нажмите : и внизу экрана появится :'<,'> .
- 5. Как и прежде, убедитесь в наличии этого файла командой :!dir , но НЕ
- УДАЛЯЙТЕ его.
+ 4. Введите w TEST (где TEST -- имя файла, который ещё не существует).
+ До нажатия <ENTER>, проверьте что внизу экрана написано :'<,'>w TEST.
+ 5. Vim запишет выбранные строки в файл TEST. Как и прежде, убедитесь в
+ наличии этого файла командой :!dir или :!ls . НЕ УДАЛЯЙТЕ этот файл, он
+ потребуется в следующем уроке.
+Замечание! Нажатие v начинает визуальный выбор. Вы можете перемещать курсор
+ для изменения выбора. Затем для выбранного фрагмента можно выполнить
+ какой-то оператор, например, удалить нажатием d.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Урок 5.4: ЧТЕНИЕ И ОБЪЕДИНЕНИЕ ФАЙЛОВ
+ Урок 5.4: ЧТЕНИЕ И ОБЪЕДИНЕНИЕ ФАЙЛОВ
- ** Для вставки содержимого файла, наберите :r FILENAME **
- 1. Наберите :!dir для того, чтобы убедиться в том, что файл TEST все еще
- существует.
+ ** Для вставки содержимого из файла, наберите :r ИМЯ_ФАЙЛА **
- 2. Установите курсор в верхней части этой страницы.
+ 1. Установите курсор над этой строкой.
-Замечание: После выполнения шага 3 Вы увидите Урок 5.3. После этого
- перемещайтесь ВНИЗ, снова к этому уроку.
+Замечание! После выполнения Шага 2 вы увидите текст из Урока 5.3. Переместитесь
+ ВНИЗ по тексту до этого урока.
- 3. Теперь прочитайте Ваш файл TEST, используя команду :r TEST , где
- TEST --- это имя файла.
+ 2. Теперь прочитайте ваш файл TEST, используя команду :r TEST , где TEST --
+ это имя файла.
-Замечание: Прочитанный Вами файл будет вставлен в том месте, где находится
- курсор.
+ 3. Для проверки что содержимое файла было вставлено, переместитесь по тексту
+ и удостоверьтесь, что теперь в нём две копии Урока 5.3: исходная и из
+ файла TEST.
- 4. Чтобы убедиться в том, что файл прочитан, переместитесь немного назад по
- тексту и заметьте, что теперь существуют две копии Урока 5.3, исходная
- и полученная из файла.
+Замечание! Вставить можно и вывод внешней команды. Например, :r !ls прочитает
+ вывод команды ls и вставит его ниже курсора.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- РЕЗЮМЕ УРОКА 5
+ РЕЗЮМЕ УРОКА 5
1. :!команда исполняет внешнюю команду.
Некоторые полезные примеры:
- :!dir --- выводит список файлов в каталоге.
- :!del FILENAME --- удаляет файл FILENAME.
+ (MS-DOS) (Unix)
+ :!dir :!ls -- вывести список файлов в каталоге.
+ :!del ИМЯ :!rm ИМЯ -- удалить файл по имени.
- 2. :w FILENAME записывает текущий редактируемый файл на диск
- под именем FILENAME.
+ 2. :w ИМЯ_ФАЙЛА записывает текущий редактируемый в Vim файл на диск под
+ указанным именем.
- 3. :#,#w FILENAME сохраняет строки от # до # в файл FILENAME.
+ 3. v перемещение :w ИМЯ_ФАЙЛА сохраняет визуально выбранные строки в файл
+ с указанным именем.
- 4. :r FILENAME считывает с диска файл FILENAME и помещает его в текущий
- файл следом за позицией курсора.
+ 4. :r ИМЯ_ФАЙЛА считывает с диска файл с указанным именем и помещает его
+ ниже курсора.
+ 5. :r !dir читает вывод команды dir и помещает его ниже курсора.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 6.1: КОМАНДА СОЗДАНИЯ
+ ** Наберите o чтобы создать пустую строку под курсором и перейти в режим
+ вставки (Insert mode) **
+ 1. Переместите курсор вниз, к строке помеченной --->.
+ 2. Наберите o (в нижнем регистре) для того, чтобы создать пустую строку
+ НИЖЕ курсора и перейти в режим вставки (Insert mode).
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Урок 6.1: КОМАНДА СОЗДАНИЯ
+ 3. Теперь наберите какой-нибудь текст и нажмите <ESC> для выхода из режима
+ вставки.
+---> После нажатия o курсор перейдёт на новую пустую строку в режиме вставки.
- ** Наберите o чтобы создать пустую строку под курсором и перейти в режим
- вставки (Insert mode) **
+ 4. Для создания строки ВЫШЕ курсора, просто наберите заглавную O , вместо
+ строчной o . Попробуйте проделать это с нижеследующей строкой.
- 1. Переместите курсор вниз, к строке, помеченной --->.
+---> Создайте новую строку над этой, поместив на неё курсор и нажав Shift-O.
- 2. Наберите o (в нижнем регистре) для того, чтобы создать пустую строку
- НИЖЕ курсора и перейти в режим вставки (Insert mode).
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 6.2: КОМАНДА ДОБАВЛЕНИЯ
+
+
+ ** Наберите a , чтобы вставить текст ПОСЛЕ курсора. **
+
+ 1. Переместите курсор вниз, в начало первой строки помеченной --->.
- 3. Теперь скопируйте помеченную ---> строку и нажмите <ESC> для выхода из
- режима вставки.
+ 2. Набирайте e пока курсор не переместиться на конец cтро .
----> После нажатия o курсор перейдет на новую пустую строку в режиме вставки.
+ 3. Наберите a (в нижнем регистре) для добавления текста ПОСЛЕ символа,
+ находящегося под курсором. (Заглавная A позволяет добавить в конец
+ строки.)
- 4. Для создания строки ВЫШЕ курсора, просто наберите заглавную O, вместо
- строчной o. Попробуйте проделать это с нижеследующей строкой.
-Создайте новую строку над этой, нажав Shift-O, поместив курсор на эту строку.
+ 4. Допишите слово так, как показано в строке ниже. Нажмите <ESC> для выхода
+ из режима вставки (Insert mode).
+ 5. Используйте e для перехода к концу следующего незавершённого слова и
+ повторите шаги 3 и 4.
+---> Эта стро позволит вам попрактиков в добавле текста.
+---> Эта строчка позволит вам попрактиковаться в добавлении текста.
+Замечание! a , i и A переводят в один и тот же режим вставки, различие
+ только в том, где вставляются символы.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Урок 6.2: КОМАНДА ДОБАВЛЕНИЯ
+ Урок 6.3: ЕЩЁ ОДИН СПОСОБ ЗАМЕНЫ
- ** Наберите a , чтобы вставить текст ПОСЛЕ курсора. **
- 1. Переместите курсор вниз, в конец первой строки, помеченной ---> ,
- набрав $ в обычном режиме (Normal mode).
+ ** Наберите заглавную R для замены более чем одного символа. **
- 2. Наберите a (в нижнем регистре) для добавления текста ПОСЛЕ символа,
- находящегося под курсором. (Заглавная A позволяет добавить в конец
- строки.)
+ 1. Переместите курсор вниз, к первой строке помеченной --->, и в начало
+ первого слова xxx.
-Замечание: Это позволяет избежать нажатия i , последнего символа, текста для
- вставки, <ESC>, курсор-вправо, и, наконец, x , просто для того,
- чтобы добавить тест в конец строки!
+ 2. Теперь нажмите R и введите число указанный ниже во второй строке чтобы
+ заменить xxx.
- 3. Теперь завершите первую строку. Заметьте также, что добавление это в
- точности то же самое, что и режим вставки, за исключением позиции, в
- которую будет вставлен текст.
+ 3. Нажмите <ESC> для выхода из режима замены. Заметьте что остаток строки
+ не был изменён.
----> Эта строчка позволит Вам попрактиковаться
----> Эта строчка позволит Вам попрактиковаться в добавлении текста в конец
- строки.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Урок 6.3: ЕЩЕ ОДИН СПОСОБ ЗАМЕНЫ
+ 4. Повторите эти шаги для замены оставшихся xxx.
+---> Добавление 123 к xxx даёт xxx.
+---> Добавление 123 к 456 даёт 579.
- ** Наберите заглавную R для замены более, чем одного символа. **
+Замечание! Режим замены похож на режим вставки, но каждый введённый символ
+ удаляет существующий.
- 1. Переместите курсор вниз, к строке, помеченной --->.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 6.4: КОПИРОВАНИЕ И ВСТАВКА ТЕКСТА
- 2. Расположите курсор в начале первого слова, отличающегося от
- соответствующего в следующей строке, помеченной ---> (слово 'последней').
- 3. Теперь наберите R и замените остаток текста в первой строке, набрав
- поверх старого текста так, чтобы обе строки стали одинаковыми.
+ ** Используйте команду y для копирования и p для вставки **
----> Первую строку можно сравнять с последней, используя клавиши.
----> Первую строку можно сравнять с второй, используя R и набрав новый текст.
+ 1. Переместите курсор вниз, к первой строке помеченной --->, и после `а)'.
- 4. Обратите внимание, что при нажатии <ESC> для завершения, любой
- не измененный текст сохранится.
+ 2. Переключитесь в режим визуального выбора нажав v и переместите курсор
+ перед словом `первый'.
+ 3. Введите y для копирования подсвеченного текста.
+ 4. Переместите курсор в конец следующей строки комбинацией j$ .
+ 5. Нажмите p для вставки текста. Затем введите `второй' и нажмите <ESC>.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Урок 6.4: УСТАНОВКА ПАРАМЕТРОВ
+---> а) Этот элемент первый.
+ б)
+Замечание! Также возможно использовать yw (команду y с оператором w ) для
+ копирования одного слова.
-** Установим параметры так, чтобы игнорировать регистр при поиске или замене **
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 6.5: УСТАНОВКА ПАРАМЕТРОВ
- 1. Поищите слово 'игнорировать', набрав:
- /игнорировать
- Повторите поиск несколько раз, нажимая клавишу n
+ ** Установка параметра для игнорирования регистра при поиске или замене **
- 2. Включите параметр 'ic' (Игнорировать регистр), набрав:
- :set ic
+ 1. Найдите слово `игнорировать', набрав: /игнорировать <ENTER>.
+ Повторите поиск несколько раз, нажимая клавишу n .
- 3. Теперь снова сделайте поиск слова 'игнорировать', нажав: n
- Повторите поиск несколько раз, нажимая клавишу n
+ 2. Установите параметр `ic' (игнорировать регистр), набрав: :set ic
- 4. Включите параметры 'hlsearch' и 'incsearch':
- :set hls is
+ 3. Теперь снова несколько раз сделайте поиск слова `игнорировать',
+ нажимая: n
+ Заметьте, что теперь находятся `Игнорировать' и `ИГНОРИРОВАТЬ'.
- 5. Теперь опять введите команду поиска и посмотрите, что получится:
- /игнорировать
+ 4. Установите параметры `hlsearch' и `incsearch': :set hls is
+ 5. Теперь опять введите команду поиска и посмотрите, что получится:
+ /игнорировать <ENTER>
+ 6. Для возвращения учёта регистра при поиске наберите: :set noic
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- РЕЗЮМЕ УРОКА 6
+Замечание! Для отключения подсветки совпадений наберите: :nohlsearch
+Замечание! Если вы хотите игнорировать регистр только для одного поиска,
+ используйте \с в команде поиска: /игнорировать\c <ENTER>
- 1. Нажатие o создает строку НИЖЕ курсора и перемещает курсор в нее в режиме
- вставки.
- Нажатие заглавной O создает строку ВЫШЕ строки, в которой находится
- курсор.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ РЕЗЮМЕ УРОКА 6
- 2. Наберите a для вставки текста ПОСЛЕ символа, на котором находится курсор.
- Нажатие заглавной A автоматически перемещает Вас для добавления текста
- в конец строки.
- 3. Нажатие заглавной R переводит Вас в режим замены до тех пор, пока не
- будет нажата клавиша <ESC> для завершения.
+ 1. Нажмите o для создания строки НИЖЕ курсора и перехода в режим вставки.
+ Нажмите O для создания строки ВЫШЕ курсора.
- 4. Набрав ":set xxx" вы сможете включить параметр "xxx"
+ 2. Нажмите a для вставки текста ПОСЛЕ курсора.
+ Нажмите A для вставки текста в конец строки.
+ 3. Команда e подводит курсор к концу слова.
+ 4. Команда y копирует текст, p -- вставляет скопированный текст.
+ 5. Нажатие заглавной R переводит в режим замены до нажатия клавиши <ESC> .
+ 6. Наберите `:set xxx' для включения параметра `xxx', некоторые параметры:
+ `ic' `ignorecase' игнорирование регистра при поиске
+ `is' `incsearch' отображение частичных совпадений при поиске
+ `hls' `hlsearch' подсветка всех совпадений при поиске
+ 7. Добавьте `no' перед параметром для его отключения: :set noic
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Урок 7: КОМАНДЫ ПОЛУЧЕНИЯ ВСТРОЕННОЙ СПРАВКИ
+ Урок 7.1: ВСТРОЕННАЯ СПРАВКА
+
- ** Используйте встроенную справочную систему **
+ ** Используйте встроенную справочную систему **
Vim обладает мощной встроенной справочной системой. Для начала попробуйте
- один из трех вариантов:
+ один из трёх вариантов:
- нажмите клавишу <HELP> (если таковая имеется на клавиатуре)
- нажмите клавишу <F1> (если таковая имеется на клавиатуре)
- наберите :help <ENTER>
+ Прочитайте текст в окне справки для получения представления о том как
+ работает справка.
+ Нажмите CTRL-W CTRL-W для перехода от окна к окну.
Наберите :q <ENTER> чтобы закрыть окно справки.
- Вы можете найти справку для любого понятия или команды, просто задав
- соответствующий аргумент команде ":help". Попробуйте следующее (не забудьте
- нажать <ENTER>):
+ Вы можете найти справку для любого понятия или команды, задав соответствующий
+ аргумент команде `:help'. Попробуйте следующее (не забудьте нажать <ENTER>):
+
+ :help w
+ :help c_CTRL-D
+ :help insert-index
+ :help user-manual
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 7.2: СОЗДАНИЕ СТАРТОВОГО СЦЕНАРИЯ
+
- :help w
- :help c_<T
- :help insert-index
+ ** Включим возможности Vim **
+ Vim имеет намного больше возможностей, чем Vi, но большинство из них по
+ умолчанию выключены. Для использования больших возможностей вам следует
+ создать файл `vimrc'.
+ 1. Отредактируйте новый файл `vimrc'. Его расположение зависит от
+ используемой системы:
+ :e ~/.vimrc для Unix
+ :e $VIM/_vimrc для MS-Windows
+ 2. Теперь прочитайте пример файла `vimrc':
+ :r $VIMRUNTIME/vimrc_example.vim
+ 3. Запишите созданный вами новый файл `vimrc':
+ :w
+
+ Теперь при следующем запуске Vim будет включена подсветка синтаксиса. Все
+ настройки, предпочитаемые вами, могут быть добавлены в файл `vimrc'.
+ Для дальнейшей информации наберите :help vimrc-intro
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Урок 8: СОЗДАНИЕ СТАРТОВОГО СКРИПТА
+ Урок 7.3: ДОПОЛНЕНИЕ
- ** Включим возможности Vim **
- Vim имеет намного больше возможностей, чем Vi, однако большинствао из них
- выключены по умолчанию. Для того, чтобы начать использовать новые
- возможности Вам следует создать файл "vimrc".
+ ** Командную строку можно дополнить нажав CTRL-D и <TAB> **
- 1. Отредактируйте файл "vimrc", его расположение зависит от используемой
- системы:
+ 1. Удостоверьтесь, что Vim не в режиме совместимости: :set nocp
- :edit ~/.vimrc для Unix
- :edit $VIM/_vimrc для MS-Windows
+ 2. Посмотрите какие файлы есть в каталоге: :!ls или :!dir
- 2. Теперь прочитайте пример файла "vimrc":
+ 3. Наберите начало команды: :e
- :read $VIMRUNTIME/vimrc_example.vim
+ 4. Нажмите CTRL-D и Vim отобразит список команд начинающихся на `e'.
- 3. Запишите файл:
+ 5. Нажмите <TAB> и Vim дополнит название команды до `:edit'.
- :write
+ 6. Теперь добавьте пробел и начало существующего имени файла: :edit ФАЙ
- Теперь при следующем запуске Vim будет включена подсветка синтаксиса. Все
- настройки, предпочитаемые Вами, могут быть добавлены в файл "vimrc".
+ 7. Нажмите <TAB> и Vim дополнит имя файла, если оно уникальное.
+
+Замечание! Дополнение работает для многих команд. Попробуйте нажать CTRL-D и
+ <TAB>. Это особенно полезно для команды :help .
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ РЕЗЮМЕ УРОКА 7
+
+
+ 1. Наберите :help или нажмите <F1>, или <Help> для открытия окна справки.
+
+ 2. Наберите :help cmd для поиска справки по команде.
+
+ 3. Нажмите CTRL-W CTRL-W для перехода к другому окну.
+
+ 4. Наберите :q для закрытия окна справки (если оно активно).
+
+ 5. Для хранения ваших настроек создайте стартовый сценарий `vimrc'.
+
+ 6. При наборе : команды, нажмите CTRL-D для отображения возможных
+ дополнений. Нажмите <TAB> для использования дополнения.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- На этом завершается Учебник Vim. Он был предназначен для того, чтобы дать
- общее представление о редакторе Vim, достаточное для того, чтобы с легкостью
- использовать его. Учебник далек от полноты, поскольку Vim имеет очень много
- команд. Прочитайте теперь руководство пользователя: ":help user-manual".
+
+ На этом завершается Учебник Vim. Он был предназначен дать общее представление
+ о редакторе Vim, достаточное для того, чтобы с лёгкостью использовать его.
+ Учебник далёк от полноты, поскольку Vim имеет очень много команд. Прочитайте
+ теперь руководство пользователя: `:help user-manual'.
Для дальнейшего чтения рекомендуется книга:
- Vim - Vi Improved - Автор: Steve Oualline
- Издатель: New Riders
- Эта книга полностью посвящена Vim. Особенно полезна новичкам. Содержит
- множество примеров и иллюстраций.
- Взгляните на See http://iccf-holland.org/click5.html
+ Vim - Vi Improved, автор: Steve Oualline, издатель: New Riders
+
+ Эта книга полностью посвящена Vim. Особенно полезна она будет новичкам.
+ Содержит множество примеров и иллюстраций.
+ См. http://iccf-holland.org/click5.html
Следующая книга более почтенного возраста и посвящена больше Vi, чем Vim,
однако также рекомендуется:
- Learning the Vi Editor - Автор: Linda Lamb
- Издатель: O'Reilly & Associates Inc.
- Это хорошая книга для того, чтобы узнать все, что только можно проделывать с
- Vi. Шестое издание также включает информацию о Vim.
+ Learning the Vi Editor, автор: Linda Lamb,
+ издатель: O'Reilly & Associates Inc.
+
+ Это хорошая книга, чтобы узнать всё, что только можно сделать в Vi. Шестое
+ издание также включает информацию о Vim.
- Этот учебник был написан Michael C. Pierce и Robert K. Ware, Colorado School
- of Mines с использованием идей, предложенных Charles Smith, Colorado State
+ Этот учебник написал Michael C. Pierce и Robert K. Ware, Colorado School of
+ Mines с использованием идей, которые предложил Charles Smith, Colorado State
University. E-mail: bware@mines.colorado.edu.
- Доработано для Vim Bram Moolenaar.
+ Доработано для Vim Брамом Моленаром (Bram Moolenaar).
+
+ Перевод:
+ Андрей Киселев <a_kissel@eudoramail.com>, 2002.
+ Сергей Алёшин <alyoshin.s@gmail.com>, 2014.
+
+ Translators:
+ Andrey Kiselev <a_kissel@eudoramail.com>, 2002.
+ Sergey Alyoshin <alyoshin.s@gmail.com>, 2014.
- Перевод: Андрей Киселев <a_kissel@eudoramail.com>, 2002.
- Translator: Andrey Kiselev <a_kissel@eudoramail.com>, 2002.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/runtime/tutor/tutor.uk.utf-8 b/runtime/tutor/tutor.uk.utf-8
new file mode 100644
index 000000000..64982e925
--- /dev/null
+++ b/runtime/tutor/tutor.uk.utf-8
@@ -0,0 +1,976 @@
+===============================================================================
+= Ласкаво простимо в уроки VIM =
+===============================================================================
+
+ Vim дуже потужний редактор, що має багато команд. Всі команди неможливо
+ помістити в підручнику на зразок цього, але цих уроків достатньо, щоб
+ ви навчились з легкістю користуватись Vim як універсальним редактором.
+
+ УВАГА:
+ Уроки цього підручника вимагають зміни тексту. Зробіть копію файлу, щоб
+ практикуватись на ньому.
+
+ Важливо пам'ятати, що цей підручник має на меті навчання на практиці.
+ Це означає що ви маєте застосовувати команди щоб вивчити їх. Просто
+ прочитавши текст, ви забудете команди.
+
+ Кнопки на клавіатурі, будемо позначати квадратними дужками: [кнопка].
+
+ А зараз переконайтесь, що включена англійська розкладка і не затиснутий
+ Caps Lock, і натисніть кнопку j щоб переміститись до першого уроку.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 1.1: ПЕРЕМІЩЕННЯ КУРСОРА
+
+
+ ** Щоб переміщати курсор використовуйте кнопки [h],[j],[k],[l],
+ як вказано на схемі:
+ ^
+ [k]
+ <[h] [l]>
+ [j]
+ v
+
+ Таке розміщення спочатку може видатись трохи дивним. Як наприклад те, що
+ кнопка [l] переміщує курсор вправо. Але клавіші розміщені так, щоб
+ мінімізувати кількість рухів. Найчастіша дія яку користувач робить з
+ текстовим файлом - це читає його. А при читанні прокручують текст вниз.
+ Тому вниз прокручує [j] - вона знаходиться якраз під вказівним пальцем
+ правої руки.
+
+ Курсор можна переміщувати і класичним способом (курсорними клавішами), але
+ зручніше буде, якщо ви опануєте спосіб Vim. (Особливо якщо ви вже вмієте
+ набирати всліпу).
+
+ 1. Попереміщуйте курсор по екрану, поки не призвичаїтесь.
+
+ 2. Перемістіться до наступного уроку.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 1.2: Вихід з Vim
+
+
+Увага! Перед тим як виконувати цей урок прочитайте його повністю.
+
+ 1. Натисніть [ESC] (щоб впевнитись що ви в звичайному режимі).
+
+ 2. Наберіть: :q! [ENTER].
+ Це завершує роботу, відкидаючи всі зміни які ви здійснили.
+
+ 3. Коли ви побачите привітання терміналу введіть команду яку ви використали
+ щоб відкрити цей підручник. Скоріш за все це було: vim tutor.txt [ENTER]
+
+ 4. Якщо ви запам'ятали кроки з 1 по 3, виконайте їх, і переходьте до
+ наступного уроку.
+
+Зауваження: Команда :q! [ENTER] завершує роботу і відкидає всі зміни. Через
+ кілька уроків ви навчитесь зберігати зміни в файл.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 1.3:РЕДАГУВАННЯ ТЕКСТУ. ВИДАЛЕННЯ.
+
+
+ ** Натисніть [x] щоб видалити символ під курсором. **
+
+ 1. Перемістіть курсор до лінії нижче, яка позначена так: --->.
+
+ 2. Щоб виправити помилки перемістіть курсор так, щоб він став над
+ символом який треба видалити.
+
+ 3. Натисніть [x] щоб видалити непотрібний символ.
+
+ 4. Повторіть кроки з другого по четвертий, поки речення не стане правильним.
+
+---> Ккоровва перрестрибнуууууула ччерезз мііісяццць.
+
+ 5. Тепер, коли речення правильне, можна перейти до уроку 1.4.
+
+Зауваження: Протягом навчання не старайтесь запам'ятати все.
+ Вчіться практикою.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 1.4: РЕДАГУВАННЯ ТЕКСТУ. ВСТАВКА
+
+
+ ** Натисніть [i] щоб вставити текст. **
+
+ 1. Перемістіть курсор на перший рядок позначений: --->.
+
+ 2. Перемістіть курсор на символ, ПІСЛЯ якого потрібно вставити текст.
+
+ 3. Натисніть [i] і наберіть необхідні вставки.
+
+ 4. Коли всі помилки виправлені натисніть [ESC] щоб повернутись в звичайний
+ режим.
+
+---> З прав текст.
+---> З цього рядка пропав деякий текст.
+
+ 5. Коли призвичаїтесь вставляти текст - переходьте до уроку 1.5.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 1.5: РЕДАГУВАННЯ ТЕКСТУ. ДОДАВАННЯ.
+
+
+ ** Натисніть [A] щоб додати текст. **
+
+Увага! Тут і далі, коли мають наувазі клавішу з буквою в верхньому
+ регістрі, то це означає що її натискають з затиснутою [SHIFT].
+
+ 1. Перемістіть курсор до першої лінії внизу позначеної --->.
+ Не має значення над яким символом знаходиться курсор.
+
+ 2. Натисніть [A] і введіть необхідне доповнення.
+
+ 3. Коли додавання завершене натисніть [ESC] щоб повернутись в
+ звичайний режим.
+
+ 4. Перемістіть курсор до другої лінії позначеної ---> і повторіть
+ кроки 2 і 3 щоб виправити речення.
+
+---> З цього рядка пропущ
+ З цього рядка пропущений текст.
+---> З цього рядка також
+ З цього рядка також пропущений текст.
+
+ 5. Після виконання вправ, переходьте до наступного уроку.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 1.6: РЕДАГУВАННЯ ФАЙЛУ
+
+ ** Використайте :wq щоб зберегти файл і вийти.**
+
+Увага! Перед виконанням уроку прочитайте його повністю.
+
+ 1. Вийдіть з цього підручника як ви робили в уроці 1.2: :q![ENTER]
+ Або якщо ви маєте доступ до іншого терміналу виконуйте наступні
+ дії в ньому.
+
+ 2. В терміналі наберіть команду: vim НазваФайлу [ENTER]
+ 'vim' - команда для запуску редактора, НазваФайлу - файл який будемо
+ редагувати. Якщо ввести неіснуючий файл, то він створиться
+
+ 3. Відредагуйте текст, як навчились у попередніх уроках.
+
+ 4. Щоб зберегти зміни у файлі, і вийти з Vim наберіть: :wq [ENTER]
+
+ 5. Якщо ви вийшли з підручника на першому кроці, то зайдіть в нього
+ знову і переходьте до підсумку.
+
+ 6. Після прочитання і засвоєння попередніх кроків виконайте їх.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ПІДСУМОК УРОКУ 1
+
+
+ 1. Курсор керується курсорними клавішами, або клавішами [h][j][k][l]
+ [h] (вліво) [j] (вниз) [k] (вверх) [l] (вправо)
+
+ 2. Щоб запустити Vim з терміналу наберіть: vim Назва файлу [ENTER]
+
+ 3. Щоб вийти з Vim наберіть: [ESC] :q! [ENTER] щоб відкинути всі зміни.
+ або наберіть: [ESC] :wq [ENTER] щоб зберегти всі зміни.
+
+ 4. Щоб видалити символ під курсором натисніть [x].
+
+ 5. Щоб вставити, чи доповнити текст наберіть:
+ [i] текст що вставляєтсья [ESC] вставиться перед курсором
+ [A] текст до додається [ESC] додасть текст до рядка
+
+Зауваження: Натискання [ESC] перенесе вас в звичайний режим, чи відмінить
+ не до кінця введену команду.
+
+Тепер переходьте до уроку 2.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 2.1: КОМАНДИ ВИДАЛЕННЯ
+
+
+ ** Введіть dw щоб видалити слово. **
+
+ 1. Натисніть [ESC], щоб переконатись що ви в звичайному режимі.
+
+ 2. Перемістіть курсор до лінії нижче позначеної --->.
+
+ 3. Перемістіть курсор до початку слова що має бути видалене.
+
+ 4. Введіть dw щоб слово пропало.
+
+ Зауваження: Буква d з'явиться в останньому рядку екрану, якщо ви її натиснули.
+ Vim чекає введення наступного символа. Якщо з'явилось щось інше
+ значить ви щось не так ввели. Натисніть [ESC] і почніть спочатку.
+
+---> Є деякі слова весело, які не потрібні папір в цьому реченні.
+
+ 5. Повторюйте кроки 3 і 4 поки речення не стане правильне, а тоді переходьте
+ до уроку 2.2.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 2.2: БІЛЬШЕ КОМАНД ВИДАЛЕННЯ
+
+
+ ** Наберіть d$ щоб видалити символи від курсора до кінця рядка. **
+
+ 1. Натисніть [ESC] щоб переконатись що ви в звичайному режимі.
+
+ 2. Перемістіть курсор до лінії нижче, що позначена --->.
+
+ 3. Перемістіть курсор до кінця правильного рядка (ПІСЛЯ першої крапки).
+
+ 4. Введіть d$ щоб видалити все до кінця рядка.
+
+---> Хтось надрукував кінець цього рядка двічі. кінець цього рядка двічі.
+
+
+ 5. Перейдіть до уроку 2.3 щоб розібратись в цьому детальніше.
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 2.3:ОПЕРАТОРИ І ПЕРЕМІЩЕННЯ
+
+
+ Багато команд що змінюють текст утворені з оператора і переміщення.
+ Формат команди видалення з оператором d подано нижче:
+
+ d переміщення
+
+ Де:
+ d - оператор видалення.
+ переміщення - з чим працює оператор (описано нижче).
+
+ Короткий список переміщень:
+ w - до початку наступного слова, НЕ ВКЛЮЧАЮЧИ його перший символ.
+ e - до кінця поточного слова, ВКЛЮЧАЮЧИ останній символ.
+ $ - до кінця рядка, ВКЛЮЧАЮЧИ останній символ.
+
+ Тому введення de видалить символи від курсора, до кінця слова.
+
+Зауваження: Натискання тільки переміщення в звичайному режимі відповідно
+ переміщує курсор.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 2.4: ВИКОРИСТАННЯ ЛІЧИЛЬНИКА ДЛЯ ПЕРЕМІЩЕННЯ
+
+
+ ** Введення числа перед переміщенням повторює його стільки раз. **
+
+ 1. Перемістіть курсор до початку рядка позначеного --->
+
+ 2. Введіть 2w щоб перемістити курсор на два слова вперед.
+
+ 3. Введіть 3e щоб перемістити курсор в кінець третього слова.
+
+ 4. Введіть 0 (нуль) щоб переміститись на початок рядка.
+
+ 5. Повторіть кроки 2 і 3 з різними числами.
+
+---> А це просто рядок зі словами, серед яких можна рухати курсором.
+
+ 6. Переходьте до уроку 2.5.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 2.5: БАГАТОРАЗОВЕ ВИДАЛЕННЯ
+
+
+ ** Введення числа з оператором повторює його стільки ж разів. **
+
+ В комбінації з оператором видалення, і переміщення з лічильника можна
+ видаляти потрібне число елементів.
+ Для цього введіть
+ d число переміщення
+
+ 1. Перемістіться до першого слова в ВЕРХНЬОМУ РЕГІСТРІ в рядку
+ позначеному --->.
+
+ 2. Введіть d2w щоб видалити два слова.
+
+ 3. Повторіть кроки 1 і 2 з різними числами, щоб видалити все зайве.
+
+---> цей ABC DE рядок FGHI JK LMN OP слів Q RS TUV почищений.
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 2.6: ОПЕРАЦІЇ З РЯДКАМИ
+
+
+ ** Введіть dd щоб видалити весь рядок. **
+
+ Через те, що видалення всього рядка є доволі частою дією розробники Vi
+ вирішили що для цієї операції потрібна проста команда, як dd.
+
+ 1. Перемістіть курсор до другого рядка в вірші нижче.
+ 2. Введіть dd щоб видалити рядок.
+ 3. Потім перемістіться до четвертого рядка.
+ 4. Введіть 2dd щоб видалити два рядки.
+
+---> 1) Троянди червоні,
+---> 2) Багнюка весела,
+---> 3) Волошки голубі,
+---> 4) В мене є машина,
+---> 5) Годинник каже час,
+---> 6) Цукерки солодкі,
+---> 7) Дарую тобі.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 2.7: ВІДКИНУТИ ЗМІНИ
+
+
+ ** Натисніть u щоб скасувати останні команди, U щоб виправити ввесь рядок. **
+
+ 1. Перемістіть курсор до рядка нижче позначеного ---> на місце першої помилки.
+ 2. Натисніть x щоб видалити непотрібний символ.
+ 3. Потім натисніть u щоб відмінити виправлення.
+ 4. Цього разу виправте всі помилки в рядку використовуючи команду x .
+ 5. Після цього введіть U, і відкиньте всі зміни в цілому рядку.
+ 6. Натисніть u кілька разів, щоб відмінити U і попередні команди.
+ 7. Тепер натисніть CTRL-R кілька разів, щоб повторити відмінені команди
+ (відмінити відміну).
+
+---> Вииправте помилки наа цьоому рядку і вііідмініть їх.
+
+ 8. Тепер можна переходити до підсумків другого уроку.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ПІДСУМОК УРОКУ 2
+
+
+ 1. Щоб видалити все від курсора аж до початку наступного слова введіть: dw
+ 2. Щоб видалити від курсора до кінця рядка: d$
+ 3. Щоб видалити увесь рядок: dd
+
+ 4. Щоб повторити переміщення, поставте перед ним число повторів: 2w
+ 5. Формат команди зміни:
+ оператор [число] переміщення
+ де:
+ оператор - що робити, як наприклад d для видалення
+ [число] - кількість повторів
+ переміщення - куди переміститись перед виконанням оператора, як
+ як наприклад w (слово), $ (кінець рядка), і т.і.
+
+ 6. Щоб переміститись до початку рядка використовуйте нуль: 0
+
+ 7. Щоб відмінити попередню дію введіть: u (u в нижньому регістрі)
+ Щоб відмінити всі зміни рядка введіть: U (U в верхньому регістрі)
+ Щоб скасувати відміну натисніть: CTRL-R
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 3.1: КОМАНДА PUT
+
+
+ ** Введіть p щоб вставити перед тим видалений текст після курсору. **
+
+ 1. Перемістіть курсор до першої ---> лінії внизу.
+
+ 2. Введіть dd щоб видалити рядок і зберегти його в регістрі Vim.
+
+ 3. Перемістіть курсор до рядка в), НАД тим місцем де має бути видалений рядок.
+
+ 4. Натисніть p щоб вставити рядок під курсором.
+
+ 5. Повторіть кроки від 2 до 4 щоб вставити всі рядки в правильному порядку.
+
+---> г) всіх до кузні іззива.
+---> б) а в коваля серце тепле,
+---> в) а він клепче та й співа,
+---> а) А в тій кузні коваль клепле,
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 3.2: Команда заміни
+
+
+ ** Наберіть rx щоб замінити символ під курсором на x . **
+
+ 1. Перемістіть курсор до першого рядка нижче, позначеного --->.
+
+ 2. Помістіть курсор над першою помилкою.
+
+ 3. Наберіть r а потім символ який має стояти там.
+
+ 4. Повторіть кроки з 2 по 3 поки перший рядок не стане еквівалентним другому.
+
+---> Коли ця лігія набираламт. хтось наьтснкв геправмльні унопкм!
+---> Коли ця лінія набиралась, хтось натиснув неправильні кнопки!
+
+ 5. Зараз переходьте до уроку 3.3.
+
+Примітка: Ви маєте вчитись діями, а не простим заучуванням, пам'ятаєте?
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 3.3: ОПЕРАТОР ЗАМІНИ
+
+
+ ** Щоб зробити заміну до кінця слова введіть ce . **
+
+ 1. Перемістіть курсор до першого рядка позначеного --->.
+
+ 2. Помістіть курсор над у в слові рукра.
+
+ 3. Введіть ce і правильне закінчення слова (ядок в цьому випадку).
+
+ 4. Натисніть [ESC] і переходьте до наступного символа, який потрібно замінити.
+
+ 5. Повторюйте кроки 3 і 4 поки перше речення не стане таким самим як і друге.
+
+---> Цей рукра має кілька слів що потретамув заміни за допоцкщшг оператора.
+---> Цей рядок має кілька слів що потребують заміни за допомогою оператора.
+
+Зауважте що ce видаляє слово, і поміщає вас в режим вставки.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 3.4: БІЛЬШЕ ЗМІН З c
+
+
+ ** Оператор заміни використовується з тими ж переміщеннями що і видалення. **
+
+ 1. Оператор заміни працює в такий же спосіб що і видалення. Формат:
+
+ c [число] переміщення
+
+ 2. Переміщення ті ж самі, такі як w (слово) і $ (кінець рядка).
+
+ 3. Перемістіться до першого рядка позначеного --->.
+
+ 4. Перемістіть курсор до першої помилки.
+
+ 5. Наберіть c$ і решту рядка, щоб він став таким як другий і натисніть [ESC].
+
+---> Кінець цього рядка потребує якихось дій щоб стати таким як кінець другого.
+---> Кінець цього рядка можна виправити за допомогою команди c$.
+
+Примітка: Можна використовувати кнопку Backspace щоб виправляти опечатки при
+ наборі.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ПІДСУМОК УРОКУ 3
+
+
+ 1. Щоб вставити текст який був видалений наберіть p . Це вставляє
+ видалений текст ПІСЛЯ курсора (якщо був видалений рядок, вставка
+ продовжиться з рядка під курсором).
+
+ 2. Щоб замінити символ під курсором наберіть r і необхідний символ.
+
+ 3. Оператор заміни дозволяє робити заміну тексту від курсору, до потрібного
+ переміщення. Наприклад щоб замінити все від курсора до кінця слова
+ вводять ce . Щоб замінити закінчення рядка тиснуть c$ .
+
+ 4. Формат заміни:
+
+ c [число] переміщення
+
+Почнемо наступний урок.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 4.1: ПОЗИЦІЯ КУРСОРА І СТАТУС ФАЙЛУ
+
+ ** Введіть CTRL-G щоб побачити вашу позицію в файлі, і його статус.
+ Введіть G щоб переміститись на потрібний рядок файлу. **
+
+ ПРИМІТКА: Прочитайте увесь урок перед виконанням будь-яких кроків!!
+
+ 1. Затисніть кнопку Ctrl і натисніть g . Це називається CTRL-G.
+ Внизу з'явиться повідомлення з назвою файлу, і позицією в файлі.
+ Запам'ятайте номер рядка для кроку 3.
+
+ПРИМІТКА: Ви бачите позицію курсора в нижньому правому кутку екрану.
+ Це трапляється коли включена опція 'ruler' (читайте :help 'ruler' )
+
+ 2. Натисніть G щоб переміститись до кінця файлу.
+ Наберіть gg щоб переміститись до початку файлу.
+
+ 3. Наберіть номер рядка де ви були а потім G. Це перенесе вас до потрібного
+ рядка.
+
+ 4. Якщо ви запам'ятали три попередні кроки, то виконуйте.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 4.2: КОМАНДА ПОШУКУ
+
+
+ ** Введіть / (слеш) і фразу, щоб шукати її в тексті. **
+
+ 1. В звичайному режимі введіть символ / . Зауважте що він і курсор
+ з'являються в низу екрану, як і з командою : .
+
+ 2. Тепер введіть 'очепятка' <ENTER>. Це буде словом яке ви шукатимете.
+
+ 3. Щоб здійснити пошук цієї фрази ще раз введіть n .
+ Щоб шукати в протилежному напрямку введіть N .
+
+ 4. Щоб шукати фразу в зворотньому напрямку використайте ? замість / .
+
+ 5. Щоб переміститись назад до того місця звідки прийшли натисніть CTRL-O.
+ Повторіть щоб повернутись ще далі. (Це як кнопка назад в браузері)
+ CTRL-I переміщує вперед.
+
+---> "очепятка" не є способом написати опечатка; очепятка це опечатка.
+Примітка: Коли пошук досягає кінця файлу він продовжує з початку, хіба що
+ опція 'wrapscan' була виключена.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 4.3: ПОШУК ПАРНИХ ДУЖОК
+
+
+ ** Введіть % щоб знайти парну ),], чи } . **
+
+ 1. Помістіть курсор над будь-якою (, [, чи { в рядку нижче позначеному --->.
+
+ 2. Тепер введіть символ % .
+
+ 3. Курсор переміститься до відповідної дужки.
+
+ 4. Введіть % щоб перемістити курсор до іншої парної дужки.
+
+ 5. Спробуйте з іншими дужками, і подивіться що вийде.
+
+---> Це ( тестовий рядок ( з такими [ такими ] і такими { дужками } в ньому. ))
+
+
+Примітка: Це корисно при відлагоджуванні програми з неправильними дужками.
+ І взагалі в кожному тексті дужки мають стояти правильно!
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 4.4: КОМАНДА ЗАМІНИ
+
+
+ ** Наберіть :s/старе/нове/g щоб замінити 'старе' на 'нове'. **
+
+ 1. Перемістіть курсор до лінії нижче позначеної --->.
+
+ 2. Введіть :s/(біп)/блять [ENTER] . Зауважте що ця команда змінює тільки перше
+ входження (біп) в рядку.
+
+ 3. Потім наберіть :s/(біп)/блять/g . Додавання g вказує що заміни
+ робляться у всьому рядку глобально.
+
+---> люди не лю(біп), коли в слові "лю(біп)" "(біп)" заміняють на "(бiп)".
+
+ 4. Щоб замінити кожне входження послідовності символів між двома рядками
+ наберіть :#,#s/старе/нове/g де #,# діапазон рядків в яких робиться
+ заміна.
+ Введіть :%s/старе/нове/g щоб змінити кожне входження у цілому файлі.
+ Введіть :%s/старе/нове/gc щоб замінити, кожне входження у файлі з
+ підтвердженням кожної заміни.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ПІДСУМОК УРОКУ 4
+
+
+ 1. CTRL-G виводить вашу позицію в файлі і назву файлу.
+ G переміщує в кінець файлу.
+ число G переміщує до рядка з вказаним номером.
+ gg переміщує до першого рядка.
+
+ 2. Ввід / і послідовності символів шукає послідовність ПІСЛЯ курсора.
+ Ввід ? і послідовності символів шукає послідовність ПЕРЕД курсором.
+
+ Після пошуку введіть n щоб знайти наступне входження в тому ж напрямку
+ або N щоб шукати в протилежному напрямку.
+ CTRL-O відносить вас до старішої позиції, CTRL-I до новішої позиції.
+
+ 3. Ввід % коли курсор знаходиться над дужкою (,),[,],{, чи } переносить
+ курсор до протилежної дужки.
+
+ 4. Щоб замінити перше входження старого слова на нове :s/старе/нове
+ Щоб замінити всі старі слова рядка на нові :s/старе/нове/g
+ Щоб замінити фрази між двома рядками :#,#s/старе/нове/g
+ Щоб замінити всі входження в файлі :%s/старе/нове/g
+ Щоб щоразу підтверджувати заміну додайте 'c' :%s/старе/нове/gc
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 5.1: ЯК ВИКОНАТИ ЗОВНІШНЮ КОМАНДУ
+
+
+ ** Введіть :! і зовнішню команду, щоб виконати ту команду. **
+
+ 1. Введіть відому команду : щоб встановити курсор в низу екрану.
+ Це дозволяє вводити команди командного рядка.
+
+ 2. Тепер введіть ! (символ знаку оклику) . Це дозволить вам виконати
+ будь-яку зовнішню команду.
+
+ 3. Як приклад введіть :!ls [ENTER]. Це покаже список файлів каталогу, так
+ так ніби ви знаходитесь в оболонці терміналу. Або використайте :!dir
+ якщо ви раптом знаходитесь в Windows.
+
+Примітка: Можна запускати будь-яку зовнішню команду таким способом, навіть з
+ аргументами.
+
+Примітка: Всі команди що починаються з : мають закінчуватись натисканням
+ [ENTER]. Більше на цьому не наголошуватиметься.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 5.2: ЩЕ ПРО ЗАПИС ФАЙЛІВ
+
+
+ ** Щоб зберегти змінений текст, введіть :w НАЗВА_ФАЙЛУ **
+
+ 1. Введіть :!dir чи :!ls щоб переглянути вміст вашої директорії.
+ Вам вже казали що після цього тиснуть [ENTER].
+
+ 2. Виберіть ім'я файлу яке ще не використовується, наприклад TEST.
+ (Взагалі то це не обов'язково, якщо вміст обраного файлу не
+ є цінним)
+
+ 3. Тепер введіть: :w TEST (де TEST це назва яку ви обрали.)
+
+ 4. Це зберігає увесь файл (підручник Vim ) під ім'ям TEST.
+ Щоб перевірити знову наберіть :!ls щоб побачити зміни в каталозі.
+
+Примітка: Якщо ви вийдете з Vim і запустите його знову командою vim TEST,
+ файл що ви відкриєте буде точною копією цього, коли ви його зберегли.
+
+ 5. Зараз видаліть файл ввівши (Unix): :!rm TEST
+ чи (MS-DOS): :!del TEST
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 5.3: ВИБІР ТЕКСТУ ДЛЯ ЗАПИСУ
+
+
+ ** Щоб зберегти частину файлу, наберіть v переміщення :w НАЗВА_ФАЙЛУ **
+
+ 1. Перемістіть курсор до цього рядка.
+
+ 2. Натисніть v і перемістіть курсор на п'ять пунктів нижче. Зауважте, що
+ текст виділяється.
+
+ 3. Натисніть символ : . Внизу екрану з'являються символи :'<,'> .
+
+ 4. Введіть w TEST , де TEST назва файлу що ще не використовується.
+ Переконайтесь що ви бачите :'<,'>w TEST перед тим як натиснути [ENTER].
+
+ 5. Vim запише вибрані рядки в файл TEST. Використайте :!dir чи !ls
+ щоб побачити це. Поки що не видаляйте його! Ми використаємо TEST в
+ наступному уроці.
+
+Зауваження: Натискання v починає режим візуального виділення. Ви можете
+ переміщувати курсор щоб змінити розмір вибраної частини.
+ Потім можна використати оператор щоб зробити щось з текстом.
+ Наприклад d видалить текст.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 5.4: ОТРИМАННЯ І ЗЛИТТЯ ФАЙЛІВ
+
+
+ ** Щоб вставити вміст файлу введіть :r НАЗВА_ФАЙЛУ **
+
+ 1. Помістіть курсор десь над цим рядком.
+
+Зауваження: Після виконання кроку 2 ви побачите текст з уроку 5.3. Тоді
+ перемістіться вниз, щоб побачити вміст цього уроку знову.
+
+ 2. Тоді отримайте вміст вашого файлу TEST використавши команду :r TEST ,
+ де TEST назва файлу що ви використали.
+ Файл що ви отримуєте поміщується під рядком курсора.
+
+ 3. Щоб перевірити що файл вставлено, прокрутіть текст назад, і переконаєтесь
+ що тепер є дві копії урок 5.3, the original and the file version.
+
+Примітка: Також ви можете вставляти вивід зовнішньої програми. Наприклад
+ :r !ls читає вивід команди ls і вставляє його під курсором.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Підсумок 5 уроку
+
+
+ 1. :!команда виконує зовнішню команду.
+
+ 2. :w НАЗВА_ФАЙЛУ записує поточний файл на диск під назвою НАЗВА_ФАЙЛУ.
+
+ 3. v переміщення :w НАЗВА_ФАЙЛУ зберігає візуально виділену частину тексту
+ в файл НАЗВА_ФАЙЛУ.
+
+ 4. :r НАЗВА_ФАЙЛУ отримує з диску файл НАЗВА_ФАЙЛУ і вставляє його під
+ курсором.
+
+ 5. :r !ls читає вивід команди ls і вставляє її під поточною позицією курсора
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 6.1: КОМАНДА ВСТАВКИ
+
+
+ ** Введіть o щоб вставити новий рядок під курсором. **
+
+ 1. Перемістіть курсор на рядок нижче, позначений --->.
+
+ 2. Натисніть o щоб вставити новий рядок ПІД курсором та перейти в
+ режим вставки.
+
+ 3. Тепер введіть текст і натисніть [ESC] щоб вийти з режиму вставки.
+
+---> Після натискання o курсор ставиться на наступний рядок в режимі вставки.
+
+ 4. Щоб вставити рядок НАД ABOVE курсором пишуть O в верхньому регістрі,
+ замість o. Спробуйте на рядку нижче.
+
+---> Щоб вставити рядок над цим введіть O .
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 6.2: КОМАНДА ДОПИСУВАННЯ
+
+
+ ** Натисніть a щоб вставити текст після курсору. **
+
+ 1. Перемістіть курсор до початку рядка внизу позначеного --->.
+
+ 2. Тисніть e поки курсор не буде в кінці ря .
+
+ 3. Натисніть a (маленьке) щоб додати текст ПІСЛЯ курсору.
+
+ 4. Допишіть слова як рядок внизу. Натисніть [ESC] щоб вийти з режиму
+ вставки.
+
+ 5. Використайте e щоб переміститись до наступного неповного слова та
+ to move to the next incomplete word and repeat steps 3 and 4.
+
+---> Цей ря дозволить вам попрактикува в дописува тексту до рядка.
+---> Цей рядок дозволить вам попрактикуватись в дописуванні тексту до рядка.
+
+Примітка: a, i і A переходять в один і той же режим вставки, єдиною різницею
+ є тільки те, де вставляються символи.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 6.3: ІНШИЙ СПОСІБ ЗАМІНИ
+
+
+ ** Введіть велику R щоб замінити більш ніж один символ. **
+
+ 1. Перемістіть курсор до першого рядка внизу позначеного --->.
+ Перемістіть курсор до першого xxx .
+
+ 2. Тепер натисніть R і введіть номер під ним з другого рядка, так що він
+ замінює xxx .
+
+ 3. Натисніть [ESC] щоб покинути режим заміни. Зауважте, що решта рядка
+ залишається незмінною.
+
+ 4. Повторіть кроки від 1 до 3 щоб замінити всі xxx на числа з другого рядка.
+
+---> Додавання 123 до xxx дає xxx.
+---> Додавання 123 до 456 дає 579.
+
+Зауваження: Режим заміни подібний до режиму вставки, тільки кожен введений
+ символ видаляє символ який стояв на його місці.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 6.4: КОПІЮВАННЯ І ВСТАВКА
+
+
+ ** Використайте оператор y щоб копіювати текст і p щоб його вставити **
+
+ 1. Перейдіть до рядка нижче позначеного ---> і покладіть курсор після "а)".
+
+ 2. Перейдіть в візуальний режим за допомогою клавіші v і перемістіть курсор
+ якраз перед словом "один".
+
+ 3. Введіть y щоб копіювати (yank) виділений текст.
+
+ 4. Перемістіть курсор до кінця наступного рядка: j$
+
+ 5. Натисніть p щоб вставити (put) текст. Тоді введіть : два [ESC] .
+
+ 6. так само додайте третій рядочок.
+
+---> а) це рядок номер один
+ б)
+
+ Зауваження: також можна використовувати y як оператор;
+ yw копіює одне слово.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 6.5: ВСТАНОВЛЕННЯ ОПЦІЙ
+
+
+ ** Встановити опцію так що пошук чи заміна буде ігнорувати регістр **
+
+ 1. Знайдіть слово 'ігнорувати' ввівши : /ігнорувати
+ Повторіть кілька разів натискаючи n .
+
+ 2. Встановіть опцію ігнорування регістру 'ic' (Ignore case) ввівши: :set ic
+
+ 3. Тепер пошукайте 'ігнорувати' знову ввівши n
+ Зауважте що Ігнорувати та ІГНОРУВАТИ тепер також знаходяться.
+
+ 4. Ввімкніть 'hlsearch' (підсвітку пошуку) і 'incsearch' (інтерактивність)
+ командою :set hls is .
+
+ 5. Тепер пошукайте щось знову і зауважте зміни: /ігнорувати [ENTER]
+
+ 6. Щоб вимкнути ігнорування регістру напишіть: :set noic
+
+Примітка: Щоб вимкнути підсвітку співпадінь введіть: :nohlsearch
+Примітка: Якщо ви хочете не брати до уваги регістр тільки під час одного пошуку
+ використайте ключ \c. Наприклад: /ігнорувати\c [ENTER]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ПІДСУМОК УРОКУ 6
+
+ 1. Введіть о щоб додати рядок ПІД курсором і почати режим вставки.
+ Введіть O щоб додати рядок НАД курсором.
+
+ 2. Введіть a щоб вставити текст ПІСЛЯ курсора.
+ Введіть A щоб додати текст до рядка.
+
+ 3. Переміщення e переміщує нас до кінця слова.
+
+ 4. Оператор y копіює текст, p вставляє його.
+
+ 5. Введення R переносить нас в режим заміни до натискання [ESC].
+
+ 6. Набір ":set xxx" встановлює опцію "xxx". Деякі опції:
+ 'ic' 'ignorecase' ігнорувати верхній/нижній регістр при пошуку
+ 'is' 'incsearch' показувати співпадіння пошуку під час введення
+ фрази
+ 'hls' 'hlsearch' пісвічувати всі співпадіння
+ Можна одночасно використовувати і коротку і довгу форму запису опції.
+
+ 7. Використайте префікс "no" щоб вимкнути опцію: :set noic
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 7.1: ОТРИМАННЯ ДОПОМОГИ
+
+
+ ** Використання вбудованої довідкової системи **
+
+ Vim має всеосяжну систему довідки. Щоб ознайомитись з нею спробуйте один з
+ таких способів:
+ - натисніть кнопку [HELP] (якщо така є)
+ - натисніть [F1]
+ - наберіть :help
+
+ Прочитайте текст в вікні допомоги, щоб вияснити як вона працює.
+ Натисніть CTRL-W двічі щоб змінити вікно
+ Наберіть :q щоб закрити вікно довідки.
+
+ Можна знайти довідку майже на будь-яку тему додаючи аргумент після команди
+ ":help" . Спробуйте одну з наступних (не забувайте натискати [ENTER]):
+
+ :help w
+ :help c_CTRL-D
+ :help insert-index
+ :help user-manual
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 7.2: СТВОРЕННЯ СКРИПТА АВТОЗАПУСКУ
+
+
+ ** Ввімкнення додаткових функцій Vim **
+
+ Vim має набагато більше функцій ніж Vi, але більшість з них відключені за
+ замовчуванням. Щоб почати використання додаткових функцій потрібно створити
+ файл "vimrc".
+
+ 1. Почніть редагування файлу "vimrc" . Це залежить від вашої системи:
+ :e ~/.vimrc для Unix
+ :e $VIM/_vimrc для MS-Windows
+
+ 2. Тепер прочитайте приклад вмісту "vimrc" :
+ :r $VIMRUNTIME/vimrc_example.vim
+
+ 3. Збережіть файл:
+ :w
+
+ Наступного разу коли ви запустите Vim він буде використовувати підсвітку
+ синтаксису. Можна додати всі ваші улюблені налаштування в цей файл. Для більш
+ детальної інформації введіть :help vimrc-intro
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Урок 7.3: АВТОДОПОВНЕННЯ
+
+
+ ** Автодоповнення за допомогою CTRL-D і [TAB] **
+
+ 1. Переконайтесь що в Vim не включена зворотня сумісність: :set nocp
+
+ 2. Подивіться що за файли існують в каталозі: :!ls чи :!dir
+
+ 3. Введіть початок команди: :e
+
+ 4. Натисніть CTRL-D і Vim покаже список команд що починаються з "e".
+
+ 5. Натисніть [TAB] і Vim доповнить команду до ":edit".
+
+ 6. Тепер додайте пропуск і початок існуючого імені файлу: :edit FIL
+
+ 7. Натисніть [TAB]. Vim доповнить ім'я (якщо воно унікальне).
+
+Зауваження: Доповнення працює для багатьох команд. Просто натискайте CTRL-D і
+ [TAB]. Це особливо корисно для команди :help .
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ПІДСУМОК УРОКУ 7
+
+
+ 1. Введіть :help або натисніть [F1] щоб відкрити вікно довідки.
+
+ 2. Введіть :help тема щоб знайти довідку про тему .
+
+ 3. Введіть CTRL-W CTRL-W щоб змінити вікно.
+
+ 4. Наберіть :q щоб закрити вікно
+
+ 5. Створіть скрипт vimrc щоб змінювати ваші налаштування при запуску.
+
+ 6. При наборі команди що починається з двокрапки : натисніть CTRL-D
+ щоб побачити можливі доповнення. Натисніть [TAB] щоб побачити одне з
+ доповнень.
+
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Це завершує уроки Vim . Вони були націлені щоб дати вам короткий вступ в
+ редактор Vim, достатній для того щоб використовувати редактор комфортно.
+ Ці уроки зовсім далеко від повних, бо Vim має набагато більше команд. Можна
+ прочитати інструкцію користувача : ":help user-manual".
+
+ Для подальшого читання і вивчення рекомендується така книжка:
+ Vim - Vi Improved - by Steve Oualline
+ Publisher: New Riders
+ Особливо корисна для початківців.
+ Там багато прикладів і ілюстрацій.
+ Дивіться http://iccf-holland.org/click5.html
+
+ Ці уроки були написані Майклом С. Пірсом та Робертом Уаром.
+
+ Модифіковано для Vim Бремом Муленаром.
+
+
+ Переклад на українську Буник Т.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/runtime/tutor/tutor.utf-8 b/runtime/tutor/tutor.utf-8
index da28a1531..64a27d1c0 100644
--- a/runtime/tutor/tutor.utf-8
+++ b/runtime/tutor/tutor.utf-8
@@ -55,8 +55,8 @@ NOTE: The cursor keys should also work. But using hjkl you will be able to
2. Type: :q! <ENTER>.
This exits the editor, DISCARDING any changes you have made.
- 3. When you see the shell prompt, type the command that got you into this
- tutor. That would be: vimtutor <ENTER>
+ 3. Get back here by executing the command that got you into this tutor. That
+ might be: vimtutor <ENTER>
4. If you have these steps memorized and are confident, execute steps
1 through 3 to exit and re-enter the editor.
diff --git a/runtime/tutor/tutor.zh.big5 b/runtime/tutor/tutor.zh.big5
index 4daad6470..9da8b1a35 100644
--- a/runtime/tutor/tutor.zh.big5
+++ b/runtime/tutor/tutor.zh.big5
@@ -843,10 +843,10 @@ Open up a line above this by typing Shift-O while the cursor is on this line.
P xuandong@sh163.net ANBOrץC
2002~0318 <linuxrat@gnuchina.org>
- ھBram Molenaarͦb2002~0316骺ӫHnDANvimtutor1.4Ķ
+ ھBram Moolenaarͦb2002~0316骺ӫHnDANvimtutor1.4Ķ
ɯŨvimtutor1.5C
2001~1115 <linuxrat@gnuchina.org>
- Nvimtutor1.4Ķ浹Bram MolenaarMSven GuckesC
+ Nvimtutor1.4Ķ浹Bram MoolenaarMSven GuckesC
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/runtime/tutor/tutor.zh.euc b/runtime/tutor/tutor.zh.euc
index df59c3208..50852f810 100644
--- a/runtime/tutor/tutor.zh.euc
+++ b/runtime/tutor/tutor.zh.euc
@@ -988,9 +988,9 @@
л xuandong@sh163.net ָ
20020318 ̩ <linuxrat@gnuchina.org>
- Bram Molenaar20020316յҪ󣬽vimtutor1.4
+ Bram Moolenaar20020316յҪ󣬽vimtutor1.4
vimtutor1.5
20011115 ̩ <linuxrat@gnuchina.org>
- vimtutor1.4ύBram MolenaarSven Guckes
+ vimtutor1.4ύBram MoolenaarSven Guckes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/runtime/tutor/tutor.zh.utf-8 b/runtime/tutor/tutor.zh.utf-8
index 21d702051..d1fabc236 100644
--- a/runtime/tutor/tutor.zh.utf-8
+++ b/runtime/tutor/tutor.zh.utf-8
@@ -843,10 +843,10 @@ Open up a line above this by typing Shift-O while the cursor is on this line.
感謝 xuandong@sh163.net 的指正,將兩處錯別字修正。
2002年03月18日 梁昌泰 <linuxrat@gnuchina.org>
- 根據Bram Molenaar先生在2002年03月16日的來信要求,將vimtutor1.4中譯
+ 根據Bram Moolenaar先生在2002年03月16日的來信要求,將vimtutor1.4中譯
版升級到vimtutor1.5。
2001年11月15日 梁昌泰 <linuxrat@gnuchina.org>
- 將vimtutor1.4中譯版提交給Bram Molenaar和Sven Guckes。
+ 將vimtutor1.4中譯版提交給Bram Moolenaar和Sven Guckes。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/runtime/tutor/tutor.zh_cn.utf-8 b/runtime/tutor/tutor.zh_cn.utf-8
index 3ff031f7c..d986ab264 100644
--- a/runtime/tutor/tutor.zh_cn.utf-8
+++ b/runtime/tutor/tutor.zh_cn.utf-8
@@ -988,9 +988,9 @@
感谢 xuandong@sh163.net 的指正,将两处错别字修正。
2002年03月18日 梁昌泰 <linuxrat@gnuchina.org>
- 根据Bram Molenaar先生在2002年03月16日的来信要求,将vimtutor1.4中译
+ 根据Bram Moolenaar先生在2002年03月16日的来信要求,将vimtutor1.4中译
版升级到vimtutor1.5。
2001年11月15日 梁昌泰 <linuxrat@gnuchina.org>
- 将vimtutor1.4中译版提交给Bram Molenaar和Sven Guckes。
+ 将vimtutor1.4中译版提交给Bram Moolenaar和Sven Guckes。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/runtime/tutor/tutor.zh_tw.utf-8 b/runtime/tutor/tutor.zh_tw.utf-8
index 21d702051..d1fabc236 100644
--- a/runtime/tutor/tutor.zh_tw.utf-8
+++ b/runtime/tutor/tutor.zh_tw.utf-8
@@ -843,10 +843,10 @@ Open up a line above this by typing Shift-O while the cursor is on this line.
感謝 xuandong@sh163.net 的指正,將兩處錯別字修正。
2002年03月18日 梁昌泰 <linuxrat@gnuchina.org>
- 根據Bram Molenaar先生在2002年03月16日的來信要求,將vimtutor1.4中譯
+ 根據Bram Moolenaar先生在2002年03月16日的來信要求,將vimtutor1.4中譯
版升級到vimtutor1.5。
2001年11月15日 梁昌泰 <linuxrat@gnuchina.org>
- 將vimtutor1.4中譯版提交給Bram Molenaar和Sven Guckes。
+ 將vimtutor1.4中譯版提交給Bram Moolenaar和Sven Guckes。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/runtime/vimrc_example.vim b/runtime/vimrc_example.vim
index 27a5cfc22..215fd2465 100644
--- a/runtime/vimrc_example.vim
+++ b/runtime/vimrc_example.vim
@@ -1,7 +1,7 @@
" An example for a vimrc file.
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last change: 2014 Feb 05
+" Last change: 2014 Nov 05
"
" To use it, copy it to
" for Unix and OS/2: ~/.vimrc
@@ -95,3 +95,10 @@ if !exists(":DiffOrig")
command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis
\ | wincmd p | diffthis
endif
+
+if has('langmap') && exists('+langnoremap')
+ " Prevent that the langmap option applies to characters that result from a
+ " mapping. If unset (default), this may break plugins (but it's backward
+ " compatible).
+ set langnoremap
+endif
diff --git a/src/INSTALL b/src/INSTALL
index aa4b6e341..54297d198 100644
--- a/src/INSTALL
+++ b/src/INSTALL
@@ -316,7 +316,7 @@ directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
- If you have to use a `make' that does not supports the `VPATH'
+ If you have to use a `make' that does not support the `VPATH'
variable, you have to compile the package for one architecture at a time
in the source code directory. After you have installed the package for
one architecture, use `make distclean' before reconfiguring for another
diff --git a/src/INSTALLpc.txt b/src/INSTALLpc.txt
index 7ba2801b0..24fb4f0aa 100644
--- a/src/INSTALLpc.txt
+++ b/src/INSTALLpc.txt
@@ -192,6 +192,30 @@ To set the environment execute the msvc2010.bat script. You can then build
Vim with Make_mvc.mak.
+Targeting Windows XP with new MSVC *new-msvc-windows-xp*
+----------------------------------
+
+Beginning with Visual C++ 2010, Microsoft changed the behavior of LINK.EXE
+so that it targets Windows 6.0 (Vista) by default. In order to override
+this, the target Windows version number needs to be passed to LINK like
+follows:
+ LINK ... /subsystem:console,5.01
+
+Make_mvc.mak now supports a macro SUBSYSTEM_VER to pass the Windows version.
+Use lines like follows to target Windows XP (assuming using Visual C++ 2012
+under 64-bit Windows):
+ set WinSdk71=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.1A
+ set SDK_INCLUDE_DIR=%WinSdk71%\Include
+ set INCLUDE=%WinSdk71%\Include;%INCLUDE%
+ set LIB=%WinSdk71%\Lib;%LIB%
+ set PATH=%WinSdk71%\Bin;%PATH%
+ set CL=/D_USING_V110_SDK71_
+ nmake -f Make_mvc.mak ... WINVER=0x0501 SUBSYSTEM_VER=5.01
+
+The following Visual C++ team blog can serve as a reference page:
+ http://blogs.msdn.com/b/vcblog/archive/2012/10/08/windows-xp-targeting-with-c-in-visual-studio-2012.aspx
+
+
2. MinGW
========
@@ -204,11 +228,15 @@ at:
http://www.mingw.org/
+or you can use 'MinGW-w64' compiler.
+
+ http://mingw-w64.sourceforge.net/
+
Once you have downloaded the compiler binaries, unpack them on your hard disk
somewhere, and put them on your PATH. If you are on Win95/98 you can edit
your AUTOEXEC.BAT file with a line like:
- set PATH=C:\GCC-2.95.2\BIN;%PATH%
+ set PATH=C:\MinGW\bin;%PATH%
or on NT/2000/XP, go to the Control Panel, (Performance and Maintenance),
System, Advanced, and edit the environment from there.
@@ -216,10 +244,10 @@ System, Advanced, and edit the environment from there.
Test if gcc is on your path. From a CMD (or COMMAND on '95/98) window:
C:\> gcc --version
- 2.95.2
+ gcc (GCC) 4.8.1
- C:\> make --version
- GNU Make version 3.77 (...etc...)
+ C:\> mingw32-make --version
+ GNU Make 3.82.90 (...etc...)
Now you are ready to rock 'n' roll. Unpack the vim sources (look on
www.vim.org for exactly which version of the vim files you need).
@@ -231,7 +259,7 @@ Change directory to 'vim\src':
and you type:
- make -f Make_ming.mak gvim.exe
+ mingw32-make -f Make_ming.mak gvim.exe
After churning for a while, you will end up with 'gvim.exe' in the 'vim\src'
directory.
@@ -240,7 +268,7 @@ You should not need to do *any* editing of any files to get vim compiled this
way. If, for some reason, you want the console-mode-only version of vim (this
is NOT recommended on Win32, especially on '95/'98!!!), you can use:
- make -f Make_ming.mak GUI=no vim.exe
+ mingw32-make -f Make_ming.mak GUI=no vim.exe
If you are dismayed by how big the EXE is, I strongly recommend you get 'UPX'
(also free!) and compress the file (typical compression is 50%). UPX can be
@@ -267,8 +295,7 @@ You need to uncomment lines in Make_ming.mak to have NLS defined.
Use Make_cyg.mak with Cygwin's GCC. See
http://users.skynet.be/antoine.mechelynck/vim/compile.htm
-The Cygnus one many not fully work yet.
-With Cygnus gcc you can use the Unix Makefile instead (you need to get the
+With Cygnus gcc you should use the Unix Makefile instead (you need to get the
Unix archive then). Then you get a Cygwin application (feels like Vim is
running on Unix), while with Make_cyg.mak you get a Windows application (like
with the other makefiles).
@@ -292,9 +319,9 @@ your Linux (or other unix) box. To do this, you need to follow a few steps:
http://www.mingw.org/wiki/LinuxCrossMinGW
http://www.libsdl.org/extras/win32/cross/README.txt
2) Get and unpack both the Unix sources and the extra archive
- 3) in 'Make_ming.mak', set 'CROSS' to 'yes' instead of 'no'.
- Make further changes to 'Make_ming.mak' as you wish.
- If your cross-compiler prefix differs from the predefined value,
+ 3) in 'Make_cyg_ming.mak', set 'CROSS' to 'yes' instead of 'no'.
+ Make further changes to 'Make_cyg_ming.mak' and 'Make_ming.mak' as you
+ wish. If your cross-compiler prefix differs from the predefined value,
set 'CROSS_COMPILE' corresponding.
4) make -f Make_ming.mak gvim.exe
diff --git a/src/Make_bc3.mak b/src/Make_bc3.mak
index 54c42acc6..dea9e1011 100644
--- a/src/Make_bc3.mak
+++ b/src/Make_bc3.mak
@@ -54,6 +54,8 @@ EXE_dependencies = \
blowfish.obj \
buffer.obj \
charset.obj \
+ crypt.obj \
+ crypt_zip.obj \
diff.obj \
digraph.obj \
edit.obj \
diff --git a/src/Make_bc5.mak b/src/Make_bc5.mak
index 5769bd64b..2b759dce1 100644
--- a/src/Make_bc5.mak
+++ b/src/Make_bc5.mak
@@ -580,6 +580,8 @@ vimobj = \
$(OBJDIR)\blowfish.obj \
$(OBJDIR)\buffer.obj \
$(OBJDIR)\charset.obj \
+ $(OBJDIR)\crypt.obj \
+ $(OBJDIR)\crypt_zip.obj \
$(OBJDIR)\diff.obj \
$(OBJDIR)\digraph.obj \
$(OBJDIR)\edit.obj \
diff --git a/src/Make_cyg.mak b/src/Make_cyg.mak
index f34979807..828666ce0 100644
--- a/src/Make_cyg.mak
+++ b/src/Make_cyg.mak
@@ -1,710 +1,52 @@
#
-# Makefile for VIM on Win32, using Cygnus gcc
-# Last updated by Dan Sharp. Last Change: 2013 Dec 11
+# Makefile for VIM on Win32, using MinGW cross compiler on Cygwin
#
# Also read INSTALLpc.txt!
#
# This compiles Vim as a Windows application. If you want Vim to run as a
# Cygwin application use the Makefile (just like on Unix).
#
-# GUI no or yes: set to yes if you want the GUI version (yes)
-# PERL define to path to Perl dir to get Perl support (not defined)
-# PERL_VER define to version of Perl being used (56)
-# DYNAMIC_PERL no or yes: set to yes to load the Perl DLL dynamically (yes)
-# PYTHON define to path to Python dir to get PYTHON support (not defined)
-# PYTHON_VER define to version of Python being used (22)
-# DYNAMIC_PYTHON no or yes: use yes to load the Python DLL dynamically (yes)
-# PYTHON3 define to path to Python3 dir to get PYTHON3 support (not defined)
-# PYTHON3_VER define to version of Python3 being used (22)
-# DYNAMIC_PYTHON3 no or yes: use yes to load the Python3 DLL dynamically (yes)
-# TCL define to path to TCL dir to get TCL support (not defined)
-# TCL_VER define to version of TCL being used (83)
-# DYNAMIC_TCL no or yes: use yes to load the TCL DLL dynamically (yes)
-# RUBY define to path to Ruby dir to get Ruby support (not defined)
-# RUBY_VER define to version of Ruby being used (16)
-# RUBY_VER_LONG same, but in format with dot. (1.6)
-# You must set RUBY_VER_LONG when changing RUBY_VER.
-# You must set RUBY_API_VER version to RUBY_VER_LONG.
-# Don't set ruby API version to RUBY_VER like 191.
-# DYNAMIC_RUBY no or yes: use yes to load the Ruby DLL dynamically (yes)
-# MZSCHEME define to path to MzScheme dir to get MZSCHEME support (not defined)
-# MZSCHEME_VER define to version of MzScheme being used (209_000)
-# DYNAMIC_MZSCHEME no or yes: use yes to load the MzScheme DLLs dynamically (yes)
-# MZSCHEME_DLLS path to MzScheme DLLs (libmzgc and libmzsch), for "static" build.
-# MZSCHEME_USE_RACKET define to use "racket" instead of "mzsch".
-# LUA define to path to Lua dir to get Lua support (not defined)
-# LUA_VER define to version of Lua being used (51)
-# DYNAMIC_LUA no or yes: use yes to load the Lua DLL dynamically (yes)
-# GETTEXT no or yes: set to yes for dynamic gettext support (yes)
-# ICONV no or yes: set to yes for dynamic iconv support (yes)
-# MBYTE no or yes: set to yes to include multibyte support (yes)
-# IME no or yes: set to yes to include IME support (yes)
-# DYNAMIC_IME no or yes: set to yes to load imm32.dll dynamically (yes)
-# OLE no or yes: set to yes to make OLE gvim (no)
-# DEBUG no or yes: set to yes if you wish a DEBUGging build (no)
-# CPUNR No longer supported, use ARCH.
-# ARCH i386 through pentium4: select -march argument to compile with
-# (i386)
-# USEDLL no or yes: set to yes to use the Runtime library DLL (no)
-# For USEDLL=yes the cygwin1.dll is required to run Vim.
-# For "no" the mingw-gcc-g++ package or the mingw64-i686-gcc-g++
-# package is required to compile Vim. Or set CC to gcc-3 and add
-# -L/lib/w32api to EXTRA_LIBS.
-# POSTSCRIPT no or yes: set to yes for PostScript printing (no)
-# FEATURES TINY, SMALL, NORMAL, BIG or HUGE (BIG)
-# WINVER Lowest Win32 version to support. (0x0500)
-# CSCOPE no or yes: to include cscope interface support (yes)
-# OPTIMIZE SPACE, SPEED, or MAXSPEED: set optimization level (MAXSPEED)
-# NETBEANS no or yes: to include netbeans interface support (yes when GUI
-# is yes)
-# NBDEBUG no or yes: to include netbeans interface debugging support (no)
-# XPM define to path to XPM dir to get XPM image support (not defined)
-#>>>>> choose options:
-ifndef GUI
-GUI=yes
-endif
-
-ifndef FEATURES
-FEATURES = BIG
-endif
-
-ifndef GETTEXT
-GETTEXT = yes
-endif
-
-ifndef ICONV
-ICONV = yes
-endif
-
-ifndef MBYTE
-MBYTE = yes
-endif
-
-ifndef IME
-IME = yes
-endif
+# The old Make_cyg.mak (maintained by Dan Sharp et al.) was merged into
+# Make_cyg_ming.mak. Note: USEDLL option was removed.
+# This file contains Cygwin specific settings. Common settings are contained
+# in Make_cyg_ming.mak.
+#
+# Last updated by Ken Takata.
+# Last Change: 2014 Oct 21
-ifndef ARCH
-ARCH = i386
-endif
-ifndef WINVER
-WINVER = 0x0500
-endif
+# uncomment 'PERL' if you want a perl-enabled version
+#PERL=/cygdrive/c/perl
-ifndef CSCOPE
-CSCOPE = yes
-endif
+# uncomment 'LUA' if you want a Lua-enabled version
+#LUA=/cygdrive/c/lua
-ifndef NETBEANS
-ifeq ($(GUI),yes)
-NETBEANS = yes
-endif
-endif
+# uncomment 'MZSCHEME' if you want a MzScheme-enabled version
+#MZSCHEME=/cygdrive/d/plt
-ifndef OPTIMIZE
-OPTIMIZE = MAXSPEED
-endif
+# uncomment 'PYTHON' if you want a python-enabled version
+#PYTHON=/cygdrive/c/python20
+# uncomment 'PYTHON3' if you want a python3-enabled version
+#PYTHON3=/cygdrive/c/python31
-# Link against the shared version of libstdc++ by default. Set
-# STATIC_STDCPLUS to "yes" to link against static version instead.
-ifndef STATIC_STDCPLUS
-STATIC_STDCPLUS=no
-endif
+# uncomment 'TCL' if you want a Tcl-enabled version
+#TCL=/cygdrive/c/tcl
-### See feature.h for a list of optionals.
-### Any other defines can be included here.
+# uncomment 'RUBY' if you want a Ruby-enabled version
+#RUBY=/cygdribe/c/ruby
-DEFINES = -DWIN32 -DHAVE_PATHDEF -DFEAT_$(FEATURES) \
- -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER)
-ifeq ($(ARCH),x86-64)
-DEFINES+=-DMS_WIN64
-endif
-INCLUDES = -march=$(ARCH) -Iproto
-#>>>>> name of the compiler and linker, name of lib directory
-ifeq (yes, $(USEDLL))
-# CROSS_COMPILE is used for the gvimext DLL.
+# Use MinGW(-w64) cross compiler.
+# There are three MinGW packages in Cygwin:
+# 32-bit: mingw-gcc-g++ and mingw64-i686-gcc-g++
+# 64-bit: mingw64-x86_64-gcc-g++
+# You may also need to set 'ARCH' in Make_cyg_ming.mak.
CROSS_COMPILE = i686-pc-mingw32-
-CC = gcc
-RC = windres
-else
-# i686-pc-mingw32-gcc, i686-w64-mingw32-gcc or gcc-3 can be used.
-CROSS_COMPILE = i686-pc-mingw32-
-CC = $(CROSS_COMPILE)gcc
-RC = $(CROSS_COMPILE)windres
-endif
-
-##############################
-# DYNAMIC_PERL=yes and no both work
-##############################
-ifdef PERL
-DEFINES += -DFEAT_PERL
-INCLUDES += -I$(PERL)/lib/CORE
-EXTRA_OBJS += $(OUTDIR)/if_perl.o
-
-ifndef DYNAMIC_PERL
-DYNAMIC_PERL = yes
-endif
-
-ifndef PERL_VER
-PERL_VER = 56
-endif
-
-ifeq (yes, $(DYNAMIC_PERL))
-DEFINES += -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl$(PERL_VER).dll\"
-else
-EXTRA_LIBS += -L$(PERL)/lib/CORE -lperl$(PERL_VER)
-endif
-endif
-
-##############################
-# DYNAMIC_PYTHON=yes works.
-# DYNAMIC_PYTHON=no does not (unresolved externals on link).
-##############################
-ifdef PYTHON
-DEFINES += -DFEAT_PYTHON
-EXTRA_OBJS += $(OUTDIR)/if_python.o
-
-ifndef DYNAMIC_PYTHON
-DYNAMIC_PYTHON = yes
-endif
-
-ifndef PYTHON_VER
-PYTHON_VER = 22
-endif
-
-ifeq (yes, $(DYNAMIC_PYTHON))
-DEFINES += -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"python$(PYTHON_VER).dll\"
-else
-EXTRA_LIBS += $(PYTHON)/libs/python$(PYTHON_VER).lib
-endif
-endif
-
-##############################
-# DYNAMIC_PYTHON3=yes works.
-# DYNAMIC_PYTHON3=no does not (unresolved externals on link).
-##############################
-ifdef PYTHON3
-DEFINES += -DFEAT_PYTHON3
-EXTRA_OBJS += $(OUTDIR)/if_python3.o
-
-ifndef DYNAMIC_PYTHON3
-DYNAMIC_PYTHON3 = yes
-endif
-
-ifndef PYTHON3_VER
-PYTHON3_VER = 31
-endif
-
-ifeq (yes, $(DYNAMIC_PYTHON3))
-DEFINES += -DDYNAMIC_PYTHON3 -DDYNAMIC_PYTHON3_DLL=\"python$(PYTHON3_VER).dll\"
-else
-EXTRA_LIBS += $(PYTHON3)/libs/python$(PYTHON3_VER).lib
-endif
-endif
-
-##############################
-# DYNAMIC_RUBY=yes works.
-# DYNAMIC_RUBY=no does not (process exits).
-##############################
-ifdef RUBY
-
-ifndef DYNAMIC_RUBY
-DYNAMIC_RUBY=yes
-endif
-# Set default value
-ifndef RUBY_VER
-RUBY_VER = 16
-endif
-ifndef RUBY_VER_LONG
-RUBY_VER_LONG = 1.6
-endif
-ifndef RUBY_API_VER
-RUBY_API_VER = $(subst .,,$(RUBY_VER_LONG))
-endif
-
-ifndef RUBY_PLATFORM
-ifeq ($(RUBY_VER), 16)
-RUBY_PLATFORM = i586-mswin32
-else
-ifneq ($(wildcard $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/i386-mingw32),)
-RUBY_PLATFORM = i386-mingw32
-else
-ifneq ($(wildcard $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/x64-mingw32),)
-RUBY_PLATFORM = x64-mingw32
-else
-RUBY_PLATFORM = i386-mswin32
-endif
-endif
-endif
-endif
-
-ifndef RUBY_INSTALL_NAME
-ifeq ($(RUBY_VER), 16)
-RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_API_VER)
-else
-ifeq ($(ARCH),x86-64)
-RUBY_INSTALL_NAME = x64-msvcrt-ruby$(RUBY_API_VER)
-else
-RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_API_VER)
-endif
-endif
-endif
-
-ifeq (19, $(word 1,$(sort 19 $(RUBY_VER))))
-RUBY_19_OR_LATER = 1
-endif
-
-DEFINES += -DFEAT_RUBY
-ifneq ($(findstring w64-mingw32,$(CC)),)
-# A workaround for mingw-w64
-DEFINES += -DHAVE_STRUCT_TIMESPEC -DHAVE_STRUCT_TIMEZONE
-endif
-INCLUDES += -I$(RUBY)/lib/ruby/$(RUBY_VER_LONG)/$(RUBY_PLATFORM)
-ifdef RUBY_19_OR_LATER
-INCLUDES += -I$(RUBY)/include/ruby-$(RUBY_VER_LONG) -I$(RUBY)/include/ruby-$(RUBY_VER_LONG)/$(RUBY_PLATFORM)
-endif
-EXTRA_OBJS += $(OUTDIR)/if_ruby.o
-
-ifeq (yes, $(DYNAMIC_RUBY))
-DEFINES += -DDYNAMIC_RUBY -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\"
-DEFINES += -DDYNAMIC_RUBY_VER=$(RUBY_VER)
-else
-EXTRA_LIBS += $(RUBY)/lib/$(RUBY_INSTALL_NAME)
-endif
-endif
-
-##############################
-# DYNAMIC_MZSCHEME=yes works
-# DYNAMIC_MZSCHEME=no works too
-##############################
-ifdef MZSCHEME
-DEFINES += -DFEAT_MZSCHEME
-INCLUDES += -I$(MZSCHEME)/include
-EXTRA_OBJS += $(OUTDIR)/if_mzsch.o
-
-ifndef DYNAMIC_MZSCHEME
-DYNAMIC_MZSCHEME = yes
-endif
-
-ifndef MZSCHEME_VER
-MZSCHEME_VER = 209_000
-endif
-
-ifndef MZSCHEME_PRECISE_GC
-MZSCHEME_PRECISE_GC=no
-endif
-
-# for version 4.x we need to generate byte-code for Scheme base
-ifndef MZSCHEME_GENERATE_BASE
-MZSCHEME_GENERATE_BASE=no
-endif
-
-ifndef MZSCHEME_USE_RACKET
-MZSCHEME_MAIN_LIB=mzsch
-else
-MZSCHEME_MAIN_LIB=racket
-endif
-
-ifeq (yes, $(DYNAMIC_MZSCHEME))
-DEFINES += -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\" -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\"
-else
-ifndef MZSCHEME_DLLS
-MZSCHEME_DLLS = $(MZSCHEME)
-endif
-ifeq (yes,$(MZSCHEME_PRECISE_GC))
-MZSCHEME_LIB=-l$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER)
-else
-MZSCHEME_LIB = -l$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER) -lmzgc$(MZSCHEME_VER)
-endif
-EXTRA_LIBS += -L$(MZSCHEME_DLLS) -L$(MZSCHEME_DLLS)/lib $(MZSCHEME_LIB)
-endif
-ifeq (yes,$(MZSCHEME_GENERATE_BASE))
-DEFINES += -DINCLUDE_MZSCHEME_BASE
-MZ_EXTRA_DEP += mzscheme_base.c
-endif
-ifeq (yes,$(MZSCHEME_PRECISE_GC))
-DEFINES += -DMZ_PRECISE_GC
-endif
-endif
-
-##############################
-# DYNAMIC_TCL=yes and no both work.
-##############################
-ifdef TCL
-DEFINES += -DFEAT_TCL
-INCLUDES += -I$(TCL)/include
-EXTRA_OBJS += $(OUTDIR)/if_tcl.o
-
-ifndef DYNAMIC_TCL
-DYNAMIC_TCL = yes
-endif
-
-ifndef TCL_VER
-TCL_VER = 83
-endif
-
-ifeq (yes, $(DYNAMIC_TCL))
-DEFINES += -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl$(TCL_VER).dll\"
-EXTRA_LIBS += $(TCL)/lib/tclstub$(TCL_VER).lib
-else
-EXTRA_LIBS += $(TCL)/lib/tcl$(TCL_VER).lib
-endif
-endif
-
-##############################
-# DYNAMIC_LUA=yes works.
-# DYNAMIC_LUA=no does not (unresolved externals on link).
-##############################
-ifdef LUA
-DEFINES += -DFEAT_LUA
-INCLUDES += -I$(LUA)/include
-EXTRA_OBJS += $(OUTDIR)/if_lua.o
-
-ifndef DYNAMIC_LUA
-DYNAMIC_LUA = yes
-endif
-
-ifndef LUA_VER
-LUA_VER = 51
-endif
-
-ifeq (yes, $(DYNAMIC_LUA))
-DEFINES += -DDYNAMIC_LUA -DDYNAMIC_LUA_DLL=\"lua$(LUA_VER).dll\"
-else
-EXTRA_LIBS += $(LUA)/lib/lua$(LUA_VER).lib
-endif
-endif
-
-##############################
-ifeq (yes, $(GETTEXT))
-DEFINES += -DDYNAMIC_GETTEXT
-endif
-
-##############################
-ifeq (yes, $(ICONV))
-DEFINES += -DDYNAMIC_ICONV
-endif
-
-##############################
-ifeq (yes, $(MBYTE))
-DEFINES += -DFEAT_MBYTE
-endif
-
-##############################
-ifeq (yes, $(IME))
-DEFINES += -DFEAT_MBYTE_IME
-
-ifndef DYNAMIC_IME
-DYNAMIC_IME = yes
-endif
-
-ifeq (yes, $(DYNAMIC_IME))
-DEFINES += -DDYNAMIC_IME
-else
-EXTRA_LIBS += -limm32
-endif
-endif
-
-##############################
-ifeq (yes, $(DEBUG))
-DEFINES += -DDEBUG
-INCLUDES += -g -fstack-check
-DEBUG_SUFFIX = d
-else
-
-ifeq ($(OPTIMIZE), SIZE)
-OPTFLAG = -Os
-else
-ifeq ($(OPTIMIZE), MAXSPEED)
-OPTFLAG = -O3 -fomit-frame-pointer -freg-struct-return
-else
-OPTFLAG = -O2
-endif
-endif
-
-# A bug in the GCC <= 3.2 optimizer can cause a crash. The
-# following option removes the problem optimization.
-OPTFLAG += -fno-strength-reduce
-
-INCLUDES += -s
-
-endif
-
-##############################
-# USEDLL=yes will build a Cygwin32 executable that relies on cygwin1.dll.
-# USEDLL=no will build a Mingw32 executable with no extra dll dependencies.
-##############################
-ifeq (yes, $(USEDLL))
-DEFINES += -D_MAX_PATH=256 -D__CYGWIN__
-endif
-
-##############################
-ifeq (yes, $(POSTSCRIPT))
-DEFINES += -DMSWINPS
-endif
-
-##############################
-ifeq (yes, $(CSCOPE))
-DEFINES += -DFEAT_CSCOPE
-EXTRA_OBJS += $(OUTDIR)/if_cscope.o
-endif
-
-##############################
-ifeq ($(GUI),yes)
-
-##############################
-ifeq (yes, $(NETBEANS))
-# Only allow NETBEANS for a GUI build.
-DEFINES += -DFEAT_NETBEANS_INTG
-EXTRA_OBJS += $(OUTDIR)/netbeans.o
-EXTRA_LIBS += -lwsock32
-
-ifeq (yes, $(NBDEBUG))
-DEFINES += -DNBDEBUG
-NBDEBUG_DEP = nbdebug.h nbdebug.c
-endif
-
-endif
-
-##############################
-ifdef XPM
-# Only allow XPM for a GUI build.
-DEFINES += -DFEAT_XPM_W32
-INCLUDES += -I$(XPM)/include
-EXTRA_OBJS += $(OUTDIR)/xpm_w32.o
-EXTRA_LIBS += -L$(XPM)/lib -lXpm
-endif
-
-##############################
-EXE = gvim$(DEBUG_SUFFIX).exe
-OUTDIR = gobj$(DEBUG_SUFFIX)
-DEFINES += -DFEAT_GUI_W32 -DFEAT_CLIPBOARD
-EXTRA_OBJS += $(OUTDIR)/gui.o $(OUTDIR)/gui_w32.o $(OUTDIR)/gui_beval.o $(OUTDIR)/os_w32exe.o
-EXTRA_LIBS += -mwindows -lcomctl32 -lversion
-else
-EXE = vim$(DEBUG_SUFFIX).exe
-OUTDIR = obj$(DEBUG_SUFFIX)
-LIBS += -luser32 -lgdi32 -lcomdlg32
-endif
-
-##############################
-ifeq (yes, $(OLE))
-DEFINES += -DFEAT_OLE
-EXTRA_OBJS += $(OUTDIR)/if_ole.o
-EXTRA_LIBS += -loleaut32
-ifeq (yes, $(STATIC_STDCPLUS))
-EXTRA_LIBS += -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
-else
-EXTRA_LIBS += -lstdc++
-endif
-endif
-
-##############################
-ifneq (sh.exe, $(SHELL))
-DEL = rm
-MKDIR = mkdir -p
-DIRSLASH = /
-else
-DEL = del
-MKDIR = mkdir
-DIRSLASH = \\
-endif
-
-#>>>>> end of choices
-###########################################################################
-
-INCL = vim.h globals.h option.h keymap.h macros.h ascii.h term.h os_win32.h \
- structs.h version.h
-
-CFLAGS = $(OPTFLAG) $(DEFINES) $(INCLUDES)
-
-RCFLAGS = -O coff $(DEFINES)
-
-OBJ = \
- $(OUTDIR)/blowfish.o \
- $(OUTDIR)/buffer.o \
- $(OUTDIR)/charset.o \
- $(OUTDIR)/diff.o \
- $(OUTDIR)/digraph.o \
- $(OUTDIR)/edit.o \
- $(OUTDIR)/eval.o \
- $(OUTDIR)/ex_cmds.o \
- $(OUTDIR)/ex_cmds2.o \
- $(OUTDIR)/ex_docmd.o \
- $(OUTDIR)/ex_eval.o \
- $(OUTDIR)/ex_getln.o \
- $(OUTDIR)/fileio.o \
- $(OUTDIR)/fold.o \
- $(OUTDIR)/getchar.o \
- $(OUTDIR)/hardcopy.o \
- $(OUTDIR)/hashtab.o \
- $(OUTDIR)/main.o \
- $(OUTDIR)/mark.o \
- $(OUTDIR)/memfile.o \
- $(OUTDIR)/memline.o \
- $(OUTDIR)/menu.o \
- $(OUTDIR)/message.o \
- $(OUTDIR)/misc1.o \
- $(OUTDIR)/misc2.o \
- $(OUTDIR)/move.o \
- $(OUTDIR)/mbyte.o \
- $(OUTDIR)/normal.o \
- $(OUTDIR)/ops.o \
- $(OUTDIR)/option.o \
- $(OUTDIR)/os_win32.o \
- $(OUTDIR)/os_mswin.o \
- $(OUTDIR)/winclip.o \
- $(OUTDIR)/pathdef.o \
- $(OUTDIR)/popupmnu.o \
- $(OUTDIR)/quickfix.o \
- $(OUTDIR)/regexp.o \
- $(OUTDIR)/screen.o \
- $(OUTDIR)/search.o \
- $(OUTDIR)/sha256.o \
- $(OUTDIR)/spell.o \
- $(OUTDIR)/syntax.o \
- $(OUTDIR)/tag.o \
- $(OUTDIR)/term.o \
- $(OUTDIR)/ui.o \
- $(OUTDIR)/undo.o \
- $(OUTDIR)/version.o \
- $(OUTDIR)/vimrc.o \
- $(OUTDIR)/window.o \
- $(EXTRA_OBJS)
-
-all: $(EXE) xxd/xxd.exe vimrun.exe install.exe uninstal.exe GvimExt/gvimext.dll
-
-# According to the Cygwin doc 1.2 FAQ, kernel32 should not be specified for
-# linking unless calling ld directly.
-# See /usr/doc/cygwin-doc-1.2/html/faq_toc.html#TOC93 for more information.
-$(EXE): $(OUTDIR) $(OBJ)
- $(CC) $(CFLAGS) -o $(EXE) $(OBJ) $(LIBS) -luuid -lole32 $(EXTRA_LIBS)
-
-xxd/xxd.exe: xxd/xxd.c
- $(MAKE) -C xxd -f Make_cyg.mak CC=$(CC) USEDLL=$(USEDLL)
-
-GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
- $(MAKE) -C GvimExt -f Make_cyg.mak CROSS_COMPILE=$(CROSS_COMPILE)
-
-vimrun.exe: vimrun.c
- $(CC) $(CFLAGS) -o vimrun.exe vimrun.c $(LIBS)
-
-install.exe: dosinst.c
- $(CC) $(CFLAGS) -o install.exe dosinst.c $(LIBS) -luuid -lole32
-
-uninstal.exe: uninstal.c
- $(CC) $(CFLAGS) -o uninstal.exe uninstal.c $(LIBS)
-
-$(OUTDIR):
- $(MKDIR) $(OUTDIR)
-
-tags:
- command /c ctags *.c $(INCL)
-
-clean:
- -$(DEL) $(OUTDIR)$(DIRSLASH)*.o
- -rmdir $(OUTDIR)
- -$(DEL) $(EXE) vimrun.exe install.exe uninstal.exe
-ifdef PERL
- -$(DEL) if_perl.c
-endif
-ifdef MZSCHEME
- -$(DEL) mzscheme_base.c
-endif
- -$(DEL) pathdef.c
- $(MAKE) -C xxd -f Make_cyg.mak clean
- $(MAKE) -C GvimExt -f Make_cyg.mak clean
-
-distclean: clean
- -$(DEL) obj$(DIRSLASH)*.o
- -rmdir obj
- -$(DEL) gobj$(DIRSLASH)*.o
- -rmdir gobj
- -$(DEL) objd$(DIRSLASH)*.o
- -rmdir objd
- -$(DEL) gobjd$(DIRSLASH)*.o
- -rmdir gobjd
- -$(DEL) *.exe
-
-###########################################################################
-
-$(OUTDIR)/%.o : %.c $(INCL)
- $(CC) -c $(CFLAGS) $< -o $@
-
-$(OUTDIR)/ex_docmd.o: ex_docmd.c $(INCL) ex_cmds.h
- $(CC) -c $(CFLAGS) ex_docmd.c -o $(OUTDIR)/ex_docmd.o
-
-$(OUTDIR)/ex_eval.o: ex_eval.c $(INCL) ex_cmds.h
- $(CC) -c $(CFLAGS) ex_eval.c -o $(OUTDIR)/ex_eval.o
-
-$(OUTDIR)/gui_w32.o: gui_w32.c gui_w48.c $(INCL)
- $(CC) -c $(CFLAGS) gui_w32.c -o $(OUTDIR)/gui_w32.o
-
-$(OUTDIR)/if_cscope.o: if_cscope.c $(INCL) if_cscope.h
- $(CC) -c $(CFLAGS) if_cscope.c -o $(OUTDIR)/if_cscope.o
-
-$(OUTDIR)/if_ole.o: if_ole.cpp $(INCL)
- $(CC) -c $(CFLAGS) if_ole.cpp -o $(OUTDIR)/if_ole.o
-
-$(OUTDIR)/if_python.o : if_python.c if_py_both.h $(INCL)
- $(CC) -c $(CFLAGS) -I$(PYTHON)/include $< -o $@
-
-$(OUTDIR)/if_python3.o : if_python3.c if_py_both.h $(INCL)
- $(CC) -c $(CFLAGS) -I$(PYTHON3)/include $< -o $@
-
-if_perl.c: if_perl.xs typemap
- $(PERL)/bin/perl `cygpath -d $(PERL)/lib/ExtUtils/xsubpp` \
- -prototypes -typemap \
- `cygpath -d $(PERL)/lib/ExtUtils/typemap` if_perl.xs > $@
-
-$(OUTDIR)/if_perl.o: if_perl.c $(INCL)
-ifeq (yes, $(USEDLL))
- $(CC) -c $(CFLAGS) -I/usr/include/mingw -D__MINGW32__ if_perl.c -o $(OUTDIR)/if_perl.o
-endif
-
-$(OUTDIR)/if_ruby.o: if_ruby.c $(INCL)
-ifeq (16, $(RUBY_VER))
- $(CC) -c $(CFLAGS) -U_WIN32 if_ruby.c -o $(OUTDIR)/if_ruby.o
-endif
-
-$(OUTDIR)/netbeans.o: netbeans.c $(INCL) $(NBDEBUG_DEP)
- $(CC) -c $(CFLAGS) netbeans.c -o $(OUTDIR)/netbeans.o
-
-$(OUTDIR)/regexp.o: regexp.c regexp_nfa.c $(INCL)
- $(CC) -c $(CFLAGS) regexp.c -o $(OUTDIR)/regexp.o
-
-$(OUTDIR)/if_mzsch.o: if_mzsch.c $(INCL) if_mzsch.h $(MZ_EXTRA_DEP)
- $(CC) -c $(CFLAGS) if_mzsch.c -o $(OUTDIR)/if_mzsch.o
-
-$(OUTDIR)/vimrc.o: vim.rc version.h gui_w32_rc.h
- $(RC) $(RCFLAGS) vim.rc -o $(OUTDIR)/vimrc.o
-
-mzscheme_base.c:
- $(MZSCHEME)/mzc --c-mods mzscheme_base.c ++lib scheme/base
+#CROSS_COMPILE = i686-w64-mingw32-
+#CROSS_COMPILE = x86_64-w64-mingw32-
-pathdef.c: $(INCL)
-ifneq (sh.exe, $(SHELL))
- @echo creating pathdef.c
- @echo '/* pathdef.c */' > pathdef.c
- @echo '#include "vim.h"' >> pathdef.c
- @echo 'char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)";' >> pathdef.c
- @echo 'char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)";' >> pathdef.c
- @echo 'char_u *all_cflags = (char_u *)"$(CC) $(CFLAGS)";' >> pathdef.c
- @echo 'char_u *all_lflags = (char_u *)"$(CC) -s -o $(EXE) $(LIBS) -luuid -lole32 $(EXTRA_LIBS)";' >> pathdef.c
- @echo 'char_u *compiled_user = (char_u *)"$(USERNAME)";' >> pathdef.c
- @echo 'char_u *compiled_sys = (char_u *)"$(USERDOMAIN)";' >> pathdef.c
-else
- @echo creating pathdef.c
- @echo /* pathdef.c */ > pathdef.c
- @echo #include "vim.h" >> pathdef.c
- @echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)"; >> pathdef.c
- @echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)"; >> pathdef.c
- @echo char_u *all_cflags = (char_u *)"$(CC) $(CFLAGS)"; >> pathdef.c
- @echo char_u *all_lflags = (char_u *)"$(CC) -s -o $(EXE) $(LIBS) -luuid -lole32 $(EXTRA_LIBS)"; >> pathdef.c
- @echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> pathdef.c
- @echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> pathdef.c
-endif
+# Do not change this.
+UNDER_CYGWIN = yes
+include Make_cyg_ming.mak
diff --git a/src/Make_cyg_ming.mak b/src/Make_cyg_ming.mak
new file mode 100644
index 000000000..1f55a9e6a
--- /dev/null
+++ b/src/Make_cyg_ming.mak
@@ -0,0 +1,851 @@
+# Makefile for VIM on Win32 (Cygwin and MinGW)
+#
+# This file contains common part for Cygwin and MinGW and it is included
+# from Make_cyg.mak and Make_ming.mak.
+#
+# Info at http://www.mingw.org
+# Alternative x86 and 64-builds: http://mingw-w64.sourceforge.net
+# Also requires GNU make, which you can download from the same sites.
+# Get missing libraries from http://gnuwin32.sf.net.
+#
+# Tested on Win32 NT 4 and Win95.
+#
+# To make everything, just 'make -f Make_ming.mak'.
+# To make just e.g. gvim.exe, 'make -f Make_ming.mak gvim.exe'.
+# After a run, you can 'make -f Make_ming.mak clean' to clean up.
+#
+# NOTE: Sometimes 'GNU Make' will stop after building vimrun.exe -- I think
+# it's just run out of memory or something. Run again, and it will continue
+# with 'xxd'.
+#
+# "make upx" makes *compressed* versions of the 32 bit GUI and console EXEs,
+# using the excellent UPX compressor:
+# http://upx.sourceforge.net/
+# "make mpress" uses the MPRESS compressor for 32- and 64-bit EXEs:
+# http://www.matcode.com/mpress.htm
+#
+# Maintained by Ron Aaron <ronaharon@yahoo.com> et al.
+# Updated 2014 Oct 13.
+
+#>>>>> choose options:
+# set to yes for a debug build
+DEBUG=no
+# set to SIZE for size, SPEED for speed, MAXSPEED for maximum optimization
+OPTIMIZE=MAXSPEED
+# set to yes to make gvim, no for vim
+GUI=yes
+# set to yes if you want to use DirectWrite (DirectX)
+# MinGW-w64 is needed, and ARCH should be set to i686 or x86-64.
+DIRECTX=no
+# FEATURES=[TINY | SMALL | NORMAL | BIG | HUGE]
+# Set to TINY to make minimal version (few features).
+FEATURES=BIG
+# Set to one of i386, i486, i586, i686 as the minimum target processor.
+# For amd64/x64 architecture set ARCH=x86-64 .
+ARCH=i386
+# Set to yes to cross-compile from unix; no=native Windows (and Cygwin).
+CROSS=no
+# Set to path to iconv.h and libiconv.a to enable using 'iconv.dll'.
+#ICONV="."
+ICONV=yes
+GETTEXT=yes
+# Set to yes to include multibyte support.
+MBYTE=yes
+# Set to yes to include IME support.
+IME=yes
+DYNAMIC_IME=yes
+# Set to yes to enable writing a postscript file with :hardcopy.
+POSTSCRIPT=no
+# Set to yes to enable OLE support.
+OLE=no
+# Set the default $(WINVER) to make it work with pre-Win2k.
+ifndef WINVER
+WINVER = 0x0500
+endif
+# Set to yes to enable Cscope support.
+CSCOPE=yes
+# Set to yes to enable Netbeans support.
+NETBEANS=$(GUI)
+
+
+# Link against the shared version of libstdc++ by default. Set
+# STATIC_STDCPLUS to "yes" to link against static version instead.
+ifndef STATIC_STDCPLUS
+STATIC_STDCPLUS=no
+endif
+
+# If the user doesn't want gettext, undefine it.
+ifeq (no, $(GETTEXT))
+GETTEXT=
+endif
+# Added by E.F. Amatria <eferna1@platea.ptic.mec.es> 2001 Feb 23
+# Uncomment the first line and one of the following three if you want Native Language
+# Support. You'll need gnu_gettext.win32, a MINGW32 Windows PORT of gettext by
+# Franco Bez <franco.bez@gmx.de>. It may be found at
+# http://home.a-city.de/franco.bez/gettext/gettext_win32_en.html
+# Tested with mingw32 with GCC-2.95.2 on Win98
+# Updated 2001 Jun 9
+#GETTEXT=c:/gettext.win32.msvcrt
+#STATIC_GETTEXT=USE_STATIC_GETTEXT
+#DYNAMIC_GETTEXT=USE_GETTEXT_DLL
+#DYNAMIC_GETTEXT=USE_SAFE_GETTEXT_DLL
+SAFE_GETTEXT_DLL_OBJ = $(GETTEXT)/src/safe_gettext_dll/safe_gettext_dll.o
+# Alternatively, if you uncomment the two following lines, you get a "safe" version
+# without linking the safe_gettext_dll.o object file.
+#DYNAMIC_GETTEXT=DYNAMIC_GETTEXT
+#GETTEXT_DYNAMIC=gnu_gettext.dll
+INTLPATH=$(GETTEXT)/lib/mingw32
+INTLLIB=gnu_gettext
+
+# If you are using gettext-0.10.35 from http://sourceforge.net/projects/gettext
+# or gettext-0.10.37 from http://sourceforge.net/projects/mingwrep/
+# uncomment the following, but I can't build a static version with them, ?-(|
+#GETTEXT=c:/gettext-0.10.37-20010430
+#STATIC_GETTEXT=USE_STATIC_GETTEXT
+#DYNAMIC_GETTEXT=DYNAMIC_GETTEXT
+#INTLPATH=$(GETTEXT)/lib
+#INTLLIB=intl
+
+# Perl interface:
+# PERL=[Path to Perl directory] (Set inside Make_cyg.mak or Make_ming.mak)
+# DYNAMIC_PERL=yes (to load the Perl DLL dynamically)
+# PERL_VER=[Perl version, eg 56, 58, 510] (default is 56)
+ifdef PERL
+ifndef PERL_VER
+PERL_VER=56
+endif
+ifndef DYNAMIC_PERL
+DYNAMIC_PERL=yes
+endif
+# on Linux, for cross-compile, it's here:
+#PERLLIB=/home/ron/ActivePerl/lib
+# on NT, it's here:
+PERLEXE=$(PERL)/bin/perl
+PERLLIB=$(PERL)/lib
+PERLLIBS=$(PERLLIB)/Core
+ifeq ($(UNDER_CYGWIN),yes)
+PERLTYPEMAP:=$(shell cygpath -m $(PERLLIB)/ExtUtils/typemap)
+XSUBPPTRY:=$(shell cygpath -m $(PERLLIB)/ExtUtils/xsubpp)
+else
+PERLTYPEMAP=$(PERLLIB)/ExtUtils/typemap
+XSUBPPTRY=$(PERLLIB)/ExtUtils/xsubpp
+endif
+XSUBPP_EXISTS=$(shell $(PERLEXE) -e "print 1 unless -e '$(XSUBPPTRY)'")
+ifeq "$(XSUBPP_EXISTS)" ""
+XSUBPP=$(PERLEXE) $(XSUBPPTRY)
+else
+XSUBPP=xsubpp
+endif
+endif
+
+# Lua interface:
+# LUA=[Path to Lua directory] (Set inside Make_cyg.mak or Make_ming.mak)
+# DYNAMIC_LUA=yes (to load the Lua DLL dynamically)
+# LUA_VER=[Lua version, eg 51, 52] (default is 51)
+ifdef LUA
+ifndef DYNAMIC_LUA
+DYNAMIC_LUA=yes
+endif
+
+ifndef LUA_VER
+LUA_VER=51
+endif
+
+ifeq (no,$(DYNAMIC_LUA))
+LUA_LIB = -L$(LUA)/lib -llua
+endif
+
+endif
+
+# MzScheme interface:
+# MZSCHEME=[Path to MzScheme directory] (Set inside Make_cyg.mak or Make_ming.mak)
+# DYNAMIC_MZSCHEME=yes (to load the MzScheme DLL dynamically)
+# MZSCHEME_VER=[MzScheme version] (default is 205_000)
+# MZSCHEME_DEBUG=no
+ifdef MZSCHEME
+ifndef DYNAMIC_MZSCHEME
+DYNAMIC_MZSCHEME=yes
+endif
+
+ifndef MZSCHEME_VER
+MZSCHEME_VER=205_000
+endif
+
+ifndef MZSCHEME_PRECISE_GC
+MZSCHEME_PRECISE_GC=no
+endif
+
+# for version 4.x we need to generate byte-code for Scheme base
+ifndef MZSCHEME_GENERATE_BASE
+MZSCHEME_GENERATE_BASE=no
+endif
+
+ifndef MZSCHEME_USE_RACKET
+MZSCHEME_MAIN_LIB=mzsch
+else
+MZSCHEME_MAIN_LIB=racket
+endif
+
+ifeq (no,$(DYNAMIC_MZSCHEME))
+ifeq (yes,$(MZSCHEME_PRECISE_GC))
+MZSCHEME_LIB=-l$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER)
+else
+MZSCHEME_LIB = -l$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER) -lmzgc$(MZSCHEME_VER)
+endif
+# the modern MinGW can dynamically link to dlls directly.
+# point MZSCHEME_DLLS to where you put libmzschXXXXXXX.dll and libgcXXXXXXX.dll
+ifndef MZSCHEME_DLLS
+MZSCHEME_DLLS=$(MZSCHEME)
+endif
+MZSCHEME_LIBDIR=-L$(MZSCHEME_DLLS) -L$(MZSCHEME_DLLS)\lib
+endif
+
+endif
+
+# Python interface:
+# PYTHON=[Path to Python directory] (Set inside Make_cyg.mak or Make_ming.mak)
+# DYNAMIC_PYTHON=yes (to load the Python DLL dynamically)
+# PYTHON_VER=[Python version, eg 22, 23, ..., 27] (default is 22)
+ifdef PYTHON
+ifndef DYNAMIC_PYTHON
+DYNAMIC_PYTHON=yes
+endif
+
+ifndef PYTHON_VER
+PYTHON_VER=22
+endif
+
+ifeq (no,$(DYNAMIC_PYTHON))
+PYTHONLIB=-L$(PYTHON)/libs -lpython$(PYTHON_VER)
+endif
+# my include files are in 'win32inc' on Linux, and 'include' in the standard
+# NT distro (ActiveState)
+ifeq ($(CROSS),no)
+PYTHONINC=-I $(PYTHON)/include
+else
+PYTHONINC=-I $(PYTHON)/win32inc
+endif
+endif
+
+# Python3 interface:
+# PYTHON3=[Path to Python3 directory] (Set inside Make_cyg.mak or Make_ming.mak)
+# DYNAMIC_PYTHON3=yes (to load the Python3 DLL dynamically)
+# PYTHON3_VER=[Python3 version, eg 31, 32] (default is 31)
+ifdef PYTHON3
+ifndef DYNAMIC_PYTHON3
+DYNAMIC_PYTHON3=yes
+endif
+
+ifndef PYTHON3_VER
+PYTHON3_VER=31
+endif
+
+ifeq (no,$(DYNAMIC_PYTHON3))
+PYTHON3LIB=-L$(PYTHON3)/libs -lPYTHON$(PYTHON3_VER)
+endif
+
+ifeq ($(CROSS),no)
+PYTHON3INC=-I $(PYTHON3)/include
+else
+PYTHON3INC=-I $(PYTHON3)/win32inc
+endif
+endif
+
+# TCL interface:
+# TCL=[Path to TCL directory] (Set inside Make_cyg.mak or Make_ming.mak)
+# DYNAMIC_TCL=yes (to load the TCL DLL dynamically)
+# TCL_VER=[TCL version, eg 83, 84] (default is 83)
+ifdef TCL
+ifndef DYNAMIC_TCL
+DYNAMIC_TCL=yes
+endif
+ifndef TCL_VER
+TCL_VER = 83
+endif
+TCLINC += -I$(TCL)/include
+endif
+
+
+# Ruby interface:
+# RUBY=[Path to Ruby directory] (Set inside Make_cyg.mak or Make_ming.mak)
+# DYNAMIC_RUBY=yes (to load the Ruby DLL dynamically)
+# RUBY_VER=[Ruby version, eg 18, 19, 20] (default is 18)
+# RUBY_VER_LONG=[Ruby version, eg 1.8, 1.9.1, 2.0.0] (default is 1.8)
+# You must set RUBY_VER_LONG when changing RUBY_VER.
+# RUBY_API_VER is derived from RUBY_VER_LONG.
+# Note: If you use Ruby 1.9.3, set as follows:
+# RUBY_VER=19
+# RUBY_VER_LONG=1.9.1 (not 1.9.3, because the API version is 1.9.1.)
+ifdef RUBY
+ifndef DYNAMIC_RUBY
+DYNAMIC_RUBY=yes
+endif
+# Set default value
+ifndef RUBY_VER
+RUBY_VER = 18
+endif
+ifndef RUBY_VER_LONG
+RUBY_VER_LONG = 1.8
+endif
+ifndef RUBY_API_VER
+RUBY_API_VER = $(subst .,,$(RUBY_VER_LONG))
+endif
+
+ifndef RUBY_PLATFORM
+ifeq ($(RUBY_VER), 16)
+RUBY_PLATFORM = i586-mswin32
+else
+ifneq ($(wildcard $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/i386-mingw32),)
+RUBY_PLATFORM = i386-mingw32
+else
+ifneq ($(wildcard $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/x64-mingw32),)
+RUBY_PLATFORM = x64-mingw32
+else
+RUBY_PLATFORM = i386-mswin32
+endif
+endif
+endif
+endif
+
+ifndef RUBY_INSTALL_NAME
+ifeq ($(RUBY_VER), 16)
+RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_API_VER)
+else
+ifeq ($(ARCH),x86-64)
+RUBY_INSTALL_NAME = x64-msvcrt-ruby$(RUBY_API_VER)
+else
+RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_API_VER)
+endif
+endif
+endif
+
+ifeq (19, $(word 1,$(sort 19 $(RUBY_VER))))
+RUBY_19_OR_LATER = 1
+endif
+
+RUBYINC = -I $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/$(RUBY_PLATFORM)
+ifdef RUBY_19_OR_LATER
+RUBYINC += -I $(RUBY)/include/ruby-$(RUBY_VER_LONG) -I $(RUBY)/include/ruby-$(RUBY_VER_LONG)/$(RUBY_PLATFORM)
+endif
+ifeq (no, $(DYNAMIC_RUBY))
+RUBYLIB = -L$(RUBY)/lib -l$(RUBY_INSTALL_NAME)
+endif
+
+endif # RUBY
+
+# See feature.h for a list of options.
+# Any other defines can be included here.
+DEF_GUI=-DFEAT_GUI_W32 -DFEAT_CLIPBOARD
+DEFINES=-DWIN32 -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) \
+ -DHAVE_PATHDEF -DFEAT_$(FEATURES)
+ifeq ($(ARCH),x86-64)
+DEFINES+=-DMS_WIN64
+endif
+ifeq ($(CROSS),yes)
+# cross-compiler prefix:
+ifndef CROSS_COMPILE
+CROSS_COMPILE = i586-pc-mingw32msvc-
+endif
+DEL = rm
+MKDIR = mkdir -p
+DIRSLASH = /
+else
+# normal (Windows) compilation:
+ifndef CROSS_COMPILE
+CROSS_COMPILE =
+endif
+ifneq (sh.exe, $(SHELL))
+DEL = rm
+MKDIR = mkdir -p
+DIRSLASH = /
+else
+DEL = del
+MKDIR = mkdir
+DIRSLASH = \\
+endif
+endif
+CC := $(CROSS_COMPILE)gcc
+CXX := $(CROSS_COMPILE)g++
+ifeq ($(UNDER_CYGWIN),yes)
+WINDRES := $(CROSS_COMPILE)windres
+else
+WINDRES := windres
+endif
+WINDRES_CC = $(CC)
+
+#>>>>> end of choices
+###########################################################################
+
+CFLAGS = -Iproto $(DEFINES) -pipe -w -march=$(ARCH) -Wall
+WINDRES_FLAGS = --preprocessor="$(WINDRES_CC) -E -xc" -DRC_INVOKED
+EXTRA_LIBS =
+
+ifdef GETTEXT
+DEFINES += -DHAVE_GETTEXT -DHAVE_LOCALE_H
+GETTEXTINCLUDE = $(GETTEXT)/include
+GETTEXTLIB = $(INTLPATH)
+ifeq (yes, $(GETTEXT))
+DEFINES += -DDYNAMIC_GETTEXT
+else
+ifdef DYNAMIC_GETTEXT
+DEFINES += -D$(DYNAMIC_GETTEXT)
+ifdef GETTEXT_DYNAMIC
+DEFINES += -DGETTEXT_DYNAMIC -DGETTEXT_DLL=\"$(GETTEXT_DYNAMIC)\"
+endif
+endif
+endif
+endif
+
+ifdef PERL
+CFLAGS += -I$(PERLLIBS) -DFEAT_PERL
+ifeq (yes, $(DYNAMIC_PERL))
+CFLAGS += -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl$(PERL_VER).dll\"
+EXTRA_LIBS += -L$(PERLLIBS) -lperl$(PERL_VER)
+endif
+endif
+
+ifdef LUA
+CFLAGS += -I$(LUA)/include -I$(LUA) -DFEAT_LUA
+ifeq (yes, $(DYNAMIC_LUA))
+CFLAGS += -DDYNAMIC_LUA -DDYNAMIC_LUA_DLL=\"lua$(LUA_VER).dll\"
+endif
+endif
+
+ifdef MZSCHEME
+CFLAGS += -I$(MZSCHEME)/include -DFEAT_MZSCHEME -DMZSCHEME_COLLECTS=\"$(MZSCHEME)/collects\"
+ifeq (yes, $(DYNAMIC_MZSCHEME))
+CFLAGS += -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\" -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\"
+endif
+ifeq (yes, "$(MZSCHEME_DEBUG)")
+CFLAGS += -DMZSCHEME_FORCE_GC
+endif
+endif
+
+ifdef RUBY
+CFLAGS += -DFEAT_RUBY $(RUBYINC)
+ifeq (yes, $(DYNAMIC_RUBY))
+CFLAGS += -DDYNAMIC_RUBY -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\"
+CFLAGS += -DDYNAMIC_RUBY_VER=$(RUBY_VER)
+endif
+ifneq ($(findstring w64-mingw32,$(CC)),)
+# A workaround for MinGW-w64
+CFLAGS += -DHAVE_STRUCT_TIMESPEC -DHAVE_STRUCT_TIMEZONE
+endif
+endif
+
+ifdef PYTHON
+CFLAGS += -DFEAT_PYTHON
+ifeq (yes, $(DYNAMIC_PYTHON))
+CFLAGS += -DDYNAMIC_PYTHON
+endif
+endif
+
+ifdef PYTHON3
+CFLAGS += -DFEAT_PYTHON3
+ifeq (yes, $(DYNAMIC_PYTHON3))
+CFLAGS += -DDYNAMIC_PYTHON3
+endif
+endif
+
+ifdef TCL
+CFLAGS += -DFEAT_TCL $(TCLINC)
+ifeq (yes, $(DYNAMIC_TCL))
+CFLAGS += -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl$(TCL_VER).dll\"
+endif
+endif
+
+ifeq ($(POSTSCRIPT),yes)
+DEFINES += -DMSWINPS
+endif
+
+ifeq (yes, $(OLE))
+DEFINES += -DFEAT_OLE
+endif
+
+ifeq ($(CSCOPE),yes)
+DEFINES += -DFEAT_CSCOPE
+endif
+
+ifeq ($(NETBEANS),yes)
+# Only allow NETBEANS for a GUI build.
+ifeq (yes, $(GUI))
+DEFINES += -DFEAT_NETBEANS_INTG
+
+ifeq ($(NBDEBUG), yes)
+DEFINES += -DNBDEBUG
+NBDEBUG_INCL = nbdebug.h
+NBDEBUG_SRC = nbdebug.c
+endif
+endif
+endif
+
+# DirectWrite (DirectX)
+ifeq ($(DIRECTX),yes)
+# Only allow DirectWrite for a GUI build.
+ifeq (yes, $(GUI))
+DEFINES += -DFEAT_DIRECTX -DDYNAMIC_DIRECTX
+endif
+endif
+
+# Only allow XPM for a GUI build.
+ifeq (yes, $(GUI))
+
+ifndef XPM
+ifeq ($(ARCH),i386)
+XPM = xpm/x86
+endif
+ifeq ($(ARCH),i486)
+XPM = xpm/x86
+endif
+ifeq ($(ARCH),i586)
+XPM = xpm/x86
+endif
+ifeq ($(ARCH),i686)
+XPM = xpm/x86
+endif
+ifeq ($(ARCH),x86-64)
+XPM = xpm/x64
+endif
+endif
+ifdef XPM
+ifneq ($(XPM),no)
+CFLAGS += -DFEAT_XPM_W32 -I $(XPM)/include -I $(XPM)/../include
+endif
+endif
+
+endif
+
+ifeq ($(DEBUG),yes)
+CFLAGS += -g -fstack-check
+DEBUG_SUFFIX=d
+else
+ifeq ($(OPTIMIZE), SIZE)
+CFLAGS += -Os
+else
+ifeq ($(OPTIMIZE), MAXSPEED)
+CFLAGS += -O3
+CFLAGS += -fomit-frame-pointer -freg-struct-return
+else # SPEED
+CFLAGS += -O2
+endif
+endif
+CFLAGS += -s
+endif
+
+LIB = -lkernel32 -luser32 -lgdi32 -ladvapi32 -lcomdlg32 -lcomctl32 -lversion
+GUIOBJ = $(OUTDIR)/gui.o $(OUTDIR)/gui_w32.o $(OUTDIR)/gui_beval.o $(OUTDIR)/os_w32exe.o
+OBJ = \
+ $(OUTDIR)/blowfish.o \
+ $(OUTDIR)/buffer.o \
+ $(OUTDIR)/charset.o \
+ $(OUTDIR)/crypt.o \
+ $(OUTDIR)/crypt_zip.o \
+ $(OUTDIR)/diff.o \
+ $(OUTDIR)/digraph.o \
+ $(OUTDIR)/edit.o \
+ $(OUTDIR)/eval.o \
+ $(OUTDIR)/ex_cmds.o \
+ $(OUTDIR)/ex_cmds2.o \
+ $(OUTDIR)/ex_docmd.o \
+ $(OUTDIR)/ex_eval.o \
+ $(OUTDIR)/ex_getln.o \
+ $(OUTDIR)/fileio.o \
+ $(OUTDIR)/fold.o \
+ $(OUTDIR)/getchar.o \
+ $(OUTDIR)/hardcopy.o \
+ $(OUTDIR)/hashtab.o \
+ $(OUTDIR)/main.o \
+ $(OUTDIR)/mark.o \
+ $(OUTDIR)/memfile.o \
+ $(OUTDIR)/memline.o \
+ $(OUTDIR)/menu.o \
+ $(OUTDIR)/message.o \
+ $(OUTDIR)/misc1.o \
+ $(OUTDIR)/misc2.o \
+ $(OUTDIR)/move.o \
+ $(OUTDIR)/mbyte.o \
+ $(OUTDIR)/normal.o \
+ $(OUTDIR)/ops.o \
+ $(OUTDIR)/option.o \
+ $(OUTDIR)/os_win32.o \
+ $(OUTDIR)/os_mswin.o \
+ $(OUTDIR)/winclip.o \
+ $(OUTDIR)/pathdef.o \
+ $(OUTDIR)/popupmnu.o \
+ $(OUTDIR)/quickfix.o \
+ $(OUTDIR)/regexp.o \
+ $(OUTDIR)/screen.o \
+ $(OUTDIR)/search.o \
+ $(OUTDIR)/sha256.o \
+ $(OUTDIR)/spell.o \
+ $(OUTDIR)/syntax.o \
+ $(OUTDIR)/tag.o \
+ $(OUTDIR)/term.o \
+ $(OUTDIR)/ui.o \
+ $(OUTDIR)/undo.o \
+ $(OUTDIR)/version.o \
+ $(OUTDIR)/vimrc.o \
+ $(OUTDIR)/window.o
+
+ifdef PERL
+OBJ += $(OUTDIR)/if_perl.o
+endif
+ifdef LUA
+OBJ += $(OUTDIR)/if_lua.o
+endif
+ifdef MZSCHEME
+OBJ += $(OUTDIR)/if_mzsch.o
+MZSCHEME_INCL = if_mzsch.h
+ifeq (yes,$(MZSCHEME_GENERATE_BASE))
+CFLAGS += -DINCLUDE_MZSCHEME_BASE
+MZ_EXTRA_DEP += mzscheme_base.c
+endif
+ifeq (yes,$(MZSCHEME_PRECISE_GC))
+CFLAGS += -DMZ_PRECISE_GC
+endif
+endif
+ifdef PYTHON
+OBJ += $(OUTDIR)/if_python.o
+endif
+ifdef PYTHON3
+OBJ += $(OUTDIR)/if_python3.o
+endif
+ifdef RUBY
+OBJ += $(OUTDIR)/if_ruby.o
+endif
+ifdef TCL
+OBJ += $(OUTDIR)/if_tcl.o
+endif
+ifeq ($(CSCOPE),yes)
+OBJ += $(OUTDIR)/if_cscope.o
+endif
+ifeq ($(NETBEANS),yes)
+# Only allow NETBEANS for a GUI build.
+ifeq (yes, $(GUI))
+OBJ += $(OUTDIR)/netbeans.o
+LIB += -lwsock32
+endif
+endif
+ifeq ($(DIRECTX),yes)
+# Only allow DIRECTX for a GUI build.
+ifeq (yes, $(GUI))
+OBJ += $(OUTDIR)/gui_dwrite.o
+LIB += -ld2d1 -ldwrite
+USE_STDCPLUS = yes
+endif
+endif
+ifneq ($(XPM),no)
+# Only allow XPM for a GUI build.
+ifeq (yes, $(GUI))
+OBJ += $(OUTDIR)/xpm_w32.o
+# You'll need libXpm.a from http://gnuwin32.sf.net
+LIB += -L$(XPM)/lib -lXpm
+endif
+endif
+
+
+ifdef MZSCHEME
+MZSCHEME_SUFFIX = Z
+endif
+
+ifeq ($(GUI),yes)
+TARGET := gvim$(DEBUG_SUFFIX).exe
+DEFINES += $(DEF_GUI)
+OBJ += $(GUIOBJ)
+LFLAGS += -mwindows
+OUTDIR = gobj$(DEBUG_SUFFIX)$(MZSCHEME_SUFFIX)$(ARCH)
+else
+TARGET := vim$(DEBUG_SUFFIX).exe
+OUTDIR = obj$(DEBUG_SUFFIX)$(MZSCHEME_SUFFIX)$(ARCH)
+endif
+
+ifdef GETTEXT
+ifneq (yes, $(GETTEXT))
+CFLAGS += -I$(GETTEXTINCLUDE)
+ifndef STATIC_GETTEXT
+LIB += -L$(GETTEXTLIB) -l$(INTLLIB)
+ifeq (USE_SAFE_GETTEXT_DLL, $(DYNAMIC_GETTEXT))
+OBJ+=$(SAFE_GETTEXT_DLL_OBJ)
+endif
+else
+LIB += -L$(GETTEXTLIB) -lintl
+endif
+endif
+endif
+
+ifdef PERL
+ifeq (no, $(DYNAMIC_PERL))
+LIB += -L$(PERLLIBS) -lperl$(PERL_VER)
+endif
+endif
+
+ifdef TCL
+LIB += -L$(TCL)/lib
+ifeq (yes, $(DYNAMIC_TCL))
+LIB += -ltclstub$(TCL_VER)
+else
+LIB += -ltcl$(TCL_VER)
+endif
+endif
+
+ifeq (yes, $(OLE))
+LIB += -loleaut32
+OBJ += $(OUTDIR)/if_ole.o
+USE_STDCPLUS = yes
+endif
+
+ifeq (yes, $(MBYTE))
+DEFINES += -DFEAT_MBYTE
+endif
+
+ifeq (yes, $(IME))
+DEFINES += -DFEAT_MBYTE_IME
+ifeq (yes, $(DYNAMIC_IME))
+DEFINES += -DDYNAMIC_IME
+else
+LIB += -limm32
+endif
+endif
+
+ifdef ICONV
+ifneq (yes, $(ICONV))
+LIB += -L$(ICONV)
+CFLAGS += -I$(ICONV)
+endif
+DEFINES+=-DDYNAMIC_ICONV
+endif
+
+ifeq (yes, $(USE_STDCPLUS))
+ifeq (yes, $(STATIC_STDCPLUS))
+LIB += -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
+else
+LIB += -lstdc++
+endif
+endif
+
+all: $(TARGET) vimrun.exe xxd/xxd.exe install.exe uninstal.exe GvimExt/gvimext.dll
+
+vimrun.exe: vimrun.c
+ $(CC) $(CFLAGS) -o vimrun.exe vimrun.c $(LIB)
+
+install.exe: dosinst.c
+ $(CC) $(CFLAGS) -o install.exe dosinst.c $(LIB) -lole32 -luuid
+
+uninstal.exe: uninstal.c
+ $(CC) $(CFLAGS) -o uninstal.exe uninstal.c $(LIB)
+
+$(TARGET): $(OUTDIR) $(OBJ)
+ $(CC) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB)
+
+upx: exes
+ upx gvim.exe
+ upx vim.exe
+
+mpress: exes
+ mpress gvim.exe
+ mpress vim.exe
+
+xxd/xxd.exe: xxd/xxd.c
+ $(MAKE) -C xxd -f Make_ming.mak CC='$(CC)'
+
+GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
+ $(MAKE) -C GvimExt -f Make_ming.mak CROSS=$(CROSS) CROSS_COMPILE=$(CROSS_COMPILE) CXX='$(CXX)' STATIC_STDCPLUS=$(STATIC_STDCPLUS)
+
+clean:
+ -$(DEL) $(OUTDIR)$(DIRSLASH)*.o
+ -$(DEL) $(OUTDIR)$(DIRSLASH)*.res
+ -rmdir $(OUTDIR)
+ -$(DEL) *.exe
+ -$(DEL) pathdef.c
+ifdef PERL
+ -$(DEL) if_perl.c
+endif
+ifdef MZSCHEME
+ -$(DEL) mzscheme_base.c
+endif
+ $(MAKE) -C GvimExt -f Make_ming.mak clean
+ $(MAKE) -C xxd -f Make_ming.mak clean
+
+###########################################################################
+INCL = vim.h feature.h os_win32.h os_dos.h ascii.h keymap.h term.h macros.h \
+ structs.h regexp.h option.h ex_cmds.h proto.h globals.h farsi.h \
+ gui.h
+
+$(OUTDIR)/if_python.o : if_python.c if_py_both.h $(INCL)
+ $(CC) -c $(CFLAGS) $(PYTHONINC) -DDYNAMIC_PYTHON_DLL=\"python$(PYTHON_VER).dll\" $< -o $@
+
+$(OUTDIR)/if_python3.o : if_python3.c if_py_both.h $(INCL)
+ $(CC) -c $(CFLAGS) $(PYTHON3INC) -DDYNAMIC_PYTHON3_DLL=\"PYTHON$(PYTHON3_VER).dll\" $< -o $@
+
+$(OUTDIR)/%.o : %.c $(INCL)
+ $(CC) -c $(CFLAGS) $< -o $@
+
+$(OUTDIR)/vimrc.o: vim.rc version.h gui_w32_rc.h
+ $(WINDRES) $(WINDRES_FLAGS) $(DEFINES) \
+ --input-format=rc --output-format=coff -i vim.rc -o $@
+
+$(OUTDIR):
+ $(MKDIR) $(OUTDIR)
+
+$(OUTDIR)/ex_docmd.o: ex_docmd.c $(INCL) ex_cmds.h
+ $(CC) -c $(CFLAGS) ex_docmd.c -o $(OUTDIR)/ex_docmd.o
+
+$(OUTDIR)/ex_eval.o: ex_eval.c $(INCL) ex_cmds.h
+ $(CC) -c $(CFLAGS) ex_eval.c -o $(OUTDIR)/ex_eval.o
+
+$(OUTDIR)/gui_w32.o: gui_w32.c gui_w48.c $(INCL)
+ $(CC) -c $(CFLAGS) gui_w32.c -o $(OUTDIR)/gui_w32.o
+
+$(OUTDIR)/gui_dwrite.o: gui_dwrite.cpp $(INCL) gui_dwrite.h
+ $(CC) -c $(CFLAGS) gui_dwrite.cpp -o $(OUTDIR)/gui_dwrite.o
+
+$(OUTDIR)/if_cscope.o: if_cscope.c $(INCL) if_cscope.h
+ $(CC) -c $(CFLAGS) if_cscope.c -o $(OUTDIR)/if_cscope.o
+
+# Remove -D__IID_DEFINED__ for newer versions of the w32api
+$(OUTDIR)/if_ole.o: if_ole.cpp $(INCL)
+ $(CC) $(CFLAGS) -c -o $(OUTDIR)/if_ole.o if_ole.cpp
+
+$(OUTDIR)/if_ruby.o: if_ruby.c $(INCL)
+ifeq (16, $(RUBY))
+ $(CC) $(CFLAGS) -U_WIN32 -c -o $(OUTDIR)/if_ruby.o if_ruby.c
+endif
+
+if_perl.c: if_perl.xs typemap
+ $(XSUBPP) -prototypes -typemap \
+ $(PERLTYPEMAP) if_perl.xs > $@
+
+$(OUTDIR)/netbeans.o: netbeans.c $(INCL) $(NBDEBUG_INCL) $(NBDEBUG_SRC)
+ $(CC) -c $(CFLAGS) netbeans.c -o $(OUTDIR)/netbeans.o
+
+$(OUTDIR)/regexp.o: regexp.c regexp_nfa.c $(INCL)
+ $(CC) -c $(CFLAGS) regexp.c -o $(OUTDIR)/regexp.o
+
+$(OUTDIR)/if_mzsch.o: if_mzsch.c $(INCL) if_mzsch.h $(MZ_EXTRA_DEP)
+ $(CC) -c $(CFLAGS) if_mzsch.c -o $(OUTDIR)/if_mzsch.o
+
+mzscheme_base.c:
+ $(MZSCHEME)/mzc --c-mods mzscheme_base.c ++lib scheme/base
+
+pathdef.c: $(INCL)
+ifneq (sh.exe, $(SHELL))
+ @echo creating pathdef.c
+ @echo '/* pathdef.c */' > pathdef.c
+ @echo '#include "vim.h"' >> pathdef.c
+ @echo 'char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)";' >> pathdef.c
+ @echo 'char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)";' >> pathdef.c
+ @echo 'char_u *all_cflags = (char_u *)"$(CC) $(CFLAGS)";' >> pathdef.c
+ @echo 'char_u *all_lflags = (char_u *)"$(CC) $(CFLAGS) $(LFLAGS) -o $(TARGET) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB)";' >> pathdef.c
+ @echo 'char_u *compiled_user = (char_u *)"$(USERNAME)";' >> pathdef.c
+ @echo 'char_u *compiled_sys = (char_u *)"$(USERDOMAIN)";' >> pathdef.c
+else
+ @echo creating pathdef.c
+ @echo /* pathdef.c */ > pathdef.c
+ @echo #include "vim.h" >> pathdef.c
+ @echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)"; >> pathdef.c
+ @echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)"; >> pathdef.c
+ @echo char_u *all_cflags = (char_u *)"$(CC) $(CFLAGS)"; >> pathdef.c
+ @echo char_u *all_lflags = (char_u *)"$(CC) $(CFLAGS) $(LFLAGS) -o $(TARGET) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB)"; >> pathdef.c
+ @echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> pathdef.c
+ @echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> pathdef.c
+endif
diff --git a/src/Make_dice.mak b/src/Make_dice.mak
index e3a8b9e0f..890f15d09 100644
--- a/src/Make_dice.mak
+++ b/src/Make_dice.mak
@@ -29,6 +29,8 @@ SRC = \
blowfish.c \
buffer.c \
charset.c \
+ crypt.c \
+ crypt_zip.c \
diff.c \
digraph.c \
edit.c \
@@ -75,6 +77,8 @@ SRC = \
OBJ = o/blowfish.o \
o/buffer.o \
o/charset.o \
+ o/crypt.o \
+ o/crypt_zip.o \
o/diff.o \
o/digraph.o \
o/edit.o \
@@ -143,6 +147,10 @@ o/buffer.o: buffer.c $(SYMS)
o/charset.o: charset.c $(SYMS)
+o/crypt.o: crypt.c $(SYMS)
+
+o/crypt_zip.o: crypt_zip.c $(SYMS)
+
o/diff.o: diff.c $(SYMS)
o/digraph.o: digraph.c $(SYMS)
diff --git a/src/Make_djg.mak b/src/Make_djg.mak
index f2e7c8271..1a9234476 100644
--- a/src/Make_djg.mak
+++ b/src/Make_djg.mak
@@ -22,6 +22,8 @@ OBJ = \
obj/blowfish.o \
obj/buffer.o \
obj/charset.o \
+ obj/crypt.o \
+ obj/crypt_zip.o \
obj/diff.o \
obj/digraph.o \
obj/edit.o \
diff --git a/src/Make_ivc.mak b/src/Make_ivc.mak
index 16589ea8a..a891a9743 100644
--- a/src/Make_ivc.mak
+++ b/src/Make_ivc.mak
@@ -213,6 +213,8 @@ LINK32_OBJS= \
"$(INTDIR)/blowfish.obj" \
"$(INTDIR)/buffer.obj" \
"$(INTDIR)/charset.obj" \
+ "$(INTDIR)/crypt.obj" \
+ "$(INTDIR)/crypt_zip.obj" \
"$(INTDIR)/diff.obj" \
"$(INTDIR)/digraph.obj" \
"$(INTDIR)/edit.obj" \
@@ -339,6 +341,14 @@ SOURCE=.\charset.c
# End Source File
# Begin Source File
+SOURCE=.\crypt.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\crypt_zip.c
+# End Source File
+# Begin Source File
+
SOURCE=.\diff.c
# End Source File
# Begin Source File
diff --git a/src/Make_manx.mak b/src/Make_manx.mak
index 101c5c6b3..6305cd381 100644
--- a/src/Make_manx.mak
+++ b/src/Make_manx.mak
@@ -37,6 +37,8 @@ DEL = $(SHELL) -c rm -f
SRC = blowfish.c \
buffer.c \
charset.c \
+ crypt.c \
+ crypt_zip.c \
diff.c \
digraph.c \
edit.c \
@@ -85,6 +87,8 @@ INCL = vim.h feature.h keymap.h macros.h ascii.h term.h structs.h os_amiga.h
OBJ = obj/blowfish.o \
obj/buffer.o \
obj/charset.o \
+ obj/crypt.o \
+ obj/crypt_zip.o \
obj/diff.o \
obj/digraph.o \
obj/edit.o \
@@ -131,6 +135,8 @@ OBJ = obj/blowfish.o \
PRO = proto/blowfish.pro \
proto/buffer.pro \
proto/charset.pro \
+ proto/crypt.pro \
+ proto/crypt_zip.pro \
proto/diff.pro \
proto/digraph.pro \
proto/edit.pro \
@@ -227,6 +233,12 @@ obj/buffer.o: buffer.c
obj/charset.o: charset.c
$(CCSYM) $@ charset.c
+obj/crypt.o: crypt.c
+ $(CCSYM) $@ crypt.c
+
+obj/crypt_zip.o: crypt_zip.c
+ $(CCSYM) $@ crypt_zip.c
+
obj/diff.o: diff.c
$(CCSYM) $@ diff.c
diff --git a/src/Make_ming.mak b/src/Make_ming.mak
index f7088ad58..9ed1a7000 100644
--- a/src/Make_ming.mak
+++ b/src/Make_ming.mak
@@ -1,191 +1,27 @@
-# Makefile for VIM on Win32
#
-# Info at http://www.mingw.org
-# Alternative x86 and 64-builds: http://mingw-w64.sourceforge.net
-# Also requires GNU make, which you can download from the same sites.
-# Get missing libraries from http://gnuwin32.sf.net.
+# Makefile for VIM on Win32, using MinGW
#
-# Tested on Win32 NT 4 and Win95.
+# Also read INSTALLpc.txt!
#
-# To make everything, just 'make -f Make_ming.mak'.
-# To make just e.g. gvim.exe, 'make -f Make_ming.mak gvim.exe'.
-# After a run, you can 'make -f Make_ming.mak clean' to clean up.
+# The old Make_ming.mak (maintained by Ron Aaron et al.) was merged into
+# Make_cyg_ming.mak.
+# This file contains MinGW specific settings. Common settings are contained
+# in Make_cyg_ming.mak.
#
-# NOTE: Sometimes 'GNU Make' will stop after building vimrun.exe -- I think
-# it's just run out of memory or something. Run again, and it will continue
-# with 'xxd'.
-#
-# "make upx" makes *compressed* versions of the 32 bit GUI and console EXEs,
-# using the excellent UPX compressor:
-# http://upx.sourceforge.net/
-# "make mpress" uses the MPRESS compressor for 32- and 64-bit EXEs:
-# http://www.matcode.com/mpress.htm
-#
-# Maintained by Ron Aaron <ronaharon@yahoo.com> et al.
-# Updated 2012 Sep 5.
-
-#>>>>> choose options:
-# set to yes for a debug build
-DEBUG=no
-# set to SIZE for size, SPEED for speed, MAXSPEED for maximum optimization
-OPTIMIZE=MAXSPEED
-# set to yes to make gvim, no for vim
-GUI=yes
-# FEATURES=[TINY | SMALL | NORMAL | BIG | HUGE]
-# Set to TINY to make minimal version (few features).
-FEATURES=BIG
-# Set to one of i386, i486, i586, i686 as the minimum target processor.
-# For amd64/x64 architecture set ARCH=x86-64 .
-ARCH=i386
-# Set to yes to cross-compile from unix; no=native Windows.
-CROSS=no
-# Set to path to iconv.h and libiconv.a to enable using 'iconv.dll'.
-#ICONV="."
-ICONV=yes
-GETTEXT=yes
-# Set to yes to include multibyte support.
-MBYTE=yes
-# Set to yes to include IME support.
-IME=yes
-DYNAMIC_IME=yes
-# Set to yes to enable writing a postscript file with :hardcopy.
-POSTSCRIPT=no
-# Set to yes to enable OLE support.
-OLE=no
-# Set the default $(WINVER) to make it work with pre-Win2k.
-ifndef WINVER
-WINVER = 0x0500
-endif
-# Set to yes to enable Cscope support.
-CSCOPE=yes
-# Set to yes to enable Netbeans support.
-NETBEANS=$(GUI)
-
-
-# Link against the shared version of libstdc++ by default. Set
-# STATIC_STDCPLUS to "yes" to link against static version instead.
-ifndef STATIC_STDCPLUS
-STATIC_STDCPLUS=no
-endif
-
-# If the user doesn't want gettext, undefine it.
-ifeq (no, $(GETTEXT))
-GETTEXT=
-endif
-# Added by E.F. Amatria <eferna1@platea.ptic.mec.es> 2001 Feb 23
-# Uncomment the first line and one of the following three if you want Native Language
-# Support. You'll need gnu_gettext.win32, a MINGW32 Windows PORT of gettext by
-# Franco Bez <franco.bez@gmx.de>. It may be found at
-# http://home.a-city.de/franco.bez/gettext/gettext_win32_en.html
-# Tested with mingw32 with GCC-2.95.2 on Win98
-# Updated 2001 Jun 9
-#GETTEXT=c:/gettext.win32.msvcrt
-#STATIC_GETTEXT=USE_STATIC_GETTEXT
-#DYNAMIC_GETTEXT=USE_GETTEXT_DLL
-#DYNAMIC_GETTEXT=USE_SAFE_GETTEXT_DLL
-SAFE_GETTEXT_DLL_OBJ = $(GETTEXT)/src/safe_gettext_dll/safe_gettext_dll.o
-# Alternatively, if you uncomment the two following lines, you get a "safe" version
-# without linking the safe_gettext_dll.o object file.
-#DYNAMIC_GETTEXT=DYNAMIC_GETTEXT
-#GETTEXT_DYNAMIC=gnu_gettext.dll
-INTLPATH=$(GETTEXT)/lib/mingw32
-INTLLIB=gnu_gettext
+# Last updated by Ken Takata.
+# Last Change: 2014 Oct 21
-# If you are using gettext-0.10.35 from http://sourceforge.net/projects/gettext
-# or gettext-0.10.37 from http://sourceforge.net/projects/mingwrep/
-# uncomment the following, but I can't build a static version with them, ?-(|
-#GETTEXT=c:/gettext-0.10.37-20010430
-#STATIC_GETTEXT=USE_STATIC_GETTEXT
-#DYNAMIC_GETTEXT=DYNAMIC_GETTEXT
-#INTLPATH=$(GETTEXT)/lib
-#INTLLIB=intl
# uncomment 'PERL' if you want a perl-enabled version
-#PERL=C:/perl
-ifdef PERL
-ifndef PERL_VER
-PERL_VER=56
-endif
-ifndef DYNAMIC_PERL
-DYNAMIC_PERL=yes
-endif
-# on Linux, for cross-compile, it's here:
-#PERLLIB=/home/ron/ActivePerl/lib
-# on NT, it's here:
-PERLLIB=$(PERL)/lib
-PERLLIBS=$(PERLLIB)/Core
-XSUBPPTRY=$(PERLLIB)/ExtUtils/xsubpp
-XSUBPP_EXISTS=$(shell perl -e "print 1 unless -e '$(XSUBPPTRY)'")
-ifeq "$(XSUBPP_EXISTS)" ""
-XSUBPP=perl $(XSUBPPTRY)
-else
-XSUBPP=xsubpp
-endif
-endif
+#PERL=c:/perl
# uncomment 'LUA' if you want a Lua-enabled version
-#LUA=/usr/local
-ifdef LUA
-ifndef DYNAMIC_LUA
-DYNAMIC_LUA=yes
-endif
-
-ifndef LUA_VER
-LUA_VER=51
-endif
-
-ifeq (no,$(DYNAMIC_LUA))
-LUA_LIB = -L$(LUA)/lib -llua
-endif
-
-endif
+#LUA=c:/lua
# uncomment 'MZSCHEME' if you want a MzScheme-enabled version
#MZSCHEME=d:/plt
-ifdef MZSCHEME
-ifndef DYNAMIC_MZSCHEME
-DYNAMIC_MZSCHEME=yes
-endif
-
-ifndef MZSCHEME_VER
-MZSCHEME_VER=205_000
-endif
-
-ifndef MZSCHEME_PRECISE_GC
-MZSCHEME_PRECISE_GC=no
-endif
-# for version 4.x we need to generate byte-code for Scheme base
-ifndef MZSCHEME_GENERATE_BASE
-MZSCHEME_GENERATE_BASE=no
-endif
-
-ifndef MZSCHEME_USE_RACKET
-MZSCHEME_MAIN_LIB=mzsch
-else
-MZSCHEME_MAIN_LIB=racket
-endif
-
-ifeq (no,$(DYNAMIC_MZSCHEME))
-ifeq (yes,$(MZSCHEME_PRECISE_GC))
-MZSCHEME_LIB=-l$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER)
-else
-MZSCHEME_LIB = -l$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER) -lmzgc$(MZSCHEME_VER)
-endif
-# the modern MinGW can dynamically link to dlls directly.
-# point MZSCHEME_DLLS to where you put libmzschXXXXXXX.dll and libgcXXXXXXX.dll
-ifndef MZSCHEME_DLLS
-MZSCHEME_DLLS=$(MZSCHEME)
-endif
-MZSCHEME_LIBDIR=-L$(MZSCHEME_DLLS) -L$(MZSCHEME_DLLS)\lib
-endif
-
-endif
-
-# Python support -- works with the ActiveState python 2.0 release (and others
-# too, probably)
-#
-# uncomment 'PYTHON' to make python-enabled version
+# uncomment 'PYTHON' if you want a python-enabled version
# Put the path to the python distro here. If cross compiling from Linux, you
# will also need to convert the header files to unix instead of dos format:
# for fil in *.h ; do vim -e -c 'set ff=unix|w|q' $fil
@@ -198,606 +34,16 @@ endif
# on my NT box, it's here:
#PYTHON=c:/python20
-ifdef PYTHON
-ifndef DYNAMIC_PYTHON
-DYNAMIC_PYTHON=yes
-endif
-
-ifndef PYTHON_VER
-PYTHON_VER=22
-endif
-
-ifeq (no,$(DYNAMIC_PYTHON))
-PYTHONLIB=-L$(PYTHON)/libs -lpython$(PYTHON_VER)
-endif
-# my include files are in 'win32inc' on Linux, and 'include' in the standard
-# NT distro (ActiveState)
-ifeq ($(CROSS),no)
-PYTHONINC=-I $(PYTHON)/include
-else
-PYTHONINC=-I $(PYTHON)/win32inc
-endif
-endif
-
-#PYTHON3: See comment for Python 2 above
-
-ifdef PYTHON3
-ifndef DYNAMIC_PYTHON3
-DYNAMIC_PYTHON3=yes
-endif
-
-ifndef PYTHON3_VER
-PYTHON3_VER=31
-endif
-
-ifeq (no,$(DYNAMIC_PYTHON3))
-PYTHON3LIB=-L$(PYTHON3)/libs -lPYTHON$(PYTHON3_VER)
-endif
+# uncomment 'PYTHON3' if you want a python3-enabled version
+#PYTHON3=c:/python31
-ifeq ($(CROSS),no)
-PYTHON3INC=-I $(PYTHON3)/include
-else
-PYTHON3INC=-I $(PYTHON3)/win32inc
-endif
-endif
-
-# TCL interface:
-# TCL=[Path to TCL directory]
-# DYNAMIC_TCL=yes (to load the TCL DLL dynamically)
-# TCL_VER=[TCL version, eg 83, 84] (default is 83)
+# uncomment 'TCL' if you want a Tcl-enabled version
#TCL=c:/tcl
-ifdef TCL
-ifndef DYNAMIC_TCL
-DYNAMIC_TCL=yes
-endif
-ifndef TCL_VER
-TCL_VER = 83
-endif
-TCLINC += -I$(TCL)/include
-endif
-
-# Ruby interface:
-# RUBY=[Path to Ruby directory]
-# DYNAMIC_RUBY=yes (to load the Ruby DLL dynamically)
-# RUBY_VER=[Ruby version, eg 16, 17] (default is 16)
-# RUBY_VER_LONG=[Ruby version, eg 1.6, 1.7] (default is 1.6)
-# You must set RUBY_VER_LONG when changing RUBY_VER.
-# You must set RUBY_API_VER version to RUBY_VER_LONG.
-# Don't set ruby API version to RUBY_VER like 191.
+# uncomment 'RUBY' if you want a Ruby-enabled version
#RUBY=c:/ruby
-ifdef RUBY
-ifndef DYNAMIC_RUBY
-DYNAMIC_RUBY=yes
-endif
-# Set default value
-ifndef RUBY_VER
-RUBY_VER = 16
-endif
-ifndef RUBY_VER_LONG
-RUBY_VER_LONG = 1.6
-endif
-ifndef RUBY_API_VER
-RUBY_API_VER = $(subst .,,$(RUBY_VER_LONG))
-endif
-
-ifndef RUBY_PLATFORM
-ifeq ($(RUBY_VER), 16)
-RUBY_PLATFORM = i586-mswin32
-else
-ifneq ($(wildcard $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/i386-mingw32),)
-RUBY_PLATFORM = i386-mingw32
-else
-ifneq ($(wildcard $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/x64-mingw32),)
-RUBY_PLATFORM = x64-mingw32
-else
-RUBY_PLATFORM = i386-mswin32
-endif
-endif
-endif
-endif
-
-ifndef RUBY_INSTALL_NAME
-ifeq ($(RUBY_VER), 16)
-RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_API_VER)
-else
-ifeq ($(ARCH),x86-64)
-RUBY_INSTALL_NAME = x64-msvcrt-ruby$(RUBY_API_VER)
-else
-RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_API_VER)
-endif
-endif
-endif
-
-ifeq (19, $(word 1,$(sort 19 $(RUBY_VER))))
-RUBY_19_OR_LATER = 1
-endif
-
-RUBYINC = -I $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/$(RUBY_PLATFORM)
-ifdef RUBY_19_OR_LATER
-RUBYINC += -I $(RUBY)/include/ruby-$(RUBY_VER_LONG) -I $(RUBY)/include/ruby-$(RUBY_VER_LONG)/$(RUBY_PLATFORM)
-endif
-ifeq (no, $(DYNAMIC_RUBY))
-RUBYLIB = -L$(RUBY)/lib -l$(RUBY_INSTALL_NAME)
-endif
-
-endif # RUBY
-
-# See feature.h for a list of options.
-# Any other defines can be included here.
-DEF_GUI=-DFEAT_GUI_W32 -DFEAT_CLIPBOARD
-DEFINES=-DWIN32 -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) \
- -DHAVE_PATHDEF -DFEAT_$(FEATURES)
-ifeq ($(ARCH),x86-64)
-DEFINES+=-DMS_WIN64
-endif
-ifeq ($(CROSS),yes)
-# cross-compiler prefix:
-CROSS_COMPILE = i586-pc-mingw32msvc-
-DEL = rm
-MKDIR = mkdir -p
-DIRSLASH = /
-else
-# normal (Windows) compilation:
-CROSS_COMPILE =
-ifneq (sh.exe, $(SHELL))
-DEL = rm
-MKDIR = mkdir -p
-DIRSLASH = /
-else
-DEL = del
-MKDIR = mkdir
-DIRSLASH = \\
-endif
-endif
-CC := $(CROSS_COMPILE)gcc
-WINDRES := $(CROSS_COMPILE)windres
-WINDRES_CC = $(CC)
-
-#>>>>> end of choices
-###########################################################################
-
-CFLAGS = -Iproto $(DEFINES) -pipe -w -march=$(ARCH) -Wall
-WINDRES_FLAGS = --preprocessor="$(WINDRES_CC) -E -xc" -DRC_INVOKED
-EXTRA_LIBS =
-
-ifdef GETTEXT
-DEFINES += -DHAVE_GETTEXT -DHAVE_LOCALE_H
-GETTEXTINCLUDE = $(GETTEXT)/include
-GETTEXTLIB = $(INTLPATH)
-ifeq (yes, $(GETTEXT))
-DEFINES += -DDYNAMIC_GETTEXT
-else
-ifdef DYNAMIC_GETTEXT
-DEFINES += -D$(DYNAMIC_GETTEXT)
-ifdef GETTEXT_DYNAMIC
-DEFINES += -DGETTEXT_DYNAMIC -DGETTEXT_DLL=\"$(GETTEXT_DYNAMIC)\"
-endif
-endif
-endif
-endif
-
-ifdef PERL
-CFLAGS += -I$(PERLLIBS) -DFEAT_PERL
-ifeq (yes, $(DYNAMIC_PERL))
-CFLAGS += -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl$(PERL_VER).dll\"
-EXTRA_LIBS += -L$(PERLLIBS) -lperl$(PERL_VER)
-endif
-endif
-
-ifdef LUA
-CFLAGS += -I$(LUA)/include -DFEAT_LUA
-ifeq (yes, $(DYNAMIC_LUA))
-CFLAGS += -DDYNAMIC_LUA -DDYNAMIC_LUA_DLL=\"lua$(LUA_VER).dll\"
-endif
-endif
-
-ifdef MZSCHEME
-CFLAGS += -I$(MZSCHEME)/include -DFEAT_MZSCHEME -DMZSCHEME_COLLECTS=\"$(MZSCHEME)/collects\"
-ifeq (yes, $(DYNAMIC_MZSCHEME))
-CFLAGS += -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\" -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\"
-endif
-ifeq (yes, "$(MZSCHEME_DEBUG)")
-CFLAGS += -DMZSCHEME_FORCE_GC
-endif
-endif
-
-ifdef RUBY
-CFLAGS += -DFEAT_RUBY $(RUBYINC)
-ifeq (yes, $(DYNAMIC_RUBY))
-CFLAGS += -DDYNAMIC_RUBY -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\"
-CFLAGS += -DDYNAMIC_RUBY_VER=$(RUBY_VER)
-endif
-endif
-
-ifdef PYTHON
-CFLAGS += -DFEAT_PYTHON
-ifeq (yes, $(DYNAMIC_PYTHON))
-CFLAGS += -DDYNAMIC_PYTHON
-endif
-endif
-
-ifdef PYTHON3
-CFLAGS += -DFEAT_PYTHON3
-ifeq (yes, $(DYNAMIC_PYTHON3))
-CFLAGS += -DDYNAMIC_PYTHON3
-endif
-endif
-
-ifdef TCL
-CFLAGS += -DFEAT_TCL $(TCLINC)
-ifeq (yes, $(DYNAMIC_TCL))
-CFLAGS += -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl$(TCL_VER).dll\"
-endif
-endif
-
-ifeq ($(POSTSCRIPT),yes)
-DEFINES += -DMSWINPS
-endif
-
-ifeq (yes, $(OLE))
-DEFINES += -DFEAT_OLE
-endif
-
-ifeq ($(CSCOPE),yes)
-DEFINES += -DFEAT_CSCOPE
-endif
-
-ifeq ($(NETBEANS),yes)
-# Only allow NETBEANS for a GUI build.
-ifeq (yes, $(GUI))
-DEFINES += -DFEAT_NETBEANS_INTG
-
-ifeq ($(NBDEBUG), yes)
-DEFINES += -DNBDEBUG
-NBDEBUG_INCL = nbdebug.h
-NBDEBUG_SRC = nbdebug.c
-endif
-endif
-endif
-
-# Only allow XPM for a GUI build.
-ifeq (yes, $(GUI))
-
-ifndef XPM
-ifeq ($(ARCH),i386)
-XPM = xpm/x86
-endif
-ifeq ($(ARCH),i486)
-XPM = xpm/x86
-endif
-ifeq ($(ARCH),i586)
-XPM = xpm/x86
-endif
-ifeq ($(ARCH),i686)
-XPM = xpm/x86
-endif
-ifeq ($(ARCH),x86-64)
-XPM = xpm/x64
-endif
-endif
-ifdef XPM
-ifneq ($(XPM),no)
-CFLAGS += -DFEAT_XPM_W32 -I $(XPM)/include -I $(XPM)/../include
-endif
-endif
-
-endif
-
-ifeq ($(DEBUG),yes)
-CFLAGS += -g -fstack-check
-DEBUG_SUFFIX=d
-else
-ifeq ($(OPTIMIZE), SIZE)
-CFLAGS += -Os
-else
-ifeq ($(OPTIMIZE), MAXSPEED)
-CFLAGS += -O3
-CFLAGS += -fomit-frame-pointer -freg-struct-return
-else # SPEED
-CFLAGS += -O2
-endif
-endif
-CFLAGS += -s
-endif
-
-LIB = -lkernel32 -luser32 -lgdi32 -ladvapi32 -lcomdlg32 -lcomctl32 -lversion
-GUIOBJ = $(OUTDIR)/gui.o $(OUTDIR)/gui_w32.o $(OUTDIR)/gui_beval.o $(OUTDIR)/os_w32exe.o
-OBJ = \
- $(OUTDIR)/blowfish.o \
- $(OUTDIR)/buffer.o \
- $(OUTDIR)/charset.o \
- $(OUTDIR)/diff.o \
- $(OUTDIR)/digraph.o \
- $(OUTDIR)/edit.o \
- $(OUTDIR)/eval.o \
- $(OUTDIR)/ex_cmds.o \
- $(OUTDIR)/ex_cmds2.o \
- $(OUTDIR)/ex_docmd.o \
- $(OUTDIR)/ex_eval.o \
- $(OUTDIR)/ex_getln.o \
- $(OUTDIR)/fileio.o \
- $(OUTDIR)/fold.o \
- $(OUTDIR)/getchar.o \
- $(OUTDIR)/hardcopy.o \
- $(OUTDIR)/hashtab.o \
- $(OUTDIR)/main.o \
- $(OUTDIR)/mark.o \
- $(OUTDIR)/memfile.o \
- $(OUTDIR)/memline.o \
- $(OUTDIR)/menu.o \
- $(OUTDIR)/message.o \
- $(OUTDIR)/misc1.o \
- $(OUTDIR)/misc2.o \
- $(OUTDIR)/move.o \
- $(OUTDIR)/mbyte.o \
- $(OUTDIR)/normal.o \
- $(OUTDIR)/ops.o \
- $(OUTDIR)/option.o \
- $(OUTDIR)/os_win32.o \
- $(OUTDIR)/os_mswin.o \
- $(OUTDIR)/winclip.o \
- $(OUTDIR)/pathdef.o \
- $(OUTDIR)/popupmnu.o \
- $(OUTDIR)/quickfix.o \
- $(OUTDIR)/regexp.o \
- $(OUTDIR)/screen.o \
- $(OUTDIR)/search.o \
- $(OUTDIR)/sha256.o \
- $(OUTDIR)/spell.o \
- $(OUTDIR)/syntax.o \
- $(OUTDIR)/tag.o \
- $(OUTDIR)/term.o \
- $(OUTDIR)/ui.o \
- $(OUTDIR)/undo.o \
- $(OUTDIR)/version.o \
- $(OUTDIR)/vimrc.o \
- $(OUTDIR)/window.o
-
-ifdef PERL
-OBJ += $(OUTDIR)/if_perl.o
-endif
-ifdef LUA
-OBJ += $(OUTDIR)/if_lua.o
-endif
-ifdef MZSCHEME
-OBJ += $(OUTDIR)/if_mzsch.o
-MZSCHEME_INCL = if_mzsch.h
-ifeq (yes,$(MZSCHEME_GENERATE_BASE))
-CFLAGS += -DINCLUDE_MZSCHEME_BASE
-MZ_EXTRA_DEP += mzscheme_base.c
-endif
-ifeq (yes,$(MZSCHEME_PRECISE_GC))
-CFLAGS += -DMZ_PRECISE_GC
-endif
-endif
-ifdef PYTHON
-OBJ += $(OUTDIR)/if_python.o
-endif
-ifdef PYTHON3
-OBJ += $(OUTDIR)/if_python3.o
-endif
-ifdef RUBY
-OBJ += $(OUTDIR)/if_ruby.o
-endif
-ifdef TCL
-OBJ += $(OUTDIR)/if_tcl.o
-endif
-ifeq ($(CSCOPE),yes)
-OBJ += $(OUTDIR)/if_cscope.o
-endif
-ifeq ($(NETBEANS),yes)
-# Only allow NETBEANS for a GUI build.
-ifeq (yes, $(GUI))
-OBJ += $(OUTDIR)/netbeans.o
-LIB += -lwsock32
-endif
-endif
-ifdef XPM
-# Only allow XPM for a GUI build.
-ifeq (yes, $(GUI))
-OBJ += $(OUTDIR)/xpm_w32.o
-# You'll need libXpm.a from http://gnuwin32.sf.net
-LIB += -L$(XPM)/lib -lXpm
-endif
-endif
-
-
-ifdef MZSCHEME
-MZSCHEME_SUFFIX = Z
-endif
-
-ifeq ($(GUI),yes)
-TARGET := gvim$(DEBUG_SUFFIX).exe
-DEFINES += $(DEF_GUI)
-OBJ += $(GUIOBJ)
-LFLAGS += -mwindows
-OUTDIR = gobj$(DEBUG_SUFFIX)$(MZSCHEME_SUFFIX)$(ARCH)
-else
-TARGET := vim$(DEBUG_SUFFIX).exe
-OUTDIR = obj$(DEBUG_SUFFIX)$(MZSCHEME_SUFFIX)$(ARCH)
-endif
-
-ifdef GETTEXT
-ifneq (yes, $(GETTEXT))
-CFLAGS += -I$(GETTEXTINCLUDE)
-ifndef STATIC_GETTEXT
-LIB += -L$(GETTEXTLIB) -l$(INTLLIB)
-ifeq (USE_SAFE_GETTEXT_DLL, $(DYNAMIC_GETTEXT))
-OBJ+=$(SAFE_GETTEXT_DLL_OBJ)
-endif
-else
-LIB += -L$(GETTEXTLIB) -lintl
-endif
-endif
-endif
-
-ifdef PERL
-ifeq (no, $(DYNAMIC_PERL))
-LIB += -L$(PERLLIBS) -lperl$(PERL_VER)
-endif
-endif
-
-ifdef TCL
-LIB += -L$(TCL)/lib
-ifeq (yes, $(DYNAMIC_TCL))
-LIB += -ltclstub$(TCL_VER)
-else
-LIB += -ltcl$(TCL_VER)
-endif
-endif
-
-ifeq (yes, $(OLE))
-LIB += -loleaut32
-OBJ += $(OUTDIR)/if_ole.o
-ifeq (yes, $(STATIC_STDCPLUS))
-LIB += -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
-else
-LIB += -lstdc++
-endif
-endif
-
-ifeq (yes, $(MBYTE))
-DEFINES += -DFEAT_MBYTE
-endif
-
-ifeq (yes, $(IME))
-DEFINES += -DFEAT_MBYTE_IME
-ifeq (yes, $(DYNAMIC_IME))
-DEFINES += -DDYNAMIC_IME
-else
-LIB += -limm32
-endif
-endif
-
-ifdef ICONV
-ifneq (yes, $(ICONV))
-LIB += -L$(ICONV)
-CFLAGS += -I$(ICONV)
-endif
-DEFINES+=-DDYNAMIC_ICONV
-endif
-
-all: $(TARGET) vimrun.exe xxd/xxd.exe install.exe uninstal.exe GvimExt/gvimext.dll
-
-vimrun.exe: vimrun.c
- $(CC) $(CFLAGS) -o vimrun.exe vimrun.c $(LIB)
-
-install.exe: dosinst.c
- $(CC) $(CFLAGS) -o install.exe dosinst.c $(LIB) -lole32 -luuid
-
-uninstal.exe: uninstal.c
- $(CC) $(CFLAGS) -o uninstal.exe uninstal.c $(LIB)
-
-$(TARGET): $(OUTDIR) $(OBJ)
- $(CC) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB)
-
-upx: exes
- upx gvim.exe
- upx vim.exe
-
-mpress: exes
- mpress gvim.exe
- mpress vim.exe
-
-xxd/xxd.exe: xxd/xxd.c
- $(MAKE) -C xxd -f Make_ming.mak CC=$(CC)
-
-GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
- $(MAKE) -C GvimExt -f Make_ming.mak CROSS=$(CROSS) CROSS_COMPILE=$(CROSS_COMPILE)
-
-clean:
- -$(DEL) $(OUTDIR)$(DIRSLASH)*.o
- -$(DEL) $(OUTDIR)$(DIRSLASH)*.res
- -rmdir $(OUTDIR)
- -$(DEL) *.exe
- -$(DEL) pathdef.c
-ifdef PERL
- -$(DEL) if_perl.c
-endif
-ifdef MZSCHEME
- -$(DEL) mzscheme_base.c
-endif
- $(MAKE) -C GvimExt -f Make_ming.mak clean
- $(MAKE) -C xxd -f Make_ming.mak clean
-
-###########################################################################
-INCL = vim.h feature.h os_win32.h os_dos.h ascii.h keymap.h term.h macros.h \
- structs.h regexp.h option.h ex_cmds.h proto.h globals.h farsi.h \
- gui.h
-
-$(OUTDIR)/if_python.o : if_python.c if_py_both.h $(INCL)
- $(CC) -c $(CFLAGS) $(PYTHONINC) -DDYNAMIC_PYTHON_DLL=\"python$(PYTHON_VER).dll\" $< -o $@
-
-$(OUTDIR)/if_python3.o : if_python3.c if_py_both.h $(INCL)
- $(CC) -c $(CFLAGS) $(PYTHON3INC) -DDYNAMIC_PYTHON3_DLL=\"PYTHON$(PYTHON3_VER).dll\" $< -o $@
-
-$(OUTDIR)/%.o : %.c $(INCL)
- $(CC) -c $(CFLAGS) $< -o $@
-
-$(OUTDIR)/vimrc.o: vim.rc version.h gui_w32_rc.h
- $(WINDRES) $(WINDRES_FLAGS) $(DEFINES) \
- --input-format=rc --output-format=coff -i vim.rc -o $@
-
-$(OUTDIR):
- $(MKDIR) $(OUTDIR)
-
-$(OUTDIR)/ex_docmd.o: ex_docmd.c $(INCL) ex_cmds.h
- $(CC) -c $(CFLAGS) ex_docmd.c -o $(OUTDIR)/ex_docmd.o
-
-$(OUTDIR)/ex_eval.o: ex_eval.c $(INCL) ex_cmds.h
- $(CC) -c $(CFLAGS) ex_eval.c -o $(OUTDIR)/ex_eval.o
-
-$(OUTDIR)/gui_w32.o: gui_w32.c gui_w48.c $(INCL)
- $(CC) -c $(CFLAGS) gui_w32.c -o $(OUTDIR)/gui_w32.o
-
-$(OUTDIR)/if_cscope.o: if_cscope.c $(INCL) if_cscope.h
- $(CC) -c $(CFLAGS) if_cscope.c -o $(OUTDIR)/if_cscope.o
-
-# Remove -D__IID_DEFINED__ for newer versions of the w32api
-$(OUTDIR)/if_ole.o: if_ole.cpp $(INCL)
- $(CC) $(CFLAGS) -c -o $(OUTDIR)/if_ole.o if_ole.cpp
-
-$(OUTDIR)/if_ruby.o: if_ruby.c $(INCL)
-ifeq (16, $(RUBY))
- $(CC) $(CFLAGS) -U_WIN32 -c -o $(OUTDIR)/if_ruby.o if_ruby.c
-endif
-
-if_perl.c: if_perl.xs typemap
- $(XSUBPP) -prototypes -typemap \
- $(PERLLIB)/ExtUtils/typemap if_perl.xs > $@
-
-$(OUTDIR)/netbeans.o: netbeans.c $(INCL) $(NBDEBUG_INCL) $(NBDEBUG_SRC)
- $(CC) -c $(CFLAGS) netbeans.c -o $(OUTDIR)/netbeans.o
-
-$(OUTDIR)/regexp.o: regexp.c regexp_nfa.c $(INCL)
- $(CC) -c $(CFLAGS) regexp.c -o $(OUTDIR)/regexp.o
-
-$(OUTDIR)/if_mzsch.o: if_mzsch.c $(INCL) if_mzsch.h $(MZ_EXTRA_DEP)
- $(CC) -c $(CFLAGS) if_mzsch.c -o $(OUTDIR)/if_mzsch.o
-mzscheme_base.c:
- $(MZSCHEME)/mzc --c-mods mzscheme_base.c ++lib scheme/base
-pathdef.c: $(INCL)
-ifneq (sh.exe, $(SHELL))
- @echo creating pathdef.c
- @echo '/* pathdef.c */' > pathdef.c
- @echo '#include "vim.h"' >> pathdef.c
- @echo 'char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)";' >> pathdef.c
- @echo 'char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)";' >> pathdef.c
- @echo 'char_u *all_cflags = (char_u *)"$(CC) $(CFLAGS)";' >> pathdef.c
- @echo 'char_u *all_lflags = (char_u *)"$(CC) $(CFLAGS) $(LFLAGS) -o $(TARGET) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB)";' >> pathdef.c
- @echo 'char_u *compiled_user = (char_u *)"$(USERNAME)";' >> pathdef.c
- @echo 'char_u *compiled_sys = (char_u *)"$(USERDOMAIN)";' >> pathdef.c
-else
- @echo creating pathdef.c
- @echo /* pathdef.c */ > pathdef.c
- @echo #include "vim.h" >> pathdef.c
- @echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)"; >> pathdef.c
- @echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)"; >> pathdef.c
- @echo char_u *all_cflags = (char_u *)"$(CC) $(CFLAGS)"; >> pathdef.c
- @echo char_u *all_lflags = (char_u *)"$(CC) $(CFLAGS) $(LFLAGS) -o $(TARGET) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB)"; >> pathdef.c
- @echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> pathdef.c
- @echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> pathdef.c
-endif
+# Do not change this.
+UNDER_CYGWIN = no
+include Make_cyg_ming.mak
diff --git a/src/Make_morph.mak b/src/Make_morph.mak
index aa8fbd927..15a74773c 100644
--- a/src/Make_morph.mak
+++ b/src/Make_morph.mak
@@ -27,6 +27,8 @@ RM = rm
SRC = blowfish.c \
buffer.c \
charset.c \
+ crypt.c \
+ crypt_zip.c \
diff.c \
digraph.c \
edit.c \
diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak
index 4a979e419..f7517574c 100644
--- a/src/Make_mvc.mak
+++ b/src/Make_mvc.mak
@@ -24,6 +24,9 @@
#
# GUI interface: GUI=yes (default is no)
#
+# GUI with DirectWrite(DirectX): DIRECTX=yes
+# (default is no, requires GUI=yes)
+#
# OLE interface: OLE=yes (usually with GUI=yes)
#
# Multibyte support: MBYTE=yes (default is no)
@@ -47,13 +50,14 @@
# Perl interface:
# PERL=[Path to Perl directory]
# DYNAMIC_PERL=yes (to load the Perl DLL dynamically)
-# PERL_VER=[Perl version, in the form 55 (5.005), 56 (5.6.x), etc]
+# PERL_VER=[Perl version, in the form 55 (5.005), 56 (5.6.x),
+# 510 (5.10.x), etc]
# (default is 56)
#
# Python interface:
# PYTHON=[Path to Python directory]
# DYNAMIC_PYTHON=yes (to load the Python DLL dynamically)
-# PYTHON_VER=[Python version, eg 15, 20] (default is 22)
+# PYTHON_VER=[Python version, eg 22, 23, ..., 27] (default is 22)
#
# Python3 interface:
# PYTHON3=[Path to Python3 directory]
@@ -63,11 +67,13 @@
# Ruby interface:
# RUBY=[Path to Ruby directory]
# DYNAMIC_RUBY=yes (to load the Ruby DLL dynamically)
-# RUBY_VER=[Ruby version, eg 16, 17] (default is 18)
-# RUBY_VER_LONG=[Ruby version, eg 1.6, 1.7] (default is 1.8)
+# RUBY_VER=[Ruby version, eg 18, 19, 20] (default is 18)
+# RUBY_VER_LONG=[Ruby version, eg 1.8, 1.9.1, 2.0.0] (default is 1.8)
# You must set RUBY_VER_LONG when change RUBY_VER.
-# You must set RUBY_API_VER to RUBY_VER_LONG.
-# Don't set ruby API version to RUBY_VER like 191.
+# RUBY_API_VER is derived from RUBY_VER_LONG.
+# Note: If you use Ruby 1.9.3, set as follows:
+# RUBY_VER=19
+# RUBY_VER_LONG=1.9.1 (not 1.9.3, because the API version is 1.9.1.)
#
# Tcl interface:
# TCL=[Path to Tcl directory]
@@ -168,6 +174,9 @@ OBJDIR = .\ObjG
!else
OBJDIR = .\ObjC
!endif
+!if "$(DIRECTX)" == "yes"
+OBJDIR = $(OBJDIR)X
+!endif
!if "$(OLE)" == "yes"
OBJDIR = $(OBJDIR)O
!endif
@@ -292,6 +301,13 @@ NBDEBUG_SRC = nbdebug.c
NETBEANS_LIB = WSock32.lib
!endif
+# DirectWrite(DirectX)
+!if "$(DIRECTX)" == "yes"
+DIRECTX_DEFS = -DFEAT_DIRECTX -DDYNAMIC_DIRECTX
+DIRECTX_INCL = gui_dwrite.h
+DIRECTX_OBJ = $(OUTDIR)\gui_dwrite.obj
+!endif
+
!ifndef XPM
# XPM is not set, use the included xpm files, depending on the architecture.
!if "$(CPU)" == "AMD64"
@@ -534,6 +550,8 @@ OBJ = \
$(OUTDIR)\blowfish.obj \
$(OUTDIR)\buffer.obj \
$(OUTDIR)\charset.obj \
+ $(OUTDIR)\crypt.obj \
+ $(OUTDIR)\crypt_zip.obj \
$(OUTDIR)\diff.obj \
$(OUTDIR)\digraph.obj \
$(OUTDIR)\edit.obj \
@@ -642,6 +660,16 @@ GUI_LIB = \
SUBSYSTEM = console
!endif
+!if "$(SUBSYSTEM_VER)" != ""
+SUBSYSTEM = $(SUBSYSTEM),$(SUBSYSTEM_VER)
+!endif
+
+!if "$(GUI)" == "yes" && "$(DIRECTX)" == "yes"
+CFLAGS = $(CFLAGS) $(DIRECTX_DEFS)
+GUI_INCL = $(GUI_INCL) $(DIRECTX_INCL)
+GUI_OBJ = $(GUI_OBJ) $(DIRECTX_OBJ)
+!endif
+
# iconv.dll library (dynamically loaded)
!ifndef ICONV
ICONV = yes
@@ -1073,6 +1101,10 @@ $(OUTDIR)/buffer.obj: $(OUTDIR) buffer.c $(INCL)
$(OUTDIR)/charset.obj: $(OUTDIR) charset.c $(INCL)
+$(OUTDIR)/crypt.obj: $(OUTDIR) crypt.c $(INCL)
+
+$(OUTDIR)/crypt_zip.obj: $(OUTDIR) crypt_zip.c $(INCL)
+
$(OUTDIR)/diff.obj: $(OUTDIR) diff.c $(INCL)
$(OUTDIR)/digraph.obj: $(OUTDIR) digraph.c $(INCL)
@@ -1107,6 +1139,8 @@ $(OUTDIR)/gui_beval.obj: $(OUTDIR) gui_beval.c $(INCL) $(GUI_INCL)
$(OUTDIR)/gui_w32.obj: $(OUTDIR) gui_w32.c gui_w48.c $(INCL) $(GUI_INCL)
+$(OUTDIR)/gui_dwrite.obj: $(OUTDIR) gui_dwrite.cpp $(INCL) $(GUI_INCL)
+
$(OUTDIR)/if_cscope.obj: $(OUTDIR) if_cscope.c $(INCL)
$(OUTDIR)/if_lua.obj: $(OUTDIR) if_lua.c $(INCL)
@@ -1257,6 +1291,8 @@ proto.h: \
proto/blowfish.pro \
proto/buffer.pro \
proto/charset.pro \
+ proto/crypt.pro \
+ proto/crypt_zip.pro \
proto/diff.pro \
proto/digraph.pro \
proto/edit.pro \
diff --git a/src/Make_os2.mak b/src/Make_os2.mak
index 42dbdb346..cd62d1c6d 100644
--- a/src/Make_os2.mak
+++ b/src/Make_os2.mak
@@ -42,6 +42,8 @@ OBJ = \
blowfish.o \
buffer.o \
charset.o \
+ crypt.o \
+ crypt_zip.o \
diff.o \
digraph.o \
edit.o \
@@ -117,6 +119,8 @@ os_unix.o: os_unix.c $(INCL)
blowfish.o: blowfish.c $(INCL)
buffer.o: buffer.c $(INCL)
charset.o: charset.c $(INCL)
+crypt.o: crypt.c $(INCL)
+crypt_zip.o: crypt_zip.c $(INCL)
diff.o: diff.c $(INCL)
digraph.o: digraph.c $(INCL)
edit.o: edit.c $(INCL)
diff --git a/src/Make_sas.mak b/src/Make_sas.mak
index bf57c0dcb..49dcb6bdc 100644
--- a/src/Make_sas.mak
+++ b/src/Make_sas.mak
@@ -92,6 +92,8 @@ SRC = \
blowfish.c \
buffer.c \
charset.c \
+ crypt.c \
+ crypt_zip.c \
diff.c \
digraph.c \
edit.c \
@@ -139,6 +141,8 @@ OBJ = \
blowfish.o \
buffer.o \
charset.o \
+ crypt.o \
+ crypt_zip.o \
diff.o \
digraph.o \
edit.o \
@@ -186,6 +190,8 @@ PRO = \
proto/blowfish.pro \
proto/buffer.pro \
proto/charset.pro \
+ proto/crypt.pro \
+ proto/crypt_zip.pro \
proto/diff.pro \
proto/digraph.pro \
proto/edit.pro \
@@ -290,6 +296,10 @@ buffer.o: buffer.c
proto/buffer.pro: buffer.c
charset.o: charset.c
proto/charset.pro: charset.c
+crypt.o: crypt.c
+proto/crypt.pro: crypt.c
+crypt_zip.o: crypt_zip.c
+proto/crypt_zip.pro: crypt_zip.c
diff.o: diff.c
proto/diff.pro: diff.c
digraph.o: digraph.c
diff --git a/src/Make_vms.mms b/src/Make_vms.mms
index 4d19bcb2e..f19b68858 100644
--- a/src/Make_vms.mms
+++ b/src/Make_vms.mms
@@ -2,7 +2,7 @@
# Makefile for Vim on OpenVMS
#
# Maintainer: Zoltan Arpadffy <arpadffy@polarhome.com>
-# Last change: 2014 Feb 24
+# Last change: 2014 Aug 10
#
# This has script been tested on VMS 6.2 to 8.2 on DEC Alpha, VAX and IA64
# with MMS and MMK
@@ -309,7 +309,7 @@ ALL_CFLAGS_VER = /def=($(MODEL_DEF)$(DEFS)$(DEBUG_DEF)$(PERL_DEF)$(PYTHON_DEF) -
ALL_LIBS = $(LIBS) $(GUI_LIB_DIR) $(GUI_LIB) \
$(PERL_LIB) $(PYTHON_LIB) $(TCL_LIB) $(SNIFF_LIB) $(RUBY_LIB)
-SRC = blowfish.c buffer.c charset.c diff.c digraph.c edit.c eval.c ex_cmds.c ex_cmds2.c \
+SRC = blowfish.c buffer.c charset.c crypt.c, crypt_zip.c diff.c digraph.c edit.c eval.c ex_cmds.c ex_cmds2.c \
ex_docmd.c ex_eval.c ex_getln.c if_xcmdsrv.c fileio.c fold.c getchar.c \
hardcopy.c hashtab.c main.c mark.c menu.c mbyte.c memfile.c memline.c message.c misc1.c \
misc2.c move.c normal.c ops.c option.c popupmnu.c quickfix.c regexp.c search.c sha256.c\
@@ -318,7 +318,7 @@ SRC = blowfish.c buffer.c charset.c diff.c digraph.c edit.c eval.c ex_cmds.c ex_
$(GUI_SRC) $(PERL_SRC) $(PYTHON_SRC) $(TCL_SRC) $(SNIFF_SRC) \
$(RUBY_SRC) $(HANGULIN_SRC) $(MZSCH_SRC)
-OBJ = blowfish.obj buffer.obj charset.obj diff.obj digraph.obj edit.obj eval.obj \
+OBJ = blowfish.obj buffer.obj charset.obj crypt.obj, crypt_zip.obj diff.obj digraph.obj edit.obj eval.obj \
ex_cmds.obj ex_cmds2.obj ex_docmd.obj ex_eval.obj ex_getln.obj \
if_xcmdsrv.obj fileio.obj fold.obj getchar.obj hardcopy.obj hashtab.obj main.obj mark.obj \
menu.obj memfile.obj memline.obj message.obj misc1.obj misc2.obj \
diff --git a/src/Makefile b/src/Makefile
index 1d20ec1af..5a5518d43 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1431,6 +1431,8 @@ BASIC_SRC = \
blowfish.c \
buffer.c \
charset.c \
+ crypt.c \
+ crypt_zip.c \
diff.c \
digraph.c \
edit.c \
@@ -1520,6 +1522,8 @@ OBJ_COMMON = \
objects/buffer.o \
objects/blowfish.o \
objects/charset.o \
+ objects/crypt.o \
+ objects/crypt_zip.o \
objects/diff.o \
objects/digraph.o \
objects/edit.o \
@@ -1589,6 +1593,8 @@ PRO_AUTO = \
blowfish.pro \
buffer.pro \
charset.pro \
+ crypt.pro \
+ crypt_zip.pro \
diff.pro \
digraph.pro \
edit.pro \
@@ -1753,10 +1759,11 @@ xxd/xxd$(EXEEXT): xxd/xxd.c
languages:
@if test -n "$(MAKEMO)" -a -f $(PODIR)/Makefile; then \
cd $(PODIR); \
- CC="$(CC)" $(MAKE) prefix=$(DESTDIR)$(prefix); \
+ CC="$(CC)" $(MAKE) prefix=$(DESTDIR)$(prefix); \
fi
-@if test -n "$(MAKEMO)" -a -f $(PODIR)/Makefile; then \
- cd $(PODIR); CC="$(CC)" $(MAKE) prefix=$(DESTDIR)$(prefix) converted; \
+ cd $(PODIR); \
+ CC="$(CC)" $(MAKE) prefix=$(DESTDIR)$(prefix) converted; \
fi
# Update the *.po files for changes in the sources. Only run manually.
@@ -1772,13 +1779,12 @@ update-po:
proto: $(PRO_AUTO) $(PRO_MANUAL)
# Filter out arguments that cproto doesn't support.
-# Don't pass "-pthread" to cproto, it sees it as a list of individual flags.
-# Don't pass "-fstack-protector" to cproto, for the same reason.
-# Don't pass "-g" to cproto.
+# Don't pass "-pthread", "-fwrapv" and similar arguments to cproto, it sees
+# them as a list of individual flags.
# The -E"gcc -E" argument must be separate to avoid problems with shell
# quoting.
CPROTO = cproto $(PROTO_FLAGS) -DPROTO \
- `echo '$(LINT_CFLAGS)' | sed -e 's/-pthread//g' -e 's/-fstack-protector//g' -e 's/\ -g\ / /g'`
+ `echo '$(LINT_CFLAGS)' | sed -e 's/ -[a-z-]\+//g'`
### Would be nice if this would work for "normal" make.
### Currently it only works for (Free)BSD make.
@@ -1872,6 +1878,9 @@ test check:
cd testdir; $(MAKE) -f Makefile $(GUI_TESTTARGET) VIMPROG=../$(VIMTARGET) $(GUI_TESTARG) SCRIPTSOURCE=../$(SCRIPTSOURCE)
$(MAKE) -f Makefile unittest
+benchmark:
+ cd testdir; $(MAKE) -f Makefile benchmark VIMPROG=../$(VIMTARGET) SCRIPTSOURCE=../$(SCRIPTSOURCE)
+
unittesttargets:
$(MAKE) -f Makefile $(UNITTEST_TARGETS)
@@ -1881,10 +1890,24 @@ unittest unittests: $(UNITTEST_TARGETS)
done
# Run individual test, assuming that Vim was already compiled.
-test1 test2 test3 test4 test5 test6 test7 test8 test9 \
+test1 \
+ test_argument_count \
test_autoformat_join \
+ test_breakindent \
+ test_changelist \
+ test_close_count \
+ test_command_count \
test_eval \
+ test_insertcount \
+ test_listlbr \
+ test_listlbr_utf8 \
+ test_mapping \
test_options \
+ test_qf_title \
+ test_signs \
+ test_utf8 \
+ test_writefile \
+ test2 test3 test4 test5 test6 test7 test8 test9 \
test10 test11 test12 test13 test14 test15 test16 test17 test18 test19 \
test20 test21 test22 test23 test24 test25 test26 test27 test28 test29 \
test30 test31 test32 test33 test34 test35 test36 test37 test38 test39 \
@@ -2464,7 +2487,7 @@ lintinstall:
auto/if_perl.c: if_perl.xs
$(PERL) -e 'unless ( $$] >= 5.005 ) { for (qw(na defgv errgv)) { print "#define PL_$$_ $$_\n" }}' > $@
- $(PERL) $(PERLLIB)/ExtUtils/xsubpp -prototypes -typemap \
+ $(PERL) $(PERL_XSUBPP) -prototypes -typemap \
$(PERLLIB)/ExtUtils/typemap if_perl.xs >> $@
auto/osdef.h: auto/config.h osdef.sh osdef1.h.in osdef2.h.in
@@ -2506,6 +2529,12 @@ objects/buffer.o: buffer.c
objects/charset.o: charset.c
$(CCC) -o $@ charset.c
+objects/crypt.o: crypt.c
+ $(CCC) -o $@ crypt.c
+
+objects/crypt_zip.o: crypt_zip.c
+ $(CCC) -o $@ crypt_zip.c
+
objects/diff.o: diff.c
$(CCC) -o $@ diff.c
@@ -2855,6 +2884,14 @@ objects/charset.o: charset.c vim.h auto/config.h feature.h os_unix.h auto/osdef.
ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \
gui_beval.h proto/gui_beval.pro ex_cmds.h proto.h globals.h farsi.h \
arabic.h
+objects/crypt.o: crypt.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \
+ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \
+ gui_beval.h proto/gui_beval.pro ex_cmds.h proto.h globals.h farsi.h \
+ arabic.h
+objects/crypt_zip.o: crypt_zip.c vim.h auto/config.h feature.h os_unix.h \
+ auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \
+ regexp.h gui.h gui_beval.h proto/gui_beval.pro ex_cmds.h proto.h \
+ globals.h farsi.h arabic.h
objects/diff.o: diff.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \
ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \
gui_beval.h proto/gui_beval.pro ex_cmds.h proto.h globals.h farsi.h \
diff --git a/src/auto/configure b/src/auto/configure
index 4ece95ea8..ddc5c1e03 100755
--- a/src/auto/configure
+++ b/src/auto/configure
@@ -687,6 +687,7 @@ PERL_PRO
PERL_OBJ
PERL_SRC
shrpenv
+vi_cv_perl_xsubpp
vi_cv_perllib
vi_cv_path_perl
MZSCHEME_MZC
@@ -5604,6 +5605,14 @@ $as_echo "OK" >&6; }
fi
vi_cv_perllib=`$vi_cv_path_perl -MConfig -e 'print $Config{privlibexp}'`
+ vi_cv_perl_extutils=unknown_perl_extutils_path
+ for extutils_rel_path in ExtUtils vendor_perl/ExtUtils; do
+ xsubpp_path="$vi_cv_perllib/$extutils_rel_path/xsubpp"
+ if test -f "$xsubpp_path"; then
+ vi_cv_perl_xsubpp="$xsubpp_path"
+ fi
+ done
+
perlcppflags=`$vi_cv_path_perl -Mlib=$srcdir -MExtUtils::Embed \
-e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[^ ]*//'`
perllibs=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed -e 'ldopts' | \
@@ -5719,6 +5728,10 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_pythoninterp" >&5
$as_echo "$enable_pythoninterp" >&6; }
if test "$enable_pythoninterp" = "yes" -o "$enable_pythoninterp" = "dynamic"; then
+ if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
+ as_fn_error $? "cannot use Python with tiny or small features" "$LINENO" 5
+ fi
+
for ac_prog in python2 python
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -6035,6 +6048,10 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_python3interp" >&5
$as_echo "$enable_python3interp" >&6; }
if test "$enable_python3interp" = "yes" -o "$enable_python3interp" = "dynamic"; then
+ if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
+ as_fn_error $? "cannot use Python with tiny or small features" "$LINENO" 5
+ fi
+
for ac_prog in python3 python
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -6920,6 +6937,10 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_rubyinterp" >&5
$as_echo "$enable_rubyinterp" >&6; }
if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then
+ if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
+ as_fn_error $? "cannot use Ruby with tiny or small features" "$LINENO" 5
+ fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --with-ruby-command argument" >&5
$as_echo_n "checking --with-ruby-command argument... " >&6; }
@@ -12723,16 +12744,15 @@ $as_echo "$vim_cv_memcpy_handles_overlap" >&6; }
fi
-
-if test "$enable_multibyte" = "yes"; then
+if test "x$with_x" = "xyes"; then
cflags_save=$CFLAGS
- ldflags_save=$LDFLAGS
- if test "x$x_includes" != "xNONE" ; then
- CFLAGS="$CFLAGS -I$x_includes"
- LDFLAGS="$X_LIBS $LDFLAGS -lX11"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether X_LOCALE needed" >&5
+ libs_save=$LIBS
+ LIBS="$LIBS $X_LIBS $GUI_LIB_LOC $GUI_X_LIBS $X_PRE_LIBS $X_LIB $X_EXTRA_LIBS"
+ CFLAGS="$CFLAGS $X_CFLAGS"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether X_LOCALE needed" >&5
$as_echo_n "checking whether X_LOCALE needed... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <X11/Xlocale.h>
int
@@ -12765,7 +12785,7 @@ _ACEOF
if ac_fn_c_try_link "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
- $as_echo "#define X_LOCALE 1" >>confdefs.h
+ $as_echo "#define X_LOCALE 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -12778,9 +12798,41 @@ else
$as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Xutf8SetWMProperties() can be used" >&5
+$as_echo_n "checking whether Xutf8SetWMProperties() can be used... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char Xutf8SetWMProperties ();
+int
+main ()
+{
+return Xutf8SetWMProperties ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ $as_echo "#define HAVE_XUTF8SETWMPROPERTIES 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
CFLAGS=$cflags_save
- LDFLAGS=$ldflags_save
+ LIBS=$libs_save
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _xpg4_setrunelocale in -lxpg4" >&5
@@ -12966,7 +13018,7 @@ rm -f core conftest.err conftest.$ac_objext \
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: msgfmt not found - disabled" >&5
$as_echo "msgfmt not found - disabled" >&6; };
fi
- if test $have_gettext = "yes"; then
+ if test $have_gettext = "yes" -a "x$features" != "xtiny" -a "x$features" != "xsmall"; then
$as_echo "#define HAVE_GETTEXT 1" >>confdefs.h
MAKEMO=yes
diff --git a/src/blowfish.c b/src/blowfish.c
index 3d9ba5566..6bf2482f0 100644
--- a/src/blowfish.c
+++ b/src/blowfish.c
@@ -9,17 +9,25 @@
* Blowfish encryption for Vim; in Blowfish cipher feedback mode.
* Contributed by Mohsin Ahmed, http://www.cs.albany.edu/~mosh
* Based on http://www.schneier.com/blowfish.html by Bruce Schneier.
+ *
+ * There are two variants:
+ * - The old one "blowfish" has a flaw which makes it much easier to crack the
+ * key. To see this, make a text file with one line of 1000 "x" characters
+ * and write it encrypted. Use "xxd" to inspect the bytes in the file. You
+ * will see that a block of 8 bytes repeats 8 times.
+ * - The new one "blowfish2" is better. It uses an 8 byte CFB to avoid the
+ * repeats.
*/
#include "vim.h"
-#if defined(FEAT_CRYPT)
+#if defined(FEAT_CRYPT) || defined(PROTO)
#define ARRAY_LENGTH(A) (sizeof(A)/sizeof(A[0]))
#define BF_BLOCK 8
#define BF_BLOCK_MASK 7
-#define BF_CFB_LEN (8*(BF_BLOCK))
+#define BF_MAX_CFB_LEN (8 * BF_BLOCK)
typedef union {
UINT32_T ul[2];
@@ -37,14 +45,26 @@ typedef union {
# endif
#endif
-static void bf_e_block __ARGS((UINT32_T *p_xl, UINT32_T *p_xr));
-static void bf_e_cblock __ARGS((char_u *block));
-static int bf_check_tables __ARGS((UINT32_T a_ipa[18], UINT32_T a_sbi[4][256], UINT32_T val));
+/* The state of encryption, referenced by cryptstate_T. */
+typedef struct {
+ UINT32_T pax[18]; /* P-array */
+ UINT32_T sbx[4][256]; /* S-boxes */
+ int randbyte_offset;
+ int update_offset;
+ char_u cfb_buffer[BF_MAX_CFB_LEN]; /* up to 64 bytes used */
+ int cfb_len; /* size of cfb_buffer actually used */
+} bf_state_T;
+
+
+static void bf_e_block __ARGS((bf_state_T *state, UINT32_T *p_xl, UINT32_T *p_xr));
+static void bf_e_cblock __ARGS((bf_state_T *state, char_u *block));
+static int bf_check_tables __ARGS((UINT32_T pax[18], UINT32_T sbx[4][256], UINT32_T val));
static int bf_self_test __ARGS((void));
+static void bf_key_init __ARGS((bf_state_T *state, char_u *password, char_u *salt, int salt_len));
+static void bf_cfb_init __ARGS((bf_state_T *state, char_u *seed, int seed_len));
/* Blowfish code */
-static UINT32_T pax[18];
-static UINT32_T ipa[18] = {
+static UINT32_T pax_init[18] = {
0x243f6a88u, 0x85a308d3u, 0x13198a2eu,
0x03707344u, 0xa4093822u, 0x299f31d0u,
0x082efa98u, 0xec4e6c89u, 0x452821e6u,
@@ -53,8 +73,7 @@ static UINT32_T ipa[18] = {
0xb5470917u, 0x9216d5d9u, 0x8979fb1bu
};
-static UINT32_T sbx[4][256];
-static UINT32_T sbi[4][256] = {
+static UINT32_T sbx_init[4][256] = {
{0xd1310ba6u, 0x98dfb5acu, 0x2ffd72dbu, 0xd01adfb7u,
0xb8e1afedu, 0x6a267e96u, 0xba7c9045u, 0xf12c7f99u,
0x24a19947u, 0xb3916cf7u, 0x0801f2e2u, 0x858efc16u,
@@ -314,33 +333,40 @@ static UINT32_T sbi[4][256] = {
}
};
-
#define F1(i) \
- xl ^= pax[i]; \
- xr ^= ((sbx[0][xl >> 24] + \
- sbx[1][(xl & 0xFF0000) >> 16]) ^ \
- sbx[2][(xl & 0xFF00) >> 8]) + \
- sbx[3][xl & 0xFF];
+ xl ^= bfs->pax[i]; \
+ xr ^= ((bfs->sbx[0][xl >> 24] + \
+ bfs->sbx[1][(xl & 0xFF0000) >> 16]) ^ \
+ bfs->sbx[2][(xl & 0xFF00) >> 8]) + \
+ bfs->sbx[3][xl & 0xFF];
#define F2(i) \
- xr ^= pax[i]; \
- xl ^= ((sbx[0][xr >> 24] + \
- sbx[1][(xr & 0xFF0000) >> 16]) ^ \
- sbx[2][(xr & 0xFF00) >> 8]) + \
- sbx[3][xr & 0xFF];
-
+ xr ^= bfs->pax[i]; \
+ xl ^= ((bfs->sbx[0][xr >> 24] + \
+ bfs->sbx[1][(xr & 0xFF0000) >> 16]) ^ \
+ bfs->sbx[2][(xr & 0xFF00) >> 8]) + \
+ bfs->sbx[3][xr & 0xFF];
static void
-bf_e_block(p_xl, p_xr)
+bf_e_block(bfs, p_xl, p_xr)
+ bf_state_T *bfs;
UINT32_T *p_xl;
UINT32_T *p_xr;
{
- UINT32_T temp, xl = *p_xl, xr = *p_xr;
-
- F1(0) F2(1) F1(2) F2(3) F1(4) F2(5) F1(6) F2(7)
- F1(8) F2(9) F1(10) F2(11) F1(12) F2(13) F1(14) F2(15)
- xl ^= pax[16];
- xr ^= pax[17];
+ UINT32_T temp;
+ UINT32_T xl = *p_xl;
+ UINT32_T xr = *p_xr;
+
+ F1(0) F2(1)
+ F1(2) F2(3)
+ F1(4) F2(5)
+ F1(6) F2(7)
+ F1(8) F2(9)
+ F1(10) F2(11)
+ F1(12) F2(13)
+ F1(14) F2(15)
+ xl ^= bfs->pax[16];
+ xr ^= bfs->pax[17];
temp = xl;
xl = xr;
xr = temp;
@@ -348,22 +374,6 @@ bf_e_block(p_xl, p_xr)
*p_xr = xr;
}
-#if 0 /* not used */
- static void
-bf_d_block(p_xl, p_xr)
- UINT32_T *p_xl;
- UINT32_T *p_xr;
-{
- UINT32_T temp, xl = *p_xl, xr = *p_xr;
- F1(17) F2(16) F1(15) F2(14) F1(13) F2(12) F1(11) F2(10)
- F1(9) F2(8) F1(7) F2(6) F1(5) F2(4) F1(3) F2(2)
- xl ^= pax[1];
- xr ^= pax[0];
- temp = xl; xl = xr; xr = temp;
- *p_xl = xl; *p_xr = xr;
-}
-#endif
-
#ifdef WORDS_BIGENDIAN
# define htonl2(x) \
@@ -374,7 +384,8 @@ bf_d_block(p_xl, p_xr)
#endif
static void
-bf_e_cblock(block)
+bf_e_cblock(bfs, block)
+ bf_state_T *bfs;
char_u *block;
{
block8 bk;
@@ -382,35 +393,22 @@ bf_e_cblock(block)
memcpy(bk.uc, block, 8);
htonl2(bk.ul[0]);
htonl2(bk.ul[1]);
- bf_e_block(&bk.ul[0], &bk.ul[1]);
+ bf_e_block(bfs, &bk.ul[0], &bk.ul[1]);
htonl2(bk.ul[0]);
htonl2(bk.ul[1]);
memcpy(block, bk.uc, 8);
}
-#if 0 /* not used */
- void
-bf_d_cblock(block)
- char_u *block;
-{
- block8 bk;
- memcpy(bk.uc, block, 8);
- htonl2(bk.ul[0]); htonl2(bk.ul[1]);
- bf_d_block(&bk.ul[0], &bk.ul[1]);
- htonl2(bk.ul[0]); htonl2(bk.ul[1]);
- memcpy(block, bk.uc, 8);
-}
-#endif
-
/*
* Initialize the crypt method using "password" as the encryption key and
* "salt[salt_len]" as the salt.
*/
- void
-bf_key_init(password, salt, salt_len)
- char_u *password;
- char_u *salt;
- int salt_len;
+ static void
+bf_key_init(bfs, password, salt, salt_len)
+ bf_state_T *bfs;
+ char_u *password;
+ char_u *salt;
+ int salt_len;
{
int i, j, keypos = 0;
unsigned u;
@@ -418,7 +416,7 @@ bf_key_init(password, salt, salt_len)
char_u *key;
int keylen;
- /* Process the key 1000 times.
+ /* Process the key 1001 times.
* See http://en.wikipedia.org/wiki/Key_strengthening. */
key = sha256_key(password, salt, salt_len);
for (i = 0; i < 1000; i++)
@@ -437,52 +435,54 @@ bf_key_init(password, salt, salt_len)
key[i] = u;
}
- mch_memmove(sbx, sbi, 4 * 4 * 256);
+ /* Use "key" to initialize the P-array ("pax") and S-boxes ("sbx") of
+ * Blowfish. */
+ mch_memmove(bfs->sbx, sbx_init, 4 * 4 * 256);
for (i = 0; i < 18; ++i)
{
val = 0;
for (j = 0; j < 4; ++j)
val = (val << 8) | key[keypos++ % keylen];
- pax[i] = ipa[i] ^ val;
+ bfs->pax[i] = pax_init[i] ^ val;
}
data_l = data_r = 0;
for (i = 0; i < 18; i += 2)
{
- bf_e_block(&data_l, &data_r);
- pax[i + 0] = data_l;
- pax[i + 1] = data_r;
+ bf_e_block(bfs, &data_l, &data_r);
+ bfs->pax[i + 0] = data_l;
+ bfs->pax[i + 1] = data_r;
}
for (i = 0; i < 4; ++i)
{
for (j = 0; j < 256; j += 2)
{
- bf_e_block(&data_l, &data_r);
- sbx[i][j + 0] = data_l;
- sbx[i][j + 1] = data_r;
+ bf_e_block(bfs, &data_l, &data_r);
+ bfs->sbx[i][j + 0] = data_l;
+ bfs->sbx[i][j + 1] = data_r;
}
}
}
/*
- * BF Self test for corrupted tables or instructions
+ * Blowfish self-test for corrupted tables or instructions.
*/
static int
-bf_check_tables(a_ipa, a_sbi, val)
- UINT32_T a_ipa[18];
- UINT32_T a_sbi[4][256];
+bf_check_tables(pax, sbx, val)
+ UINT32_T pax[18];
+ UINT32_T sbx[4][256];
UINT32_T val;
{
int i, j;
UINT32_T c = 0;
for (i = 0; i < 18; i++)
- c ^= a_ipa[i];
+ c ^= pax[i];
for (i = 0; i < 4; i++)
for (j = 0; j < 256; j++)
- c ^= a_sbi[i][j];
+ c ^= sbx[i][j];
return c == val;
}
@@ -520,6 +520,10 @@ bf_self_test()
int err = 0;
block8 bk;
UINT32_T ui = 0xffffffffUL;
+ bf_state_T state;
+
+ vim_memset(&state, 0, sizeof(bf_state_T));
+ state.cfb_len = BF_MAX_CFB_LEN;
/* We can't simply use sizeof(UINT32_T), it would generate a compiler
* warning. */
@@ -528,21 +532,21 @@ bf_self_test()
EMSG(_("E820: sizeof(uint32_t) != 4"));
}
- if (!bf_check_tables(ipa, sbi, 0x6ffa520a))
+ if (!bf_check_tables(pax_init, sbx_init, 0x6ffa520a))
err++;
bn = ARRAY_LENGTH(bf_test_data);
for (i = 0; i < bn; i++)
{
- bf_key_init((char_u *)(bf_test_data[i].password),
+ bf_key_init(&state, (char_u *)(bf_test_data[i].password),
bf_test_data[i].salt,
(int)STRLEN(bf_test_data[i].salt));
- if (!bf_check_tables(pax, sbx, bf_test_data[i].keysum))
+ if (!bf_check_tables(state.pax, state.sbx, bf_test_data[i].keysum))
err++;
/* Don't modify bf_test_data[i].plaintxt, self test is idempotent. */
memcpy(bk.uc, bf_test_data[i].plaintxt, 8);
- bf_e_cblock(bk.uc);
+ bf_e_cblock(&state, bk.uc);
if (memcmp(bk.uc, bf_test_data[i].cryptxt, 8) != 0)
{
if (err == 0 && memcmp(bk.uc, bf_test_data[i].badcryptxt, 8) == 0)
@@ -554,43 +558,43 @@ bf_self_test()
return err > 0 ? FAIL : OK;
}
-/* Cipher feedback mode. */
-static int randbyte_offset = 0;
-static int update_offset = 0;
-static char_u cfb_buffer[BF_CFB_LEN]; /* 64 bytes */
+/*
+ * CFB: Cipher Feedback Mode.
+ */
/*
- * Initialize with seed "iv[iv_len]".
+ * Initialize with seed "seed[seed_len]".
*/
- void
-bf_cfb_init(iv, iv_len)
- char_u *iv;
- int iv_len;
+ static void
+bf_cfb_init(bfs, seed, seed_len)
+ bf_state_T *bfs;
+ char_u *seed;
+ int seed_len;
{
int i, mi;
- randbyte_offset = update_offset = 0;
- vim_memset(cfb_buffer, 0, BF_CFB_LEN);
- if (iv_len > 0)
+ bfs->randbyte_offset = bfs->update_offset = 0;
+ vim_memset(bfs->cfb_buffer, 0, bfs->cfb_len);
+ if (seed_len > 0)
{
- mi = iv_len > BF_CFB_LEN ? iv_len : BF_CFB_LEN;
+ mi = seed_len > bfs->cfb_len ? seed_len : bfs->cfb_len;
for (i = 0; i < mi; i++)
- cfb_buffer[i % BF_CFB_LEN] ^= iv[i % iv_len];
+ bfs->cfb_buffer[i % bfs->cfb_len] ^= seed[i % seed_len];
}
}
-#define BF_CFB_UPDATE(c) { \
- cfb_buffer[update_offset] ^= (char_u)c; \
- if (++update_offset == BF_CFB_LEN) \
- update_offset = 0; \
+#define BF_CFB_UPDATE(bfs, c) { \
+ bfs->cfb_buffer[bfs->update_offset] ^= (char_u)c; \
+ if (++bfs->update_offset == bfs->cfb_len) \
+ bfs->update_offset = 0; \
}
-#define BF_RANBYTE(t) { \
- if ((randbyte_offset & BF_BLOCK_MASK) == 0) \
- bf_e_cblock(&cfb_buffer[randbyte_offset]); \
- t = cfb_buffer[randbyte_offset]; \
- if (++randbyte_offset == BF_CFB_LEN) \
- randbyte_offset = 0; \
+#define BF_RANBYTE(bfs, t) { \
+ if ((bfs->randbyte_offset & BF_BLOCK_MASK) == 0) \
+ bf_e_cblock(bfs, &(bfs->cfb_buffer[bfs->randbyte_offset])); \
+ t = bfs->cfb_buffer[bfs->randbyte_offset]; \
+ if (++bfs->randbyte_offset == bfs->cfb_len) \
+ bfs->randbyte_offset = 0; \
}
/*
@@ -598,90 +602,69 @@ bf_cfb_init(iv, iv_len)
* "from" and "to" can be equal to encrypt in place.
*/
void
-bf_crypt_encode(from, len, to)
+crypt_blowfish_encode(state, from, len, to)
+ cryptstate_T *state;
char_u *from;
size_t len;
char_u *to;
{
+ bf_state_T *bfs = state->method_state;
size_t i;
int ztemp, t;
for (i = 0; i < len; ++i)
{
ztemp = from[i];
- BF_RANBYTE(t);
- BF_CFB_UPDATE(ztemp);
+ BF_RANBYTE(bfs, t);
+ BF_CFB_UPDATE(bfs, ztemp);
to[i] = t ^ ztemp;
}
}
/*
- * Decrypt "ptr[len]" in place.
+ * Decrypt "from[len]" into "to[len]".
*/
void
-bf_crypt_decode(ptr, len)
- char_u *ptr;
- long len;
+crypt_blowfish_decode(state, from, len, to)
+ cryptstate_T *state;
+ char_u *from;
+ size_t len;
+ char_u *to;
{
- char_u *p;
+ bf_state_T *bfs = state->method_state;
+ size_t i;
int t;
- for (p = ptr; p < ptr + len; ++p)
+ for (i = 0; i < len; ++i)
{
- BF_RANBYTE(t);
- *p ^= t;
- BF_CFB_UPDATE(*p);
+ BF_RANBYTE(bfs, t);
+ to[i] = from[i] ^ t;
+ BF_CFB_UPDATE(bfs, to[i]);
}
}
-/*
- * Initialize the encryption keys and the random header according to
- * the given password.
- */
void
-bf_crypt_init_keys(passwd)
- char_u *passwd; /* password string with which to modify keys */
+crypt_blowfish_init(state, key, salt, salt_len, seed, seed_len)
+ cryptstate_T *state;
+ char_u* key;
+ char_u* salt;
+ int salt_len;
+ char_u* seed;
+ int seed_len;
{
- char_u *p;
+ bf_state_T *bfs = (bf_state_T *)alloc_clear(sizeof(bf_state_T));
- for (p = passwd; *p != NUL; ++p)
- {
- BF_CFB_UPDATE(*p);
- }
-}
+ state->method_state = bfs;
-static int save_randbyte_offset;
-static int save_update_offset;
-static char_u save_cfb_buffer[BF_CFB_LEN];
-static UINT32_T save_pax[18];
-static UINT32_T save_sbx[4][256];
+ /* "blowfish" uses a 64 byte buffer, causing it to repeat 8 byte groups 8
+ * times. "blowfish2" uses a 8 byte buffer to avoid repeating. */
+ bfs->cfb_len = state->method_nr == CRYPT_M_BF ? BF_MAX_CFB_LEN : BF_BLOCK;
-/*
- * Save the current crypt state. Can only be used once before
- * bf_crypt_restore().
- */
- void
-bf_crypt_save()
-{
- save_randbyte_offset = randbyte_offset;
- save_update_offset = update_offset;
- mch_memmove(save_cfb_buffer, cfb_buffer, BF_CFB_LEN);
- mch_memmove(save_pax, pax, 4 * 18);
- mch_memmove(save_sbx, sbx, 4 * 4 * 256);
-}
+ if (blowfish_self_test() == FAIL)
+ return;
-/*
- * Restore the current crypt state. Can only be used after
- * bf_crypt_save().
- */
- void
-bf_crypt_restore()
-{
- randbyte_offset = save_randbyte_offset;
- update_offset = save_update_offset;
- mch_memmove(cfb_buffer, save_cfb_buffer, BF_CFB_LEN);
- mch_memmove(pax, save_pax, 4 * 18);
- mch_memmove(sbx, save_sbx, 4 * 4 * 256);
+ bf_key_init(bfs, key, salt, salt_len);
+ bf_cfb_init(bfs, seed, seed_len);
}
/*
diff --git a/src/buffer.c b/src/buffer.c
index 5a9f8a786..0d1470606 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -28,9 +28,9 @@
#include "vim.h"
#if defined(FEAT_CMDL_COMPL) || defined(FEAT_LISTCMDS) || defined(FEAT_EVAL) || defined(FEAT_PERL)
-static char_u *buflist_match __ARGS((regprog_T *prog, buf_T *buf));
+static char_u *buflist_match __ARGS((regmatch_T *rmp, buf_T *buf, int ignore_case));
# define HAVE_BUFLIST_MATCH
-static char_u *fname_match __ARGS((regprog_T *prog, char_u *name));
+static char_u *fname_match __ARGS((regmatch_T *rmp, char_u *name, int ignore_case));
#endif
static void buflist_setfpos __ARGS((buf_T *buf, win_T *win, linenr_T lnum, colnr_T col, int copy_options));
static wininfo_T *find_wininfo __ARGS((buf_T *buf, int skip_diff_buffer));
@@ -2001,6 +2001,7 @@ free_buf_options(buf, free_p_ff)
#ifdef FEAT_LISP
clear_string_option(&buf->b_p_lw);
#endif
+ clear_string_option(&buf->b_p_bkc);
}
/*
@@ -2219,7 +2220,6 @@ buflist_findpat(pattern, pattern_end, unlisted, diffmode, curtab_only)
int curtab_only; /* find buffers in current tab only */
{
buf_T *buf;
- regprog_T *prog;
int match = -1;
int find_listed;
char_u *pat;
@@ -2264,14 +2264,16 @@ buflist_findpat(pattern, pattern_end, unlisted, diffmode, curtab_only)
{
for (attempt = 0; attempt <= 3; ++attempt)
{
+ regmatch_T regmatch;
+
/* may add '^' and '$' */
if (toggledollar)
*patend = (attempt < 2) ? NUL : '$'; /* add/remove '$' */
p = pat;
if (*p == '^' && !(attempt & 1)) /* add/remove '^' */
++p;
- prog = vim_regcomp(p, p_magic ? RE_MAGIC : 0);
- if (prog == NULL)
+ regmatch.regprog = vim_regcomp(p, p_magic ? RE_MAGIC : 0);
+ if (regmatch.regprog == NULL)
{
vim_free(pat);
return -1;
@@ -2282,7 +2284,7 @@ buflist_findpat(pattern, pattern_end, unlisted, diffmode, curtab_only)
#ifdef FEAT_DIFF
&& (!diffmode || diff_mode_buf(buf))
#endif
- && buflist_match(prog, buf) != NULL)
+ && buflist_match(&regmatch, buf, FALSE) != NULL)
{
if (curtab_only)
{
@@ -2309,7 +2311,7 @@ buflist_findpat(pattern, pattern_end, unlisted, diffmode, curtab_only)
match = buf->b_fnum; /* remember first match */
}
- vim_regfree(prog);
+ vim_regfree(regmatch.regprog);
if (match >= 0) /* found one match */
break;
}
@@ -2351,7 +2353,6 @@ ExpandBufnames(pat, num_file, file, options)
int round;
char_u *p;
int attempt;
- regprog_T *prog;
char_u *patc;
*num_file = 0; /* return values in case of FAIL */
@@ -2375,10 +2376,12 @@ ExpandBufnames(pat, num_file, file, options)
*/
for (attempt = 0; attempt <= 1; ++attempt)
{
+ regmatch_T regmatch;
+
if (attempt > 0 && patc == pat)
break; /* there was no anchor, no need to try again */
- prog = vim_regcomp(patc + attempt * 11, RE_MAGIC);
- if (prog == NULL)
+ regmatch.regprog = vim_regcomp(patc + attempt * 11, RE_MAGIC);
+ if (regmatch.regprog == NULL)
{
if (patc != pat)
vim_free(patc);
@@ -2396,7 +2399,7 @@ ExpandBufnames(pat, num_file, file, options)
{
if (!buf->b_p_bl) /* skip unlisted buffers */
continue;
- p = buflist_match(prog, buf);
+ p = buflist_match(&regmatch, buf, p_wic);
if (p != NULL)
{
if (round == 1)
@@ -2418,14 +2421,14 @@ ExpandBufnames(pat, num_file, file, options)
*file = (char_u **)alloc((unsigned)(count * sizeof(char_u *)));
if (*file == NULL)
{
- vim_regfree(prog);
+ vim_regfree(regmatch.regprog);
if (patc != pat)
vim_free(patc);
return FAIL;
}
}
}
- vim_regfree(prog);
+ vim_regfree(regmatch.regprog);
if (count) /* match(es) found, break here */
break;
}
@@ -2444,16 +2447,17 @@ ExpandBufnames(pat, num_file, file, options)
* Check for a match on the file name for buffer "buf" with regprog "prog".
*/
static char_u *
-buflist_match(prog, buf)
- regprog_T *prog;
+buflist_match(rmp, buf, ignore_case)
+ regmatch_T *rmp;
buf_T *buf;
+ int ignore_case; /* when TRUE ignore case, when FALSE use 'fic' */
{
char_u *match;
/* First try the short file name, then the long file name. */
- match = fname_match(prog, buf->b_sfname);
+ match = fname_match(rmp, buf->b_sfname, ignore_case);
if (match == NULL)
- match = fname_match(prog, buf->b_ffname);
+ match = fname_match(rmp, buf->b_ffname, ignore_case);
return match;
}
@@ -2463,25 +2467,25 @@ buflist_match(prog, buf)
* Return "name" when there is a match, NULL when not.
*/
static char_u *
-fname_match(prog, name)
- regprog_T *prog;
+fname_match(rmp, name, ignore_case)
+ regmatch_T *rmp;
char_u *name;
+ int ignore_case; /* when TRUE ignore case, when FALSE use 'fic' */
{
char_u *match = NULL;
char_u *p;
- regmatch_T regmatch;
if (name != NULL)
{
- regmatch.regprog = prog;
- regmatch.rm_ic = p_fic; /* ignore case when 'fileignorecase' is set */
- if (vim_regexec(&regmatch, name, (colnr_T)0))
+ /* Ignore case when 'fileignorecase' or the argument is set. */
+ rmp->rm_ic = p_fic || ignore_case;
+ if (vim_regexec(rmp, name, (colnr_T)0))
match = name;
else
{
/* Replace $(HOME) with '~' and try matching again. */
p = home_replace_save(NULL, name);
- if (p != NULL && vim_regexec(&regmatch, p, (colnr_T)0))
+ if (p != NULL && vim_regexec(rmp, p, (colnr_T)0))
match = name;
vim_free(p);
}
@@ -4405,6 +4409,8 @@ get_rel_pos(wp, buf, buflen)
long above; /* number of lines above window */
long below; /* number of lines below window */
+ if (buflen < 3) /* need at least 3 chars for writing */
+ return;
above = wp->w_topline - 1;
#ifdef FEAT_DIFF
above += diff_check_fill(wp, wp->w_topline) - wp->w_topfill;
diff --git a/src/charset.c b/src/charset.c
index e7aabe7ed..e9745c09a 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1185,6 +1185,14 @@ win_lbr_chartabsize(wp, line, s, col, headp)
col -= W_WIDTH(wp);
numberextra = W_WIDTH(wp) - (numberextra - win_col_off2(wp));
if (numberextra > 0)
+ col %= numberextra;
+ if (*p_sbr != NUL)
+ {
+ colnr_T sbrlen = (colnr_T)MB_CHARLEN(p_sbr);
+ if (col >= sbrlen)
+ col -= sbrlen;
+ }
+ if (numberextra > 0)
col = col % numberextra;
}
if (col == 0 || col + size > (colnr_T)W_WIDTH(wp))
@@ -1195,10 +1203,7 @@ win_lbr_chartabsize(wp, line, s, col, headp)
if (wp->w_p_bri)
added += get_breakindent_win(wp, line);
- if (tab_corr)
- size += (added / wp->w_buffer->b_p_ts) * wp->w_buffer->b_p_ts;
- else
- size += added;
+ size += added;
if (col != 0)
added = 0;
}
diff --git a/src/config.h.in b/src/config.h.in
index 7f16e622a..b8168a55f 100644
--- a/src/config.h.in
+++ b/src/config.h.in
@@ -446,3 +446,6 @@
/* Define if we have AvailabilityMacros.h on Mac OS X */
#undef HAVE_AVAILABILITYMACROS_H
+
+/* Define if Xutf8SetWMProperties() is in an X library. */
+#undef HAVE_XUTF8SETWMPROPERTIES
diff --git a/src/config.mk.in b/src/config.mk.in
index bd5649e4d..15b5a6239 100644
--- a/src/config.mk.in
+++ b/src/config.mk.in
@@ -48,11 +48,12 @@ MZSCHEME_SRC = @MZSCHEME_SRC@
MZSCHEME_OBJ = @MZSCHEME_OBJ@
MZSCHEME_CFLAGS = @MZSCHEME_CFLAGS@
MZSCHEME_PRO = @MZSCHEME_PRO@
-MZSCHEME_EXTRA = @MZSCHEME_EXTRA@
+MZSCHEME_EXTRA = @MZSCHEME_EXTRA@
MZSCHEME_MZC = @MZSCHEME_MZC@
PERL = @vi_cv_path_perl@
PERLLIB = @vi_cv_perllib@
+PERL_XSUBPP = @vi_cv_perl_xsubpp@
PERL_LIBS = @PERL_LIBS@
SHRPENV = @shrpenv@
PERL_SRC = @PERL_SRC@
diff --git a/src/configure.in b/src/configure.in
index fc6d405fe..033138c11 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -933,6 +933,14 @@ if test "$enable_perlinterp" = "yes" -o "$enable_perlinterp" = "dynamic"; then
fi
vi_cv_perllib=`$vi_cv_path_perl -MConfig -e 'print $Config{privlibexp}'`
AC_SUBST(vi_cv_perllib)
+ vi_cv_perl_extutils=unknown_perl_extutils_path
+ for extutils_rel_path in ExtUtils vendor_perl/ExtUtils; do
+ xsubpp_path="$vi_cv_perllib/$extutils_rel_path/xsubpp"
+ if test -f "$xsubpp_path"; then
+ vi_cv_perl_xsubpp="$xsubpp_path"
+ fi
+ done
+ AC_SUBST(vi_cv_perl_xsubpp)
dnl Remove "-fno-something", it breaks using cproto.
perlcppflags=`$vi_cv_path_perl -Mlib=$srcdir -MExtUtils::Embed \
-e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[[^ ]]*//'`
@@ -1033,6 +1041,10 @@ AC_ARG_ENABLE(pythoninterp,
[enable_pythoninterp="no"])
AC_MSG_RESULT($enable_pythoninterp)
if test "$enable_pythoninterp" = "yes" -o "$enable_pythoninterp" = "dynamic"; then
+ if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
+ AC_MSG_ERROR([cannot use Python with tiny or small features])
+ fi
+
dnl -- find the python executable
AC_PATH_PROGS(vi_cv_path_python, python2 python)
if test "X$vi_cv_path_python" != "X"; then
@@ -1235,6 +1247,10 @@ AC_ARG_ENABLE(python3interp,
[enable_python3interp="no"])
AC_MSG_RESULT($enable_python3interp)
if test "$enable_python3interp" = "yes" -o "$enable_python3interp" = "dynamic"; then
+ if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
+ AC_MSG_ERROR([cannot use Python with tiny or small features])
+ fi
+
dnl -- find the python3 executable
AC_PATH_PROGS(vi_cv_path_python3, python3 python)
if test "X$vi_cv_path_python3" != "X"; then
@@ -1712,6 +1728,10 @@ AC_ARG_ENABLE(rubyinterp,
[enable_rubyinterp="no"])
AC_MSG_RESULT($enable_rubyinterp)
if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then
+ if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
+ AC_MSG_ERROR([cannot use Ruby with tiny or small features])
+ fi
+
AC_MSG_CHECKING(--with-ruby-command argument)
AC_SUBST(vi_cv_path_ruby)
AC_ARG_WITH(ruby-command, [ --with-ruby-command=RUBY name of the Ruby command (default: ruby)],
@@ -3722,21 +3742,24 @@ fi
dnl Check for multibyte locale functions
dnl Find out if _Xsetlocale() is supported by libX11.
dnl Check if X_LOCALE should be defined.
-
-if test "$enable_multibyte" = "yes"; then
+if test "x$with_x" = "xyes"; then
cflags_save=$CFLAGS
- ldflags_save=$LDFLAGS
- if test "x$x_includes" != "xNONE" ; then
- CFLAGS="$CFLAGS -I$x_includes"
- LDFLAGS="$X_LIBS $LDFLAGS -lX11"
- AC_MSG_CHECKING(whether X_LOCALE needed)
- AC_TRY_COMPILE([#include <X11/Xlocale.h>],,
- AC_TRY_LINK_FUNC([_Xsetlocale], [AC_MSG_RESULT(yes)
- AC_DEFINE(X_LOCALE)], AC_MSG_RESULT(no)),
- AC_MSG_RESULT(no))
- fi
+ libs_save=$LIBS
+ LIBS="$LIBS $X_LIBS $GUI_LIB_LOC $GUI_X_LIBS $X_PRE_LIBS $X_LIB $X_EXTRA_LIBS"
+ CFLAGS="$CFLAGS $X_CFLAGS"
+
+ AC_MSG_CHECKING(whether X_LOCALE needed)
+ AC_TRY_COMPILE([#include <X11/Xlocale.h>],,
+ AC_TRY_LINK_FUNC([_Xsetlocale], [AC_MSG_RESULT(yes)
+ AC_DEFINE(X_LOCALE)], AC_MSG_RESULT(no)),
+ AC_MSG_RESULT(no))
+
+ AC_MSG_CHECKING(whether Xutf8SetWMProperties() can be used)
+ AC_TRY_LINK_FUNC([Xutf8SetWMProperties], [AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_XUTF8SETWMPROPERTIES)], AC_MSG_RESULT(no))
+
CFLAGS=$cflags_save
- LDFLAGS=$ldflags_save
+ LIBS=$libs_save
fi
dnl Link with xpg4, it is said to make Korean locale working
@@ -3818,7 +3841,7 @@ if test "$enable_nls" = "yes"; then
else
AC_MSG_RESULT([msgfmt not found - disabled]);
fi
- if test $have_gettext = "yes"; then
+ if test $have_gettext = "yes" -a "x$features" != "xtiny" -a "x$features" != "xsmall"; then
AC_DEFINE(HAVE_GETTEXT)
MAKEMO=yes
AC_SUBST(MAKEMO)
diff --git a/src/crypt.c b/src/crypt.c
new file mode 100644
index 000000000..f25a2c4a9
--- /dev/null
+++ b/src/crypt.c
@@ -0,0 +1,605 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * crypt.c: Generic encryption support.
+ */
+#include "vim.h"
+
+#if defined(FEAT_CRYPT) || defined(PROTO)
+/*
+ * Optional encryption support.
+ * Mohsin Ahmed, mosh@sasi.com, 1998-09-24
+ * Based on zip/crypt sources.
+ * Refactored by David Leadbeater, 2014.
+ *
+ * NOTE FOR USA: Since 2000 exporting this code from the USA is allowed to
+ * most countries. There are a few exceptions, but that still should not be a
+ * problem since this code was originally created in Europe and India.
+ *
+ * Blowfish addition originally made by Mohsin Ahmed,
+ * http://www.cs.albany.edu/~mosh 2010-03-14
+ * Based on blowfish by Bruce Schneier (http://www.schneier.com/blowfish.html)
+ * and sha256 by Christophe Devine.
+ */
+
+typedef struct {
+ char *name; /* encryption name as used in 'cryptmethod' */
+ char *magic; /* magic bytes stored in file header */
+ int salt_len; /* length of salt, or 0 when not using salt */
+ int seed_len; /* length of seed, or 0 when not using salt */
+ int works_inplace; /* encryption/decryption can be done in-place */
+ int whole_undofile; /* whole undo file is encrypted */
+
+ /* Optional function pointer for a self-test. */
+ int (* self_test_fn)();
+
+ /* Function pointer for initializing encryption/decription. */
+ void (* init_fn)(cryptstate_T *state, char_u *key,
+ char_u *salt, int salt_len, char_u *seed, int seed_len);
+
+ /* Function pointers for encoding/decoding from one buffer into another.
+ * Optional, however, these or the _buffer ones should be configured. */
+ void (*encode_fn)(cryptstate_T *state, char_u *from, size_t len,
+ char_u *to);
+ void (*decode_fn)(cryptstate_T *state, char_u *from, size_t len,
+ char_u *to);
+
+ /* Function pointers for encoding and decoding, can buffer data if needed.
+ * Optional (however, these or the above should be configured). */
+ long (*encode_buffer_fn)(cryptstate_T *state, char_u *from, size_t len,
+ char_u **newptr);
+ long (*decode_buffer_fn)(cryptstate_T *state, char_u *from, size_t len,
+ char_u **newptr);
+
+ /* Function pointers for in-place encoding and decoding, used for
+ * crypt_*_inplace(). "from" and "to" arguments will be equal.
+ * These may be the same as decode_fn and encode_fn above, however an
+ * algorithm may implement them in a way that is not interchangeable with
+ * the crypt_(en|de)code() interface (for example because it wishes to add
+ * padding to files).
+ * This method is used for swap and undo files which have a rigid format.
+ */
+ void (*encode_inplace_fn)(cryptstate_T *state, char_u *p1, size_t len,
+ char_u *p2);
+ void (*decode_inplace_fn)(cryptstate_T *state, char_u *p1, size_t len,
+ char_u *p2);
+} cryptmethod_T;
+
+/* index is method_nr of cryptstate_T, CRYPT_M_* */
+static cryptmethod_T cryptmethods[CRYPT_M_COUNT] = {
+ /* PK_Zip; very weak */
+ {
+ "zip",
+ "VimCrypt~01!",
+ 0,
+ 0,
+ TRUE,
+ FALSE,
+ NULL,
+ crypt_zip_init,
+ crypt_zip_encode, crypt_zip_decode,
+ NULL, NULL,
+ crypt_zip_encode, crypt_zip_decode,
+ },
+
+ /* Blowfish/CFB + SHA-256 custom key derivation; implementation issues. */
+ {
+ "blowfish",
+ "VimCrypt~02!",
+ 8,
+ 8,
+ TRUE,
+ FALSE,
+ blowfish_self_test,
+ crypt_blowfish_init,
+ crypt_blowfish_encode, crypt_blowfish_decode,
+ NULL, NULL,
+ crypt_blowfish_encode, crypt_blowfish_decode,
+ },
+
+ /* Blowfish/CFB + SHA-256 custom key derivation; fixed. */
+ {
+ "blowfish2",
+ "VimCrypt~03!",
+ 8,
+ 8,
+ TRUE,
+ TRUE,
+ blowfish_self_test,
+ crypt_blowfish_init,
+ crypt_blowfish_encode, crypt_blowfish_decode,
+ NULL, NULL,
+ crypt_blowfish_encode, crypt_blowfish_decode,
+ },
+};
+
+#define CRYPT_MAGIC_LEN 12 /* cannot change */
+static char crypt_magic_head[] = "VimCrypt~";
+
+/*
+ * Return int value for crypt method name.
+ * 0 for "zip", the old method. Also for any non-valid value.
+ * 1 for "blowfish".
+ * 2 for "blowfish2".
+ */
+ int
+crypt_method_nr_from_name(name)
+ char_u *name;
+{
+ int i;
+
+ for (i = 0; i < CRYPT_M_COUNT; ++i)
+ if (STRCMP(name, cryptmethods[i].name) == 0)
+ return i;
+ return 0;
+}
+
+/*
+ * Get the crypt method used for a file from "ptr[len]", the magic text at the
+ * start of the file.
+ * Returns -1 when no encryption used.
+ */
+ int
+crypt_method_nr_from_magic(ptr, len)
+ char *ptr;
+ int len;
+{
+ int i;
+
+ if (len < CRYPT_MAGIC_LEN)
+ return -1;
+
+ for (i = 0; i < CRYPT_M_COUNT; i++)
+ if (memcmp(ptr, cryptmethods[i].magic, CRYPT_MAGIC_LEN) == 0)
+ return i;
+
+ i = (int)STRLEN(crypt_magic_head);
+ if (len >= i && memcmp(ptr, crypt_magic_head, i) == 0)
+ EMSG(_("E821: File is encrypted with unknown method"));
+
+ return -1;
+}
+
+/*
+ * Return TRUE if the crypt method for "method_nr" can be done in-place.
+ */
+ int
+crypt_works_inplace(state)
+ cryptstate_T *state;
+{
+ return cryptmethods[state->method_nr].works_inplace;
+}
+
+/*
+ * Get the crypt method for buffer "buf" as a number.
+ */
+ int
+crypt_get_method_nr(buf)
+ buf_T *buf;
+{
+ return crypt_method_nr_from_name(*buf->b_p_cm == NUL ? p_cm : buf->b_p_cm);
+}
+
+/*
+ * Return TRUE when the buffer uses an encryption method that encrypts the
+ * whole undo file, not only the text.
+ */
+ int
+crypt_whole_undofile(method_nr)
+ int method_nr;
+{
+ return cryptmethods[method_nr].whole_undofile;
+}
+
+/*
+ * Get crypt method specifc length of the file header in bytes.
+ */
+ int
+crypt_get_header_len(method_nr)
+ int method_nr;
+{
+ return CRYPT_MAGIC_LEN
+ + cryptmethods[method_nr].salt_len
+ + cryptmethods[method_nr].seed_len;
+}
+
+/*
+ * Set the crypt method for buffer "buf" to "method_nr" using the int value as
+ * returned by crypt_method_nr_from_name().
+ */
+ void
+crypt_set_cm_option(buf, method_nr)
+ buf_T *buf;
+ int method_nr;
+{
+ free_string_option(buf->b_p_cm);
+ buf->b_p_cm = vim_strsave((char_u *)cryptmethods[method_nr].name);
+}
+
+/*
+ * If the crypt method for the current buffer has a self-test, run it and
+ * return OK/FAIL.
+ */
+ int
+crypt_self_test()
+{
+ int method_nr = crypt_get_method_nr(curbuf);
+
+ if (cryptmethods[method_nr].self_test_fn == NULL)
+ return OK;
+ return cryptmethods[method_nr].self_test_fn();
+}
+
+/*
+ * Allocate a crypt state and initialize it.
+ */
+ cryptstate_T *
+crypt_create(method_nr, key, salt, salt_len, seed, seed_len)
+ int method_nr;
+ char_u *key;
+ char_u *salt;
+ int salt_len;
+ char_u *seed;
+ int seed_len;
+{
+ cryptstate_T *state = (cryptstate_T *)alloc((int)sizeof(cryptstate_T));
+
+ state->method_nr = method_nr;
+ cryptmethods[method_nr].init_fn(state, key, salt, salt_len, seed, seed_len);
+ return state;
+}
+
+/*
+ * Allocate a crypt state from a file header and initialize it.
+ * Assumes that header contains at least the number of bytes that
+ * crypt_get_header_len() returns for "method_nr".
+ */
+ cryptstate_T *
+crypt_create_from_header(method_nr, key, header)
+ int method_nr;
+ char_u *key;
+ char_u *header;
+{
+ char_u *salt = NULL;
+ char_u *seed = NULL;
+ int salt_len = cryptmethods[method_nr].salt_len;
+ int seed_len = cryptmethods[method_nr].seed_len;
+
+ if (salt_len > 0)
+ salt = header + CRYPT_MAGIC_LEN;
+ if (seed_len > 0)
+ seed = header + CRYPT_MAGIC_LEN + salt_len;
+
+ return crypt_create(method_nr, key, salt, salt_len, seed, seed_len);
+}
+
+/*
+ * Read the crypt method specific header data from "fp".
+ * Return an allocated cryptstate_T or NULL on error.
+ */
+ cryptstate_T *
+crypt_create_from_file(fp, key)
+ FILE *fp;
+ char_u *key;
+{
+ int method_nr;
+ int header_len;
+ char magic_buffer[CRYPT_MAGIC_LEN];
+ char_u *buffer;
+ cryptstate_T *state;
+
+ if (fread(magic_buffer, CRYPT_MAGIC_LEN, 1, fp) != 1)
+ return NULL;
+ method_nr = crypt_method_nr_from_magic(magic_buffer, CRYPT_MAGIC_LEN);
+ if (method_nr < 0)
+ return NULL;
+
+ header_len = crypt_get_header_len(method_nr);
+ if ((buffer = alloc(header_len)) == NULL)
+ return NULL;
+ mch_memmove(buffer, magic_buffer, CRYPT_MAGIC_LEN);
+ if (header_len > CRYPT_MAGIC_LEN
+ && fread(buffer + CRYPT_MAGIC_LEN,
+ header_len - CRYPT_MAGIC_LEN, 1, fp) != 1)
+ {
+ vim_free(buffer);
+ return NULL;
+ }
+
+ state = crypt_create_from_header(method_nr, key, buffer);
+ vim_free(buffer);
+ return state;
+}
+
+/*
+ * Allocate a cryptstate_T for writing and initialize it with "key".
+ * Allocates and fills in the header and stores it in "header", setting
+ * "header_len". The header may include salt and seed, depending on
+ * cryptmethod. Caller must free header.
+ * Returns the state or NULL on failure.
+ */
+ cryptstate_T *
+crypt_create_for_writing(method_nr, key, header, header_len)
+ int method_nr;
+ char_u *key;
+ char_u **header;
+ int *header_len;
+{
+ int len = crypt_get_header_len(method_nr);
+ char_u *salt = NULL;
+ char_u *seed = NULL;
+ int salt_len = cryptmethods[method_nr].salt_len;
+ int seed_len = cryptmethods[method_nr].seed_len;
+ cryptstate_T *state;
+
+ *header_len = len;
+ *header = alloc(len);
+ if (*header == NULL)
+ return NULL;
+
+ mch_memmove(*header, cryptmethods[method_nr].magic, CRYPT_MAGIC_LEN);
+ if (salt_len > 0 || seed_len > 0)
+ {
+ if (salt_len > 0)
+ salt = *header + CRYPT_MAGIC_LEN;
+ if (seed_len > 0)
+ seed = *header + CRYPT_MAGIC_LEN + salt_len;
+
+ /* TODO: Should this be crypt method specific? (Probably not worth
+ * it). sha2_seed is pretty bad for large amounts of entropy, so make
+ * that into something which is suitable for anything. */
+ sha2_seed(salt, salt_len, seed, seed_len);
+ }
+
+ state = crypt_create(method_nr, key, salt, salt_len, seed, seed_len);
+ if (state == NULL)
+ {
+ vim_free(*header);
+ *header = NULL;
+ }
+ return state;
+}
+
+/*
+ * Free the crypt state.
+ */
+ void
+crypt_free_state(state)
+ cryptstate_T *state;
+{
+ vim_free(state->method_state);
+ vim_free(state);
+}
+
+/*
+ * Encode "from[len]" and store the result in a newly allocated buffer, which
+ * is stored in "newptr".
+ * Return number of bytes in "newptr", 0 for need more or -1 on error.
+ */
+ long
+crypt_encode_alloc(state, from, len, newptr)
+ cryptstate_T *state;
+ char_u *from;
+ size_t len;
+ char_u **newptr;
+{
+ cryptmethod_T *method = &cryptmethods[state->method_nr];
+
+ if (method->encode_buffer_fn != NULL)
+ /* Has buffer function, pass through. */
+ return method->encode_buffer_fn(state, from, len, newptr);
+ if (len == 0)
+ /* Not buffering, just return EOF. */
+ return (long)len;
+
+ *newptr = alloc((long)len);
+ if (*newptr == NULL)
+ return -1;
+ method->encode_fn(state, from, len, *newptr);
+ return (long)len;
+}
+
+/*
+ * Decrypt "ptr[len]" and store the result in a newly allocated buffer, which
+ * is stored in "newptr".
+ * Return number of bytes in "newptr", 0 for need more or -1 on error.
+ */
+ long
+crypt_decode_alloc(state, ptr, len, newptr)
+ cryptstate_T *state;
+ char_u *ptr;
+ long len;
+ char_u **newptr;
+{
+ cryptmethod_T *method = &cryptmethods[state->method_nr];
+
+ if (method->decode_buffer_fn != NULL)
+ /* Has buffer function, pass through. */
+ return method->decode_buffer_fn(state, ptr, len, newptr);
+
+ if (len == 0)
+ /* Not buffering, just return EOF. */
+ return len;
+
+ *newptr = alloc(len);
+ if (*newptr == NULL)
+ return -1;
+ method->decode_fn(state, ptr, len, *newptr);
+ return len;
+}
+
+/*
+ * Encrypting "from[len]" into "to[len]".
+ */
+ void
+crypt_encode(state, from, len, to)
+ cryptstate_T *state;
+ char_u *from;
+ size_t len;
+ char_u *to;
+{
+ cryptmethods[state->method_nr].encode_fn(state, from, len, to);
+}
+
+/*
+ * decrypting "from[len]" into "to[len]".
+ */
+ void
+crypt_decode(state, from, len, to)
+ cryptstate_T *state;
+ char_u *from;
+ size_t len;
+ char_u *to;
+{
+ cryptmethods[state->method_nr].decode_fn(state, from, len, to);
+}
+
+/*
+ * Simple inplace encryption, modifies "buf[len]" in place.
+ */
+ void
+crypt_encode_inplace(state, buf, len)
+ cryptstate_T *state;
+ char_u *buf;
+ size_t len;
+{
+ cryptmethods[state->method_nr].encode_inplace_fn(state, buf, len, buf);
+}
+
+/*
+ * Simple inplace decryption, modifies "buf[len]" in place.
+ */
+ void
+crypt_decode_inplace(state, buf, len)
+ cryptstate_T *state;
+ char_u *buf;
+ size_t len;
+{
+ cryptmethods[state->method_nr].decode_inplace_fn(state, buf, len, buf);
+}
+
+/*
+ * Free an allocated crypt key. Clear the text to make sure it doesn't stay
+ * in memory anywhere.
+ */
+ void
+crypt_free_key(key)
+ char_u *key;
+{
+ char_u *p;
+
+ if (key != NULL)
+ {
+ for (p = key; *p != NUL; ++p)
+ *p = 0;
+ vim_free(key);
+ }
+}
+
+/*
+ * Check the crypt method and give a warning if it's outdated.
+ */
+ void
+crypt_check_method(method)
+ int method;
+{
+ if (method < CRYPT_M_BF2)
+ {
+ msg_scroll = TRUE;
+ MSG(_("Warning: Using a weak encryption method; see :help 'cm'"));
+ }
+}
+
+ void
+crypt_check_current_method()
+{
+ crypt_check_method(crypt_get_method_nr(curbuf));
+}
+
+/*
+ * Ask the user for a crypt key.
+ * When "store" is TRUE, the new key is stored in the 'key' option, and the
+ * 'key' option value is returned: Don't free it.
+ * When "store" is FALSE, the typed key is returned in allocated memory.
+ * Returns NULL on failure.
+ */
+ char_u *
+crypt_get_key(store, twice)
+ int store;
+ int twice; /* Ask for the key twice. */
+{
+ char_u *p1, *p2 = NULL;
+ int round;
+
+ for (round = 0; ; ++round)
+ {
+ cmdline_star = TRUE;
+ cmdline_row = msg_row;
+ p1 = getcmdline_prompt(NUL, round == 0
+ ? (char_u *)_("Enter encryption key: ")
+ : (char_u *)_("Enter same key again: "), 0, EXPAND_NOTHING,
+ NULL);
+ cmdline_star = FALSE;
+
+ if (p1 == NULL)
+ break;
+
+ if (round == twice)
+ {
+ if (p2 != NULL && STRCMP(p1, p2) != 0)
+ {
+ MSG(_("Keys don't match!"));
+ crypt_free_key(p1);
+ crypt_free_key(p2);
+ p2 = NULL;
+ round = -1; /* do it again */
+ continue;
+ }
+
+ if (store)
+ {
+ set_option_value((char_u *)"key", 0L, p1, OPT_LOCAL);
+ crypt_free_key(p1);
+ p1 = curbuf->b_p_key;
+ }
+ break;
+ }
+ p2 = p1;
+ }
+
+ /* since the user typed this, no need to wait for return */
+ if (msg_didout)
+ msg_putchar('\n');
+ need_wait_return = FALSE;
+ msg_didout = FALSE;
+
+ crypt_free_key(p2);
+ return p1;
+}
+
+
+/*
+ * Append a message to IObuff for the encryption/decryption method being used.
+ */
+ void
+crypt_append_msg(buf)
+ buf_T *buf;
+{
+ if (crypt_get_method_nr(buf) == 0)
+ STRCAT(IObuff, _("[crypted]"));
+ else
+ {
+ STRCAT(IObuff, "[");
+ STRCAT(IObuff, *buf->b_p_cm == NUL ? p_cm : buf->b_p_cm);
+ STRCAT(IObuff, "]");
+ }
+}
+
+#endif /* FEAT_CRYPT */
diff --git a/src/crypt_zip.c b/src/crypt_zip.c
new file mode 100644
index 000000000..571f3ec74
--- /dev/null
+++ b/src/crypt_zip.c
@@ -0,0 +1,158 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * crypt_zip.c: Zip encryption support.
+ */
+#include "vim.h"
+
+#if defined(FEAT_CRYPT) || defined(PROTO)
+/*
+ * Optional encryption support.
+ * Mohsin Ahmed, mosh@sasi.com, 98-09-24
+ * Based on zip/crypt sources.
+ *
+ * NOTE FOR USA: Since 2000 exporting this code from the USA is allowed to
+ * most countries. There are a few exceptions, but that still should not be a
+ * problem since this code was originally created in Europe and India.
+ */
+
+/* Need a type that should be 32 bits. 64 also works but wastes space. */
+# if VIM_SIZEOF_INT >= 4
+typedef unsigned int u32_T; /* int is at least 32 bits */
+# else
+typedef unsigned long u32_T; /* long should be 32 bits or more */
+# endif
+
+/* The state of encryption, referenced by cryptstate_T. */
+typedef struct {
+ u32_T keys[3];
+} zip_state_T;
+
+
+static void make_crc_tab __ARGS((void));
+
+static u32_T crc_32_table[256];
+
+/*
+ * Fill the CRC table, if not done already.
+ */
+ static void
+make_crc_tab()
+{
+ u32_T s, t, v;
+ static int done = FALSE;
+
+ if (done)
+ return;
+ for (t = 0; t < 256; t++)
+ {
+ v = t;
+ for (s = 0; s < 8; s++)
+ v = (v >> 1) ^ ((v & 1) * (u32_T)0xedb88320L);
+ crc_32_table[t] = v;
+ }
+ done = TRUE;
+}
+
+#define CRC32(c, b) (crc_32_table[((int)(c) ^ (b)) & 0xff] ^ ((c) >> 8))
+
+/*
+ * Return the next byte in the pseudo-random sequence.
+ */
+#define DECRYPT_BYTE_ZIP(keys, t) { \
+ short_u temp = (short_u)keys[2] | 2; \
+ t = (int)(((unsigned)(temp * (temp ^ 1U)) >> 8) & 0xff); \
+}
+
+/*
+ * Update the encryption keys with the next byte of plain text.
+ */
+#define UPDATE_KEYS_ZIP(keys, c) { \
+ keys[0] = CRC32(keys[0], (c)); \
+ keys[1] += keys[0] & 0xff; \
+ keys[1] = keys[1] * 134775813L + 1; \
+ keys[2] = CRC32(keys[2], (int)(keys[1] >> 24)); \
+}
+
+/*
+ * Initialize for encryption/decryption.
+ */
+ void
+crypt_zip_init(state, key, salt, salt_len, seed, seed_len)
+ cryptstate_T *state;
+ char_u *key;
+ char_u *salt UNUSED;
+ int salt_len UNUSED;
+ char_u *seed UNUSED;
+ int seed_len UNUSED;
+{
+ char_u *p;
+ zip_state_T *zs;
+
+ zs = (zip_state_T *)alloc(sizeof(zip_state_T));
+ state->method_state = zs;
+
+ make_crc_tab();
+ zs->keys[0] = 305419896L;
+ zs->keys[1] = 591751049L;
+ zs->keys[2] = 878082192L;
+ for (p = key; *p != NUL; ++p)
+ {
+ UPDATE_KEYS_ZIP(zs->keys, (int)*p);
+ }
+}
+
+/*
+ * Encrypt "from[len]" into "to[len]".
+ * "from" and "to" can be equal to encrypt in place.
+ */
+ void
+crypt_zip_encode(state, from, len, to)
+ cryptstate_T *state;
+ char_u *from;
+ size_t len;
+ char_u *to;
+{
+ zip_state_T *zs = state->method_state;
+ size_t i;
+ int ztemp, t;
+
+ for (i = 0; i < len; ++i)
+ {
+ ztemp = from[i];
+ DECRYPT_BYTE_ZIP(zs->keys, t);
+ UPDATE_KEYS_ZIP(zs->keys, ztemp);
+ to[i] = t ^ ztemp;
+ }
+}
+
+/*
+ * Decrypt "from[len]" into "to[len]".
+ */
+ void
+crypt_zip_decode(state, from, len, to)
+ cryptstate_T *state;
+ char_u *from;
+ size_t len;
+ char_u *to;
+{
+ zip_state_T *zs = state->method_state;
+ size_t i;
+ short_u temp;
+
+ for (i = 0; i < len; ++i)
+ {
+ temp = (short_u)zs->keys[2] | 2;
+ temp = (int)(((unsigned)(temp * (temp ^ 1U)) >> 8) & 0xff);
+ UPDATE_KEYS_ZIP(zs->keys, to[i] = from[i] ^ temp);
+ }
+}
+
+#endif /* FEAT_CRYPT */
diff --git a/src/diff.c b/src/diff.c
index 98b791a72..caee6e5a5 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -2107,12 +2107,20 @@ diff_infold(wp, lnum)
* "dp" and "do" commands.
*/
void
-nv_diffgetput(put)
+nv_diffgetput(put, count)
int put;
+ long count;
{
exarg_T ea;
+ char_u buf[30];
- ea.arg = (char_u *)"";
+ if (count == 0)
+ ea.arg = (char_u *)"";
+ else
+ {
+ vim_snprintf((char *)buf, 30, "%ld", count);
+ ea.arg = buf;
+ }
if (put)
ea.cmdidx = CMD_diffput;
else
@@ -2325,7 +2333,7 @@ ex_diffgetput(eap)
end_skip = 0;
}
- buf_empty = FALSE;
+ buf_empty = bufempty();
added = 0;
for (i = 0; i < count; ++i)
{
diff --git a/src/edit.c b/src/edit.c
index f0d630a05..13faafeb7 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -4035,7 +4035,7 @@ expand_by_function(type, base)
goto theend;
}
curwin->w_cursor = pos; /* restore the cursor position */
- check_cursor();
+ validate_cursor();
if (!equalpos(curwin->w_cursor, pos))
{
EMSG(_(e_compldel));
@@ -4593,9 +4593,9 @@ ins_compl_delete()
i = compl_col + (compl_cont_status & CONT_ADDING ? compl_length : 0);
backspace_until_column(i);
- /* Not sure what is still valid, better redraw everything. */
+ /* TODO: is this sufficient for redrawing? Redrawing everything causes
+ * flicker, thus we can't do that. */
changed_cline_bef_curs();
- redraw_curbuf_later(NOT_VALID);
}
/* Insert the new text being completed. */
@@ -5273,7 +5273,7 @@ ins_complete(c)
return FAIL;
}
curwin->w_cursor = pos; /* restore the cursor position */
- check_cursor();
+ validate_cursor();
if (!equalpos(curwin->w_cursor, pos))
{
EMSG(_(e_compldel));
@@ -6131,6 +6131,12 @@ internal_format(textwidth, second_indent, flags, format_only, c)
int no_leader = FALSE;
int do_comments = (flags & INSCHAR_DO_COM);
#endif
+#ifdef FEAT_LINEBREAK
+ int has_lbr = curwin->w_p_lbr;
+
+ /* make sure win_lbr_chartabsize() counts correctly */
+ curwin->w_p_lbr = FALSE;
+#endif
/*
* When 'ai' is off we don't want a space under the cursor to be
@@ -6483,6 +6489,9 @@ internal_format(textwidth, second_indent, flags, format_only, c)
if (save_char != NUL) /* put back space after cursor */
pchar_cursor(save_char);
+#ifdef FEAT_LINEBREAK
+ curwin->w_p_lbr = has_lbr;
+#endif
if (!format_only && haveto_redraw)
{
update_topline();
@@ -6768,13 +6777,19 @@ stop_arrow()
{
if (arrow_used)
{
+ Insstart = curwin->w_cursor; /* new insertion starts here */
+ if (Insstart.col > Insstart_orig.col && !ins_need_undo)
+ /* Don't update the original insert position when moved to the
+ * right, except when nothing was inserted yet. */
+ update_Insstart_orig = FALSE;
+ Insstart_textlen = (colnr_T)linetabsize(ml_get_curline());
+
if (u_save_cursor() == OK)
{
arrow_used = FALSE;
ins_need_undo = FALSE;
}
- Insstart = curwin->w_cursor; /* new insertion starts here */
- Insstart_textlen = (colnr_T)linetabsize(ml_get_curline());
+
ai_col = 0;
#ifdef FEAT_VREPLACE
if (State & VREPLACE_FLAG)
@@ -6901,8 +6916,14 @@ stop_insert(end_insert_pos, esc, nomove)
}
if (curwin->w_cursor.lnum != tpos.lnum)
curwin->w_cursor = tpos;
- else if (cc != NUL)
- ++curwin->w_cursor.col; /* put cursor back on the NUL */
+ else
+ {
+ /* reset tpos, could have been invalidated in the loop above */
+ tpos = curwin->w_cursor;
+ tpos.col++;
+ if (cc != NUL && gchar_pos(&tpos) == NUL)
+ ++curwin->w_cursor.col; /* put cursor back on the NUL */
+ }
/* <C-S-Right> may have started Visual mode, adjust the position for
* deleted characters. */
@@ -8389,7 +8410,7 @@ ins_esc(count, cmdchar, nomove)
(void)start_redo_ins();
if (cmdchar == 'r' || cmdchar == 'v')
- stuffReadbuff(ESC_STR); /* no ESC in redo buffer */
+ stuffRedoReadbuff(ESC_STR); /* no ESC in redo buffer */
++RedrawingDisabled;
disabled_redraw = TRUE;
return FALSE; /* repeat the insert */
@@ -8833,6 +8854,7 @@ ins_bs(c, mode, inserted_space_p)
return FALSE;
--Insstart_orig.lnum;
Insstart_orig.col = MAXCOL;
+ Insstart = Insstart_orig;
}
/*
* In replace mode:
diff --git a/src/eval.c b/src/eval.c
index aedbaa4ce..fbe824eec 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -554,6 +554,7 @@ static void f_getcharmod __ARGS((typval_T *argvars, typval_T *rettv));
static void f_getcmdline __ARGS((typval_T *argvars, typval_T *rettv));
static void f_getcmdpos __ARGS((typval_T *argvars, typval_T *rettv));
static void f_getcmdtype __ARGS((typval_T *argvars, typval_T *rettv));
+static void f_getcmdwintype __ARGS((typval_T *argvars, typval_T *rettv));
static void f_getcwd __ARGS((typval_T *argvars, typval_T *rettv));
static void f_getfontname __ARGS((typval_T *argvars, typval_T *rettv));
static void f_getfperm __ARGS((typval_T *argvars, typval_T *rettv));
@@ -2944,6 +2945,23 @@ set_var_lval(lp, endp, rettv, copy, op)
;
else if (lp->ll_range)
{
+ listitem_T *ll_li = lp->ll_li;
+ int ll_n1 = lp->ll_n1;
+
+ /*
+ * Check whether any of the list items is locked
+ */
+ for (ri = rettv->vval.v_list->lv_first; ri != NULL && ll_li != NULL; )
+ {
+ if (tv_check_lock(ll_li->li_tv.v_lock, lp->ll_name))
+ return;
+ ri = ri->li_next;
+ if (ri == NULL || (!lp->ll_empty2 && lp->ll_n2 == ll_n1))
+ break;
+ ll_li = ll_li->li_next;
+ ++ll_n1;
+ }
+
/*
* Assign the List values to the list items.
*/
@@ -3350,11 +3368,11 @@ set_context_for_expression(xp, arg, cmdidx)
got_eq = TRUE;
xp->xp_context = EXPAND_EXPRESSION;
}
- else if (c == '<'
+ else if ((c == '<' || c == '#')
&& xp->xp_context == EXPAND_FUNCTIONS
&& vim_strchr(xp->xp_pattern, '(') == NULL)
{
- /* Function name can start with "<SNR>" */
+ /* Function name can start with "<SNR>" and contain '#'. */
break;
}
else if (cmdidx != CMD_let || got_eq)
@@ -3645,6 +3663,17 @@ do_unlet_var(lp, name_end, forceit)
else if (lp->ll_range)
{
listitem_T *li;
+ listitem_T *ll_li = lp->ll_li;
+ int ll_n1 = lp->ll_n1;
+
+ while (ll_li != NULL && (lp->ll_empty2 || lp->ll_n2 >= ll_n1))
+ {
+ li = ll_li->li_next;
+ if (tv_check_lock(ll_li->li_tv.v_lock, lp->ll_name))
+ return FAIL;
+ ll_li = li;
+ ++ll_n1;
+ }
/* Delete a range of List items. */
while (lp->ll_li != NULL && (lp->ll_empty2 || lp->ll_n2 >= lp->ll_n1))
@@ -7984,6 +8013,7 @@ static struct fst
{"getcmdline", 0, 0, f_getcmdline},
{"getcmdpos", 0, 0, f_getcmdpos},
{"getcmdtype", 0, 0, f_getcmdtype},
+ {"getcmdwintype", 0, 0, f_getcmdwintype},
{"getcurpos", 0, 0, f_getcurpos},
{"getcwd", 0, 0, f_getcwd},
{"getfontname", 0, 1, f_getfontname},
@@ -10690,18 +10720,20 @@ filter_map(argvars, rettv, map)
{
if (!HASHITEM_EMPTY(hi))
{
+ int r;
+
--todo;
di = HI2DI(hi);
if (tv_check_lock(di->di_tv.v_lock,
(char_u *)_(arg_errmsg)))
break;
vimvars[VV_KEY].vv_str = vim_strsave(di->di_key);
- if (filter_map_one(&di->di_tv, expr, map, &rem) == FAIL
- || did_emsg)
+ r = filter_map_one(&di->di_tv, expr, map, &rem);
+ clear_tv(&vimvars[VV_KEY].vv_tv);
+ if (r == FAIL || did_emsg)
break;
if (!map && rem)
dictitem_remove(d, di);
- clear_tv(&vimvars[VV_KEY].vv_tv);
}
}
hash_unlock(ht);
@@ -10752,6 +10784,7 @@ filter_map_one(tv, expr, map, remp)
if (*s != NUL) /* check for trailing chars after expr */
{
EMSG2(_(e_invexpr2), s);
+ clear_tv(&rettv);
goto theend;
}
if (map)
@@ -11503,6 +11536,26 @@ f_getcmdtype(argvars, rettv)
}
/*
+ * "getcmdwintype()" function
+ */
+ static void
+f_getcmdwintype(argvars, rettv)
+ typval_T *argvars UNUSED;
+ typval_T *rettv;
+{
+ rettv->v_type = VAR_STRING;
+ rettv->vval.v_string = NULL;
+#ifdef FEAT_CMDWIN
+ rettv->vval.v_string = alloc(2);
+ if (rettv->vval.v_string != NULL)
+ {
+ rettv->vval.v_string[0] = cmdwin_type;
+ rettv->vval.v_string[1] = NUL;
+ }
+#endif
+}
+
+/*
* "getcwd()" function
*/
static void
@@ -11958,6 +12011,8 @@ f_getreg(argvars, rettv)
rettv->v_type = VAR_LIST;
rettv->vval.v_list = (list_T *)get_reg_contents(regname,
(arg2 ? GREG_EXPR_SRC : 0) | GREG_LIST);
+ if (rettv->vval.v_list != NULL)
+ ++rettv->vval.v_list->lv_refcount;
}
else
{
@@ -12021,7 +12076,8 @@ f_gettabvar(argvars, rettv)
typval_T *argvars;
typval_T *rettv;
{
- tabpage_T *tp;
+ win_T *oldcurwin;
+ tabpage_T *tp, *oldtabpage;
dictitem_T *v;
char_u *varname;
int done = FALSE;
@@ -12033,13 +12089,23 @@ f_gettabvar(argvars, rettv)
tp = find_tabpage((int)get_tv_number_chk(&argvars[0], NULL));
if (tp != NULL && varname != NULL)
{
- /* look up the variable */
- v = find_var_in_ht(&tp->tp_vars->dv_hashtab, 0, varname, FALSE);
- if (v != NULL)
+ /* Set tp to be our tabpage, temporarily. Also set the window to the
+ * first window in the tabpage, otherwise the window is not valid. */
+ if (switch_win(&oldcurwin, &oldtabpage, tp->tp_firstwin, tp, TRUE)
+ == OK)
{
- copy_tv(&v->di_tv, rettv);
- done = TRUE;
+ /* look up the variable */
+ /* Let gettabvar({nr}, "") return the "t:" dictionary. */
+ v = find_var_in_ht(&tp->tp_vars->dv_hashtab, 't', varname, FALSE);
+ if (v != NULL)
+ {
+ copy_tv(&v->di_tv, rettv);
+ done = TRUE;
+ }
}
+
+ /* restore previous notion of curwin */
+ restore_win(oldcurwin, oldtabpage, TRUE);
}
if (!done && argvars[2].v_type != VAR_UNKNOWN)
@@ -12174,22 +12240,24 @@ getwinvar(argvars, rettv, off)
{
/* Set curwin to be our win, temporarily. Also set the tabpage,
* otherwise the window is not valid. */
- switch_win(&oldcurwin, &oldtabpage, win, tp, TRUE);
-
- if (*varname == '&') /* window-local-option */
- {
- if (get_option_tv(&varname, rettv, 1) == OK)
- done = TRUE;
- }
- else
+ if (switch_win(&oldcurwin, &oldtabpage, win, tp, TRUE) == OK)
{
- /* Look up the variable. */
- /* Let getwinvar({nr}, "") return the "w:" dictionary. */
- v = find_var_in_ht(&win->w_vars->dv_hashtab, 'w', varname, FALSE);
- if (v != NULL)
+ if (*varname == '&') /* window-local-option */
{
- copy_tv(&v->di_tv, rettv);
- done = TRUE;
+ if (get_option_tv(&varname, rettv, 1) == OK)
+ done = TRUE;
+ }
+ else
+ {
+ /* Look up the variable. */
+ /* Let getwinvar({nr}, "") return the "w:" dictionary. */
+ v = find_var_in_ht(&win->w_vars->dv_hashtab, 'w',
+ varname, FALSE);
+ if (v != NULL)
+ {
+ copy_tv(&v->di_tv, rettv);
+ done = TRUE;
+ }
}
}
@@ -12442,6 +12510,9 @@ f_has(argvars, rettv)
#ifdef FEAT_DIGRAPHS
"digraphs",
#endif
+#ifdef FEAT_DIRECTX
+ "directx",
+#endif
#ifdef FEAT_DND
"dnd",
#endif
@@ -17190,34 +17261,33 @@ setwinvar(argvars, rettv, off)
if (win != NULL && varname != NULL && varp != NULL)
{
#ifdef FEAT_WINDOWS
- if (switch_win(&save_curwin, &save_curtab, win, tp, TRUE) == FAIL)
- return;
+ if (switch_win(&save_curwin, &save_curtab, win, tp, TRUE) == OK)
#endif
-
- if (*varname == '&')
- {
- long numval;
- char_u *strval;
- int error = FALSE;
-
- ++varname;
- numval = get_tv_number_chk(varp, &error);
- strval = get_tv_string_buf_chk(varp, nbuf);
- if (!error && strval != NULL)
- set_option_value(varname, numval, strval, OPT_LOCAL);
- }
- else
{
- winvarname = alloc((unsigned)STRLEN(varname) + 3);
- if (winvarname != NULL)
+ if (*varname == '&')
{
- STRCPY(winvarname, "w:");
- STRCPY(winvarname + 2, varname);
- set_var(winvarname, varp, TRUE);
- vim_free(winvarname);
+ long numval;
+ char_u *strval;
+ int error = FALSE;
+
+ ++varname;
+ numval = get_tv_number_chk(varp, &error);
+ strval = get_tv_string_buf_chk(varp, nbuf);
+ if (!error && strval != NULL)
+ set_option_value(varname, numval, strval, OPT_LOCAL);
+ }
+ else
+ {
+ winvarname = alloc((unsigned)STRLEN(varname) + 3);
+ if (winvarname != NULL)
+ {
+ STRCPY(winvarname, "w:");
+ STRCPY(winvarname + 2, varname);
+ set_var(winvarname, varp, TRUE);
+ vim_free(winvarname);
+ }
}
}
-
#ifdef FEAT_WINDOWS
restore_win(save_curwin, save_curtab, TRUE);
#endif
@@ -17357,16 +17427,38 @@ item_compare(s1, s2)
const void *s2;
{
sortItem_T *si1, *si2;
+ typval_T *tv1, *tv2;
char_u *p1, *p2;
- char_u *tofree1, *tofree2;
+ char_u *tofree1 = NULL, *tofree2 = NULL;
int res;
char_u numbuf1[NUMBUFLEN];
char_u numbuf2[NUMBUFLEN];
si1 = (sortItem_T *)s1;
si2 = (sortItem_T *)s2;
- p1 = tv2string(&si1->item->li_tv, &tofree1, numbuf1, 0);
- p2 = tv2string(&si2->item->li_tv, &tofree2, numbuf2, 0);
+ tv1 = &si1->item->li_tv;
+ tv2 = &si2->item->li_tv;
+ /* tv2string() puts quotes around a string and allocates memory. Don't do
+ * that for string variables. Use a single quote when comparing with a
+ * non-string to do what the docs promise. */
+ if (tv1->v_type == VAR_STRING)
+ {
+ if (tv2->v_type != VAR_STRING || item_compare_numeric)
+ p1 = (char_u *)"'";
+ else
+ p1 = tv1->vval.v_string;
+ }
+ else
+ p1 = tv2string(tv1, &tofree1, numbuf1, 0);
+ if (tv2->v_type == VAR_STRING)
+ {
+ if (tv1->v_type != VAR_STRING || item_compare_numeric)
+ p2 = (char_u *)"'";
+ else
+ p2 = tv2->vval.v_string;
+ }
+ else
+ p2 = tv2string(tv2, &tofree2, numbuf2, 0);
if (p1 == NULL)
p1 = (char_u *)"";
if (p2 == NULL)
@@ -17386,8 +17478,8 @@ item_compare(s1, s2)
res = n1 == n2 ? 0 : n1 > n2 ? 1 : -1;
}
- /* When the result would be zero, compare the pointers themselves. Makes
- * the sort stable. */
+ /* When the result would be zero, compare the item indexes. Makes the
+ * sort stable. */
if (res == 0 && !item_compare_keep_zero)
res = si1->idx > si2->idx ? 1 : -1;
@@ -18519,6 +18611,7 @@ get_cmd_output_as_rettv(argvars, rettv, retlist)
int err = FALSE;
FILE *fd;
list_T *list = NULL;
+ int flags = SHELL_SILENT;
rettv->v_type = VAR_STRING;
rettv->vval.v_string = NULL;
@@ -18550,13 +18643,16 @@ get_cmd_output_as_rettv(argvars, rettv, retlist)
}
else
{
+ size_t len;
+
p = get_tv_string_buf_chk(&argvars[1], buf);
if (p == NULL)
{
fclose(fd);
goto errret; /* type error; errmsg already given */
}
- if (fwrite(p, STRLEN(p), 1, fd) != 1)
+ len = STRLEN(p);
+ if (len > 0 && fwrite(p, len, 1, fd) != 1)
err = TRUE;
}
if (fclose(fd) != 0)
@@ -18568,6 +18664,11 @@ get_cmd_output_as_rettv(argvars, rettv, retlist)
}
}
+ /* Omit SHELL_COOKED when invoked with ":silent". Avoids that the shell
+ * echoes typeahead, that messes up the display. */
+ if (!msg_silent)
+ flags += SHELL_COOKED;
+
if (retlist)
{
int len;
@@ -18577,8 +18678,7 @@ get_cmd_output_as_rettv(argvars, rettv, retlist)
char_u *end;
int i;
- res = get_cmd_output(get_tv_string(&argvars[0]), infile,
- SHELL_SILENT | SHELL_COOKED, &len);
+ res = get_cmd_output(get_tv_string(&argvars[0]), infile, flags, &len);
if (res == NULL)
goto errret;
@@ -18619,8 +18719,7 @@ get_cmd_output_as_rettv(argvars, rettv, retlist)
}
else
{
- res = get_cmd_output(get_tv_string(&argvars[0]), infile,
- SHELL_SILENT | SHELL_COOKED, NULL);
+ res = get_cmd_output(get_tv_string(&argvars[0]), infile, flags, NULL);
#ifdef USE_CR
/* translate <CR> into <NL> */
if (res != NULL)
@@ -19482,7 +19581,7 @@ f_winrestview(argvars, rettv)
# endif
changed_window_setting();
- if (curwin->w_topline == 0)
+ if (curwin->w_topline <= 0)
curwin->w_topline = 1;
if (curwin->w_topline > curbuf->b_ml.ml_line_count)
curwin->w_topline = curbuf->b_ml.ml_line_count;
@@ -19595,6 +19694,7 @@ f_writefile(argvars, rettv)
typval_T *rettv;
{
int binary = FALSE;
+ int append = FALSE;
char_u *fname;
FILE *fd;
int ret = 0;
@@ -19610,14 +19710,19 @@ f_writefile(argvars, rettv)
if (argvars[0].vval.v_list == NULL)
return;
- if (argvars[2].v_type != VAR_UNKNOWN
- && STRCMP(get_tv_string(&argvars[2]), "b") == 0)
- binary = TRUE;
+ if (argvars[2].v_type != VAR_UNKNOWN)
+ {
+ if (vim_strchr(get_tv_string(&argvars[2]), 'b') != NULL)
+ binary = TRUE;
+ if (vim_strchr(get_tv_string(&argvars[2]), 'a') != NULL)
+ append = TRUE;
+ }
/* Always open the file in binary mode, library functions have a mind of
* their own about CR-LF conversion. */
fname = get_tv_string(&argvars[1]);
- if (*fname == NUL || (fd = mch_fopen((char *)fname, WRITEBIN)) == NULL)
+ if (*fname == NUL || (fd = mch_fopen((char *)fname,
+ append ? APPENDBIN : WRITEBIN)) == NULL)
{
EMSG2(_(e_notcreate), *fname == NUL ? (char_u *)_("<empty>") : fname);
ret = -1;
@@ -22178,14 +22283,11 @@ ex_function(eap)
if (*p == '!')
p = skipwhite(p + 1);
p += eval_fname_script(p);
- if (ASCII_ISALPHA(*p))
+ vim_free(trans_function_name(&p, TRUE, 0, NULL));
+ if (*skipwhite(p) == '(')
{
- vim_free(trans_function_name(&p, TRUE, 0, NULL));
- if (*skipwhite(p) == '(')
- {
- ++nesting;
- indent += 2;
- }
+ ++nesting;
+ indent += 2;
}
}
@@ -24660,7 +24762,7 @@ repeat:
p = alloc(_MAX_PATH + 1);
if (p != NULL)
{
- if (GetLongPathName(*fnamep, p, MAXPATHL))
+ if (GetLongPathName(*fnamep, p, _MAX_PATH))
{
vim_free(*bufp);
*bufp = *fnamep = p;
@@ -24982,6 +25084,7 @@ do_string_sub(str, pat, sub, flags)
int i;
int do_all;
char_u *tail;
+ char_u *end;
garray_T ga;
char_u *ret;
char_u *save_cpo;
@@ -25000,6 +25103,7 @@ do_string_sub(str, pat, sub, flags)
if (regmatch.regprog != NULL)
{
tail = str;
+ end = str + STRLEN(str);
while (vim_regexec_nl(&regmatch, str, (colnr_T)(tail - str)))
{
/* Skip empty match except for first match. */
@@ -25026,7 +25130,7 @@ do_string_sub(str, pat, sub, flags)
* - The text after the match.
*/
sublen = vim_regsub(&regmatch, sub, tail, FALSE, TRUE, FALSE);
- if (ga_grow(&ga, (int)(STRLEN(tail) + sublen -
+ if (ga_grow(&ga, (int)((end - tail) + sublen -
(regmatch.endp[0] - regmatch.startp[0]))) == FAIL)
{
ga_clear(&ga);
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 62621bfa5..8195eb71b 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -34,6 +34,7 @@ static int
_RTLENTRYF
#endif
help_compare __ARGS((const void *s1, const void *s2));
+static void prepare_help_buffer __ARGS((void));
/*
* ":ascii" and "ga".
@@ -3531,71 +3532,15 @@ do_ecmd(fnum, ffname, sfname, eap, newlnum, flags, oldwin)
oldbuf = (flags & ECMD_OLDBUF);
}
- if ((flags & ECMD_SET_HELP) || keep_help_flag)
- {
- char_u *p;
-
- curbuf->b_help = TRUE;
-#ifdef FEAT_QUICKFIX
- set_string_option_direct((char_u *)"buftype", -1,
- (char_u *)"help", OPT_FREE|OPT_LOCAL, 0);
-#endif
-
- /*
- * Always set these options after jumping to a help tag, because the
- * user may have an autocommand that gets in the way.
- * Accept all ASCII chars for keywords, except ' ', '*', '"', '|', and
- * latin1 word characters (for translated help files).
- * Only set it when needed, buf_init_chartab() is some work.
- */
- p =
-#ifdef EBCDIC
- (char_u *)"65-255,^*,^|,^\"";
-#else
- (char_u *)"!-~,^*,^|,^\",192-255";
-#endif
- if (STRCMP(curbuf->b_p_isk, p) != 0)
- {
- set_string_option_direct((char_u *)"isk", -1, p,
- OPT_FREE|OPT_LOCAL, 0);
- check_buf_options(curbuf);
- (void)buf_init_chartab(curbuf, FALSE);
- }
-
- curbuf->b_p_ts = 8; /* 'tabstop' is 8 */
- curwin->w_p_list = FALSE; /* no list mode */
-
- curbuf->b_p_ma = FALSE; /* not modifiable */
- curbuf->b_p_bin = FALSE; /* reset 'bin' before reading file */
- curwin->w_p_nu = 0; /* no line numbers */
- curwin->w_p_rnu = 0; /* no relative line numbers */
- RESET_BINDING(curwin); /* no scroll or cursor binding */
-#ifdef FEAT_ARABIC
- curwin->w_p_arab = FALSE; /* no arabic mode */
-#endif
-#ifdef FEAT_RIGHTLEFT
- curwin->w_p_rl = FALSE; /* help window is left-to-right */
-#endif
-#ifdef FEAT_FOLDING
- curwin->w_p_fen = FALSE; /* No folding in the help window */
-#endif
-#ifdef FEAT_DIFF
- curwin->w_p_diff = FALSE; /* No 'diff' */
-#endif
-#ifdef FEAT_SPELL
- curwin->w_p_spell = FALSE; /* No spell checking */
-#endif
-
#ifdef FEAT_AUTOCMD
- buf = curbuf;
+ buf = curbuf;
#endif
- set_buflisted(FALSE);
+ if ((flags & ECMD_SET_HELP) || keep_help_flag)
+ {
+ prepare_help_buffer();
}
else
{
-#ifdef FEAT_AUTOCMD
- buf = curbuf;
-#endif
/* Don't make a buffer listed if it's a help buffer. Useful when
* using CTRL-O to go back to a help file. */
if (!curbuf->b_help)
@@ -4011,11 +3956,19 @@ ex_append(eap)
eap->nextcmd = p;
}
else
+ {
+ int save_State = State;
+
+ /* Set State to avoid the cursor shape to be set to INSERT mode
+ * when getline() returns. */
+ State = CMDLINE;
theline = eap->getline(
#ifdef FEAT_EVAL
eap->cstack->cs_looplevel > 0 ? -1 :
#endif
NUL, eap->cookie, indent);
+ State = save_State;
+ }
lines_left = Rows - 1;
if (theline == NULL)
break;
@@ -4455,6 +4408,8 @@ do_sub(eap)
&& (*cmd == NUL || (cmd[1] == NUL && (*cmd == 'g' || *cmd == 'l'
|| *cmd == 'p' || *cmd == '#'))))
{
+ linenr_T joined_lines_count;
+
curwin->w_cursor.lnum = eap->line1;
if (*cmd == 'l')
eap->flags = EXFLAG_LIST;
@@ -4463,10 +4418,27 @@ do_sub(eap)
else if (*cmd == 'p')
eap->flags = EXFLAG_PRINT;
- (void)do_join(eap->line2 - eap->line1 + 1, FALSE, TRUE, FALSE, TRUE);
- sub_nlines = sub_nsubs = eap->line2 - eap->line1 + 1;
- (void)do_sub_msg(FALSE);
- ex_may_print(eap);
+ /* The number of lines joined is the number of lines in the range plus
+ * one. One less when the last line is included. */
+ joined_lines_count = eap->line2 - eap->line1 + 1;
+ if (eap->line2 < curbuf->b_ml.ml_line_count)
+ ++joined_lines_count;
+ if (joined_lines_count > 1)
+ {
+ (void)do_join(joined_lines_count, FALSE, TRUE, FALSE, TRUE);
+ sub_nsubs = joined_lines_count - 1;
+ sub_nlines = 1;
+ (void)do_sub_msg(FALSE);
+ ex_may_print(eap);
+ }
+
+ if (!cmdmod.keeppatterns)
+ save_re_pat(RE_SUBST, pat, p_magic);
+#ifdef FEAT_CMDHIST
+ /* put pattern in history */
+ add_to_history(HIST_SEARCH, pat, TRUE, NUL);
+#endif
+
return;
}
@@ -5514,7 +5486,15 @@ ex_global(eap)
smsg((char_u *)_("Pattern not found: %s"), pat);
}
else
+ {
+#ifdef FEAT_CLIPBOARD
+ start_global_changes();
+#endif
global_exe(cmd);
+#ifdef FEAT_CLIPBOARD
+ end_global_changes();
+#endif
+ }
ml_clearmarked(); /* clear rest of the marks */
vim_regfree(regmatch.regprog);
@@ -5883,6 +5863,26 @@ erret:
vim_free(tag);
}
+/*
+ * ":helpclose": Close one help window
+ */
+ void
+ex_helpclose(eap)
+ exarg_T *eap UNUSED;
+{
+#if defined(FEAT_WINDOWS)
+ win_T *win;
+
+ FOR_ALL_WINDOWS(win)
+ {
+ if (win->w_buffer->b_help)
+ {
+ win_close(win, FALSE);
+ return;
+ }
+ }
+#endif
+}
#if defined(FEAT_MULTI_LANG) || defined(PROTO)
/*
@@ -6186,6 +6186,73 @@ find_help_tags(arg, num_matches, matches, keep_lang)
}
/*
+ * Called when starting to edit a buffer for a help file.
+ */
+ static void
+prepare_help_buffer()
+{
+ char_u *p;
+
+ curbuf->b_help = TRUE;
+#ifdef FEAT_QUICKFIX
+ set_string_option_direct((char_u *)"buftype", -1,
+ (char_u *)"help", OPT_FREE|OPT_LOCAL, 0);
+#endif
+
+ /*
+ * Always set these options after jumping to a help tag, because the
+ * user may have an autocommand that gets in the way.
+ * Accept all ASCII chars for keywords, except ' ', '*', '"', '|', and
+ * latin1 word characters (for translated help files).
+ * Only set it when needed, buf_init_chartab() is some work.
+ */
+ p =
+#ifdef EBCDIC
+ (char_u *)"65-255,^*,^|,^\"";
+#else
+ (char_u *)"!-~,^*,^|,^\",192-255";
+#endif
+ if (STRCMP(curbuf->b_p_isk, p) != 0)
+ {
+ set_string_option_direct((char_u *)"isk", -1, p, OPT_FREE|OPT_LOCAL, 0);
+ check_buf_options(curbuf);
+ (void)buf_init_chartab(curbuf, FALSE);
+ }
+
+#ifdef FEAT_FOLDING
+ /* Don't use the global foldmethod.*/
+ set_string_option_direct((char_u *)"fdm", -1, (char_u *)"manual",
+ OPT_FREE|OPT_LOCAL, 0);
+#endif
+
+ curbuf->b_p_ts = 8; /* 'tabstop' is 8 */
+ curwin->w_p_list = FALSE; /* no list mode */
+
+ curbuf->b_p_ma = FALSE; /* not modifiable */
+ curbuf->b_p_bin = FALSE; /* reset 'bin' before reading file */
+ curwin->w_p_nu = 0; /* no line numbers */
+ curwin->w_p_rnu = 0; /* no relative line numbers */
+ RESET_BINDING(curwin); /* no scroll or cursor binding */
+#ifdef FEAT_ARABIC
+ curwin->w_p_arab = FALSE; /* no arabic mode */
+#endif
+#ifdef FEAT_RIGHTLEFT
+ curwin->w_p_rl = FALSE; /* help window is left-to-right */
+#endif
+#ifdef FEAT_FOLDING
+ curwin->w_p_fen = FALSE; /* No folding in the help window */
+#endif
+#ifdef FEAT_DIFF
+ curwin->w_p_diff = FALSE; /* No 'diff' */
+#endif
+#ifdef FEAT_SPELL
+ curwin->w_p_spell = FALSE; /* No spell checking */
+#endif
+
+ set_buflisted(FALSE);
+}
+
+/*
* After reading a help file: May cleanup a help buffer when syntax
* highlighting is not used.
*/
diff --git a/src/ex_cmds.h b/src/ex_cmds.h
index 41d3a642d..50e82521a 100644
--- a/src/ex_cmds.h
+++ b/src/ex_cmds.h
@@ -58,6 +58,14 @@
#define WORD1 (EXTRA | NOSPC) /* one extra word allowed */
#define FILE1 (FILES | NOSPC) /* 1 file allowed, defaults to current file */
+/* values for cmd_addr_type */
+#define ADDR_LINES 0
+#define ADDR_WINDOWS 1
+#define ADDR_ARGUMENTS 2
+#define ADDR_LOADED_BUFFERS 3
+#define ADDR_BUFFERS 4
+#define ADDR_TABS 5
+
#ifndef DO_DECLARE_EXCMD
typedef struct exarg exarg_T;
#endif
@@ -74,7 +82,7 @@ typedef struct exarg exarg_T;
# undef EX /* just in case */
#endif
#ifdef DO_DECLARE_EXCMD
-# define EX(a, b, c, d) {(char_u *)b, c, (long_u)(d)}
+# define EX(a, b, c, d, e) {(char_u *)b, c, (long_u)(d), e}
typedef void (*ex_func_T) __ARGS((exarg_T *eap));
@@ -83,1062 +91,1588 @@ static struct cmdname
char_u *cmd_name; /* name of the command */
ex_func_T cmd_func; /* function for this command */
long_u cmd_argt; /* flags declared above */
+ int cmd_addr_type; /* flag for address type */
}
# if defined(FEAT_GUI_W16)
_far
# endif
cmdnames[] =
#else
-# define EX(a, b, c, d) a
+# define EX(a, b, c, d, e) a
enum CMD_index
#endif
{
EX(CMD_append, "append", ex_append,
- BANG|RANGE|ZEROR|TRLBAR|CMDWIN|MODIFY),
+ BANG|RANGE|ZEROR|TRLBAR|CMDWIN|MODIFY,
+ ADDR_LINES),
EX(CMD_abbreviate, "abbreviate", ex_abbreviate,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_abclear, "abclear", ex_abclear,
- EXTRA|TRLBAR|CMDWIN),
+ EXTRA|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_aboveleft, "aboveleft", ex_wrongmodifier,
- NEEDARG|EXTRA|NOTRLCOM),
+ NEEDARG|EXTRA|NOTRLCOM,
+ ADDR_LINES),
EX(CMD_all, "all", ex_all,
- BANG|RANGE|NOTADR|COUNT|TRLBAR),
+ BANG|RANGE|NOTADR|COUNT|TRLBAR,
+ ADDR_LINES),
EX(CMD_amenu, "amenu", ex_menu,
- RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_anoremenu, "anoremenu", ex_menu,
- RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_args, "args", ex_args,
- BANG|FILES|EDITCMD|ARGOPT|TRLBAR),
+ BANG|FILES|EDITCMD|ARGOPT|TRLBAR,
+ ADDR_LINES),
EX(CMD_argadd, "argadd", ex_argadd,
- BANG|NEEDARG|RANGE|NOTADR|ZEROR|FILES|TRLBAR),
+ BANG|NEEDARG|RANGE|NOTADR|ZEROR|FILES|TRLBAR,
+ ADDR_ARGUMENTS),
EX(CMD_argdelete, "argdelete", ex_argdelete,
- BANG|RANGE|NOTADR|FILES|TRLBAR),
+ BANG|RANGE|NOTADR|FILES|TRLBAR,
+ ADDR_ARGUMENTS),
EX(CMD_argdo, "argdo", ex_listdo,
- BANG|NEEDARG|EXTRA|NOTRLCOM),
+ BANG|NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL,
+ ADDR_ARGUMENTS),
EX(CMD_argedit, "argedit", ex_argedit,
- BANG|NEEDARG|RANGE|NOTADR|FILE1|EDITCMD|ARGOPT|TRLBAR),
+ BANG|NEEDARG|RANGE|NOTADR|FILE1|EDITCMD|ARGOPT|TRLBAR,
+ ADDR_ARGUMENTS),
EX(CMD_argglobal, "argglobal", ex_args,
- BANG|FILES|EDITCMD|ARGOPT|TRLBAR),
+ BANG|FILES|EDITCMD|ARGOPT|TRLBAR,
+ ADDR_LINES),
EX(CMD_arglocal, "arglocal", ex_args,
- BANG|FILES|EDITCMD|ARGOPT|TRLBAR),
+ BANG|FILES|EDITCMD|ARGOPT|TRLBAR,
+ ADDR_LINES),
EX(CMD_argument, "argument", ex_argument,
- BANG|RANGE|NOTADR|COUNT|EXTRA|EDITCMD|ARGOPT|TRLBAR),
+ BANG|RANGE|NOTADR|COUNT|EXTRA|EDITCMD|ARGOPT|TRLBAR,
+ ADDR_ARGUMENTS),
EX(CMD_ascii, "ascii", do_ascii,
- TRLBAR|SBOXOK|CMDWIN),
+ TRLBAR|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_autocmd, "autocmd", ex_autocmd,
- BANG|EXTRA|NOTRLCOM|USECTRLV|CMDWIN),
+ BANG|EXTRA|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_augroup, "augroup", ex_autocmd,
- BANG|WORD1|TRLBAR|CMDWIN),
+ BANG|WORD1|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_aunmenu, "aunmenu", ex_menu,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_buffer, "buffer", ex_buffer,
- BANG|RANGE|NOTADR|BUFNAME|BUFUNL|COUNT|EXTRA|TRLBAR),
+ BANG|RANGE|NOTADR|BUFNAME|BUFUNL|COUNT|EXTRA|EDITCMD|TRLBAR,
+ ADDR_BUFFERS),
EX(CMD_bNext, "bNext", ex_bprevious,
- BANG|RANGE|NOTADR|COUNT|TRLBAR),
+ BANG|RANGE|NOTADR|COUNT|EDITCMD|TRLBAR,
+ ADDR_LINES),
EX(CMD_ball, "ball", ex_buffer_all,
- RANGE|NOTADR|COUNT|TRLBAR),
+ RANGE|NOTADR|COUNT|TRLBAR,
+ ADDR_LINES),
EX(CMD_badd, "badd", ex_edit,
- NEEDARG|FILE1|EDITCMD|TRLBAR|CMDWIN),
+ NEEDARG|FILE1|EDITCMD|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_bdelete, "bdelete", ex_bunload,
- BANG|RANGE|NOTADR|BUFNAME|COUNT|EXTRA|TRLBAR),
+ BANG|RANGE|NOTADR|BUFNAME|COUNT|EXTRA|TRLBAR,
+ ADDR_LOADED_BUFFERS),
EX(CMD_behave, "behave", ex_behave,
- NEEDARG|WORD1|TRLBAR|CMDWIN),
+ NEEDARG|WORD1|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_belowright, "belowright", ex_wrongmodifier,
- NEEDARG|EXTRA|NOTRLCOM),
+ NEEDARG|EXTRA|NOTRLCOM,
+ ADDR_LINES),
EX(CMD_bfirst, "bfirst", ex_brewind,
- BANG|RANGE|NOTADR|TRLBAR),
+ BANG|RANGE|NOTADR|EDITCMD|TRLBAR,
+ ADDR_LINES),
EX(CMD_blast, "blast", ex_blast,
- BANG|RANGE|NOTADR|TRLBAR),
+ BANG|RANGE|NOTADR|EDITCMD|TRLBAR,
+ ADDR_LINES),
EX(CMD_bmodified, "bmodified", ex_bmodified,
- BANG|RANGE|NOTADR|COUNT|TRLBAR),
+ BANG|RANGE|NOTADR|COUNT|EDITCMD|TRLBAR,
+ ADDR_LINES),
EX(CMD_bnext, "bnext", ex_bnext,
- BANG|RANGE|NOTADR|COUNT|TRLBAR),
+ BANG|RANGE|NOTADR|COUNT|EDITCMD|TRLBAR,
+ ADDR_LINES),
EX(CMD_botright, "botright", ex_wrongmodifier,
- NEEDARG|EXTRA|NOTRLCOM),
+ NEEDARG|EXTRA|NOTRLCOM,
+ ADDR_LINES),
EX(CMD_bprevious, "bprevious", ex_bprevious,
- BANG|RANGE|NOTADR|COUNT|TRLBAR),
+ BANG|RANGE|NOTADR|COUNT|EDITCMD|TRLBAR,
+ ADDR_LINES),
EX(CMD_brewind, "brewind", ex_brewind,
- BANG|RANGE|NOTADR|TRLBAR),
+ BANG|RANGE|NOTADR|EDITCMD|TRLBAR,
+ ADDR_LINES),
EX(CMD_break, "break", ex_break,
- TRLBAR|SBOXOK|CMDWIN),
+ TRLBAR|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_breakadd, "breakadd", ex_breakadd,
- EXTRA|TRLBAR|CMDWIN),
+ EXTRA|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_breakdel, "breakdel", ex_breakdel,
- EXTRA|TRLBAR|CMDWIN),
+ EXTRA|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_breaklist, "breaklist", ex_breaklist,
- EXTRA|TRLBAR|CMDWIN),
+ EXTRA|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_browse, "browse", ex_wrongmodifier,
- NEEDARG|EXTRA|NOTRLCOM|CMDWIN),
+ NEEDARG|EXTRA|NOTRLCOM|CMDWIN,
+ ADDR_LINES),
EX(CMD_buffers, "buffers", buflist_list,
- BANG|TRLBAR|CMDWIN),
+ BANG|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_bufdo, "bufdo", ex_listdo,
- BANG|NEEDARG|EXTRA|NOTRLCOM),
+ BANG|NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL,
+ ADDR_BUFFERS),
EX(CMD_bunload, "bunload", ex_bunload,
- BANG|RANGE|NOTADR|BUFNAME|COUNT|EXTRA|TRLBAR),
+ BANG|RANGE|NOTADR|BUFNAME|COUNT|EXTRA|TRLBAR,
+ ADDR_LOADED_BUFFERS),
EX(CMD_bwipeout, "bwipeout", ex_bunload,
- BANG|RANGE|NOTADR|BUFNAME|BUFUNL|COUNT|EXTRA|TRLBAR),
+ BANG|RANGE|NOTADR|BUFNAME|BUFUNL|COUNT|EXTRA|TRLBAR,
+ ADDR_BUFFERS),
EX(CMD_change, "change", ex_change,
- BANG|WHOLEFOLD|RANGE|COUNT|TRLBAR|CMDWIN|MODIFY),
+ BANG|WHOLEFOLD|RANGE|COUNT|TRLBAR|CMDWIN|MODIFY,
+ ADDR_LINES),
EX(CMD_cNext, "cNext", ex_cnext,
- RANGE|NOTADR|COUNT|TRLBAR|BANG),
+ RANGE|NOTADR|COUNT|TRLBAR|BANG,
+ ADDR_LINES),
EX(CMD_cNfile, "cNfile", ex_cnext,
- RANGE|NOTADR|COUNT|TRLBAR|BANG),
+ RANGE|NOTADR|COUNT|TRLBAR|BANG,
+ ADDR_LINES),
EX(CMD_cabbrev, "cabbrev", ex_abbreviate,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_cabclear, "cabclear", ex_abclear,
- EXTRA|TRLBAR|CMDWIN),
+ EXTRA|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_caddbuffer, "caddbuffer", ex_cbuffer,
- RANGE|NOTADR|WORD1|TRLBAR),
+ RANGE|NOTADR|WORD1|TRLBAR,
+ ADDR_LINES),
EX(CMD_caddexpr, "caddexpr", ex_cexpr,
- NEEDARG|WORD1|NOTRLCOM|TRLBAR),
+ NEEDARG|WORD1|NOTRLCOM|TRLBAR,
+ ADDR_LINES),
EX(CMD_caddfile, "caddfile", ex_cfile,
- TRLBAR|FILE1),
+ TRLBAR|FILE1,
+ ADDR_LINES),
EX(CMD_call, "call", ex_call,
- RANGE|NEEDARG|EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+ RANGE|NEEDARG|EXTRA|NOTRLCOM|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_catch, "catch", ex_catch,
- EXTRA|SBOXOK|CMDWIN),
+ EXTRA|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_cbuffer, "cbuffer", ex_cbuffer,
- BANG|RANGE|NOTADR|WORD1|TRLBAR),
+ BANG|RANGE|NOTADR|WORD1|TRLBAR,
+ ADDR_LINES),
EX(CMD_cc, "cc", ex_cc,
- RANGE|NOTADR|COUNT|TRLBAR|BANG),
+ RANGE|NOTADR|COUNT|TRLBAR|BANG,
+ ADDR_LINES),
EX(CMD_cclose, "cclose", ex_cclose,
- RANGE|NOTADR|COUNT|TRLBAR),
+ RANGE|NOTADR|COUNT|TRLBAR,
+ ADDR_LINES),
EX(CMD_cd, "cd", ex_cd,
- BANG|FILE1|TRLBAR|CMDWIN),
+ BANG|FILE1|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_center, "center", ex_align,
- TRLBAR|RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY),
+ TRLBAR|RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY,
+ ADDR_LINES),
EX(CMD_cexpr, "cexpr", ex_cexpr,
- NEEDARG|WORD1|NOTRLCOM|TRLBAR|BANG),
+ NEEDARG|WORD1|NOTRLCOM|TRLBAR|BANG,
+ ADDR_LINES),
EX(CMD_cfile, "cfile", ex_cfile,
- TRLBAR|FILE1|BANG),
+ TRLBAR|FILE1|BANG,
+ ADDR_LINES),
EX(CMD_cfirst, "cfirst", ex_cc,
- RANGE|NOTADR|COUNT|TRLBAR|BANG),
+ RANGE|NOTADR|COUNT|TRLBAR|BANG,
+ ADDR_LINES),
EX(CMD_cgetfile, "cgetfile", ex_cfile,
- TRLBAR|FILE1),
+ TRLBAR|FILE1,
+ ADDR_LINES),
EX(CMD_cgetbuffer, "cgetbuffer", ex_cbuffer,
- RANGE|NOTADR|WORD1|TRLBAR),
+ RANGE|NOTADR|WORD1|TRLBAR,
+ ADDR_LINES),
EX(CMD_cgetexpr, "cgetexpr", ex_cexpr,
- NEEDARG|WORD1|NOTRLCOM|TRLBAR),
+ NEEDARG|WORD1|NOTRLCOM|TRLBAR,
+ ADDR_LINES),
EX(CMD_chdir, "chdir", ex_cd,
- BANG|FILE1|TRLBAR|CMDWIN),
+ BANG|FILE1|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_changes, "changes", ex_changes,
- TRLBAR|CMDWIN),
+ TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_checkpath, "checkpath", ex_checkpath,
- TRLBAR|BANG|CMDWIN),
+ TRLBAR|BANG|CMDWIN,
+ ADDR_LINES),
EX(CMD_checktime, "checktime", ex_checktime,
- RANGE|NOTADR|BUFNAME|COUNT|EXTRA|TRLBAR),
+ RANGE|NOTADR|BUFNAME|COUNT|EXTRA|TRLBAR,
+ ADDR_LINES),
EX(CMD_clist, "clist", qf_list,
- BANG|EXTRA|TRLBAR|CMDWIN),
+ BANG|EXTRA|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_clast, "clast", ex_cc,
- RANGE|NOTADR|COUNT|TRLBAR|BANG),
+ RANGE|NOTADR|COUNT|TRLBAR|BANG,
+ ADDR_LINES),
EX(CMD_close, "close", ex_close,
- BANG|TRLBAR|CMDWIN),
+ BANG|RANGE|NOTADR|COUNT|TRLBAR|CMDWIN,
+ ADDR_WINDOWS),
EX(CMD_cmap, "cmap", ex_map,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_cmapclear, "cmapclear", ex_mapclear,
- EXTRA|TRLBAR|CMDWIN),
+ EXTRA|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_cmenu, "cmenu", ex_menu,
- RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_cnext, "cnext", ex_cnext,
- RANGE|NOTADR|COUNT|TRLBAR|BANG),
+ RANGE|NOTADR|COUNT|TRLBAR|BANG,
+ ADDR_LINES),
EX(CMD_cnewer, "cnewer", qf_age,
- RANGE|NOTADR|COUNT|TRLBAR),
+ RANGE|NOTADR|COUNT|TRLBAR,
+ ADDR_LINES),
EX(CMD_cnfile, "cnfile", ex_cnext,
- RANGE|NOTADR|COUNT|TRLBAR|BANG),
+ RANGE|NOTADR|COUNT|TRLBAR|BANG,
+ ADDR_LINES),
EX(CMD_cnoremap, "cnoremap", ex_map,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_cnoreabbrev, "cnoreabbrev", ex_abbreviate,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_cnoremenu, "cnoremenu", ex_menu,
- RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_copy, "copy", ex_copymove,
- RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN|MODIFY),
+ RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN|MODIFY,
+ ADDR_LINES),
EX(CMD_colder, "colder", qf_age,
- RANGE|NOTADR|COUNT|TRLBAR),
+ RANGE|NOTADR|COUNT|TRLBAR,
+ ADDR_LINES),
EX(CMD_colorscheme, "colorscheme", ex_colorscheme,
- WORD1|TRLBAR|CMDWIN),
+ WORD1|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_command, "command", ex_command,
- EXTRA|BANG|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|BANG|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_comclear, "comclear", ex_comclear,
- TRLBAR|CMDWIN),
+ TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_compiler, "compiler", ex_compiler,
- BANG|TRLBAR|WORD1|CMDWIN),
+ BANG|TRLBAR|WORD1|CMDWIN,
+ ADDR_LINES),
EX(CMD_continue, "continue", ex_continue,
- TRLBAR|SBOXOK|CMDWIN),
+ TRLBAR|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_confirm, "confirm", ex_wrongmodifier,
- NEEDARG|EXTRA|NOTRLCOM|CMDWIN),
+ NEEDARG|EXTRA|NOTRLCOM|CMDWIN,
+ ADDR_LINES),
EX(CMD_copen, "copen", ex_copen,
- RANGE|NOTADR|COUNT|TRLBAR),
+ RANGE|NOTADR|COUNT|TRLBAR,
+ ADDR_LINES),
EX(CMD_cprevious, "cprevious", ex_cnext,
- RANGE|NOTADR|COUNT|TRLBAR|BANG),
+ RANGE|NOTADR|COUNT|TRLBAR|BANG,
+ ADDR_LINES),
EX(CMD_cpfile, "cpfile", ex_cnext,
- RANGE|NOTADR|COUNT|TRLBAR|BANG),
+ RANGE|NOTADR|COUNT|TRLBAR|BANG,
+ ADDR_LINES),
EX(CMD_cquit, "cquit", ex_cquit,
- TRLBAR|BANG),
+ TRLBAR|BANG,
+ ADDR_LINES),
EX(CMD_crewind, "crewind", ex_cc,
- RANGE|NOTADR|COUNT|TRLBAR|BANG),
+ RANGE|NOTADR|COUNT|TRLBAR|BANG,
+ ADDR_LINES),
EX(CMD_cscope, "cscope", do_cscope,
- EXTRA|NOTRLCOM|XFILE),
+ EXTRA|NOTRLCOM|XFILE,
+ ADDR_LINES),
EX(CMD_cstag, "cstag", do_cstag,
- BANG|TRLBAR|WORD1),
+ BANG|TRLBAR|WORD1,
+ ADDR_LINES),
EX(CMD_cunmap, "cunmap", ex_unmap,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_cunabbrev, "cunabbrev", ex_abbreviate,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_cunmenu, "cunmenu", ex_menu,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_cwindow, "cwindow", ex_cwindow,
- RANGE|NOTADR|COUNT|TRLBAR),
+ RANGE|NOTADR|COUNT|TRLBAR,
+ ADDR_LINES),
EX(CMD_delete, "delete", ex_operators,
- RANGE|WHOLEFOLD|REGSTR|COUNT|TRLBAR|CMDWIN|MODIFY),
+ RANGE|WHOLEFOLD|REGSTR|COUNT|TRLBAR|CMDWIN|MODIFY,
+ ADDR_LINES),
EX(CMD_delmarks, "delmarks", ex_delmarks,
- BANG|EXTRA|TRLBAR|CMDWIN),
+ BANG|EXTRA|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_debug, "debug", ex_debug,
- NEEDARG|EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+ NEEDARG|EXTRA|NOTRLCOM|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_debuggreedy, "debuggreedy", ex_debuggreedy,
- RANGE|NOTADR|ZEROR|TRLBAR|CMDWIN),
+ RANGE|NOTADR|ZEROR|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_delcommand, "delcommand", ex_delcommand,
- NEEDARG|WORD1|TRLBAR|CMDWIN),
+ NEEDARG|WORD1|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_delfunction, "delfunction", ex_delfunction,
- NEEDARG|WORD1|CMDWIN),
+ NEEDARG|WORD1|CMDWIN,
+ ADDR_LINES),
EX(CMD_display, "display", ex_display,
- EXTRA|NOTRLCOM|TRLBAR|SBOXOK|CMDWIN),
+ EXTRA|NOTRLCOM|TRLBAR|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_diffupdate, "diffupdate", ex_diffupdate,
- BANG|TRLBAR),
+ BANG|TRLBAR,
+ ADDR_LINES),
EX(CMD_diffget, "diffget", ex_diffgetput,
- RANGE|EXTRA|TRLBAR|MODIFY),
+ RANGE|EXTRA|TRLBAR|MODIFY,
+ ADDR_LINES),
EX(CMD_diffoff, "diffoff", ex_diffoff,
- BANG|TRLBAR),
+ BANG|TRLBAR,
+ ADDR_LINES),
EX(CMD_diffpatch, "diffpatch", ex_diffpatch,
- EXTRA|FILE1|TRLBAR|MODIFY),
+ EXTRA|FILE1|TRLBAR|MODIFY,
+ ADDR_LINES),
EX(CMD_diffput, "diffput", ex_diffgetput,
- RANGE|EXTRA|TRLBAR),
+ RANGE|EXTRA|TRLBAR,
+ ADDR_LINES),
EX(CMD_diffsplit, "diffsplit", ex_diffsplit,
- EXTRA|FILE1|TRLBAR),
+ EXTRA|FILE1|TRLBAR,
+ ADDR_LINES),
EX(CMD_diffthis, "diffthis", ex_diffthis,
- TRLBAR),
+ TRLBAR,
+ ADDR_LINES),
EX(CMD_digraphs, "digraphs", ex_digraphs,
- EXTRA|TRLBAR|CMDWIN),
+ EXTRA|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_djump, "djump", ex_findpat,
- BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA),
+ BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA,
+ ADDR_LINES),
EX(CMD_dlist, "dlist", ex_findpat,
- BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA|CMDWIN),
+ BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA|CMDWIN,
+ ADDR_LINES),
EX(CMD_doautocmd, "doautocmd", ex_doautocmd,
- EXTRA|TRLBAR|CMDWIN),
+ EXTRA|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_doautoall, "doautoall", ex_doautoall,
- EXTRA|TRLBAR|CMDWIN),
+ EXTRA|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_drop, "drop", ex_drop,
- FILES|EDITCMD|NEEDARG|ARGOPT|TRLBAR),
+ FILES|EDITCMD|NEEDARG|ARGOPT|TRLBAR,
+ ADDR_LINES),
EX(CMD_dsearch, "dsearch", ex_findpat,
- BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA|CMDWIN),
+ BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA|CMDWIN,
+ ADDR_LINES),
EX(CMD_dsplit, "dsplit", ex_findpat,
- BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA),
+ BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA,
+ ADDR_LINES),
EX(CMD_edit, "edit", ex_edit,
- BANG|FILE1|EDITCMD|ARGOPT|TRLBAR),
+ BANG|FILE1|EDITCMD|ARGOPT|TRLBAR,
+ ADDR_LINES),
EX(CMD_earlier, "earlier", ex_later,
- TRLBAR|EXTRA|NOSPC|CMDWIN),
+ TRLBAR|EXTRA|NOSPC|CMDWIN,
+ ADDR_LINES),
EX(CMD_echo, "echo", ex_echo,
- EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+ EXTRA|NOTRLCOM|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_echoerr, "echoerr", ex_execute,
- EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+ EXTRA|NOTRLCOM|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_echohl, "echohl", ex_echohl,
- EXTRA|TRLBAR|SBOXOK|CMDWIN),
+ EXTRA|TRLBAR|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_echomsg, "echomsg", ex_execute,
- EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+ EXTRA|NOTRLCOM|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_echon, "echon", ex_echo,
- EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+ EXTRA|NOTRLCOM|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_else, "else", ex_else,
- TRLBAR|SBOXOK|CMDWIN),
+ TRLBAR|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_elseif, "elseif", ex_else,
- EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+ EXTRA|NOTRLCOM|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_emenu, "emenu", ex_emenu,
- NEEDARG|EXTRA|TRLBAR|NOTRLCOM|RANGE|NOTADR|CMDWIN),
+ NEEDARG|EXTRA|TRLBAR|NOTRLCOM|RANGE|NOTADR|CMDWIN,
+ ADDR_LINES),
EX(CMD_endif, "endif", ex_endif,
- TRLBAR|SBOXOK|CMDWIN),
+ TRLBAR|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_endfunction, "endfunction", ex_endfunction,
- TRLBAR|CMDWIN),
+ TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_endfor, "endfor", ex_endwhile,
- TRLBAR|SBOXOK|CMDWIN),
+ TRLBAR|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_endtry, "endtry", ex_endtry,
- TRLBAR|SBOXOK|CMDWIN),
+ TRLBAR|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_endwhile, "endwhile", ex_endwhile,
- TRLBAR|SBOXOK|CMDWIN),
+ TRLBAR|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_enew, "enew", ex_edit,
- BANG|TRLBAR),
+ BANG|TRLBAR,
+ ADDR_LINES),
EX(CMD_ex, "ex", ex_edit,
- BANG|FILE1|EDITCMD|ARGOPT|TRLBAR),
+ BANG|FILE1|EDITCMD|ARGOPT|TRLBAR,
+ ADDR_LINES),
EX(CMD_execute, "execute", ex_execute,
- EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+ EXTRA|NOTRLCOM|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_exit, "exit", ex_exit,
- RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR|CMDWIN),
+ RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_exusage, "exusage", ex_exusage,
- TRLBAR),
+ TRLBAR,
+ ADDR_LINES),
EX(CMD_file, "file", ex_file,
- RANGE|NOTADR|ZEROR|BANG|FILE1|TRLBAR),
+ RANGE|NOTADR|ZEROR|BANG|FILE1|TRLBAR,
+ ADDR_LINES),
EX(CMD_files, "files", buflist_list,
- BANG|TRLBAR|CMDWIN),
+ BANG|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_filetype, "filetype", ex_filetype,
- EXTRA|TRLBAR|CMDWIN),
+ EXTRA|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_find, "find", ex_find,
- RANGE|NOTADR|BANG|FILE1|EDITCMD|ARGOPT|TRLBAR),
+ RANGE|NOTADR|BANG|FILE1|EDITCMD|ARGOPT|TRLBAR,
+ ADDR_LINES),
EX(CMD_finally, "finally", ex_finally,
- TRLBAR|SBOXOK|CMDWIN),
+ TRLBAR|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_finish, "finish", ex_finish,
- TRLBAR|SBOXOK|CMDWIN),
+ TRLBAR|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_first, "first", ex_rewind,
- EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR),
+ EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR,
+ ADDR_LINES),
EX(CMD_fixdel, "fixdel", do_fixdel,
- TRLBAR|CMDWIN),
+ TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_fold, "fold", ex_fold,
- RANGE|WHOLEFOLD|TRLBAR|SBOXOK|CMDWIN),
+ RANGE|WHOLEFOLD|TRLBAR|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_foldclose, "foldclose", ex_foldopen,
- RANGE|BANG|WHOLEFOLD|TRLBAR|SBOXOK|CMDWIN),
+ RANGE|BANG|WHOLEFOLD|TRLBAR|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_folddoopen, "folddoopen", ex_folddo,
- RANGE|DFLALL|NEEDARG|EXTRA|NOTRLCOM),
+ RANGE|DFLALL|NEEDARG|EXTRA|NOTRLCOM,
+ ADDR_LINES),
EX(CMD_folddoclosed, "folddoclosed", ex_folddo,
- RANGE|DFLALL|NEEDARG|EXTRA|NOTRLCOM),
+ RANGE|DFLALL|NEEDARG|EXTRA|NOTRLCOM,
+ ADDR_LINES),
EX(CMD_foldopen, "foldopen", ex_foldopen,
- RANGE|BANG|WHOLEFOLD|TRLBAR|SBOXOK|CMDWIN),
+ RANGE|BANG|WHOLEFOLD|TRLBAR|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_for, "for", ex_while,
- EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+ EXTRA|NOTRLCOM|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_function, "function", ex_function,
- EXTRA|BANG|CMDWIN),
+ EXTRA|BANG|CMDWIN,
+ ADDR_LINES),
EX(CMD_global, "global", ex_global,
- RANGE|WHOLEFOLD|BANG|EXTRA|DFLALL|SBOXOK|CMDWIN),
+ RANGE|WHOLEFOLD|BANG|EXTRA|DFLALL|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_goto, "goto", ex_goto,
- RANGE|NOTADR|COUNT|TRLBAR|SBOXOK|CMDWIN),
+ RANGE|NOTADR|COUNT|TRLBAR|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_grep, "grep", ex_make,
- RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE),
+ RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE,
+ ADDR_LINES),
EX(CMD_grepadd, "grepadd", ex_make,
- RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE),
+ RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE,
+ ADDR_LINES),
EX(CMD_gui, "gui", ex_gui,
- BANG|FILES|EDITCMD|ARGOPT|TRLBAR|CMDWIN),
+ BANG|FILES|EDITCMD|ARGOPT|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_gvim, "gvim", ex_gui,
- BANG|FILES|EDITCMD|ARGOPT|TRLBAR|CMDWIN),
+ BANG|FILES|EDITCMD|ARGOPT|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_help, "help", ex_help,
- BANG|EXTRA|NOTRLCOM),
+ BANG|EXTRA|NOTRLCOM,
+ ADDR_LINES),
+EX(CMD_helpclose, "helpclose", ex_helpclose,
+ RANGE|NOTADR|COUNT|TRLBAR,
+ ADDR_LINES),
EX(CMD_helpfind, "helpfind", ex_helpfind,
- EXTRA|NOTRLCOM),
+ EXTRA|NOTRLCOM,
+ ADDR_LINES),
EX(CMD_helpgrep, "helpgrep", ex_helpgrep,
- EXTRA|NOTRLCOM|NEEDARG),
+ EXTRA|NOTRLCOM|NEEDARG,
+ ADDR_LINES),
EX(CMD_helptags, "helptags", ex_helptags,
- NEEDARG|FILES|TRLBAR|CMDWIN),
+ NEEDARG|FILES|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_hardcopy, "hardcopy", ex_hardcopy,
- RANGE|COUNT|EXTRA|TRLBAR|DFLALL|BANG),
+ RANGE|COUNT|EXTRA|TRLBAR|DFLALL|BANG,
+ ADDR_LINES),
EX(CMD_highlight, "highlight", ex_highlight,
- BANG|EXTRA|TRLBAR|SBOXOK|CMDWIN),
+ BANG|EXTRA|TRLBAR|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_hide, "hide", ex_hide,
- BANG|EXTRA|NOTRLCOM),
+ BANG|RANGE|NOTADR|COUNT|EXTRA|NOTRLCOM,
+ ADDR_WINDOWS),
EX(CMD_history, "history", ex_history,
- EXTRA|TRLBAR|CMDWIN),
+ EXTRA|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_insert, "insert", ex_append,
- BANG|RANGE|TRLBAR|CMDWIN|MODIFY),
+ BANG|RANGE|TRLBAR|CMDWIN|MODIFY,
+ ADDR_LINES),
EX(CMD_iabbrev, "iabbrev", ex_abbreviate,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_iabclear, "iabclear", ex_abclear,
- EXTRA|TRLBAR|CMDWIN),
+ EXTRA|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_if, "if", ex_if,
- EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+ EXTRA|NOTRLCOM|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_ijump, "ijump", ex_findpat,
- BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA),
+ BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA,
+ ADDR_LINES),
EX(CMD_ilist, "ilist", ex_findpat,
- BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA|CMDWIN),
+ BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA|CMDWIN,
+ ADDR_LINES),
EX(CMD_imap, "imap", ex_map,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_imapclear, "imapclear", ex_mapclear,
- EXTRA|TRLBAR|CMDWIN),
+ EXTRA|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_imenu, "imenu", ex_menu,
- RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_inoremap, "inoremap", ex_map,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_inoreabbrev, "inoreabbrev", ex_abbreviate,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_inoremenu, "inoremenu", ex_menu,
- RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_intro, "intro", ex_intro,
- TRLBAR|CMDWIN),
+ TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_isearch, "isearch", ex_findpat,
- BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA|CMDWIN),
+ BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA|CMDWIN,
+ ADDR_LINES),
EX(CMD_isplit, "isplit", ex_findpat,
- BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA),
+ BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA,
+ ADDR_LINES),
EX(CMD_iunmap, "iunmap", ex_unmap,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_iunabbrev, "iunabbrev", ex_abbreviate,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_iunmenu, "iunmenu", ex_menu,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_join, "join", ex_join,
- BANG|RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN|MODIFY),
+ BANG|RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN|MODIFY,
+ ADDR_LINES),
EX(CMD_jumps, "jumps", ex_jumps,
- TRLBAR|CMDWIN),
+ TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_k, "k", ex_mark,
- RANGE|WORD1|TRLBAR|SBOXOK|CMDWIN),
+ RANGE|WORD1|TRLBAR|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_keepmarks, "keepmarks", ex_wrongmodifier,
- NEEDARG|EXTRA|NOTRLCOM),
+ NEEDARG|EXTRA|NOTRLCOM,
+ ADDR_LINES),
EX(CMD_keepjumps, "keepjumps", ex_wrongmodifier,
- NEEDARG|EXTRA|NOTRLCOM),
+ NEEDARG|EXTRA|NOTRLCOM,
+ ADDR_LINES),
EX(CMD_keeppatterns, "keeppatterns", ex_wrongmodifier,
- NEEDARG|EXTRA|NOTRLCOM),
+ NEEDARG|EXTRA|NOTRLCOM,
+ ADDR_LINES),
EX(CMD_keepalt, "keepalt", ex_wrongmodifier,
- NEEDARG|EXTRA|NOTRLCOM),
+ NEEDARG|EXTRA|NOTRLCOM,
+ ADDR_LINES),
EX(CMD_list, "list", ex_print,
- RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN),
+ RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_lNext, "lNext", ex_cnext,
- RANGE|NOTADR|COUNT|TRLBAR|BANG),
+ RANGE|NOTADR|COUNT|TRLBAR|BANG,
+ ADDR_LINES),
EX(CMD_lNfile, "lNfile", ex_cnext,
- RANGE|NOTADR|COUNT|TRLBAR|BANG),
+ RANGE|NOTADR|COUNT|TRLBAR|BANG,
+ ADDR_LINES),
EX(CMD_last, "last", ex_last,
- EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR),
+ EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR,
+ ADDR_LINES),
EX(CMD_language, "language", ex_language,
- EXTRA|TRLBAR|CMDWIN),
+ EXTRA|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_laddexpr, "laddexpr", ex_cexpr,
- NEEDARG|WORD1|NOTRLCOM|TRLBAR),
+ NEEDARG|WORD1|NOTRLCOM|TRLBAR,
+ ADDR_LINES),
EX(CMD_laddbuffer, "laddbuffer", ex_cbuffer,
- RANGE|NOTADR|WORD1|TRLBAR),
+ RANGE|NOTADR|WORD1|TRLBAR,
+ ADDR_LINES),
EX(CMD_laddfile, "laddfile", ex_cfile,
- TRLBAR|FILE1),
+ TRLBAR|FILE1,
+ ADDR_LINES),
EX(CMD_later, "later", ex_later,
- TRLBAR|EXTRA|NOSPC|CMDWIN),
+ TRLBAR|EXTRA|NOSPC|CMDWIN,
+ ADDR_LINES),
EX(CMD_lbuffer, "lbuffer", ex_cbuffer,
- BANG|RANGE|NOTADR|WORD1|TRLBAR),
+ BANG|RANGE|NOTADR|WORD1|TRLBAR,
+ ADDR_LINES),
EX(CMD_lcd, "lcd", ex_cd,
- BANG|FILE1|TRLBAR|CMDWIN),
+ BANG|FILE1|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_lchdir, "lchdir", ex_cd,
- BANG|FILE1|TRLBAR|CMDWIN),
+ BANG|FILE1|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_lclose, "lclose", ex_cclose,
- RANGE|NOTADR|COUNT|TRLBAR),
+ RANGE|NOTADR|COUNT|TRLBAR,
+ ADDR_LINES),
EX(CMD_lcscope, "lcscope", do_cscope,
- EXTRA|NOTRLCOM|XFILE),
+ EXTRA|NOTRLCOM|XFILE,
+ ADDR_LINES),
EX(CMD_left, "left", ex_align,
- TRLBAR|RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY),
+ TRLBAR|RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY,
+ ADDR_LINES),
EX(CMD_leftabove, "leftabove", ex_wrongmodifier,
- NEEDARG|EXTRA|NOTRLCOM),
+ NEEDARG|EXTRA|NOTRLCOM,
+ ADDR_LINES),
EX(CMD_let, "let", ex_let,
- EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+ EXTRA|NOTRLCOM|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_lexpr, "lexpr", ex_cexpr,
- NEEDARG|WORD1|NOTRLCOM|TRLBAR|BANG),
+ NEEDARG|WORD1|NOTRLCOM|TRLBAR|BANG,
+ ADDR_LINES),
EX(CMD_lfile, "lfile", ex_cfile,
- TRLBAR|FILE1|BANG),
+ TRLBAR|FILE1|BANG,
+ ADDR_LINES),
EX(CMD_lfirst, "lfirst", ex_cc,
- RANGE|NOTADR|COUNT|TRLBAR|BANG),
+ RANGE|NOTADR|COUNT|TRLBAR|BANG,
+ ADDR_LINES),
EX(CMD_lgetfile, "lgetfile", ex_cfile,
- TRLBAR|FILE1),
+ TRLBAR|FILE1,
+ ADDR_LINES),
EX(CMD_lgetbuffer, "lgetbuffer", ex_cbuffer,
- RANGE|NOTADR|WORD1|TRLBAR),
+ RANGE|NOTADR|WORD1|TRLBAR,
+ ADDR_LINES),
EX(CMD_lgetexpr, "lgetexpr", ex_cexpr,
- NEEDARG|WORD1|NOTRLCOM|TRLBAR),
+ NEEDARG|WORD1|NOTRLCOM|TRLBAR,
+ ADDR_LINES),
EX(CMD_lgrep, "lgrep", ex_make,
- RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE),
+ RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE,
+ ADDR_LINES),
EX(CMD_lgrepadd, "lgrepadd", ex_make,
- RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE),
+ RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE,
+ ADDR_LINES),
EX(CMD_lhelpgrep, "lhelpgrep", ex_helpgrep,
- EXTRA|NOTRLCOM|NEEDARG),
+ EXTRA|NOTRLCOM|NEEDARG,
+ ADDR_LINES),
EX(CMD_ll, "ll", ex_cc,
- RANGE|NOTADR|COUNT|TRLBAR|BANG),
+ RANGE|NOTADR|COUNT|TRLBAR|BANG,
+ ADDR_LINES),
EX(CMD_llast, "llast", ex_cc,
- RANGE|NOTADR|COUNT|TRLBAR|BANG),
+ RANGE|NOTADR|COUNT|TRLBAR|BANG,
+ ADDR_LINES),
EX(CMD_llist, "llist", qf_list,
- BANG|EXTRA|TRLBAR|CMDWIN),
+ BANG|EXTRA|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_lmap, "lmap", ex_map,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_lmapclear, "lmapclear", ex_mapclear,
- EXTRA|TRLBAR|CMDWIN),
+ EXTRA|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_lmake, "lmake", ex_make,
- BANG|EXTRA|NOTRLCOM|TRLBAR|XFILE),
+ BANG|EXTRA|NOTRLCOM|TRLBAR|XFILE,
+ ADDR_LINES),
EX(CMD_lnoremap, "lnoremap", ex_map,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_lnext, "lnext", ex_cnext,
- RANGE|NOTADR|COUNT|TRLBAR|BANG),
+ RANGE|NOTADR|COUNT|TRLBAR|BANG,
+ ADDR_LINES),
EX(CMD_lnewer, "lnewer", qf_age,
- RANGE|NOTADR|COUNT|TRLBAR),
+ RANGE|NOTADR|COUNT|TRLBAR,
+ ADDR_LINES),
EX(CMD_lnfile, "lnfile", ex_cnext,
- RANGE|NOTADR|COUNT|TRLBAR|BANG),
+ RANGE|NOTADR|COUNT|TRLBAR|BANG,
+ ADDR_LINES),
EX(CMD_loadview, "loadview", ex_loadview,
- FILE1|TRLBAR),
+ FILE1|TRLBAR,
+ ADDR_LINES),
EX(CMD_loadkeymap, "loadkeymap", ex_loadkeymap,
- CMDWIN),
+ CMDWIN,
+ ADDR_LINES),
EX(CMD_lockmarks, "lockmarks", ex_wrongmodifier,
- NEEDARG|EXTRA|NOTRLCOM),
+ NEEDARG|EXTRA|NOTRLCOM,
+ ADDR_LINES),
EX(CMD_lockvar, "lockvar", ex_lockvar,
- BANG|EXTRA|NEEDARG|SBOXOK|CMDWIN),
+ BANG|EXTRA|NEEDARG|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_lolder, "lolder", qf_age,
- RANGE|NOTADR|COUNT|TRLBAR),
+ RANGE|NOTADR|COUNT|TRLBAR,
+ ADDR_LINES),
EX(CMD_lopen, "lopen", ex_copen,
- RANGE|NOTADR|COUNT|TRLBAR),
+ RANGE|NOTADR|COUNT|TRLBAR,
+ ADDR_LINES),
EX(CMD_lprevious, "lprevious", ex_cnext,
- RANGE|NOTADR|COUNT|TRLBAR|BANG),
+ RANGE|NOTADR|COUNT|TRLBAR|BANG,
+ ADDR_LINES),
EX(CMD_lpfile, "lpfile", ex_cnext,
- RANGE|NOTADR|COUNT|TRLBAR|BANG),
+ RANGE|NOTADR|COUNT|TRLBAR|BANG,
+ ADDR_LINES),
EX(CMD_lrewind, "lrewind", ex_cc,
- RANGE|NOTADR|COUNT|TRLBAR|BANG),
+ RANGE|NOTADR|COUNT|TRLBAR|BANG,
+ ADDR_LINES),
EX(CMD_ltag, "ltag", ex_tag,
- NOTADR|TRLBAR|BANG|WORD1),
+ NOTADR|TRLBAR|BANG|WORD1,
+ ADDR_LINES),
EX(CMD_lunmap, "lunmap", ex_unmap,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_lua, "lua", ex_lua,
- RANGE|EXTRA|NEEDARG|CMDWIN),
+ RANGE|EXTRA|NEEDARG|CMDWIN,
+ ADDR_LINES),
EX(CMD_luado, "luado", ex_luado,
- RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN),
+ RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN,
+ ADDR_LINES),
EX(CMD_luafile, "luafile", ex_luafile,
- RANGE|FILE1|NEEDARG|CMDWIN),
+ RANGE|FILE1|NEEDARG|CMDWIN,
+ ADDR_LINES),
EX(CMD_lvimgrep, "lvimgrep", ex_vimgrep,
- RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE),
+ RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE,
+ ADDR_LINES),
EX(CMD_lvimgrepadd, "lvimgrepadd", ex_vimgrep,
- RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE),
+ RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE,
+ ADDR_LINES),
EX(CMD_lwindow, "lwindow", ex_cwindow,
- RANGE|NOTADR|COUNT|TRLBAR),
+ RANGE|NOTADR|COUNT|TRLBAR,
+ ADDR_LINES),
EX(CMD_ls, "ls", buflist_list,
- BANG|TRLBAR|CMDWIN),
+ BANG|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_move, "move", ex_copymove,
- RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN|MODIFY),
+ RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN|MODIFY,
+ ADDR_LINES),
EX(CMD_mark, "mark", ex_mark,
- RANGE|WORD1|TRLBAR|SBOXOK|CMDWIN),
+ RANGE|WORD1|TRLBAR|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_make, "make", ex_make,
- BANG|EXTRA|NOTRLCOM|TRLBAR|XFILE),
+ BANG|EXTRA|NOTRLCOM|TRLBAR|XFILE,
+ ADDR_LINES),
EX(CMD_map, "map", ex_map,
- BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_mapclear, "mapclear", ex_mapclear,
- EXTRA|BANG|TRLBAR|CMDWIN),
+ EXTRA|BANG|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_marks, "marks", do_marks,
- EXTRA|TRLBAR|CMDWIN),
+ EXTRA|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_match, "match", ex_match,
- RANGE|NOTADR|EXTRA|CMDWIN),
+ RANGE|NOTADR|EXTRA|CMDWIN,
+ ADDR_LINES),
EX(CMD_menu, "menu", ex_menu,
- RANGE|NOTADR|ZEROR|BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ RANGE|NOTADR|ZEROR|BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_menutranslate, "menutranslate", ex_menutranslate,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_messages, "messages", ex_messages,
- TRLBAR|CMDWIN),
+ TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_mkexrc, "mkexrc", ex_mkrc,
- BANG|FILE1|TRLBAR|CMDWIN),
+ BANG|FILE1|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_mksession, "mksession", ex_mkrc,
- BANG|FILE1|TRLBAR),
+ BANG|FILE1|TRLBAR,
+ ADDR_LINES),
EX(CMD_mkspell, "mkspell", ex_mkspell,
- BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE),
+ BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE,
+ ADDR_LINES),
EX(CMD_mkvimrc, "mkvimrc", ex_mkrc,
- BANG|FILE1|TRLBAR|CMDWIN),
+ BANG|FILE1|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_mkview, "mkview", ex_mkrc,
- BANG|FILE1|TRLBAR),
+ BANG|FILE1|TRLBAR,
+ ADDR_LINES),
EX(CMD_mode, "mode", ex_mode,
- WORD1|TRLBAR|CMDWIN),
+ WORD1|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_mzscheme, "mzscheme", ex_mzscheme,
- RANGE|EXTRA|DFLALL|NEEDARG|CMDWIN|SBOXOK),
+ RANGE|EXTRA|DFLALL|NEEDARG|CMDWIN|SBOXOK,
+ ADDR_LINES),
EX(CMD_mzfile, "mzfile", ex_mzfile,
- RANGE|FILE1|NEEDARG|CMDWIN),
+ RANGE|FILE1|NEEDARG|CMDWIN,
+ ADDR_LINES),
EX(CMD_next, "next", ex_next,
- RANGE|NOTADR|BANG|FILES|EDITCMD|ARGOPT|TRLBAR),
+ RANGE|NOTADR|BANG|FILES|EDITCMD|ARGOPT|TRLBAR,
+ ADDR_LINES),
EX(CMD_nbkey, "nbkey", ex_nbkey,
- EXTRA|NOTADR|NEEDARG),
+ EXTRA|NOTADR|NEEDARG,
+ ADDR_LINES),
EX(CMD_nbclose, "nbclose", ex_nbclose,
- TRLBAR|CMDWIN),
+ TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_nbstart, "nbstart", ex_nbstart,
- WORD1|TRLBAR|CMDWIN),
+ WORD1|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_new, "new", ex_splitview,
- BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR),
+ BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR,
+ ADDR_LINES),
EX(CMD_nmap, "nmap", ex_map,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_nmapclear, "nmapclear", ex_mapclear,
- EXTRA|TRLBAR|CMDWIN),
+ EXTRA|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_nmenu, "nmenu", ex_menu,
- RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_nnoremap, "nnoremap", ex_map,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_nnoremenu, "nnoremenu", ex_menu,
- RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_noremap, "noremap", ex_map,
- BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_noautocmd, "noautocmd", ex_wrongmodifier,
- NEEDARG|EXTRA|NOTRLCOM),
+ NEEDARG|EXTRA|NOTRLCOM,
+ ADDR_LINES),
EX(CMD_nohlsearch, "nohlsearch", ex_nohlsearch,
- TRLBAR|SBOXOK|CMDWIN),
+ TRLBAR|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_noreabbrev, "noreabbrev", ex_abbreviate,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_noremenu, "noremenu", ex_menu,
- RANGE|NOTADR|ZEROR|BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ RANGE|NOTADR|ZEROR|BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_noswapfile, "noswapfile", ex_wrongmodifier,
- NEEDARG|EXTRA|NOTRLCOM),
+ NEEDARG|EXTRA|NOTRLCOM,
+ ADDR_LINES),
EX(CMD_normal, "normal", ex_normal,
- RANGE|BANG|EXTRA|NEEDARG|NOTRLCOM|USECTRLV|SBOXOK|CMDWIN),
+ RANGE|BANG|EXTRA|NEEDARG|NOTRLCOM|USECTRLV|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_number, "number", ex_print,
- RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN),
+ RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_nunmap, "nunmap", ex_unmap,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_nunmenu, "nunmenu", ex_menu,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_open, "open", ex_open,
- RANGE|BANG|EXTRA),
+ RANGE|BANG|EXTRA,
+ ADDR_LINES),
EX(CMD_oldfiles, "oldfiles", ex_oldfiles,
- BANG|TRLBAR|SBOXOK|CMDWIN),
+ BANG|TRLBAR|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_omap, "omap", ex_map,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_omapclear, "omapclear", ex_mapclear,
- EXTRA|TRLBAR|CMDWIN),
+ EXTRA|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_omenu, "omenu", ex_menu,
- RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_only, "only", ex_only,
- BANG|TRLBAR),
+ BANG|NOTADR|RANGE|COUNT|TRLBAR,
+ ADDR_WINDOWS),
EX(CMD_onoremap, "onoremap", ex_map,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_onoremenu, "onoremenu", ex_menu,
- RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_options, "options", ex_options,
- TRLBAR),
+ TRLBAR,
+ ADDR_LINES),
EX(CMD_ounmap, "ounmap", ex_unmap,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_ounmenu, "ounmenu", ex_menu,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_ownsyntax, "ownsyntax", ex_ownsyntax,
- EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+ EXTRA|NOTRLCOM|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_print, "print", ex_print,
- RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN|SBOXOK),
+ RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN|SBOXOK,
+ ADDR_LINES),
EX(CMD_pclose, "pclose", ex_pclose,
- BANG|TRLBAR),
+ BANG|TRLBAR,
+ ADDR_LINES),
EX(CMD_perl, "perl", ex_perl,
- RANGE|EXTRA|DFLALL|NEEDARG|SBOXOK|CMDWIN),
+ RANGE|EXTRA|DFLALL|NEEDARG|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_perldo, "perldo", ex_perldo,
- RANGE|EXTRA|DFLALL|NEEDARG|CMDWIN),
+ RANGE|EXTRA|DFLALL|NEEDARG|CMDWIN,
+ ADDR_LINES),
EX(CMD_pedit, "pedit", ex_pedit,
- BANG|FILE1|EDITCMD|ARGOPT|TRLBAR),
+ BANG|FILE1|EDITCMD|ARGOPT|TRLBAR,
+ ADDR_LINES),
EX(CMD_pop, "pop", ex_tag,
- RANGE|NOTADR|BANG|COUNT|TRLBAR|ZEROR),
+ RANGE|NOTADR|BANG|COUNT|TRLBAR|ZEROR,
+ ADDR_LINES),
EX(CMD_popup, "popup", ex_popup,
- NEEDARG|EXTRA|BANG|TRLBAR|NOTRLCOM|CMDWIN),
+ NEEDARG|EXTRA|BANG|TRLBAR|NOTRLCOM|CMDWIN,
+ ADDR_LINES),
EX(CMD_ppop, "ppop", ex_ptag,
- RANGE|NOTADR|BANG|COUNT|TRLBAR|ZEROR),
+ RANGE|NOTADR|BANG|COUNT|TRLBAR|ZEROR,
+ ADDR_LINES),
EX(CMD_preserve, "preserve", ex_preserve,
- TRLBAR),
+ TRLBAR,
+ ADDR_LINES),
EX(CMD_previous, "previous", ex_previous,
- EXTRA|RANGE|NOTADR|COUNT|BANG|EDITCMD|ARGOPT|TRLBAR),
+ EXTRA|RANGE|NOTADR|COUNT|BANG|EDITCMD|ARGOPT|TRLBAR,
+ ADDR_LINES),
EX(CMD_promptfind, "promptfind", gui_mch_find_dialog,
- EXTRA|NOTRLCOM|CMDWIN),
+ EXTRA|NOTRLCOM|CMDWIN,
+ ADDR_LINES),
EX(CMD_promptrepl, "promptrepl", gui_mch_replace_dialog,
- EXTRA|NOTRLCOM|CMDWIN),
+ EXTRA|NOTRLCOM|CMDWIN,
+ ADDR_LINES),
EX(CMD_profile, "profile", ex_profile,
- BANG|EXTRA|TRLBAR|CMDWIN),
+ BANG|EXTRA|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_profdel, "profdel", ex_breakdel,
- EXTRA|TRLBAR|CMDWIN),
+ EXTRA|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_psearch, "psearch", ex_psearch,
- BANG|RANGE|WHOLEFOLD|DFLALL|EXTRA),
+ BANG|RANGE|WHOLEFOLD|DFLALL|EXTRA,
+ ADDR_LINES),
EX(CMD_ptag, "ptag", ex_ptag,
- RANGE|NOTADR|BANG|WORD1|TRLBAR|ZEROR),
+ RANGE|NOTADR|BANG|WORD1|TRLBAR|ZEROR,
+ ADDR_LINES),
EX(CMD_ptNext, "ptNext", ex_ptag,
- RANGE|NOTADR|BANG|TRLBAR|ZEROR),
+ RANGE|NOTADR|BANG|TRLBAR|ZEROR,
+ ADDR_LINES),
EX(CMD_ptfirst, "ptfirst", ex_ptag,
- RANGE|NOTADR|BANG|TRLBAR|ZEROR),
+ RANGE|NOTADR|BANG|TRLBAR|ZEROR,
+ ADDR_LINES),
EX(CMD_ptjump, "ptjump", ex_ptag,
- BANG|TRLBAR|WORD1),
+ BANG|TRLBAR|WORD1,
+ ADDR_LINES),
EX(CMD_ptlast, "ptlast", ex_ptag,
- BANG|TRLBAR),
+ BANG|TRLBAR,
+ ADDR_LINES),
EX(CMD_ptnext, "ptnext", ex_ptag,
- RANGE|NOTADR|BANG|TRLBAR|ZEROR),
+ RANGE|NOTADR|BANG|TRLBAR|ZEROR,
+ ADDR_LINES),
EX(CMD_ptprevious, "ptprevious", ex_ptag,
- RANGE|NOTADR|BANG|TRLBAR|ZEROR),
+ RANGE|NOTADR|BANG|TRLBAR|ZEROR,
+ ADDR_LINES),
EX(CMD_ptrewind, "ptrewind", ex_ptag,
- RANGE|NOTADR|BANG|TRLBAR|ZEROR),
+ RANGE|NOTADR|BANG|TRLBAR|ZEROR,
+ ADDR_LINES),
EX(CMD_ptselect, "ptselect", ex_ptag,
- BANG|TRLBAR|WORD1),
+ BANG|TRLBAR|WORD1,
+ ADDR_LINES),
EX(CMD_put, "put", ex_put,
- RANGE|WHOLEFOLD|BANG|REGSTR|TRLBAR|ZEROR|CMDWIN|MODIFY),
+ RANGE|WHOLEFOLD|BANG|REGSTR|TRLBAR|ZEROR|CMDWIN|MODIFY,
+ ADDR_LINES),
EX(CMD_pwd, "pwd", ex_pwd,
- TRLBAR|CMDWIN),
+ TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_python, "python", ex_python,
- RANGE|EXTRA|NEEDARG|CMDWIN),
+ RANGE|EXTRA|NEEDARG|CMDWIN,
+ ADDR_LINES),
EX(CMD_pydo, "pydo", ex_pydo,
- RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN),
+ RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN,
+ ADDR_LINES),
EX(CMD_pyfile, "pyfile", ex_pyfile,
- RANGE|FILE1|NEEDARG|CMDWIN),
+ RANGE|FILE1|NEEDARG|CMDWIN,
+ ADDR_LINES),
EX(CMD_py3, "py3", ex_py3,
- RANGE|EXTRA|NEEDARG|CMDWIN),
+ RANGE|EXTRA|NEEDARG|CMDWIN,
+ ADDR_LINES),
EX(CMD_py3do, "py3do", ex_py3do,
- RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN),
+ RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN,
+ ADDR_LINES),
EX(CMD_python3, "python3", ex_py3,
- RANGE|EXTRA|NEEDARG|CMDWIN),
+ RANGE|EXTRA|NEEDARG|CMDWIN,
+ ADDR_LINES),
EX(CMD_py3file, "py3file", ex_py3file,
- RANGE|FILE1|NEEDARG|CMDWIN),
+ RANGE|FILE1|NEEDARG|CMDWIN,
+ ADDR_LINES),
EX(CMD_quit, "quit", ex_quit,
- BANG|TRLBAR|CMDWIN),
+ BANG|RANGE|COUNT|NOTADR|TRLBAR|CMDWIN,
+ ADDR_WINDOWS),
EX(CMD_quitall, "quitall", ex_quit_all,
- BANG|TRLBAR),
+ BANG|TRLBAR,
+ ADDR_LINES),
EX(CMD_qall, "qall", ex_quit_all,
- BANG|TRLBAR|CMDWIN),
+ BANG|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_read, "read", ex_read,
- BANG|RANGE|WHOLEFOLD|FILE1|ARGOPT|TRLBAR|ZEROR|CMDWIN|MODIFY),
+ BANG|RANGE|WHOLEFOLD|FILE1|ARGOPT|TRLBAR|ZEROR|CMDWIN|MODIFY,
+ ADDR_LINES),
EX(CMD_recover, "recover", ex_recover,
- BANG|FILE1|TRLBAR),
+ BANG|FILE1|TRLBAR,
+ ADDR_LINES),
EX(CMD_redo, "redo", ex_redo,
- TRLBAR|CMDWIN),
+ TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_redir, "redir", ex_redir,
- BANG|FILES|TRLBAR|CMDWIN),
+ BANG|FILES|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_redraw, "redraw", ex_redraw,
- BANG|TRLBAR|CMDWIN),
+ BANG|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_redrawstatus, "redrawstatus", ex_redrawstatus,
- BANG|TRLBAR|CMDWIN),
+ BANG|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_registers, "registers", ex_display,
- EXTRA|NOTRLCOM|TRLBAR|CMDWIN),
+ EXTRA|NOTRLCOM|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_resize, "resize", ex_resize,
- RANGE|NOTADR|TRLBAR|WORD1),
+ RANGE|NOTADR|TRLBAR|WORD1,
+ ADDR_LINES),
EX(CMD_retab, "retab", ex_retab,
- TRLBAR|RANGE|WHOLEFOLD|DFLALL|BANG|WORD1|CMDWIN|MODIFY),
+ TRLBAR|RANGE|WHOLEFOLD|DFLALL|BANG|WORD1|CMDWIN|MODIFY,
+ ADDR_LINES),
EX(CMD_return, "return", ex_return,
- EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+ EXTRA|NOTRLCOM|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_rewind, "rewind", ex_rewind,
- EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR),
+ EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR,
+ ADDR_LINES),
EX(CMD_right, "right", ex_align,
- TRLBAR|RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY),
+ TRLBAR|RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY,
+ ADDR_LINES),
EX(CMD_rightbelow, "rightbelow", ex_wrongmodifier,
- NEEDARG|EXTRA|NOTRLCOM),
+ NEEDARG|EXTRA|NOTRLCOM,
+ ADDR_LINES),
EX(CMD_runtime, "runtime", ex_runtime,
- BANG|NEEDARG|FILES|TRLBAR|SBOXOK|CMDWIN),
+ BANG|NEEDARG|FILES|TRLBAR|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_ruby, "ruby", ex_ruby,
- RANGE|EXTRA|NEEDARG|CMDWIN),
+ RANGE|EXTRA|NEEDARG|CMDWIN,
+ ADDR_LINES),
EX(CMD_rubydo, "rubydo", ex_rubydo,
- RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN),
+ RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN,
+ ADDR_LINES),
EX(CMD_rubyfile, "rubyfile", ex_rubyfile,
- RANGE|FILE1|NEEDARG|CMDWIN),
+ RANGE|FILE1|NEEDARG|CMDWIN,
+ ADDR_LINES),
EX(CMD_rundo, "rundo", ex_rundo,
- NEEDARG|FILE1),
+ NEEDARG|FILE1,
+ ADDR_LINES),
EX(CMD_rviminfo, "rviminfo", ex_viminfo,
- BANG|FILE1|TRLBAR|CMDWIN),
+ BANG|FILE1|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_substitute, "substitute", do_sub,
- RANGE|WHOLEFOLD|EXTRA|CMDWIN),
+ RANGE|WHOLEFOLD|EXTRA|CMDWIN,
+ ADDR_LINES),
EX(CMD_sNext, "sNext", ex_previous,
- EXTRA|RANGE|NOTADR|COUNT|BANG|EDITCMD|ARGOPT|TRLBAR),
+ EXTRA|RANGE|NOTADR|COUNT|BANG|EDITCMD|ARGOPT|TRLBAR,
+ ADDR_LINES),
EX(CMD_sargument, "sargument", ex_argument,
- BANG|RANGE|NOTADR|COUNT|EXTRA|EDITCMD|ARGOPT|TRLBAR),
+ BANG|RANGE|NOTADR|COUNT|EXTRA|EDITCMD|ARGOPT|TRLBAR,
+ ADDR_ARGUMENTS),
EX(CMD_sall, "sall", ex_all,
- BANG|RANGE|NOTADR|COUNT|TRLBAR),
+ BANG|RANGE|NOTADR|COUNT|TRLBAR,
+ ADDR_LINES),
EX(CMD_sandbox, "sandbox", ex_wrongmodifier,
- NEEDARG|EXTRA|NOTRLCOM),
+ NEEDARG|EXTRA|NOTRLCOM,
+ ADDR_LINES),
EX(CMD_saveas, "saveas", ex_write,
- BANG|DFLALL|FILE1|ARGOPT|CMDWIN|TRLBAR),
+ BANG|DFLALL|FILE1|ARGOPT|CMDWIN|TRLBAR,
+ ADDR_LINES),
EX(CMD_sbuffer, "sbuffer", ex_buffer,
- BANG|RANGE|NOTADR|BUFNAME|BUFUNL|COUNT|EXTRA|TRLBAR),
+ BANG|RANGE|NOTADR|BUFNAME|BUFUNL|COUNT|EXTRA|EDITCMD|TRLBAR,
+ ADDR_BUFFERS),
EX(CMD_sbNext, "sbNext", ex_bprevious,
- RANGE|NOTADR|COUNT|TRLBAR),
+ RANGE|NOTADR|COUNT|EDITCMD|TRLBAR,
+ ADDR_LINES),
EX(CMD_sball, "sball", ex_buffer_all,
- RANGE|NOTADR|COUNT|TRLBAR),
+ RANGE|NOTADR|COUNT|EDITCMD|TRLBAR,
+ ADDR_LINES),
EX(CMD_sbfirst, "sbfirst", ex_brewind,
- TRLBAR),
+ EDITCMD|TRLBAR,
+ ADDR_LINES),
EX(CMD_sblast, "sblast", ex_blast,
- TRLBAR),
+ EDITCMD|TRLBAR,
+ ADDR_LINES),
EX(CMD_sbmodified, "sbmodified", ex_bmodified,
- RANGE|NOTADR|COUNT|TRLBAR),
+ RANGE|NOTADR|COUNT|EDITCMD|TRLBAR,
+ ADDR_LINES),
EX(CMD_sbnext, "sbnext", ex_bnext,
- RANGE|NOTADR|COUNT|TRLBAR),
+ RANGE|NOTADR|COUNT|EDITCMD|TRLBAR,
+ ADDR_LINES),
EX(CMD_sbprevious, "sbprevious", ex_bprevious,
- RANGE|NOTADR|COUNT|TRLBAR),
+ RANGE|NOTADR|COUNT|EDITCMD|TRLBAR,
+ ADDR_LINES),
EX(CMD_sbrewind, "sbrewind", ex_brewind,
- TRLBAR),
+ EDITCMD|TRLBAR,
+ ADDR_LINES),
EX(CMD_scriptnames, "scriptnames", ex_scriptnames,
- TRLBAR|CMDWIN),
+ TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_scriptencoding, "scriptencoding", ex_scriptencoding,
- WORD1|TRLBAR|CMDWIN),
+ WORD1|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_scscope, "scscope", do_scscope,
- EXTRA|NOTRLCOM),
+ EXTRA|NOTRLCOM,
+ ADDR_LINES),
EX(CMD_set, "set", ex_set,
- TRLBAR|EXTRA|CMDWIN|SBOXOK),
+ TRLBAR|EXTRA|CMDWIN|SBOXOK,
+ ADDR_LINES),
EX(CMD_setfiletype, "setfiletype", ex_setfiletype,
- TRLBAR|EXTRA|NEEDARG|CMDWIN),
+ TRLBAR|EXTRA|NEEDARG|CMDWIN,
+ ADDR_LINES),
EX(CMD_setglobal, "setglobal", ex_set,
- TRLBAR|EXTRA|CMDWIN|SBOXOK),
+ TRLBAR|EXTRA|CMDWIN|SBOXOK,
+ ADDR_LINES),
EX(CMD_setlocal, "setlocal", ex_set,
- TRLBAR|EXTRA|CMDWIN|SBOXOK),
+ TRLBAR|EXTRA|CMDWIN|SBOXOK,
+ ADDR_LINES),
EX(CMD_sfind, "sfind", ex_splitview,
- BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR),
+ BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR,
+ ADDR_LINES),
EX(CMD_sfirst, "sfirst", ex_rewind,
- EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR),
+ EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR,
+ ADDR_LINES),
EX(CMD_shell, "shell", ex_shell,
- TRLBAR|CMDWIN),
+ TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_simalt, "simalt", ex_simalt,
- NEEDARG|WORD1|TRLBAR|CMDWIN),
+ NEEDARG|WORD1|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_sign, "sign", ex_sign,
- NEEDARG|RANGE|NOTADR|EXTRA|CMDWIN),
+ NEEDARG|RANGE|NOTADR|EXTRA|CMDWIN,
+ ADDR_LINES),
EX(CMD_silent, "silent", ex_wrongmodifier,
- NEEDARG|EXTRA|BANG|NOTRLCOM|SBOXOK|CMDWIN),
+ NEEDARG|EXTRA|BANG|NOTRLCOM|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_sleep, "sleep", ex_sleep,
- RANGE|NOTADR|COUNT|EXTRA|TRLBAR|CMDWIN),
+ RANGE|NOTADR|COUNT|EXTRA|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_slast, "slast", ex_last,
- EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR),
+ EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR,
+ ADDR_LINES),
EX(CMD_smagic, "smagic", ex_submagic,
- RANGE|WHOLEFOLD|EXTRA|CMDWIN),
+ RANGE|WHOLEFOLD|EXTRA|CMDWIN,
+ ADDR_LINES),
EX(CMD_smap, "smap", ex_map,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_smapclear, "smapclear", ex_mapclear,
- EXTRA|TRLBAR|CMDWIN),
+ EXTRA|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_smenu, "smenu", ex_menu,
- RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_snext, "snext", ex_next,
- RANGE|NOTADR|BANG|FILES|EDITCMD|ARGOPT|TRLBAR),
+ RANGE|NOTADR|BANG|FILES|EDITCMD|ARGOPT|TRLBAR,
+ ADDR_LINES),
EX(CMD_sniff, "sniff", ex_sniff,
- EXTRA|TRLBAR),
+ EXTRA|TRLBAR,
+ ADDR_LINES),
EX(CMD_snomagic, "snomagic", ex_submagic,
- RANGE|WHOLEFOLD|EXTRA|CMDWIN),
+ RANGE|WHOLEFOLD|EXTRA|CMDWIN,
+ ADDR_LINES),
EX(CMD_snoremap, "snoremap", ex_map,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_snoremenu, "snoremenu", ex_menu,
- RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_source, "source", ex_source,
- BANG|FILE1|TRLBAR|SBOXOK|CMDWIN),
+ BANG|FILE1|TRLBAR|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_sort, "sort", ex_sort,
- RANGE|DFLALL|WHOLEFOLD|BANG|EXTRA|NOTRLCOM|MODIFY),
+ RANGE|DFLALL|WHOLEFOLD|BANG|EXTRA|NOTRLCOM|MODIFY,
+ ADDR_LINES),
EX(CMD_split, "split", ex_splitview,
- BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR),
+ BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR,
+ ADDR_LINES),
EX(CMD_spellgood, "spellgood", ex_spell,
- BANG|RANGE|NOTADR|NEEDARG|EXTRA|TRLBAR),
+ BANG|RANGE|NOTADR|NEEDARG|EXTRA|TRLBAR,
+ ADDR_LINES),
EX(CMD_spelldump, "spelldump", ex_spelldump,
- BANG|TRLBAR),
+ BANG|TRLBAR,
+ ADDR_LINES),
EX(CMD_spellinfo, "spellinfo", ex_spellinfo,
- TRLBAR),
+ TRLBAR,
+ ADDR_LINES),
EX(CMD_spellrepall, "spellrepall", ex_spellrepall,
- TRLBAR),
+ TRLBAR,
+ ADDR_LINES),
EX(CMD_spellundo, "spellundo", ex_spell,
- BANG|RANGE|NOTADR|NEEDARG|EXTRA|TRLBAR),
+ BANG|RANGE|NOTADR|NEEDARG|EXTRA|TRLBAR,
+ ADDR_LINES),
EX(CMD_spellwrong, "spellwrong", ex_spell,
- BANG|RANGE|NOTADR|NEEDARG|EXTRA|TRLBAR),
+ BANG|RANGE|NOTADR|NEEDARG|EXTRA|TRLBAR,
+ ADDR_LINES),
EX(CMD_sprevious, "sprevious", ex_previous,
- EXTRA|RANGE|NOTADR|COUNT|BANG|EDITCMD|ARGOPT|TRLBAR),
+ EXTRA|RANGE|NOTADR|COUNT|BANG|EDITCMD|ARGOPT|TRLBAR,
+ ADDR_LINES),
EX(CMD_srewind, "srewind", ex_rewind,
- EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR),
+ EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR,
+ ADDR_LINES),
EX(CMD_stop, "stop", ex_stop,
- TRLBAR|BANG|CMDWIN),
+ TRLBAR|BANG|CMDWIN,
+ ADDR_LINES),
EX(CMD_stag, "stag", ex_stag,
- RANGE|NOTADR|BANG|WORD1|TRLBAR|ZEROR),
+ RANGE|NOTADR|BANG|WORD1|TRLBAR|ZEROR,
+ ADDR_LINES),
EX(CMD_startinsert, "startinsert", ex_startinsert,
- BANG|TRLBAR|CMDWIN),
+ BANG|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_startgreplace, "startgreplace", ex_startinsert,
- BANG|TRLBAR|CMDWIN),
+ BANG|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_startreplace, "startreplace", ex_startinsert,
- BANG|TRLBAR|CMDWIN),
+ BANG|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_stopinsert, "stopinsert", ex_stopinsert,
- BANG|TRLBAR|CMDWIN),
+ BANG|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_stjump, "stjump", ex_stag,
- BANG|TRLBAR|WORD1),
+ BANG|TRLBAR|WORD1,
+ ADDR_LINES),
EX(CMD_stselect, "stselect", ex_stag,
- BANG|TRLBAR|WORD1),
+ BANG|TRLBAR|WORD1,
+ ADDR_LINES),
EX(CMD_sunhide, "sunhide", ex_buffer_all,
- RANGE|NOTADR|COUNT|TRLBAR),
+ RANGE|NOTADR|COUNT|TRLBAR,
+ ADDR_LINES),
EX(CMD_sunmap, "sunmap", ex_unmap,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_sunmenu, "sunmenu", ex_menu,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_suspend, "suspend", ex_stop,
- TRLBAR|BANG|CMDWIN),
+ TRLBAR|BANG|CMDWIN,
+ ADDR_LINES),
EX(CMD_sview, "sview", ex_splitview,
- BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR),
+ BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR,
+ ADDR_LINES),
EX(CMD_swapname, "swapname", ex_swapname,
- TRLBAR|CMDWIN),
+ TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_syntax, "syntax", ex_syntax,
- EXTRA|NOTRLCOM|CMDWIN),
+ EXTRA|NOTRLCOM|CMDWIN,
+ ADDR_LINES),
EX(CMD_syntime, "syntime", ex_syntime,
- NEEDARG|WORD1|TRLBAR|CMDWIN),
+ NEEDARG|WORD1|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_syncbind, "syncbind", ex_syncbind,
- TRLBAR),
+ TRLBAR,
+ ADDR_LINES),
EX(CMD_t, "t", ex_copymove,
- RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN|MODIFY),
+ RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN|MODIFY,
+ ADDR_LINES),
EX(CMD_tNext, "tNext", ex_tag,
- RANGE|NOTADR|BANG|TRLBAR|ZEROR),
+ RANGE|NOTADR|BANG|TRLBAR|ZEROR,
+ ADDR_LINES),
EX(CMD_tag, "tag", ex_tag,
- RANGE|NOTADR|BANG|WORD1|TRLBAR|ZEROR),
+ RANGE|NOTADR|BANG|WORD1|TRLBAR|ZEROR,
+ ADDR_LINES),
EX(CMD_tags, "tags", do_tags,
- TRLBAR|CMDWIN),
+ TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_tab, "tab", ex_wrongmodifier,
- NEEDARG|EXTRA|NOTRLCOM),
+ NEEDARG|EXTRA|NOTRLCOM,
+ ADDR_LINES),
EX(CMD_tabclose, "tabclose", ex_tabclose,
- RANGE|NOTADR|COUNT|BANG|TRLBAR|CMDWIN),
+ RANGE|NOTADR|COUNT|BANG|TRLBAR|CMDWIN,
+ ADDR_TABS),
EX(CMD_tabdo, "tabdo", ex_listdo,
- NEEDARG|EXTRA|NOTRLCOM),
+ NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL,
+ ADDR_TABS),
EX(CMD_tabedit, "tabedit", ex_splitview,
- BANG|FILE1|RANGE|NOTADR|ZEROR|EDITCMD|ARGOPT|TRLBAR),
+ BANG|FILE1|RANGE|NOTADR|ZEROR|EDITCMD|ARGOPT|TRLBAR,
+ ADDR_TABS),
EX(CMD_tabfind, "tabfind", ex_splitview,
- BANG|FILE1|RANGE|NOTADR|ZEROR|EDITCMD|ARGOPT|NEEDARG|TRLBAR),
+ BANG|FILE1|RANGE|NOTADR|ZEROR|EDITCMD|ARGOPT|NEEDARG|TRLBAR,
+ ADDR_TABS),
EX(CMD_tabfirst, "tabfirst", ex_tabnext,
- TRLBAR),
+ TRLBAR,
+ ADDR_LINES),
EX(CMD_tabmove, "tabmove", ex_tabmove,
- RANGE|NOTADR|ZEROR|EXTRA|NOSPC|TRLBAR),
+ RANGE|NOTADR|ZEROR|EXTRA|NOSPC|TRLBAR,
+ ADDR_TABS),
EX(CMD_tablast, "tablast", ex_tabnext,
- TRLBAR),
+ TRLBAR,
+ ADDR_LINES),
EX(CMD_tabnext, "tabnext", ex_tabnext,
- RANGE|NOTADR|COUNT|TRLBAR),
+ RANGE|NOTADR|COUNT|TRLBAR,
+ ADDR_LINES),
EX(CMD_tabnew, "tabnew", ex_splitview,
- BANG|FILE1|RANGE|NOTADR|ZEROR|EDITCMD|ARGOPT|TRLBAR),
+ BANG|FILE1|RANGE|NOTADR|ZEROR|EDITCMD|ARGOPT|TRLBAR,
+ ADDR_TABS),
EX(CMD_tabonly, "tabonly", ex_tabonly,
- BANG|TRLBAR|CMDWIN),
+ BANG|RANGE|NOTADR|TRLBAR|CMDWIN,
+ ADDR_TABS),
EX(CMD_tabprevious, "tabprevious", ex_tabnext,
- RANGE|NOTADR|COUNT|TRLBAR),
+ RANGE|NOTADR|COUNT|TRLBAR,
+ ADDR_LINES),
EX(CMD_tabNext, "tabNext", ex_tabnext,
- RANGE|NOTADR|COUNT|TRLBAR),
+ RANGE|NOTADR|COUNT|TRLBAR,
+ ADDR_LINES),
EX(CMD_tabrewind, "tabrewind", ex_tabnext,
- TRLBAR),
+ TRLBAR,
+ ADDR_LINES),
EX(CMD_tabs, "tabs", ex_tabs,
- TRLBAR|CMDWIN),
+ TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_tcl, "tcl", ex_tcl,
- RANGE|EXTRA|NEEDARG|CMDWIN),
+ RANGE|EXTRA|NEEDARG|CMDWIN,
+ ADDR_LINES),
EX(CMD_tcldo, "tcldo", ex_tcldo,
- RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN),
+ RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN,
+ ADDR_LINES),
EX(CMD_tclfile, "tclfile", ex_tclfile,
- RANGE|FILE1|NEEDARG|CMDWIN),
+ RANGE|FILE1|NEEDARG|CMDWIN,
+ ADDR_LINES),
EX(CMD_tearoff, "tearoff", ex_tearoff,
- NEEDARG|EXTRA|TRLBAR|NOTRLCOM|CMDWIN),
+ NEEDARG|EXTRA|TRLBAR|NOTRLCOM|CMDWIN,
+ ADDR_LINES),
EX(CMD_tfirst, "tfirst", ex_tag,
- RANGE|NOTADR|BANG|TRLBAR|ZEROR),
+ RANGE|NOTADR|BANG|TRLBAR|ZEROR,
+ ADDR_LINES),
EX(CMD_throw, "throw", ex_throw,
- EXTRA|NEEDARG|SBOXOK|CMDWIN),
+ EXTRA|NEEDARG|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_tjump, "tjump", ex_tag,
- BANG|TRLBAR|WORD1),
+ BANG|TRLBAR|WORD1,
+ ADDR_LINES),
EX(CMD_tlast, "tlast", ex_tag,
- BANG|TRLBAR),
+ BANG|TRLBAR,
+ ADDR_LINES),
EX(CMD_tmenu, "tmenu", ex_menu,
- RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_tnext, "tnext", ex_tag,
- RANGE|NOTADR|BANG|TRLBAR|ZEROR),
+ RANGE|NOTADR|BANG|TRLBAR|ZEROR,
+ ADDR_LINES),
EX(CMD_topleft, "topleft", ex_wrongmodifier,
- NEEDARG|EXTRA|NOTRLCOM),
+ NEEDARG|EXTRA|NOTRLCOM,
+ ADDR_LINES),
EX(CMD_tprevious, "tprevious", ex_tag,
- RANGE|NOTADR|BANG|TRLBAR|ZEROR),
+ RANGE|NOTADR|BANG|TRLBAR|ZEROR,
+ ADDR_LINES),
EX(CMD_trewind, "trewind", ex_tag,
- RANGE|NOTADR|BANG|TRLBAR|ZEROR),
+ RANGE|NOTADR|BANG|TRLBAR|ZEROR,
+ ADDR_LINES),
EX(CMD_try, "try", ex_try,
- TRLBAR|SBOXOK|CMDWIN),
+ TRLBAR|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_tselect, "tselect", ex_tag,
- BANG|TRLBAR|WORD1),
+ BANG|TRLBAR|WORD1,
+ ADDR_LINES),
EX(CMD_tunmenu, "tunmenu", ex_menu,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_undo, "undo", ex_undo,
- RANGE|NOTADR|COUNT|ZEROR|TRLBAR|CMDWIN),
+ RANGE|NOTADR|COUNT|ZEROR|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_undojoin, "undojoin", ex_undojoin,
- TRLBAR|CMDWIN),
+ TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_undolist, "undolist", ex_undolist,
- TRLBAR|CMDWIN),
+ TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_unabbreviate, "unabbreviate", ex_abbreviate,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_unhide, "unhide", ex_buffer_all,
- RANGE|NOTADR|COUNT|TRLBAR),
+ RANGE|NOTADR|COUNT|TRLBAR,
+ ADDR_LINES),
EX(CMD_unlet, "unlet", ex_unlet,
- BANG|EXTRA|NEEDARG|SBOXOK|CMDWIN),
+ BANG|EXTRA|NEEDARG|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_unlockvar, "unlockvar", ex_lockvar,
- BANG|EXTRA|NEEDARG|SBOXOK|CMDWIN),
+ BANG|EXTRA|NEEDARG|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_unmap, "unmap", ex_unmap,
- BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_unmenu, "unmenu", ex_menu,
- BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_unsilent, "unsilent", ex_wrongmodifier,
- NEEDARG|EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+ NEEDARG|EXTRA|NOTRLCOM|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_update, "update", ex_update,
- RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR),
+ RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR,
+ ADDR_LINES),
EX(CMD_vglobal, "vglobal", ex_global,
- RANGE|WHOLEFOLD|EXTRA|DFLALL|CMDWIN),
+ RANGE|WHOLEFOLD|EXTRA|DFLALL|CMDWIN,
+ ADDR_LINES),
EX(CMD_version, "version", ex_version,
- EXTRA|TRLBAR|CMDWIN),
+ EXTRA|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_verbose, "verbose", ex_wrongmodifier,
- NEEDARG|RANGE|NOTADR|EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+ NEEDARG|RANGE|NOTADR|EXTRA|NOTRLCOM|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_vertical, "vertical", ex_wrongmodifier,
- NEEDARG|EXTRA|NOTRLCOM),
+ NEEDARG|EXTRA|NOTRLCOM,
+ ADDR_LINES),
EX(CMD_visual, "visual", ex_edit,
- BANG|FILE1|EDITCMD|ARGOPT|TRLBAR),
+ BANG|FILE1|EDITCMD|ARGOPT|TRLBAR,
+ ADDR_LINES),
EX(CMD_view, "view", ex_edit,
- BANG|FILE1|EDITCMD|ARGOPT|TRLBAR),
+ BANG|FILE1|EDITCMD|ARGOPT|TRLBAR,
+ ADDR_LINES),
EX(CMD_vimgrep, "vimgrep", ex_vimgrep,
- RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE),
+ RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE,
+ ADDR_LINES),
EX(CMD_vimgrepadd, "vimgrepadd", ex_vimgrep,
- RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE),
+ RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE,
+ ADDR_LINES),
EX(CMD_viusage, "viusage", ex_viusage,
- TRLBAR),
+ TRLBAR,
+ ADDR_LINES),
EX(CMD_vmap, "vmap", ex_map,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_vmapclear, "vmapclear", ex_mapclear,
- EXTRA|TRLBAR|CMDWIN),
+ EXTRA|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_vmenu, "vmenu", ex_menu,
- RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_vnoremap, "vnoremap", ex_map,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_vnew, "vnew", ex_splitview,
- BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR),
+ BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR,
+ ADDR_LINES),
EX(CMD_vnoremenu, "vnoremenu", ex_menu,
- RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_vsplit, "vsplit", ex_splitview,
- BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR),
+ BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR,
+ ADDR_LINES),
EX(CMD_vunmap, "vunmap", ex_unmap,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_vunmenu, "vunmenu", ex_menu,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_write, "write", ex_write,
- RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR|CMDWIN),
+ RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_wNext, "wNext", ex_wnext,
- RANGE|WHOLEFOLD|NOTADR|BANG|FILE1|ARGOPT|TRLBAR),
+ RANGE|WHOLEFOLD|NOTADR|BANG|FILE1|ARGOPT|TRLBAR,
+ ADDR_LINES),
EX(CMD_wall, "wall", do_wqall,
- BANG|TRLBAR|CMDWIN),
+ BANG|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_while, "while", ex_while,
- EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+ EXTRA|NOTRLCOM|SBOXOK|CMDWIN,
+ ADDR_LINES),
EX(CMD_winsize, "winsize", ex_winsize,
- EXTRA|NEEDARG|TRLBAR),
+ EXTRA|NEEDARG|TRLBAR,
+ ADDR_LINES),
EX(CMD_wincmd, "wincmd", ex_wincmd,
- NEEDARG|WORD1|RANGE|NOTADR),
+ NEEDARG|WORD1|RANGE|NOTADR,
+ ADDR_WINDOWS),
EX(CMD_windo, "windo", ex_listdo,
- BANG|NEEDARG|EXTRA|NOTRLCOM),
+ BANG|NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL,
+ ADDR_WINDOWS),
EX(CMD_winpos, "winpos", ex_winpos,
- EXTRA|TRLBAR|CMDWIN),
+ EXTRA|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_wnext, "wnext", ex_wnext,
- RANGE|NOTADR|BANG|FILE1|ARGOPT|TRLBAR),
+ RANGE|NOTADR|BANG|FILE1|ARGOPT|TRLBAR,
+ ADDR_LINES),
EX(CMD_wprevious, "wprevious", ex_wnext,
- RANGE|NOTADR|BANG|FILE1|ARGOPT|TRLBAR),
+ RANGE|NOTADR|BANG|FILE1|ARGOPT|TRLBAR,
+ ADDR_LINES),
EX(CMD_wq, "wq", ex_exit,
- RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR),
+ RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR,
+ ADDR_LINES),
EX(CMD_wqall, "wqall", do_wqall,
- BANG|FILE1|ARGOPT|DFLALL|TRLBAR),
+ BANG|FILE1|ARGOPT|DFLALL|TRLBAR,
+ ADDR_LINES),
EX(CMD_wsverb, "wsverb", ex_wsverb,
- EXTRA|NOTADR|NEEDARG),
+ EXTRA|NOTADR|NEEDARG,
+ ADDR_LINES),
EX(CMD_wundo, "wundo", ex_wundo,
- BANG|NEEDARG|FILE1),
+ BANG|NEEDARG|FILE1,
+ ADDR_LINES),
EX(CMD_wviminfo, "wviminfo", ex_viminfo,
- BANG|FILE1|TRLBAR|CMDWIN),
+ BANG|FILE1|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_xit, "xit", ex_exit,
- RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR|CMDWIN),
+ RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_xall, "xall", do_wqall,
- BANG|TRLBAR),
+ BANG|TRLBAR,
+ ADDR_LINES),
EX(CMD_xmap, "xmap", ex_map,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_xmapclear, "xmapclear", ex_mapclear,
- EXTRA|TRLBAR|CMDWIN),
+ EXTRA|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_xmenu, "xmenu", ex_menu,
- RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_xnoremap, "xnoremap", ex_map,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_xnoremenu, "xnoremenu", ex_menu,
- RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_xunmap, "xunmap", ex_unmap,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_xunmenu, "xunmenu", ex_menu,
- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ ADDR_LINES),
EX(CMD_yank, "yank", ex_operators,
- RANGE|WHOLEFOLD|REGSTR|COUNT|TRLBAR|CMDWIN),
+ RANGE|WHOLEFOLD|REGSTR|COUNT|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_z, "z", ex_z,
- RANGE|WHOLEFOLD|EXTRA|EXFLAGS|TRLBAR|CMDWIN),
+ RANGE|WHOLEFOLD|EXTRA|EXFLAGS|TRLBAR|CMDWIN,
+ ADDR_LINES),
/* commands that don't start with a lowercase letter */
EX(CMD_bang, "!", ex_bang,
- RANGE|WHOLEFOLD|BANG|FILES|CMDWIN),
+ RANGE|WHOLEFOLD|BANG|FILES|CMDWIN,
+ ADDR_LINES),
EX(CMD_pound, "#", ex_print,
- RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN),
+ RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_and, "&", do_sub,
- RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY),
+ RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY,
+ ADDR_LINES),
EX(CMD_star, "*", ex_at,
- RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN),
+ RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_lshift, "<", ex_operators,
- RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN|MODIFY),
+ RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN|MODIFY,
+ ADDR_LINES),
EX(CMD_equal, "=", ex_equal,
- RANGE|TRLBAR|DFLALL|EXFLAGS|CMDWIN),
+ RANGE|TRLBAR|DFLALL|EXFLAGS|CMDWIN,
+ ADDR_LINES),
EX(CMD_rshift, ">", ex_operators,
- RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN|MODIFY),
+ RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN|MODIFY,
+ ADDR_LINES),
EX(CMD_at, "@", ex_at,
- RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN),
+ RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_Next, "Next", ex_previous,
- EXTRA|RANGE|NOTADR|COUNT|BANG|EDITCMD|ARGOPT|TRLBAR),
+ EXTRA|RANGE|NOTADR|COUNT|BANG|EDITCMD|ARGOPT|TRLBAR,
+ ADDR_LINES),
EX(CMD_Print, "Print", ex_print,
- RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN),
+ RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN,
+ ADDR_LINES),
EX(CMD_X, "X", ex_X,
- TRLBAR),
+ TRLBAR,
+ ADDR_LINES),
EX(CMD_tilde, "~", do_sub,
- RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY),
+ RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY,
+ ADDR_LINES),
#ifndef DO_DECLARE_EXCMD
#ifdef FEAT_USR_CMDS
@@ -1151,8 +1685,6 @@ EX(CMD_tilde, "~", do_sub,
#endif
};
-#define USER_CMDIDX(idx) ((int)(idx) < 0)
-
#ifndef DO_DECLARE_EXCMD
typedef enum CMD_index cmdidx_T;
@@ -1172,6 +1704,7 @@ struct exarg
int addr_count; /* the number of addresses given */
linenr_T line1; /* the first line number */
linenr_T line2; /* the second line number or count */
+ int addr_type; /* type of the count/range */
int flags; /* extra flags after count: EXFLAG_ */
char_u *do_ecmd_cmd; /* +command arg to be used in edited file */
linenr_T do_ecmd_lnum; /* the line number in an edited file */
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
index c502ff852..48badeb93 100644
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -739,7 +739,6 @@ debuggy_find(file, fname, after, gap, fp)
struct debuggy *bp;
int i;
linenr_T lnum = 0;
- regmatch_T regmatch;
char_u *name = fname;
int prev_got_int;
@@ -771,8 +770,6 @@ debuggy_find(file, fname, after, gap, fp)
#endif
(bp->dbg_lnum > after && (lnum == 0 || bp->dbg_lnum < lnum)))))
{
- regmatch.regprog = bp->dbg_prog;
- regmatch.rm_ic = FALSE;
/*
* Save the value of got_int and reset it. We don't want a
* previous interruption cancel matching, only hitting CTRL-C
@@ -780,7 +777,7 @@ debuggy_find(file, fname, after, gap, fp)
*/
prev_got_int = got_int;
got_int = FALSE;
- if (vim_regexec(&regmatch, name, (colnr_T)0))
+ if (vim_regexec_prog(&bp->dbg_prog, FALSE, name, (colnr_T)0))
{
lnum = bp->dbg_lnum;
if (fp != NULL)
@@ -2464,6 +2461,9 @@ ex_listdo(eap)
* great speed improvement. */
save_ei = au_event_disable(",Syntax");
#endif
+#ifdef FEAT_CLIPBOARD
+ start_global_changes();
+#endif
if (eap->cmdidx == CMD_windo
|| eap->cmdidx == CMD_tabdo
@@ -2472,15 +2472,36 @@ ex_listdo(eap)
| (eap->forceit ? CCGD_FORCEIT : 0)
| CCGD_EXCMD))
{
- /* start at the first argument/window/buffer */
i = 0;
+ /* start at the eap->line1 argument/window/buffer */
#ifdef FEAT_WINDOWS
wp = firstwin;
tp = first_tabpage;
#endif
+ switch (eap->cmdidx)
+ {
+#ifdef FEAT_WINDOWS
+ case CMD_windo:
+ for ( ; wp != NULL && i + 1 < eap->line1; wp = wp->w_next)
+ i++;
+ break;
+ case CMD_tabdo:
+ for( ; tp != NULL && i + 1 < eap->line1; tp = tp->tp_next)
+ i++;
+ break;
+#endif
+ case CMD_argdo:
+ i = eap->line1 - 1;
+ break;
+ case CMD_bufdo:
+ i = eap->line1;
+ break;
+ default:
+ break;
+ }
/* set pcmark now */
if (eap->cmdidx == CMD_bufdo)
- goto_buffer(eap, DOBUF_FIRST, FORWARD, 0);
+ goto_buffer(eap, DOBUF_FIRST, FORWARD, i);
else
setpcmark();
listcmd_busy = TRUE; /* avoids setting pcmark below */
@@ -2506,7 +2527,6 @@ ex_listdo(eap)
}
if (curwin->w_arg_idx != i)
break;
- ++i;
}
#ifdef FEAT_WINDOWS
else if (eap->cmdidx == CMD_windo)
@@ -2541,6 +2561,8 @@ ex_listdo(eap)
}
}
+ ++i;
+
/* execute the command */
do_cmdline(eap->arg, eap->getline, eap->cookie,
DOCMD_VERBOSE + DOCMD_NOWAIT);
@@ -2548,7 +2570,7 @@ ex_listdo(eap)
if (eap->cmdidx == CMD_bufdo)
{
/* Done? */
- if (next_fnum < 0)
+ if (next_fnum < 0 || next_fnum > eap->line2)
break;
/* Check if the buffer still exists. */
for (buf = firstbuf; buf != NULL; buf = buf->b_next)
@@ -2579,6 +2601,14 @@ ex_listdo(eap)
do_check_scrollbind(TRUE);
#endif
}
+
+#ifdef FEAT_WINDOWS
+ if (eap->cmdidx == CMD_windo || eap->cmdidx == CMD_tabdo)
+ if (i+1 > eap->line2)
+ break;
+#endif
+ if (eap->cmdidx == CMD_argdo && i >= eap->line2)
+ break;
}
listcmd_busy = FALSE;
}
@@ -2591,6 +2621,9 @@ ex_listdo(eap)
curbuf->b_fname, TRUE, curbuf);
}
#endif
+#ifdef FEAT_CLIPBOARD
+ end_global_changes();
+#endif
}
/*
@@ -2750,8 +2783,8 @@ source_runtime(name, all)
* used.
* Returns OK when at least one match found, FAIL otherwise.
*
- * If "name" is NULL calls callback for each entry in runtimepath. Cookie is
- * passed by reference in this case, setting it to NULL indicates that callback
+ * If "name" is NULL calls callback for each entry in runtimepath. Cookie is
+ * passed by reference in this case, setting it to NULL indicates that callback
* has done its job.
*/
int
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 083693b64..c36f40740 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -27,6 +27,7 @@ typedef struct ucmd
char_u *uc_rep; /* The command's replacement string */
long uc_def; /* The default value for a range/count */
int uc_compl; /* completion type */
+ int uc_addr_type; /* The command's address type */
# ifdef FEAT_EVAL
scid_T uc_scriptID; /* SID where the command was defined */
# ifdef FEAT_CMDL_COMPL
@@ -49,12 +50,18 @@ static void ex_delcommand __ARGS((exarg_T *eap));
static char_u *get_user_command_name __ARGS((int idx));
# endif
+/* Wether a command index indicates a user command. */
+# define IS_USER_CMDIDX(idx) ((int)(idx) < 0)
+
#else
# define ex_command ex_ni
# define ex_comclear ex_ni
# define ex_delcommand ex_ni
+/* Wether a command index indicates a user command. */
+# define IS_USER_CMDIDX(idx) (FALSE)
#endif
+static int compute_buffer_local_count __ARGS((int addr_type, int lnum, int local));
#ifdef FEAT_EVAL
static char_u *do_one_cmd __ARGS((char_u **, int, struct condstack *, char_u *(*fgetline)(int, void *, int), void *cookie));
#else
@@ -128,7 +135,7 @@ static int getargopt __ARGS((exarg_T *eap));
#endif
static int check_more __ARGS((int, int));
-static linenr_T get_address __ARGS((char_u **, int skip, int to_other_file));
+static linenr_T get_address __ARGS((char_u **, int addr_type, int skip, int to_other_file));
static void get_flags __ARGS((exarg_T *eap));
#if !defined(FEAT_PERL) \
|| !defined(FEAT_PYTHON) || !defined(FEAT_PYTHON3) \
@@ -1675,6 +1682,102 @@ getline_cookie(fgetline, cookie)
}
#endif
+
+/*
+ * Helper function to apply an offset for buffer commands, i.e. ":bdelete",
+ * ":bwipeout", etc.
+ * Returns the buffer number.
+ */
+ static int
+compute_buffer_local_count(addr_type, lnum, offset)
+ int addr_type;
+ int lnum;
+ int offset;
+{
+ buf_T *buf;
+ buf_T *nextbuf;
+ int count = offset;
+
+ buf = firstbuf;
+ while (buf->b_next != NULL && buf->b_fnum < lnum)
+ buf = buf->b_next;
+ while (count != 0)
+ {
+ count += (offset < 0) ? 1 : -1;
+ nextbuf = (offset < 0) ? buf->b_prev : buf->b_next;
+ if (nextbuf == NULL)
+ break;
+ buf = nextbuf;
+ if (addr_type == ADDR_LOADED_BUFFERS)
+ /* skip over unloaded buffers */
+ while (buf->b_ml.ml_mfp == NULL)
+ {
+ nextbuf = (offset < 0) ? buf->b_prev : buf->b_next;
+ if (nextbuf == NULL)
+ break;
+ buf = nextbuf;
+ }
+ }
+ /* we might have gone too far, last buffer is not loadedd */
+ if (addr_type == ADDR_LOADED_BUFFERS)
+ while (buf->b_ml.ml_mfp == NULL)
+ {
+ nextbuf = (offset >= 0) ? buf->b_prev : buf->b_next;
+ if (nextbuf == NULL)
+ break;
+ buf = nextbuf;
+ }
+ return buf->b_fnum;
+}
+
+#ifdef FEAT_WINDOWS
+static int current_win_nr __ARGS((win_T *win));
+static int current_tab_nr __ARGS((tabpage_T *tab));
+
+ static int
+current_win_nr(win)
+ win_T *win;
+{
+ win_T *wp;
+ int nr = 0;
+
+ for (wp = firstwin; wp != NULL; wp = wp->w_next)
+ {
+ ++nr;
+ if (wp == win)
+ break;
+ }
+ return nr;
+}
+
+ static int
+current_tab_nr(tab)
+ tabpage_T *tab;
+{
+ tabpage_T *tp;
+ int nr = 0;
+
+ for (tp = first_tabpage; tp != NULL; tp = tp->tp_next)
+ {
+ ++nr;
+ if (tp == tab)
+ break;
+ }
+ return nr;
+}
+
+# define CURRENT_WIN_NR current_win_nr(curwin)
+# define LAST_WIN_NR current_win_nr(NULL)
+# define CURRENT_TAB_NR current_tab_nr(curtab)
+# define LAST_TAB_NR current_tab_nr(NULL)
+#else
+# define CURRENT_WIN_NR 1
+# define LAST_WIN_NR 1
+# define CURRENT_TAB_NR 1
+# define LAST_TAB_NR 1
+#endif
+
+
/*
* Execute one Ex command.
*
@@ -1682,10 +1785,11 @@ getline_cookie(fgetline, cookie)
*
* 1. skip comment lines and leading space
* 2. handle command modifiers
- * 3. parse range
- * 4. parse command
- * 5. parse arguments
- * 6. switch on command name
+ * 3. find the command
+ * 4. parse range
+ * 5. Parse the command.
+ * 6. parse arguments
+ * 7. switch on command name
*
* Note: "fgetline" can be NULL.
*
@@ -1725,6 +1829,7 @@ do_one_cmd(cmdlinep, sourcing,
#endif
cmdmod_T save_cmdmod;
int ni; /* set when Not Implemented */
+ char_u *cmd;
vim_memset(&ea, 0, sizeof(ea));
ea.line1 = 1;
@@ -1764,7 +1869,7 @@ do_one_cmd(cmdlinep, sourcing,
for (;;)
{
/*
- * 1. skip comment lines and leading white space and colons
+ * 1. Skip comment lines and leading white space and colons.
*/
while (*ea.cmd == ' ' || *ea.cmd == '\t' || *ea.cmd == ':')
++ea.cmd;
@@ -1789,7 +1894,7 @@ do_one_cmd(cmdlinep, sourcing,
}
/*
- * 2. handle command modifiers.
+ * 2. Handle command modifiers.
*/
p = ea.cmd;
if (VIM_ISDIGIT(*ea.cmd))
@@ -1998,7 +2103,18 @@ do_one_cmd(cmdlinep, sourcing,
#endif
/*
- * 3. parse a range specifier of the form: addr [,addr] [;addr] ..
+ * 3. Skip over the range to find the command. Let "p" point to after it.
+ *
+ * We need the command to know what kind of range it uses.
+ */
+ cmd = ea.cmd;
+ ea.cmd = skip_range(ea.cmd, NULL);
+ if (*ea.cmd == '*' && vim_strchr(p_cpo, CPO_STAR) == NULL)
+ ea.cmd = skipwhite(ea.cmd + 1);
+ p = find_command(&ea, NULL);
+
+/*
+ * 4. parse a range specifier of the form: addr [,addr] [;addr] ..
*
* where 'addr' is:
*
@@ -2014,22 +2130,105 @@ do_one_cmd(cmdlinep, sourcing,
* is equal to the lower.
*/
+ if (ea.cmdidx != CMD_SIZE
+#ifdef FEAT_USR_CMDS
+ && ea.cmdidx != CMD_USER
+ && ea.cmdidx != CMD_USER_BUF
+#endif
+ )
+ ea.addr_type = cmdnames[(int)ea.cmdidx].cmd_addr_type;
+ else
+#ifdef FEAT_USR_CMDS
+ if (ea.cmdidx != CMD_USER && ea.cmdidx != CMD_USER_BUF)
+#endif
+ ea.addr_type = ADDR_LINES;
+ /* ea.addr_type for user commands is set by find_ucmd */
+ ea.cmd = cmd;
+
/* repeat for all ',' or ';' separated addresses */
for (;;)
{
ea.line1 = ea.line2;
- ea.line2 = curwin->w_cursor.lnum; /* default is current line number */
+ switch (ea.addr_type)
+ {
+ case ADDR_LINES:
+ /* default is current line number */
+ ea.line2 = curwin->w_cursor.lnum;
+ break;
+ case ADDR_WINDOWS:
+ lnum = CURRENT_WIN_NR;
+ ea.line2 = lnum;
+ break;
+ case ADDR_ARGUMENTS:
+ ea.line2 = curwin->w_arg_idx + 1;
+ if (ea.line2 > ARGCOUNT)
+ ea.line2 = ARGCOUNT;
+ break;
+ case ADDR_LOADED_BUFFERS:
+ case ADDR_BUFFERS:
+ ea.line2 = curbuf->b_fnum;
+ break;
+ case ADDR_TABS:
+ lnum = CURRENT_TAB_NR;
+ ea.line2 = lnum;
+ break;
+ }
ea.cmd = skipwhite(ea.cmd);
- lnum = get_address(&ea.cmd, ea.skip, ea.addr_count == 0);
+ lnum = get_address(&ea.cmd, ea.addr_type, ea.skip, ea.addr_count == 0);
if (ea.cmd == NULL) /* error detected */
goto doend;
if (lnum == MAXLNUM)
{
if (*ea.cmd == '%') /* '%' - all lines */
{
+ buf_T *buf;
++ea.cmd;
- ea.line1 = 1;
- ea.line2 = curbuf->b_ml.ml_line_count;
+ switch (ea.addr_type)
+ {
+ case ADDR_LINES:
+ ea.line1 = 1;
+ ea.line2 = curbuf->b_ml.ml_line_count;
+ break;
+ case ADDR_LOADED_BUFFERS:
+ buf = firstbuf;
+ while (buf->b_next != NULL && buf->b_ml.ml_mfp == NULL)
+ buf = buf->b_next;
+ ea.line1 = buf->b_fnum;
+ buf = lastbuf;
+ while (buf->b_prev != NULL && buf->b_ml.ml_mfp == NULL)
+ buf = buf->b_prev;
+ ea.line2 = buf->b_fnum;
+ break;
+ case ADDR_BUFFERS:
+ ea.line1 = firstbuf->b_fnum;
+ ea.line2 = lastbuf->b_fnum;
+ break;
+ case ADDR_WINDOWS:
+ case ADDR_TABS:
+ if (IS_USER_CMDIDX(ea.cmdidx))
+ {
+ ea.line1 = 1;
+ ea.line2 = ea.addr_type == ADDR_WINDOWS
+ ? LAST_WIN_NR : LAST_TAB_NR;
+ }
+ else
+ {
+ /* there is no Vim command which uses '%' and
+ * ADDR_WINDOWS or ADDR_TABS */
+ errormsg = (char_u *)_(e_invrange);
+ goto doend;
+ }
+ break;
+ case ADDR_ARGUMENTS:
+ if (ARGCOUNT == 0)
+ ea.line1 = ea.line2 = 0;
+ else
+ {
+ ea.line1 = 1;
+ ea.line2 = ARGCOUNT;
+ }
+ break;
+ }
++ea.addr_count;
}
/* '*' - visual area */
@@ -2037,6 +2236,12 @@ do_one_cmd(cmdlinep, sourcing,
{
pos_T *fp;
+ if (ea.addr_type != ADDR_LINES)
+ {
+ errormsg = (char_u *)_(e_invrange);
+ goto doend;
+ }
+
++ea.cmd;
if (!ea.skip)
{
@@ -2079,7 +2284,7 @@ do_one_cmd(cmdlinep, sourcing,
check_cursor_lnum();
/*
- * 4. parse command
+ * 5. Parse the command.
*/
/*
@@ -2093,8 +2298,8 @@ do_one_cmd(cmdlinep, sourcing,
* If we got a line, but no command, then go to the line.
* If we find a '|' or '\n' we set ea.nextcmd.
*/
- if (*ea.cmd == NUL || *ea.cmd == '"' ||
- (ea.nextcmd = check_nextcmd(ea.cmd)) != NULL)
+ if (*ea.cmd == NUL || *ea.cmd == '"'
+ || (ea.nextcmd = check_nextcmd(ea.cmd)) != NULL)
{
/*
* strange vi behaviour:
@@ -2140,8 +2345,25 @@ do_one_cmd(cmdlinep, sourcing,
goto doend;
}
- /* Find the command and let "p" point to after it. */
- p = find_command(&ea, NULL);
+#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
+ && ASCII_ISUPPER(*ea.cmd)
+ && has_cmdundefined())
+ {
+ int ret;
+
+ p = ea.cmd;
+ while (ASCII_ISALNUM(*p))
+ ++p;
+ p = vim_strnsave(ea.cmd, (int)(p - ea.cmd));
+ ret = apply_autocmds(EVENT_CMDUNDEFINED, p, p, TRUE, NULL);
+ vim_free(p);
+ if (ret && !aborting())
+ p = find_command(&ea, NULL);
+ }
+#endif
#ifdef FEAT_USR_CMDS
if (p == NULL)
@@ -2170,11 +2392,8 @@ do_one_cmd(cmdlinep, sourcing,
goto doend;
}
- ni = (
-#ifdef FEAT_USR_CMDS
- !USER_CMDIDX(ea.cmdidx) &&
-#endif
- (cmdnames[ea.cmdidx].cmd_func == ex_ni
+ ni = (!IS_USER_CMDIDX(ea.cmdidx)
+ && (cmdnames[ea.cmdidx].cmd_func == ex_ni
#ifdef HAVE_EX_SCRIPT_NI
|| cmdnames[ea.cmdidx].cmd_func == ex_script_ni
#endif
@@ -2207,11 +2426,9 @@ do_one_cmd(cmdlinep, sourcing,
ea.forceit = FALSE;
/*
- * 5. parse arguments
+ * 6. Parse arguments.
*/
-#ifdef FEAT_USR_CMDS
- if (!USER_CMDIDX(ea.cmdidx))
-#endif
+ if (!IS_USER_CMDIDX(ea.cmdidx))
ea.argt = (long)cmdnames[(int)ea.cmdidx].cmd_argt;
if (!ea.skip)
@@ -2232,10 +2449,7 @@ do_one_cmd(cmdlinep, sourcing,
}
if (text_locked() && !(ea.argt & CMDWIN)
-# ifdef FEAT_USR_CMDS
- && !USER_CMDIDX(ea.cmdidx)
-# endif
- )
+ && !IS_USER_CMDIDX(ea.cmdidx))
{
/* Command not allowed when editing the command line. */
#ifdef FEAT_CMDWIN
@@ -2253,9 +2467,7 @@ do_one_cmd(cmdlinep, sourcing,
if (!(ea.argt & CMDWIN)
&& ea.cmdidx != CMD_edit
&& ea.cmdidx != CMD_checktime
-# ifdef FEAT_USR_CMDS
- && !USER_CMDIDX(ea.cmdidx)
-# endif
+ && !IS_USER_CMDIDX(ea.cmdidx)
&& curbuf_locked())
goto doend;
#endif
@@ -2441,17 +2653,48 @@ do_one_cmd(cmdlinep, sourcing,
if ((ea.argt & DFLALL) && ea.addr_count == 0)
{
+ buf_T *buf;
+
ea.line1 = 1;
- ea.line2 = curbuf->b_ml.ml_line_count;
+ switch (ea.addr_type)
+ {
+ case ADDR_LINES:
+ ea.line2 = curbuf->b_ml.ml_line_count;
+ break;
+ case ADDR_LOADED_BUFFERS:
+ buf = firstbuf;
+ while (buf->b_next != NULL && buf->b_ml.ml_mfp == NULL)
+ buf = buf->b_next;
+ ea.line1 = buf->b_fnum;
+ buf = lastbuf;
+ while (buf->b_prev != NULL && buf->b_ml.ml_mfp == NULL)
+ buf = buf->b_prev;
+ ea.line2 = buf->b_fnum;
+ break;
+ case ADDR_BUFFERS:
+ ea.line1 = firstbuf->b_fnum;
+ ea.line2 = lastbuf->b_fnum;
+ break;
+ case ADDR_WINDOWS:
+ ea.line2 = LAST_WIN_NR;
+ break;
+ case ADDR_TABS:
+ ea.line2 = LAST_TAB_NR;
+ break;
+ case ADDR_ARGUMENTS:
+ if (ARGCOUNT == 0)
+ ea.line1 = ea.line2 = 0;
+ else
+ ea.line2 = ARGCOUNT;
+ break;
+ }
}
/* accept numbered register only when no count allowed (:put) */
if ( (ea.argt & REGSTR)
&& *ea.arg != NUL
-#ifdef FEAT_USR_CMDS
- /* Do not allow register = for user commands */
- && (!USER_CMDIDX(ea.cmdidx) || *ea.arg != '=')
-#endif
+ /* Do not allow register = for user commands */
+ && (!IS_USER_CMDIDX(ea.cmdidx) || *ea.arg != '=')
&& !((ea.argt & COUNT) && VIM_ISDIGIT(*ea.arg)))
{
#ifndef FEAT_CLIPBOARD
@@ -2462,14 +2705,8 @@ do_one_cmd(cmdlinep, sourcing,
goto doend;
}
#endif
- if (
-#ifdef FEAT_USR_CMDS
- valid_yank_reg(*ea.arg, (ea.cmdidx != CMD_put
- && USER_CMDIDX(ea.cmdidx)))
-#else
- valid_yank_reg(*ea.arg, ea.cmdidx != CMD_put)
-#endif
- )
+ if (valid_yank_reg(*ea.arg, (ea.cmdidx != CMD_put
+ && !IS_USER_CMDIDX(ea.cmdidx))))
{
ea.regname = *ea.arg++;
#ifdef FEAT_EVAL
@@ -2643,10 +2880,7 @@ do_one_cmd(cmdlinep, sourcing,
* number. Don't do this for a user command.
*/
if ((ea.argt & BUFNAME) && *ea.arg != NUL && ea.addr_count == 0
-# ifdef FEAT_USR_CMDS
- && !USER_CMDIDX(ea.cmdidx)
-# endif
- )
+ && !IS_USER_CMDIDX(ea.cmdidx))
{
/*
* :bdelete, :bwipeout and :bunload take several arguments, separated
@@ -2672,7 +2906,7 @@ do_one_cmd(cmdlinep, sourcing,
#endif
/*
- * 6. switch on command name
+ * 7. Switch on command name.
*
* The "ea" structure holds the arguments that can be used.
*/
@@ -2684,7 +2918,7 @@ do_one_cmd(cmdlinep, sourcing,
#endif
#ifdef FEAT_USR_CMDS
- if (USER_CMDIDX(ea.cmdidx))
+ if (IS_USER_CMDIDX(ea.cmdidx))
{
/*
* Execute a user-defined command.
@@ -2743,11 +2977,8 @@ doend:
}
#ifdef FEAT_EVAL
do_errthrow(cstack,
- (ea.cmdidx != CMD_SIZE
-# ifdef FEAT_USR_CMDS
- && !USER_CMDIDX(ea.cmdidx)
-# endif
- ) ? cmdnames[(int)ea.cmdidx].cmd_name : (char_u *)NULL);
+ (ea.cmdidx != CMD_SIZE && !IS_USER_CMDIDX(ea.cmdidx))
+ ? cmdnames[(int)ea.cmdidx].cmd_name : (char_u *)NULL);
#endif
if (verbose_save >= 0)
@@ -2881,7 +3112,7 @@ find_command(eap, full)
* Exceptions:
* - the 'k' command can directly be followed by any character.
* - the 's' command can be followed directly by 'c', 'g', 'i', 'I' or 'r'
- * but :sre[wind] is another command, as are :scrip[tnames],
+ * but :sre[wind] is another command, as are :scr[iptnames],
* :scs[cope], :sim[alt], :sig[ns] and :sil[ent].
* - the "d" command can directly be followed by 'l' or 'p' flag.
*/
@@ -3037,6 +3268,7 @@ find_ucmd(eap, p, full, xp, compl)
eap->cmdidx = CMD_USER_BUF;
eap->argt = (long)uc->uc_argt;
eap->useridx = j;
+ eap->addr_type = uc->uc_addr_type;
# ifdef FEAT_CMDL_COMPL
if (compl != NULL)
@@ -3212,7 +3444,7 @@ set_one_cmd_context(xp, buff)
ea.argt = 0;
/*
- * 2. skip comment lines and leading space, colons or bars
+ * 1. skip comment lines and leading space, colons or bars
*/
for (cmd = buff; vim_strchr((char_u *)" \t:|", *cmd) != NULL; cmd++)
;
@@ -3227,13 +3459,9 @@ set_one_cmd_context(xp, buff)
}
/*
- * 3. parse a range specifier of the form: addr [,addr] [;addr] ..
+ * 3. Skip over the range to find the command.
*/
cmd = skip_range(cmd, &xp->xp_context);
-
-/*
- * 4. parse command
- */
xp->xp_pattern = cmd;
if (*cmd == NUL)
return NULL;
@@ -3339,11 +3567,9 @@ set_one_cmd_context(xp, buff)
}
/*
- * 5. parse arguments
+ * 6. parse arguments
*/
-#ifdef FEAT_USR_CMDS
- if (!USER_CMDIDX(ea.cmdidx))
-#endif
+ if (!IS_USER_CMDIDX(ea.cmdidx))
ea.argt = (long)cmdnames[(int)ea.cmdidx].cmd_argt;
arg = skipwhite(p);
@@ -3577,7 +3803,7 @@ set_one_cmd_context(xp, buff)
}
/*
- * 6. switch on command name
+ * 6. Switch on command name.
*/
switch (ea.cmdidx)
{
@@ -3671,7 +3897,7 @@ set_one_cmd_context(xp, buff)
return NULL;
}
- /* For the -complete and -nargs attributes, we complete
+ /* For the -complete, -nargs and -addr attributes, we complete
* their arguments as well.
*/
if (STRNICMP(arg, "complete", p - arg) == 0)
@@ -3686,6 +3912,12 @@ set_one_cmd_context(xp, buff)
xp->xp_pattern = p + 1;
return NULL;
}
+ else if (STRNICMP(arg, "addr", p - arg) == 0)
+ {
+ xp->xp_context = EXPAND_USER_ADDR_TYPE;
+ xp->xp_pattern = p + 1;
+ return NULL;
+ }
return NULL;
}
arg = skipwhite(p);
@@ -4083,8 +4315,9 @@ skip_range(cmd, ctx)
* Return MAXLNUM when no Ex address was found.
*/
static linenr_T
-get_address(ptr, skip, to_other_file)
+get_address(ptr, addr_type, skip, to_other_file)
char_u **ptr;
+ int addr_type; /* flag: one of ADDR_LINES, ... */
int skip; /* only skip the address, don't use it */
int to_other_file; /* flag: may jump to other file */
{
@@ -4095,6 +4328,7 @@ get_address(ptr, skip, to_other_file)
pos_T pos;
pos_T *fp;
linenr_T lnum;
+ buf_T *buf;
cmd = skipwhite(*ptr);
lnum = MAXLNUM;
@@ -4103,137 +4337,197 @@ get_address(ptr, skip, to_other_file)
switch (*cmd)
{
case '.': /* '.' - Cursor position */
- ++cmd;
+ ++cmd;
+ switch (addr_type)
+ {
+ case ADDR_LINES:
lnum = curwin->w_cursor.lnum;
break;
+ case ADDR_WINDOWS:
+ lnum = CURRENT_WIN_NR;
+ break;
+ case ADDR_ARGUMENTS:
+ lnum = curwin->w_arg_idx + 1;
+ break;
+ case ADDR_LOADED_BUFFERS:
+ case ADDR_BUFFERS:
+ lnum = curbuf->b_fnum;
+ break;
+ case ADDR_TABS:
+ lnum = CURRENT_TAB_NR;
+ break;
+ }
+ break;
case '$': /* '$' - last line */
- ++cmd;
+ ++cmd;
+ switch (addr_type)
+ {
+ case ADDR_LINES:
lnum = curbuf->b_ml.ml_line_count;
break;
+ case ADDR_WINDOWS:
+ lnum = LAST_WIN_NR;
+ break;
+ case ADDR_ARGUMENTS:
+ lnum = ARGCOUNT;
+ break;
+ case ADDR_LOADED_BUFFERS:
+ buf = lastbuf;
+ while (buf->b_ml.ml_mfp == NULL)
+ {
+ if (buf->b_prev == NULL)
+ break;
+ buf = buf->b_prev;
+ }
+ lnum = buf->b_fnum;
+ break;
+ case ADDR_BUFFERS:
+ lnum = lastbuf->b_fnum;
+ break;
+ case ADDR_TABS:
+ lnum = LAST_TAB_NR;
+ break;
+ }
+ break;
case '\'': /* ''' - mark */
- if (*++cmd == NUL)
+ if (*++cmd == NUL)
+ {
+ cmd = NULL;
+ goto error;
+ }
+ if (addr_type != ADDR_LINES)
+ {
+ EMSG(_(e_invaddr));
+ goto error;
+ }
+ if (skip)
+ ++cmd;
+ else
+ {
+ /* Only accept a mark in another file when it is
+ * used by itself: ":'M". */
+ fp = getmark(*cmd, to_other_file && cmd[1] == NUL);
+ ++cmd;
+ if (fp == (pos_T *)-1)
+ /* Jumped to another file. */
+ lnum = curwin->w_cursor.lnum;
+ else
+ {
+ if (check_mark(fp) == FAIL)
{
cmd = NULL;
goto error;
}
- if (skip)
- ++cmd;
- else
- {
- /* Only accept a mark in another file when it is
- * used by itself: ":'M". */
- fp = getmark(*cmd, to_other_file && cmd[1] == NUL);
- ++cmd;
- if (fp == (pos_T *)-1)
- /* Jumped to another file. */
- lnum = curwin->w_cursor.lnum;
- else
- {
- if (check_mark(fp) == FAIL)
- {
- cmd = NULL;
- goto error;
- }
- lnum = fp->lnum;
- }
- }
- break;
+ lnum = fp->lnum;
+ }
+ }
+ break;
case '/':
case '?': /* '/' or '?' - search */
- c = *cmd++;
- if (skip) /* skip "/pat/" */
- {
- cmd = skip_regexp(cmd, c, (int)p_magic, NULL);
- if (*cmd == c)
- ++cmd;
- }
- else
- {
- pos = curwin->w_cursor; /* save curwin->w_cursor */
- /*
- * When '/' or '?' follows another address, start
- * from there.
- */
- if (lnum != MAXLNUM)
- curwin->w_cursor.lnum = lnum;
- /*
- * Start a forward search at the end of the line.
- * Start a backward search at the start of the line.
- * This makes sure we never match in the current
- * line, and can match anywhere in the
- * next/previous line.
- */
- if (c == '/')
- curwin->w_cursor.col = MAXCOL;
- else
- curwin->w_cursor.col = 0;
- searchcmdlen = 0;
- if (!do_search(NULL, c, cmd, 1L,
- SEARCH_HIS | SEARCH_MSG, NULL))
- {
- curwin->w_cursor = pos;
- cmd = NULL;
- goto error;
- }
- lnum = curwin->w_cursor.lnum;
- curwin->w_cursor = pos;
- /* adjust command string pointer */
- cmd += searchcmdlen;
- }
- break;
+ c = *cmd++;
+ if (addr_type != ADDR_LINES)
+ {
+ EMSG(_(e_invaddr));
+ goto error;
+ }
+ if (skip) /* skip "/pat/" */
+ {
+ cmd = skip_regexp(cmd, c, (int)p_magic, NULL);
+ if (*cmd == c)
+ ++cmd;
+ }
+ else
+ {
+ pos = curwin->w_cursor; /* save curwin->w_cursor */
+ /*
+ * When '/' or '?' follows another address, start
+ * from there.
+ */
+ if (lnum != MAXLNUM)
+ curwin->w_cursor.lnum = lnum;
+ /*
+ * Start a forward search at the end of the line.
+ * Start a backward search at the start of the line.
+ * This makes sure we never match in the current
+ * line, and can match anywhere in the
+ * next/previous line.
+ */
+ if (c == '/')
+ curwin->w_cursor.col = MAXCOL;
+ else
+ curwin->w_cursor.col = 0;
+ searchcmdlen = 0;
+ if (!do_search(NULL, c, cmd, 1L,
+ SEARCH_HIS | SEARCH_MSG, NULL))
+ {
+ curwin->w_cursor = pos;
+ cmd = NULL;
+ goto error;
+ }
+ lnum = curwin->w_cursor.lnum;
+ curwin->w_cursor = pos;
+ /* adjust command string pointer */
+ cmd += searchcmdlen;
+ }
+ break;
case '\\': /* "\?", "\/" or "\&", repeat search */
- ++cmd;
- if (*cmd == '&')
- i = RE_SUBST;
- else if (*cmd == '?' || *cmd == '/')
- i = RE_SEARCH;
- else
- {
- EMSG(_(e_backslash));
- cmd = NULL;
- goto error;
- }
+ ++cmd;
+ if (addr_type != ADDR_LINES)
+ {
+ EMSG(_(e_invaddr));
+ goto error;
+ }
+ if (*cmd == '&')
+ i = RE_SUBST;
+ else if (*cmd == '?' || *cmd == '/')
+ i = RE_SEARCH;
+ else
+ {
+ EMSG(_(e_backslash));
+ cmd = NULL;
+ goto error;
+ }
- if (!skip)
- {
- /*
- * When search follows another address, start from
- * there.
- */
- if (lnum != MAXLNUM)
- pos.lnum = lnum;
- else
- pos.lnum = curwin->w_cursor.lnum;
-
- /*
- * Start the search just like for the above
- * do_search().
- */
- if (*cmd != '?')
- pos.col = MAXCOL;
- else
- pos.col = 0;
- if (searchit(curwin, curbuf, &pos,
- *cmd == '?' ? BACKWARD : FORWARD,
- (char_u *)"", 1L, SEARCH_MSG,
- i, (linenr_T)0, NULL) != FAIL)
- lnum = pos.lnum;
- else
- {
- cmd = NULL;
- goto error;
- }
- }
- ++cmd;
- break;
+ if (!skip)
+ {
+ /*
+ * When search follows another address, start from
+ * there.
+ */
+ if (lnum != MAXLNUM)
+ pos.lnum = lnum;
+ else
+ pos.lnum = curwin->w_cursor.lnum;
+
+ /*
+ * Start the search just like for the above
+ * do_search().
+ */
+ if (*cmd != '?')
+ pos.col = MAXCOL;
+ else
+ pos.col = 0;
+ if (searchit(curwin, curbuf, &pos,
+ *cmd == '?' ? BACKWARD : FORWARD,
+ (char_u *)"", 1L, SEARCH_MSG,
+ i, (linenr_T)0, NULL) != FAIL)
+ lnum = pos.lnum;
+ else
+ {
+ cmd = NULL;
+ goto error;
+ }
+ }
+ ++cmd;
+ break;
default:
- if (VIM_ISDIGIT(*cmd)) /* absolute line number */
- lnum = getdigits(&cmd);
+ if (VIM_ISDIGIT(*cmd)) /* absolute line number */
+ lnum = getdigits(&cmd);
}
for (;;)
@@ -4243,7 +4537,29 @@ get_address(ptr, skip, to_other_file)
break;
if (lnum == MAXLNUM)
- lnum = curwin->w_cursor.lnum; /* "+1" is same as ".+1" */
+ {
+ switch (addr_type)
+ {
+ case ADDR_LINES:
+ /* "+1" is same as ".+1" */
+ lnum = curwin->w_cursor.lnum;
+ break;
+ case ADDR_WINDOWS:
+ lnum = CURRENT_WIN_NR;
+ break;
+ case ADDR_ARGUMENTS:
+ lnum = curwin->w_arg_idx + 1;
+ break;
+ case ADDR_LOADED_BUFFERS:
+ case ADDR_BUFFERS:
+ lnum = curbuf->b_fnum;
+ break;
+ case ADDR_TABS:
+ lnum = CURRENT_TAB_NR;
+ break;
+ }
+ }
+
if (VIM_ISDIGIT(*cmd))
i = '+'; /* "number" is same as "+number" */
else
@@ -4252,7 +4568,10 @@ get_address(ptr, skip, to_other_file)
n = 1;
else
n = getdigits(&cmd);
- if (i == '-')
+ if (addr_type == ADDR_LOADED_BUFFERS
+ || addr_type == ADDR_BUFFERS)
+ lnum = compute_buffer_local_count(addr_type, lnum, (i == '-') ? -1 * n : n);
+ else if (i == '-')
lnum -= n;
else
lnum += n;
@@ -4318,17 +4637,64 @@ ex_script_ni(eap)
invalid_range(eap)
exarg_T *eap;
{
+ buf_T *buf;
if ( eap->line1 < 0
|| eap->line2 < 0
- || eap->line1 > eap->line2
- || ((eap->argt & RANGE)
- && !(eap->argt & NOTADR)
- && eap->line2 > curbuf->b_ml.ml_line_count
+ || eap->line1 > eap->line2)
+ return (char_u *)_(e_invrange);
+
+ if (eap->argt & RANGE)
+ {
+ switch(eap->addr_type)
+ {
+ case ADDR_LINES:
+ if (!(eap->argt & NOTADR)
+ && eap->line2 > curbuf->b_ml.ml_line_count
#ifdef FEAT_DIFF
- + (eap->cmdidx == CMD_diffget)
+ + (eap->cmdidx == CMD_diffget)
#endif
- ))
- return (char_u *)_(e_invrange);
+ )
+ return (char_u *)_(e_invrange);
+ break;
+ case ADDR_ARGUMENTS:
+ if (eap->line2 > ARGCOUNT + (!ARGCOUNT)) // add 1 if ARCOUNT is 0
+ return (char_u *)_(e_invrange);
+ break;
+ case ADDR_BUFFERS:
+ if (eap->line1 < firstbuf->b_fnum
+ || eap->line2 > lastbuf->b_fnum)
+ return (char_u *)_(e_invrange);
+ break;
+ case ADDR_LOADED_BUFFERS:
+ buf = firstbuf;
+ while (buf->b_ml.ml_mfp == NULL)
+ {
+ if (buf->b_next == NULL)
+ return (char_u *)_(e_invrange);
+ buf = buf->b_next;
+ }
+ if (eap->line1 < buf->b_fnum)
+ return (char_u *)_(e_invrange);
+ buf = lastbuf;
+ while (buf->b_ml.ml_mfp == NULL)
+ {
+ if (buf->b_prev == NULL)
+ return (char_u *)_(e_invrange);
+ buf = buf->b_prev;
+ }
+ if (eap->line2 > buf->b_fnum)
+ return (char_u *)_(e_invrange);
+ break;
+ case ADDR_WINDOWS:
+ if (eap->line2 > LAST_WIN_NR)
+ return (char_u *)_(e_invrange);
+ break;
+ case ADDR_TABS:
+ if (eap->line2 > LAST_TAB_NR)
+ return (char_u *)_(e_invrange);
+ break;
+ }
+ }
return NULL;
}
@@ -5115,6 +5481,8 @@ ex_buffer(eap)
goto_buffer(eap, DOBUF_CURRENT, FORWARD, 0);
else
goto_buffer(eap, DOBUF_FIRST, FORWARD, (int)eap->line2);
+ if (eap->do_ecmd_cmd != NULL)
+ do_cmdline_cmd(eap->do_ecmd_cmd);
}
}
@@ -5127,6 +5495,8 @@ ex_bmodified(eap)
exarg_T *eap;
{
goto_buffer(eap, DOBUF_MOD, FORWARD, (int)eap->line2);
+ if (eap->do_ecmd_cmd != NULL)
+ do_cmdline_cmd(eap->do_ecmd_cmd);
}
/*
@@ -5138,6 +5508,8 @@ ex_bnext(eap)
exarg_T *eap;
{
goto_buffer(eap, DOBUF_CURRENT, FORWARD, (int)eap->line2);
+ if (eap->do_ecmd_cmd != NULL)
+ do_cmdline_cmd(eap->do_ecmd_cmd);
}
/*
@@ -5151,6 +5523,8 @@ ex_bprevious(eap)
exarg_T *eap;
{
goto_buffer(eap, DOBUF_CURRENT, BACKWARD, (int)eap->line2);
+ if (eap->do_ecmd_cmd != NULL)
+ do_cmdline_cmd(eap->do_ecmd_cmd);
}
/*
@@ -5164,6 +5538,8 @@ ex_brewind(eap)
exarg_T *eap;
{
goto_buffer(eap, DOBUF_FIRST, FORWARD, 0);
+ if (eap->do_ecmd_cmd != NULL)
+ do_cmdline_cmd(eap->do_ecmd_cmd);
}
/*
@@ -5175,6 +5551,8 @@ ex_blast(eap)
exarg_T *eap;
{
goto_buffer(eap, DOBUF_LAST, BACKWARD, 0);
+ if (eap->do_ecmd_cmd != NULL)
+ do_cmdline_cmd(eap->do_ecmd_cmd);
}
#endif
@@ -5288,14 +5666,14 @@ get_command_name(xp, idx)
#endif
#if defined(FEAT_USR_CMDS) || defined(PROTO)
-static int uc_add_command __ARGS((char_u *name, size_t name_len, char_u *rep, long argt, long def, int flags, int compl, char_u *compl_arg, int force));
+static int uc_add_command __ARGS((char_u *name, size_t name_len, char_u *rep, long argt, long def, int flags, int compl, char_u *compl_arg, int addr_type, int force));
static void uc_list __ARGS((char_u *name, size_t name_len));
-static int uc_scan_attr __ARGS((char_u *attr, size_t len, long *argt, long *def, int *flags, int *compl, char_u **compl_arg));
+static int uc_scan_attr __ARGS((char_u *attr, size_t len, long *argt, long *def, int *flags, int *compl, char_u **compl_arg, int* attr_type_arg));
static char_u *uc_split_args __ARGS((char_u *arg, size_t *lenp));
static size_t uc_check_code __ARGS((char_u *code, size_t len, char_u *buf, ucmd_T *cmd, exarg_T *eap, char_u **split_buf, size_t *split_len));
static int
-uc_add_command(name, name_len, rep, argt, def, flags, compl, compl_arg, force)
+uc_add_command(name, name_len, rep, argt, def, flags, compl, compl_arg, addr_type, force)
char_u *name;
size_t name_len;
char_u *rep;
@@ -5304,6 +5682,7 @@ uc_add_command(name, name_len, rep, argt, def, flags, compl, compl_arg, force)
int flags;
int compl;
char_u *compl_arg;
+ int addr_type;
int force;
{
ucmd_T *cmd = NULL;
@@ -5398,6 +5777,7 @@ uc_add_command(name, name_len, rep, argt, def, flags, compl, compl_arg, force)
cmd->uc_compl_arg = compl_arg;
# endif
#endif
+ cmd->uc_addr_type = addr_type;
return OK;
@@ -5410,6 +5790,23 @@ fail:
}
#endif
+#if defined(FEAT_USR_CMDS)
+static struct
+{
+ int expand;
+ char *name;
+} addr_type_complete[] =
+{
+ {ADDR_ARGUMENTS, "arguments"},
+ {ADDR_LINES, "lines"},
+ {ADDR_LOADED_BUFFERS, "loaded_buffers"},
+ {ADDR_TABS, "tabs"},
+ {ADDR_BUFFERS, "buffers"},
+ {ADDR_WINDOWS, "windows"},
+ {-1, NULL}
+};
+#endif
+
#if defined(FEAT_USR_CMDS) || defined(FEAT_EVAL) || defined(PROTO)
/*
* List of names for completion for ":command" with the EXPAND_ flag.
@@ -5497,7 +5894,7 @@ uc_list(name, name_len)
/* Put out the title first time */
if (!found)
- MSG_PUTS_TITLE(_("\n Name Args Range Complete Definition"));
+ MSG_PUTS_TITLE(_("\n Name Args Address Complete Definition"));
found = TRUE;
msg_putchar('\n');
if (got_int)
@@ -5558,6 +5955,20 @@ uc_list(name, name_len)
IObuff[len++] = ' ';
} while (len < 11);
+ /* Address Type */
+ for (j = 0; addr_type_complete[j].expand != -1; ++j)
+ if (addr_type_complete[j].expand != ADDR_LINES
+ && addr_type_complete[j].expand == cmd->uc_addr_type)
+ {
+ STRCPY(IObuff + len, addr_type_complete[j].name);
+ len += (int)STRLEN(IObuff + len);
+ break;
+ }
+
+ do {
+ IObuff[len++] = ' ';
+ } while (len < 21);
+
/* Completion */
for (j = 0; command_complete[j].expand != 0; ++j)
if (command_complete[j].expand == cmd->uc_compl)
@@ -5569,7 +5980,7 @@ uc_list(name, name_len)
do {
IObuff[len++] = ' ';
- } while (len < 21);
+ } while (len < 35);
IObuff[len] = '\0';
msg_outtrans(IObuff);
@@ -5609,7 +6020,7 @@ uc_fun_cmd()
}
static int
-uc_scan_attr(attr, len, argt, def, flags, compl, compl_arg)
+uc_scan_attr(attr, len, argt, def, flags, compl, compl_arg, addr_type_arg)
char_u *attr;
size_t len;
long *argt;
@@ -5617,6 +6028,7 @@ uc_scan_attr(attr, len, argt, def, flags, compl, compl_arg)
int *flags;
int *compl;
char_u **compl_arg;
+ int *addr_type_arg;
{
char_u *p;
@@ -5735,6 +6147,20 @@ invalid_count:
== FAIL)
return FAIL;
}
+ else if (STRNICMP(attr, "addr", attrlen) == 0)
+ {
+ *argt |= RANGE;
+ if (val == NULL)
+ {
+ EMSG(_("E179: argument required for -addr"));
+ return FAIL;
+ }
+ if (parse_addr_type_arg(val, (int)vallen, argt, addr_type_arg)
+ == FAIL)
+ return FAIL;
+ if (addr_type_arg != ADDR_LINES)
+ *argt |= (ZEROR | NOTADR) ;
+ }
else
{
char_u ch = attr[len];
@@ -5763,6 +6189,7 @@ ex_command(eap)
int flags = 0;
int compl = EXPAND_NOTHING;
char_u *compl_arg = NULL;
+ int addr_type_arg = ADDR_LINES;
int has_attr = (eap->arg[0] == '-');
int name_len;
@@ -5773,7 +6200,7 @@ ex_command(eap)
{
++p;
end = skiptowhite(p);
- if (uc_scan_attr(p, end - p, &argt, &def, &flags, &compl, &compl_arg)
+ if (uc_scan_attr(p, end - p, &argt, &def, &flags, &compl, &compl_arg, &addr_type_arg)
== FAIL)
return;
p = skipwhite(end);
@@ -5814,7 +6241,7 @@ ex_command(eap)
}
else
uc_add_command(name, end - name, p, argt, def, flags, compl, compl_arg,
- eap->forceit);
+ addr_type_arg, eap->forceit);
}
/*
@@ -6355,6 +6782,17 @@ get_user_commands(xp, idx)
}
/*
+ * Function given to ExpandGeneric() to obtain the list of user address type names.
+ */
+ char_u *
+get_user_cmd_addr_type(xp, idx)
+ expand_T *xp UNUSED;
+ int idx;
+{
+ return (char_u *)addr_type_complete[idx].name;
+}
+
+/*
* Function given to ExpandGeneric() to obtain the list of user command
* attributes.
*/
@@ -6364,8 +6802,8 @@ get_user_cmd_flags(xp, idx)
int idx;
{
static char *user_cmd_flags[] =
- {"bang", "bar", "buffer", "complete", "count",
- "nargs", "range", "register"};
+ {"addr", "bang", "bar", "buffer", "complete",
+ "count", "nargs", "range", "register"};
if (idx >= (int)(sizeof(user_cmd_flags) / sizeof(user_cmd_flags[0])))
return NULL;
@@ -6399,6 +6837,43 @@ get_user_cmd_complete(xp, idx)
}
# endif /* FEAT_CMDL_COMPL */
+/*
+ * Parse address type argument
+ */
+ int
+parse_addr_type_arg(value, vallen, argt, addr_type_arg)
+ char_u *value;
+ int vallen;
+ long *argt;
+ int *addr_type_arg;
+{
+ int i, a, b;
+ for (i = 0; addr_type_complete[i].expand != -1; ++i)
+ {
+ a = (int)STRLEN(addr_type_complete[i].name) == vallen;
+ b = STRNCMP(value, addr_type_complete[i].name, vallen) == 0;
+ if (a && b)
+ {
+ *addr_type_arg = addr_type_complete[i].expand;
+ break;
+ }
+ }
+
+ if (addr_type_complete[i].expand == -1)
+ {
+ char_u *err = value;
+ for (i=0; err[i] == NUL || !vim_iswhite(err[i]); i++);
+ err[i] = NUL;
+ EMSG2(_("E180: Invalid address type value: %s"), err);
+ return FAIL;
+ }
+
+ if (*addr_type_arg != ADDR_LINES)
+ *argt |= NOTADR;
+
+ return OK;
+}
+
#endif /* FEAT_USR_CMDS */
#if defined(FEAT_USR_CMDS) || defined(FEAT_EVAL) || defined(PROTO)
@@ -6539,12 +7014,16 @@ not_exiting()
}
/*
- * ":quit": quit current window, quit Vim if closed the last window.
+ * ":quit": quit current window, quit Vim if the last window is closed.
*/
static void
ex_quit(eap)
exarg_T *eap;
{
+#if defined(FEAT_WINDOWS) || defined(FEAT_AUTOCMD)
+ win_T *wp;
+#endif
+
#ifdef FEAT_CMDWIN
if (cmdwin_type != 0)
{
@@ -6558,11 +7037,27 @@ ex_quit(eap)
text_locked_msg();
return;
}
+#ifdef FEAT_WINDOWS
+ if (eap->addr_count > 0)
+ {
+ int wnr = eap->line2;
+
+ for (wp = firstwin; wp->w_next != NULL; wp = wp->w_next)
+ if (--wnr <= 0)
+ break;
+ }
+ else
+#endif
+#if defined(FEAT_WINDOWS) || defined(FEAT_AUTOCMD)
+ wp = curwin;
+#endif
+
#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_closing))
+ if (curbuf_locked() || (wp->w_buffer->b_nwindows == 1
+ && wp->w_buffer->b_closing))
return;
#endif
@@ -6595,7 +7090,7 @@ ex_quit(eap)
need_mouse_correct = TRUE;
# endif
/* close window; may free buffer */
- win_close(curwin, !P_HID(curwin->w_buffer) || eap->forceit);
+ win_close(wp, !P_HID(wp->w_buffer) || eap->forceit);
#endif
}
}
@@ -6657,6 +7152,8 @@ ex_quit_all(eap)
ex_close(eap)
exarg_T *eap;
{
+ win_T *win;
+ int winnr = 0;
# ifdef FEAT_CMDWIN
if (cmdwin_type != 0)
cmdwin_result = Ctrl_C;
@@ -6667,7 +7164,21 @@ ex_close(eap)
&& !curbuf_locked()
#endif
)
- ex_win_close(eap->forceit, curwin, NULL);
+ {
+ if (eap->addr_count == 0)
+ ex_win_close(eap->forceit, curwin, NULL);
+ else {
+ for (win = firstwin; win != NULL; win = win->w_next)
+ {
+ winnr++;
+ if (winnr == eap->line2)
+ break;
+ }
+ if (win == NULL)
+ win = lastwin;
+ ex_win_close(eap->forceit, win, NULL);
+ }
+ }
}
# ifdef FEAT_QUICKFIX
@@ -6793,6 +7304,8 @@ ex_tabonly(eap)
MSG(_("Already only one tab page"));
else
{
+ if (eap->addr_count > 0)
+ goto_tabpage(eap->line2);
/* Repeat this up to a 1000 times, because autocommands may mess
* up the lists. */
for (done = 0; done < 1000; ++done)
@@ -6871,9 +7384,23 @@ tabpage_close_other(tp, forceit)
ex_only(eap)
exarg_T *eap;
{
+ win_T *wp;
+ int wnr;
# ifdef FEAT_GUI
need_mouse_correct = TRUE;
# endif
+ if (eap->addr_count > 0)
+ {
+ wnr = eap->line2;
+ for (wp = firstwin; --wnr > 0; )
+ {
+ if (wp->w_next == NULL)
+ break;
+ else
+ wp = wp->w_next;
+ }
+ win_goto(wp);
+ }
close_others(TRUE, eap->forceit);
}
@@ -6907,7 +7434,23 @@ ex_hide(eap)
# ifdef FEAT_GUI
need_mouse_correct = TRUE;
# endif
- win_close(curwin, FALSE); /* don't free buffer */
+ if (eap->addr_count == 0)
+ win_close(curwin, FALSE); /* don't free buffer */
+ else
+ {
+ int winnr = 0;
+ win_T *win;
+
+ for (win = firstwin; win != NULL; win = win->w_next)
+ {
+ winnr++;
+ if (winnr == eap->line2)
+ break;
+ }
+ if (win == NULL)
+ win = lastwin;
+ win_close(win, FALSE);
+ }
}
#endif
}
@@ -8641,7 +9184,7 @@ ex_copymove(eap)
{
long n;
- n = get_address(&eap->arg, FALSE, FALSE);
+ n = get_address(&eap->arg, eap->addr_type, FALSE, FALSE);
if (eap->arg == NULL) /* error detected */
{
eap->nextcmd = NULL;
@@ -9515,8 +10058,15 @@ ex_normal(eap)
msg_didout |= save_msg_didout; /* don't reset msg_didout now */
/* Restore the state (needed when called from a function executed for
- * 'indentexpr'). */
+ * 'indentexpr'). Update the mouse and cursor, they may have changed. */
State = save_State;
+#ifdef FEAT_MOUSE
+ setmouse();
+#endif
+#ifdef CURSOR_SHAPE
+ ui_cursor_shape(); /* may show different cursor shape */
+#endif
+
#ifdef FEAT_MBYTE
vim_free(arg);
#endif
@@ -11506,8 +12056,8 @@ ex_match(eap)
ex_X(eap)
exarg_T *eap UNUSED;
{
- if (get_crypt_method(curbuf) == 0 || blowfish_self_test() == OK)
- (void)get_crypt_key(TRUE, TRUE);
+ crypt_check_current_method();
+ (void)crypt_get_key(TRUE, TRUE);
}
#endif
@@ -11534,6 +12084,10 @@ ex_folddo(eap)
{
linenr_T lnum;
+#ifdef FEAT_CLIPBOARD
+ start_global_changes();
+#endif
+
/* First set the marks for all lines closed/open. */
for (lnum = eap->line1; lnum <= eap->line2; ++lnum)
if (hasFolding(lnum, NULL, NULL) == (eap->cmdidx == CMD_folddoclosed))
@@ -11542,5 +12096,8 @@ ex_folddo(eap)
/* Execute the command on the marked lines. */
global_exe(eap->arg);
ml_clearmarked(); /* clear rest of the marks */
+#ifdef FEAT_CLIPBOARD
+ end_global_changes();
+#endif
}
#endif
diff --git a/src/ex_getln.c b/src/ex_getln.c
index fcc1d600a..d8db15abf 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -759,11 +759,14 @@ getcmdline(firstc, count, indent)
#ifdef FEAT_CMDWIN
if (c == cedit_key || c == K_CMDWIN)
{
- /*
- * Open a window to edit the command line (and history).
- */
- c = ex_window();
- some_key_typed = TRUE;
+ if (ex_normal_busy == 0 && got_int == FALSE)
+ {
+ /*
+ * Open a window to edit the command line (and history).
+ */
+ c = ex_window();
+ some_key_typed = TRUE;
+ }
}
# ifdef FEAT_DIGRAPHS
else
@@ -4694,6 +4697,7 @@ ExpandFromContext(xp, pat, num_file, file, options)
#endif
#ifdef FEAT_USR_CMDS
{EXPAND_USER_COMMANDS, get_user_commands, FALSE, TRUE},
+ {EXPAND_USER_ADDR_TYPE, get_user_cmd_addr_type, FALSE, TRUE},
{EXPAND_USER_CMD_FLAGS, get_user_cmd_flags, FALSE, TRUE},
{EXPAND_USER_NARGS, get_user_cmd_nargs, FALSE, TRUE},
{EXPAND_USER_COMPLETE, get_user_cmd_complete, FALSE, TRUE},
@@ -6363,6 +6367,9 @@ ex_window()
#ifdef FEAT_RIGHTLEFT
int save_cmdmsg_rl = cmdmsg_rl;
#endif
+#ifdef FEAT_FOLDING
+ int save_KeyTyped;
+#endif
/* Can't do this recursively. Can't do it when typing a password. */
if (cmdwin_type != 0
@@ -6497,8 +6504,19 @@ ex_window()
RedrawingDisabled = i;
# ifdef FEAT_AUTOCMD
+
+# ifdef FEAT_FOLDING
+ save_KeyTyped = KeyTyped;
+# endif
+
/* Trigger CmdwinLeave autocommands. */
apply_autocmds(EVENT_CMDWINLEAVE, typestr, typestr, FALSE, curbuf);
+
+# ifdef FEAT_FOLDING
+ /* Restore KeyTyped in case it is modified by autocommands */
+ KeyTyped = save_KeyTyped;
+# endif
+
# endif
/* Restore the command line info. */
diff --git a/src/feature.h b/src/feature.h
index 917179401..01f611e38 100644
--- a/src/feature.h
+++ b/src/feature.h
@@ -385,13 +385,6 @@
#endif
/*
- * +python and +python3 require FEAT_EVAL.
- */
-#if !defined(FEAT_EVAL) && (defined(FEAT_PYTHON3) || defined(FEAT_PYTHON))
-# define FEAT_EVAL
-#endif
-
-/*
* +profile Profiling for functions and scripts.
*/
#if defined(FEAT_HUGE) \
diff --git a/src/fileio.c b/src/fileio.c
index 38dc2597d..0fa0fc8e0 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -24,20 +24,6 @@
#define BUFSIZE 8192 /* size of normal write buffer */
#define SMBUFSIZE 256 /* size of emergency write buffer */
-#ifdef FEAT_CRYPT
-/* crypt_magic[0] is pkzip crypt, crypt_magic[1] is sha2+blowfish */
-static char *crypt_magic[] = {"VimCrypt~01!", "VimCrypt~02!"};
-static char crypt_magic_head[] = "VimCrypt~";
-# define CRYPT_MAGIC_LEN 12 /* must be multiple of 4! */
-
-/* For blowfish, after the magic header, we store 8 bytes of salt and then 8
- * bytes of seed (initialisation vector). */
-static int crypt_salt_len[] = {0, 8};
-static int crypt_seed_len[] = {0, 8};
-#define CRYPT_SALT_LEN_MAX 8
-#define CRYPT_SEED_LEN_MAX 8
-#endif
-
/* Is there any system that doesn't have access()? */
#define USE_MCH_ACCESS
@@ -55,7 +41,6 @@ static char_u *readfile_charconvert __ARGS((char_u *fname, char_u *fenc, int *fd
static void check_marks_read __ARGS((void));
#endif
#ifdef FEAT_CRYPT
-static int crypt_method_from_magic __ARGS((char *ptr, int len));
static char_u *check_for_cryptkey __ARGS((char_u *cryptkey, char_u *ptr, long *sizep, off_t *filesizep, int newfile, char_u *fname, int *did_ask));
#endif
#ifdef UNIX
@@ -116,6 +101,9 @@ struct bw_info
#ifdef HAS_BW_FLAGS
int bw_flags; /* FIO_ flags */
#endif
+#ifdef FEAT_CRYPT
+ buf_T *bw_buffer; /* buffer being written */
+#endif
#ifdef FEAT_MBYTE
char_u bw_rest[CONV_RESTLEN]; /* not converted bytes */
int bw_restlen; /* nr of bytes in bw_rest[] */
@@ -250,7 +238,6 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
#ifdef FEAT_CRYPT
char_u *cryptkey = NULL;
int did_ask_for_key = FALSE;
- int crypt_method_used;
#endif
#ifdef FEAT_PERSISTENT_UNDO
context_sha256_T sha_ctx;
@@ -966,13 +953,6 @@ retry:
#endif
}
-#ifdef FEAT_CRYPT
- if (cryptkey != NULL)
- /* Need to reset the state, but keep the key, don't want to ask for it
- * again. */
- crypt_pop_state();
-#endif
-
/*
* When retrying with another "fenc" and the first time "fileformat"
* will be reset.
@@ -1175,6 +1155,15 @@ retry:
if (read_undo_file)
sha256_start(&sha_ctx);
#endif
+#ifdef FEAT_CRYPT
+ if (curbuf->b_cryptstate != NULL)
+ {
+ /* Need to free the state, but keep the key, don't want to ask for
+ * it again. */
+ crypt_free_state(curbuf->b_cryptstate);
+ curbuf->b_cryptstate = NULL;
+ }
+#endif
}
while (!error && !got_int)
@@ -1339,6 +1328,76 @@ retry:
size = read_eintr(fd, ptr, size);
}
+#ifdef FEAT_CRYPT
+ /*
+ * At start of file: Check for magic number of encryption.
+ */
+ if (filesize == 0 && size > 0)
+ cryptkey = check_for_cryptkey(cryptkey, ptr, &size,
+ &filesize, newfile, sfname,
+ &did_ask_for_key);
+ /*
+ * Decrypt the read bytes. This is done before checking for
+ * EOF because the crypt layer may be buffering.
+ */
+ if (cryptkey != NULL && size > 0)
+ {
+ if (crypt_works_inplace(curbuf->b_cryptstate))
+ {
+ crypt_decode_inplace(curbuf->b_cryptstate, ptr, size);
+ }
+ else
+ {
+ char_u *newptr = NULL;
+ int decrypted_size;
+
+ decrypted_size = crypt_decode_alloc(
+ curbuf->b_cryptstate, ptr, size, &newptr);
+
+ /* If the crypt layer is buffering, not producing
+ * anything yet, need to read more. */
+ if (size > 0 && decrypted_size == 0)
+ continue;
+
+ if (linerest == 0)
+ {
+ /* Simple case: reuse returned buffer (may be
+ * NULL, checked later). */
+ new_buffer = newptr;
+ }
+ else
+ {
+ long_u new_size;
+
+ /* Need new buffer to add bytes carried over. */
+ new_size = (long_u)(decrypted_size + linerest + 1);
+ new_buffer = lalloc(new_size, FALSE);
+ if (new_buffer == NULL)
+ {
+ do_outofmem_msg(new_size);
+ error = TRUE;
+ break;
+ }
+
+ mch_memmove(new_buffer, buffer, linerest);
+ if (newptr != NULL)
+ mch_memmove(new_buffer + linerest, newptr,
+ decrypted_size);
+ }
+
+ if (new_buffer != NULL)
+ {
+ vim_free(buffer);
+ buffer = new_buffer;
+ new_buffer = NULL;
+ line_start = buffer;
+ ptr = buffer + linerest;
+ }
+ size = decrypted_size;
+ }
+ }
+#endif
+
if (size <= 0)
{
if (size < 0) /* read error */
@@ -1403,21 +1462,6 @@ retry:
}
#endif
}
-
-#ifdef FEAT_CRYPT
- /*
- * At start of file: Check for magic number of encryption.
- */
- if (filesize == 0)
- cryptkey = check_for_cryptkey(cryptkey, ptr, &size,
- &filesize, newfile, sfname,
- &did_ask_for_key);
- /*
- * Decrypt the read bytes.
- */
- if (cryptkey != NULL && size > 0)
- crypt_decode(ptr, size);
-#endif
}
skip_read = FALSE;
@@ -1430,10 +1474,9 @@ retry:
*/
if ((filesize == 0
# ifdef FEAT_CRYPT
- || (filesize == (CRYPT_MAGIC_LEN
- + crypt_salt_len[use_crypt_method]
- + crypt_seed_len[use_crypt_method])
- && cryptkey != NULL)
+ || (cryptkey != NULL
+ && filesize == crypt_get_header_len(
+ crypt_get_method_nr(curbuf)))
# endif
)
&& (fio_flags == FIO_UCSBOM
@@ -2262,15 +2305,15 @@ failed:
save_file_ff(curbuf); /* remember the current file format */
#ifdef FEAT_CRYPT
- crypt_method_used = use_crypt_method;
- if (cryptkey != NULL)
+ if (curbuf->b_cryptstate != NULL)
{
- crypt_pop_state();
- if (cryptkey != curbuf->b_p_key)
- free_crypt_key(cryptkey);
- /* don't set cryptkey to NULL, it's used below as a flag that
- * encryption was used */
+ crypt_free_state(curbuf->b_cryptstate);
+ curbuf->b_cryptstate = NULL;
}
+ if (cryptkey != NULL && cryptkey != curbuf->b_p_key)
+ crypt_free_key(cryptkey);
+ /* Don't set cryptkey to NULL, it's used below as a flag that
+ * encryption was used. */
#endif
#ifdef FEAT_MBYTE
@@ -2457,10 +2500,7 @@ failed:
#ifdef FEAT_CRYPT
if (cryptkey != NULL)
{
- if (crypt_method_used == 1)
- STRCAT(IObuff, _("[blowfish]"));
- else
- STRCAT(IObuff, _("[crypted]"));
+ crypt_append_msg(curbuf);
c = TRUE;
}
#endif
@@ -2489,9 +2529,7 @@ failed:
#ifdef FEAT_CRYPT
if (cryptkey != NULL)
msg_add_lines(c, (long)linecnt, filesize
- - CRYPT_MAGIC_LEN
- - crypt_salt_len[use_crypt_method]
- - crypt_seed_len[use_crypt_method]);
+ - crypt_get_header_len(crypt_get_method_nr(curbuf)));
else
#endif
msg_add_lines(c, (long)linecnt, filesize);
@@ -2882,33 +2920,6 @@ check_marks_read()
#if defined(FEAT_CRYPT) || defined(PROTO)
/*
- * Get the crypt method used for a file from "ptr[len]", the magic text at the
- * start of the file.
- * Returns -1 when no encryption used.
- */
- static int
-crypt_method_from_magic(ptr, len)
- char *ptr;
- int len;
-{
- int i;
-
- for (i = 0; i < (int)(sizeof(crypt_magic) / sizeof(crypt_magic[0])); i++)
- {
- if (len < (CRYPT_MAGIC_LEN + crypt_salt_len[i] + crypt_seed_len[i]))
- continue;
- if (memcmp(ptr, crypt_magic[i], CRYPT_MAGIC_LEN) == 0)
- return i;
- }
-
- i = (int)STRLEN(crypt_magic_head);
- if (len >= i && memcmp(ptr, crypt_magic_head, i) == 0)
- EMSG(_("E821: File is encrypted with unknown method"));
-
- return -1;
-}
-
-/*
* Check for magic number used for encryption. Applies to the current buffer.
* If found, the magic number is removed from ptr[*sizep] and *sizep and
* *filesizep are updated.
@@ -2924,7 +2935,7 @@ check_for_cryptkey(cryptkey, ptr, sizep, filesizep, newfile, fname, did_ask)
char_u *fname; /* file name to display */
int *did_ask; /* flag: whether already asked for key */
{
- int method = crypt_method_from_magic((char *)ptr, *sizep);
+ int method = crypt_method_nr_from_magic((char *)ptr, *sizep);
int b_p_ro = curbuf->b_p_ro;
if (method >= 0)
@@ -2933,9 +2944,8 @@ check_for_cryptkey(cryptkey, ptr, sizep, filesizep, newfile, fname, did_ask)
* Avoids accidentally overwriting the file with garbage. */
curbuf->b_p_ro = TRUE;
- set_crypt_method(curbuf, method);
- if (method > 0)
- (void)blowfish_self_test();
+ /* Set the cryptmethod local to the buffer. */
+ crypt_set_cm_option(curbuf, method);
if (cryptkey == NULL && !*did_ask)
{
if (*curbuf->b_p_key)
@@ -2948,7 +2958,8 @@ check_for_cryptkey(cryptkey, ptr, sizep, filesizep, newfile, fname, did_ask)
* Happens when retrying to detect encoding. */
smsg((char_u *)_(need_key_msg), fname);
msg_scroll = TRUE;
- cryptkey = get_crypt_key(newfile, FALSE);
+ crypt_check_method(method);
+ cryptkey = crypt_get_key(newfile, FALSE);
*did_ask = TRUE;
/* check if empty key entered */
@@ -2963,24 +2974,18 @@ check_for_cryptkey(cryptkey, ptr, sizep, filesizep, newfile, fname, did_ask)
if (cryptkey != NULL)
{
- int seed_len = crypt_seed_len[method];
- int salt_len = crypt_salt_len[method];
+ int header_len;
- crypt_push_state();
- use_crypt_method = method;
- if (method == 0)
- crypt_init_keys(cryptkey);
- else
- {
- bf_key_init(cryptkey, ptr + CRYPT_MAGIC_LEN, salt_len);
- bf_cfb_init(ptr + CRYPT_MAGIC_LEN + salt_len, seed_len);
- }
+ curbuf->b_cryptstate = crypt_create_from_header(
+ method, cryptkey, ptr);
+ crypt_set_cm_option(curbuf, method);
+
+ /* Remove cryptmethod specific header from the text. */
+ header_len = crypt_get_header_len(method);
+ *filesizep += header_len;
+ *sizep -= header_len;
+ mch_memmove(ptr, ptr + header_len, (size_t)*sizep);
- /* Remove magic number from the text */
- *filesizep += CRYPT_MAGIC_LEN + salt_len + seed_len;
- *sizep -= CRYPT_MAGIC_LEN + salt_len + seed_len;
- mch_memmove(ptr, ptr + CRYPT_MAGIC_LEN + salt_len + seed_len,
- (size_t)*sizep);
/* Restore the read-only flag. */
curbuf->b_p_ro = b_p_ro;
}
@@ -2992,85 +2997,6 @@ check_for_cryptkey(cryptkey, ptr, sizep, filesizep, newfile, fname, did_ask)
return cryptkey;
}
-
-/*
- * Check for magic number used for encryption. Applies to the current buffer.
- * If found and decryption is possible returns OK;
- */
- int
-prepare_crypt_read(fp)
- FILE *fp;
-{
- int method;
- char_u buffer[CRYPT_MAGIC_LEN + CRYPT_SALT_LEN_MAX
- + CRYPT_SEED_LEN_MAX + 2];
-
- if (fread(buffer, CRYPT_MAGIC_LEN, 1, fp) != 1)
- return FAIL;
- method = crypt_method_from_magic((char *)buffer,
- CRYPT_MAGIC_LEN +
- CRYPT_SEED_LEN_MAX +
- CRYPT_SALT_LEN_MAX);
- if (method < 0 || method != get_crypt_method(curbuf))
- return FAIL;
-
- crypt_push_state();
- if (method == 0)
- crypt_init_keys(curbuf->b_p_key);
- else
- {
- int salt_len = crypt_salt_len[method];
- int seed_len = crypt_seed_len[method];
-
- if (fread(buffer, salt_len + seed_len, 1, fp) != 1)
- return FAIL;
- bf_key_init(curbuf->b_p_key, buffer, salt_len);
- bf_cfb_init(buffer + salt_len, seed_len);
- }
- return OK;
-}
-
-/*
- * Prepare for writing encrypted bytes for buffer "buf".
- * Returns a pointer to an allocated header of length "*lenp".
- * When out of memory returns NULL.
- * Otherwise calls crypt_push_state(), call crypt_pop_state() later.
- */
- char_u *
-prepare_crypt_write(buf, lenp)
- buf_T *buf;
- int *lenp;
-{
- char_u *header;
- int seed_len = crypt_seed_len[get_crypt_method(buf)];
- int salt_len = crypt_salt_len[get_crypt_method(buf)];
- char_u *salt;
- char_u *seed;
-
- header = alloc_clear(CRYPT_MAGIC_LEN + CRYPT_SALT_LEN_MAX
- + CRYPT_SEED_LEN_MAX + 2);
- if (header != NULL)
- {
- crypt_push_state();
- use_crypt_method = get_crypt_method(buf); /* select zip or blowfish */
- vim_strncpy(header, (char_u *)crypt_magic[use_crypt_method],
- CRYPT_MAGIC_LEN);
- if (use_crypt_method == 0)
- crypt_init_keys(buf->b_p_key);
- else
- {
- /* Using blowfish, add salt and seed. */
- salt = header + CRYPT_MAGIC_LEN;
- seed = salt + salt_len;
- sha2_seed(salt, salt_len, seed, seed_len);
- bf_key_init(buf->b_p_key, salt, salt_len);
- bf_cfb_init(seed, seed_len);
- }
- }
- *lenp = CRYPT_MAGIC_LEN + salt_len + seed_len;
- return header;
-}
-
#endif /* FEAT_CRYPT */
#ifdef UNIX
@@ -3224,9 +3150,7 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
int write_undo_file = FALSE;
context_sha256_T sha_ctx;
#endif
-#ifdef FEAT_CRYPT
- int crypt_method_used;
-#endif
+ unsigned int bkc = get_bkc_value(buf);
if (fname == NULL || *fname == NUL) /* safety check */
return FAIL;
@@ -3262,6 +3186,9 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
write_info.bw_iconv_fd = (iconv_t)-1;
# endif
#endif
+#ifdef FEAT_CRYPT
+ write_info.bw_buffer = buf;
+#endif
/* After writing a file changedtick changes but we don't want to display
* the line. */
@@ -3722,10 +3649,10 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
struct stat st;
#endif
- if ((bkc_flags & BKC_YES) || append) /* "yes" */
+ if ((bkc & BKC_YES) || append) /* "yes" */
backup_copy = TRUE;
#if defined(UNIX) || defined(WIN32)
- else if ((bkc_flags & BKC_AUTO)) /* "auto" */
+ else if ((bkc & BKC_AUTO)) /* "auto" */
{
int i;
@@ -3813,7 +3740,7 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
/*
* Break symlinks and/or hardlinks if we've been asked to.
*/
- if ((bkc_flags & BKC_BREAKSYMLINK) || (bkc_flags & BKC_BREAKHARDLINK))
+ if ((bkc & BKC_BREAKSYMLINK) || (bkc & BKC_BREAKHARDLINK))
{
# ifdef UNIX
int lstat_res;
@@ -3821,24 +3748,24 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
lstat_res = mch_lstat((char *)fname, &st);
/* Symlinks. */
- if ((bkc_flags & BKC_BREAKSYMLINK)
+ if ((bkc & BKC_BREAKSYMLINK)
&& lstat_res == 0
&& st.st_ino != st_old.st_ino)
backup_copy = FALSE;
/* Hardlinks. */
- if ((bkc_flags & BKC_BREAKHARDLINK)
+ if ((bkc & BKC_BREAKHARDLINK)
&& st_old.st_nlink > 1
&& (lstat_res != 0 || st.st_ino == st_old.st_ino))
backup_copy = FALSE;
# else
# if defined(WIN32)
/* Symlinks. */
- if ((bkc_flags & BKC_BREAKSYMLINK) && mch_is_symbolic_link(fname))
+ if ((bkc & BKC_BREAKSYMLINK) && mch_is_symbolic_link(fname))
backup_copy = FALSE;
/* Hardlinks. */
- if ((bkc_flags & BKC_BREAKHARDLINK) && mch_is_hard_link(fname))
+ if ((bkc & BKC_BREAKHARDLINK) && mch_is_hard_link(fname))
backup_copy = FALSE;
# endif
# endif
@@ -4505,17 +4432,17 @@ restore_backup:
#ifdef FEAT_CRYPT
if (*buf->b_p_key != NUL && !filtering)
{
- char_u *header;
- int header_len;
+ char_u *header;
+ int header_len;
- header = prepare_crypt_write(buf, &header_len);
- if (header == NULL)
+ buf->b_cryptstate = crypt_create_for_writing(crypt_get_method_nr(buf),
+ buf->b_p_key, &header, &header_len);
+ if (buf->b_cryptstate == NULL || header == NULL)
end = 0;
else
{
- /* Write magic number, so that Vim knows that this file is
- * encrypted when reading it again. This also undergoes utf-8 to
- * ucs-2/4 conversion when needed. */
+ /* Write magic number, so that Vim knows how this file is
+ * encrypted when reading it back. */
write_info.bw_buf = header;
write_info.bw_len = header_len;
write_info.bw_flags = FIO_NOCONVERT;
@@ -4769,12 +4696,13 @@ restore_backup:
mch_set_acl(wfname, acl);
#endif
#ifdef FEAT_CRYPT
- crypt_method_used = use_crypt_method;
- if (wb_flags & FIO_ENCRYPTED)
- crypt_pop_state();
+ if (buf->b_cryptstate != NULL)
+ {
+ crypt_free_state(buf->b_cryptstate);
+ buf->b_cryptstate = NULL;
+ }
#endif
-
#if defined(FEAT_MBYTE) && defined(FEAT_EVAL)
if (wfname != fname)
{
@@ -4924,10 +4852,7 @@ restore_backup:
#ifdef FEAT_CRYPT
if (wb_flags & FIO_ENCRYPTED)
{
- if (crypt_method_used == 1)
- STRCAT(IObuff, _("[blowfish]"));
- else
- STRCAT(IObuff, _("[crypted]"));
+ crypt_append_msg(buf);
c = TRUE;
}
#endif
@@ -4953,6 +4878,13 @@ restore_backup:
)
{
unchanged(buf, TRUE);
+#ifdef FEAT_AUTOCMD
+ /* buf->b_changedtick is always incremented in unchanged() but that
+ * should not trigger a TextChanged event. */
+ if (last_changedtick + 1 == buf->b_changedtick
+ && last_changedtick_buf == buf)
+ last_changedtick = buf->b_changedtick;
+#endif
u_unchanged(buf);
u_update_save_nr(buf);
}
@@ -5740,8 +5672,26 @@ buf_write_bytes(ip)
#endif /* FEAT_MBYTE */
#ifdef FEAT_CRYPT
- if (flags & FIO_ENCRYPTED) /* encrypt the data */
- crypt_encode(buf, len, buf);
+ if (flags & FIO_ENCRYPTED)
+ {
+ /* Encrypt the data. Do it in-place if possible, otherwise use an
+ * allocated buffer. */
+ if (crypt_works_inplace(ip->bw_buffer->b_cryptstate))
+ {
+ crypt_encode_inplace(ip->bw_buffer->b_cryptstate, buf, len);
+ }
+ else
+ {
+ char_u *outbuf;
+
+ len = crypt_encode_alloc(curbuf->b_cryptstate, buf, len, &outbuf);
+ if (len == 0)
+ return OK; /* Crypt layer is buffering, will flush later. */
+ wlen = write_eintr(ip->bw_fd, outbuf, len);
+ vim_free(outbuf);
+ return (wlen < len) ? FAIL : OK;
+ }
+ }
#endif
wlen = write_eintr(ip->bw_fd, buf, len);
@@ -7700,6 +7650,7 @@ static struct event_name
{"BufWriteCmd", EVENT_BUFWRITECMD},
{"CmdwinEnter", EVENT_CMDWINENTER},
{"CmdwinLeave", EVENT_CMDWINLEAVE},
+ {"CmdUndefined", EVENT_CMDUNDEFINED},
{"ColorScheme", EVENT_COLORSCHEME},
{"CompleteDone", EVENT_COMPLETEDONE},
{"CursorHold", EVENT_CURSORHOLD},
@@ -7821,6 +7772,9 @@ static int au_get_grouparg __ARGS((char_u **argp));
static int do_autocmd_event __ARGS((event_T event, char_u *pat, int nested, char_u *cmd, int forceit, int group));
static int apply_autocmds_group __ARGS((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 __ARGS((AutoPatCmd *apc, int stop_at_last));
+#if defined(FEAT_AUTOCMD) || defined(FEAT_WILDIGN)
+static int match_file_pat __ARGS((char_u *pattern, regprog_T **prog, char_u *fname, char_u *sfname, char_u *tail, int allow_dirs));
+#endif
static event_T last_event;
@@ -9067,6 +9021,9 @@ win_found:
curwin = aco->save_curwin;
curbuf = curwin->w_buffer;
+ /* In case the autocommand move the cursor to a position that that
+ * not exist in curbuf. */
+ check_cursor();
}
}
}
@@ -9218,6 +9175,24 @@ has_insertcharpre()
return (first_autopat[(int)EVENT_INSERTCHARPRE] != NULL);
}
+/*
+ * Return TRUE when there is an CmdUndefined autocommand defined.
+ */
+ int
+has_cmdundefined()
+{
+ return (first_autopat[(int)EVENT_CMDUNDEFINED] != NULL);
+}
+
+/*
+ * Return TRUE when there is an FuncUndefined autocommand defined.
+ */
+ int
+has_funcundefined()
+{
+ return (first_autopat[(int)EVENT_FUNCUNDEFINED] != NULL);
+}
+
static int
apply_autocmds_group(event, fname, fname_io, force, group, buf, eap)
event_T event;
@@ -9668,7 +9643,7 @@ auto_next_pat(apc, stop_at_last)
{
/* execution-condition */
if (ap->buflocal_nr == 0
- ? (match_file_pat(NULL, ap->reg_prog, apc->fname,
+ ? (match_file_pat(NULL, &ap->reg_prog, apc->fname,
apc->sfname, apc->tail, ap->allow_dirs))
: ap->buflocal_nr == apc->arg_bufnr)
{
@@ -9802,7 +9777,7 @@ has_autocmd(event, sfname, buf)
for (ap = first_autopat[(int)event]; ap != NULL; ap = ap->next)
if (ap->pat != NULL && ap->cmds != NULL
&& (ap->buflocal_nr == 0
- ? match_file_pat(NULL, ap->reg_prog,
+ ? match_file_pat(NULL, &ap->reg_prog,
fname, sfname, tail, ap->allow_dirs)
: buf != NULL && ap->buflocal_nr == buf->b_fnum
))
@@ -10063,10 +10038,10 @@ aucmd_restbuf(aco)
* Used for autocommands and 'wildignore'.
* Returns TRUE if there is a match, FALSE otherwise.
*/
- int
+ static int
match_file_pat(pattern, prog, fname, sfname, tail, allow_dirs)
char_u *pattern; /* pattern to match with */
- regprog_T *prog; /* pre-compiled regprog or NULL */
+ regprog_T **prog; /* pre-compiled regprog or NULL */
char_u *fname; /* full path of file name */
char_u *sfname; /* short file name or NULL */
char_u *tail; /* tail of path */
@@ -10074,57 +10049,12 @@ match_file_pat(pattern, prog, fname, sfname, tail, allow_dirs)
{
regmatch_T regmatch;
int result = FALSE;
-#ifdef FEAT_OSFILETYPE
- int no_pattern = FALSE; /* TRUE if check is filetype only */
- char_u *type_start;
- char_u c;
- int match = FALSE;
-#endif
regmatch.rm_ic = p_fic; /* ignore case if 'fileignorecase' is set */
-#ifdef FEAT_OSFILETYPE
- if (*pattern == '<')
- {
- /* There is a filetype condition specified with this pattern.
- * Check the filetype matches first. If not, don't bother with the
- * pattern (set regprog to NULL).
- * Always use magic for the regexp.
- */
-
- for (type_start = pattern + 1; (c = *pattern); pattern++)
- {
- if ((c == ';' || c == '>') && match == FALSE)
- {
- *pattern = NUL; /* Terminate the string */
- /* TODO: match with 'filetype' of buffer that "fname" comes
- * from. */
- match = mch_check_filetype(fname, type_start);
- *pattern = c; /* Restore the terminator */
- type_start = pattern + 1;
- }
- if (c == '>')
- break;
- }
-
- /* (c should never be NUL, but check anyway) */
- if (match == FALSE || c == NUL)
- regmatch.regprog = NULL; /* Doesn't match - don't check pat. */
- else if (*pattern == NUL)
- {
- regmatch.regprog = NULL; /* Vim will try to free regprog later */
- no_pattern = TRUE; /* Always matches - don't check pat. */
- }
- else
- regmatch.regprog = vim_regcomp(pattern + 1, RE_MAGIC);
- }
+ if (prog != NULL)
+ regmatch.regprog = *prog;
else
-#endif
- {
- if (prog != NULL)
- regmatch.regprog = prog;
- else
- regmatch.regprog = vim_regcomp(pattern, RE_MAGIC);
- }
+ regmatch.regprog = vim_regcomp(pattern, RE_MAGIC);
/*
* Try for a match with the pattern with:
@@ -10132,22 +10062,17 @@ match_file_pat(pattern, prog, fname, sfname, tail, allow_dirs)
* 2. the short file name, when the pattern has a '/'.
* 3. the tail of the file name, when the pattern has no '/'.
*/
- if (
-#ifdef FEAT_OSFILETYPE
- /* If the check is for a filetype only and we don't care
- * about the path then skip all the regexp stuff.
- */
- no_pattern ||
-#endif
- (regmatch.regprog != NULL
+ if (regmatch.regprog != NULL
&& ((allow_dirs
&& (vim_regexec(&regmatch, fname, (colnr_T)0)
|| (sfname != NULL
&& vim_regexec(&regmatch, sfname, (colnr_T)0))))
- || (!allow_dirs && vim_regexec(&regmatch, tail, (colnr_T)0)))))
+ || (!allow_dirs && vim_regexec(&regmatch, tail, (colnr_T)0))))
result = TRUE;
- if (prog == NULL)
+ if (prog != NULL)
+ *prog = regmatch.regprog;
+ else
vim_regfree(regmatch.regprog);
return result;
}
@@ -10199,9 +10124,6 @@ match_file_list(list, sfname, ffname)
* allow_dirs, otherwise FALSE is put there -- webb.
* Handle backslashes before special characters, like "\*" and "\ ".
*
- * If FEAT_OSFILETYPE defined then pass initial <type> through unchanged. Eg:
- * '<html>myfile' becomes '<html>^myfile$' -- leonard.
- *
* Returns NULL when out of memory.
*/
char_u *
@@ -10211,54 +10133,19 @@ file_pat_to_reg_pat(pat, pat_end, allow_dirs, no_bslash)
char *allow_dirs; /* Result passed back out in here */
int no_bslash UNUSED; /* Don't use a backward slash as pathsep */
{
- int size;
+ int size = 2; /* '^' at start, '$' at end */
char_u *endp;
char_u *reg_pat;
char_u *p;
int i;
int nested = 0;
int add_dollar = TRUE;
-#ifdef FEAT_OSFILETYPE
- int check_length = 0;
-#endif
if (allow_dirs != NULL)
*allow_dirs = FALSE;
if (pat_end == NULL)
pat_end = pat + STRLEN(pat);
-#ifdef FEAT_OSFILETYPE
- /* Find out how much of the string is the filetype check */
- if (*pat == '<')
- {
- /* Count chars until the next '>' */
- for (p = pat + 1; p < pat_end && *p != '>'; p++)
- ;
- if (p < pat_end)
- {
- /* Pattern is of the form <.*>.* */
- check_length = p - pat + 1;
- if (p + 1 >= pat_end)
- {
- /* The 'pattern' is a filetype check ONLY */
- reg_pat = (char_u *)alloc(check_length + 1);
- if (reg_pat != NULL)
- {
- mch_memmove(reg_pat, pat, (size_t)check_length);
- reg_pat[check_length] = NUL;
- }
- return reg_pat;
- }
- }
- /* else: there was no closing '>' - assume it was a normal pattern */
-
- }
- pat += check_length;
- size = 2 + check_length;
-#else
- size = 2; /* '^' at start, '$' at end */
-#endif
-
for (p = pat; p < pat_end; p++)
{
switch (*p)
@@ -10293,14 +10180,7 @@ file_pat_to_reg_pat(pat, pat_end, allow_dirs, no_bslash)
if (reg_pat == NULL)
return NULL;
-#ifdef FEAT_OSFILETYPE
- /* Copy the type check in to the start. */
- if (check_length)
- mch_memmove(reg_pat, pat - check_length, (size_t)check_length);
- i = check_length;
-#else
i = 0;
-#endif
if (pat[0] == '*')
while (pat[0] == '*' && pat < pat_end - 1)
diff --git a/src/getchar.c b/src/getchar.c
index 55fdd3112..174cfa892 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -678,6 +678,17 @@ stuffReadbuff(s)
add_buff(&readbuf1, s, -1L);
}
+/*
+ * Append string "s" to the redo stuff buffer.
+ * CSI and K_SPECIAL must already have been escaped.
+ */
+ void
+stuffRedoReadbuff(s)
+ char_u *s;
+{
+ add_buff(&readbuf2, s, -1L);
+}
+
void
stuffReadbuffLen(s, len)
char_u *s;
@@ -2134,7 +2145,7 @@ vgetorpeek(advance)
nolmaplen = 2;
else
{
- LANGMAP_ADJUST(c1, TRUE);
+ LANGMAP_ADJUST(c1, (State & INSERT) == 0);
nolmaplen = 0;
}
#endif
@@ -2731,6 +2742,11 @@ vgetorpeek(advance)
}
if (c < 0)
continue; /* end of input script reached */
+
+ /* Allow mapping for just typed characters. When we get here c
+ * is the number of extra bytes and typebuf.tb_len is 1. */
+ for (n = 1; n <= c; ++n)
+ typebuf.tb_noremap[typebuf.tb_off + n] = RM_YES;
typebuf.tb_len += c;
/* buffer full, don't map */
@@ -3691,6 +3707,9 @@ do_map(maptype, arg, mode, abbrev)
{
if (!did_it)
retval = 2; /* no match */
+ else if (*keys == Ctrl_C)
+ /* If CTRL-C has been unmapped, reuse it for Interrupting. */
+ mapped_ctrl_c = FALSE;
goto theend;
}
@@ -3723,7 +3742,7 @@ do_map(maptype, arg, mode, abbrev)
goto theend;
}
- /* If CTRL-C has been mapped, don't always use it for Interrupting */
+ /* If CTRL-C has been mapped, don't always use it for Interrupting. */
if (*keys == Ctrl_C)
mapped_ctrl_c = TRUE;
@@ -4507,10 +4526,28 @@ check_abbr(c, ptr, col, mincol)
#endif
(mp = mp->m_next))
{
+ int qlen = mp->m_keylen;
+ char_u *q = mp->m_keys;
+ int match;
+
+ if (vim_strbyte(mp->m_keys, K_SPECIAL) != NULL)
+ {
+ /* might have CSI escaped mp->m_keys */
+ q = vim_strsave(mp->m_keys);
+ if (q != NULL)
+ {
+ vim_unescape_csi(q);
+ qlen = (int)STRLEN(q);
+ }
+ }
+
/* find entries with right mode and keys */
- if ( (mp->m_mode & State)
- && mp->m_keylen == len
- && !STRNCMP(mp->m_keys, ptr, (size_t)len))
+ match = (mp->m_mode & State)
+ && qlen == len
+ && !STRNCMP(q, ptr, (size_t)len);
+ if (q != mp->m_keys)
+ vim_free(q);
+ if (match)
break;
}
if (mp != NULL)
diff --git a/src/globals.h b/src/globals.h
index b3310b368..d1fdc33ac 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -105,10 +105,6 @@ EXTERN int exec_from_reg INIT(= FALSE); /* executing register */
EXTERN int screen_cleared INIT(= FALSE); /* screen has been cleared */
-#ifdef FEAT_CRYPT
-EXTERN int use_crypt_method INIT(= 0);
-#endif
-
/*
* When '$' is included in 'cpoptions' option set:
* When a change command is given that deletes only part of a line, a dollar
@@ -533,6 +529,8 @@ EXTERN int clip_autoselect_plus INIT(= FALSE);
EXTERN int clip_autoselectml INIT(= FALSE);
EXTERN int clip_html INIT(= FALSE);
EXTERN regprog_T *clip_exclude_prog INIT(= NULL);
+EXTERN int clip_did_set_selection INIT(= TRUE);
+EXTERN int clip_unnamed_saved INIT(= 0);
#endif
/*
@@ -1336,9 +1334,6 @@ EXTERN HWND clientWindow INIT(= 0);
#if defined(UNIX) || defined(VMS)
EXTERN int term_is_xterm INIT(= FALSE); /* xterm-like 'term' */
#endif
-#if defined(UNIX)
-EXTERN int xterm_conflict_mouse INIT(= FALSE);
-#endif
#ifdef BACKSLASH_IN_FILENAME
EXTERN char psepc INIT(= '\\'); /* normal path separator character */
diff --git a/src/gui.h b/src/gui.h
index 89476c934..b2fdc6d8f 100644
--- a/src/gui.h
+++ b/src/gui.h
@@ -41,7 +41,7 @@
# include <Events.h>
# include <Menus.h>
# if !(defined (TARGET_API_MAC_CARBON) && (TARGET_API_MAC_CARBON))
-# include <Windows.h>
+# include <Windows.h>
# endif
# include <Controls.h>
/*# include <TextEdit.h>*/
diff --git a/src/gui_beval.c b/src/gui_beval.c
index ae7845660..b3e51fb84 100644
--- a/src/gui_beval.c
+++ b/src/gui_beval.c
@@ -30,6 +30,7 @@ general_beval_cb(beval, state)
long winnr = 0;
char_u *bexpr;
buf_T *save_curbuf;
+ size_t len;
# ifdef FEAT_WINDOWS
win_T *cw;
# endif
@@ -83,6 +84,16 @@ general_beval_cb(beval, state)
vim_free(result);
result = eval_to_string(bexpr, NULL, TRUE);
+ /* Remove one trailing newline, it is added when the result was a
+ * list and it's hardly every useful. If the user really wants a
+ * trailing newline he can add two and one remains. */
+ if (result != NULL)
+ {
+ len = STRLEN(result);
+ if (len > 0 && result[len - 1] == NL)
+ result[len - 1] = NUL;
+ }
+
if (use_sandbox)
--sandbox;
--textlock;
diff --git a/src/gui_dwrite.cpp b/src/gui_dwrite.cpp
new file mode 100644
index 000000000..d4c43a37d
--- /dev/null
+++ b/src/gui_dwrite.cpp
@@ -0,0 +1,901 @@
+/* vi:set ts=8 sts=4 sw=4 noet: */
+/*
+ * Author: MURAOKA Taro <koron.kaoriya@gmail.com>
+ *
+ * Contributors:
+ * - Ken Takata
+ *
+ * Copyright (C) 2013 MURAOKA Taro <koron.kaoriya@gmail.com>
+ * THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE.
+ */
+
+#define WIN32_LEAN_AND_MEAN
+
+#ifndef DYNAMIC_DIRECTX
+# if WINVER < 0x0600
+# error WINVER must be 0x0600 or above to use DirectWrite(DirectX)
+# endif
+#endif
+
+#include <windows.h>
+#include <crtdbg.h>
+#include <assert.h>
+#include <math.h>
+#include <d2d1.h>
+#include <d2d1helper.h>
+#include <dwrite.h>
+
+#include "gui_dwrite.h"
+
+#ifdef __MINGW32__
+# define __maybenull SAL__maybenull
+# define __in SAL__in
+# define __out SAL__out
+#endif
+
+#ifdef DYNAMIC_DIRECTX
+extern "C" HINSTANCE vimLoadLib(char *name);
+
+typedef int (WINAPI *PGETUSERDEFAULTLOCALENAME)(LPWSTR, int);
+typedef HRESULT (WINAPI *PD2D1CREATEFACTORY)(D2D1_FACTORY_TYPE,
+ REFIID, const D2D1_FACTORY_OPTIONS *, void **);
+typedef HRESULT (WINAPI *PDWRITECREATEFACTORY)(DWRITE_FACTORY_TYPE,
+ REFIID, IUnknown **);
+
+static HINSTANCE hD2D1DLL = NULL;
+static HINSTANCE hDWriteDLL = NULL;
+
+static PGETUSERDEFAULTLOCALENAME pGetUserDefaultLocaleName = NULL;
+static PD2D1CREATEFACTORY pD2D1CreateFactory = NULL;
+static PDWRITECREATEFACTORY pDWriteCreateFactory = NULL;
+
+#define GetUserDefaultLocaleName (*pGetUserDefaultLocaleName)
+#define D2D1CreateFactory (*pD2D1CreateFactory)
+#define DWriteCreateFactory (*pDWriteCreateFactory)
+
+ static void
+unload(HINSTANCE &hinst)
+{
+ if (hinst != NULL)
+ {
+ FreeLibrary(hinst);
+ hinst = NULL;
+ }
+}
+#endif // DYNAMIC_DIRECTX
+
+template <class T> inline void SafeRelease(T **ppT)
+{
+ if (*ppT)
+ {
+ (*ppT)->Release();
+ *ppT = NULL;
+ }
+}
+
+struct GdiTextRendererContext
+{
+ // const fields.
+ COLORREF color;
+ FLOAT cellWidth;
+
+ // working fields.
+ FLOAT offsetX;
+};
+
+ static DWRITE_PIXEL_GEOMETRY
+ToPixelGeometry(int value)
+{
+ switch (value)
+ {
+ default:
+ case 0:
+ return DWRITE_PIXEL_GEOMETRY_FLAT;
+ case 1:
+ return DWRITE_PIXEL_GEOMETRY_RGB;
+ case 2:
+ return DWRITE_PIXEL_GEOMETRY_BGR;
+ }
+}
+
+ static int
+ToInt(DWRITE_PIXEL_GEOMETRY value)
+{
+ switch (value)
+ {
+ case DWRITE_PIXEL_GEOMETRY_FLAT:
+ return 0;
+ case DWRITE_PIXEL_GEOMETRY_RGB:
+ return 1;
+ case DWRITE_PIXEL_GEOMETRY_BGR:
+ return 2;
+ default:
+ return -1;
+ }
+}
+
+ static DWRITE_RENDERING_MODE
+ToRenderingMode(int value)
+{
+ switch (value)
+ {
+ default:
+ case 0:
+ return DWRITE_RENDERING_MODE_DEFAULT;
+ case 1:
+ return DWRITE_RENDERING_MODE_ALIASED;
+ case 2:
+ return DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC;
+ case 3:
+ return DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL;
+ case 4:
+ return DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL;
+ case 5:
+ return DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC;
+ case 6:
+ return DWRITE_RENDERING_MODE_OUTLINE;
+ }
+}
+
+ static D2D1_TEXT_ANTIALIAS_MODE
+ToTextAntialiasMode(int value)
+{
+ switch (value)
+ {
+ default:
+ case 0:
+ return D2D1_TEXT_ANTIALIAS_MODE_DEFAULT;
+ case 1:
+ return D2D1_TEXT_ANTIALIAS_MODE_CLEARTYPE;
+ case 2:
+ return D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE;
+ case 3:
+ return D2D1_TEXT_ANTIALIAS_MODE_ALIASED;
+ }
+}
+
+ static int
+ToInt(DWRITE_RENDERING_MODE value)
+{
+ switch (value)
+ {
+ case DWRITE_RENDERING_MODE_DEFAULT:
+ return 0;
+ case DWRITE_RENDERING_MODE_ALIASED:
+ return 1;
+ case DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC:
+ return 2;
+ case DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL:
+ return 3;
+ case DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL:
+ return 4;
+ case DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC:
+ return 5;
+ case DWRITE_RENDERING_MODE_OUTLINE:
+ return 6;
+ default:
+ return -1;
+ }
+}
+
+class AdjustedGlyphRun : public DWRITE_GLYPH_RUN
+{
+private:
+ FLOAT mDelta;
+ FLOAT *mAdjustedAdvances;
+
+public:
+ AdjustedGlyphRun(
+ const DWRITE_GLYPH_RUN *glyphRun,
+ FLOAT cellWidth) :
+ DWRITE_GLYPH_RUN(*glyphRun),
+ mDelta(0.0f),
+ mAdjustedAdvances(new FLOAT[glyphRun->glyphCount])
+ {
+ assert(cellWidth != 0.0f);
+ for (UINT32 i = 0; i < glyphRun->glyphCount; ++i)
+ {
+ FLOAT orig = glyphRun->glyphAdvances[i];
+ FLOAT adjusted = adjustToCell(orig, cellWidth);
+ mAdjustedAdvances[i] = adjusted;
+ mDelta += adjusted - orig;
+ }
+ glyphAdvances = mAdjustedAdvances;
+ }
+
+ ~AdjustedGlyphRun(void)
+ {
+ delete[] mAdjustedAdvances;
+ }
+
+ FLOAT getDelta(void) const
+ {
+ return mDelta;
+ }
+
+ static FLOAT adjustToCell(FLOAT value, FLOAT cellWidth)
+ {
+ int cellCount = (int)floor(value / cellWidth + 0.5f);
+ if (cellCount < 1)
+ cellCount = 1;
+ return cellCount * cellWidth;
+ }
+};
+
+class GdiTextRenderer : public IDWriteTextRenderer
+{
+public:
+ GdiTextRenderer(
+ IDWriteBitmapRenderTarget* bitmapRenderTarget,
+ IDWriteRenderingParams* renderingParams) :
+ cRefCount_(0),
+ pRenderTarget_(bitmapRenderTarget),
+ pRenderingParams_(renderingParams)
+ {
+ pRenderTarget_->AddRef();
+ pRenderingParams_->AddRef();
+ AddRef();
+ }
+
+ ~GdiTextRenderer()
+ {
+ SafeRelease(&pRenderTarget_);
+ SafeRelease(&pRenderingParams_);
+ }
+
+ IFACEMETHOD(IsPixelSnappingDisabled)(
+ __maybenull void* clientDrawingContext,
+ __out BOOL* isDisabled)
+ {
+ *isDisabled = FALSE;
+ return S_OK;
+ }
+
+ IFACEMETHOD(GetCurrentTransform)(
+ __maybenull void* clientDrawingContext,
+ __out DWRITE_MATRIX* transform)
+ {
+ //forward the render target's transform
+ pRenderTarget_->GetCurrentTransform(transform);
+ return S_OK;
+ }
+
+ IFACEMETHOD(GetPixelsPerDip)(
+ __maybenull void* clientDrawingContext,
+ __out FLOAT* pixelsPerDip)
+ {
+ *pixelsPerDip = pRenderTarget_->GetPixelsPerDip();
+ return S_OK;
+ }
+
+ IFACEMETHOD(DrawGlyphRun)(
+ __maybenull void* clientDrawingContext,
+ FLOAT baselineOriginX,
+ FLOAT baselineOriginY,
+ DWRITE_MEASURING_MODE measuringMode,
+ __in DWRITE_GLYPH_RUN const* glyphRun,
+ __in DWRITE_GLYPH_RUN_DESCRIPTION const* glyphRunDescription,
+ IUnknown* clientDrawingEffect)
+ {
+ HRESULT hr = S_OK;
+
+ GdiTextRendererContext *context =
+ reinterpret_cast<GdiTextRendererContext*>(clientDrawingContext);
+
+ AdjustedGlyphRun adjustedGlyphRun(glyphRun, context->cellWidth);
+
+ // Pass on the drawing call to the render target to do the real work.
+ RECT dirtyRect = {0};
+
+ hr = pRenderTarget_->DrawGlyphRun(
+ baselineOriginX + context->offsetX,
+ baselineOriginY,
+ measuringMode,
+ &adjustedGlyphRun,
+ pRenderingParams_,
+ context->color,
+ &dirtyRect);
+
+ context->offsetX += adjustedGlyphRun.getDelta();
+
+ return hr;
+ }
+
+ IFACEMETHOD(DrawUnderline)(
+ __maybenull void* clientDrawingContext,
+ FLOAT baselineOriginX,
+ FLOAT baselineOriginY,
+ __in DWRITE_UNDERLINE const* underline,
+ IUnknown* clientDrawingEffect)
+ {
+ return E_NOTIMPL;
+ }
+
+ IFACEMETHOD(DrawStrikethrough)(
+ __maybenull void* clientDrawingContext,
+ FLOAT baselineOriginX,
+ FLOAT baselineOriginY,
+ __in DWRITE_STRIKETHROUGH const* strikethrough,
+ IUnknown* clientDrawingEffect)
+ {
+ return E_NOTIMPL;
+ }
+
+ IFACEMETHOD(DrawInlineObject)(
+ __maybenull void* clientDrawingContext,
+ FLOAT originX,
+ FLOAT originY,
+ IDWriteInlineObject* inlineObject,
+ BOOL isSideways,
+ BOOL isRightToLeft,
+ IUnknown* clientDrawingEffect)
+ {
+ return E_NOTIMPL;
+ }
+
+public:
+ IFACEMETHOD_(unsigned long, AddRef) ()
+ {
+ return InterlockedIncrement(&cRefCount_);
+ }
+
+ IFACEMETHOD_(unsigned long, Release) ()
+ {
+ long newCount = InterlockedDecrement(&cRefCount_);
+
+ if (newCount == 0)
+ {
+ delete this;
+ return 0;
+ }
+ return newCount;
+ }
+
+ IFACEMETHOD(QueryInterface)(
+ IID const& riid,
+ void** ppvObject)
+ {
+ if (__uuidof(IDWriteTextRenderer) == riid)
+ {
+ *ppvObject = this;
+ }
+ else if (__uuidof(IDWritePixelSnapping) == riid)
+ {
+ *ppvObject = this;
+ }
+ else if (__uuidof(IUnknown) == riid)
+ {
+ *ppvObject = this;
+ }
+ else
+ {
+ *ppvObject = NULL;
+ return E_FAIL;
+ }
+
+ return S_OK;
+ }
+
+private:
+ long cRefCount_;
+ IDWriteBitmapRenderTarget* pRenderTarget_;
+ IDWriteRenderingParams* pRenderingParams_;
+};
+
+struct DWriteContext {
+ FLOAT mDpiScaleX;
+ FLOAT mDpiScaleY;
+ bool mDrawing;
+
+ ID2D1Factory *mD2D1Factory;
+
+ ID2D1DCRenderTarget *mRT;
+ ID2D1SolidColorBrush *mBrush;
+
+ IDWriteFactory *mDWriteFactory;
+ IDWriteGdiInterop *mGdiInterop;
+ IDWriteRenderingParams *mRenderingParams;
+ IDWriteTextFormat *mTextFormat;
+
+ HFONT mLastHFont;
+ DWRITE_FONT_WEIGHT mFontWeight;
+ DWRITE_FONT_STYLE mFontStyle;
+
+ D2D1_TEXT_ANTIALIAS_MODE mTextAntialiasMode;
+
+ // METHODS
+
+ DWriteContext();
+
+ virtual ~DWriteContext();
+
+ HRESULT SetLOGFONT(const LOGFONTW &logFont, float fontSize);
+
+ void SetFont(HFONT hFont);
+
+ void SetFont(const LOGFONTW &logFont);
+
+ void DrawText(HDC hdc, const WCHAR* text, int len,
+ int x, int y, int w, int h, int cellWidth, COLORREF color);
+
+ float PixelsToDipsX(int x);
+
+ float PixelsToDipsY(int y);
+
+ void SetRenderingParams(
+ const DWriteRenderingParams *params);
+
+ DWriteRenderingParams *GetRenderingParams(
+ DWriteRenderingParams *params);
+};
+
+DWriteContext::DWriteContext() :
+ mDpiScaleX(1.f),
+ mDpiScaleY(1.f),
+ mDrawing(false),
+ mD2D1Factory(NULL),
+ mRT(NULL),
+ mBrush(NULL),
+ mDWriteFactory(NULL),
+ mGdiInterop(NULL),
+ mRenderingParams(NULL),
+ mTextFormat(NULL),
+ mLastHFont(NULL),
+ mFontWeight(DWRITE_FONT_WEIGHT_NORMAL),
+ mFontStyle(DWRITE_FONT_STYLE_NORMAL),
+ mTextAntialiasMode(D2D1_TEXT_ANTIALIAS_MODE_DEFAULT)
+{
+ HRESULT hr;
+
+ HDC screen = ::GetDC(0);
+ mDpiScaleX = ::GetDeviceCaps(screen, LOGPIXELSX) / 96.0f;
+ mDpiScaleY = ::GetDeviceCaps(screen, LOGPIXELSY) / 96.0f;
+ ::ReleaseDC(0, screen);
+
+ hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED,
+ __uuidof(ID2D1Factory), NULL,
+ reinterpret_cast<void**>(&mD2D1Factory));
+ _RPT2(_CRT_WARN, "D2D1CreateFactory: hr=%p p=%p\n", hr, mD2D1Factory);
+
+ if (SUCCEEDED(hr))
+ {
+ D2D1_RENDER_TARGET_PROPERTIES props = {
+ D2D1_RENDER_TARGET_TYPE_DEFAULT,
+ { DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_IGNORE },
+ 0, 0,
+ D2D1_RENDER_TARGET_USAGE_NONE,
+ D2D1_FEATURE_LEVEL_DEFAULT
+ };
+ hr = mD2D1Factory->CreateDCRenderTarget(&props, &mRT);
+ _RPT2(_CRT_WARN, "CreateDCRenderTarget: hr=%p p=%p\n", hr, mRT);
+ }
+
+ if (SUCCEEDED(hr))
+ {
+ hr = mRT->CreateSolidColorBrush(
+ D2D1::ColorF(D2D1::ColorF::Black),
+ &mBrush);
+ _RPT2(_CRT_WARN, "CreateSolidColorBrush: hr=%p p=%p\n", hr, mBrush);
+ }
+
+ if (SUCCEEDED(hr))
+ {
+ hr = DWriteCreateFactory(
+ DWRITE_FACTORY_TYPE_SHARED,
+ __uuidof(IDWriteFactory),
+ reinterpret_cast<IUnknown**>(&mDWriteFactory));
+ _RPT2(_CRT_WARN, "DWriteCreateFactory: hr=%p p=%p\n", hr,
+ mDWriteFactory);
+ }
+
+ if (SUCCEEDED(hr))
+ {
+ hr = mDWriteFactory->GetGdiInterop(&mGdiInterop);
+ _RPT2(_CRT_WARN, "GetGdiInterop: hr=%p p=%p\n", hr, mGdiInterop);
+ }
+
+ if (SUCCEEDED(hr))
+ {
+ hr = mDWriteFactory->CreateRenderingParams(&mRenderingParams);
+ _RPT2(_CRT_WARN, "CreateRenderingParams: hr=%p p=%p\n", hr,
+ mRenderingParams);
+ }
+}
+
+DWriteContext::~DWriteContext()
+{
+ SafeRelease(&mTextFormat);
+ SafeRelease(&mRenderingParams);
+ SafeRelease(&mGdiInterop);
+ SafeRelease(&mDWriteFactory);
+ SafeRelease(&mBrush);
+ SafeRelease(&mRT);
+ SafeRelease(&mD2D1Factory);
+}
+
+ HRESULT
+DWriteContext::SetLOGFONT(const LOGFONTW &logFont, float fontSize)
+{
+ // Most of this function is copy from: http://msdn.microsoft.com/en-us/library/windows/desktop/dd941783(v=vs.85).aspx
+ HRESULT hr = S_OK;
+
+ IDWriteFont *font = NULL;
+ IDWriteFontFamily *fontFamily = NULL;
+ IDWriteLocalizedStrings *localizedFamilyNames = NULL;
+
+ if (SUCCEEDED(hr))
+ {
+ hr = mGdiInterop->CreateFontFromLOGFONT(&logFont, &font);
+ }
+
+ // Get the font family to which this font belongs.
+ if (SUCCEEDED(hr))
+ {
+ hr = font->GetFontFamily(&fontFamily);
+ }
+
+ // Get the family names. This returns an object that encapsulates one or
+ // more names with the same meaning but in different languages.
+ if (SUCCEEDED(hr))
+ {
+ hr = fontFamily->GetFamilyNames(&localizedFamilyNames);
+ }
+
+ // Get the family name at index zero. If we were going to display the name
+ // we'd want to try to find one that matched the use locale, but for
+ // purposes of creating a text format object any language will do.
+
+ wchar_t familyName[100];
+ if (SUCCEEDED(hr))
+ {
+ hr = localizedFamilyNames->GetString(0, familyName,
+ ARRAYSIZE(familyName));
+ }
+
+ if (SUCCEEDED(hr))
+ {
+ // If no font size was passed in use the lfHeight of the LOGFONT.
+ if (fontSize == 0)
+ {
+ // Convert from pixels to DIPs.
+ fontSize = PixelsToDipsY(logFont.lfHeight);
+ if (fontSize < 0)
+ {
+ // Negative lfHeight represents the size of the em unit.
+ fontSize = -fontSize;
+ }
+ else
+ {
+ // Positive lfHeight represents the cell height (ascent +
+ // descent).
+ DWRITE_FONT_METRICS fontMetrics;
+ font->GetMetrics(&fontMetrics);
+
+ // Convert the cell height (ascent + descent) from design units
+ // to ems.
+ float cellHeight = static_cast<float>(
+ fontMetrics.ascent + fontMetrics.descent)
+ / fontMetrics.designUnitsPerEm;
+
+ // Divide the font size by the cell height to get the font em
+ // size.
+ fontSize /= cellHeight;
+ }
+ }
+ }
+
+ // The text format includes a locale name. Ideally, this would be the
+ // language of the text, which may or may not be the same as the primary
+ // language of the user. However, for our purposes the user locale will do.
+ wchar_t localeName[LOCALE_NAME_MAX_LENGTH];
+ if (SUCCEEDED(hr))
+ {
+ if (GetUserDefaultLocaleName(localeName, LOCALE_NAME_MAX_LENGTH) == 0)
+ hr = HRESULT_FROM_WIN32(GetLastError());
+ }
+
+ if (SUCCEEDED(hr))
+ {
+ // Create the text format object.
+ hr = mDWriteFactory->CreateTextFormat(
+ familyName,
+ NULL, // no custom font collection
+ font->GetWeight(),
+ font->GetStyle(),
+ font->GetStretch(),
+ fontSize,
+ localeName,
+ &mTextFormat);
+ }
+
+ if (SUCCEEDED(hr))
+ {
+ mFontWeight = static_cast<DWRITE_FONT_WEIGHT>(logFont.lfWeight);
+ mFontStyle = logFont.lfItalic ? DWRITE_FONT_STYLE_ITALIC
+ : DWRITE_FONT_STYLE_NORMAL;
+ }
+
+ SafeRelease(&localizedFamilyNames);
+ SafeRelease(&fontFamily);
+ SafeRelease(&font);
+
+ return hr;
+}
+
+ void
+DWriteContext::SetFont(HFONT hFont)
+{
+ if (mLastHFont != hFont)
+ {
+ LOGFONTW lf;
+ if (GetObjectW(hFont, sizeof(lf), &lf))
+ {
+ SetFont(lf);
+ mLastHFont = hFont;
+ }
+ }
+}
+
+ void
+DWriteContext::SetFont(const LOGFONTW &logFont)
+{
+ SafeRelease(&mTextFormat);
+ mLastHFont = NULL;
+
+ HRESULT hr = SetLOGFONT(logFont, 0.f);
+
+ if (SUCCEEDED(hr))
+ hr = mTextFormat->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING);
+
+ if (SUCCEEDED(hr))
+ hr = mTextFormat->SetParagraphAlignment(
+ DWRITE_PARAGRAPH_ALIGNMENT_CENTER);
+
+ if (SUCCEEDED(hr))
+ hr = mTextFormat->SetWordWrapping(DWRITE_WORD_WRAPPING_NO_WRAP);
+}
+
+ void
+DWriteContext::DrawText(HDC hdc, const WCHAR* text, int len,
+ int x, int y, int w, int h, int cellWidth, COLORREF color)
+{
+ HRESULT hr = S_OK;
+ IDWriteBitmapRenderTarget *bmpRT = NULL;
+
+ // Skip when any fonts are not set.
+ if (mTextFormat == NULL)
+ return;
+
+ // Check possibility of zero divided error.
+ if (cellWidth == 0 || mDpiScaleX == 0.0f || mDpiScaleY == 0.0f)
+ return;
+
+ if (SUCCEEDED(hr))
+ hr = mGdiInterop->CreateBitmapRenderTarget(hdc, w, h, &bmpRT);
+
+ if (SUCCEEDED(hr))
+ {
+ IDWriteTextLayout *textLayout = NULL;
+
+ HDC memdc = bmpRT->GetMemoryDC();
+ BitBlt(memdc, 0, 0, w, h, hdc, x, y, SRCCOPY);
+
+ hr = mDWriteFactory->CreateGdiCompatibleTextLayout(
+ text, len, mTextFormat, PixelsToDipsX(w),
+ PixelsToDipsY(h), mDpiScaleX, NULL, TRUE, &textLayout);
+
+ if (SUCCEEDED(hr))
+ {
+ DWRITE_TEXT_RANGE textRange = { 0, len };
+ textLayout->SetFontWeight(mFontWeight, textRange);
+ textLayout->SetFontStyle(mFontStyle, textRange);
+ }
+
+ if (SUCCEEDED(hr))
+ {
+ GdiTextRenderer *renderer = new GdiTextRenderer(bmpRT,
+ mRenderingParams);
+ GdiTextRendererContext data = {
+ color,
+ PixelsToDipsX(cellWidth),
+ 0.0f
+ };
+ textLayout->Draw(&data, renderer, 0, 0);
+ SafeRelease(&renderer);
+ }
+
+ BitBlt(hdc, x, y, w, h, memdc, 0, 0, SRCCOPY);
+
+ SafeRelease(&textLayout);
+ }
+
+ SafeRelease(&bmpRT);
+}
+
+ float
+DWriteContext::PixelsToDipsX(int x)
+{
+ return x / mDpiScaleX;
+}
+
+ float
+DWriteContext::PixelsToDipsY(int y)
+{
+ return y / mDpiScaleY;
+}
+
+ void
+DWriteContext::SetRenderingParams(
+ const DWriteRenderingParams *params)
+{
+ if (mDWriteFactory == NULL)
+ return;
+
+ IDWriteRenderingParams *renderingParams = NULL;
+ D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode =
+ D2D1_TEXT_ANTIALIAS_MODE_DEFAULT;
+ HRESULT hr;
+ if (params != NULL)
+ {
+ hr = mDWriteFactory->CreateCustomRenderingParams(params->gamma,
+ params->enhancedContrast, params->clearTypeLevel,
+ ToPixelGeometry(params->pixelGeometry),
+ ToRenderingMode(params->renderingMode), &renderingParams);
+ textAntialiasMode = ToTextAntialiasMode(params->textAntialiasMode);
+ }
+ else
+ hr = mDWriteFactory->CreateRenderingParams(&renderingParams);
+ if (SUCCEEDED(hr) && renderingParams != NULL)
+ {
+ SafeRelease(&mRenderingParams);
+ mRenderingParams = renderingParams;
+ mTextAntialiasMode = textAntialiasMode;
+ }
+}
+
+ DWriteRenderingParams *
+DWriteContext::GetRenderingParams(
+ DWriteRenderingParams *params)
+{
+ if (params != NULL && mRenderingParams != NULL)
+ {
+ params->gamma = mRenderingParams->GetGamma();
+ params->enhancedContrast = mRenderingParams->GetEnhancedContrast();
+ params->clearTypeLevel = mRenderingParams->GetClearTypeLevel();
+ params->pixelGeometry = ToInt(mRenderingParams->GetPixelGeometry());
+ params->renderingMode = ToInt(mRenderingParams->GetRenderingMode());
+ params->textAntialiasMode = mTextAntialiasMode;
+ }
+ return params;
+}
+
+////////////////////////////////////////////////////////////////////////////
+// PUBLIC C INTERFACES
+
+ void
+DWrite_Init(void)
+{
+#ifdef DYNAMIC_DIRECTX
+ // Load libraries.
+ hD2D1DLL = vimLoadLib(const_cast<char*>("d2d1.dll"));
+ hDWriteDLL = vimLoadLib(const_cast<char*>("dwrite.dll"));
+ if (hD2D1DLL == NULL || hDWriteDLL == NULL)
+ {
+ DWrite_Final();
+ return;
+ }
+ // Get address of procedures.
+ pGetUserDefaultLocaleName = (PGETUSERDEFAULTLOCALENAME)GetProcAddress(
+ GetModuleHandle("kernel32.dll"), "GetUserDefaultLocaleName");
+ pD2D1CreateFactory = (PD2D1CREATEFACTORY)GetProcAddress(hD2D1DLL,
+ "D2D1CreateFactory");
+ pDWriteCreateFactory = (PDWRITECREATEFACTORY)GetProcAddress(hDWriteDLL,
+ "DWriteCreateFactory");
+#endif
+}
+
+ void
+DWrite_Final(void)
+{
+#ifdef DYNAMIC_DIRECTX
+ pGetUserDefaultLocaleName = NULL;
+ pD2D1CreateFactory = NULL;
+ pDWriteCreateFactory = NULL;
+ unload(hDWriteDLL);
+ unload(hD2D1DLL);
+#endif
+}
+
+ DWriteContext *
+DWriteContext_Open(void)
+{
+#ifdef DYNAMIC_DIRECTX
+ if (pGetUserDefaultLocaleName == NULL || pD2D1CreateFactory == NULL
+ || pDWriteCreateFactory == NULL)
+ return NULL;
+#endif
+ return new DWriteContext();
+}
+
+ void
+DWriteContext_BeginDraw(DWriteContext *ctx)
+{
+ if (ctx != NULL && ctx->mRT != NULL)
+ {
+ ctx->mRT->BeginDraw();
+ ctx->mRT->SetTransform(D2D1::IdentityMatrix());
+ ctx->mDrawing = true;
+ }
+}
+
+ void
+DWriteContext_BindDC(DWriteContext *ctx, HDC hdc, RECT *rect)
+{
+ if (ctx != NULL && ctx->mRT != NULL)
+ {
+ ctx->mRT->BindDC(hdc, rect);
+ ctx->mRT->SetTextAntialiasMode(ctx->mTextAntialiasMode);
+ }
+}
+
+ void
+DWriteContext_SetFont(DWriteContext *ctx, HFONT hFont)
+{
+ if (ctx != NULL)
+ {
+ ctx->SetFont(hFont);
+ }
+}
+
+ void
+DWriteContext_DrawText(
+ DWriteContext *ctx,
+ HDC hdc,
+ const WCHAR* text,
+ int len,
+ int x,
+ int y,
+ int w,
+ int h,
+ int cellWidth,
+ COLORREF color)
+{
+ if (ctx != NULL)
+ ctx->DrawText(hdc, text, len, x, y, w, h, cellWidth, color);
+}
+
+ void
+DWriteContext_EndDraw(DWriteContext *ctx)
+{
+ if (ctx != NULL && ctx->mRT != NULL)
+ {
+ ctx->mRT->EndDraw();
+ ctx->mDrawing = false;
+ }
+}
+
+ void
+DWriteContext_Close(DWriteContext *ctx)
+{
+ delete ctx;
+}
+
+ void
+DWriteContext_SetRenderingParams(
+ DWriteContext *ctx,
+ const DWriteRenderingParams *params)
+{
+ if (ctx != NULL)
+ ctx->SetRenderingParams(params);
+}
+
+ DWriteRenderingParams *
+DWriteContext_GetRenderingParams(
+ DWriteContext *ctx,
+ DWriteRenderingParams *params)
+{
+ if (ctx != NULL)
+ return ctx->GetRenderingParams(params);
+ else
+ return NULL;
+}
diff --git a/src/gui_dwrite.h b/src/gui_dwrite.h
new file mode 100644
index 000000000..647f479a6
--- /dev/null
+++ b/src/gui_dwrite.h
@@ -0,0 +1,85 @@
+/* vi:set ts=8 sts=4 sw=4 noet: */
+/*
+ * Author: MURAOKA Taro <koron.kaoriya@gmail.com>
+ *
+ * Contributors:
+ * - Ken Takata
+ *
+ * Copyright (C) 2013 MURAOKA Taro <koron.kaoriya@gmail.com>
+ * THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE.
+ */
+
+#ifndef GUI_DWRITE_H
+#define GUI_DWRITE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct DWriteContext DWriteContext;
+
+typedef struct DWriteRenderingParams {
+ float gamma;
+ float enhancedContrast;
+ float clearTypeLevel;
+ /*
+ * pixelGeometry:
+ * 0 - DWRITE_PIXEL_GEOMETRY_FLAT
+ * 1 - DWRITE_PIXEL_GEOMETRY_RGB
+ * 2 - DWRITE_PIXEL_GEOMETRY_BGR
+ */
+ int pixelGeometry;
+ /*
+ * renderingMode:
+ * 0 - DWRITE_RENDERING_MODE_DEFAULT
+ * 1 - DWRITE_RENDERING_MODE_ALIASED
+ * 2 - DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC
+ * 3 - DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL
+ * 4 - DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL
+ * 5 - DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC
+ * 6 - DWRITE_RENDERING_MODE_OUTLINE
+ */
+ int renderingMode;
+ /*
+ * antialiasMode:
+ * 0 - D2D1_TEXT_ANTIALIAS_MODE_DEFAULT
+ * 1 - D2D1_TEXT_ANTIALIAS_MODE_CLEARTYPE
+ * 2 - D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE
+ * 3 - D2D1_TEXT_ANTIALIAS_MODE_ALIASED
+ */
+ int textAntialiasMode;
+} DWriteRenderingParams;
+
+void DWrite_Init(void);
+void DWrite_Final(void);
+
+DWriteContext *DWriteContext_Open(void);
+void DWriteContext_BeginDraw(DWriteContext *ctx);
+void DWriteContext_BindDC(DWriteContext *ctx, HDC hdc, RECT *rect);
+void DWriteContext_SetFont(DWriteContext *ctx, HFONT hFont);
+void DWriteContext_DrawText(
+ DWriteContext *ctx,
+ HDC hdc,
+ const WCHAR* text,
+ int len,
+ int x,
+ int y,
+ int w,
+ int h,
+ int cellWidth,
+ COLORREF color);
+void DWriteContext_EndDraw(DWriteContext *ctx);
+void DWriteContext_Close(DWriteContext *ctx);
+
+void DWriteContext_SetRenderingParams(
+ DWriteContext *ctx,
+ const DWriteRenderingParams *params);
+
+DWriteRenderingParams *DWriteContext_GetRenderingParams(
+ DWriteContext *ctx,
+ DWriteRenderingParams *params);
+
+#ifdef __cplusplus
+}
+#endif
+#endif/*GUI_DWRITE_H*/
diff --git a/src/gui_w32.c b/src/gui_w32.c
index 2d57fbb27..b81a74df9 100644
--- a/src/gui_w32.c
+++ b/src/gui_w32.c
@@ -25,6 +25,147 @@
#include "vim.h"
+#if defined(FEAT_DIRECTX)
+# include "gui_dwrite.h"
+#endif
+
+#if defined(FEAT_DIRECTX)
+static DWriteContext *s_dwc = NULL;
+static int s_directx_enabled = 0;
+static int s_directx_load_attempted = 0;
+# define IS_ENABLE_DIRECTX() (s_directx_enabled && s_dwc != NULL)
+#endif
+
+#if defined(FEAT_DIRECTX) || defined(PROTO)
+ int
+directx_enabled(void)
+{
+ if (s_dwc != NULL)
+ return 1;
+ else if (s_directx_load_attempted)
+ return 0;
+ /* load DirectX */
+ DWrite_Init();
+ s_directx_load_attempted = 1;
+ s_dwc = DWriteContext_Open();
+ return s_dwc != NULL ? 1 : 0;
+}
+#endif
+
+#if defined(FEAT_RENDER_OPTIONS) || defined(PROTO)
+ int
+gui_mch_set_rendering_options(char_u *s)
+{
+#ifdef FEAT_DIRECTX
+ int retval = FAIL;
+ char_u *p, *q;
+
+ int dx_enable = 0;
+ int dx_flags = 0;
+ float dx_gamma = 0.0f;
+ float dx_contrast = 0.0f;
+ float dx_level = 0.0f;
+ int dx_geom = 0;
+ int dx_renmode = 0;
+ int dx_taamode = 0;
+
+ /* parse string as rendering options. */
+ for (p = s; p != NULL && *p != NUL; )
+ {
+ char_u item[256];
+ char_u name[128];
+ char_u value[128];
+
+ copy_option_part(&p, item, sizeof(item), ",");
+ if (p == NULL)
+ break;
+ q = &item[0];
+ copy_option_part(&q, name, sizeof(name), ":");
+ if (q == NULL)
+ return FAIL;
+ copy_option_part(&q, value, sizeof(value), ":");
+
+ if (STRCMP(name, "type") == 0)
+ {
+ if (STRCMP(value, "directx") == 0)
+ dx_enable = 1;
+ else
+ return FAIL;
+ }
+ else if (STRCMP(name, "gamma") == 0)
+ {
+ dx_flags |= 1 << 0;
+ dx_gamma = (float)atof(value);
+ }
+ else if (STRCMP(name, "contrast") == 0)
+ {
+ dx_flags |= 1 << 1;
+ dx_contrast = (float)atof(value);
+ }
+ else if (STRCMP(name, "level") == 0)
+ {
+ dx_flags |= 1 << 2;
+ dx_level = (float)atof(value);
+ }
+ else if (STRCMP(name, "geom") == 0)
+ {
+ dx_flags |= 1 << 3;
+ dx_geom = atoi(value);
+ if (dx_geom < 0 || dx_geom > 2)
+ return FAIL;
+ }
+ else if (STRCMP(name, "renmode") == 0)
+ {
+ dx_flags |= 1 << 4;
+ dx_renmode = atoi(value);
+ if (dx_renmode < 0 || dx_renmode > 6)
+ return FAIL;
+ }
+ else if (STRCMP(name, "taamode") == 0)
+ {
+ dx_flags |= 1 << 5;
+ dx_taamode = atoi(value);
+ if (dx_taamode < 0 || dx_taamode > 3)
+ return FAIL;
+ }
+ else
+ return FAIL;
+ }
+
+ /* Enable DirectX/DirectWrite */
+ if (dx_enable)
+ {
+ if (!directx_enabled())
+ return FAIL;
+ DWriteContext_SetRenderingParams(s_dwc, NULL);
+ if (dx_flags)
+ {
+ DWriteRenderingParams param;
+ DWriteContext_GetRenderingParams(s_dwc, &param);
+ if (dx_flags & (1 << 0))
+ param.gamma = dx_gamma;
+ if (dx_flags & (1 << 1))
+ param.enhancedContrast = dx_contrast;
+ if (dx_flags & (1 << 2))
+ param.clearTypeLevel = dx_level;
+ if (dx_flags & (1 << 3))
+ param.pixelGeometry = dx_geom;
+ if (dx_flags & (1 << 4))
+ param.renderingMode = dx_renmode;
+ if (dx_flags & (1 << 5))
+ param.textAntialiasMode = dx_taamode;
+ DWriteContext_SetRenderingParams(s_dwc, &param);
+ }
+ }
+ s_directx_enabled = dx_enable;
+
+ return OK;
+#else
+ return FAIL;
+#endif
+}
+#endif
+
/*
* These are new in Windows ME/XP, only defined in recent compilers.
*/
@@ -396,10 +537,6 @@ static void dyn_imm_load(void);
# define pImmSetConversionStatus ImmSetConversionStatus
#endif
-#ifndef ETO_IGNORELANGUAGE
-# define ETO_IGNORELANGUAGE 0x1000
-#endif
-
/* multi monitor support */
typedef struct _MONITORINFOstruct
{
@@ -1527,6 +1664,14 @@ gui_mch_init(void)
if (s_textArea == NULL)
return FAIL;
+ /* Try loading an icon from $RUNTIMEPATH/bitmaps/vim.ico. */
+ {
+ HANDLE hIcon = NULL;
+
+ if (mch_icon_load(&hIcon) == OK && hIcon != NULL)
+ SendMessage(s_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)hIcon);
+ }
+
#ifdef FEAT_MENU
s_menuBar = CreateMenu();
#endif
@@ -1624,6 +1769,11 @@ gui_mch_init(void)
set_vim_var_nr(VV_WINDOWID, HandleToLong(s_hwnd));
#endif
+#ifdef FEAT_RENDER_OPTIONS
+ if (p_rop)
+ (void)gui_mch_set_rendering_options(p_rop);
+#endif
+
theend:
/* Display any pending error messages */
display_errors();
@@ -1695,9 +1845,9 @@ gui_mch_set_shellsize(int width, int height,
/* compute the size of the outside of the window */
win_width = width + (GetSystemMetrics(SM_CXFRAME) +
- GetSystemMetrics(SM_CXPADDEDBORDER)) * 2;
+ GetSystemMetrics(SM_CXPADDEDBORDER)) * 2;
win_height = height + (GetSystemMetrics(SM_CYFRAME) +
- GetSystemMetrics(SM_CXPADDEDBORDER)) * 2
+ GetSystemMetrics(SM_CXPADDEDBORDER)) * 2
+ GetSystemMetrics(SM_CYCAPTION)
#ifdef FEAT_MENU
+ gui_mswin_get_menu_height(FALSE)
@@ -2239,6 +2389,9 @@ gui_mch_draw_string(
#endif
HPEN hpen, old_pen;
int y;
+#ifdef FEAT_DIRECTX
+ int font_is_ttf_or_vector = 0;
+#endif
#ifndef MSWIN16_FASTTEXT
/*
@@ -2326,6 +2479,20 @@ gui_mch_draw_string(
SetTextColor(s_hdc, gui.currFgColor);
SelectFont(s_hdc, gui.currFont);
+#ifdef FEAT_DIRECTX
+ if (IS_ENABLE_DIRECTX())
+ {
+ TEXTMETRIC tm;
+
+ GetTextMetrics(s_hdc, &tm);
+ if (tm.tmPitchAndFamily & (TMPF_TRUETYPE | TMPF_VECTOR))
+ {
+ font_is_ttf_or_vector = 1;
+ DWriteContext_SetFont(s_dwc, (HFONT)gui.currFont);
+ }
+ }
+#endif
+
if (pad_size != Columns || padding == NULL || padding[0] != gui.char_width)
{
vim_free(padding);
@@ -2339,12 +2506,6 @@ gui_mch_draw_string(
padding[i] = gui.char_width;
}
- /* On NT, tell the font renderer not to "help" us with Hebrew and Arabic
- * text. This doesn't work in 9x, so we have to deal with it manually on
- * those systems. */
- if (os_version.dwPlatformId == VER_PLATFORM_WIN32_NT)
- foptions |= ETO_IGNORELANGUAGE;
-
/*
* We have to provide the padding argument because italic and bold versions
* of fixed-width fonts are often one pixel or so wider than their normal
@@ -2360,6 +2521,14 @@ gui_mch_draw_string(
if (text[n] >= 0x80)
break;
+#if defined(FEAT_DIRECTX)
+ /* Quick hack to enable DirectWrite. To use DirectWrite (antialias), it is
+ * required that unicode drawing routine, currently. So this forces it
+ * enabled. */
+ if (enc_utf8 && IS_ENABLE_DIRECTX())
+ n = 0; /* Keep n < len, to enter block for unicode. */
+#endif
+
/* Check if the Unicode buffer exists and is big enough. Create it
* with the same length as the multi-byte string, the number of wide
* characters is always equal or smaller. */
@@ -2418,8 +2587,18 @@ gui_mch_draw_string(
i += utfc_ptr2len_len(text + i, len - i);
++clen;
}
- ExtTextOutW(s_hdc, TEXT_X(col), TEXT_Y(row),
- foptions, pcliprect, unicodebuf, wlen, unicodepdy);
+#if defined(FEAT_DIRECTX)
+ if (IS_ENABLE_DIRECTX() && font_is_ttf_or_vector)
+ {
+ /* Add one to "cells" for italics. */
+ DWriteContext_DrawText(s_dwc, s_hdc, unicodebuf, wlen,
+ TEXT_X(col), TEXT_Y(row), FILL_X(cells + 1), FILL_Y(1),
+ gui.char_width, gui.currFgColor);
+ }
+ else
+#endif
+ ExtTextOutW(s_hdc, TEXT_X(col), TEXT_Y(row),
+ foptions, pcliprect, unicodebuf, wlen, unicodepdy);
len = cells; /* used for underlining */
}
else if ((enc_codepage > 0 && (int)GetACP() != enc_codepage) || enc_latin9)
@@ -2462,10 +2641,9 @@ gui_mch_draw_string(
#endif
{
#ifdef FEAT_RIGHTLEFT
- /* If we can't use ETO_IGNORELANGUAGE, we can't tell Windows not to
- * mess up RL text, so we have to draw it character-by-character.
- * Only do this if RL is on, since it's slow. */
- if (curwin->w_p_rl && !(foptions & ETO_IGNORELANGUAGE))
+ /* Windows will mess up RL text, so we have to draw it character by
+ * character. Only do this if RL is on, since it's slow. */
+ if (curwin->w_p_rl)
RevOut(s_hdc, TEXT_X(col), TEXT_Y(row),
foptions, pcliprect, (char *)text, len, padding);
else
@@ -2549,14 +2727,14 @@ gui_mch_get_screen_dimensions(int *screen_w, int *screen_h)
*screen_w = workarea_rect.right - workarea_rect.left
- (GetSystemMetrics(SM_CXFRAME) +
- GetSystemMetrics(SM_CXPADDEDBORDER)) * 2;
+ GetSystemMetrics(SM_CXPADDEDBORDER)) * 2;
/* FIXME: dirty trick: Because the gui_get_base_height() doesn't include
* the menubar for MSwin, we subtract it from the screen height, so that
* the window size can be made to fit on the screen. */
*screen_h = workarea_rect.bottom - workarea_rect.top
- (GetSystemMetrics(SM_CYFRAME) +
- GetSystemMetrics(SM_CXPADDEDBORDER)) * 2
+ GetSystemMetrics(SM_CXPADDEDBORDER)) * 2
- GetSystemMetrics(SM_CYCAPTION)
#ifdef FEAT_MENU
- gui_mswin_get_menu_height(FALSE)
@@ -3188,13 +3366,13 @@ gui_mch_dialog(
GetWindowRect(s_hwnd, &rect);
maxDialogWidth = rect.right - rect.left
- (GetSystemMetrics(SM_CXFRAME) +
- GetSystemMetrics(SM_CXPADDEDBORDER)) * 2;
+ GetSystemMetrics(SM_CXPADDEDBORDER)) * 2;
if (maxDialogWidth < DLG_MIN_MAX_WIDTH)
maxDialogWidth = DLG_MIN_MAX_WIDTH;
maxDialogHeight = rect.bottom - rect.top
- (GetSystemMetrics(SM_CYFRAME) +
- GetSystemMetrics(SM_CXPADDEDBORDER)) * 4
+ GetSystemMetrics(SM_CXPADDEDBORDER)) * 4
- GetSystemMetrics(SM_CYCAPTION);
if (maxDialogHeight < DLG_MIN_MAX_HEIGHT)
maxDialogHeight = DLG_MIN_MAX_HEIGHT;
@@ -3351,11 +3529,11 @@ gui_mch_dialog(
/* Restrict the size to a maximum. Causes a scrollbar to show up. */
if (dlgheight > maxDialogHeight)
{
- msgheight = msgheight - (dlgheight - maxDialogHeight);
- dlgheight = maxDialogHeight;
- scroll_flag = WS_VSCROLL;
- /* Make sure scrollbar doesn't appear in the middle of the dialog */
- messageWidth = dlgwidth - DLG_ICON_WIDTH - 3 * dlgPaddingX;
+ msgheight = msgheight - (dlgheight - maxDialogHeight);
+ dlgheight = maxDialogHeight;
+ scroll_flag = WS_VSCROLL;
+ /* Make sure scrollbar doesn't appear in the middle of the dialog */
+ messageWidth = dlgwidth - DLG_ICON_WIDTH - 3 * dlgPaddingX;
}
add_word(PixelToDialogY(dlgheight));
diff --git a/src/gui_w48.c b/src/gui_w48.c
index 89b60908e..cd7fdde54 100644
--- a/src/gui_w48.c
+++ b/src/gui_w48.c
@@ -614,6 +614,8 @@ _OnChar(
char_u string[40];
int len = 0;
+ dead_key = 0;
+
len = char_to_string(ch, string, 40, FALSE);
if (len == 1 && string[0] == Ctrl_C && ctrl_c_interrupts)
{
@@ -1788,24 +1790,21 @@ process_message(void)
if (msg.message == WM_KEYDOWN || msg.message == WM_SYSKEYDOWN)
{
vk = (int) msg.wParam;
- /* handle key after dead key, but ignore shift, alt and control */
- if (dead_key && vk != VK_SHIFT && vk != VK_MENU && vk != VK_CONTROL)
+ /*
+ * If a dead key was pressed and the user presses VK_SPACE, VK_BACK, or
+ * VK_ESCAPE it means that he actually wants to deal with the dead char
+ * now, so do nothing special and let Windows handle it.
+ *
+ * Note that VK_SPACE combines with the dead_key's character and only
+ * one WM_CHAR will be generated by TranslateMessage(), in the two
+ * other cases two WM_CHAR will be generated: the dead char and VK_BACK
+ * or VK_ESCAPE. That is most likely what the user expects.
+ */
+ if (dead_key && (vk == VK_SPACE || vk == VK_BACK || vk == VK_ESCAPE))
{
dead_key = 0;
- /* handle non-alphabetic keys (ones that hopefully cannot generate
- * umlaut-characters), unless when control is down */
- if (vk < 'A' || vk > 'Z' || (GetKeyState(VK_CONTROL) & 0x8000))
- {
- MSG dm;
-
- dm.message = msg.message;
- dm.hwnd = msg.hwnd;
- dm.wParam = VK_SPACE;
- MyTranslateMessage(&dm); /* generate dead character */
- if (vk != VK_SPACE) /* and send current character once more */
- PostMessage(msg.hwnd, msg.message, msg.wParam, msg.lParam);
- return;
- }
+ MyTranslateMessage(&msg);
+ return;
}
/* Check for CTRL-BREAK */
@@ -2785,6 +2784,10 @@ _OnPaint(
out_flush(); /* make sure all output has been processed */
(void)BeginPaint(hwnd, &ps);
+#if defined(FEAT_DIRECTX)
+ if (IS_ENABLE_DIRECTX())
+ DWriteContext_BeginDraw(s_dwc);
+#endif
#ifdef FEAT_MBYTE
/* prevent multi-byte characters from misprinting on an invalid
@@ -2800,9 +2803,20 @@ _OnPaint(
#endif
if (!IsRectEmpty(&ps.rcPaint))
+ {
+#if defined(FEAT_DIRECTX)
+ if (IS_ENABLE_DIRECTX())
+ DWriteContext_BindDC(s_dwc, s_hdc, &ps.rcPaint);
+#endif
gui_redraw(ps.rcPaint.left, ps.rcPaint.top,
ps.rcPaint.right - ps.rcPaint.left + 1,
ps.rcPaint.bottom - ps.rcPaint.top + 1);
+ }
+
+#if defined(FEAT_DIRECTX)
+ if (IS_ENABLE_DIRECTX())
+ DWriteContext_EndDraw(s_dwc);
+#endif
EndPaint(hwnd, &ps);
}
}
@@ -3043,6 +3057,12 @@ gui_mch_insert_lines(
void
gui_mch_exit(int rc)
{
+#if defined(FEAT_DIRECTX)
+ DWriteContext_Close(s_dwc);
+ DWrite_Final();
+ s_dwc = NULL;
+#endif
+
ReleaseDC(s_textArea, s_hdc);
DeleteObject(s_brush);
diff --git a/src/hardcopy.c b/src/hardcopy.c
index 1df2fda72..1e795e6b5 100644
--- a/src/hardcopy.c
+++ b/src/hardcopy.c
@@ -2960,12 +2960,12 @@ mch_print_begin(psettings)
if (!prt_find_resource("prolog", res_prolog))
{
EMSG(_("E456: Can't find PostScript resource file \"prolog.ps\""));
- return FALSE;
+ goto theend;
}
if (!prt_open_resource(res_prolog))
- return FALSE;
+ goto theend;
if (!prt_check_resource(res_prolog, PRT_PROLOG_VERSION))
- return FALSE;
+ goto theend;
#ifdef FEAT_MBYTE
if (prt_out_mbyte)
{
@@ -2973,12 +2973,12 @@ mch_print_begin(psettings)
if (!prt_find_resource("cidfont", res_cidfont))
{
EMSG(_("E456: Can't find PostScript resource file \"cidfont.ps\""));
- return FALSE;
+ goto theend;
}
if (!prt_open_resource(res_cidfont))
- return FALSE;
+ goto theend;
if (!prt_check_resource(res_cidfont, PRT_CID_PROLOG_VERSION))
- return FALSE;
+ goto theend;
}
#endif
@@ -3012,12 +3012,12 @@ mch_print_begin(psettings)
{
EMSG2(_("E456: Can't find PostScript resource file \"%s.ps\""),
p_encoding);
- return FALSE;
+ goto theend;
}
}
}
if (!prt_open_resource(res_encoding))
- return FALSE;
+ goto theend;
/* For the moment there are no checks on encoding resource files to
* perform */
#ifdef FEAT_MBYTE
@@ -3034,10 +3034,10 @@ mch_print_begin(psettings)
{
EMSG2(_("E456: Can't find PostScript resource file \"%s.ps\""),
prt_ascii_encoding);
- return FALSE;
+ goto theend;
}
if (!prt_open_resource(res_encoding))
- return FALSE;
+ goto theend;
/* For the moment there are no checks on encoding resource files to
* perform */
}
@@ -3050,7 +3050,7 @@ mch_print_begin(psettings)
{
EMSG2(_("E620: Unable to convert to print encoding \"%s\""),
p_encoding);
- return FALSE;
+ goto theend;
}
prt_do_conv = TRUE;
}
@@ -3063,10 +3063,10 @@ mch_print_begin(psettings)
{
EMSG2(_("E456: Can't find PostScript resource file \"%s.ps\""),
prt_cmap);
- return FALSE;
+ goto theend;
}
if (!prt_open_resource(res_cmap))
- return FALSE;
+ goto theend;
}
#endif
@@ -3140,15 +3140,15 @@ mch_print_begin(psettings)
/* Add required procsets - NOTE: order is important! */
if (!prt_add_resource(res_prolog))
- return FALSE;
+ goto theend;
#ifdef FEAT_MBYTE
if (prt_out_mbyte)
{
/* Add CID font procset, and any user supplied CMap */
if (!prt_add_resource(res_cidfont))
- return FALSE;
+ goto theend;
if (prt_custom_cmap && !prt_add_resource(res_cmap))
- return FALSE;
+ goto theend;
}
#endif
@@ -3158,7 +3158,7 @@ mch_print_begin(psettings)
/* There will be only one Roman font encoding to be included in the PS
* file. */
if (!prt_add_resource(res_encoding))
- return FALSE;
+ goto theend;
prt_dsc_noarg("EndProlog");
diff --git a/src/if_cscope.c b/src/if_cscope.c
index 09982e647..ab31a0351 100644
--- a/src/if_cscope.c
+++ b/src/if_cscope.c
@@ -1131,8 +1131,8 @@ cs_find_common(opt, pat, forceit, verbose, use_ll, cmdline)
char *pat;
int forceit;
int verbose;
- int use_ll;
- char_u *cmdline;
+ int use_ll UNUSED;
+ char_u *cmdline UNUSED;
{
int i;
char *cmd;
diff --git a/src/if_py_both.h b/src/if_py_both.h
index bf5ea4cf3..206d2987a 100644
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -3172,6 +3172,7 @@ set_option_value_for(
if (switch_win(&save_curwin, &save_curtab, (win_T *)from,
win_find_tabpage((win_T *)from), FALSE) == FAIL)
{
+ restore_win(save_curwin, save_curtab, TRUE);
if (VimTryEnd())
return -1;
PyErr_SET_VIM(N_("problem while switching windows"));
@@ -4032,9 +4033,13 @@ switch_to_win_for_buf(
win_T *wp;
tabpage_T *tp;
- if (find_win_for_buf(buf, &wp, &tp) == FAIL
- || switch_win(save_curwinp, save_curtabp, wp, tp, TRUE) == FAIL)
+ if (find_win_for_buf(buf, &wp, &tp) == FAIL)
switch_buffer(save_curbufp, buf);
+ else if (switch_win(save_curwinp, save_curtabp, wp, tp, TRUE) == FAIL)
+ {
+ restore_win(*save_curwinp, *save_curtabp, TRUE);
+ switch_buffer(save_curbufp, buf);
+ }
}
static void
@@ -4196,7 +4201,9 @@ SetBufferLineList(
break;
}
}
- if (buf == curbuf)
+ if (buf == curbuf && (save_curwin != NULL || save_curbuf == NULL))
+ /* Using an existing window for the buffer, adjust the cursor
+ * position. */
py_fix_cursor((linenr_T)lo, (linenr_T)hi, (linenr_T)-n);
if (save_curbuf == NULL)
/* Only adjust marks if we managed to switch to a window that
diff --git a/src/if_python.c b/src/if_python.c
index c95cb5d0e..b7bfa785c 100644
--- a/src/if_python.c
+++ b/src/if_python.c
@@ -295,6 +295,9 @@ struct PyMethodDef { Py_ssize_t a; };
# define PyCObject_FromVoidPtr dll_PyCObject_FromVoidPtr
# define PyCObject_AsVoidPtr dll_PyCObject_AsVoidPtr
# endif
+# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02070000
+# define Py_NoSiteFlag (*dll_Py_NoSiteFlag)
+# endif
/*
* Pointers for dynamic link
@@ -440,6 +443,9 @@ static void* (*dll_PyCapsule_GetPointer)(PyObject *, char *);
static PyObject* (*dll_PyCObject_FromVoidPtr)(void *cobj, void (*destr)(void *));
static void* (*dll_PyCObject_AsVoidPtr)(PyObject *);
# endif
+# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02070000
+static int* dll_Py_NoSiteFlag;
+# endif
static HINSTANCE hinstPython = 0; /* Instance of python.dll */
@@ -633,6 +639,9 @@ static struct
{"PyCObject_FromVoidPtr", (PYTHON_PROC*)&dll_PyCObject_FromVoidPtr},
{"PyCObject_AsVoidPtr", (PYTHON_PROC*)&dll_PyCObject_AsVoidPtr},
# endif
+# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02070000
+ {"Py_NoSiteFlag", (PYTHON_PROC*)&dll_Py_NoSiteFlag},
+# endif
{"", NULL},
};
@@ -901,6 +910,10 @@ Python_Init(void)
{
if (!initialised)
{
+#if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02070000
+ PyObject *site;
+#endif
+
#ifdef DYNAMIC_PYTHON
if (!python_enabled(TRUE))
{
@@ -915,11 +928,29 @@ Python_Init(void)
init_structs();
+#if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02070000
+ /* Disable implicit 'import site', because it may cause Vim to exit
+ * when it can't be found. */
+ Py_NoSiteFlag++;
+#endif
+
#if !defined(MACOS) || defined(MACOS_X_UNIX)
Py_Initialize();
#else
PyMac_Initialize();
#endif
+
+#if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02070000
+ /* 'import site' explicitly. */
+ site = PyImport_ImportModule("site");
+ if (site == NULL)
+ {
+ EMSG(_("E887: Sorry, this command is disabled, the Python's site module could not be loaded."));
+ goto fail;
+ }
+ Py_DECREF(site);
+#endif
+
/* Initialise threads, and below save the state using
* PyEval_SaveThread. Without the call to PyEval_SaveThread, thread
* specific state (such as the system trace hook), will be lost
diff --git a/src/if_ruby.c b/src/if_ruby.c
index 06465bd5a..eb6141fbc 100644
--- a/src/if_ruby.c
+++ b/src/if_ruby.c
@@ -96,11 +96,11 @@
# define rb_num2int rb_num2int_stub
#endif
-# if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 21
+#if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 21
/* Ruby 2.1 adds new GC called RGenGC and RARRAY_PTR uses
* rb_gc_writebarrier_unprotect_promoted if USE_RGENGC */
-# define rb_gc_writebarrier_unprotect_promoted rb_gc_writebarrier_unprotect_promoted_stub
-# endif
+# define rb_gc_writebarrier_unprotect_promoted rb_gc_writebarrier_unprotect_promoted_stub
+#endif
#include <ruby.h>
#ifdef RUBY19_OR_LATER
@@ -418,10 +418,11 @@ VALUE rb_num2ulong(VALUE x)
# endif
# endif
-# if defined(USE_RGENGC) && USE_RGENGC
+ /* Do not generate a prototype here, VALUE isn't always defined. */
+# if defined(USE_RGENGC) && USE_RGENGC && !defined(PROTO)
void rb_gc_writebarrier_unprotect_promoted_stub(VALUE obj)
{
- return dll_rb_gc_writebarrier_unprotect_promoted(obj);
+ dll_rb_gc_writebarrier_unprotect_promoted(obj);
}
# endif
@@ -762,7 +763,8 @@ static int ensure_ruby_initialized(void)
/* suggested by Ariya Mizutani */
int argc = 1;
char *argv[] = {"gvim.exe"};
- NtInitialize(&argc, &argv);
+ char **argvp = argv;
+ NtInitialize(&argc, &argvp);
#endif
{
#if defined(RUBY19_OR_LATER) || defined(RUBY_INIT_STACK)
diff --git a/src/macros.h b/src/macros.h
index 2706a0252..01207d91b 100644
--- a/src/macros.h
+++ b/src/macros.h
@@ -128,13 +128,18 @@
* Adjust chars in a language according to 'langmap' option.
* NOTE that there is no noticeable overhead if 'langmap' is not set.
* When set the overhead for characters < 256 is small.
- * Don't apply 'langmap' if the character comes from the Stuff buffer.
+ * Don't apply 'langmap' if the character comes from the Stuff buffer or from
+ * a mapping and the langnoremap option was set.
* The do-while is just to ignore a ';' after the macro.
*/
# ifdef FEAT_MBYTE
# define LANGMAP_ADJUST(c, condition) \
do { \
- if (*p_langmap && (condition) && !KeyStuffed && (c) >= 0) \
+ if (*p_langmap \
+ && (condition) \
+ && (!p_lnr || (p_lnr && typebuf_maplen() == 0)) \
+ && !KeyStuffed \
+ && (c) >= 0) \
{ \
if ((c) < 256) \
c = langmap_mapchar[c]; \
@@ -145,7 +150,11 @@
# else
# define LANGMAP_ADJUST(c, condition) \
do { \
- if (*p_langmap && (condition) && !KeyStuffed && (c) >= 0 && (c) < 256) \
+ if (*p_langmap \
+ && (condition) \
+ && (!p_lnr || (p_lnr && typebuf_maplen() == 0)) \
+ && !KeyStuffed \
+ && (c) >= 0 && (c) < 256) \
c = langmap_mapchar[c]; \
} while (0)
# endif
diff --git a/src/main.c b/src/main.c
index 9c92f7a84..181438519 100644
--- a/src/main.c
+++ b/src/main.c
@@ -178,6 +178,14 @@ main
*/
mch_early_init();
+#if defined(WIN32) && defined(FEAT_MBYTE)
+ /*
+ * MingW expands command line arguments, which confuses our code to
+ * convert when 'encoding' changes. Get the unexpanded arguments.
+ */
+ argc = get_cmd_argsW(&argv);
+#endif
+
/* Many variables are in "params" so that we can pass them to invoked
* functions without a lot of arguments. "argc" and "argv" are also
* copied, so that they can be changed. */
@@ -846,8 +854,8 @@ vim_main2(int argc UNUSED, char **argv UNUSED)
#ifdef FEAT_CRYPT
if (params.ask_for_key)
{
- (void)blowfish_self_test();
- (void)get_crypt_key(TRUE, TRUE);
+ crypt_check_current_method();
+ (void)crypt_get_key(TRUE, TRUE);
TIME_MSG("getting crypt key");
}
#endif
@@ -951,8 +959,17 @@ vim_main2(int argc UNUSED, char **argv UNUSED)
if (p_im)
need_start_insertmode = TRUE;
+#ifdef FEAT_CLIPBOARD
+ if (clip_unnamed)
+ /* do not overwrite system clipboard while starting up */
+ clip_did_set_selection = -1;
+#endif
#ifdef FEAT_AUTOCMD
apply_autocmds(EVENT_VIMENTER, NULL, NULL, FALSE, curbuf);
+# ifdef FEAT_CLIPBOARD
+ if (clip_did_set_selection < 0)
+ clip_did_set_selection = TRUE;
+# endif
TIME_MSG("VimEnter autocommands");
#endif
@@ -1242,9 +1259,9 @@ main_loop(cmdwin, noexmode)
char_u *p;
/* msg_attr_keep() will set keep_msg to NULL, must free the
- * string here. */
+ * string here. Don't reset keep_msg, msg_attr_keep() uses it
+ * to check for duplicates. */
p = keep_msg;
- keep_msg = NULL;
msg_attr(p, keep_msg_attr);
vim_free(p);
}
@@ -1497,6 +1514,9 @@ getout(exitval)
if (garbage_collect_at_exit)
garbage_collect();
#endif
+#if defined(WIN32) && defined(FEAT_MBYTE)
+ free_cmd_argsW();
+#endif
mch_exit(exitval);
}
diff --git a/src/mbyte.c b/src/mbyte.c
index 10df894be..0531f1811 100644
--- a/src/mbyte.c
+++ b/src/mbyte.c
@@ -405,6 +405,7 @@ enc_alias_table[] =
{"unix-jis", IDX_EUC_JP},
{"ujis", IDX_EUC_JP},
{"shift-jis", IDX_SJIS},
+ {"pck", IDX_SJIS}, /* Sun: PCK */
{"euckr", IDX_EUC_KR},
{"5601", IDX_EUC_KR}, /* Sun: KS C 5601 */
{"euccn", IDX_EUC_CN},
@@ -2537,6 +2538,7 @@ utf_class(c)
{0x2900, 0x2998, 1}, /* arrows, brackets, etc. */
{0x29d8, 0x29db, 1},
{0x29fc, 0x29fd, 1},
+ {0x2e00, 0x2e7f, 1}, /* supplemental punctuation */
{0x3000, 0x3000, 0}, /* ideographic space */
{0x3001, 0x3020, 1}, /* ideographic punctuation */
{0x3030, 0x3030, 1},
diff --git a/src/memline.c b/src/memline.c
index c3f841024..60a50182d 100644
--- a/src/memline.c
+++ b/src/memline.c
@@ -63,6 +63,15 @@ typedef struct pointer_entry PTR_EN; /* block/line-count pair */
#define BLOCK0_ID1 '0' /* block 0 id 1 */
#define BLOCK0_ID1_C0 'c' /* block 0 id 1 'cm' 0 */
#define BLOCK0_ID1_C1 'C' /* block 0 id 1 'cm' 1 */
+#define BLOCK0_ID1_C2 'd' /* block 0 id 1 'cm' 2 */
+
+#if defined(FEAT_CRYPT)
+static int id1_codes[] = {
+ BLOCK0_ID1_C0, /* CRYPT_M_ZIP */
+ BLOCK0_ID1_C1, /* CRYPT_M_BF */
+ BLOCK0_ID1_C2, /* CRYPT_M_BF2 */
+};
+#endif
/*
* pointer to a block, used in a pointer block
@@ -151,7 +160,7 @@ struct data_block
struct block0
{
char_u b0_id[2]; /* id for block 0: BLOCK0_ID0 and BLOCK0_ID1,
- * BLOCK0_ID1_C0, BLOCK0_ID1_C1 */
+ * BLOCK0_ID1_C0, BLOCK0_ID1_C1, etc. */
char_u b0_version[10]; /* Vim version string */
char_u b0_page_size[4];/* number of bytes per page */
char_u b0_mtime[4]; /* last modification time of file */
@@ -226,6 +235,7 @@ typedef enum {
} upd_block0_T;
#ifdef FEAT_CRYPT
+static void ml_set_mfp_crypt __ARGS((buf_T *buf));
static void ml_set_b0_crypt __ARGS((buf_T *buf, ZERO_BL *b0p));
#endif
static int ml_check_b0_id __ARGS((ZERO_BL *b0p));
@@ -256,7 +266,7 @@ static long char_to_long __ARGS((char_u *));
static char_u *make_percent_swname __ARGS((char_u *dir, char_u *name));
#endif
#ifdef FEAT_CRYPT
-static void ml_crypt_prepare __ARGS((memfile_T *mfp, off_t offset, int reading));
+static cryptstate_T *ml_crypt_prepare __ARGS((memfile_T *mfp, off_t offset, int reading));
#endif
#ifdef FEAT_BYTEOFF
static void ml_updatechunk __ARGS((buf_T *buf, long line, long len, int updtype));
@@ -359,8 +369,7 @@ ml_open(buf)
b0p->b0_hname[B0_HNAME_SIZE - 1] = NUL;
long_to_char(mch_get_pid(), b0p->b0_pid);
#ifdef FEAT_CRYPT
- if (*buf->b_p_key != NUL)
- ml_set_b0_crypt(buf, b0p);
+ ml_set_b0_crypt(buf, b0p);
#endif
}
@@ -425,6 +434,25 @@ error:
#if defined(FEAT_CRYPT) || defined(PROTO)
/*
+ * Prepare encryption for "buf" for the current key and method.
+ */
+ static void
+ml_set_mfp_crypt(buf)
+ buf_T *buf;
+{
+ if (*buf->b_p_key != NUL)
+ {
+ int method_nr = crypt_get_method_nr(buf);
+
+ if (method_nr > CRYPT_M_ZIP)
+ {
+ /* Generate a seed and store it in the memfile. */
+ sha2_seed(buf->b_ml.ml_mfp->mf_seed, MF_SEED_LEN, NULL, 0);
+ }
+ }
+}
+
+/*
* Prepare encryption for "buf" with block 0 "b0p".
*/
static void
@@ -436,11 +464,11 @@ ml_set_b0_crypt(buf, b0p)
b0p->b0_id[1] = BLOCK0_ID1;
else
{
- if (get_crypt_method(buf) == 0)
- b0p->b0_id[1] = BLOCK0_ID1_C0;
- else
+ int method_nr = crypt_get_method_nr(buf);
+
+ b0p->b0_id[1] = id1_codes[method_nr];
+ if (method_nr > CRYPT_M_ZIP)
{
- b0p->b0_id[1] = BLOCK0_ID1_C1;
/* Generate a seed and store it in block 0 and in the memfile. */
sha2_seed(&b0p->b0_seed, MF_SEED_LEN, NULL, 0);
mch_memmove(buf->b_ml.ml_mfp->mf_seed, &b0p->b0_seed, MF_SEED_LEN);
@@ -887,7 +915,8 @@ ml_check_b0_id(b0p)
if (b0p->b0_id[0] != BLOCK0_ID0
|| (b0p->b0_id[1] != BLOCK0_ID1
&& b0p->b0_id[1] != BLOCK0_ID1_C0
- && b0p->b0_id[1] != BLOCK0_ID1_C1)
+ && b0p->b0_id[1] != BLOCK0_ID1_C1
+ && b0p->b0_id[1] != BLOCK0_ID1_C2)
)
return FAIL;
return OK;
@@ -906,8 +935,19 @@ ml_upd_block0(buf, what)
ZERO_BL *b0p;
mfp = buf->b_ml.ml_mfp;
- if (mfp == NULL || (hp = mf_get(mfp, (blocknr_T)0, 1)) == NULL)
+ if (mfp == NULL)
+ return;
+ hp = mf_get(mfp, (blocknr_T)0, 1);
+ if (hp == NULL)
+ {
+#ifdef FEAT_CRYPT
+ /* Possibly update the seed in the memfile before there is a block0. */
+ if (what == UB_CRYPT)
+ ml_set_mfp_crypt(buf);
+#endif
return;
+ }
+
b0p = (ZERO_BL *)(hp->bh_data);
if (ml_check_b0_id(b0p) == FAIL)
EMSG(_("E304: ml_upd_block0(): Didn't get block 0??"));
@@ -1255,14 +1295,12 @@ ml_recover()
}
#ifdef FEAT_CRYPT
- if (b0p->b0_id[1] == BLOCK0_ID1_C0)
- b0_cm = 0;
- else if (b0p->b0_id[1] == BLOCK0_ID1_C1)
- {
- b0_cm = 1;
+ for (i = 0; i < (int)(sizeof(id1_codes) / sizeof(int)); ++i)
+ if (id1_codes[i] == b0p->b0_id[1])
+ b0_cm = i;
+ if (b0_cm > 0)
mch_memmove(mfp->mf_seed, &b0p->b0_seed, MF_SEED_LEN);
- }
- set_crypt_method(buf, b0_cm);
+ crypt_set_cm_option(buf, b0_cm < 0 ? 0 : b0_cm);
#else
if (b0p->b0_id[1] != BLOCK0_ID1)
{
@@ -1389,7 +1427,7 @@ ml_recover()
}
else
smsg((char_u *)_(need_key_msg), fname_used);
- buf->b_p_key = get_crypt_key(FALSE, FALSE);
+ buf->b_p_key = crypt_get_key(FALSE, FALSE);
if (buf->b_p_key == NULL)
buf->b_p_key = curbuf->b_p_key;
else if (*buf->b_p_key == NUL)
@@ -4816,6 +4854,7 @@ ml_encrypt_data(mfp, data, offset, size)
char_u *text_start;
char_u *new_data;
int text_len;
+ cryptstate_T *state;
if (dp->db_id != DATA_ID)
return data;
@@ -4831,10 +4870,9 @@ ml_encrypt_data(mfp, data, offset, size)
mch_memmove(new_data, dp, head_end - (char_u *)dp);
/* Encrypt the text. */
- crypt_push_state();
- ml_crypt_prepare(mfp, offset, FALSE);
- crypt_encode(text_start, text_len, new_data + dp->db_txt_start);
- crypt_pop_state();
+ state = ml_crypt_prepare(mfp, offset, FALSE);
+ crypt_encode(state, text_start, text_len, new_data + dp->db_txt_start);
+ crypt_free_state(state);
/* Clear the gap. */
if (head_end < text_start)
@@ -4857,6 +4895,7 @@ ml_decrypt_data(mfp, data, offset, size)
char_u *head_end;
char_u *text_start;
int text_len;
+ cryptstate_T *state;
if (dp->db_id == DATA_ID)
{
@@ -4869,17 +4908,17 @@ ml_decrypt_data(mfp, data, offset, size)
return; /* data was messed up */
/* Decrypt the text in place. */
- crypt_push_state();
- ml_crypt_prepare(mfp, offset, TRUE);
- crypt_decode(text_start, text_len);
- crypt_pop_state();
+ state = ml_crypt_prepare(mfp, offset, TRUE);
+ crypt_decode_inplace(state, text_start, text_len);
+ crypt_free_state(state);
}
}
/*
* Prepare for encryption/decryption, using the key, seed and offset.
+ * Return an allocated cryptstate_T *.
*/
- static void
+ static cryptstate_T *
ml_crypt_prepare(mfp, offset, reading)
memfile_T *mfp;
off_t offset;
@@ -4887,38 +4926,37 @@ ml_crypt_prepare(mfp, offset, reading)
{
buf_T *buf = mfp->mf_buffer;
char_u salt[50];
- int method;
+ int method_nr;
char_u *key;
char_u *seed;
if (reading && mfp->mf_old_key != NULL)
{
/* Reading back blocks with the previous key/method/seed. */
- method = mfp->mf_old_cm;
+ method_nr = mfp->mf_old_cm;
key = mfp->mf_old_key;
seed = mfp->mf_old_seed;
}
else
{
- method = get_crypt_method(buf);
+ method_nr = crypt_get_method_nr(buf);
key = buf->b_p_key;
seed = mfp->mf_seed;
}
- use_crypt_method = method; /* select pkzip or blowfish */
- if (method == 0)
+ if (method_nr == CRYPT_M_ZIP)
{
+ /* For PKzip: Append the offset to the key, so that we use a different
+ * key for every block. */
vim_snprintf((char *)salt, sizeof(salt), "%s%ld", key, (long)offset);
- crypt_init_keys(salt);
- }
- else
- {
- /* Using blowfish, add salt and seed. We use the byte offset of the
- * block for the salt. */
- vim_snprintf((char *)salt, sizeof(salt), "%ld", (long)offset);
- bf_key_init(key, salt, (int)STRLEN(salt));
- bf_cfb_init(seed, MF_SEED_LEN);
+ return crypt_create(method_nr, salt, NULL, 0, NULL, 0);
}
+
+ /* Using blowfish or better: add salt and seed. We use the byte offset
+ * of the block for the salt. */
+ vim_snprintf((char *)salt, sizeof(salt), "%ld", (long)offset);
+ return crypt_create(method_nr, key, salt, (int)STRLEN(salt),
+ seed, MF_SEED_LEN);
}
#endif
diff --git a/src/message.c b/src/message.c
index 8508f6dfd..b6eaddc0c 100644
--- a/src/message.c
+++ b/src/message.c
@@ -4030,11 +4030,11 @@ tv_float(tvs, idxp)
* pointer for resulting string argument if "str_m" is zero (as per ISO C99).
*
* The return value is the number of characters which would be generated
- * for the given input, excluding the trailing null. If this value
+ * for the given input, excluding the trailing NUL. If this value
* is greater or equal to "str_m", not all characters from the result
* have been stored in str, output bytes beyond the ("str_m"-1) -th character
* are discarded. If "str_m" is greater than zero it is guaranteed
- * the resulting string will be null-terminated.
+ * the resulting string will be NUL-terminated.
*/
/*
diff --git a/src/misc1.c b/src/misc1.c
index 3a834aa0c..e3e7da824 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -78,7 +78,8 @@ get_indent_str(ptr, ts, list)
if (!list || lcs_tab1) /* count a tab for what it is worth */
count += ts - (count % ts);
else
- /* in list mode, when tab is not set, count screen char width for Tab: ^I */
+ /* In list mode, when tab is not set, count screen char width
+ * for Tab, displays: ^I */
count += ptr2cells(ptr);
}
else if (*ptr == ' ')
@@ -5503,7 +5504,7 @@ cin_has_js_key(text)
char_u *text;
{
char_u *s = skipwhite(text);
- int quote = 0;
+ int quote = -1;
if (*s == '\'' || *s == '"')
{
@@ -6995,6 +6996,7 @@ get_c_indent()
char_u *linecopy;
pos_T *trypos;
pos_T *tryposBrace = NULL;
+ pos_T tryposBraceCopy;
pos_T our_paren_pos;
char_u *start;
int start_brace;
@@ -7532,7 +7534,11 @@ get_c_indent()
/*
* We are inside braces, there is a { before this line at the position
* stored in tryposBrace.
+ * Make a copy of tryposBrace, it may point to pos_copy inside
+ * find_start_brace(), which may be changed somewhere.
*/
+ tryposBraceCopy = *tryposBrace;
+ tryposBrace = &tryposBraceCopy;
trypos = tryposBrace;
ourscope = trypos->lnum;
start = ml_get(ourscope);
@@ -10762,7 +10768,7 @@ gen_expand_wildcards(num_pat, pat, num_file, file, flags)
vim_free(p);
ga_clear_strings(&ga);
i = mch_expand_wildcards(num_pat, pat, num_file, file,
- flags);
+ flags|EW_KEEPDOLLAR);
recursive = FALSE;
return i;
}
diff --git a/src/misc2.c b/src/misc2.c
index 1a5b370ba..d421a00bc 100644
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -1040,7 +1040,8 @@ free_all_mem()
entered = TRUE;
# ifdef FEAT_AUTOCMD
- block_autocmds(); /* don't want to trigger autocommands here */
+ /* Don't want to trigger autocommands from here on. */
+ block_autocmds();
# endif
# ifdef FEAT_WINDOWS
@@ -2470,6 +2471,7 @@ static struct key_name_entry
{K_SNR, (char_u *)"SNR"},
#endif
{K_PLUG, (char_u *)"Plug"},
+ {K_CURSORHOLD, (char_u *)"CursorHold"},
{0, NULL}
};
@@ -3803,322 +3805,6 @@ update_mouseshape(shape_idx)
#endif /* CURSOR_SHAPE */
-#ifdef FEAT_CRYPT
-/*
- * Optional encryption support.
- * Mohsin Ahmed, mosh@sasi.com, 98-09-24
- * Based on zip/crypt sources.
- *
- * NOTE FOR USA: Since 2000 exporting this code from the USA is allowed to
- * most countries. There are a few exceptions, but that still should not be a
- * problem since this code was originally created in Europe and India.
- *
- * Blowfish addition originally made by Mohsin Ahmed,
- * http://www.cs.albany.edu/~mosh 2010-03-14
- * Based on blowfish by Bruce Schneier (http://www.schneier.com/blowfish.html)
- * and sha256 by Christophe Devine.
- */
-
-/* from zip.h */
-
-typedef unsigned short ush; /* unsigned 16-bit value */
-typedef unsigned long ulg; /* unsigned 32-bit value */
-
-static void make_crc_tab __ARGS((void));
-
-static ulg crc_32_tab[256];
-
-/*
- * Fill the CRC table.
- */
- static void
-make_crc_tab()
-{
- ulg s,t,v;
- static int done = FALSE;
-
- if (done)
- return;
- for (t = 0; t < 256; t++)
- {
- v = t;
- for (s = 0; s < 8; s++)
- v = (v >> 1) ^ ((v & 1) * (ulg)0xedb88320L);
- crc_32_tab[t] = v;
- }
- done = TRUE;
-}
-
-#define CRC32(c, b) (crc_32_tab[((int)(c) ^ (b)) & 0xff] ^ ((c) >> 8))
-
-static ulg keys[3]; /* keys defining the pseudo-random sequence */
-
-/*
- * Return the next byte in the pseudo-random sequence.
- */
-#define DECRYPT_BYTE_ZIP(t) { \
- ush temp; \
- \
- temp = (ush)keys[2] | 2; \
- t = (int)(((unsigned)(temp * (temp ^ 1U)) >> 8) & 0xff); \
-}
-
-/*
- * Update the encryption keys with the next byte of plain text.
- */
-#define UPDATE_KEYS_ZIP(c) { \
- keys[0] = CRC32(keys[0], (c)); \
- keys[1] += keys[0] & 0xff; \
- keys[1] = keys[1] * 134775813L + 1; \
- keys[2] = CRC32(keys[2], (int)(keys[1] >> 24)); \
-}
-
-static int crypt_busy = 0;
-static ulg saved_keys[3];
-static int saved_crypt_method;
-
-/*
- * Return int value for crypt method string:
- * 0 for "zip", the old method. Also for any non-valid value.
- * 1 for "blowfish".
- */
- int
-crypt_method_from_string(s)
- char_u *s;
-{
- return *s == 'b' ? 1 : 0;
-}
-
-/*
- * Get the crypt method for buffer "buf" as a number.
- */
- int
-get_crypt_method(buf)
- buf_T *buf;
-{
- return crypt_method_from_string(*buf->b_p_cm == NUL ? p_cm : buf->b_p_cm);
-}
-
-/*
- * Set the crypt method for buffer "buf" to "method" using the int value as
- * returned by crypt_method_from_string().
- */
- void
-set_crypt_method(buf, method)
- buf_T *buf;
- int method;
-{
- free_string_option(buf->b_p_cm);
- buf->b_p_cm = vim_strsave((char_u *)(method == 0 ? "zip" : "blowfish"));
-}
-
-/*
- * Prepare for initializing encryption. If already doing encryption then save
- * the state.
- * Must always be called symmetrically with crypt_pop_state().
- */
- void
-crypt_push_state()
-{
- if (crypt_busy == 1)
- {
- /* save the state */
- if (use_crypt_method == 0)
- {
- saved_keys[0] = keys[0];
- saved_keys[1] = keys[1];
- saved_keys[2] = keys[2];
- }
- else
- bf_crypt_save();
- saved_crypt_method = use_crypt_method;
- }
- else if (crypt_busy > 1)
- EMSG2(_(e_intern2), "crypt_push_state()");
- ++crypt_busy;
-}
-
-/*
- * End encryption. If doing encryption before crypt_push_state() then restore
- * the saved state.
- * Must always be called symmetrically with crypt_push_state().
- */
- void
-crypt_pop_state()
-{
- --crypt_busy;
- if (crypt_busy == 1)
- {
- use_crypt_method = saved_crypt_method;
- if (use_crypt_method == 0)
- {
- keys[0] = saved_keys[0];
- keys[1] = saved_keys[1];
- keys[2] = saved_keys[2];
- }
- else
- bf_crypt_restore();
- }
-}
-
-/*
- * Encrypt "from[len]" into "to[len]".
- * "from" and "to" can be equal to encrypt in place.
- */
- void
-crypt_encode(from, len, to)
- char_u *from;
- size_t len;
- char_u *to;
-{
- size_t i;
- int ztemp, t;
-
- if (use_crypt_method == 0)
- for (i = 0; i < len; ++i)
- {
- ztemp = from[i];
- DECRYPT_BYTE_ZIP(t);
- UPDATE_KEYS_ZIP(ztemp);
- to[i] = t ^ ztemp;
- }
- else
- bf_crypt_encode(from, len, to);
-}
-
-/*
- * Decrypt "ptr[len]" in place.
- */
- void
-crypt_decode(ptr, len)
- char_u *ptr;
- long len;
-{
- char_u *p;
-
- if (use_crypt_method == 0)
- for (p = ptr; p < ptr + len; ++p)
- {
- ush temp;
-
- temp = (ush)keys[2] | 2;
- temp = (int)(((unsigned)(temp * (temp ^ 1U)) >> 8) & 0xff);
- UPDATE_KEYS_ZIP(*p ^= temp);
- }
- else
- bf_crypt_decode(ptr, len);
-}
-
-/*
- * Initialize the encryption keys and the random header according to
- * the given password.
- * If "passwd" is NULL or empty, don't do anything.
- */
- void
-crypt_init_keys(passwd)
- char_u *passwd; /* password string with which to modify keys */
-{
- if (passwd != NULL && *passwd != NUL)
- {
- if (use_crypt_method == 0)
- {
- char_u *p;
-
- make_crc_tab();
- keys[0] = 305419896L;
- keys[1] = 591751049L;
- keys[2] = 878082192L;
- for (p = passwd; *p!= NUL; ++p)
- {
- UPDATE_KEYS_ZIP((int)*p);
- }
- }
- else
- bf_crypt_init_keys(passwd);
- }
-}
-
-/*
- * Free an allocated crypt key. Clear the text to make sure it doesn't stay
- * in memory anywhere.
- */
- void
-free_crypt_key(key)
- char_u *key;
-{
- char_u *p;
-
- if (key != NULL)
- {
- for (p = key; *p != NUL; ++p)
- *p = 0;
- vim_free(key);
- }
-}
-
-/*
- * Ask the user for a crypt key.
- * When "store" is TRUE, the new key is stored in the 'key' option, and the
- * 'key' option value is returned: Don't free it.
- * When "store" is FALSE, the typed key is returned in allocated memory.
- * Returns NULL on failure.
- */
- char_u *
-get_crypt_key(store, twice)
- int store;
- int twice; /* Ask for the key twice. */
-{
- char_u *p1, *p2 = NULL;
- int round;
-
- for (round = 0; ; ++round)
- {
- cmdline_star = TRUE;
- cmdline_row = msg_row;
- p1 = getcmdline_prompt(NUL, round == 0
- ? (char_u *)_("Enter encryption key: ")
- : (char_u *)_("Enter same key again: "), 0, EXPAND_NOTHING,
- NULL);
- cmdline_star = FALSE;
-
- if (p1 == NULL)
- break;
-
- if (round == twice)
- {
- if (p2 != NULL && STRCMP(p1, p2) != 0)
- {
- MSG(_("Keys don't match!"));
- free_crypt_key(p1);
- free_crypt_key(p2);
- p2 = NULL;
- round = -1; /* do it again */
- continue;
- }
-
- if (store)
- {
- set_option_value((char_u *)"key", 0L, p1, OPT_LOCAL);
- free_crypt_key(p1);
- p1 = curbuf->b_p_key;
- }
- break;
- }
- p2 = p1;
- }
-
- /* since the user typed this, no need to wait for return */
- if (msg_didout)
- msg_putchar('\n');
- need_wait_return = FALSE;
- msg_didout = FALSE;
-
- free_crypt_key(p2);
- return p1;
-}
-
-#endif /* FEAT_CRYPT */
-
/* TODO: make some #ifdef for this */
/*--------[ file searching ]-------------------------------------------------*/
/*
@@ -6588,8 +6274,23 @@ put_time(fd, the_time)
FILE *fd;
time_t the_time;
{
+ char_u buf[8];
+
+ time_to_bytes(the_time, buf);
+ fwrite(buf, (size_t)8, (size_t)1, fd);
+}
+
+/*
+ * Write time_t to "buf[8]".
+ */
+ void
+time_to_bytes(the_time, buf)
+ time_t the_time;
+ char_u *buf;
+{
int c;
int i;
+ int bi = 0;
time_t wtime = the_time;
/* time_t can be up to 8 bytes in size, more than long_u, thus we
@@ -6603,7 +6304,7 @@ put_time(fd, the_time)
{
if (i + 1 > (int)sizeof(time_t))
/* ">>" doesn't work well when shifting more bits than avail */
- putc(0, fd);
+ buf[bi++] = 0;
else
{
#if defined(SIZEOF_TIME_T) && SIZEOF_TIME_T > 4
@@ -6611,7 +6312,7 @@ put_time(fd, the_time)
#else
c = (int)((long_u)wtime >> (i * 8));
#endif
- putc(c, fd);
+ buf[bi++] = c;
}
}
}
diff --git a/src/move.c b/src/move.c
index 42f778438..e84f3d57e 100644
--- a/src/move.c
+++ b/src/move.c
@@ -23,8 +23,7 @@ static void comp_botline __ARGS((win_T *wp));
static void redraw_for_cursorline __ARGS((win_T *wp));
static int scrolljump_value __ARGS((void));
static int check_top_offset __ARGS((void));
-static void curs_rows __ARGS((win_T *wp, int do_botline));
-static void validate_botline_win __ARGS((win_T *wp));
+static void curs_rows __ARGS((win_T *wp));
static void validate_cheight __ARGS((void));
typedef struct
@@ -183,6 +182,18 @@ update_topline()
if (!screen_valid(TRUE))
return;
+ /* If the window height is zero just use the cursor line. */
+ if (curwin->w_height == 0)
+ {
+ 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;
+ }
+
check_cursor_moved(curwin);
if (curwin->w_valid & VALID_TOPLINE)
return;
@@ -597,17 +608,6 @@ validate_botline()
}
/*
- * Make sure the value of wp->w_botline is valid.
- */
- static void
-validate_botline_win(wp)
- win_T *wp;
-{
- if (!(wp->w_valid & VALID_BOTLINE))
- comp_botline(wp);
-}
-
-/*
* Mark curwin->w_botline as invalid (because of some change in the buffer).
*/
void
@@ -666,20 +666,17 @@ validate_cline_row()
update_topline();
check_cursor_moved(curwin);
if (!(curwin->w_valid & VALID_CROW))
- curs_rows(curwin, FALSE);
+ curs_rows(curwin);
}
#endif
/*
* Compute wp->w_cline_row and wp->w_cline_height, based on the current value
* of wp->w_topline.
- *
- * Returns OK when cursor is in the window, FAIL when it isn't.
*/
static void
-curs_rows(wp, do_botline)
+curs_rows(wp)
win_T *wp;
- int do_botline; /* also compute w_botline */
{
linenr_T lnum;
int i;
@@ -798,9 +795,6 @@ curs_rows(wp, do_botline)
redraw_for_cursorline(curwin);
wp->w_valid |= VALID_CROW|VALID_CHEIGHT;
- /* validate botline too, if update_screen doesn't do it */
- if (do_botline && all_invalid)
- validate_botline_win(wp);
}
/*
@@ -974,7 +968,7 @@ curs_columns(may_scroll)
* Next make sure that w_cline_row is valid.
*/
if (!(curwin->w_valid & VALID_CROW))
- curs_rows(curwin, FALSE);
+ curs_rows(curwin);
/*
* Compute the number of virtual columns.
diff --git a/src/normal.c b/src/normal.c
index e5fa1401c..bd5bacd59 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -1076,7 +1076,10 @@ getcount:
#ifdef FEAT_MBYTE
/* When getting a text character and the next character is a
* multi-byte character, it could be a composing character.
- * However, don't wait for it to arrive. */
+ * However, don't wait for it to arrive. Also, do enable mapping,
+ * because if it's put back with vungetc() it's too late to apply
+ * mapping. */
+ --no_mapping;
while (enc_utf8 && lang && (c = vpeekc()) > 0
&& (c >= 0x100 || MB_BYTE2LEN(vpeekc()) > 1))
{
@@ -1091,6 +1094,7 @@ getcount:
else
ca.ncharC2 = c;
}
+ ++no_mapping;
#endif
}
--no_mapping;
@@ -1376,6 +1380,9 @@ do_pending_operator(cap, old_col, gui_yank)
pos_T old_cursor;
int empty_region_error;
int restart_edit_save;
+#ifdef FEAT_LINEBREAK
+ int lbr_saved = curwin->w_p_lbr;
+#endif
/* The visual area is remembered for redo */
static int redo_VIsual_mode = NUL; /* 'v', 'V', or Ctrl-V */
@@ -1386,6 +1393,10 @@ do_pending_operator(cap, old_col, gui_yank)
int include_line_break = FALSE;
#endif
+#ifdef FEAT_LINEBREAK
+ curwin->w_p_lbr = FALSE; /* Avoid a problem with unwanted linebreaks in
+ * block mode. */
+#endif
#if defined(FEAT_CLIPBOARD)
/*
* Yank the visual area into the GUI selection register before we operate
@@ -2132,6 +2143,9 @@ do_pending_operator(cap, old_col, gui_yank)
oap->block_mode = FALSE;
clearop(oap);
}
+#ifdef FEAT_LINEBREAK
+ curwin->w_p_lbr = lbr_saved;
+#endif
}
/*
@@ -4505,13 +4519,21 @@ nv_screengo(oap, dir, dist)
#if defined(FEAT_LINEBREAK) || defined(FEAT_MBYTE)
if (curwin->w_cursor.col > 0 && curwin->w_p_wrap)
{
+ colnr_T virtcol;
+
/*
* Check for landing on a character that got split at the end of the
* last line. We want to advance a screenline, not end up in the same
* screenline or move two screenlines.
*/
validate_virtcol();
- if (curwin->w_virtcol > curwin->w_curswant
+ virtcol = curwin->w_virtcol;
+# if defined(FEAT_LINEBREAK)
+ if (virtcol > (colnr_T)width1 && *p_sbr != NUL)
+ virtcol -= vim_strsize(p_sbr);
+# endif
+
+ if (virtcol > curwin->w_curswant
&& (curwin->w_curswant < (colnr_T)width1
? (curwin->w_curswant > (colnr_T)width1 / 2)
: ((curwin->w_curswant - width1) % width2
@@ -9262,7 +9284,7 @@ nv_put(cap)
if (cap->oap->op_type == OP_DELETE && cap->cmdchar == 'p')
{
clearop(cap->oap);
- nv_diffgetput(TRUE);
+ nv_diffgetput(TRUE, cap->opcount);
}
else
#endif
@@ -9385,7 +9407,7 @@ nv_open(cap)
if (cap->oap->op_type == OP_DELETE && cap->cmdchar == 'o')
{
clearop(cap->oap);
- nv_diffgetput(FALSE);
+ nv_diffgetput(FALSE, cap->opcount);
}
else
#endif
diff --git a/src/ops.c b/src/ops.c
index 265cf3a85..0c3d11b87 100644
--- a/src/ops.c
+++ b/src/ops.c
@@ -609,6 +609,26 @@ block_insert(oap, s, b_insert, bdp)
}
}
+#ifdef FEAT_MBYTE
+ if (has_mbyte && spaces > 0)
+ {
+ int off;
+
+ /* Avoid starting halfway a multi-byte character. */
+ if (b_insert)
+ {
+ off = (*mb_head_off)(oldp, oldp + offset + spaces);
+ }
+ else
+ {
+ off = (*mb_off_next)(oldp, oldp + offset);
+ offset += off;
+ }
+ spaces -= off;
+ count -= off;
+ }
+#endif
+
newp = alloc_check((unsigned)(STRLEN(oldp)) + s_len + count + 1);
if (newp == NULL)
continue;
@@ -1597,9 +1617,15 @@ adjust_clip_reg(rp)
{
/* If no reg. specified, and "unnamed" or "unnamedplus" is in 'clipboard',
* use '*' or '+' reg, respectively. "unnamedplus" prevails. */
- if (*rp == 0 && clip_unnamed != 0)
- *rp = ((clip_unnamed & CLIP_UNNAMED_PLUS) && clip_plus.available)
+ if (*rp == 0 && (clip_unnamed != 0 || clip_unnamed_saved != 0))
+ {
+ if (clip_unnamed != 0)
+ *rp = ((clip_unnamed & CLIP_UNNAMED_PLUS) && clip_plus.available)
? '+' : '*';
+ else
+ *rp = ((clip_unnamed_saved & CLIP_UNNAMED_PLUS) && clip_plus.available)
+ ? '+' : '*';
+ }
if (!clip_star.available && *rp == '*')
*rp = 0;
if (!clip_plus.available && *rp == '+')
@@ -3203,7 +3229,7 @@ op_yank(oap, deleting, mess)
if (clip_star.available
&& (curr == &(y_regs[STAR_REGISTER])
|| (!deleting && oap->regname == 0
- && (clip_unnamed & CLIP_UNNAMED))))
+ && ((clip_unnamed | clip_unnamed_saved) & CLIP_UNNAMED))))
{
if (curr != &(y_regs[STAR_REGISTER]))
/* Copy the text from register 0 to the clipboard register. */
@@ -3224,7 +3250,8 @@ op_yank(oap, deleting, mess)
if (clip_plus.available
&& (curr == &(y_regs[PLUS_REGISTER])
|| (!deleting && oap->regname == 0
- && (clip_unnamed & CLIP_UNNAMED_PLUS))))
+ && ((clip_unnamed | clip_unnamed_saved) &
+ CLIP_UNNAMED_PLUS))))
{
if (curr != &(y_regs[PLUS_REGISTER]))
/* Copy the text from register 0 to the clipboard register. */
@@ -3804,6 +3831,9 @@ do_put(regname, dir, count, flags)
lnum++;
} while (VIsual_active && lnum <= curbuf->b_visual.vi_end.lnum);
+ if (VIsual_active) /* reset lnum to the last visual line */
+ lnum--;
+
curbuf->b_op_end = curwin->w_cursor;
/* For "CTRL-O p" in Insert mode, put cursor after last char */
if (totlen && (restart_edit != 0 || (flags & PUT_CURSEND)))
@@ -5633,6 +5663,8 @@ read_viminfo_register(virp, force)
int set_prev = FALSE;
char_u *str;
char_u **array = NULL;
+ int new_type;
+ colnr_T new_width;
/* We only get here (hopefully) if line[0] == '"' */
str = virp->vir_line + 1;
@@ -5665,21 +5697,25 @@ read_viminfo_register(virp, force)
limit = 100; /* Optimized for registers containing <= 100 lines */
if (do_it)
{
+ /*
+ * Build the new register in array[].
+ * y_array is kept as-is until done.
+ * The "do_it" flag is reset when something is wrong, in which case
+ * array[] needs to be freed.
+ */
if (set_prev)
y_previous = y_current;
- vim_free(y_current->y_array);
- array = y_current->y_array =
- (char_u **)alloc((unsigned)(limit * sizeof(char_u *)));
+ array = (char_u **)alloc((unsigned)(limit * sizeof(char_u *)));
str = skipwhite(skiptowhite(str));
if (STRNCMP(str, "CHAR", 4) == 0)
- y_current->y_type = MCHAR;
+ new_type = MCHAR;
else if (STRNCMP(str, "BLOCK", 5) == 0)
- y_current->y_type = MBLOCK;
+ new_type = MBLOCK;
else
- y_current->y_type = MLINE;
+ new_type = MLINE;
/* get the block width; if it's missing we get a zero, which is OK */
str = skipwhite(skiptowhite(str));
- y_current->y_width = getdigits(&str);
+ new_width = getdigits(&str);
}
while (!(eof = viminfo_readline(virp))
@@ -5687,40 +5723,66 @@ read_viminfo_register(virp, force)
{
if (do_it)
{
- if (size >= limit)
+ if (size == limit)
{
- y_current->y_array = (char_u **)
+ char_u **new_array = (char_u **)
alloc((unsigned)(limit * 2 * sizeof(char_u *)));
+
+ if (new_array == NULL)
+ {
+ do_it = FALSE;
+ break;
+ }
for (i = 0; i < limit; i++)
- y_current->y_array[i] = array[i];
+ new_array[i] = array[i];
vim_free(array);
+ array = new_array;
limit *= 2;
- array = y_current->y_array;
}
str = viminfo_readstring(virp, 1, TRUE);
if (str != NULL)
array[size++] = str;
else
+ /* error, don't store the result */
do_it = FALSE;
}
}
if (do_it)
{
+ /* free y_array[] */
+ for (i = 0; i < y_current->y_size; i++)
+ vim_free(y_current->y_array[i]);
+ vim_free(y_current->y_array);
+
+ y_current->y_type = new_type;
+ y_current->y_width = new_width;
+ y_current->y_size = size;
if (size == 0)
{
- vim_free(array);
y_current->y_array = NULL;
}
- else if (size < limit)
+ else
{
+ /* Move the lines from array[] to y_array[]. */
y_current->y_array =
(char_u **)alloc((unsigned)(size * sizeof(char_u *)));
for (i = 0; i < size; i++)
- y_current->y_array[i] = array[i];
- vim_free(array);
+ {
+ if (y_current->y_array == NULL)
+ vim_free(array[i]);
+ else
+ y_current->y_array[i] = array[i];
+ }
}
- y_current->y_size = size;
}
+ else
+ {
+ /* Free array[] if it was filled. */
+ for (i = 0; i < size; i++)
+ vim_free(array[i]);
+ }
+ vim_free(array);
+
return eof;
}
diff --git a/src/option.c b/src/option.c
index 05d8869ea..3195fa8d9 100644
--- a/src/option.c
+++ b/src/option.c
@@ -56,6 +56,7 @@
*/
#define PV_AI OPT_BUF(BV_AI)
#define PV_AR OPT_BOTH(OPT_BUF(BV_AR))
+#define PV_BKC OPT_BOTH(OPT_BUF(BV_BKC))
#ifdef FEAT_QUICKFIX
# define PV_BH OPT_BUF(BV_BH)
# define PV_BT OPT_BUF(BV_BT)
@@ -582,7 +583,7 @@ static struct vimoption
(char_u *)&p_bk, PV_NONE,
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
{"backupcopy", "bkc", P_STRING|P_VIM|P_COMMA|P_NODUP,
- (char_u *)&p_bkc, PV_NONE,
+ (char_u *)&p_bkc, PV_BKC,
#ifdef UNIX
{(char_u *)"yes", (char_u *)"auto"}
#else
@@ -1690,6 +1691,13 @@ static struct vimoption
(char_u *)NULL, PV_NONE,
#endif
{(char_u *)"", (char_u *)0L} SCRIPTID_INIT},
+ {"langnoremap", "lnr", P_BOOL|P_VI_DEF,
+#ifdef FEAT_LANGMAP
+ (char_u *)&p_lnr, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
{"laststatus", "ls", P_NUM|P_VI_DEF|P_RALL,
#ifdef FEAT_WINDOWS
(char_u *)&p_ls, PV_NONE,
@@ -2124,6 +2132,15 @@ static struct vimoption
{"remap", NULL, P_BOOL|P_VI_DEF,
(char_u *)&p_remap, PV_NONE,
{(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT},
+ {"renderoptions", "rop", P_STRING|P_COMMA|P_RCLR|P_VI_DEF,
+#ifdef FEAT_RENDER_OPTIONS
+ (char_u *)&p_rop, PV_NONE,
+ {(char_u *)"", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)NULL, (char_u *)0L}
+#endif
+ SCRIPTID_INIT},
{"report", NULL, P_NUM|P_VI_DEF,
(char_u *)&p_report, PV_NONE,
{(char_u *)2L, (char_u *)0L} SCRIPTID_INIT},
@@ -2980,7 +2997,7 @@ static char *(p_bg_values[]) = {"light", "dark", NULL};
static char *(p_nf_values[]) = {"octal", "hex", "alpha", NULL};
static char *(p_ff_values[]) = {FF_UNIX, FF_DOS, FF_MAC, NULL};
#ifdef FEAT_CRYPT
-static char *(p_cm_values[]) = {"zip", "blowfish", NULL};
+static char *(p_cm_values[]) = {"zip", "blowfish", "blowfish2", NULL};
#endif
#ifdef FEAT_CMDL_COMPL
static char *(p_wop_values[]) = {"tagfile", NULL};
@@ -3088,6 +3105,9 @@ static void fill_breakat_flags __ARGS((void));
static int opt_strings_flags __ARGS((char_u *val, char **values, unsigned *flagp, int list));
static int check_opt_strings __ARGS((char_u *val, char **values, int));
static int check_opt_wim __ARGS((void));
+#ifdef FEAT_LINEBREAK
+static int briopt_check __ARGS((win_T *wp));
+#endif
/*
* Initialize the options, first part.
@@ -3633,6 +3653,9 @@ set_options_default(opt_flags)
#else
win_comp_scroll(curwin);
#endif
+#ifdef FEAT_CINDENT
+ parse_cino(curbuf);
+#endif
}
/*
@@ -5280,7 +5303,7 @@ didset_options()
(void)check_cedit();
#endif
#ifdef FEAT_LINEBREAK
- briopt_check();
+ briopt_check(curwin);
#endif
}
@@ -5397,6 +5420,7 @@ check_buf_options(buf)
#ifdef FEAT_LISP
check_string_option(&buf->b_p_lw);
#endif
+ check_string_option(&buf->b_p_bkc);
}
/*
@@ -5551,6 +5575,7 @@ set_string_option_direct(name, opt_idx, val, opt_flags, set_sid)
if (idx < 0) /* not found (should not happen) */
{
EMSG2(_(e_intern2), "set_string_option_direct()");
+ EMSG2(_("For option %s"), name);
return;
}
}
@@ -5714,17 +5739,32 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
}
/* 'backupcopy' */
- else if (varp == &p_bkc)
+ else if (gvarp == &p_bkc)
{
- if (opt_strings_flags(p_bkc, p_bkc_values, &bkc_flags, TRUE) != OK)
- errmsg = e_invarg;
- if (((bkc_flags & BKC_AUTO) != 0)
- + ((bkc_flags & BKC_YES) != 0)
- + ((bkc_flags & BKC_NO) != 0) != 1)
+ char_u *bkc = p_bkc;
+ unsigned int *flags = &bkc_flags;
+
+ if (opt_flags & OPT_LOCAL)
{
- /* Must have exactly one of "auto", "yes" and "no". */
- (void)opt_strings_flags(oldval, p_bkc_values, &bkc_flags, TRUE);
- errmsg = e_invarg;
+ bkc = curbuf->b_p_bkc;
+ flags = &curbuf->b_bkc_flags;
+ }
+
+ if ((opt_flags & OPT_LOCAL) && *bkc == NUL)
+ /* make the local value empty: use the global value */
+ *flags = 0;
+ else
+ {
+ if (opt_strings_flags(bkc, p_bkc_values, flags, TRUE) != OK)
+ errmsg = e_invarg;
+ if ((((int)*flags & BKC_AUTO) != 0)
+ + (((int)*flags & BKC_YES) != 0)
+ + (((int)*flags & BKC_NO) != 0) != 1)
+ {
+ /* Must have exactly one of "auto", "yes" and "no". */
+ (void)opt_strings_flags(oldval, p_bkc_values, flags, TRUE);
+ errmsg = e_invarg;
+ }
}
}
@@ -5739,7 +5779,7 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
/* 'breakindentopt' */
else if (varp == &curwin->w_p_briopt)
{
- if (briopt_check() == FAIL)
+ if (briopt_check(curwin) == FAIL)
errmsg = e_invarg;
}
#endif
@@ -6131,7 +6171,7 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
# endif
if (STRCMP(curbuf->b_p_key, oldval) != 0)
/* Need to update the swapfile. */
- ml_set_crypt_key(curbuf, oldval, get_crypt_method(curbuf));
+ ml_set_crypt_key(curbuf, oldval, crypt_get_method_nr(curbuf));
}
else if (gvarp == &p_cm)
@@ -6142,7 +6182,7 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
p = p_cm;
if (check_opt_strings(p, p_cm_values, TRUE) != OK)
errmsg = e_invarg;
- else if (get_crypt_method(curbuf) > 0 && blowfish_self_test() == FAIL)
+ else if (crypt_self_test() == FAIL)
errmsg = e_invarg;
else
{
@@ -6154,6 +6194,14 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
p_cm = vim_strsave((char_u *)"zip");
new_value_alloced = TRUE;
}
+ /* When using ":set cm=name" the local value is going to be empty.
+ * Do that here, otherwise the crypt functions will still use the
+ * local value. */
+ if ((opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0)
+ {
+ free_string_option(curbuf->b_p_cm);
+ curbuf->b_p_cm = empty_option;
+ }
/* Need to update the swapfile when the effective method changed.
* Set "s" to the effective old value, "p" to the effective new
@@ -6168,7 +6216,7 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
p = curbuf->b_p_cm;
if (STRCMP(s, p) != 0)
ml_set_crypt_key(curbuf, curbuf->b_p_key,
- crypt_method_from_string(s));
+ crypt_method_nr_from_name(s));
/* If the global value changes need to update the swapfile for all
* buffers using that value. */
@@ -6179,7 +6227,7 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
for (buf = firstbuf; buf != NULL; buf = buf->b_next)
if (buf != curbuf && *buf->b_p_cm == NUL)
ml_set_crypt_key(buf, buf->b_p_key,
- crypt_method_from_string(oldval));
+ crypt_method_nr_from_name(oldval));
}
}
}
@@ -6659,15 +6707,16 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
#ifdef FEAT_SPELL
/* When 'spelllang' or 'spellfile' is set and there is a window for this
* buffer in which 'spell' is set load the wordlists. */
- else if (varp == &(curbuf->b_s.b_p_spl) || varp == &(curbuf->b_s.b_p_spf))
+ else if (varp == &(curwin->w_s->b_p_spl)
+ || varp == &(curwin->w_s->b_p_spf))
{
win_T *wp;
int l;
- if (varp == &(curbuf->b_s.b_p_spf))
+ if (varp == &(curwin->w_s->b_p_spf))
{
- l = (int)STRLEN(curbuf->b_s.b_p_spf);
- if (l > 0 && (l < 4 || STRCMP(curbuf->b_s.b_p_spf + l - 4,
+ l = (int)STRLEN(curwin->w_s->b_p_spf);
+ if (l > 0 && (l < 4 || STRCMP(curwin->w_s->b_p_spf + l - 4,
".add") != 0))
errmsg = e_invarg;
}
@@ -6999,6 +7048,14 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
}
#endif
+#if defined(FEAT_RENDER_OPTIONS)
+ else if (varp == &p_rop && gui.in_use)
+ {
+ if (!gui_mch_set_rendering_options(p_rop))
+ errmsg = e_invarg;
+ }
+#endif
+
/* Options that are a list of flags. */
else
{
@@ -8994,12 +9051,13 @@ get_option_value_strict(name, numval, stringval, opt_type, from)
}
/*
- * Iterate over options. First argument is a pointer to a pointer to a structure
- * inside options[] array, second is option type like in the above function.
+ * Iterate over options. First argument is a pointer to a pointer to a
+ * structure inside options[] array, second is option type like in the above
+ * function.
*
- * If first argument points to NULL it is assumed that iteration just started
+ * If first argument points to NULL it is assumed that iteration just started
* and caller needs the very first value.
- * If first argument points to the end marker function returns NULL and sets
+ * If first argument points to the end marker function returns NULL and sets
* first argument to NULL.
*
* Returns full option name for current option on each call.
@@ -9825,6 +9883,10 @@ unset_global_local_option(name, from)
case PV_AR:
buf->b_p_ar = -1;
break;
+ case PV_BKC:
+ clear_string_option(&buf->b_p_bkc);
+ buf->b_bkc_flags = 0;
+ break;
case PV_TAGS:
clear_string_option(&buf->b_p_tags);
break;
@@ -9930,6 +9992,7 @@ get_varp_scope(p, opt_flags)
#ifdef FEAT_LISP
case PV_LW: return (char_u *)&(curbuf->b_p_lw);
#endif
+ case PV_BKC: return (char_u *)&(curbuf->b_p_bkc);
}
return NULL; /* "cannot happen" */
}
@@ -9962,6 +10025,8 @@ get_varp(p)
? (char_u *)&(curbuf->b_p_ar) : p->var;
case PV_TAGS: return *curbuf->b_p_tags != NUL
? (char_u *)&(curbuf->b_p_tags) : p->var;
+ case PV_BKC: return *curbuf->b_p_bkc != NUL
+ ? (char_u *)&(curbuf->b_p_bkc) : p->var;
#ifdef FEAT_FIND_ID
case PV_DEF: return *curbuf->b_p_def != NUL
? (char_u *)&(curbuf->b_p_def) : p->var;
@@ -10207,6 +10272,9 @@ win_copy_options(wp_from, wp_to)
wp_to->w_farsi = wp_from->w_farsi;
# endif
# endif
+#if defined(FEAT_LINEBREAK)
+ briopt_check(wp_to);
+#endif
}
#endif
@@ -10551,6 +10619,8 @@ buf_copy_options(buf, flags)
* are not copied, start using the global value */
buf->b_p_ar = -1;
buf->b_p_ul = NO_LOCAL_UNDOLEVEL;
+ buf->b_p_bkc = empty_option;
+ buf->b_bkc_flags = 0;
#ifdef FEAT_QUICKFIX
buf->b_p_gp = empty_option;
buf->b_p_mp = empty_option;
@@ -11977,15 +12047,16 @@ find_mps_values(initc, findc, backwards, switchit)
* This is called when 'breakindentopt' is changed and when a window is
* initialized.
*/
- int
-briopt_check()
+ static int
+briopt_check(wp)
+ win_T *wp;
{
char_u *p;
int bri_shift = 0;
long bri_min = 20;
int bri_sbr = FALSE;
- p = curwin->w_p_briopt;
+ p = wp->w_p_briopt;
while (*p != NUL)
{
if (STRNCMP(p, "shift:", 6) == 0
@@ -12010,10 +12081,20 @@ briopt_check()
++p;
}
- curwin->w_p_brishift = bri_shift;
- curwin->w_p_brimin = bri_min;
- curwin->w_p_brisbr = bri_sbr;
+ wp->w_p_brishift = bri_shift;
+ wp->w_p_brimin = bri_min;
+ wp->w_p_brisbr = bri_sbr;
return OK;
}
#endif
+
+/*
+ * Get the local or global value of 'backupcopy'.
+ */
+ unsigned int
+get_bkc_value(buf)
+ buf_T *buf;
+{
+ return buf->b_bkc_flags ? buf->b_bkc_flags : bkc_flags;
+}
diff --git a/src/option.h b/src/option.h
index edf905844..b03146676 100644
--- a/src/option.h
+++ b/src/option.h
@@ -327,7 +327,7 @@ EXTERN char_u *p_bs; /* 'backspace' */
EXTERN char_u *p_bg; /* 'background' */
EXTERN int p_bk; /* 'backup' */
EXTERN char_u *p_bkc; /* 'backupcopy' */
-EXTERN unsigned bkc_flags;
+EXTERN unsigned bkc_flags; /* flags from 'backupcopy' */
#ifdef IN_OPTION_C
static char *(p_bkc_values[]) = {"yes", "auto", "no", "breaksymlink", "breakhardlink", NULL};
#endif
@@ -576,6 +576,7 @@ EXTERN char_u *p_kp; /* 'keywordprg' */
EXTERN char_u *p_km; /* 'keymodel' */
#ifdef FEAT_LANGMAP
EXTERN char_u *p_langmap; /* 'langmap'*/
+EXTERN int p_lnr; /* 'langnoremap' */
#endif
#if defined(FEAT_MENU) && defined(FEAT_MULTI_LANG)
EXTERN char_u *p_lm; /* 'langmenu' */
@@ -655,6 +656,9 @@ EXTERN long p_rdt; /* 'redrawtime' */
#endif
EXTERN int p_remap; /* 'remap' */
EXTERN long p_re; /* 'regexpengine' */
+#ifdef FEAT_RENDER_OPTIONS
+EXTERN char_u *p_rop; /* 'renderoptions' */
+#endif
EXTERN long p_report; /* 'report' */
#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
EXTERN long p_pvh; /* 'previewheight' */
@@ -915,6 +919,9 @@ enum
, BV_AR
#ifdef FEAT_QUICKFIX
, BV_BH
+#endif
+ , BV_BKC
+#ifdef FEAT_QUICKFIX
, BV_BT
, BV_EFM
, BV_GP
diff --git a/src/os_mswin.c b/src/os_mswin.c
index 871afad9d..b50b86c88 100644
--- a/src/os_mswin.c
+++ b/src/os_mswin.c
@@ -277,10 +277,6 @@ mch_early_init(void)
AnsiUpperBuff(toupper_tab, 256);
AnsiLowerBuff(tolower_tab, 256);
#endif
-
-#if defined(FEAT_MBYTE) && !defined(FEAT_GUI)
- (void)get_cmd_argsW(NULL);
-#endif
}
@@ -348,7 +344,7 @@ mch_restore_title(
int which)
{
#ifndef FEAT_GUI_MSWIN
- mch_settitle((which & 1) ? g_szOrigTitle : NULL, NULL);
+ SetConsoleTitle(g_szOrigTitle);
#endif
}
@@ -415,7 +411,7 @@ mch_FullName(
* - convert the result from UCS2 to 'encoding'.
*/
wname = enc_to_utf16(fname, NULL);
- if (wname != NULL && _wfullpath(wbuf, wname, MAX_PATH - 1) != NULL)
+ if (wname != NULL && _wfullpath(wbuf, wname, MAX_PATH) != NULL)
{
cname = utf16_to_enc((short_u *)wbuf, NULL);
if (cname != NULL)
@@ -932,6 +928,33 @@ check_str_len(char_u *str)
}
# endif
+/*
+ * Passed to do_in_runtimepath() to load a vim.ico file.
+ */
+ static void
+mch_icon_load_cb(char_u *fname, void *cookie)
+{
+ HANDLE *h = (HANDLE *)cookie;
+
+ *h = LoadImage(NULL,
+ fname,
+ IMAGE_ICON,
+ 64,
+ 64,
+ LR_LOADFROMFILE | LR_LOADMAP3DCOLORS);
+}
+
+/*
+ * Try loading an icon file from 'runtimepath'.
+ */
+ int
+mch_icon_load(iconp)
+ HANDLE *iconp;
+{
+ return do_in_runtimepath((char_u *)"bitmaps/vim.ico",
+ FALSE, mch_icon_load_cb, iconp);
+}
+
int
mch_libcall(
char_u *libname,
@@ -1612,11 +1635,34 @@ mch_print_init(prt_settings_T *psettings, char_u *jobname, int forceit)
char_u *printer_name = (char_u *)devname + devname->wDeviceOffset;
char_u *port_name = (char_u *)devname +devname->wOutputOffset;
char_u *text = _("to %s on %s");
+#ifdef FEAT_MBYTE
+ char_u *printer_name_orig = printer_name;
+ char_u *port_name_orig = port_name;
+ if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
+ {
+ char_u *to_free = NULL;
+ int maxlen;
+
+ acp_to_enc(printer_name, (int)STRLEN(printer_name), &to_free,
+ &maxlen);
+ if (to_free != NULL)
+ printer_name = to_free;
+ acp_to_enc(port_name, (int)STRLEN(port_name), &to_free, &maxlen);
+ if (to_free != NULL)
+ port_name = to_free;
+ }
+#endif
prt_name = alloc((unsigned)(STRLEN(printer_name) + STRLEN(port_name)
+ STRLEN(text)));
if (prt_name != NULL)
wsprintf(prt_name, text, printer_name, port_name);
+#ifdef FEAT_MBYTE
+ if (printer_name != printer_name_orig)
+ vim_free(printer_name);
+ if (port_name != port_name_orig)
+ vim_free(port_name);
+#endif
}
GlobalUnlock(prt_dlg.hDevNames);
@@ -1650,16 +1696,22 @@ mch_print_init(prt_settings_T *psettings, char_u *jobname, int forceit)
*/
psettings->chars_per_line = prt_get_cpl();
psettings->lines_per_page = prt_get_lpp();
- psettings->n_collated_copies = (prt_dlg.Flags & PD_COLLATE)
- ? prt_dlg.nCopies : 1;
- psettings->n_uncollated_copies = (prt_dlg.Flags & PD_COLLATE)
- ? 1 : prt_dlg.nCopies;
+ if (prt_dlg.Flags & PD_USEDEVMODECOPIESANDCOLLATE)
+ {
+ psettings->n_collated_copies = (prt_dlg.Flags & PD_COLLATE)
+ ? prt_dlg.nCopies : 1;
+ psettings->n_uncollated_copies = (prt_dlg.Flags & PD_COLLATE)
+ ? 1 : prt_dlg.nCopies;
- if (psettings->n_collated_copies == 0)
- psettings->n_collated_copies = 1;
+ if (psettings->n_collated_copies == 0)
+ psettings->n_collated_copies = 1;
- if (psettings->n_uncollated_copies == 0)
+ if (psettings->n_uncollated_copies == 0)
+ psettings->n_uncollated_copies = 1;
+ } else {
+ psettings->n_collated_copies = 1;
psettings->n_uncollated_copies = 1;
+ }
psettings->jobname = jobname;
diff --git a/src/os_unix.c b/src/os_unix.c
index 033ce3cc3..bcf11ddc7 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -1586,12 +1586,15 @@ x_IOerror_check(dpy)
* An X IO Error handler, used to catch terminal errors.
*/
static int x_IOerror_handler __ARGS((Display *dpy));
+static void may_restore_clipboard __ARGS((void));
+static int xterm_dpy_was_reset = FALSE;
static int
x_IOerror_handler(dpy)
Display *dpy UNUSED;
{
xterm_dpy = NULL;
+ xterm_dpy_was_reset = TRUE;
x11_window = 0;
x11_display = NULL;
xterm_Shell = (Widget)0;
@@ -1602,6 +1605,33 @@ x_IOerror_handler(dpy)
return 0; /* avoid the compiler complains about missing return value */
# endif
}
+
+/*
+ * If the X11 connection was lost try to restore it.
+ * Helps when the X11 server was stopped and restarted while Vim was inactive
+ * (e.g. through tmux).
+ */
+ static void
+may_restore_clipboard()
+{
+ if (xterm_dpy_was_reset)
+ {
+ xterm_dpy_was_reset = FALSE;
+
+# ifndef LESSTIF_VERSION
+ /* This has been reported to avoid Vim getting stuck. */
+ if (app_context != (XtAppContext)NULL)
+ {
+ XtDestroyApplicationContext(app_context);
+ app_context = (XtAppContext)NULL;
+ x11_display = NULL; /* freed by XtDestroyApplicationContext() */
+ }
+# endif
+
+ setup_term_clip();
+ get_x11_title(FALSE);
+ }
+}
#endif
/*
@@ -1610,8 +1640,6 @@ x_IOerror_handler(dpy)
static int
x_connect_to_server()
{
- regmatch_T regmatch;
-
#if defined(FEAT_CLIENTSERVER)
if (x_force_connect)
return TRUE;
@@ -1622,9 +1650,7 @@ x_connect_to_server()
/* Check for a match with "exclude:" from 'clipboard'. */
if (clip_exclude_prog != NULL)
{
- regmatch.rm_ic = FALSE; /* Don't ignore case */
- regmatch.regprog = clip_exclude_prog;
- if (vim_regexec(&regmatch, T_NAME, (colnr_T)0))
+ if (vim_regexec_prog(&clip_exclude_prog, FALSE, T_NAME, (colnr_T)0))
return FALSE;
}
return TRUE;
@@ -1960,9 +1986,12 @@ get_x11_thing(get_title, test_only)
return retval;
}
-/* Are Xutf8 functions available? Avoid error from old compilers. */
+/* Xutf8 functions are not avaialble on older systems. Note that on some
+ * systems X_HAVE_UTF8_STRING may be defined in a header file but
+ * Xutf8SetWMProperties() is not in the X11 library. Configure checks for
+ * that and defines HAVE_XUTF8SETWMPROPERTIES. */
#if defined(X_HAVE_UTF8_STRING) && defined(FEAT_MBYTE)
-# if X_HAVE_UTF8_STRING
+# if X_HAVE_UTF8_STRING && HAVE_XUTF8SETWMPROPERTIES
# define USE_UTF8_STRING
# endif
#endif
@@ -3667,8 +3696,6 @@ mch_setmouse(on)
void
check_mouse_termcode()
{
- xterm_conflict_mouse = FALSE;
-
# ifdef FEAT_MOUSE_XTERM
if (use_xterm_mouse()
# ifdef FEAT_MOUSE_URXVT
@@ -3713,7 +3740,7 @@ check_mouse_termcode()
# endif
# ifdef FEAT_MOUSE_JSB
- /* There is no conflict, but it was disabled for xterm before. */
+ /* Conflicts with xterm mouse: "\033[" and "\033[M" ??? */
if (!use_xterm_mouse()
# ifdef FEAT_GUI
&& !gui.in_use
@@ -3740,45 +3767,31 @@ check_mouse_termcode()
# endif
# ifdef FEAT_MOUSE_DEC
- /* Conflicts with xterm mouse: "\033[" and "\033[M".
- * Also conflicts with the xterm termresponse, skip this if it was
- * requested already. */
+ /* Conflicts with xterm mouse: "\033[" and "\033[M" */
if (!use_xterm_mouse()
-# ifdef FEAT_TERMRESPONSE
- && !did_request_esc_sequence()
-# endif
# ifdef FEAT_GUI
&& !gui.in_use
# endif
)
- {
set_mouse_termcode(KS_DEC_MOUSE, (char_u *)(term_is_8bit(T_NAME)
? IF_EB("\233", CSI_STR) : IF_EB("\033[", ESC_STR "[")));
- xterm_conflict_mouse = TRUE;
- }
else
del_mouse_termcode(KS_DEC_MOUSE);
# endif
# ifdef FEAT_MOUSE_PTERM
- /* same as the dec mouse */
+ /* same conflict as the dec mouse */
if (!use_xterm_mouse()
-# ifdef FEAT_TERMRESPONSE
- && !did_request_esc_sequence()
-# endif
# ifdef FEAT_GUI
&& !gui.in_use
# endif
)
- {
set_mouse_termcode(KS_PTERM_MOUSE,
(char_u *) IF_EB("\033[", ESC_STR "["));
- xterm_conflict_mouse = TRUE;
- }
else
del_mouse_termcode(KS_PTERM_MOUSE);
# endif
# ifdef FEAT_MOUSE_URXVT
- /* same as the dec mouse */
+ /* same conflict as the dec mouse */
if (use_xterm_mouse() == 3
# ifdef FEAT_GUI
&& !gui.in_use
@@ -3794,8 +3807,6 @@ check_mouse_termcode()
mch_setmouse(FALSE);
setmouse();
}
- /* It's OK to request the xterm version for uxterm. */
- resume_get_esc_sequence();
}
else
del_mouse_termcode(KS_URXVT_MOUSE);
@@ -5293,6 +5304,7 @@ RealWaitForChar(fd, msec, check_for_gpm)
}
# endif
# ifdef FEAT_XCLIPBOARD
+ may_restore_clipboard();
if (xterm_Shell != (Widget)0)
{
xterm_idx = nfd;
@@ -5445,6 +5457,7 @@ select_eintr:
}
# endif
# ifdef FEAT_XCLIPBOARD
+ may_restore_clipboard();
if (xterm_Shell != (Widget)0)
{
FD_SET(ConnectionNumber(xterm_dpy), &rfds);
@@ -5957,10 +5970,12 @@ mch_expand_wildcards(num_pat, pat, num_file, file, flags)
*p++ = '\\';
++j;
}
- else if (!intick && vim_strchr(SHELL_SPECIAL,
- pat[i][j]) != NULL)
+ else if (!intick
+ && ((flags & EW_KEEPDOLLAR) == 0 || pat[i][j] != '$')
+ && vim_strchr(SHELL_SPECIAL, pat[i][j]) != NULL)
/* Put a backslash before a special character, but not
- * when inside ``. */
+ * when inside ``. And not for $var when EW_KEEPDOLLAR is
+ * set. */
*p++ = '\\';
/* Copy one character. */
diff --git a/src/os_vms.c b/src/os_vms.c
index 55876b27f..12eceedd0 100644
--- a/src/os_vms.c
+++ b/src/os_vms.c
@@ -12,7 +12,7 @@
#include "vim.h"
/* define _generic_64 for use in time functions */
-#ifndef VAX
+#if !defined(VAX) && !defined(PROTO)
# include <gen64def.h>
#else
/* based on Alpha's gen64def.h; the file is absent on VAX */
diff --git a/src/os_win32.c b/src/os_win32.c
index 0c896efc3..939563805 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -135,6 +135,8 @@ typedef int BY_HANDLE_FILE_INFORMATION;
typedef int SE_OBJECT_TYPE;
typedef int PSNSECINFO;
typedef int PSNSECINFOW;
+typedef int STARTUPINFO;
+typedef int PROCESS_INFORMATION;
#endif
#ifndef FEAT_GUI_W32
@@ -1906,6 +1908,8 @@ executable_exists(char *name, char_u **path)
{
char *dum;
char fname[_MAX_PATH];
+ char *curpath, *newpath;
+ long n;
#ifdef FEAT_MBYTE
if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
@@ -1913,11 +1917,19 @@ executable_exists(char *name, char_u **path)
WCHAR *p = enc_to_utf16(name, NULL);
WCHAR fnamew[_MAX_PATH];
WCHAR *dumw;
- long n;
+ WCHAR *wcurpath, *wnewpath;
if (p != NULL)
{
- n = (long)SearchPathW(NULL, p, NULL, _MAX_PATH, fnamew, &dumw);
+ wcurpath = _wgetenv(L"PATH");
+ wnewpath = (WCHAR*)alloc((unsigned)(wcslen(wcurpath) + 3)
+ * sizeof(WCHAR));
+ if (wnewpath == NULL)
+ return FALSE;
+ wcscpy(wnewpath, L".;");
+ wcscat(wnewpath, wcurpath);
+ n = (long)SearchPathW(wnewpath, p, NULL, _MAX_PATH, fnamew, &dumw);
+ vim_free(wnewpath);
vim_free(p);
if (n > 0 || GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
{
@@ -1933,7 +1945,16 @@ executable_exists(char *name, char_u **path)
}
}
#endif
- if (SearchPath(NULL, name, NULL, _MAX_PATH, fname, &dum) == 0)
+
+ curpath = getenv("PATH");
+ newpath = (char*)alloc((unsigned)(STRLEN(curpath) + 3));
+ if (newpath == NULL)
+ return FALSE;
+ STRCPY(newpath, ".;");
+ STRCAT(newpath, curpath);
+ n = (long)SearchPath(newpath, name, NULL, _MAX_PATH, fname, &dum);
+ vim_free(newpath);
+ if (n == 0)
return FALSE;
if (mch_isdir(fname))
return FALSE;
@@ -2427,7 +2448,8 @@ SaveConsoleTitleAndIcon(void)
return;
/* Extract the first icon contained in the Vim executable. */
- g_hVimIcon = ExtractIcon(NULL, exe_name, 0);
+ if (mch_icon_load((HANDLE *)&g_hVimIcon) == FAIL || g_hVimIcon == NULL)
+ g_hVimIcon = ExtractIcon(NULL, exe_name, 0);
if (g_hVimIcon != NULL)
g_fCanChangeIcon = TRUE;
}
@@ -2755,9 +2777,10 @@ fname_case(
if (p != NULL)
{
char_u *q;
- WCHAR buf[_MAX_PATH + 2];
+ WCHAR buf[_MAX_PATH + 1];
- wcscpy(buf, p);
+ wcsncpy(buf, p, _MAX_PATH);
+ buf[_MAX_PATH] = L'\0';
vim_free(p);
if (fname_casew(buf, (len > 0) ? _MAX_PATH : 0) == OK)
@@ -4625,21 +4648,52 @@ mch_call_shell(
int x = 0;
int tmode = cur_tmode;
#ifdef FEAT_TITLE
- char szShellTitle[512];
+ char szShellTitle[512];
+# ifdef FEAT_MBYTE
+ int did_set_title = FALSE;
/* Change the title to reflect that we are in a subshell. */
- if (GetConsoleTitle(szShellTitle, sizeof(szShellTitle) - 4) > 0)
+ if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
{
- if (cmd == NULL)
- strcat(szShellTitle, " :sh");
- else
+ WCHAR szShellTitle[512];
+
+ if (GetConsoleTitleW(szShellTitle,
+ sizeof(szShellTitle)/sizeof(WCHAR) - 4) > 0)
{
- strcat(szShellTitle, " - !");
- if ((strlen(szShellTitle) + strlen(cmd) < sizeof(szShellTitle)))
- strcat(szShellTitle, cmd);
+ if (cmd == NULL)
+ wcscat(szShellTitle, L" :sh");
+ else
+ {
+ WCHAR *wn = enc_to_utf16(cmd, NULL);
+
+ if (wn != NULL)
+ {
+ wcscat(szShellTitle, L" - !");
+ if ((wcslen(szShellTitle) + wcslen(wn) <
+ sizeof(szShellTitle)/sizeof(WCHAR)))
+ wcscat(szShellTitle, wn);
+ SetConsoleTitleW(szShellTitle);
+ vim_free(wn);
+ did_set_title = TRUE;
+ }
+ }
}
- mch_settitle(szShellTitle, NULL);
}
+ if (!did_set_title)
+# endif
+ /* Change the title to reflect that we are in a subshell. */
+ if (GetConsoleTitle(szShellTitle, sizeof(szShellTitle) - 4) > 0)
+ {
+ if (cmd == NULL)
+ strcat(szShellTitle, " :sh");
+ else
+ {
+ strcat(szShellTitle, " - !");
+ if ((strlen(szShellTitle) + strlen(cmd) < sizeof(szShellTitle)))
+ strcat(szShellTitle, cmd);
+ }
+ SetConsoleTitle(szShellTitle);
+ }
#endif
out_flush();
@@ -6087,6 +6141,13 @@ mch_open(char *name, int flags, int mode)
}
# endif
+ /* open() can open a file which name is longer than _MAX_PATH bytes
+ * and shorter than _MAX_PATH characters successfully, but sometimes it
+ * causes unexpected error in another part. We make it an error explicitly
+ * here. */
+ if (strlen(name) >= _MAX_PATH)
+ return -1;
+
return open(name, flags, mode);
}
@@ -6136,6 +6197,13 @@ mch_fopen(char *name, char *mode)
* the _wfopen() fails for missing wide functions. */
}
+ /* fopen() can open a file which name is longer than _MAX_PATH bytes
+ * and shorter than _MAX_PATH characters successfully, but sometimes it
+ * causes unexpected error in another part. We make it an error explicitly
+ * here. */
+ if (strlen(name) >= _MAX_PATH)
+ return NULL;
+
return fopen(name, mode);
}
#endif
@@ -6442,6 +6510,7 @@ get_cmd_argsW(char ***argvp)
int argc = 0;
int i;
+ free_cmd_argsW();
ArglistW = CommandLineToArgvW(GetCommandLineW(), &nArgsW);
if (ArglistW != NULL)
{
@@ -6474,7 +6543,11 @@ get_cmd_argsW(char ***argvp)
global_argc = argc;
global_argv = argv;
if (argc > 0)
+ {
+ if (used_file_indexes != NULL)
+ free(used_file_indexes);
used_file_indexes = malloc(argc * sizeof(int));
+ }
if (argvp != NULL)
*argvp = argv;
diff --git a/src/po/eo.po b/src/po/eo.po
index 580c7ac79..2070991af 100644
--- a/src/po/eo.po
+++ b/src/po/eo.po
@@ -23,8 +23,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Vim(Esperanto)\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-03-21 23:15+0100\n"
-"PO-Revision-Date: 2014-03-21 23:16+0100\n"
+"POT-Creation-Date: 2014-11-05 21:12+0100\n"
+"PO-Revision-Date: 2014-11-05 21:12+0100\n"
"Last-Translator: Dominique PELLÉ <dominique.pelle@gmail.com>\n"
"Language-Team: \n"
"Language: eo\n"
@@ -42,10 +42,10 @@ msgid "E817: Blowfish big/little endian use wrong"
msgstr "E817: Misuzo de pezkomenca/pezfina en blowfish"
msgid "E818: sha256 test failed"
-msgstr "E818: Testo de sha256 fiaskis"
+msgstr "E818: Testo de sha256 malsukcesis"
msgid "E819: Blowfish test failed"
-msgstr "E819: Testo de blowfish fiaskis"
+msgstr "E819: Testo de blowfish malsukcesis"
msgid "[Location List]"
msgstr "[Listo de lokoj]"
@@ -219,6 +219,21 @@ msgstr "Emfazaj simbolaĵoj de %s:"
msgid " line=%ld id=%d name=%s"
msgstr " linio=%ld id=%d nomo=%s"
+msgid "E821: File is encrypted with unknown method"
+msgstr "E821: Dosiero estas ĉifrata per nekonata metodo"
+
+msgid "Enter encryption key: "
+msgstr "Tajpu la ŝlosilon de ĉifrado: "
+
+msgid "Enter same key again: "
+msgstr "Tajpu la ŝlosilon denove: "
+
+msgid "Keys don't match!"
+msgstr "Ŝlosiloj ne kongruas!"
+
+msgid "[crypted]"
+msgstr "[ĉifrita]"
+
#, c-format
msgid "E96: Can not diff more than %ld buffers"
msgstr "E96: Ne eblas dosierdiferenci pli ol %ld bufrojn"
@@ -676,8 +691,14 @@ msgstr "E258: Ne eblas sendi al kliento"
msgid "sort() argument"
msgstr "argumento de sort()"
+msgid "uniq() argument"
+msgstr "argumento de uniq()"
+
msgid "E702: Sort compare function failed"
-msgstr "E702: Ordiga funkcio fiaskis"
+msgstr "E702: Ordiga funkcio malsukcesis"
+
+msgid "E882: Uniq compare function failed"
+msgstr "E882: kompara funkcio de uniq() malsukcesis"
msgid "(Invalid)"
msgstr "(Nevalida)"
@@ -774,8 +795,12 @@ msgid "E129: Function name required"
msgstr "E129: Nomo de funkcio bezonata"
#, c-format
-msgid "E128: Function name must start with a capital or contain a colon: %s"
-msgstr "E128: Nomo de funkcio devas eki per majusklo aŭ enhavi dupunkton: %s"
+msgid "E128: Function name must start with a capital or \"s:\": %s"
+msgstr "E128: Nomo de funkcio devas eki per majusklo aŭ per \"s:\": %s"
+
+#, c-format
+msgid "E884: Function name cannot contain a colon: %s"
+msgstr "E884: Nomo de funkcio ne povas enhavi dupunkton: %s"
#, c-format
msgid "E131: Cannot delete function %s: It is in use"
@@ -877,7 +902,7 @@ msgid " oldfiles"
msgstr " malnovaj dosieroj"
msgid " FAILED"
-msgstr " FIASKIS"
+msgstr " MALSUKCESIS"
#. avoid a wait_return for this message, it's annoying
#, c-format
@@ -892,6 +917,10 @@ msgstr "E138: Ne eblas skribi dosieron viminfo %s!"
msgid "Writing viminfo file \"%s\""
msgstr "Skribas dosieron viminfo \"%s\""
+#, c-format
+msgid "E886: Can't rename viminfo file to %s!"
+msgstr "E886: Ne eblas renomi dosieron viminfo al %s!"
+
#. Write the info:
#, c-format
msgid "# This viminfo file was generated by Vim %s.\n"
@@ -1093,6 +1122,10 @@ msgstr "E158: Nevalida nomo de bufro: %s"
msgid "E157: Invalid sign ID: %ld"
msgstr "E157: Nevalida identigilo de simbolo: %ld"
+#, c-format
+msgid "E885: Not possible to change sign %s"
+msgstr "E885: Ne eblas ŝanĝi simbolon %s"
+
msgid " (NOT FOUND)"
msgstr " (NETROVITA)"
@@ -1679,12 +1712,6 @@ msgstr "[NE konvertita]"
msgid "[converted]"
msgstr "[konvertita]"
-msgid "[blowfish]"
-msgstr "[blowfish]"
-
-msgid "[crypted]"
-msgstr "[ĉifrita]"
-
#, c-format
msgid "[CONVERSION ERROR in line %ld]"
msgstr "[ERARO DE KONVERTO en linio %ld]"
@@ -1700,14 +1727,11 @@ msgid "Can't find temp file for conversion"
msgstr "Ne eblas trovi provizoran dosieron por konverti"
msgid "Conversion with 'charconvert' failed"
-msgstr "Konverto kun 'charconvert' fiaskis"
+msgstr "Konverto kun 'charconvert' malsukcesis"
msgid "can't read output of 'charconvert'"
msgstr "ne eblas legi la eligon de 'charconvert'"
-msgid "E821: File is encrypted with unknown method"
-msgstr "E821: Dosiero estas ĉifrata per nekonata metodo"
-
msgid "E676: No matching autocommands for acwrite buffer"
msgstr "E676: Neniu kongrua aŭtokomando por la bufro acwrite"
@@ -1764,21 +1788,22 @@ msgstr "E212: Ne eblas malfermi la dosieron por skribi"
# AM: fsync: ne traduku (nomo de C-komando)
msgid "E667: Fsync failed"
-msgstr "E667: Fsync fiaskis"
+msgstr "E667: Fsync malsukcesis"
msgid "E512: Close failed"
-msgstr "E512: Fermo fiaskis"
+msgstr "E512: Fermo malsukcesis"
msgid "E513: write error, conversion failed (make 'fenc' empty to override)"
-msgstr "E513: skriberaro, konverto fiaskis (igu 'fenc' malplena por transpasi)"
+msgstr ""
+"E513: skriberaro, konverto malsukcesis (igu 'fenc' malplena por transpasi)"
#, c-format
msgid ""
"E513: write error, conversion failed in line %ld (make 'fenc' empty to "
"override)"
msgstr ""
-"E513: skriberaro, konverto fiaskis en linio %ld (igu 'fenc' malplena por "
-"transpasi)"
+"E513: skriberaro, konverto malsukcesis en linio %ld (igu 'fenc' malplena "
+"por transpasi)"
msgid "E514: write error (file system full?)"
msgstr "E514: skriberaro (ĉu plena dosiersistemo?)"
@@ -2052,10 +2077,10 @@ msgid "E228: makemap: Illegal mode"
msgstr "E228: makemap: Nevalida reĝimo"
msgid "E851: Failed to create a new process for the GUI"
-msgstr "E851: Ne sukcesis krei novan procezon por la grafika interfaco"
+msgstr "E851: Malsukcesis krei novan procezon por la grafika interfaco"
msgid "E852: The child process failed to start the GUI"
-msgstr "E852: La ida procezo ne sukcesis startigi la grafikan interfacon"
+msgstr "E852: La ida procezo malsukcesis startigi la grafikan interfacon"
msgid "E229: Cannot start the GUI"
msgstr "E229: Ne eblas lanĉi la grafikan interfacon"
@@ -2414,7 +2439,7 @@ msgid "Sending to printer..."
msgstr "Sendas al presilo..."
msgid "E365: Failed to print PostScript file"
-msgstr "E365: Presado de PostSkripta dosiero fiaskis"
+msgstr "E365: Presado de PostSkripta dosiero malsukcesis"
msgid "Print job sent."
msgstr "Laboro de presado sendita."
@@ -2479,16 +2504,16 @@ msgid "E622: Could not fork for cscope"
msgstr "E622: Ne eblis forki cscope"
msgid "cs_create_connection setpgid failed"
-msgstr "plenumo de cs_create_connection-setgpid fiaskis"
+msgstr "plenumo de cs_create_connection-setgpid malsukcesis"
msgid "cs_create_connection exec failed"
-msgstr "plenumo de cs_create_connection fiaskis"
+msgstr "plenumo de cs_create_connection malsukcesis"
msgid "cs_create_connection: fdopen for to_fp failed"
-msgstr "cs_create_connection: fdopen de to_fp fiaskis"
+msgstr "cs_create_connection: fdopen de to_fp malsukcesis"
msgid "cs_create_connection: fdopen for fr_fp failed"
-msgstr "cs_create_connection: fdopen de fr_fp fiaskis"
+msgstr "cs_create_connection: fdopen de fr_fp malsukcesis"
msgid "E623: Could not spawn cscope process"
msgstr "E623: Ne eblis naskigi procezon cscope"
@@ -2655,6 +2680,13 @@ msgstr ""
"E263: Bedaŭrinde tiu komando estas malŝaltita: la biblioteko de Pitono ne "
"ŝargeblis."
+msgid ""
+"E887: Sorry, this command is disabled, the Python's site module could not be "
+"loaded."
+msgstr ""
+"E887` Bedaŭrinde tiu komando estas malŝaltita: la biblioteko de Pitono ne "
+"ŝargeblis."
+
msgid "E659: Cannot invoke Python recursively"
msgstr "E659: Ne eblas alvoki Pitonon rekursie"
@@ -2860,7 +2892,7 @@ msgid "Unable to register a command server name"
msgstr "Ne eblas registri nomon de komanda servilo"
msgid "E248: Failed to send command to the destination program"
-msgstr "E248: Sendo de komando al cela programo fiaskis"
+msgstr "E248: Sendo de komando al cela programo malsukcesis"
#, c-format
msgid "E573: Invalid server id used: %s"
@@ -2911,7 +2943,7 @@ msgid "Cannot open for script output: \""
msgstr "Ne eblas malfermi por eligo de skripto: \""
msgid "Vim: Error: Failure to start gvim from NetBeans\n"
-msgstr "Vim: Eraro: Fiaskis lanĉi gvim el NetBeans\n"
+msgstr "Vim: Eraro: malsukcesis lanĉi gvim el NetBeans\n"
msgid "Vim: Warning: Output is not to a terminal\n"
msgstr "Vim: Averto: Eligo ne estas al terminalo\n"
@@ -3280,21 +3312,21 @@ msgstr "Neniu ekrano"
#. Failed to send, abort.
msgid ": Send failed.\n"
-msgstr ": Sendo fiaskis.\n"
+msgstr ": Sendo malsukcesis.\n"
#. Let vim start normally.
msgid ": Send failed. Trying to execute locally\n"
-msgstr ": Sendo fiaskis. Provo de loka plenumo\n"
+msgstr ": Sendo malsukcesis. Provo de loka plenumo\n"
#, c-format
msgid "%d of %d edited"
msgstr "%d de %d redaktita(j)"
msgid "No display: Send expression failed.\n"
-msgstr "Neniu ekrano: Sendado de esprimo fiaskis.\n"
+msgstr "Neniu ekrano: Sendado de esprimo malsukcesis.\n"
msgid ": Send expression failed.\n"
-msgstr ": Sendado de esprimo fiaskis.\n"
+msgstr ": Sendado de esprimo malsukcesis.\n"
msgid "No marks set"
msgstr "Neniu marko"
@@ -3359,10 +3391,10 @@ msgid "E284: Cannot set IC values"
msgstr "E284: Ne eblas agordi valorojn de IC"
msgid "E285: Failed to create input context"
-msgstr "E285: Ne eblis krei enigan kuntekston"
+msgstr "E285: Kreado de eniga kunteksto malsukcesis"
msgid "E286: Failed to open input method"
-msgstr "E286: Ne eblis malfermi enigan metodon"
+msgstr "E286: Malfermo de eniga metodo malsukcesis"
msgid "E287: Warning: Could not set destroy callback to IM"
msgstr "E287: Averto: Ne eblis agordi detruan reagfunkcion al IM"
@@ -3689,7 +3721,7 @@ msgid "File preserved"
msgstr "Dosiero konservita"
msgid "E314: Preserve failed"
-msgstr "E314: Konservo fiaskis"
+msgstr "E314: Konservo malsukcesis"
#, c-format
msgid "E315: ml_get: invalid lnum: %ld"
@@ -3967,7 +3999,7 @@ msgid "E766: Insufficient arguments for printf()"
msgstr "E766: Ne sufiĉaj argumentoj por printf()"
msgid "E807: Expected Float argument for printf()"
-msgstr "E807: Atendis Glitpunktnombron kiel argumento de printf()"
+msgstr "E807: Atendis Glitpunktnombron kiel argumenton de printf()"
msgid "E767: Too many arguments to printf()"
msgstr "E767: Tro da argumentoj al printf()"
@@ -4052,15 +4084,6 @@ msgstr "E548: cifero atendata"
msgid "E549: Illegal percentage"
msgstr "E549: Nevalida procento"
-msgid "Enter encryption key: "
-msgstr "Tajpu la ŝlosilon de ĉifrado: "
-
-msgid "Enter same key again: "
-msgstr "Tajpu la ŝlosilon denove: "
-
-msgid "Keys don't match!"
-msgstr "Ŝlosiloj ne kongruas!"
-
msgid "E854: path too long for completion"
msgstr "E854: tro longa vojo por kompletigo"
@@ -4232,6 +4255,12 @@ msgstr ""
msgid "E574: Unknown register type %d"
msgstr "E574: Nekonata tipo de reĝistro %d"
+msgid ""
+"E883: search pattern and expression register may not contain two or more "
+"lines"
+msgstr ""
+"E883: serĉa ŝablono kaj esprima reĝistro ne povas enhavi du aŭ pliajn liniojn"
+
#, c-format
msgid "%ld Cols; "
msgstr "%ld Kolumnoj; "
@@ -4368,7 +4397,7 @@ msgid "E541: too many items"
msgstr "E541: tro da elementoj"
msgid "E542: unbalanced groups"
-msgstr "E542: misekvilibritaj grupoj"
+msgstr "E542: misekvilibraj grupoj"
msgid "E590: A preview window already exists"
msgstr "E590: Antaŭvida fenestro jam ekzistas"
@@ -4486,10 +4515,10 @@ msgid "Message"
msgstr "Mesaĝo"
msgid "'columns' is not 80, cannot execute external commands"
-msgstr "'columns' ne estas 80, ne eblas plenumi eksternajn komandojn"
+msgstr "'columns' ne estas 80, ne eblas plenumi eksterajn komandojn"
msgid "E237: Printer selection failed"
-msgstr "E237: Elekto de presilo fiaskis"
+msgstr "E237: Elekto de presilo malsukcesis"
#, c-format
msgid "to %s on %s"
@@ -4527,7 +4556,7 @@ msgstr ""
"Vim: Alvenis X eraro\n"
msgid "Testing the X display failed"
-msgstr "Testo de la vidigo X fiaskis"
+msgstr "Testo de la vidigo X malsukcesis"
msgid "Opening the X display timed out"
msgstr "Tempolimo okazis dum malfermo de vidigo X"
@@ -4546,6 +4575,19 @@ msgstr ""
"\n"
"Ne povis ŝalti kuntekston de sekureco por "
+msgid "Could not set security context "
+msgstr "Ne povis akiri kuntekston de sekureco "
+
+msgid " for "
+msgstr " por "
+
+#. no enough size OR unexpected error
+msgid "Could not get security context "
+msgstr "Ne povis akiri kuntekston de sekureco "
+
+msgid ". Removing it!\n"
+msgstr ". Ĝi estas foriganta!\n"
+
msgid ""
"\n"
"Cannot execute shell "
@@ -4596,7 +4638,7 @@ msgid "dlerror = \"%s\""
msgstr "dlerror = \"%s\""
msgid "Opening the X display failed"
-msgstr "Malfermo de vidigo X fiaskis"
+msgstr "Malfermo de vidigo X malsukcesis"
msgid "XSMP handling save-yourself request"
msgstr "XSMP: traktado de peto konservi-mem"
@@ -4605,11 +4647,11 @@ msgid "XSMP opening connection"
msgstr "XSMP: malfermo de konekto"
msgid "XSMP ICE connection watch failed"
-msgstr "XSMP: kontrolo de konekto ICE fiaskis"
+msgstr "XSMP: kontrolo de konekto ICE malsukcesis"
#, c-format
msgid "XSMP SmcOpenConnection failed: %s"
-msgstr "XSMP: SmcOpenConnection fiaskis: %s"
+msgstr "XSMP: SmcOpenConnection malsukcesis: %s"
msgid "At line"
msgstr "Ĉe linio"
@@ -4816,6 +4858,10 @@ msgstr "E554: Sintaksa eraro en %s{...}"
msgid "External submatches:\n"
msgstr "Eksteraj subkongruoj:\n"
+#, c-format
+msgid "E888: (NFA regexp) cannot repeat %s"
+msgstr "E888: (NFA-regulesprimo) ne eblas ripeti %s"
+
msgid ""
"E864: \\%#= can only be followed by 0, 1, or 2. The automatic engine will be "
"used "
@@ -4823,6 +4869,9 @@ msgstr ""
"E864: \\%#= povas nur esti sekvita de 0, 1, aŭ 2. La aŭtomata motoro de "
"regulesprimo estos uzata "
+msgid "Switching to backtracking RE engine for pattern: "
+msgstr "Ŝangota al malavanca motoro de regulesprimo por ŝablono: "
+
msgid "E865: (NFA) Regexp end encountered prematurely"
msgstr "E865: (NFA) Trovis finon de regulesprimo tro frue"
@@ -5547,7 +5596,7 @@ msgstr "E412: Ne sufiĉaj argumentoj: \":highlight link %s\""
#, c-format
msgid "E413: Too many arguments: \":highlight link %s\""
-msgstr "E413: Tro argumentoj: \":highlight link %s\""
+msgstr "E413: Tro da argumentoj: \":highlight link %s\""
msgid "E414: group has settings, highlight link ignored"
msgstr "E414: grupo havas agordojn, ligilo de emfazo ignorita"
@@ -5788,7 +5837,7 @@ msgstr "E832: Ne ĉifrata dosiero havas ĉifratan malfaran dosieron: %s"
#, c-format
msgid "E826: Undo file decryption failed: %s"
-msgstr "E826: Malĉifrado de malfara dosiero fiaskis: %s"
+msgstr "E826: Malĉifrado de malfara dosiero malsukcesis: %s"
#, c-format
msgid "E827: Undo file is encrypted: %s"
@@ -6228,6 +6277,9 @@ msgstr "E446: Neniu dosiernomo sub la kursoro"
msgid "E447: Can't find file \"%s\" in path"
msgstr "E447: Ne eblas trovi dosieron \"%s\" en serĉvojo"
+msgid "List or number required"
+msgstr "Listo aŭ nombro bezonata"
+
#, c-format
msgid "E370: Could not load library %s"
msgstr "E370: Ne eblis ŝargi bibliotekon %s"
@@ -6314,7 +6366,7 @@ msgid "E13: File exists (add ! to override)"
msgstr "E13: Dosiero ekzistas (aldonu ! por transpasi)"
msgid "E472: Command failed"
-msgstr "E472: La komando fiaskis"
+msgstr "E472: La komando malsukcesis"
#, c-format
msgid "E234: Unknown fontset: %s"
@@ -6360,7 +6412,7 @@ msgstr "E17: \"%s\" estas dosierujo"
#, c-format
msgid "E364: Library call failed for \"%s()\""
-msgstr "E364: Alvoko al biblioteko fiaskis por \"%s()\""
+msgstr "E364: Alvoko al biblioteko malsukcesis por \"%s()\""
#, c-format
msgid "E448: Could not load library function %s"
@@ -6630,7 +6682,7 @@ msgstr "listo estas ŝlosita"
#, c-format
msgid "failed to add key '%s' to dictionary"
-msgstr "aldono de ŝlosilo '%s' al vortaro fiaskis"
+msgstr "aldono de ŝlosilo '%s' al vortaro malsukcesis"
#, c-format
msgid "index must be int or slice, not %s"
@@ -6676,7 +6728,7 @@ msgid "E264: Python: Error initialising I/O objects"
msgstr "E264: Pitono: Eraro de pravalorizo de eneligaj objektoj"
msgid "failed to change directory"
-msgstr "ne povis ŝanĝi dosierujon"
+msgstr "malsukcesis ŝanĝi dosierujon"
#, c-format
msgid "expected 3-tuple as imp.find_module() result, but got %s"
@@ -6715,7 +6767,7 @@ msgstr "indekso de listo ekster limoj"
#. No more suitable format specifications in python-2.3
#, c-format
msgid "internal error: failed to get vim list item %d"
-msgstr "interna eraro: obteno de vim-a listero %d fiaskis"
+msgstr "interna eraro: obteno de vim-a listero %d malsukcesis"
msgid "slice step cannot be zero"
msgstr "paŝo de sekco ne povas esti nul"
@@ -6732,14 +6784,14 @@ msgid "internal error: not enough list items"
msgstr "interna eraro: ne sufiĉaj listeroj"
msgid "internal error: failed to add item to list"
-msgstr "interna eraro: aldono de listero fiaskis"
+msgstr "interna eraro: aldono de listero malsukcesis"
#, c-format
msgid "attempt to assign sequence of size %d to extended slice of size %d"
msgstr "provis valorizi sekvencon kun %d eroj al etendita sekco kun %d eroj"
msgid "failed to add item to list"
-msgstr "aldono de listero fiaskis"
+msgstr "aldono de listero malsukcesis"
msgid "cannot delete vim.List attributes"
msgstr "ne eblas forviŝi atributojn de 'vim.List'"
@@ -6760,10 +6812,10 @@ msgstr "konstruilo de funkcio ne akceptas ŝlosilvortajn argumentojn"
#, c-format
msgid "failed to run function %s"
-msgstr "fiaskis ruli funkcion %s"
+msgstr "malsukcesis ruli funkcion %s"
msgid "unable to get option value"
-msgstr "fiaskis akiri valoron de opcio"
+msgstr "malsukcesis akiri valoron de opcio"
msgid "internal error: unknown option type"
msgstr "interna eraro: nekonata tipo de opcio"
@@ -6801,7 +6853,7 @@ msgid "attempt to refer to deleted buffer"
msgstr "provo de referenco al forviŝita bufro"
msgid "failed to rename buffer"
-msgstr "ne povis renomi bufron"
+msgstr "malsukcesis renomi bufron"
msgid "mark name must be a single character"
msgstr "nomo de marko devas esti unuopa signo"
@@ -6812,14 +6864,14 @@ msgstr "atendis objekton vim.Buffer, sed ricevis %s"
#, c-format
msgid "failed to switch to buffer %d"
-msgstr "ne povis salti al la bufro %d"
+msgstr "salto al la bufro %d malsukcesis"
#, c-format
msgid "expected vim.Window object, but got %s"
msgstr "atendis objekton vim.window, sed ricevis %s"
msgid "failed to find window in the current tab page"
-msgstr "ne povis trovi vindozon en la nuna langeto"
+msgstr "malsukcesis trovi vindozon en la nuna langeto"
msgid "did not switch to the specified window"
msgstr "ne saltis al la specifita vindozo"
@@ -6832,13 +6884,13 @@ msgid "did not switch to the specified tab page"
msgstr "ne saltis al la specifita langeto"
msgid "failed to run the code"
-msgstr "fiaskis ruli la kodon"
+msgstr "malsukcesis ruli la kodon"
msgid "E858: Eval did not return a valid python object"
msgstr "E858: Eval ne revenis kun valida python-objekto"
msgid "E859: Failed to convert returned python object to vim value"
-msgstr "E859: Konverto de revena python-objekto al vim-valoro fiaskis"
+msgstr "E859: Konverto de revena python-objekto al vim-valoro malsukcesis"
#, c-format
msgid "unable to convert %s to vim dictionary"
@@ -6860,7 +6912,7 @@ msgid ""
"- append vim.path_hook to sys.path_hooks\n"
"- append vim.VIM_SPECIAL_PATH to sys.path\n"
msgstr ""
-"Fiaskis valorizi sys.path_hooks: sys.path_hooks ne estas listo\n"
+"Valorizo de sys.path_hooks malsukcesis: sys.path_hooks ne estas listo\n"
"Vi nun devas fari tion:\n"
"- postaldoni vim.path_hook al sys.path_hooks\n"
"- postaldoni vim.VIM_SPECIAL_PATH al sys.path\n"
@@ -6869,5 +6921,8 @@ msgid ""
"Failed to set path: sys.path is not a list\n"
"You should now append vim.VIM_SPECIAL_PATH to sys.path"
msgstr ""
-"Ne povis agordi serĉvojon: sys.path ne estas listo\n"
+"Agordo de serĉvojo malsukcesis: sys.path ne estas listo\n"
"Vi nun devas aldoni vim.VIM_SPECIAL_PATH al sys.path"
+
+#~ msgid "[blowfish]"
+#~ msgstr "[blowfish]"
diff --git a/src/po/fr.po b/src/po/fr.po
index fe466b301..0ae8327cf 100644
--- a/src/po/fr.po
+++ b/src/po/fr.po
@@ -6,7 +6,7 @@
# FIRST AUTHOR DindinX <David.Odin@bigfoot.com> 2000.
# SECOND AUTHOR Adrien Beau <version.francaise@free.fr> 2002, 2003.
# THIRD AUTHOR David Blanchet <david.blanchet@free.fr> 2006, 2008.
-# FOURTH AUTHOR Dominique Pell <dominique.pelle@gmail.com> 2008, 2013.
+# FOURTH AUTHOR Dominique Pell <dominique.pelle@gmail.com> 2008, 2014.
#
# Latest translation available at:
# http://dominique.pelle.free.fr/vim-fr.php
@@ -15,8 +15,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Vim(Franais)\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-05-27 04:55+0200\n"
-"PO-Revision-Date: 2013-05-27 10:22+0200\n"
+"POT-Creation-Date: 2014-11-05 21:12+0100\n"
+"PO-Revision-Date: 2014-11-05 21:23+0100\n"
"Last-Translator: Dominique Pell <dominique.pelle@gmail.com>\n"
"Language-Team: \n"
"Language: fr\n"
@@ -90,6 +90,9 @@ msgstr "1 tampon a t dtruit"
msgid "%d buffers wiped out"
msgstr "%d tampons ont t dtruits"
+msgid "E90: Cannot unload last buffer"
+msgstr "E90: Impossible de dcharger le dernier tampon"
+
# AB - La version franaise est meilleure que la version anglaise.
msgid "E84: No modified buffer found"
msgstr "E84: Aucun tampon n'est modifi"
@@ -115,9 +118,6 @@ msgid "E89: No write since last change for buffer %ld (add ! to override)"
msgstr ""
"E89: Le tampon %ld n'a pas t enregistr (ajoutez ! pour passer outre)"
-msgid "E90: Cannot unload last buffer"
-msgstr "E90: Impossible de dcharger le dernier tampon"
-
msgid "W14: Warning: List of file names overflow"
msgstr "W14: Alerte : La liste des noms de fichier dborde"
@@ -156,6 +156,9 @@ msgstr "[Nouveau fichier]"
msgid "[Read errors]"
msgstr "[Erreurs de lecture]"
+msgid "[RO]"
+msgstr "[RO]"
+
# AB - La version courte, "[RO]", devrait-elle tre traduite par "[LS]" ?
# Il faudrait faire un sondage auprs des utilisateurs francophones.
msgid "[readonly]"
@@ -230,6 +233,21 @@ msgstr "Symboles dans %s :"
msgid " line=%ld id=%d name=%s"
msgstr " ligne=%ld id=%d nom=%s"
+msgid "E821: File is encrypted with unknown method"
+msgstr "E821: Le fichier est chiffr avec une mthode inconnue"
+
+msgid "Enter encryption key: "
+msgstr "Tapez la cl de chiffrement : "
+
+msgid "Enter same key again: "
+msgstr "Tapez la cl nouveau : "
+
+msgid "Keys don't match!"
+msgstr "Les cls ne correspondent pas !"
+
+msgid "[crypted]"
+msgstr "[chiffr]"
+
# AB - Je n'ai pas trouv de traduction satisfaisante au verbe "diff". Comme
# Vim fait en pratique appel au programme "diff" pour evaluer les
# diffrences entre fichiers, "to diff" a t traduit par "utiliser diff"
@@ -491,6 +509,9 @@ msgstr "E130: Fonction inconnue : %s"
msgid "E461: Illegal variable name: %s"
msgstr "E461: Nom de variable invalide : %s"
+msgid "E806: using Float as a String"
+msgstr "E806: Utilisation d'un Flottant comme une Chane"
+
# DB - todo : trouver mieux que "destinations".
msgid "E687: Less targets than List items"
msgstr "E687: Moins de destinations que d'lments dans la Liste"
@@ -662,13 +683,13 @@ msgstr "E785: complete() n'est utilisable que dans le mode Insertion"
msgid "&Ok"
msgstr "&Ok"
-msgid "extend() argument"
-msgstr "argument de extend()"
-
#, c-format
msgid "E737: Key already exists: %s"
msgstr "E737: un mappage existe dj pour %s"
+msgid "extend() argument"
+msgstr "argument de extend()"
+
msgid "map() argument"
msgstr "argument de map()"
@@ -742,9 +763,15 @@ msgstr "E258: La rponse n'a pas pu tre envoye au client"
msgid "sort() argument"
msgstr "argument de sort()"
+msgid "uniq() argument"
+msgstr "argument de uniq()"
+
msgid "E702: Sort compare function failed"
msgstr "E702: La fonction de comparaison de sort() a chou"
+msgid "E882: Uniq compare function failed"
+msgstr "E882: La fonction de comparaison de uniq() a chou"
+
msgid "(Invalid)"
msgstr "(Invalide)"
@@ -772,9 +799,6 @@ msgstr "E730: Utilisation d'une Liste comme une Chane"
msgid "E731: using Dictionary as a String"
msgstr "E731: Utilisation d'un Dictionnaire comme une Chane"
-msgid "E806: using Float as a String"
-msgstr "E806: Utilisation d'un Flottant comme une Chane"
-
# DB : On doit pouvoir trouver nettement mieux que a.
#, c-format
msgid "E706: Variable type mismatch for: %s"
@@ -848,8 +872,15 @@ msgid "E129: Function name required"
msgstr "E129: Nom de fonction requis"
#, c-format
-msgid "E128: Function name must start with a capital or contain a colon: %s"
-msgstr "E128: La fonction %s ne commence pas par une majuscule ou contient ':'"
+msgid "E128: Function name must start with a capital or \"s:\": %s"
+msgstr ""
+"E128: Le nom de la fonction doit commencer par une majuscule ou \"s:\": %s"
+
+#, c-format
+msgid "E884: Function name cannot contain a colon: %s"
+msgstr ""
+"E884: Le nom de la fonction ne peut pas contenir le caractre deux-points : "
+"%s"
# AB - Il est difficile de crer une version franaise qui fasse moins de 80
# caractres de long, nom de la fonction compris : "It is in use" est une
@@ -1013,6 +1044,10 @@ msgstr "E138: Impossible d'crire le fichier %s"
msgid "Writing viminfo file \"%s\""
msgstr "criture du fichier viminfo \"%s\""
+#, c-format
+msgid "E886: Can't rename viminfo file to %s!"
+msgstr "E886: Impossible de renommer viminfo en %s"
+
#. Write the info:
#, c-format
msgid "# This viminfo file was generated by Vim %s.\n"
@@ -1267,6 +1302,10 @@ msgstr "E158: Le tampon %s est introuvable"
msgid "E157: Invalid sign ID: %ld"
msgstr "E157: Le symbole %ld est introuvable"
+#, c-format
+msgid "E885: Not possible to change sign %s"
+msgstr "E885: Impossible de changer le symbole %s"
+
msgid " (NOT FOUND)"
msgstr " (INTROUVABLE)"
@@ -1856,9 +1895,6 @@ msgstr "[socket]"
msgid "[character special]"
msgstr "[caractre spcial]"
-msgid "[RO]"
-msgstr "[RO]"
-
msgid "[CR missing]"
msgstr "[CR manquant]"
@@ -1871,12 +1907,6 @@ msgstr "[NON converti]"
msgid "[converted]"
msgstr "[converti]"
-msgid "[blowfish]"
-msgstr "[blowfish]"
-
-msgid "[crypted]"
-msgstr "[chiffr]"
-
#, c-format
msgid "[CONVERSION ERROR in line %ld]"
msgstr "[ERREUR DE CONVERSION la ligne %ld]"
@@ -1898,9 +1928,6 @@ msgstr "La conversion avec 'charconvert' a chou"
msgid "can't read output of 'charconvert'"
msgstr "Impossible de lire la sortie de 'charconvert'"
-msgid "E821: File is encrypted with unknown method"
-msgstr "E821: Le fichier est chiffr avec une mthode inconnue"
-
msgid "E676: No matching autocommands for acwrite buffer"
msgstr "E676: Pas d'autocommande correspondante pour le tampon acwrite"
@@ -2490,32 +2517,28 @@ msgid "Font '%s' is not fixed-width"
msgstr "La police '%s' n'a pas une largeur fixe"
#, c-format
-msgid "E253: Fontset name: %s\n"
-msgstr "E253: Nom du jeu de polices : %s\n"
+msgid "E253: Fontset name: %s"
+msgstr "E253: Nom du jeu de polices : %s"
#, c-format
-msgid "Font0: %s\n"
-msgstr "Font0: %s\n"
+msgid "Font0: %s"
+msgstr "Font0: %s"
#, c-format
-msgid "Font1: %s\n"
-msgstr "Font1: %s\n"
+msgid "Font1: %s"
+msgstr "Font1: %s"
#, c-format
-msgid "Font%ld width is not twice that of font0\n"
-msgstr "La largeur de Font%ld n'est pas le double de celle de Font0\n"
+msgid "Font%ld width is not twice that of font0"
+msgstr "La largeur de Font%ld n'est pas le double de celle de Font0"
#, c-format
-msgid "Font0 width: %ld\n"
-msgstr "Largeur de Font0 : %ld\n"
+msgid "Font0 width: %ld"
+msgstr "Largeur de Font0 : %ld"
#, c-format
-msgid ""
-"Font1 width: %ld\n"
-"\n"
-msgstr ""
-"Largeur de Font1 : %ld\n"
-"\n"
+msgid "Font1 width: %ld"
+msgstr "Largeur de Font1 : %ld"
# DB - todo : Pas certain de mon coup, ici...
msgid "Invalid font specification"
@@ -2709,6 +2732,9 @@ msgstr "E566: Impossible de crer les tuyaux (pipes) cscope"
msgid "E622: Could not fork for cscope"
msgstr "E622: Impossible de forker pour cscope"
+msgid "cs_create_connection setpgid failed"
+msgstr "cs_create_connection setpgid a chou"
+
msgid "cs_create_connection exec failed"
msgstr "exec de cs_create_connection a chou"
@@ -2879,9 +2905,6 @@ msgstr "non autoris dans le bac sable"
msgid "E836: This Vim cannot execute :python after using :py3"
msgstr "E836: Vim ne peut pas excuter :python aprs avoir utilis :py3"
-msgid "only string keys are allowed"
-msgstr "seule une chaine est autorise comme cl"
-
msgid ""
"E263: Sorry, this command is disabled, the Python library could not be "
"loaded."
@@ -2889,15 +2912,19 @@ msgstr ""
"E263: Dsol, commande dsactive : la bibliothque Python n'a pas pu tre "
"charge."
+msgid ""
+"E887: Sorry, this command is disabled, the Python's site module could not be "
+"loaded."
+msgstr ""
+"E887: Dsol, commande dsactive : la bibliothque Python n'a pas pu tre "
+"charge."
+
msgid "E659: Cannot invoke Python recursively"
msgstr "E659: Impossible d'invoquer Python rcursivement"
msgid "E837: This Vim cannot execute :py3 after using :python"
msgstr "E837: Vim ne peut pas excuter :py3 aprs avoir utilis :python"
-msgid "index must be int or slice"
-msgstr "index doit tre int ou slice"
-
msgid "E265: $_ must be an instance of String"
msgstr "E265: $_ doit tre une instance de chane (String)"
@@ -4249,13 +4276,6 @@ msgstr " (Interrompu)"
msgid "Beep!"
msgstr "Bip !"
-msgid "Vim: preserving files...\n"
-msgstr "Vim : prservation des fichiers...\n"
-
-#. close all memfiles, without deleting
-msgid "Vim: Finished.\n"
-msgstr "Vim : Fini.\n"
-
msgid "ERROR: "
msgstr "ERREUR : "
@@ -4305,15 +4325,6 @@ msgstr "E548: chiffre attendu"
msgid "E549: Illegal percentage"
msgstr "E549: Pourcentage non autoris"
-msgid "Enter encryption key: "
-msgstr "Tapez la cl de chiffrement : "
-
-msgid "Enter same key again: "
-msgstr "Tapez la cl nouveau : "
-
-msgid "Keys don't match!"
-msgstr "Les cls ne correspondent pas !"
-
msgid "E854: path too long for completion"
msgstr "E854: chemin trop long pour compltement"
@@ -4488,6 +4499,13 @@ msgstr ""
msgid "E574: Unknown register type %d"
msgstr "E574: Type de registre %d inconnu"
+msgid ""
+"E883: search pattern and expression register may not contain two or more "
+"lines"
+msgstr ""
+"E883: le motif de recherche et le registre d'expression ne peuvent pas "
+"contenir deux lignes ou plus"
+
#, c-format
msgid "%ld Cols; "
msgstr "%ld Colonnes ; "
@@ -4777,17 +4795,6 @@ msgstr "E244: Jeu de caractres \"%s\" invalide dans le nom de fonte \"%s\""
msgid "E245: Illegal char '%c' in font name \"%s\""
msgstr "E245: Caractre '%c' invalide dans le nom de fonte \"%s\""
-msgid "Vim: Double signal, exiting\n"
-msgstr "Vim : Double signal, sortie\n"
-
-#, c-format
-msgid "Vim: Caught deadly signal %s\n"
-msgstr "Vim : Signal mortel %s intercept\n"
-
-#, c-format
-msgid "Vim: Caught deadly signal\n"
-msgstr "Vim : Signal mortel intercept\n"
-
#, c-format
msgid "Opening the X display took %ld msec"
msgstr "L'ouverture du display X a pris %ld ms"
@@ -4819,6 +4826,19 @@ msgstr ""
"\n"
"Impossible de modifier le contexte de scurit pour "
+msgid "Could not set security context "
+msgstr "Impossible d'initialiser le contexte de scurit "
+
+msgid " for "
+msgstr " pour "
+
+#. no enough size OR unexpected error
+msgid "Could not get security context "
+msgstr "Impossible d'obtenir le contexte de scurit "
+
+msgid ". Removing it!\n"
+msgstr ". Suppression !\n"
+
msgid ""
"\n"
"Cannot execute shell "
@@ -5017,6 +5037,20 @@ msgstr "E54: %s( ouvrante non ferme"
msgid "E55: Unmatched %s)"
msgstr "E55: %s) fermante non ouverte"
+msgid "E66: \\z( not allowed here"
+msgstr "E66: \\z( n'est pas autoris ici"
+
+msgid "E67: \\z1 et al. not allowed here"
+msgstr "E67: \\z1 et co. ne sont pas autoriss ici"
+
+#, c-format
+msgid "E69: Missing ] after %s%%["
+msgstr "E69: ']' manquant aprs %s%%["
+
+#, c-format
+msgid "E70: Empty %s%%[]"
+msgstr "E70: %s%%[] vide"
+
msgid "E339: Pattern too long"
msgstr "E339: Motif trop long"
@@ -5056,24 +5090,10 @@ msgstr "E64: %s%c ne suit aucun atome"
msgid "E65: Illegal back reference"
msgstr "E65: post-rfrence invalide"
-msgid "E66: \\z( not allowed here"
-msgstr "E66: \\z( n'est pas autoris ici"
-
-msgid "E67: \\z1 et al. not allowed here"
-msgstr "E67: \\z1 et co. ne sont pas autoriss ici"
-
msgid "E68: Invalid character after \\z"
msgstr "E68: Caractre invalide aprs \\z"
#, c-format
-msgid "E69: Missing ] after %s%%["
-msgstr "E69: ']' manquant aprs %s%%["
-
-#, c-format
-msgid "E70: Empty %s%%[]"
-msgstr "E70: %s%%[] vide"
-
-#, c-format
msgid "E678: Invalid character after %s%%[dxouU]"
msgstr "E678: Caractre invalide aprs %s%%[dxouU]"
@@ -5088,6 +5108,10 @@ msgstr "E554: Erreur de syntaxe dans %s{...}"
msgid "External submatches:\n"
msgstr "Sous-correspondances externes :\n"
+#, c-format
+msgid "E888: (NFA regexp) cannot repeat %s"
+msgstr "E888: (regexp NFA) %s ne peut pas tre rpt"
+
msgid ""
"E864: \\%#= can only be followed by 0, 1, or 2. The automatic engine will be "
"used "
@@ -5095,17 +5119,28 @@ msgstr ""
"E864: \\%#= peut tre suivi uniquement de 0, 1 ou 2. Le moteur automatique "
"sera utilis "
+msgid "Switching to backtracking RE engine for pattern: "
+msgstr "Moteur RE avec backtracking utilis pour le motif : "
+
+msgid "E865: (NFA) Regexp end encountered prematurely"
+msgstr "E865: (NFA) Fin de regexp rencontre prmaturment"
+
#, c-format
msgid "E866: (NFA regexp) Misplaced %c"
msgstr "E866: (regexp NFA) %c au mauvais endroit"
-msgid "E865: (NFA) Regexp end encountered prematurely"
-msgstr "E865: (NFA) Fin de regexp rencontre prmaturment"
+#, c-format
+msgid "E877: (NFA regexp) Invalid character class: %ld"
+msgstr "E877: (regexp NFA) Classe de caractre invalide : %ld"
#, c-format
msgid "E867: (NFA) Unknown operator '\\z%c'"
msgstr "E867: (NFA) Oprateur inconnu '\\z%c'"
+#, c-format
+msgid "E867: (NFA) Unknown operator '\\%%%c'"
+msgstr "E867: (NFA) Oprateur inconnu '\\%%%c'"
+
#. should never happen
msgid "E868: Error building NFA with equivalence class!"
msgstr "E868: Erreur lors de la construction du NFA avec classe d'quivalence"
@@ -5117,12 +5152,17 @@ msgstr "E869: (NFA) Oprateur inconnu '\\@%c'"
msgid "E870: (NFA regexp) Error reading repetition limits"
msgstr "E870: (regexp NFA) Erreur la lecture des limites de rptition"
+#. Can't have a multi follow a multi.
msgid "E871: (NFA regexp) Can't have a multi follow a multi !"
msgstr "E871: (regexp NFA) Un multi ne peut pas suivre un multi !"
+#. Too many `('
msgid "E872: (NFA regexp) Too many '('"
msgstr "E872: (regexp NFA) Trop de '('"
+msgid "E879: (NFA regexp) Too many \\z("
+msgstr "E879: (regexp NFA) Trop de \\z("
+
msgid "E873: (NFA regexp) proper termination error"
msgstr "E873: (NFA regexp) erreur de terminaison"
@@ -5139,18 +5179,9 @@ msgstr ""
msgid "E876: (NFA regexp) Not enough space to store the whole NFA "
msgstr "E876: (regexp NFA) Pas assez de mmoire pour stocker le NFA"
-msgid "E999: (NFA regexp internal error) Should not process NOT node !"
+msgid "E878: (NFA) Could not allocate memory for branch traversal!"
msgstr ""
-"E999: (erreur interne du regexp NFA) Un noeud 'NOT' ne devrait pas tre "
-"trait !"
-
-#. should not be here :P
-msgid "E877: (NFA regexp) Invalid character class "
-msgstr "E877: (regexp NFA) Classe de caractre invalide "
-
-#, c-format
-msgid "(NFA) COULD NOT OPEN %s !"
-msgstr "(NFA) IMPOSSIBLE D'OUVRIR %s !"
+"E878: (NFA) Impossible d'allouer la mmoire pour parcourir les branches !"
msgid ""
"Could not open temporary log file for writing, displaying on stderr ... "
@@ -5158,9 +5189,9 @@ msgstr ""
"Impossible d'ouvrir le fichier de log temporaire en criture, affichage sur "
"stderr ... "
-msgid "E878: (NFA) Could not allocate memory for branch traversal!"
-msgstr ""
-"E878: (NFA) Impossible d'allouer la mmoire pour parcourir les branches!"
+#, c-format
+msgid "(NFA) COULD NOT OPEN %s !"
+msgstr "(NFA) IMPOSSIBLE D'OUVRIR %s !"
msgid "Could not open temporary log file for writing "
msgstr "Impossible d'ouvrir le fichier de log en criture"
@@ -5607,12 +5638,12 @@ msgid "E765: 'spellfile' does not have %ld entries"
msgstr "E765: 'spellfile' n'a pas %ld entres"
#, c-format
-msgid "Word removed from %s"
-msgstr "Mot retir de %s"
+msgid "Word '%.*s' removed from %s"
+msgstr "Mot '%.*s' retir de %s"
#, c-format
-msgid "Word added to %s"
-msgstr "Mot ajout dans %s"
+msgid "Word '%.*s' added to %s"
+msgstr "Mot '%.*s' ajout dans %s"
msgid "E763: Word characters differ between spell files"
msgstr ""
@@ -5668,6 +5699,9 @@ msgstr "E782: Erreur lors de la lecture de fichier de suggestions : %s"
msgid "E783: duplicate char in MAP entry"
msgstr "E783: caractres dupliqu dans l'entre MAP"
+msgid "No Syntax items defined for this buffer"
+msgstr "Aucun lment de syntaxe dfini pour ce tampon"
+
#, c-format
msgid "E390: Illegal argument: %s"
msgstr "E390: Argument invalide : %s"
@@ -5676,9 +5710,6 @@ msgstr "E390: Argument invalide : %s"
msgid "E391: No such syntax cluster: %s"
msgstr "E391: Aucune grappe de syntaxe %s"
-msgid "No Syntax items defined for this buffer"
-msgstr "Aucun lment de syntaxe dfini pour ce tampon"
-
msgid "syncing on C-style comments"
msgstr "synchronisation sur les commentaires de type C"
@@ -5808,6 +5839,11 @@ msgstr "E409: Nom de groupe inconnu : %s"
msgid "E410: Invalid :syntax subcommand: %s"
msgstr "E410: Sous-commande de :syntax invalide : %s"
+msgid ""
+" TOTAL COUNT MATCH SLOWEST AVERAGE NAME PATTERN"
+msgstr ""
+" TOTAL NOMBRE MATCH PLUS LENT MOYEN NOM MOTIF"
+
msgid "E679: recursive loop loading syncolor.vim"
msgstr "E679: boucle rcursive lors du chargement de syncolor.vim"
@@ -6005,8 +6041,8 @@ msgstr "CUT_BUFFER0 utilis plutt qu'une slection vide"
#. This happens when the FileChangedRO autocommand changes the
#. * file in a way it becomes shorter.
-msgid "E834: Line count changed unexpectedly"
-msgstr "E834: Le nombre de lignes a t chang inopinment"
+msgid "E881: Line count changed unexpectedly"
+msgstr "E881: Le nombre de lignes a t chang inopinment"
# DB - Question O/N.
#. must display the prompt
@@ -6501,6 +6537,9 @@ msgstr "E446: Aucun nom de fichier sous le curseur"
msgid "E447: Can't find file \"%s\" in path"
msgstr "E447: Le fichier \"%s\" est introuvable dans 'path'"
+msgid "List or number required"
+msgstr "Liste ou nombre requis"
+
#, c-format
msgid "E370: Could not load library %s"
msgstr "E370: Impossible de charger la bibliothque %s"
@@ -6737,6 +6776,9 @@ msgstr "E485: Impossible de lire le fichier %s"
msgid "E37: No write since last change (add ! to override)"
msgstr "E37: Modifications non enregistres (ajoutez ! pour passer outre)"
+msgid "E37: No write since last change"
+msgstr "E37: Modifications non enregistres"
+
msgid "E38: Null argument"
msgstr "E38: Argument null"
@@ -6897,107 +6939,180 @@ msgstr "La recherche a atteint le BAS, et continue en HAUT"
msgid "Need encryption key for \"%s\""
msgstr "Besoin de la cl de chiffrement pour \"%s\""
-msgid "can't delete OutputObject attributes"
-msgstr "impossible d'effacer les attributs d'OutputObject"
+msgid "empty keys are not allowed"
+msgstr "les cls vides ne sont pas autorises"
+
+msgid "dictionary is locked"
+msgstr "dictionnaire est verrouill"
+
+msgid "list is locked"
+msgstr "liste verrouille"
+
+#, c-format
+msgid "failed to add key '%s' to dictionary"
+msgstr "l'ajout de cl '%s' au dictionnaire a chou"
-msgid "softspace must be an integer"
-msgstr "softspace doit tre un nombre entier"
+#, c-format
+msgid "index must be int or slice, not %s"
+msgstr "index doit tre int ou slice, et non %s"
-msgid "invalid attribute"
-msgstr "attribut invalide"
+#, c-format
+msgid "expected str() or unicode() instance, but got %s"
+msgstr "attendu instance de str() ou unicode(), mais reu %s"
-msgid "writelines() requires list of strings"
-msgstr "writelines() requiert une liste de chanes"
+#, c-format
+msgid "expected bytes() or str() instance, but got %s"
+msgstr "attendu instance de bytes() ou str(), mais reu %s"
+
+#, c-format
+msgid ""
+"expected int(), long() or something supporting coercing to long(), but got %s"
+msgstr ""
+"attendu int(), long() ou quelque chose qui peut tre transform en long(), "
+"mais reu %s"
+
+#, c-format
+msgid "expected int() or something supporting coercing to int(), but got %s"
+msgstr ""
+"attendu int() ou quelque chose qui peut tre transform en int(), mais reu "
+"%s"
+
+msgid "value is too large to fit into C int type"
+msgstr "valeur trop grande pour tre stocke dans le type C int"
+
+msgid "value is too small to fit into C int type"
+msgstr "valeur trop petite pour tre stocke dans le type C int"
+
+msgid "number must be greater than zero"
+msgstr "le nombre doit tre plus grand que zro"
+
+msgid "number must be greater or equal to zero"
+msgstr "le nombre doit tre plus grand ou gal zro"
+
+msgid "can't delete OutputObject attributes"
+msgstr "impossible d'effacer les attributs d'OutputObject"
+
+#, c-format
+msgid "invalid attribute: %s"
+msgstr "attribut invalide : %s"
msgid "E264: Python: Error initialising I/O objects"
msgstr "E264: Python : Erreur d'initialisation des objets d'E/S"
-msgid "empty keys are not allowed"
-msgstr "les cls vides ne sont pas autorises"
+msgid "failed to change directory"
+msgstr "changement de rpertoire a chou"
-msgid "Cannot delete DictionaryObject attributes"
-msgstr "Impossible d'effacer les attributs de DictionaryObject"
+#, c-format
+msgid "expected 3-tuple as imp.find_module() result, but got %s"
+msgstr "attendu un 3-tuple comme rsultat de imp.find_module(), mais reu %s"
-msgid "Cannot modify fixed dictionary"
-msgstr "Impossible de modifier un dictionnaire fixe"
+#, c-format
+msgid "expected 3-tuple as imp.find_module() result, but got tuple of size %d"
+msgstr ""
+"attendu un 3-tuple comme rsultat de imp.find_module(), mais reu un tuple "
+"de taille %d"
-msgid "Cannot set this attribute"
-msgstr "Impossible d'initialiser cet attribut"
+msgid "internal error: imp.find_module returned tuple with NULL"
+msgstr "erreur interne : imp.find_module a retourn un tuple contenant NULL"
-msgid "dict is locked"
-msgstr "dictionnaire est verrouill"
+msgid "cannot delete vim.Dictionary attributes"
+msgstr "impossible d'effacer les attributs de vim.Dictionary"
-msgid "failed to add key to dictionary"
-msgstr "l'ajout de cl au dictionnaire a chou"
+msgid "cannot modify fixed dictionary"
+msgstr "impossible de modifier un dictionnaire fixe"
+
+#, c-format
+msgid "cannot set attribute %s"
+msgstr "impossible d'initialiser l'attribut %s"
+
+msgid "hashtab changed during iteration"
+msgstr "la table de hachage a t change pendant une itration"
+
+#, c-format
+msgid "expected sequence element of size 2, but got sequence of size %d"
+msgstr ""
+"attendu une squence d'lments de taille 2, mais reu une squence de "
+"taille %d"
+
+msgid "list constructor does not accept keyword arguments"
+msgstr "le constructeur de liste n'accepte pas les arguments nomms"
msgid "list index out of range"
msgstr "index de liste hors limites"
-msgid "internal error: failed to get vim list item"
-msgstr "erreur interne : accs un lment de liste a chou"
+#. No more suitable format specifications in python-2.3
+#, c-format
+msgid "internal error: failed to get vim list item %d"
+msgstr "erreur interne : accs un lment %d de liste a chou"
-msgid "list is locked"
-msgstr "liste verrouille"
+msgid "slice step cannot be zero"
+msgstr "le pas du dcoupage en tranche ne peut pas tre zro"
-msgid "Failed to add item to list"
-msgstr "Ajout la liste a chou"
+#, c-format
+msgid "attempt to assign sequence of size greater than %d to extended slice"
+msgstr ""
+"tentative d'assigner une squence de taille plus grande que %d un "
+"dcoupage en tranche tendu "
-msgid "internal error: no vim list item"
-msgstr "erreur interne : pas d'lment de liste vim"
+#, c-format
+msgid "internal error: no vim list item %d"
+msgstr "erreur interne : pas d'lment %d de liste vim"
-msgid "can only assign lists to slice"
-msgstr "seules des tranches peuvent tre assignes aux listes"
+msgid "internal error: not enough list items"
+msgstr "erreur interne : pas assez d'lments de liste"
msgid "internal error: failed to add item to list"
msgstr "erreur interne : ajout d'lment la liste a chou"
-msgid "can only concatenate with lists"
-msgstr "on ne peut que concatner avec des listes"
+#, c-format
+msgid "attempt to assign sequence of size %d to extended slice of size %d"
+msgstr ""
+"tentative d'assigner une squence de taille %d un dcoupage en tranche "
+"tendu de taille %d"
-msgid "cannot delete vim.dictionary attributes"
-msgstr "impossible d'effacer les attributs de vim.dictionary"
+msgid "failed to add item to list"
+msgstr "ajout la liste a chou"
+
+msgid "cannot delete vim.List attributes"
+msgstr "impossible d'effacer les attributs de vim.List"
msgid "cannot modify fixed list"
msgstr "impossible de modifier une liste fixe"
-msgid "cannot set this attribute"
-msgstr "impossible d'initialiser cet attribut"
+#, c-format
+msgid "unnamed function %s does not exist"
+msgstr "la fonction sans nom %s n'existe pas"
-msgid "'self' argument must be a dictionary"
-msgstr "l'argument 'self' doit tre un dictionnaire"
+#, c-format
+msgid "function %s does not exist"
+msgstr "la fonction %s n'existe pas"
+
+msgid "function constructor does not accept keyword arguments"
+msgstr "le constructeur de fonction n'accepte pas les arguments nomms"
-msgid "failed to run function"
-msgstr "excution de la fonction a chou"
+#, c-format
+msgid "failed to run function %s"
+msgstr "excution de la fonction %s a chou"
msgid "unable to get option value"
msgstr "impossible d'obtenir la valeur d'une option"
-msgid "unable to unset global option"
-msgstr "impossible de dsactiver une option globale"
-
-msgid "unable to unset option without global value"
-msgstr "impossible de dsactiver une option sans une valeur globale"
+msgid "internal error: unknown option type"
+msgstr "erreur interne : type d'option inconnu"
-msgid "object must be integer"
-msgstr "objet doit tre un nombre entier"
-
-msgid "object must be string"
-msgstr "objet doit tre de type string"
-
-msgid "attempt to refer to deleted tab page"
-msgstr "tentative de rfrencer un onglet effac"
+msgid "problem while switching windows"
+msgstr "problme lors du changement de fentres"
#, c-format
-msgid "<tabpage object (deleted) at %p>"
-msgstr "<objet onglet (effac) %p>"
+msgid "unable to unset global option %s"
+msgstr "impossible de dsactiver une option globale %s"
#, c-format
-msgid "<tabpage object (unknown) at %p>"
-msgstr "<objet onglet (inconnu) %p>"
+msgid "unable to unset option %s which does not have global value"
+msgstr "impossible de dsactiver l'option %s qui n'a pas de valeur globale"
-#, c-format
-msgid "<tabpage %d>"
-msgstr "<onglet %d>"
+msgid "attempt to refer to deleted tab page"
+msgstr "tentative de rfrencer un onglet effac"
msgid "no such tab page"
msgstr "cet onglet n'existe pas"
@@ -7005,45 +7120,35 @@ msgstr "cet onglet n'existe pas"
msgid "attempt to refer to deleted window"
msgstr "tentative de rfrencer une fentre efface"
-msgid "readonly attribute"
-msgstr "attribut en lecture seule"
+msgid "readonly attribute: buffer"
+msgstr "attribut en lecture seule : tampon"
msgid "cursor position outside buffer"
msgstr "curseur positionn en dehors du tampon"
-#, c-format
-msgid "<window object (deleted) at %p>"
-msgstr "<objet fentre (effac) %p>"
-
-#, c-format
-msgid "<window object (unknown) at %p>"
-msgstr "<objet fentre (inconnu) %p>"
-
-#, c-format
-msgid "<window %d>"
-msgstr "<fentre %d>"
-
msgid "no such window"
msgstr "Cette fentre n'existe pas"
msgid "attempt to refer to deleted buffer"
msgstr "tentative de rfrencer un tampon effac"
-#, c-format
-msgid "<buffer object (deleted) at %p>"
-msgstr "<objet tampon (effac) %p>"
+msgid "failed to rename buffer"
+msgstr "impossible de renommer le tampon"
-msgid "key must be integer"
-msgstr "la cl doit tre un nombre entier"
+msgid "mark name must be a single character"
+msgstr "le nom de marque doit tre un seul caractre"
-msgid "expected vim.buffer object"
-msgstr "objet vim.buffer attendu"
+#, c-format
+msgid "expected vim.Buffer object, but got %s"
+msgstr "attendu un objet objet vim.Buffer, mais reu %s"
-msgid "failed to switch to given buffer"
-msgstr "impossible de se dplacer au tampon donn"
+#, c-format
+msgid "failed to switch to buffer %d"
+msgstr "impossible de se dplacer au tampon %d"
-msgid "expected vim.window object"
-msgstr "objet vim.window attendu"
+#, c-format
+msgid "expected vim.Window object, but got %s"
+msgstr "attendu un objet vim.Window, mais reu %s"
msgid "failed to find window in the current tab page"
msgstr "impossible de trouver une fentre dans l'onglet courant"
@@ -7051,8 +7156,9 @@ msgstr "impossible de trouver une fentre dans l'onglet courant"
msgid "did not switch to the specified window"
msgstr "ne s'est pas dplac la fentre spcifie"
-msgid "expected vim.tabpage object"
-msgstr "objet vim.tabpage attendu"
+#, c-format
+msgid "expected vim.TabPage object, but got %s"
+msgstr "attendu un objet vim.TabPage, mais reu %s"
msgid "did not switch to the specified tab page"
msgstr "impossible de se dplacer l'onglet spcifi"
@@ -7066,15 +7172,115 @@ msgstr "E858: Eval n'a pas retourn un objet python valide"
msgid "E859: Failed to convert returned python object to vim value"
msgstr "E859: Conversion d'objet python une valeur de vim a chou"
-msgid "unable to convert to vim structure"
-msgstr "conversion une structure vim impossible"
+#, c-format
+msgid "unable to convert %s to vim dictionary"
+msgstr "impossible de convertir %s un dictionnaire vim"
-msgid "NULL reference passed"
-msgstr "rfrence NULL passe"
+#, c-format
+msgid "unable to convert %s to vim structure"
+msgstr "impossible de convertir %s une structure de vim"
+
+msgid "internal error: NULL reference passed"
+msgstr "erreur interne : rfrence NULL passe"
msgid "internal error: invalid value type"
msgstr "erreur interne : type de valeur invalide"
+msgid ""
+"Failed to set path hook: sys.path_hooks is not a list\n"
+"You should now do the following:\n"
+"- append vim.path_hook to sys.path_hooks\n"
+"- append vim.VIM_SPECIAL_PATH to sys.path\n"
+msgstr ""
+"Impossible d'initialiser sys.path_hook qui n'est pas un liste\n"
+"Vous devez maintenant :\n"
+"- ajouter vim.path_hook sys.path_hooks\n"
+"- ajouter vim.VIM_SPECIAL_PATH sys.path\n"
+
+msgid ""
+"Failed to set path: sys.path is not a list\n"
+"You should now append vim.VIM_SPECIAL_PATH to sys.path"
+msgstr ""
+"Impossible d'initialiser le chemin : sys.math n'est pas une liste\n"
+"Vous devez maintenant ajouter vim.VIM_SPECIAL_PATH sys.path"
+
+#~ msgid "[blowfish]"
+#~ msgstr "[blowfish]"
+
+#~ msgid "only string keys are allowed"
+#~ msgstr "seule une chaine est autorise comme cl"
+
+#~ msgid "Vim: preserving files...\n"
+#~ msgstr "Vim : prservation des fichiers...\n"
+
+#~ msgid "Vim: Finished.\n"
+#~ msgstr "Vim : Fini.\n"
+
+#~ msgid "Vim: Double signal, exiting\n"
+#~ msgstr "Vim : Double signal, sortie\n"
+
+#~ msgid "Vim: Caught deadly signal %s\n"
+#~ msgstr "Vim : Signal mortel %s intercept\n"
+
+#~ msgid "Vim: Caught deadly signal\n"
+#~ msgstr "Vim : Signal mortel intercept\n"
+
+#~ msgid "E999: (NFA regexp internal error) Should not process NOT node !"
+#~ msgstr ""
+#~ "E999: (erreur interne du regexp NFA) Un noeud 'NOT' ne devrait pas tre "
+#~ "trait !"
+
+#~ msgid "softspace must be an integer"
+#~ msgstr "softspace doit tre un nombre entier"
+
+#~ msgid "writelines() requires list of strings"
+#~ msgstr "writelines() requiert une liste de chanes"
+
+#~ msgid "Cannot delete DictionaryObject attributes"
+#~ msgstr "Impossible d'effacer les attributs de DictionaryObject"
+
+#~ msgid "Cannot set this attribute"
+#~ msgstr "Impossible d'initialiser cet attribut"
+
+#~ msgid "can only assign lists to slice"
+#~ msgstr "seules des tranches peuvent tre assignes aux listes"
+
+#~ msgid "can only concatenate with lists"
+#~ msgstr "on ne peut que concatner avec des listes"
+
+#~ msgid "'self' argument must be a dictionary"
+#~ msgstr "l'argument 'self' doit tre un dictionnaire"
+
+#~ msgid "object must be integer"
+#~ msgstr "objet doit tre un nombre entier"
+
+#~ msgid "object must be string"
+#~ msgstr "objet doit tre de type string"
+
+#~ msgid "<tabpage object (deleted) at %p>"
+#~ msgstr "<objet onglet (effac) %p>"
+
+#~ msgid "<tabpage object (unknown) at %p>"
+#~ msgstr "<objet onglet (inconnu) %p>"
+
+#~ msgid "<tabpage %d>"
+#~ msgstr "<onglet %d>"
+
+#~ msgid "<window object (deleted) at %p>"
+#~ msgstr "<objet fentre (effac) %p>"
+
+#~ msgid "<window object (unknown) at %p>"
+#~ msgstr "<objet fentre (inconnu) %p>"
+
+#~ msgid "<window %d>"
+#~ msgstr "<fentre %d>"
+
+#~ msgid "<buffer object (deleted) at %p>"
+#~ msgstr "<objet tampon (effac) %p>"
+
+#~ msgid "key must be integer"
+#~ msgstr "la cl doit tre un nombre entier"
+
#~ msgid "E860: Eval did not return a valid python 3 object"
#~ msgstr "E860: Eval n'a pas retourn un object python 3 valid"
diff --git a/src/po/ja.sjis.po b/src/po/ja.sjis.po
index e9c392d8a..8d7e7cf5b 100644
--- a/src/po/ja.sjis.po
+++ b/src/po/ja.sjis.po
@@ -8,7 +8,7 @@
# Copyright (C) 2001-13 MURAOKA Taro <koron.kaoriya@gmail.com>
# THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE.
#
-# Original translations.
+# generated from ja.po, DO NOT EDIT
#
msgid ""
msgstr ""
diff --git a/src/po/ru.cp1251.po b/src/po/ru.cp1251.po
index 8205c813d..6582507eb 100644
--- a/src/po/ru.cp1251.po
+++ b/src/po/ru.cp1251.po
@@ -7,10 +7,10 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: vim_7.4_ru\n"
+"Project-Id-Version: vim_ru\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-03-24 12:18+0400\n"
-"PO-Revision-Date: 2014-03-24 12:18 +0400\n"
+"POT-Creation-Date: 2014-10-10 11:52+0400\n"
+"PO-Revision-Date: 2014-10-10 12:00+0400\n"
"Last-Translator: Sergey Alyoshin <alyoshin.s@gmail.com>\n"
"Language-Team: \n"
"Language: Russian\n"
@@ -203,6 +203,21 @@ msgstr " %s:"
msgid " line=%ld id=%d name=%s"
msgstr " =%ld id=%d =%s"
+msgid "E821: File is encrypted with unknown method"
+msgstr "E821: "
+
+msgid "Enter encryption key: "
+msgstr " : "
+
+msgid "Enter same key again: "
+msgstr " : "
+
+msgid "Keys don't match!"
+msgstr " !"
+
+msgid "[crypted]"
+msgstr "[]"
+
#, c-format
msgid "E96: Can not diff more than %ld buffers"
msgstr "E96: %ld "
@@ -659,9 +674,16 @@ msgstr "E258: "
msgid "sort() argument"
msgstr " sort()"
+msgid "uniq() argument"
+msgstr " uniq()"
+
msgid "E702: Sort compare function failed"
msgstr "E702: "
+msgid "E882: Uniq compare function failed"
+msgstr ""
+"E882: "
+
msgid "(Invalid)"
msgstr "()"
@@ -759,10 +781,12 @@ msgid "E129: Function name required"
msgstr "E129: "
#, c-format
-msgid "E128: Function name must start with a capital or contain a colon: %s"
-msgstr ""
-"E128: "
-": %s"
+msgid "E128: Function name must start with a capital or \"s:\": %s"
+msgstr "E128: \"s:\": %s"
+
+#, c-format
+msgid "E884: Function name cannot contain a colon: %s"
+msgstr "E884: : %s"
#, c-format
msgid "E131: Cannot delete function %s: It is in use"
@@ -880,6 +904,10 @@ msgstr "E138: viminfo %s!"
msgid "Writing viminfo file \"%s\""
msgstr " viminfo \"%s\""
+#, c-format
+msgid "E886: Can't rename viminfo file to %s!"
+msgstr "E886: viminfo %s!"
+
#. Write the info:
#, c-format
msgid "# This viminfo file was generated by Vim %s.\n"
@@ -1080,6 +1108,10 @@ msgstr "E158: : %s"
msgid "E157: Invalid sign ID: %ld"
msgstr "E157: ID : %ld"
+#, c-format
+msgid "E885: Not possible to change sign %s"
+msgstr "E885: %s"
+
msgid " (NOT FOUND)"
msgstr " ( )"
@@ -1663,12 +1695,6 @@ msgstr "[ ]"
msgid "[converted]"
msgstr "[]"
-msgid "[blowfish]"
-msgstr "[blowfish]"
-
-msgid "[crypted]"
-msgstr "[]"
-
#, c-format
msgid "[CONVERSION ERROR in line %ld]"
msgstr "[ %ld]"
@@ -1689,9 +1715,6 @@ msgstr " 'charconvert' "
msgid "can't read output of 'charconvert'"
msgstr " 'charconvert'"
-msgid "E821: File is encrypted with unknown method"
-msgstr "E821: "
-
msgid "E676: No matching autocommands for acwrite buffer"
msgstr "E676: acwrite"
@@ -2654,6 +2677,13 @@ msgstr ""
"E263: , "
"Python"
+msgid ""
+"E887: Sorry, this command is disabled, the Python's site module could not be "
+"loaded."
+msgstr ""
+"E887: , "
+"Python site."
+
msgid "E659: Cannot invoke Python recursively"
msgstr "E659: Python"
@@ -4068,15 +4098,6 @@ msgstr "E548: "
msgid "E549: Illegal percentage"
msgstr "E549: "
-msgid "Enter encryption key: "
-msgstr " : "
-
-msgid "Enter same key again: "
-msgstr " : "
-
-msgid "Keys don't match!"
-msgstr " !"
-
msgid "E854: path too long for completion"
msgstr "E854: "
@@ -4248,6 +4269,13 @@ msgstr ""
msgid "E574: Unknown register type %d"
msgstr "E574: %d"
+msgid ""
+"E883: search pattern and expression register may not contain two or more "
+"lines"
+msgstr ""
+"E883: "
+""
+
#, c-format
msgid "%ld Cols; "
msgstr ": %ld; "
@@ -4565,6 +4593,19 @@ msgstr ""
"\n"
" "
+msgid "Could not set security context "
+msgstr " "
+
+msgid " for "
+msgstr " "
+
+#. no enough size OR unexpected error
+msgid "Could not get security context "
+msgstr " "
+
+msgid ". Removing it!\n"
+msgstr ". !\n"
+
msgid ""
"\n"
"Cannot execute shell "
@@ -4834,6 +4875,10 @@ msgstr "E554: %s{...}"
msgid "External submatches:\n"
msgstr " :\n"
+#, c-format
+msgid "E888: (NFA regexp) cannot repeat %s"
+msgstr "E888: (. ) %s"
+
msgid ""
"E864: \\%#= can only be followed by 0, 1, or 2. The automatic engine will be "
"used "
@@ -6232,6 +6277,9 @@ msgstr "E446: "
msgid "E447: Can't find file \"%s\" in path"
msgstr "E447: \"%s\" "
+msgid "List or number required"
+msgstr " "
+
#, c-format
msgid "E370: Could not load library %s"
msgstr "E370: %s"
@@ -6888,3 +6936,4 @@ msgid ""
msgstr ""
" : sys.path \n"
" vim.VIM_SPECIAL_PATH sys.path"
+
diff --git a/src/po/ru.po b/src/po/ru.po
index 1d7f16deb..2c15b757b 100644
--- a/src/po/ru.po
+++ b/src/po/ru.po
@@ -7,10 +7,10 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: vim_7.4_ru\n"
+"Project-Id-Version: vim_ru\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-03-24 12:18+0400\n"
-"PO-Revision-Date: 2014-03-24 12:18 +0400\n"
+"POT-Creation-Date: 2014-10-10 11:52+0400\n"
+"PO-Revision-Date: 2014-10-10 12:00+0400\n"
"Last-Translator: Sergey Alyoshin <alyoshin.s@gmail.com>\n"
"Language-Team: \n"
"Language: Russian\n"
@@ -203,6 +203,21 @@ msgstr "Значки для %s:"
msgid " line=%ld id=%d name=%s"
msgstr " строка=%ld id=%d имя=%s"
+msgid "E821: File is encrypted with unknown method"
+msgstr "E821: Файл зашифрован неизвестным методом"
+
+msgid "Enter encryption key: "
+msgstr "Введите пароль для шифрования: "
+
+msgid "Enter same key again: "
+msgstr "Повторите ввод пароля: "
+
+msgid "Keys don't match!"
+msgstr "Введённые пароли не совпадают!"
+
+msgid "[crypted]"
+msgstr "[зашифровано]"
+
#, c-format
msgid "E96: Can not diff more than %ld buffers"
msgstr "E96: Следить за отличиями можно не более чем в %ld буферах"
@@ -659,9 +674,16 @@ msgstr "E258: Не могу ответить клиенту"
msgid "sort() argument"
msgstr "параметра sort()"
+msgid "uniq() argument"
+msgstr "параметра uniq()"
+
msgid "E702: Sort compare function failed"
msgstr "E702: Неудачное завершение функции сравнения при сортировке"
+msgid "E882: Uniq compare function failed"
+msgstr ""
+"E882: Неудачное завершение функции сравнения при проверке единственности"
+
msgid "(Invalid)"
msgstr "(Неправильно)"
@@ -759,10 +781,12 @@ msgid "E129: Function name required"
msgstr "E129: Требуется имя функции"
#, c-format
-msgid "E128: Function name must start with a capital or contain a colon: %s"
-msgstr ""
-"E128: Имя функции должно начинаться с заглавной буквы или содержать "
-"двоеточие: %s"
+msgid "E128: Function name must start with a capital or \"s:\": %s"
+msgstr "E128: Имя функции должно начинаться с заглавной буквы или \"s:\": %s"
+
+#, c-format
+msgid "E884: Function name cannot contain a colon: %s"
+msgstr "E884: Имя функции не может содержать двоеточие: %s"
#, c-format
msgid "E131: Cannot delete function %s: It is in use"
@@ -880,6 +904,10 @@ msgstr "E138: Невозможно записать файл viminfo %s!"
msgid "Writing viminfo file \"%s\""
msgstr "Запись файла viminfo \"%s\""
+#, c-format
+msgid "E886: Can't rename viminfo file to %s!"
+msgstr "E886: Невозможно переименовать файл viminfo в %s!"
+
#. Write the info:
#, c-format
msgid "# This viminfo file was generated by Vim %s.\n"
@@ -1080,6 +1108,10 @@ msgstr "E158: Неправильное имя буфера: %s"
msgid "E157: Invalid sign ID: %ld"
msgstr "E157: Неправильный ID значка: %ld"
+#, c-format
+msgid "E885: Not possible to change sign %s"
+msgstr "E885: Невозможно изменить значок %s"
+
msgid " (NOT FOUND)"
msgstr " (НЕ НАЙДЕНО)"
@@ -1663,12 +1695,6 @@ msgstr "[БЕЗ преобразований]"
msgid "[converted]"
msgstr "[перекодировано]"
-msgid "[blowfish]"
-msgstr "[blowfish]"
-
-msgid "[crypted]"
-msgstr "[зашифровано]"
-
#, c-format
msgid "[CONVERSION ERROR in line %ld]"
msgstr "[ОШИБКА ПРЕОБРАЗОВАНИЯ в строке %ld]"
@@ -1689,9 +1715,6 @@ msgstr "Преобразование с помощью 'charconvert' не вып
msgid "can't read output of 'charconvert'"
msgstr "невозможно прочитать вывод 'charconvert'"
-msgid "E821: File is encrypted with unknown method"
-msgstr "E821: Файл зашифрован неизвестным методом"
-
msgid "E676: No matching autocommands for acwrite buffer"
msgstr "E676: Нет подходящих автокоманд для буфера acwrite"
@@ -2654,6 +2677,13 @@ msgstr ""
"E263: К сожалению эта команда не работает, поскольку не загружена библиотека "
"Python"
+msgid ""
+"E887: Sorry, this command is disabled, the Python's site module could not be "
+"loaded."
+msgstr ""
+"E887: К сожалению эта команда не работает, поскольку не загружен модуль "
+"Python site."
+
msgid "E659: Cannot invoke Python recursively"
msgstr "E659: Невозможно выполнить рекурсивный вызов Python"
@@ -4068,15 +4098,6 @@ msgstr "E548: Требуется ввести цифру"
msgid "E549: Illegal percentage"
msgstr "E549: Недопустимое значение процентов"
-msgid "Enter encryption key: "
-msgstr "Введите пароль для шифрования: "
-
-msgid "Enter same key again: "
-msgstr "Повторите ввод пароля: "
-
-msgid "Keys don't match!"
-msgstr "Введённые пароли не совпадают!"
-
msgid "E854: path too long for completion"
msgstr "E854: слишком большой путь для автодополнения"
@@ -4248,6 +4269,13 @@ msgstr ""
msgid "E574: Unknown register type %d"
msgstr "E574: Неизвестный тип регистра %d"
+msgid ""
+"E883: search pattern and expression register may not contain two or more "
+"lines"
+msgstr ""
+"E883: шаблон поиска и регистр выражения не могут содержать двух или более "
+"строк"
+
#, c-format
msgid "%ld Cols; "
msgstr "Колонок: %ld; "
@@ -4565,6 +4593,19 @@ msgstr ""
"\n"
"Невозможно установить контекст безопасности для "
+msgid "Could not set security context "
+msgstr "Невозможно установить контекст безопасности "
+
+msgid " for "
+msgstr " для "
+
+#. no enough size OR unexpected error
+msgid "Could not get security context "
+msgstr "Невозможно получить контекст безопасности "
+
+msgid ". Removing it!\n"
+msgstr ". Будет удалён!\n"
+
msgid ""
"\n"
"Cannot execute shell "
@@ -4834,6 +4875,10 @@ msgstr "E554: Синтаксическая ошибка в %s{...}"
msgid "External submatches:\n"
msgstr "Внешние подсоответствия:\n"
+#, c-format
+msgid "E888: (NFA regexp) cannot repeat %s"
+msgstr "E888: (рег. выражение НКА) невозможно повторить %s"
+
msgid ""
"E864: \\%#= can only be followed by 0, 1, or 2. The automatic engine will be "
"used "
@@ -6232,6 +6277,9 @@ msgstr "E446: Нет имени файла в позиции курсора"
msgid "E447: Can't find file \"%s\" in path"
msgstr "E447: Файл \"%s\" не найден по известным путям"
+msgid "List or number required"
+msgstr "Требуется список или число"
+
#, c-format
msgid "E370: Could not load library %s"
msgstr "E370: Невозможно загрузить библиотеку %s"
@@ -6888,3 +6936,4 @@ msgid ""
msgstr ""
"Ошибка при установке пути: sys.path не является списком\n"
"Следует добавить vim.VIM_SPECIAL_PATH в sys.path"
+
diff --git a/src/po/sjiscorr.c b/src/po/sjiscorr.c
index fec4740c0..b8f7e632a 100644
--- a/src/po/sjiscorr.c
+++ b/src/po/sjiscorr.c
@@ -23,9 +23,8 @@ main(argc, argv)
fputs("charset=cp932", stdout);
p += 12;
}
- else if (strncmp(p, "ja.po - Japanese message file", 29) == 0)
+ else if (strncmp(p, "# Original translations", 23) == 0)
{
- fputs("ja.sjis.po - Japanese message file for Vim (version 6.x)\n", stdout);
fputs("# generated from ja.po, DO NOT EDIT", stdout);
while (p[1] != '\n')
++p;
diff --git a/src/po/uk.cp1251.po b/src/po/uk.cp1251.po
index e97aaf1ca..e3f8df0ca 100644
--- a/src/po/uk.cp1251.po
+++ b/src/po/uk.cp1251.po
@@ -12,7 +12,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vim 7.4\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-09-29 09:05+0300\n"
+"POT-Creation-Date: 2014-11-08 08:23+0200\n"
"PO-Revision-Date: 2010-06-18 21:53+0300\n"
"Last-Translator: <sakhnik@gmail.com>\n"
"Language-Team: Bohdan Vlasyuk <bohdan@vstu.edu.ua>\n"
@@ -81,6 +81,9 @@ msgstr " "
msgid "%d buffers wiped out"
msgstr " %d ()"
+msgid "E90: Cannot unload last buffer"
+msgstr "E90: "
+
msgid "E84: No modified buffer found"
msgstr "E84: "
@@ -102,9 +105,6 @@ msgstr "E88: "
msgid "E89: No write since last change for buffer %ld (add ! to override)"
msgstr "E89: %ld (! )"
-msgid "E90: Cannot unload last buffer"
-msgstr "E90: "
-
msgid "W14: Warning: List of file names overflow"
msgstr "W14: : "
@@ -204,6 +204,21 @@ msgstr " %s:"
msgid " line=%ld id=%d name=%s"
msgstr " =%ld id=%d =%s"
+msgid "E821: File is encrypted with unknown method"
+msgstr "E821: "
+
+msgid "Enter encryption key: "
+msgstr " : "
+
+msgid "Enter same key again: "
+msgstr " : "
+
+msgid "Keys don't match!"
+msgstr " !"
+
+msgid "[crypted]"
+msgstr "[]"
+
#, c-format
msgid "E96: Can not diff more than %ld buffers"
msgstr "E96: %ld ()"
@@ -683,9 +698,17 @@ msgstr "E258: 볺"
msgid "sort() argument"
msgstr " sort()"
+# msgstr "E14: "
+msgid "uniq() argument"
+msgstr " unique()"
+
# msgstr "E364: "
msgid "E702: Sort compare function failed"
-msgstr "E702: "
+msgstr "E702: sort"
+
+# msgstr "E364: "
+msgid "E882: Uniq compare function failed"
+msgstr "E882: uniq"
msgid "(Invalid)"
msgstr "()"
@@ -783,9 +806,13 @@ msgid "E129: Function name required"
msgstr "E129: "
#, c-format
-msgid "E128: Function name must start with a capital or contain a colon: %s"
+msgid "E128: Function name must start with a capital or \"s:\": %s"
msgstr ""
-"E128: : %s"
+"E128: \"s:\": %s"
+
+#, c-format
+msgid "E884: Function name cannot contain a colon: %s"
+msgstr "E884: : %s"
#, c-format
msgid "E131: Cannot delete function %s: It is in use"
@@ -1036,6 +1063,10 @@ msgstr "E138: viminfo %s!"
msgid "Writing viminfo file \"%s\""
msgstr " viminfo %s"
+#, c-format
+msgid "E886: Can't rename viminfo file to %s!"
+msgstr "E886: viminfo %s!"
+
#. Write the info:
#, c-format
msgid "# This viminfo file was generated by Vim %s.\n"
@@ -1233,6 +1264,10 @@ msgstr "E158: : %s"
msgid "E157: Invalid sign ID: %ld"
msgstr "E157: ID : %ld"
+#, c-format
+msgid "E885: Not possible to change sign %s"
+msgstr "E885: %s"
+
msgid " (NOT FOUND)"
msgstr " ( )"
@@ -1707,12 +1742,6 @@ msgstr "[ ]"
msgid "[converted]"
msgstr "[]"
-msgid "[blowfish]"
-msgstr "[blowfish]"
-
-msgid "[crypted]"
-msgstr "[]"
-
#, c-format
msgid "[CONVERSION ERROR in line %ld]"
msgstr "[ ֲ %ld]"
@@ -1733,9 +1762,6 @@ msgstr " 'charconvert' "
msgid "can't read output of 'charconvert'"
msgstr " 'charconvert'"
-msgid "E821: File is encrypted with unknown method"
-msgstr "E821: "
-
# msgstr "E217: "
msgid "E676: No matching autocommands for acwrite buffer"
msgstr "E676: "
@@ -2710,6 +2736,13 @@ msgstr ""
msgid "E836: This Vim cannot execute :python after using :py3"
msgstr "E836: Python: :py :py3 "
+msgid ""
+"E887: Sorry, this command is disabled, the Python's site module could not be "
+"loaded."
+msgstr ""
+"E887: , , Python "
+"."
+
msgid "E659: Cannot invoke Python recursively"
msgstr "E659: Python"
@@ -4130,15 +4163,6 @@ msgstr "E548: "
msgid "E549: Illegal percentage"
msgstr "E549: "
-msgid "Enter encryption key: "
-msgstr " : "
-
-msgid "Enter same key again: "
-msgstr " : "
-
-msgid "Keys don't match!"
-msgstr " !"
-
msgid "E854: path too long for completion"
msgstr "E854: "
@@ -4316,6 +4340,13 @@ msgstr ""
msgid "E574: Unknown register type %d"
msgstr "E574: %d"
+msgid ""
+"E883: search pattern and expression register may not contain two or more "
+"lines"
+msgstr ""
+"E883: "
+""
+
#, c-format
msgid "%ld Cols; "
msgstr ".: %ld; "
@@ -4638,6 +4669,19 @@ msgstr ""
"\n"
" "
+msgid "Could not set security context "
+msgstr " "
+
+msgid " for "
+msgstr " "
+
+#. no enough size OR unexpected error
+msgid "Could not get security context "
+msgstr " "
+
+msgid ". Removing it!\n"
+msgstr ". !\n"
+
msgid ""
"\n"
"Cannot execute shell "
@@ -4923,18 +4967,30 @@ msgstr "E554: %s{...}"
msgid "External submatches:\n"
msgstr " -:\n"
+#, c-format
+msgid "E888: (NFA regexp) cannot repeat %s"
+msgstr "E888: (NFA regexp) %s"
+
msgid ""
"E864: \\%#= can only be followed by 0, 1, or 2. The automatic engine will be "
"used "
msgstr ""
-"E864: \\%#= 0, 1, or 2. "
+"E864: \\%#= 0, 1, or 2. "
+" "
+
+msgid "Switching to backtracking RE engine for pattern: "
+msgstr " : "
+
+msgid "E865: (NFA) Regexp end encountered prematurely"
+msgstr "E865: (NFA) "
#, c-format
msgid "E866: (NFA regexp) Misplaced %c"
msgstr "E866: (NFA regexp) %c"
-msgid "E865: (NFA) Regexp end encountered prematurely"
-msgstr "E865: (NFA) "
+#, c-format
+msgid "E877: (NFA regexp) Invalid character class: %ld"
+msgstr "E877: (NFA regexp) : %ld"
#, c-format
msgid "E867: (NFA) Unknown operator '\\z%c'"
@@ -4988,7 +5044,8 @@ msgstr "E878: (NFA) !"
msgid ""
"Could not open temporary log file for writing, displaying on stderr ... "
msgstr ""
-" , stderr ... "
+" , "
+"stderr ... "
#, c-format
msgid "(NFA) COULD NOT OPEN %s !"
@@ -5871,8 +5928,8 @@ msgstr " CUT_BUFFER0 "
#. This happens when the FileChangedRO autocommand changes the
#. * file in a way it becomes shorter.
-msgid "E834: Line count changed unexpectedly"
-msgstr "E834: ʳ "
+msgid "E881: Line count changed unexpectedly"
+msgstr "E881: ʳ "
#. must display the prompt
msgid "No undo possible; continue anyway"
@@ -6368,6 +6425,10 @@ msgstr "E446: "
msgid "E447: Can't find file \"%s\" in path"
msgstr "E447: %s "
+# msgstr "E396: "
+msgid "List or number required"
+msgstr " "
+
#, c-format
msgid "E370: Could not load library %s"
msgstr "E370: %s"
@@ -6622,6 +6683,9 @@ msgstr "E485: %s"
msgid "E37: No write since last change (add ! to override)"
msgstr "E37: (! )"
+msgid "E37: No write since last change"
+msgstr "E37: "
+
msgid "E38: Null argument"
msgstr "E38: ³ "
@@ -6812,7 +6876,8 @@ msgstr " bytes() str(), %s"
msgid ""
"expected int(), long() or something supporting coercing to long(), but got %s"
msgstr ""
-" int(), long() , long(), %s"
+" int(), long() , long(), "
+"%s"
#, c-format
msgid "expected int() or something supporting coercing to int(), but got %s"
@@ -6824,7 +6889,7 @@ msgstr " , C int"
msgid "value is too small to fit into C int type"
msgstr " , C int"
-msgid "number must be greater then zero"
+msgid "number must be greater than zero"
msgstr " , "
msgid "number must be greater or equal to zero"
@@ -6870,7 +6935,8 @@ msgstr "- "
#, c-format
msgid "expected sequence element of size 2, but got sequence of size %d"
-msgstr " 2, %d"
+msgstr ""
+" 2, %d"
msgid "list constructor does not accept keyword arguments"
msgstr " "
@@ -6883,16 +6949,31 @@ msgstr " "
msgid "internal error: failed to get vim list item %d"
msgstr " : vim %d"
-msgid "failed to add item to list"
-msgstr " "
+msgid "slice step cannot be zero"
+msgstr " "
+
+#, c-format
+msgid "attempt to assign sequence of size greater than %d to extended slice"
+msgstr " , %d, "
#, c-format
msgid "internal error: no vim list item %d"
msgstr " : vim %d"
+msgid "internal error: not enough list items"
+msgstr " : "
+
msgid "internal error: failed to add item to list"
msgstr " : "
+#, c-format
+msgid "attempt to assign sequence of size %d to extended slice of size %d"
+msgstr ""
+" %d %d"
+
+msgid "failed to add item to list"
+msgstr " "
+
msgid "cannot delete vim.List attributes"
msgstr " vim.List"
diff --git a/src/po/uk.po b/src/po/uk.po
index 0c7429395..3ac0c4b44 100644
--- a/src/po/uk.po
+++ b/src/po/uk.po
@@ -12,7 +12,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vim 7.4\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-09-29 09:05+0300\n"
+"POT-Creation-Date: 2014-11-08 08:23+0200\n"
"PO-Revision-Date: 2010-06-18 21:53+0300\n"
"Last-Translator: Анатолій Сахнік <sakhnik@gmail.com>\n"
"Language-Team: Bohdan Vlasyuk <bohdan@vstu.edu.ua>\n"
@@ -81,6 +81,9 @@ msgstr "Витерто один буфер"
msgid "%d buffers wiped out"
msgstr "Витерто %d буфери(ів)"
+msgid "E90: Cannot unload last buffer"
+msgstr "E90: Не можу вивантажити останній буфер"
+
msgid "E84: No modified buffer found"
msgstr "E84: Жоден буфер не змінено"
@@ -102,9 +105,6 @@ msgstr "E88: Це вже найперший буфер"
msgid "E89: No write since last change for buffer %ld (add ! to override)"
msgstr "E89: Буфер %ld має зміни (! щоб не зважати)"
-msgid "E90: Cannot unload last buffer"
-msgstr "E90: Не можу вивантажити останній буфер"
-
msgid "W14: Warning: List of file names overflow"
msgstr "W14: Обережно: Список назв файлів переповнено"
@@ -204,6 +204,21 @@ msgstr "Позначки для %s:"
msgid " line=%ld id=%d name=%s"
msgstr " рядок=%ld id=%d назва=%s"
+msgid "E821: File is encrypted with unknown method"
+msgstr "E821: Файл зашифровано невідомим методом"
+
+msgid "Enter encryption key: "
+msgstr "Вкажіть ключ шифру: "
+
+msgid "Enter same key again: "
+msgstr "Повторіть ключ: "
+
+msgid "Keys don't match!"
+msgstr "Ключі не однакові!"
+
+msgid "[crypted]"
+msgstr "[зашифровано]"
+
#, c-format
msgid "E96: Can not diff more than %ld buffers"
msgstr "E96: Не можна порівнювати понад %ld буфери(ів)"
@@ -683,9 +698,17 @@ msgstr "E258: Не вдалося надіслати клієнту"
msgid "sort() argument"
msgstr "аргумент sort()"
+# msgstr "E14: "
+msgid "uniq() argument"
+msgstr "аргумент unique()"
+
# msgstr "E364: "
msgid "E702: Sort compare function failed"
-msgstr "E702: Помилка у функції порівняння"
+msgstr "E702: Помилка у функції порівняння sort"
+
+# msgstr "E364: "
+msgid "E882: Uniq compare function failed"
+msgstr "E882: Помилка у функції порівняння uniq"
msgid "(Invalid)"
msgstr "(Неможливо)"
@@ -783,9 +806,13 @@ msgid "E129: Function name required"
msgstr "E129: Не вказано назву функції"
#, c-format
-msgid "E128: Function name must start with a capital or contain a colon: %s"
+msgid "E128: Function name must start with a capital or \"s:\": %s"
msgstr ""
-"E128: Назва функції має починатися з великої літери або містити двокрапку: %s"
+"E128: Назва функції має починатися з великої літери або \"s:\": %s"
+
+#, c-format
+msgid "E884: Function name cannot contain a colon: %s"
+msgstr "E884: Назва функції не може мати двокрапку: %s"
#, c-format
msgid "E131: Cannot delete function %s: It is in use"
@@ -1036,6 +1063,10 @@ msgstr "E138: Не вдалося записати файл viminfo %s!"
msgid "Writing viminfo file \"%s\""
msgstr "Записується файл viminfo «%s»"
+#, c-format
+msgid "E886: Can't rename viminfo file to %s!"
+msgstr "E886: Не вдалося перейменувати файл viminfo у %s!"
+
#. Write the info:
#, c-format
msgid "# This viminfo file was generated by Vim %s.\n"
@@ -1233,6 +1264,10 @@ msgstr "E158: Некоректна назва буфера: %s"
msgid "E157: Invalid sign ID: %ld"
msgstr "E157: Неправильний ID надпису: %ld"
+#, c-format
+msgid "E885: Not possible to change sign %s"
+msgstr "E885: Неможливо змінити знак %s"
+
msgid " (NOT FOUND)"
msgstr " (НЕ ЗНАЙДЕНО)"
@@ -1707,12 +1742,6 @@ msgstr "[НЕ конвертовано]"
msgid "[converted]"
msgstr "[конвертовано]"
-msgid "[blowfish]"
-msgstr "[blowfish]"
-
-msgid "[crypted]"
-msgstr "[зашифровано]"
-
#, c-format
msgid "[CONVERSION ERROR in line %ld]"
msgstr "[ПОМИЛКА КОНВЕРТАЦІЇ у рядку %ld]"
@@ -1733,9 +1762,6 @@ msgstr "Конвертація з 'charconvert' не вдалася"
msgid "can't read output of 'charconvert'"
msgstr "не вдалося прочитати вивід 'charconvert'"
-msgid "E821: File is encrypted with unknown method"
-msgstr "E821: Файл зашифровано невідомим методом"
-
# msgstr "E217: "
msgid "E676: No matching autocommands for acwrite buffer"
msgstr "E676: Немає відповідних автокоманд"
@@ -2710,6 +2736,13 @@ msgstr ""
msgid "E836: This Vim cannot execute :python after using :py3"
msgstr "E836: Python: Не можна використати :py і :py3 в одному сеансі"
+msgid ""
+"E887: Sorry, this command is disabled, the Python's site module could not be "
+"loaded."
+msgstr ""
+"E887: Вибачте, ця команда вимкнена, місцева бібліотека Python не може бути "
+"завантажена."
+
msgid "E659: Cannot invoke Python recursively"
msgstr "E659: Не можна рекурсивно викликати Python"
@@ -4130,15 +4163,6 @@ msgstr "E548: Потрібна цифра"
msgid "E549: Illegal percentage"
msgstr "E549: Неправильний відсоток"
-msgid "Enter encryption key: "
-msgstr "Вкажіть ключ шифру: "
-
-msgid "Enter same key again: "
-msgstr "Повторіть ключ: "
-
-msgid "Keys don't match!"
-msgstr "Ключі не однакові!"
-
msgid "E854: path too long for completion"
msgstr "E854: шлях занадто довгий для доповнення"
@@ -4316,6 +4340,13 @@ msgstr ""
msgid "E574: Unknown register type %d"
msgstr "E574: Невідомий тип регістру %d"
+msgid ""
+"E883: search pattern and expression register may not contain two or more "
+"lines"
+msgstr ""
+"E883: шаблон пошуку і регістровий вираз не можуть містити два чи більше "
+"рядків"
+
#, c-format
msgid "%ld Cols; "
msgstr "довж.: %ld; "
@@ -4638,6 +4669,19 @@ msgstr ""
"\n"
"Не вдалося встановити контекст безпеки для "
+msgid "Could not set security context "
+msgstr "Не вдалося встановити контекст безпеки "
+
+msgid " for "
+msgstr " для "
+
+#. no enough size OR unexpected error
+msgid "Could not get security context "
+msgstr "Не вдалося отримати контекст безпеки "
+
+msgid ". Removing it!\n"
+msgstr ". Знищуємо його!\n"
+
msgid ""
"\n"
"Cannot execute shell "
@@ -4923,18 +4967,30 @@ msgstr "E554: Синтаксична помилка в %s{...}"
msgid "External submatches:\n"
msgstr "Зовнішні під-збіги:\n"
+#, c-format
+msgid "E888: (NFA regexp) cannot repeat %s"
+msgstr "E888: (NFA regexp) не можна повторити %s"
+
msgid ""
"E864: \\%#= can only be followed by 0, 1, or 2. The automatic engine will be "
"used "
msgstr ""
-"E864: після \\%#= може бути тільки 0, 1, or 2. Буде використано автоматичний механізм "
+"E864: після \\%#= може бути тільки 0, 1, or 2. Буде використано автоматичний "
+"механізм "
+
+msgid "Switching to backtracking RE engine for pattern: "
+msgstr "Перемикаємося до пошуку з поверненням для шаблона: "
+
+msgid "E865: (NFA) Regexp end encountered prematurely"
+msgstr "E865: (NFA) Зарано трапився кінець регулярного виразу"
#, c-format
msgid "E866: (NFA regexp) Misplaced %c"
msgstr "E866: (NFA regexp) Не на місці %c"
-msgid "E865: (NFA) Regexp end encountered prematurely"
-msgstr "E865: (NFA) Зарано трапився кінець регулярного виразу"
+#, c-format
+msgid "E877: (NFA regexp) Invalid character class: %ld"
+msgstr "E877: (NFA regexp) Неправильний клас символу: %ld"
#, c-format
msgid "E867: (NFA) Unknown operator '\\z%c'"
@@ -4988,7 +5044,8 @@ msgstr "E878: (NFA) Не вдалося отримати пам’ять для
msgid ""
"Could not open temporary log file for writing, displaying on stderr ... "
msgstr ""
-"Не вдалося відкрити тимчасовий файл журналу для запису, показується на stderr ... "
+"Не вдалося відкрити тимчасовий файл журналу для запису, показується на "
+"stderr ... "
#, c-format
msgid "(NFA) COULD NOT OPEN %s !"
@@ -5871,8 +5928,8 @@ msgstr "Використано CUT_BUFFER0 замість порожнього
#. This happens when the FileChangedRO autocommand changes the
#. * file in a way it becomes shorter.
-msgid "E834: Line count changed unexpectedly"
-msgstr "E834: Кількість рядків несподівано змінилася"
+msgid "E881: Line count changed unexpectedly"
+msgstr "E881: Кількість рядків несподівано змінилася"
#. must display the prompt
msgid "No undo possible; continue anyway"
@@ -6368,6 +6425,10 @@ msgstr "E446: Немає назви файлу над курсором"
msgid "E447: Can't find file \"%s\" in path"
msgstr "E447: Файл «%s» не знайдено у шляху пошуку"
+# msgstr "E396: "
+msgid "List or number required"
+msgstr "Потрібен список чи число"
+
#, c-format
msgid "E370: Could not load library %s"
msgstr "E370: Не вдалося завантажити бібліотеку %s"
@@ -6622,6 +6683,9 @@ msgstr "E485: Не вдалося прочитати файл %s"
msgid "E37: No write since last change (add ! to override)"
msgstr "E37: Зміни не було записано (! щоб не зважати)"
+msgid "E37: No write since last change"
+msgstr "E37: Не записано попередні зміни"
+
msgid "E38: Null argument"
msgstr "E38: Відсутній аргумент"
@@ -6812,7 +6876,8 @@ msgstr "очікувався екземпляр bytes() чи str(), але от
msgid ""
"expected int(), long() or something supporting coercing to long(), but got %s"
msgstr ""
-"очікувався int(), long() чи щось, що може бути вміщене long(), але отримано %s"
+"очікувався int(), long() чи щось, що може бути вміщене long(), але отримано "
+"%s"
#, c-format
msgid "expected int() or something supporting coercing to int(), but got %s"
@@ -6824,7 +6889,7 @@ msgstr "значення завелике, щоб вміститися у тип
msgid "value is too small to fit into C int type"
msgstr "значення замале, щоб вміститися у тип C int"
-msgid "number must be greater then zero"
+msgid "number must be greater than zero"
msgstr "число має бути більше, ніж нуль"
msgid "number must be greater or equal to zero"
@@ -6870,7 +6935,8 @@ msgstr "хеш-таблиця змінилася під час перебира
#, c-format
msgid "expected sequence element of size 2, but got sequence of size %d"
-msgstr "очікувалась послідовність розміром 2, але отримано послідовність розміру %d"
+msgstr ""
+"очікувалась послідовність розміром 2, але отримано послідовність розміру %d"
msgid "list constructor does not accept keyword arguments"
msgstr "списковий конструктор не приймає іменовані аргументи"
@@ -6883,16 +6949,31 @@ msgstr "індекс списку за межами"
msgid "internal error: failed to get vim list item %d"
msgstr "внутрішня помилка: не вдалося отримати елемент списку vim %d"
-msgid "failed to add item to list"
-msgstr "не вдалося додати елемент до списку"
+msgid "slice step cannot be zero"
+msgstr "крок зрізу не може бути нуль"
+
+#, c-format
+msgid "attempt to assign sequence of size greater than %d to extended slice"
+msgstr "спроба призначити послідовність розміру більше, ніж %d, у розширений зріз"
#, c-format
msgid "internal error: no vim list item %d"
msgstr "внутрішня помилка: немає елемента списку vim %d"
+msgid "internal error: not enough list items"
+msgstr "внутрішня помилка: бракує елементів у списку"
+
msgid "internal error: failed to add item to list"
msgstr "внутрішня помилка: не вдалося додати елемент до списку"
+#, c-format
+msgid "attempt to assign sequence of size %d to extended slice of size %d"
+msgstr ""
+"спроба призначити послідовність розміром %d у розширений зріз розміру %d"
+
+msgid "failed to add item to list"
+msgstr "не вдалося додати елемент до списку"
+
msgid "cannot delete vim.List attributes"
msgstr "не вдалося знищити атрибути vim.List"
diff --git a/src/popupmnu.c b/src/popupmnu.c
index b970158b2..68ee2d562 100644
--- a/src/popupmnu.c
+++ b/src/popupmnu.c
@@ -643,6 +643,12 @@ pum_set_selected(n, repeat)
if (curwin != curwin_save && win_valid(curwin_save))
{
+ /* When the first completion is done and the preview
+ * window is not resized, skip the preview window's
+ * status line redrawing. */
+ if (ins_compl_active() && !resized)
+ curwin->w_redr_status = FALSE;
+
/* Return cursor to where we were */
validate_cursor();
redraw_later(SOME_VALID);
diff --git a/src/proto.h b/src/proto.h
index 191ecd8fd..2b08eb38f 100644
--- a/src/proto.h
+++ b/src/proto.h
@@ -70,6 +70,8 @@ extern int _stricoll __ARGS((char *a, char *b));
# ifdef FEAT_CRYPT
# include "blowfish.pro"
+# include "crypt.pro"
+# include "crypt_zip.pro"
# endif
# include "buffer.pro"
# include "charset.pro"
diff --git a/src/proto/blowfish.pro b/src/proto/blowfish.pro
index 4d64e10e8..66d029cd8 100644
--- a/src/proto/blowfish.pro
+++ b/src/proto/blowfish.pro
@@ -1,10 +1,6 @@
/* blowfish.c */
-void bf_key_init __ARGS((char_u *password, char_u *salt, int salt_len));
-void bf_cfb_init __ARGS((char_u *iv, int iv_len));
-void bf_crypt_encode __ARGS((char_u *from, size_t len, char_u *to));
-void bf_crypt_decode __ARGS((char_u *ptr, long len));
-void bf_crypt_init_keys __ARGS((char_u *passwd));
-void bf_crypt_save __ARGS((void));
-void bf_crypt_restore __ARGS((void));
+void crypt_blowfish_encode __ARGS((cryptstate_T *state, char_u *from, size_t len, char_u *to));
+void crypt_blowfish_decode __ARGS((cryptstate_T *state, char_u *from, size_t len, char_u *to));
+void crypt_blowfish_init __ARGS((cryptstate_T *state, char_u *key, char_u *salt, int salt_len, char_u *seed, int seed_len));
int blowfish_self_test __ARGS((void));
/* vim: set ft=c : */
diff --git a/src/proto/crypt.pro b/src/proto/crypt.pro
new file mode 100644
index 000000000..7b29026a1
--- /dev/null
+++ b/src/proto/crypt.pro
@@ -0,0 +1,26 @@
+/* crypt.c */
+int crypt_method_nr_from_name __ARGS((char_u *name));
+int crypt_method_nr_from_magic __ARGS((char *ptr, int len));
+int crypt_works_inplace __ARGS((cryptstate_T *state));
+int crypt_get_method_nr __ARGS((buf_T *buf));
+int crypt_whole_undofile __ARGS((int method_nr));
+int crypt_get_header_len __ARGS((int method_nr));
+void crypt_set_cm_option __ARGS((buf_T *buf, int method_nr));
+int crypt_self_test __ARGS((void));
+cryptstate_T *crypt_create __ARGS((int method_nr, char_u *key, char_u *salt, int salt_len, char_u *seed, int seed_len));
+cryptstate_T *crypt_create_from_header __ARGS((int method_nr, char_u *key, char_u *header));
+cryptstate_T *crypt_create_from_file __ARGS((FILE *fp, char_u *key));
+cryptstate_T *crypt_create_for_writing __ARGS((int method_nr, char_u *key, char_u **header, int *header_len));
+void crypt_free_state __ARGS((cryptstate_T *state));
+long crypt_encode_alloc __ARGS((cryptstate_T *state, char_u *from, size_t len, char_u **newptr));
+long crypt_decode_alloc __ARGS((cryptstate_T *state, char_u *ptr, long len, char_u **newptr));
+void crypt_encode __ARGS((cryptstate_T *state, char_u *from, size_t len, char_u *to));
+void crypt_decode __ARGS((cryptstate_T *state, char_u *from, size_t len, char_u *to));
+void crypt_encode_inplace __ARGS((cryptstate_T *state, char_u *buf, size_t len));
+void crypt_decode_inplace __ARGS((cryptstate_T *state, char_u *buf, size_t len));
+void crypt_free_key __ARGS((char_u *key));
+void crypt_check_method __ARGS((int method));
+void crypt_check_current_method __ARGS((void));
+char_u *crypt_get_key __ARGS((int store, int twice));
+void crypt_append_msg __ARGS((buf_T *buf));
+/* vim: set ft=c : */
diff --git a/src/proto/crypt_zip.pro b/src/proto/crypt_zip.pro
new file mode 100644
index 000000000..5f4e13771
--- /dev/null
+++ b/src/proto/crypt_zip.pro
@@ -0,0 +1,5 @@
+/* crypt_zip.c */
+void crypt_zip_init __ARGS((cryptstate_T *state, char_u *key, char_u *salt, int salt_len, char_u *seed, int seed_len));
+void crypt_zip_encode __ARGS((cryptstate_T *state, char_u *from, size_t len, char_u *to));
+void crypt_zip_decode __ARGS((cryptstate_T *state, char_u *from, size_t len, char_u *to));
+/* vim: set ft=c : */
diff --git a/src/proto/diff.pro b/src/proto/diff.pro
index 18c42651f..3234fde1a 100644
--- a/src/proto/diff.pro
+++ b/src/proto/diff.pro
@@ -18,7 +18,7 @@ int diffopt_changed __ARGS((void));
int diffopt_horizontal __ARGS((void));
int diff_find_change __ARGS((win_T *wp, linenr_T lnum, int *startp, int *endp));
int diff_infold __ARGS((win_T *wp, linenr_T lnum));
-void nv_diffgetput __ARGS((int put));
+void nv_diffgetput __ARGS((int put, long count));
void ex_diffgetput __ARGS((exarg_T *eap));
int diff_mode_buf __ARGS((buf_T *buf));
int diff_move_to __ARGS((int dir, long count));
diff --git a/src/proto/eval.pro b/src/proto/eval.pro
index 517d9e71a..b264365fe 100644
--- a/src/proto/eval.pro
+++ b/src/proto/eval.pro
@@ -59,8 +59,8 @@ int list_append_tv __ARGS((list_T *l, typval_T *tv));
int list_append_dict __ARGS((list_T *list, dict_T *dict));
int list_append_string __ARGS((list_T *l, char_u *str, int len));
int list_insert_tv __ARGS((list_T *l, typval_T *tv, listitem_T *item));
-void vimlist_remove __ARGS((list_T *l, listitem_T *item, listitem_T *item2));
void list_insert __ARGS((list_T *l, listitem_T *ni, listitem_T *item));
+void vimlist_remove __ARGS((list_T *l, listitem_T *item, listitem_T *item2));
int garbage_collect __ARGS((void));
void set_ref_in_ht __ARGS((hashtab_T *ht, int copyID));
void set_ref_in_list __ARGS((list_T *l, int copyID));
diff --git a/src/proto/ex_cmds.pro b/src/proto/ex_cmds.pro
index a94f5d048..8757637c0 100644
--- a/src/proto/ex_cmds.pro
+++ b/src/proto/ex_cmds.pro
@@ -44,6 +44,7 @@ void write_viminfo_sub_string __ARGS((FILE *fp));
void free_old_sub __ARGS((void));
int prepare_tagpreview __ARGS((int undo_sync));
void ex_help __ARGS((exarg_T *eap));
+void ex_helpclose __ARGS((exarg_T *eap));
char_u *check_help_lang __ARGS((char_u *arg));
int help_heuristic __ARGS((char_u *matched_string, int offset, int wrong_case));
int find_help_tags __ARGS((char_u *arg, int *num_matches, char_u ***matches, int keep_lang));
diff --git a/src/proto/ex_docmd.pro b/src/proto/ex_docmd.pro
index ebc54c9de..a998480ea 100644
--- a/src/proto/ex_docmd.pro
+++ b/src/proto/ex_docmd.pro
@@ -19,9 +19,11 @@ char_u *get_command_name __ARGS((expand_T *xp, int idx));
void ex_comclear __ARGS((exarg_T *eap));
void uc_clear __ARGS((garray_T *gap));
char_u *get_user_commands __ARGS((expand_T *xp, int idx));
+char_u *get_user_cmd_addr_type __ARGS((expand_T *xp, int idx));
char_u *get_user_cmd_flags __ARGS((expand_T *xp, int idx));
char_u *get_user_cmd_nargs __ARGS((expand_T *xp, int idx));
char_u *get_user_cmd_complete __ARGS((expand_T *xp, int idx));
+int parse_addr_type_arg __ARGS((char_u *value, int vallen, long *argt, int *addr_type_arg));
int parse_compl_arg __ARGS((char_u *value, int vallen, int *complp, long *argt, char_u **compl_arg));
void not_exiting __ARGS((void));
void tabpage_close __ARGS((int forceit));
@@ -43,6 +45,7 @@ void free_cd_dir __ARGS((void));
void post_chdir __ARGS((int local));
void ex_cd __ARGS((exarg_T *eap));
void do_sleep __ARGS((long msec));
+void ex_may_print __ARGS((exarg_T *eap));
int vim_mkdir_emsg __ARGS((char_u *name, int prot));
FILE *open_exfile __ARGS((char_u *fname, int forceit, char *mode));
void update_topline_cursor __ARGS((void));
@@ -54,5 +57,4 @@ int put_eol __ARGS((FILE *fd));
int put_line __ARGS((FILE *fd, char *s));
void dialog_msg __ARGS((char_u *buff, char *format, char_u *fname));
char_u *get_behave_arg __ARGS((expand_T *xp, int idx));
-void ex_may_print __ARGS((exarg_T *eap));
/* vim: set ft=c : */
diff --git a/src/proto/fileio.pro b/src/proto/fileio.pro
index 7aa99cfa8..45e7b3872 100644
--- a/src/proto/fileio.pro
+++ b/src/proto/fileio.pro
@@ -4,8 +4,6 @@ int readfile __ARGS((char_u *fname, char_u *sfname, linenr_T from, linenr_T line
int prep_exarg __ARGS((exarg_T *eap, buf_T *buf));
void set_file_options __ARGS((int set_options, exarg_T *eap));
void set_forced_fenc __ARGS((exarg_T *eap));
-int prepare_crypt_read __ARGS((FILE *fp));
-char_u *prepare_crypt_write __ARGS((buf_T *buf, int *lenp));
int check_file_readonly __ARGS((char_u *fname, int perm));
int buf_write __ARGS((buf_T *buf, char_u *fname, char_u *sfname, linenr_T start, linenr_T end, exarg_T *eap, int append, int forceit, int reset_changed, int filtering));
void msg_add_fname __ARGS((buf_T *buf, char_u *fname));
@@ -49,6 +47,8 @@ int has_cursormovedI __ARGS((void));
int has_textchanged __ARGS((void));
int has_textchangedI __ARGS((void));
int has_insertcharpre __ARGS((void));
+int has_cmdundefined __ARGS((void));
+int has_funcundefined __ARGS((void));
void block_autocmds __ARGS((void));
void unblock_autocmds __ARGS((void));
int is_autocmd_blocked __ARGS((void));
@@ -59,7 +59,6 @@ char_u *set_context_in_autocmd __ARGS((expand_T *xp, char_u *arg, int doautocmd)
char_u *get_event_name __ARGS((expand_T *xp, int idx));
int autocmd_supported __ARGS((char_u *name));
int au_exists __ARGS((char_u *arg));
-int match_file_pat __ARGS((char_u *pattern, regprog_T *prog, char_u *fname, char_u *sfname, char_u *tail, int allow_dirs));
int match_file_list __ARGS((char_u *list, char_u *sfname, char_u *ffname));
char_u *file_pat_to_reg_pat __ARGS((char_u *pat, char_u *pat_end, char *allow_dirs, int no_bslash));
long read_eintr __ARGS((int fd, void *buf, size_t bufsize));
diff --git a/src/proto/getchar.pro b/src/proto/getchar.pro
index 897cad37f..e90b50527 100644
--- a/src/proto/getchar.pro
+++ b/src/proto/getchar.pro
@@ -15,6 +15,7 @@ void AppendToRedobuffLit __ARGS((char_u *str, int len));
void AppendCharToRedobuff __ARGS((int c));
void AppendNumberToRedobuff __ARGS((long n));
void stuffReadbuff __ARGS((char_u *s));
+void stuffRedoReadbuff __ARGS((char_u *s));
void stuffReadbuffLen __ARGS((char_u *s, long len));
void stuffReadbuffSpec __ARGS((char_u *s));
void stuffcharReadbuff __ARGS((int c));
diff --git a/src/proto/gui_w32.pro b/src/proto/gui_w32.pro
index a333233d7..88fbf67c6 100644
--- a/src/proto/gui_w32.pro
+++ b/src/proto/gui_w32.pro
@@ -1,4 +1,6 @@
/* gui_w32.c */
+int directx_enabled __ARGS((void));
+int gui_mch_set_rendering_options __ARGS((char_u *s));
void gui_mch_set_blinking __ARGS((long wait, long on, long off));
void gui_mch_stop_blink __ARGS((void));
void gui_mch_start_blink __ARGS((void));
diff --git a/src/proto/misc1.pro b/src/proto/misc1.pro
index 274c7af46..5df81c928 100644
--- a/src/proto/misc1.pro
+++ b/src/proto/misc1.pro
@@ -5,7 +5,7 @@ int get_indent_buf __ARGS((buf_T *buf, linenr_T lnum));
int get_indent_str __ARGS((char_u *ptr, int ts, int list));
int set_indent __ARGS((int size, int flags));
int get_number_indent __ARGS((linenr_T lnum));
-int get_breakindent_win __ARGS((win_T *wp, char_u *ptr));
+int get_breakindent_win __ARGS((win_T *wp, char_u *line));
int open_line __ARGS((int dir, int flags, int second_line_indent));
int get_leader_len __ARGS((char_u *line, char_u **flags, int backward, int include_space));
int get_last_leader_offset __ARGS((char_u *line, char_u **flags));
diff --git a/src/proto/misc2.pro b/src/proto/misc2.pro
index 4fd457382..b2f72d864 100644
--- a/src/proto/misc2.pro
+++ b/src/proto/misc2.pro
@@ -84,16 +84,6 @@ int illegal_slash __ARGS((char *name));
char_u *parse_shape_opt __ARGS((int what));
int get_shape_idx __ARGS((int mouse));
void update_mouseshape __ARGS((int shape_idx));
-int crypt_method_from_string __ARGS((char_u *s));
-int get_crypt_method __ARGS((buf_T *buf));
-void set_crypt_method __ARGS((buf_T *buf, int method));
-void crypt_push_state __ARGS((void));
-void crypt_pop_state __ARGS((void));
-void crypt_encode __ARGS((char_u *from, size_t len, char_u *to));
-void crypt_decode __ARGS((char_u *ptr, long len));
-void crypt_init_keys __ARGS((char_u *passwd));
-void free_crypt_key __ARGS((char_u *key));
-char_u *get_crypt_key __ARGS((int store, int twice));
void *vim_findfile_init __ARGS((char_u *path, char_u *filename, char_u *stopdirs, int level, int free_visited, int find_what, void *search_ctx_arg, int tagfile, char_u *rel_fname));
char_u *vim_findfile_stopdir __ARGS((char_u *buf));
void vim_findfile_cleanup __ARGS((void *ctx));
@@ -116,5 +106,6 @@ time_t get8ctime __ARGS((FILE *fd));
char_u *read_string __ARGS((FILE *fd, int cnt));
int put_bytes __ARGS((FILE *fd, long_u nr, int len));
void put_time __ARGS((FILE *fd, time_t the_time));
+void time_to_bytes __ARGS((time_t the_time, char_u *buf));
int has_non_ascii __ARGS((char_u *s));
/* vim: set ft=c : */
diff --git a/src/proto/ops.pro b/src/proto/ops.pro
index fe40151cd..c1a1b455e 100644
--- a/src/proto/ops.pro
+++ b/src/proto/ops.pro
@@ -55,8 +55,8 @@ void dnd_yank_drag_data __ARGS((char_u *str, long len));
char_u get_reg_type __ARGS((int regname, long *reglen));
char_u *get_reg_contents __ARGS((int regname, int flags));
void write_reg_contents __ARGS((int name, char_u *str, int maxlen, int must_append));
-void write_reg_contents_ex __ARGS((int name, char_u *str, int maxlen, int must_append, int yank_type, long block_len));
void write_reg_contents_lst __ARGS((int name, char_u **strings, int maxlen, int must_append, int yank_type, long block_len));
+void write_reg_contents_ex __ARGS((int name, char_u *str, int maxlen, int must_append, int yank_type, long block_len));
void clear_oparg __ARGS((oparg_T *oap));
void cursor_pos_info __ARGS((void));
/* vim: set ft=c : */
diff --git a/src/proto/option.pro b/src/proto/option.pro
index e426e6cfa..2fe05aa04 100644
--- a/src/proto/option.pro
+++ b/src/proto/option.pro
@@ -62,5 +62,5 @@ int check_ff_value __ARGS((char_u *p));
long get_sw_value __ARGS((buf_T *buf));
long get_sts_value __ARGS((void));
void find_mps_values __ARGS((int *initc, int *findc, int *backwards, int switchit));
-int briopt_check __ARGS((void));
+unsigned int get_bkc_value __ARGS((buf_T *buf));
/* vim: set ft=c : */
diff --git a/src/proto/os_mswin.pro b/src/proto/os_mswin.pro
index 0d29979cf..b56ee5656 100644
--- a/src/proto/os_mswin.pro
+++ b/src/proto/os_mswin.pro
@@ -21,6 +21,7 @@ int mch_has_wildcard __ARGS((char_u *p));
int mch_chdir __ARGS((char *path));
int can_end_termcap_mode __ARGS((int give_msg));
int mch_screenmode __ARGS((char_u *arg));
+int mch_icon_load __ARGS((HANDLE *iconp));
int mch_libcall __ARGS((char_u *libname, char_u *funcname, char_u *argstring, int argint, char_u **string_result, int *number_result));
void DumpPutS __ARGS((const char *psz));
int mch_get_winpos __ARGS((int *x, int *y));
diff --git a/src/proto/os_vms.pro b/src/proto/os_vms.pro
index 6408455e4..cc0f1d913 100644
--- a/src/proto/os_vms.pro
+++ b/src/proto/os_vms.pro
@@ -5,11 +5,12 @@ void mch_set_shellsize __ARGS((void));
char_u *mch_getenv __ARGS((char_u *lognam));
int mch_setenv __ARGS((char *var, char *value, int x));
int vms_sys __ARGS((char *cmd, char *out, char *inp));
+char *vms_tolower __ARGS((char *name));
int vms_sys_status __ARGS((int status));
int vms_read __ARGS((char *inbuf, size_t nbytes));
-char *vms_tolower __ARGS((char *name));
int mch_expand_wildcards __ARGS((int num_pat, char_u **pat, int *num_file, char_u ***file, int flags));
int mch_expandpath __ARGS((garray_T *gap, char_u *path, int flags));
void *vms_fixfilename __ARGS((void *instring));
void vms_remove_version __ARGS((void *fname));
+int RealWaitForChar __ARGS((int fd, long msec, int *check_for_gpm));
/* vim: set ft=c : */
diff --git a/src/proto/regexp.pro b/src/proto/regexp.pro
index a42c5944a..099121eae 100644
--- a/src/proto/regexp.pro
+++ b/src/proto/regexp.pro
@@ -13,6 +13,7 @@ char_u *reg_submatch __ARGS((int no));
list_T *reg_submatch_list __ARGS((int no));
regprog_T *vim_regcomp __ARGS((char_u *expr_arg, int re_flags));
void vim_regfree __ARGS((regprog_T *prog));
+int vim_regexec_prog __ARGS((regprog_T **prog, int ignore_case, char_u *line, colnr_T col));
int vim_regexec __ARGS((regmatch_T *rmp, char_u *line, colnr_T col));
int vim_regexec_nl __ARGS((regmatch_T *rmp, char_u *line, colnr_T col));
long vim_regexec_multi __ARGS((regmmatch_T *rmp, win_T *win, buf_T *buf, linenr_T lnum, colnr_T col, proftime_T *tm));
diff --git a/src/proto/screen.pro b/src/proto/screen.pro
index 31f97d544..a4df6269f 100644
--- a/src/proto/screen.pro
+++ b/src/proto/screen.pro
@@ -26,7 +26,7 @@ int get_keymap_str __ARGS((win_T *wp, char_u *buf, int len));
void screen_putchar __ARGS((int c, int row, int col, int attr));
void screen_getbytes __ARGS((int row, int col, char_u *bytes, int *attrp));
void screen_puts __ARGS((char_u *text, int row, int col, int attr));
-void screen_puts_len __ARGS((char_u *text, int len, int row, int col, int attr));
+void screen_puts_len __ARGS((char_u *text, int textlen, int row, int col, int attr));
void screen_stop_highlight __ARGS((void));
void reset_cterm_colors __ARGS((void));
void screen_draw_rectangle __ARGS((int row, int col, int height, int width, int invert));
diff --git a/src/proto/search.pro b/src/proto/search.pro
index f94fb69ab..07f608789 100644
--- a/src/proto/search.pro
+++ b/src/proto/search.pro
@@ -2,6 +2,7 @@
int search_regcomp __ARGS((char_u *pat, int pat_save, int pat_use, int options, regmmatch_T *regmatch));
char_u *get_search_pat __ARGS((void));
char_u *reverse_text __ARGS((char_u *s));
+void save_re_pat __ARGS((int idx, char_u *pat, int magic));
void save_search_patterns __ARGS((void));
void restore_search_patterns __ARGS((void));
void free_search_patterns __ARGS((void));
diff --git a/src/proto/term.pro b/src/proto/term.pro
index 89d58a0d0..b3d0df39d 100644
--- a/src/proto/term.pro
+++ b/src/proto/term.pro
@@ -34,8 +34,6 @@ void set_shellsize __ARGS((int width, int height, int mustset));
void settmode __ARGS((int tmode));
void starttermcap __ARGS((void));
void stoptermcap __ARGS((void));
-int did_request_esc_sequence __ARGS((void));
-void resume_get_esc_sequence __ARGS((void));
void may_req_termresponse __ARGS((void));
void may_req_ambiguous_char_width __ARGS((void));
int swapping_screen __ARGS((void));
diff --git a/src/proto/ui.pro b/src/proto/ui.pro
index 234e99fd7..4100aa730 100644
--- a/src/proto/ui.pro
+++ b/src/proto/ui.pro
@@ -14,6 +14,8 @@ void clip_init __ARGS((int can_use));
void clip_update_selection __ARGS((VimClipboard *clip));
void clip_own_selection __ARGS((VimClipboard *cbd));
void clip_lose_selection __ARGS((VimClipboard *cbd));
+void start_global_changes __ARGS((void));
+void end_global_changes __ARGS((void));
void clip_auto_select __ARGS((void));
int clip_isautosel_star __ARGS((void));
int clip_isautosel_plus __ARGS((void));
diff --git a/src/proto/window.pro b/src/proto/window.pro
index 2d33c1757..b89cf085a 100644
--- a/src/proto/window.pro
+++ b/src/proto/window.pro
@@ -75,7 +75,7 @@ void restore_win __ARGS((win_T *save_curwin, tabpage_T *save_curtab, int no_disp
void switch_buffer __ARGS((buf_T **save_curbuf, buf_T *buf));
void restore_buffer __ARGS((buf_T *save_curbuf));
int win_hasvertsplit __ARGS((void));
-int match_add __ARGS((win_T *wp, char_u *grp, char_u *pat, int prio, int id, list_T *pos));
+int match_add __ARGS((win_T *wp, char_u *grp, char_u *pat, int prio, int id, list_T *pos_list));
int match_delete __ARGS((win_T *wp, int id, int perr));
void clear_matches __ARGS((win_T *wp));
matchitem_T *get_match __ARGS((win_T *wp, int id));
diff --git a/src/quickfix.c b/src/quickfix.c
index 799421e7f..abb4a6ecf 100644
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -107,6 +107,7 @@ struct efm_S
};
static int qf_init_ext __ARGS((qf_info_T *qi, char_u *efile, buf_T *buf, typval_T *tv, char_u *errorformat, int newlist, linenr_T lnumfirst, linenr_T lnumlast, char_u *qf_title));
+static void qf_store_title __ARGS((qf_info_T *qi, char_u *title));
static void qf_new_list __ARGS((qf_info_T *qi, char_u *qf_title));
static void ll_free_all __ARGS((qf_info_T **pqi));
static int qf_add_entry __ARGS((qf_info_T *qi, qfline_T **prevp, char_u *dir, char_u *fname, int bufnum, char_u *mesg, long lnum, int col, int vis_col, char_u *pattern, int nr, int type, int valid));
@@ -126,7 +127,7 @@ static int is_qf_win __ARGS((win_T *win, qf_info_T *qi));
static win_T *qf_find_win __ARGS((qf_info_T *qi));
static buf_T *qf_find_buf __ARGS((qf_info_T *qi));
static void qf_update_buffer __ARGS((qf_info_T *qi));
-static void qf_set_title __ARGS((qf_info_T *qi));
+static void qf_set_title_var __ARGS((qf_info_T *qi));
static void qf_fill_buffer __ARGS((qf_info_T *qi));
#endif
static char_u *get_mef_name __ARGS((void));
@@ -591,6 +592,8 @@ qf_init_ext(qi, efile, buf, tv, errorformat, newlist, lnumfirst, lnumlast,
restofline:
for ( ; fmt_ptr != NULL; fmt_ptr = fmt_ptr->next)
{
+ int r;
+
idx = fmt_ptr->prefix;
if (multiscan && vim_strchr((char_u *)"OPQ", idx) == NULL)
continue;
@@ -606,7 +609,9 @@ restofline:
tail = NULL;
regmatch.regprog = fmt_ptr->prog;
- if (vim_regexec(&regmatch, IObuff, (colnr_T)0))
+ r = vim_regexec(&regmatch, IObuff, (colnr_T)0);
+ fmt_ptr->prog = regmatch.regprog;
+ if (r)
{
if ((idx == 'C' || idx == 'Z') && !multiline)
continue;
@@ -884,6 +889,21 @@ qf_init_end:
return retval;
}
+ static void
+qf_store_title(qi, title)
+ qf_info_T *qi;
+ char_u *title;
+{
+ if (title != NULL)
+ {
+ char_u *p = alloc((int)STRLEN(title) + 2);
+
+ qi->qf_lists[qi->qf_curlist].qf_title = p;
+ if (p != NULL)
+ sprintf((char *)p, ":%s", (char *)title);
+ }
+}
+
/*
* Prepare for adding a new quickfix list.
*/
@@ -895,7 +915,7 @@ qf_new_list(qi, qf_title)
int i;
/*
- * If the current entry is not the last entry, delete entries below
+ * If the current entry is not the last entry, delete entries beyond
* the current entry. This makes it possible to browse in a tree-like
* way with ":grep'.
*/
@@ -916,14 +936,7 @@ qf_new_list(qi, qf_title)
else
qi->qf_curlist = qi->qf_listcount++;
vim_memset(&qi->qf_lists[qi->qf_curlist], 0, (size_t)(sizeof(qf_list_T)));
- if (qf_title != NULL)
- {
- char_u *p = alloc((int)STRLEN(qf_title) + 2);
-
- qi->qf_lists[qi->qf_curlist].qf_title = p;
- if (p != NULL)
- sprintf((char *)p, ":%s", (char *)qf_title);
- }
+ qf_store_title(qi, qf_title);
}
/*
@@ -2164,6 +2177,7 @@ qf_free(qi, idx)
}
vim_free(qi->qf_lists[idx].qf_title);
qi->qf_lists[idx].qf_title = NULL;
+ qi->qf_lists[idx].qf_index = 0;
}
/*
@@ -2444,7 +2458,7 @@ ex_copen(eap)
qf_fill_buffer(qi);
if (qi->qf_lists[qi->qf_curlist].qf_title != NULL)
- qf_set_title(qi);
+ qf_set_title_var(qi);
curwin->w_cursor.lnum = qi->qf_lists[qi->qf_curlist].qf_index;
curwin->w_cursor.col = 0;
@@ -2599,7 +2613,7 @@ qf_update_buffer(qi)
{
curwin_save = curwin;
curwin = win;
- qf_set_title(qi);
+ qf_set_title_var(qi);
curwin = curwin_save;
}
@@ -2612,7 +2626,7 @@ qf_update_buffer(qi)
}
static void
-qf_set_title(qi)
+qf_set_title_var(qi)
qf_info_T *qi;
{
set_internal_string_var((char_u *)"w:quickfix_title",
@@ -3845,7 +3859,10 @@ set_errorlist(wp, list, action, title)
prevp->qf_next != prevp; prevp = prevp->qf_next)
;
else if (action == 'r')
+ {
qf_free(qi, qi->qf_curlist);
+ qf_store_title(qi, title);
+ }
for (li = list->lv_first; li != NULL; li = li->li_next)
{
diff --git a/src/regexp.c b/src/regexp.c
index dcb9a3b4e..d36ac49bb 100644
--- a/src/regexp.c
+++ b/src/regexp.c
@@ -358,6 +358,8 @@ static void regdump __ARGS((char_u *, bt_regprog_T *));
static char_u *regprop __ARGS((char_u *));
#endif
+static int re_mult_next __ARGS((char *what));
+
static char_u e_missingbracket[] = N_("E769: Missing ] after %s[");
static char_u e_unmatchedpp[] = N_("E53: Unmatched %s%%(");
static char_u e_unmatchedp[] = N_("E54: Unmatched %s(");
@@ -2166,9 +2168,13 @@ regatom(flagp)
#endif
case 's': ret = regnode(MOPEN + 0);
+ if (re_mult_next("\\zs") == FAIL)
+ return NULL;
break;
case 'e': ret = regnode(MCLOSE + 0);
+ if (re_mult_next("\\ze") == FAIL)
+ return NULL;
break;
default: EMSG_RET_NULL(_("E68: Invalid character after \\z"));
@@ -3733,7 +3739,7 @@ static int bt_regexec_nl __ARGS((regmatch_T *rmp, char_u *line, colnr_T col, in
* Uses curbuf for line count and 'iskeyword'.
* if "line_lbr" is TRUE consider a "\n" in "line" to be a line break.
*
- * Return TRUE if there is a match, FALSE if not.
+ * Returns 0 for failure, number of lines contained in the match otherwise.
*/
static int
bt_regexec_nl(rmp, line, col, line_lbr)
@@ -3753,7 +3759,8 @@ bt_regexec_nl(rmp, line, col, line_lbr)
ireg_icombine = FALSE;
#endif
ireg_maxcol = 0;
- return (bt_regexec_both(line, col, NULL) != 0);
+
+ return bt_regexec_both(line, col, NULL);
}
static long bt_regexec_multi __ARGS((regmmatch_T *rmp, win_T *win, buf_T *buf, linenr_T lnum, colnr_T col, proftime_T *tm));
@@ -3775,8 +3782,6 @@ bt_regexec_multi(rmp, win, buf, lnum, col, tm)
colnr_T col; /* column to start looking for match */
proftime_T *tm; /* timeout limit or NULL */
{
- long r;
-
reg_match = NULL;
reg_mmatch = rmp;
reg_buf = buf;
@@ -3790,14 +3795,13 @@ bt_regexec_multi(rmp, win, buf, lnum, col, tm)
#endif
ireg_maxcol = rmp->rmm_maxcol;
- r = bt_regexec_both(NULL, col, tm);
-
- return r;
+ return bt_regexec_both(NULL, col, tm);
}
/*
* Match a regexp against a string ("line" points to the string) or multiple
* lines ("line" is NULL, use reg_getline()).
+ * Returns 0 for failure, number of lines contained in the match otherwise.
*/
static long
bt_regexec_both(line, col, tm)
@@ -3805,9 +3809,9 @@ bt_regexec_both(line, col, tm)
colnr_T col; /* column to start looking for match */
proftime_T *tm UNUSED; /* timeout limit or NULL */
{
- bt_regprog_T *prog;
- char_u *s;
- long retval = 0L;
+ bt_regprog_T *prog;
+ char_u *s;
+ long retval = 0L;
/* Create "regstack" and "backpos" if they are not allocated yet.
* We allocate *_INITIAL amount of bytes first and then set the grow size
@@ -7005,6 +7009,18 @@ regprop(op)
}
#endif /* DEBUG */
+/*
+ * Used in a place where no * or \+ can follow.
+ */
+ static int
+re_mult_next(what)
+ char *what;
+{
+ if (re_multi_type(peekchr()) == MULTI_MULT)
+ EMSG2_RET_FAIL(_("E888: (NFA regexp) cannot repeat %s"), what);
+ return OK;
+}
+
#ifdef FEAT_MBYTE
static void mb_decompose __ARGS((int c, int *c1, int *c2, int *c3));
@@ -7993,13 +8009,10 @@ static regengine_T bt_regengine =
bt_regcomp,
bt_regfree,
bt_regexec_nl,
- bt_regexec_multi
-#ifdef DEBUG
- ,(char_u *)""
-#endif
+ bt_regexec_multi,
+ (char_u *)""
};
-
#include "regexp_nfa.c"
static regengine_T nfa_regengine =
@@ -8007,18 +8020,14 @@ static regengine_T nfa_regengine =
nfa_regcomp,
nfa_regfree,
nfa_regexec_nl,
- nfa_regexec_multi
-#ifdef DEBUG
- ,(char_u *)""
-#endif
+ nfa_regexec_multi,
+ (char_u *)""
};
/* Which regexp engine to use? Needed for vim_regcomp().
* Must match with 'regexpengine'. */
static int regexp_engine = 0;
-#define AUTOMATIC_ENGINE 0
-#define BACKTRACKING_ENGINE 1
-#define NFA_ENGINE 2
+
#ifdef DEBUG
static char_u regname[][30] = {
"AUTOMATIC Regexp Engine",
@@ -8065,10 +8074,8 @@ vim_regcomp(expr_arg, re_flags)
regexp_engine = AUTOMATIC_ENGINE;
}
}
-#ifdef DEBUG
bt_regengine.expr = expr;
nfa_regengine.expr = expr;
-#endif
/*
* First try the NFA engine, unless backtracking was requested.
@@ -8078,7 +8085,8 @@ vim_regcomp(expr_arg, re_flags)
else
prog = bt_regengine.regcomp(expr, re_flags);
- if (prog == NULL) /* error compiling regexp with initial engine */
+ /* Check for error compiling regexp with initial engine. */
+ if (prog == NULL)
{
#ifdef BT_REGEXP_DEBUG_LOG
if (regexp_engine != BACKTRACKING_ENGINE) /* debugging log for NFA */
@@ -8096,13 +8104,27 @@ vim_regcomp(expr_arg, re_flags)
}
#endif
/*
- * If the NFA engine failed, the backtracking engine won't work either.
+ * If the NFA engine failed, try the backtracking engine.
+ * Disabled for now, both engines fail on the same patterns.
+ * Re-enable when regcomp() fails when the pattern would work better
+ * with the other engine.
*
if (regexp_engine == AUTOMATIC_ENGINE)
+ {
prog = bt_regengine.regcomp(expr, re_flags);
+ regexp_engine == BACKTRACKING_ENGINE;
+ }
*/
}
+ if (prog != NULL)
+ {
+ /* Store the info needed to call regcomp() again when the engine turns
+ * out to be very slow when executing it. */
+ prog->re_engine = regexp_engine;
+ prog->re_flags = re_flags;
+ }
+
return prog;
}
@@ -8117,40 +8139,124 @@ vim_regfree(prog)
prog->engine->regfree(prog);
}
+#ifdef FEAT_EVAL
+static void report_re_switch __ARGS((char_u *pat));
+
+ static void
+report_re_switch(pat)
+ char_u *pat;
+{
+ if (p_verbose > 0)
+ {
+ verbose_enter();
+ MSG_PUTS(_("Switching to backtracking RE engine for pattern: "));
+ MSG_PUTS(pat);
+ verbose_leave();
+ }
+}
+#endif
+
+static int vim_regexec_both __ARGS((regmatch_T *rmp, char_u *line, colnr_T col, int nl));
+
/*
* Match a regexp against a string.
* "rmp->regprog" is a compiled regexp as returned by vim_regcomp().
+ * Note: "rmp->regprog" may be freed and changed.
* Uses curbuf for line count and 'iskeyword'.
+ * When "nl" is TRUE consider a "\n" in "line" to be a line break.
*
* Return TRUE if there is a match, FALSE if not.
*/
+ static int
+vim_regexec_both(rmp, line, col, nl)
+ regmatch_T *rmp;
+ char_u *line; /* string to match against */
+ colnr_T col; /* column to start looking for match */
+ int nl;
+{
+ int result = rmp->regprog->engine->regexec_nl(rmp, line, col, nl);
+
+ /* NFA engine aborted because it's very slow. */
+ if (rmp->regprog->re_engine == AUTOMATIC_ENGINE
+ && result == NFA_TOO_EXPENSIVE)
+ {
+ int save_p_re = p_re;
+ int re_flags = rmp->regprog->re_flags;
+ char_u *pat = vim_strsave(((nfa_regprog_T *)rmp->regprog)->pattern);
+
+ p_re = BACKTRACKING_ENGINE;
+ vim_regfree(rmp->regprog);
+ if (pat != NULL)
+ {
+#ifdef FEAT_EVAL
+ report_re_switch(pat);
+#endif
+ rmp->regprog = vim_regcomp(pat, re_flags);
+ if (rmp->regprog != NULL)
+ result = rmp->regprog->engine->regexec_nl(rmp, line, col, nl);
+ vim_free(pat);
+ }
+
+ p_re = save_p_re;
+ }
+ return result > 0;
+}
+
+/*
+ * Note: "*prog" may be freed and changed.
+ * Return TRUE if there is a match, FALSE if not.
+ */
+ int
+vim_regexec_prog(prog, ignore_case, line, col)
+ regprog_T **prog;
+ int ignore_case;
+ char_u *line;
+ colnr_T col;
+{
+ int r;
+ regmatch_T regmatch;
+
+ regmatch.regprog = *prog;
+ regmatch.rm_ic = ignore_case;
+ r = vim_regexec_both(&regmatch, line, col, FALSE);
+ *prog = regmatch.regprog;
+ return r;
+}
+
+/*
+ * Note: "rmp->regprog" may be freed and changed.
+ * Return TRUE if there is a match, FALSE if not.
+ */
int
vim_regexec(rmp, line, col)
- regmatch_T *rmp;
- char_u *line; /* string to match against */
- colnr_T col; /* column to start looking for match */
+ regmatch_T *rmp;
+ char_u *line;
+ colnr_T col;
{
- return rmp->regprog->engine->regexec_nl(rmp, line, col, FALSE);
+ return vim_regexec_both(rmp, line, col, FALSE);
}
#if defined(FEAT_MODIFY_FNAME) || defined(FEAT_EVAL) \
|| defined(FIND_REPLACE_DIALOG) || defined(PROTO)
/*
* Like vim_regexec(), but consider a "\n" in "line" to be a line break.
+ * Note: "rmp->regprog" may be freed and changed.
+ * Return TRUE if there is a match, FALSE if not.
*/
int
vim_regexec_nl(rmp, line, col)
- regmatch_T *rmp;
- char_u *line;
- colnr_T col;
+ regmatch_T *rmp;
+ char_u *line;
+ colnr_T col;
{
- return rmp->regprog->engine->regexec_nl(rmp, line, col, TRUE);
+ return vim_regexec_both(rmp, line, col, TRUE);
}
#endif
/*
* Match a regexp against multiple lines.
* "rmp->regprog" is a compiled regexp as returned by vim_regcomp().
+ * Note: "rmp->regprog" may be freed and changed.
* Uses curbuf for line count and 'iskeyword'.
*
* Return zero if there is no match. Return number of lines contained in the
@@ -8165,5 +8271,32 @@ vim_regexec_multi(rmp, win, buf, lnum, col, tm)
colnr_T col; /* column to start looking for match */
proftime_T *tm; /* timeout limit or NULL */
{
- return rmp->regprog->engine->regexec_multi(rmp, win, buf, lnum, col, tm);
+ int result = rmp->regprog->engine->regexec_multi(
+ rmp, win, buf, lnum, col, tm);
+
+ /* NFA engine aborted because it's very slow. */
+ if (rmp->regprog->re_engine == AUTOMATIC_ENGINE
+ && result == NFA_TOO_EXPENSIVE)
+ {
+ int save_p_re = p_re;
+ int re_flags = rmp->regprog->re_flags;
+ char_u *pat = vim_strsave(((nfa_regprog_T *)rmp->regprog)->pattern);
+
+ p_re = BACKTRACKING_ENGINE;
+ vim_regfree(rmp->regprog);
+ if (pat != NULL)
+ {
+#ifdef FEAT_EVAL
+ report_re_switch(pat);
+#endif
+ rmp->regprog = vim_regcomp(pat, re_flags);
+ if (rmp->regprog != NULL)
+ result = rmp->regprog->engine->regexec_multi(
+ rmp, win, buf, lnum, col, tm);
+ vim_free(pat);
+ }
+ p_re = save_p_re;
+ }
+
+ return result <= 0 ? 0 : result;
}
diff --git a/src/regexp.h b/src/regexp.h
index cd619daf4..6617cd237 100644
--- a/src/regexp.h
+++ b/src/regexp.h
@@ -27,6 +27,18 @@
*/
#define NFA_MAX_BRACES 20
+/*
+ * In the NFA engine: how many states are allowed
+ */
+#define NFA_MAX_STATES 100000
+#define NFA_TOO_EXPENSIVE -1
+
+/* Which regexp engine to use? Needed for vim_regcomp().
+ * Must match with 'regexpengine'. */
+#define AUTOMATIC_ENGINE 0
+#define BACKTRACKING_ENGINE 1
+#define NFA_ENGINE 2
+
typedef struct regengine regengine_T;
/*
@@ -38,6 +50,8 @@ typedef struct regprog
{
regengine_T *engine;
unsigned regflags;
+ unsigned re_engine; /* automatic, backtracking or nfa engine */
+ unsigned re_flags; /* second argument for vim_regcomp() */
} regprog_T;
/*
@@ -47,9 +61,11 @@ typedef struct regprog
*/
typedef struct
{
- /* These two members implement regprog_T */
+ /* These four members implement regprog_T */
regengine_T *engine;
unsigned regflags;
+ unsigned re_engine;
+ unsigned re_flags; /* second argument for vim_regcomp() */
int regstart;
char_u reganch;
@@ -81,9 +97,11 @@ struct nfa_state
*/
typedef struct
{
- /* These two members implement regprog_T */
+ /* These three members implement regprog_T */
regengine_T *engine;
unsigned regflags;
+ unsigned re_engine;
+ unsigned re_flags; /* second argument for vim_regcomp() */
nfa_state_T *start; /* points into state[] */
@@ -96,9 +114,7 @@ typedef struct
#ifdef FEAT_SYN_HL
int reghasz;
#endif
-#ifdef DEBUG
char_u *pattern;
-#endif
int nsubexp; /* number of () */
int nstate;
nfa_state_T state[1]; /* actually longer.. */
@@ -151,9 +167,7 @@ struct regengine
void (*regfree)(regprog_T *);
int (*regexec_nl)(regmatch_T*, char_u*, colnr_T, int);
long (*regexec_multi)(regmmatch_T*, win_T*, buf_T*, linenr_T, colnr_T, proftime_T*);
-#ifdef DEBUG
char_u *expr;
-#endif
};
#endif /* _REGEXP_H */
diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c
index a7fbe7b25..8e069f351 100644
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -1323,10 +1323,14 @@ nfa_regatom()
{
case 's':
EMIT(NFA_ZSTART);
+ if (re_mult_next("\\zs") == FAIL)
+ return FAIL;
break;
case 'e':
EMIT(NFA_ZEND);
nfa_has_zend = TRUE;
+ if (re_mult_next("\\ze") == FAIL)
+ return FAIL;
break;
#ifdef FEAT_SYN_HL
case '1':
@@ -4403,7 +4407,6 @@ skip_add:
switch (state->c)
{
case NFA_MATCH:
-// nfa_match = TRUE;
break;
case NFA_SPLIT:
@@ -5519,6 +5522,13 @@ nfa_regmatch(prog, start, submatch, m)
nextlist->n = 0; /* clear nextlist */
nextlist->has_pim = FALSE;
++nfa_listid;
+ if (prog->re_engine == AUTOMATIC_ENGINE && nfa_listid >= NFA_MAX_STATES)
+ {
+ /* too many states, retry with old engine */
+ nfa_match = NFA_TOO_EXPENSIVE;
+ goto theend;
+ }
+
thislist->id = nfa_listid;
nextlist->id = nfa_listid + 1;
@@ -5701,6 +5711,11 @@ nfa_regmatch(prog, start, submatch, m)
*/
result = recursive_regmatch(t->state, NULL, prog,
submatch, m, &listids);
+ if (result == NFA_TOO_EXPENSIVE)
+ {
+ nfa_match = result;
+ goto theend;
+ }
/* for \@! and \@<! it is a match when the result is
* FALSE */
@@ -5814,6 +5829,11 @@ nfa_regmatch(prog, start, submatch, m)
/* First try matching the pattern. */
result = recursive_regmatch(t->state, NULL, prog,
submatch, m, &listids);
+ if (result == NFA_TOO_EXPENSIVE)
+ {
+ nfa_match = result;
+ goto theend;
+ }
if (result)
{
int bytelen;
@@ -6747,7 +6767,7 @@ theend:
/*
* Try match of "prog" with at regline["col"].
- * Returns 0 for failure, number of lines contained in the match otherwise.
+ * Returns <= 0 for failure, number of lines contained in the match otherwise.
*/
static long
nfa_regtry(prog, col)
@@ -6757,6 +6777,7 @@ nfa_regtry(prog, col)
int i;
regsubs_T subs, m;
nfa_state_T *start = prog->start;
+ int result;
#ifdef ENABLE_LOG
FILE *f;
#endif
@@ -6788,8 +6809,11 @@ nfa_regtry(prog, col)
clear_sub(&m.synt);
#endif
- if (nfa_regmatch(prog, start, &subs, &m) == FALSE)
+ result = nfa_regmatch(prog, start, &subs, &m);
+ if (result == FALSE)
return 0;
+ else if (result == NFA_TOO_EXPENSIVE)
+ return result;
cleanup_subexpr();
if (REG_MULTI)
@@ -6873,7 +6897,7 @@ nfa_regtry(prog, col)
* Match a regexp against a string ("line" points to the string) or multiple
* lines ("line" is NULL, use reg_getline()).
*
- * Returns 0 for failure, number of lines contained in the match otherwise.
+ * Returns <= 0 for failure, number of lines contained in the match otherwise.
*/
static long
nfa_regexec_both(line, startcol)
@@ -6926,9 +6950,7 @@ nfa_regexec_both(line, startcol)
nfa_nsubexpr = prog->nsubexp;
nfa_listid = 1;
nfa_alt_listid = 2;
-#ifdef DEBUG
nfa_regengine.expr = prog->pattern;
-#endif
if (prog->reganch && col > 0)
return 0L;
@@ -6976,9 +6998,7 @@ nfa_regexec_both(line, startcol)
retval = nfa_regtry(prog, col);
-#ifdef DEBUG
nfa_regengine.expr = NULL;
-#endif
theend:
return retval;
@@ -7000,9 +7020,7 @@ nfa_regcomp(expr, re_flags)
if (expr == NULL)
return NULL;
-#ifdef DEBUG
nfa_regengine.expr = expr;
-#endif
init_class_tab();
@@ -7079,10 +7097,8 @@ nfa_regcomp(expr, re_flags)
/* Remember whether this pattern has any \z specials in it. */
prog->reghasz = re_has_z;
#endif
-#ifdef DEBUG
prog->pattern = vim_strsave(expr);
nfa_regengine.expr = NULL;
-#endif
out:
vim_free(post_start);
@@ -7096,9 +7112,7 @@ fail:
#ifdef ENABLE_LOG
nfa_postfix_dump(expr, FAIL);
#endif
-#ifdef DEBUG
nfa_regengine.expr = NULL;
-#endif
goto out;
}
@@ -7112,9 +7126,7 @@ nfa_regfree(prog)
if (prog != NULL)
{
vim_free(((nfa_regprog_T *)prog)->match_text);
-#ifdef DEBUG
vim_free(((nfa_regprog_T *)prog)->pattern);
-#endif
vim_free(prog);
}
}
@@ -7125,7 +7137,7 @@ nfa_regfree(prog)
* Uses curbuf for line count and 'iskeyword'.
* If "line_lbr" is TRUE consider a "\n" in "line" to be a line break.
*
- * Return TRUE if there is a match, FALSE if not.
+ * Returns <= 0 for failure, number of lines contained in the match otherwise.
*/
static int
nfa_regexec_nl(rmp, line, col, line_lbr)
@@ -7145,7 +7157,7 @@ nfa_regexec_nl(rmp, line, col, line_lbr)
ireg_icombine = FALSE;
#endif
ireg_maxcol = 0;
- return (nfa_regexec_both(line, col) != 0);
+ return nfa_regexec_both(line, col);
}
@@ -7154,7 +7166,7 @@ nfa_regexec_nl(rmp, line, col, line_lbr)
* "rmp->regprog" is a compiled regexp as returned by vim_regcomp().
* Uses curbuf for line count and 'iskeyword'.
*
- * Return zero if there is no match. Return number of lines contained in the
+ * Return <= 0 if there is no match. Return number of lines contained in the
* match otherwise.
*
* Note: the body is the same as bt_regexec() except for nfa_regexec_both()
diff --git a/src/screen.c b/src/screen.c
index abbd9112d..bbf57b112 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -1584,9 +1584,17 @@ win_update(wp)
*/
if (VIsual_mode == Ctrl_V)
{
- colnr_T fromc, toc;
+ colnr_T fromc, toc;
+#if defined(FEAT_VIRTUALEDIT) && defined(FEAT_LINEBREAK)
+ int save_ve_flags = ve_flags;
+ if (curwin->w_p_lbr)
+ ve_flags = VE_ALL;
+#endif
getvcols(wp, &VIsual, &curwin->w_cursor, &fromc, &toc);
+#if defined(FEAT_VIRTUALEDIT) && defined(FEAT_LINEBREAK)
+ ve_flags = save_ve_flags;
+#endif
++toc;
if (curwin->w_curswant == MAXCOL)
toc = MAXCOL;
@@ -3702,7 +3710,12 @@ win_line(wp, lnum, startrow, endrow, nochange)
char_attr = 0; /* was: hl_attr(HLF_AT); */
#ifdef FEAT_DIFF
if (diff_hlf != (hlf_T)0)
+ {
char_attr = hl_attr(diff_hlf);
+ if (wp->w_p_cul && lnum == wp->w_cursor.lnum)
+ char_attr = hl_combine_attr(char_attr,
+ hl_attr(HLF_CUL));
+ }
#endif
p_extra = NULL;
c_extra = ' ';
@@ -3753,7 +3766,8 @@ win_line(wp, lnum, startrow, endrow, nochange)
#ifdef FEAT_SYN_HL
/* combine 'showbreak' with 'cursorline' */
if (wp->w_p_cul && lnum == wp->w_cursor.lnum)
- char_attr = hl_combine_attr(char_attr, HLF_CLN);
+ char_attr = hl_combine_attr(char_attr,
+ hl_attr(HLF_CUL));
#endif
}
# endif
@@ -3850,9 +3864,15 @@ win_line(wp, lnum, startrow, endrow, nochange)
&& v >= (long)shl->startcol
&& v < (long)shl->endcol)
{
+#ifdef FEAT_MBYTE
+ int tmp_col = v + MB_PTR2LEN(ptr);
+
+ if (shl->endcol < tmp_col)
+ shl->endcol = tmp_col;
+#endif
shl->attr_cur = shl->attr;
}
- else if (v >= (long)shl->endcol)
+ else if (v == (long)shl->endcol)
{
shl->attr_cur = 0;
next_search_hl(wp, shl, lnum, (colnr_T)v, cur);
@@ -3931,6 +3951,8 @@ win_line(wp, lnum, startrow, endrow, nochange)
&& n_extra == 0)
diff_hlf = HLF_CHD; /* changed line */
line_attr = hl_attr(diff_hlf);
+ if (wp->w_p_cul && lnum == wp->w_cursor.lnum)
+ line_attr = hl_combine_attr(line_attr, hl_attr(HLF_CUL));
}
#endif
@@ -4440,6 +4462,10 @@ win_line(wp, lnum, startrow, endrow, nochange)
/* TODO: is passing p for start of the line OK? */
n_extra = win_lbr_chartabsize(wp, line, p, (colnr_T)vcol,
NULL) - 1;
+ if (c == TAB && n_extra + col > W_WIDTH(wp))
+ n_extra = (int)wp->w_buffer->b_p_ts
+ - vcol % (int)wp->w_buffer->b_p_ts - 1;
+
c_extra = ' ';
if (vim_iswhite(c))
{
@@ -4494,7 +4520,7 @@ win_line(wp, lnum, startrow, endrow, nochange)
tab_len = (int)wp->w_buffer->b_p_ts
- vcol % (int)wp->w_buffer->b_p_ts - 1;
#ifdef FEAT_LINEBREAK
- if (!wp->w_p_lbr)
+ if (!wp->w_p_lbr || !wp->w_p_list)
#endif
/* tab amount depends on current column */
n_extra = tab_len;
@@ -4506,6 +4532,11 @@ win_line(wp, lnum, startrow, endrow, nochange)
int i;
int saved_nextra = n_extra;
+#ifdef FEAT_CONCEAL
+ if (is_concealing && vcol_off > 0)
+ /* there are characters to conceal */
+ tab_len += vcol_off;
+#endif
/* if n_extra > 0, it gives the number of chars, to
* use for a tab, else we need to calculate the width
* for a tab */
@@ -4531,6 +4562,12 @@ win_line(wp, lnum, startrow, endrow, nochange)
#endif
}
p_extra = p_extra_free;
+#ifdef FEAT_CONCEAL
+ /* n_extra will be increased by FIX_FOX_BOGUSCOLS
+ * macro below, so need to adjust for that here */
+ if (is_concealing && vcol_off > 0)
+ n_extra -= vcol_off;
+#endif
}
#endif
#ifdef FEAT_CONCEAL
@@ -4729,7 +4766,12 @@ win_line(wp, lnum, startrow, endrow, nochange)
{
diff_hlf = HLF_CHD;
if (attr == 0 || char_attr != attr)
+ {
char_attr = hl_attr(diff_hlf);
+ if (wp->w_p_cul && lnum == wp->w_cursor.lnum)
+ char_attr = hl_combine_attr(char_attr,
+ hl_attr(HLF_CUL));
+ }
}
# endif
}
@@ -4869,6 +4911,7 @@ win_line(wp, lnum, startrow, endrow, nochange)
* special character (via 'listchars' option "precedes:<char>".
*/
if (lcs_prec_todo != NUL
+ && wp->w_p_list
&& (wp->w_p_wrap ? wp->w_skipcol > 0 : wp->w_leftcol > 0)
#ifdef FEAT_DIFF
&& filler_todo <= 0
@@ -6019,7 +6062,7 @@ screen_line(row, coloff, endcol, clear_width
int c;
c = fillchar_vsep(&hl);
- if (ScreenLines[off_to] != c
+ if (ScreenLines[off_to] != (schar_T)c
# ifdef FEAT_MBYTE
|| (enc_utf8 && (int)ScreenLinesUC[off_to]
!= (c >= 0x80 ? c : 0))
@@ -7551,6 +7594,12 @@ next_search_hl(win, shl, lnum, mincol, cur)
shl->lnum = lnum;
if (shl->rm.regprog != NULL)
{
+ /* Remember whether shl->rm is using a copy of the regprog in
+ * cur->match. */
+ int regprog_is_copy = (shl != &search_hl && cur != NULL
+ && shl == &cur->hl
+ && cur->match.regprog == cur->hl.rm.regprog);
+
nmatched = vim_regexec_multi(&shl->rm, win, shl->buf, lnum,
matchcol,
#ifdef FEAT_RELTIME
@@ -7559,6 +7608,10 @@ next_search_hl(win, shl, lnum, mincol, cur)
NULL
#endif
);
+ /* Copy the regprog, in case it got freed and recompiled. */
+ if (regprog_is_copy)
+ cur->match.regprog = cur->hl.rm.regprog;
+
if (called_emsg || got_int)
{
/* Error while handling regexp: stop using this regexp. */
@@ -10174,9 +10227,9 @@ draw_tabline()
break;
screen_puts_len(NameBuff, len, 0, col,
#if defined(FEAT_SYN_HL)
- hl_combine_attr(attr, hl_attr(HLF_T))
+ hl_combine_attr(attr, hl_attr(HLF_T))
#else
- attr
+ attr
#endif
);
col += len;
@@ -10535,7 +10588,8 @@ win_redr_ruler(wp, always)
this_ru_col = (WITH_WIDTH(width) + 1) / 2;
if (this_ru_col + o < WITH_WIDTH(width))
{
- while (this_ru_col + o < WITH_WIDTH(width))
+ /* need at least 3 chars left for get_rel_pos() + NUL */
+ while (this_ru_col + o < WITH_WIDTH(width) && RULER_BUF_LEN > i + 4)
{
#ifdef FEAT_MBYTE
if (has_mbyte)
diff --git a/src/search.c b/src/search.c
index 283e77867..3276a77b7 100644
--- a/src/search.c
+++ b/src/search.c
@@ -12,7 +12,6 @@
#include "vim.h"
-static void save_re_pat __ARGS((int idx, char_u *pat, int magic));
#ifdef FEAT_EVAL
static void set_vv_searchforward __ARGS((void));
static int first_submatch __ARGS((regmmatch_T *rp));
@@ -272,7 +271,7 @@ reverse_text(s)
}
#endif
- static void
+ void
save_re_pat(idx, pat, magic)
int idx;
char_u *pat;
@@ -552,6 +551,7 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use, stop_lnum, tm)
int match_ok;
long nmatched;
int submatch = 0;
+ int first_match = TRUE;
int save_called_emsg = called_emsg;
#ifdef FEAT_SEARCH_EXTRA
int break_loop = FALSE;
@@ -565,33 +565,33 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use, stop_lnum, tm)
return FAIL;
}
- /* When not accepting a match at the start position set "extra_col" to a
- * non-zero value. Don't do that when starting at MAXCOL, since MAXCOL +
- * 1 is zero. */
- if ((options & SEARCH_START) || pos->col == MAXCOL)
- extra_col = 0;
-#ifdef FEAT_MBYTE
- /* Watch out for the "col" being MAXCOL - 2, used in a closed fold. */
- else if (dir != BACKWARD && has_mbyte
- && pos->lnum >= 1 && pos->lnum <= buf->b_ml.ml_line_count
- && pos->col < MAXCOL - 2)
- {
- ptr = ml_get_buf(buf, pos->lnum, FALSE) + pos->col;
- if (*ptr == NUL)
- extra_col = 1;
- else
- extra_col = (*mb_ptr2len)(ptr);
- }
-#endif
- else
- extra_col = 1;
-
/*
* find the string
*/
called_emsg = FALSE;
do /* loop for count */
{
+ /* When not accepting a match at the start position set "extra_col" to
+ * a non-zero value. Don't do that when starting at MAXCOL, since
+ * MAXCOL + 1 is zero. */
+ if ((options & SEARCH_START) || pos->col == MAXCOL)
+ extra_col = 0;
+#ifdef FEAT_MBYTE
+ /* Watch out for the "col" being MAXCOL - 2, used in a closed fold. */
+ else if (dir != BACKWARD && has_mbyte
+ && pos->lnum >= 1 && pos->lnum <= buf->b_ml.ml_line_count
+ && pos->col < MAXCOL - 2)
+ {
+ ptr = ml_get_buf(buf, pos->lnum, FALSE) + pos->col;
+ if (*ptr == NUL)
+ extra_col = 1;
+ else
+ extra_col = (*mb_ptr2len)(ptr);
+ }
+#endif
+ else
+ extra_col = 1;
+
start_pos = *pos; /* remember start pos for detecting no match */
found = 0; /* default: not found */
at_first_line = TRUE; /* default: start in first line */
@@ -677,7 +677,7 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use, stop_lnum, tm)
* otherwise "/$" will get stuck on end of line.
*/
while (matchpos.lnum == 0
- && ((options & SEARCH_END)
+ && ((options & SEARCH_END) && first_match
? (nmatched == 1
&& (int)endpos.col - 1
< (int)start_pos.col + extra_col)
@@ -908,6 +908,7 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use, stop_lnum, tm)
pos->coladd = 0;
#endif
found = 1;
+ first_match = FALSE;
/* Set variables used for 'incsearch' highlighting. */
search_match_lines = endpos.lnum - matchpos.lnum;
@@ -3931,7 +3932,7 @@ again:
if (lt(end_pos, start_pos))
curwin->w_cursor = start_pos;
else if (*p_sel == 'e')
- ++curwin->w_cursor.col;
+ inc_cursor();
VIsual = start_pos;
VIsual_mode = 'v';
redraw_curbuf_later(INVERTED); /* update the inversion */
@@ -4440,12 +4441,11 @@ current_quote(oap, count, include, quotechar)
#endif /* FEAT_TEXTOBJ */
-static int is_one_char __ARGS((char_u *pattern));
+static int is_one_char __ARGS((char_u *pattern, int move));
/*
* Find next search match under cursor, cursor at end.
* Used while an operator is pending, and in Visual mode.
- * TODO: redo only works when used in operator pending mode
*/
int
current_search(count, forward)
@@ -4490,7 +4490,7 @@ current_search(count, forward)
orig_pos = pos = start_pos = curwin->w_cursor;
/* Is the pattern is zero-width? */
- one_char = is_one_char(spats[last_idx].pat);
+ one_char = is_one_char(spats[last_idx].pat, TRUE);
if (one_char == -1)
{
p_ws = old_p_ws;
@@ -4549,6 +4549,10 @@ current_search(count, forward)
start_pos = pos;
flags = forward ? SEARCH_END : 0;
+ /* Check again from the current cursor position,
+ * since the next match might actually by only one char wide */
+ one_char = is_one_char(spats[last_idx].pat, FALSE);
+
/* move to match, except for zero-width matches, in which case, we are
* already on the next match */
if (!one_char)
@@ -4598,26 +4602,38 @@ current_search(count, forward)
/*
* Check if the pattern is one character or zero-width.
+ * If move is TRUE, check from the beginning of the buffer, else from the
+ * current cursor position.
* Returns TRUE, FALSE or -1 for failure.
*/
static int
-is_one_char(pattern)
+is_one_char(pattern, move)
char_u *pattern;
+ int move;
{
regmmatch_T regmatch;
int nmatched = 0;
int result = -1;
pos_T pos;
int save_called_emsg = called_emsg;
+ int flag = 0;
if (search_regcomp(pattern, RE_SEARCH, RE_SEARCH,
SEARCH_KEEP, &regmatch) == FAIL)
return -1;
/* move to match */
- clearpos(&pos);
+ if (move)
+ clearpos(&pos)
+ else
+ {
+ pos = curwin->w_cursor;
+ /* accept a match at the cursor position */
+ flag = SEARCH_START;
+ }
+
if (searchit(curwin, curbuf, &pos, FORWARD, spats[last_idx].pat, 1,
- SEARCH_KEEP, RE_SEARCH, 0, NULL) != FAIL)
+ SEARCH_KEEP + flag, RE_SEARCH, 0, NULL) != FAIL)
{
/* Zero-width pattern should match somewhere, then we can check if
* start and end are in the same position. */
diff --git a/src/spell.c b/src/spell.c
index 50636421e..9d7f933a2 100644
--- a/src/spell.c
+++ b/src/spell.c
@@ -1154,11 +1154,14 @@ spell_check(wp, ptr, attrp, capcol, docount)
if (capcol != NULL && wp->w_s->b_cap_prog != NULL)
{
regmatch_T regmatch;
+ int r;
/* Check for end of sentence. */
regmatch.regprog = wp->w_s->b_cap_prog;
regmatch.rm_ic = FALSE;
- if (vim_regexec(&regmatch, ptr, 0))
+ r = vim_regexec(&regmatch, ptr, 0);
+ wp->w_s->b_cap_prog = regmatch.regprog;
+ if (r)
*capcol = (int)(regmatch.endp[0] - ptr);
}
@@ -1786,7 +1789,6 @@ can_compound(slang, word, flags)
char_u *word;
char_u *flags;
{
- regmatch_T regmatch;
#ifdef FEAT_MBYTE
char_u uflags[MAXWLEN * 2];
int i;
@@ -1808,9 +1810,7 @@ can_compound(slang, word, flags)
else
#endif
p = flags;
- regmatch.regprog = slang->sl_compprog;
- regmatch.rm_ic = FALSE;
- if (!vim_regexec(&regmatch, p, 0))
+ if (!vim_regexec_prog(&slang->sl_compprog, FALSE, p, 0))
return FALSE;
/* Count the number of syllables. This may be slow, do it last. If there
@@ -1930,8 +1930,7 @@ valid_word_prefix(totprefcnt, arridx, flags, word, slang, cond_req)
{
int prefcnt;
int pidx;
- regprog_T *rp;
- regmatch_T regmatch;
+ regprog_T **rp;
int prefid;
prefid = (unsigned)flags >> 24;
@@ -1950,12 +1949,10 @@ valid_word_prefix(totprefcnt, arridx, flags, word, slang, cond_req)
/* Check the condition, if there is one. The condition index is
* stored in the two bytes above the prefix ID byte. */
- rp = slang->sl_prefprog[((unsigned)pidx >> 8) & 0xffff];
- if (rp != NULL)
+ rp = &slang->sl_prefprog[((unsigned)pidx >> 8) & 0xffff];
+ if (*rp != NULL)
{
- regmatch.regprog = rp;
- regmatch.rm_ic = FALSE;
- if (!vim_regexec(&regmatch, word, 0))
+ if (!vim_regexec_prog(rp, FALSE, word, 0))
continue;
}
else if (cond_req)
@@ -4841,6 +4838,7 @@ typedef struct afffile_S
unsigned af_nosuggest; /* NOSUGGEST ID */
int af_pfxpostpone; /* postpone prefixes without chop string and
without flags */
+ int af_ignoreextra; /* IGNOREEXTRA present */
hashtab_T af_pref; /* hashtable for prefixes, affheader_T */
hashtab_T af_suff; /* hashtable for suffixes, affheader_T */
hashtab_T af_comp; /* hashtable for compound flags, compitem_T */
@@ -5605,6 +5603,10 @@ spell_read_aff(spin, fname)
{
aff->af_pfxpostpone = TRUE;
}
+ else if (is_aff_rule(items, itemcnt, "IGNOREEXTRA", 1))
+ {
+ aff->af_ignoreextra = TRUE;
+ }
else if ((STRCMP(items[0], "PFX") == 0
|| STRCMP(items[0], "SFX") == 0)
&& aff_todo == 0
@@ -5712,9 +5714,11 @@ spell_read_aff(spin, fname)
int lasti = 5;
/* Myspell allows extra text after the item, but that might
- * mean mistakes go unnoticed. Require a comment-starter.
- * Hunspell uses a "-" item. */
- if (itemcnt > lasti && *items[lasti] != '#'
+ * mean mistakes go unnoticed. Require a comment-starter,
+ * unless IGNOREEXTRA is used. Hunspell uses a "-" item. */
+ if (itemcnt > lasti
+ && !aff->af_ignoreextra
+ && *items[lasti] != '#'
&& (STRCMP(items[lasti], "-") != 0
|| itemcnt != lasti + 1))
smsg((char_u *)_(e_afftrailing), fname, lnum, items[lasti]);
@@ -6896,7 +6900,6 @@ store_aff_word(spin, word, afflist, affile, ht, xht, condit, flags,
hashitem_T *hi;
affheader_T *ah;
affentry_T *ae;
- regmatch_T regmatch;
char_u newword[MAXWLEN];
int retval = OK;
int i, j;
@@ -6937,15 +6940,14 @@ store_aff_word(spin, word, afflist, affile, ht, xht, condit, flags,
* When a previously added affix had CIRCUMFIX this one
* must have it too, if it had not then this one must not
* have one either. */
- regmatch.regprog = ae->ae_prog;
- regmatch.rm_ic = FALSE;
if ((xht != NULL || !affile->af_pfxpostpone
|| ae->ae_chop != NULL
|| ae->ae_flags != NULL)
&& (ae->ae_chop == NULL
|| STRLEN(ae->ae_chop) < wordlen)
&& (ae->ae_prog == NULL
- || vim_regexec(&regmatch, word, (colnr_T)0))
+ || vim_regexec_prog(&ae->ae_prog, FALSE,
+ word, (colnr_T)0))
&& (((condit & CONDIT_CFIX) == 0)
== ((condit & CONDIT_AFF) == 0
|| ae->ae_flags == NULL
@@ -10471,6 +10473,7 @@ check_need_cap(lnum, col)
break;
}
}
+ curwin->w_s->b_cap_prog = regmatch.regprog;
}
vim_free(line_copy);
diff --git a/src/structs.h b/src/structs.h
index 1dbf4470d..e37a39589 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -137,7 +137,7 @@ typedef struct
#ifdef FEAT_LINEBREAK
int wo_bri;
# define w_p_bri w_onebuf_opt.wo_bri /* 'breakindent' */
- char_u *wo_briopt;
+ char_u *wo_briopt;
# define w_p_briopt w_onebuf_opt.wo_briopt /* 'breakindentopt' */
#endif
#ifdef FEAT_DIFF
@@ -1251,6 +1251,24 @@ typedef struct {
} syn_time_T;
#endif
+#ifdef FEAT_CRYPT
+/*
+ * Structure to hold the type of encryption and the state of encryption or
+ * decryption.
+ */
+typedef struct {
+ int method_nr;
+ void *method_state; /* method-specific state information */
+} cryptstate_T;
+
+/* values for method_nr */
+# define CRYPT_M_ZIP 0
+# define CRYPT_M_BF 1
+# define CRYPT_M_BF2 2
+# define CRYPT_M_COUNT 3 /* number of crypt methods */
+#endif
+
+
/*
* These are items normally related to a buffer. But when using ":ownsyntax"
* a window may have its own instance.
@@ -1520,6 +1538,8 @@ struct file_buffer
int b_p_ai; /* 'autoindent' */
int b_p_ai_nopaste; /* b_p_ai saved for paste mode */
+ char_u *b_p_bkc; /* 'backupcopy' */
+ unsigned b_bkc_flags; /* flags for 'backupcopy' */
int b_p_ci; /* 'copyindent' */
int b_p_bin; /* 'binary' */
#ifdef FEAT_MBYTE
@@ -1779,7 +1799,12 @@ struct file_buffer
int b_was_netbeans_file;/* TRUE if b_netbeans_file was once set */
#endif
-};
+#ifdef FEAT_CRYPT
+ cryptstate_T *b_cryptstate; /* Encryption state while reading or writing
+ * the file. NULL when not using encryption. */
+#endif
+
+}; /* file_buffer */
#ifdef FEAT_DIFF
diff --git a/src/syntax.c b/src/syntax.c
index a93581018..4f6ef924b 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -992,13 +992,16 @@ syn_match_linecont(lnum)
linenr_T lnum;
{
regmmatch_T regmatch;
+ int r;
if (syn_block->b_syn_linecont_prog != NULL)
{
regmatch.rmm_ic = syn_block->b_syn_linecont_ic;
regmatch.regprog = syn_block->b_syn_linecont_prog;
- return syn_regexec(&regmatch, lnum, (colnr_T)0,
+ r = syn_regexec(&regmatch, lnum, (colnr_T)0,
IF_SYN_TIME(&syn_block->b_syn_linecont_time));
+ syn_block->b_syn_linecont_prog = regmatch.regprog;
+ return r;
}
return FALSE;
}
@@ -2075,6 +2078,8 @@ syn_current_attr(syncing, displaying, can_spell, keep_state)
cur_si->si_cont_list, &spp->sp_syn,
spp->sp_flags & HL_CONTAINED))))
{
+ int r;
+
/* If we already tried matching in this line, and
* there isn't a match before next_match_col, skip
* this item. */
@@ -2089,10 +2094,12 @@ syn_current_attr(syncing, displaying, can_spell, keep_state)
regmatch.rmm_ic = spp->sp_ic;
regmatch.regprog = spp->sp_prog;
- if (!syn_regexec(&regmatch,
+ r = syn_regexec(&regmatch,
current_lnum,
(colnr_T)lc_col,
- IF_SYN_TIME(&spp->sp_time)))
+ IF_SYN_TIME(&spp->sp_time));
+ spp->sp_prog = regmatch.regprog;
+ if (!r)
{
/* no match in this line, try another one */
spp->sp_startcol = MAXCOL;
@@ -2963,6 +2970,7 @@ find_endpos(idx, startpos, m_endpos, hl_endpos, flagsp, end_endpos,
for (idx = start_idx; idx < syn_block->b_syn_patterns.ga_len; ++idx)
{
int lc_col = matchcol;
+ int r;
spp = &(SYN_ITEMS(syn_block)[idx]);
if (spp->sp_type != SPTYPE_END) /* past last END pattern */
@@ -2973,8 +2981,10 @@ find_endpos(idx, startpos, m_endpos, hl_endpos, flagsp, end_endpos,
regmatch.rmm_ic = spp->sp_ic;
regmatch.regprog = spp->sp_prog;
- if (syn_regexec(&regmatch, startpos->lnum, lc_col,
- IF_SYN_TIME(&spp->sp_time)))
+ r = syn_regexec(&regmatch, startpos->lnum, lc_col,
+ IF_SYN_TIME(&spp->sp_time));
+ spp->sp_prog = regmatch.regprog;
+ if (r)
{
if (best_idx == -1 || regmatch.startpos[0].col
< best_regmatch.startpos[0].col)
@@ -3000,14 +3010,16 @@ find_endpos(idx, startpos, m_endpos, hl_endpos, flagsp, end_endpos,
if (spp_skip != NULL)
{
int lc_col = matchcol - spp_skip->sp_offsets[SPO_LC_OFF];
+ int r;
if (lc_col < 0)
lc_col = 0;
regmatch.rmm_ic = spp_skip->sp_ic;
regmatch.regprog = spp_skip->sp_prog;
- if (syn_regexec(&regmatch, startpos->lnum, lc_col,
- IF_SYN_TIME(&spp_skip->sp_time))
- && regmatch.startpos[0].col
+ r = syn_regexec(&regmatch, startpos->lnum, lc_col,
+ IF_SYN_TIME(&spp_skip->sp_time));
+ spp_skip->sp_prog = regmatch.regprog;
+ if (r && regmatch.startpos[0].col
<= best_regmatch.startpos[0].col)
{
/* Add offset to skip pattern match */
@@ -6292,11 +6304,10 @@ ex_ownsyntax(eap)
curwin->w_s = (synblock_T *)alloc(sizeof(synblock_T));
memset(curwin->w_s, 0, sizeof(synblock_T));
#ifdef FEAT_SPELL
+ /* TODO: keep the spell checking as it was. */
curwin->w_p_spell = FALSE; /* No spell checking */
clear_string_option(&curwin->w_s->b_p_spc);
clear_string_option(&curwin->w_s->b_p_spf);
- vim_regfree(curwin->w_s->b_cap_prog);
- curwin->w_s->b_cap_prog = NULL;
clear_string_option(&curwin->w_s->b_p_spl);
#endif
}
diff --git a/src/term.c b/src/term.c
index 95c29ccf4..a1ab53729 100644
--- a/src/term.c
+++ b/src/term.c
@@ -153,11 +153,6 @@ char *UP, *BC, PC;
static char_u *vim_tgetstr __ARGS((char *s, char_u **pp));
#endif /* HAVE_TGETENT */
-#if defined(FEAT_TERMRESPONSE)
-static int xt_index_in = 0;
-static int xt_index_out = 0;
-#endif
-
static int detected_8bit = FALSE; /* detected 8-bit terminal */
static struct builtin_term builtin_termcaps[] =
@@ -3312,40 +3307,6 @@ stoptermcap()
}
#if defined(FEAT_TERMRESPONSE) || defined(PROTO)
-# if defined(UNIX) || defined(PROTO)
-/*
- * Return TRUE when the xterm version was requested or anything else that
- * would send an ESC sequence back to Vim.
- * If not sent yet, prevent it from being sent soon.
- * Used to check whether it is OK to enable checking for DEC mouse codes,
- * which conflict with may xterm ESC sequences.
- */
- int
-did_request_esc_sequence()
-{
- if (crv_status == CRV_GET)
- crv_status = 0;
- if (u7_status == U7_GET)
- u7_status = 0;
- return crv_status == CRV_SENT || u7_status == U7_SENT
- || xt_index_out > xt_index_in;
-}
-
-/*
- * If requesting the version was disabled in did_request_esc_sequence(),
- * enable it again.
- */
- void
-resume_get_esc_sequence()
-{
- if (crv_status == 0)
- crv_status = CRV_GET;
- if (u7_status == 0)
- u7_status = U7_GET;
-}
-# endif
-
-
/*
* Request version string (for xterm) when needed.
* Only do this after switching to raw mode, otherwise the result will be
@@ -3358,8 +3319,6 @@ resume_get_esc_sequence()
* Insert mode.
* On Unix only do it when both output and input are a tty (avoid writing
* request to terminal while reading from a file).
- * Do not do this when a mouse is being detected that starts with the same ESC
- * sequence as the termresponse.
* The result is caught in check_termcode().
*/
void
@@ -3373,7 +3332,6 @@ may_req_termresponse()
# ifdef UNIX
&& isatty(1)
&& isatty(read_cmd_fd)
- && !xterm_conflict_mouse
# endif
&& *T_CRV != NUL)
{
@@ -3742,8 +3700,8 @@ add_termcode(name, string, flags)
#if defined(WIN3264) && !defined(FEAT_GUI)
if (s[0] == K_NUL)
{
- STRMOVE(s + 1, s);
- s[1] = 3;
+ STRMOVE(s + 1, s);
+ s[1] = 3;
}
#endif
@@ -4212,24 +4170,31 @@ check_termcode(max_offset, buf, bufsize, buflen)
#ifdef FEAT_TERMRESPONSE
if (key_name[0] == NUL
- /* URXVT mouse uses <ESC>[#;#;#M, but we are matching <ESC>[ */
+ /* Mouse codes of DEC, pterm, and URXVT start with <ESC>[. When
+ * detecting the start of these mouse codes they might as well be
+ * another key code or terminal response. */
+# ifdef FEAT_MOUSE_DEC
+ || key_name[0] == KS_DEC_MOUSE
+# endif
+# ifdef FEAT_MOUSE_PTERM
+ || key_name[0] == KS_PTERM_MOUSE
+# endif
+# ifdef FEAT_MOUSE_URXVT
|| key_name[0] == KS_URXVT_MOUSE
-# ifdef FEAT_MBYTE
- || u7_status == U7_SENT
# endif
- )
+ )
{
- /* Check for some responses from terminal start with "<Esc>[" or
- * CSI.
+ /* Check for some responses from the terminal starting with
+ * "<Esc>[" or CSI:
*
- * - xterm version string: <Esc>[>{x};{vers};{y}c
+ * - Xterm version string: <Esc>[>{x};{vers};{y}c
* Also eat other possible responses to t_RV, rxvt returns
* "<Esc>[?1;2c". Also accept CSI instead of <Esc>[.
* mrxvt has been reported to have "+" in the version. Assume
* the escape sequence ends with a letter or one of "{|}~".
*
- * - cursor position report: <Esc>[{row};{col}R
- * The final byte is 'R'. now it is only used for checking for
+ * - Cursor position report: <Esc>[{row};{col}R
+ * The final byte must be 'R'. It is used for checking the
* ambiguous-width character state.
*/
p = tp[0] == CSI ? tp + 1 : tp + 2;
@@ -4269,36 +4234,42 @@ check_termcode(max_offset, buf, bufsize, buflen)
* u7_status is not "sent", it may be from a previous Vim that
* just exited. But not for <S-F3>, it sends something
* similar, check for row and column to make sense. */
- if (j == 1 && tp[i] == 'R' && row_char == '2' && col >= 2)
+ if (j == 1 && tp[i] == 'R')
{
- char *aw = NULL;
+ if (row_char == '2' && col >= 2)
+ {
+ char *aw = NULL;
- LOG_TR("Received U7 status");
- u7_status = U7_GOT;
+ LOG_TR("Received U7 status");
+ u7_status = U7_GOT;
# ifdef FEAT_AUTOCMD
- did_cursorhold = TRUE;
+ did_cursorhold = TRUE;
# endif
- if (col == 2)
- aw = "single";
- else if (col == 3)
- aw = "double";
- if (aw != NULL && STRCMP(aw, p_ambw) != 0)
- {
- /* Setting the option causes a screen redraw. Do that
- * right away if possible, keeping any messages. */
- set_option_value((char_u *)"ambw", 0L, (char_u *)aw, 0);
-# ifdef DEBUG_TERMRESPONSE
+ if (col == 2)
+ aw = "single";
+ else if (col == 3)
+ aw = "double";
+ if (aw != NULL && STRCMP(aw, p_ambw) != 0)
{
- char buf[100];
- int r = redraw_asap(CLEAR);
+ /* Setting the option causes a screen redraw. Do
+ * that right away if possible, keeping any
+ * messages. */
+ set_option_value((char_u *)"ambw", 0L,
+ (char_u *)aw, 0);
+# ifdef DEBUG_TERMRESPONSE
+ {
+ char buf[100];
+ int r = redraw_asap(CLEAR);
- sprintf(buf, "set 'ambiwidth', redraw_asap(): %d",
- r);
- log_tr(buf);
- }
+ sprintf(buf,
+ "set 'ambiwidth', redraw_asap(): %d",
+ r);
+ log_tr(buf);
+ }
# else
- redraw_asap(CLEAR);
+ redraw_asap(CLEAR);
# endif
+ }
}
key_name[0] = (int)KS_EXTRA;
key_name[1] = (int)KE_IGNORE;
@@ -4563,19 +4534,19 @@ check_termcode(max_offset, buf, bufsize, buflen)
return -1;
/* when mouse reporting is SGR, add 32 to mouse code */
- if (key_name[0] == KS_SGR_MOUSE)
- mouse_code += 32;
+ if (key_name[0] == KS_SGR_MOUSE)
+ mouse_code += 32;
mouse_col = getdigits(&p) - 1;
if (*p++ != ';')
return -1;
mouse_row = getdigits(&p) - 1;
- if (key_name[0] == KS_SGR_MOUSE && *p == 'm')
+ if (key_name[0] == KS_SGR_MOUSE && *p == 'm')
mouse_code |= MOUSE_RELEASE;
- else if (*p != 'M')
+ else if (*p != 'M')
return -1;
- p++;
+ p++;
slen += (int)(p - (tp + slen));
@@ -4592,7 +4563,7 @@ check_termcode(max_offset, buf, bufsize, buflen)
for (slen2 = slen; slen2 < len; slen2++)
{
if (tp[slen2] == 'M'
- || (key_name[0] == KS_SGR_MOUSE
+ || (key_name[0] == KS_SGR_MOUSE
&& tp[slen2] == 'm'))
{
cmd_complete = 1;
@@ -5769,6 +5740,9 @@ show_one_termcode(name, code, printit)
* termcap codes from the terminal itself.
* We get them one by one to avoid a very long response string.
*/
+static int xt_index_in = 0;
+static int xt_index_out = 0;
+
static void
req_codes_from_term()
{
diff --git a/src/testdir/Make_amiga.mak b/src/testdir/Make_amiga.mak
index 60d820ab8..c8becc7a7 100644
--- a/src/testdir/Make_amiga.mak
+++ b/src/testdir/Make_amiga.mak
@@ -36,12 +36,22 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
test94.out test95.out test96.out test97.out test98.out \
test99.out test100.out test101.out test102.out test103.out \
test104.out test105.out test106.out test107.out \
+ test_argument_count.out \
test_autoformat_join.out \
test_breakindent.out \
+ test_changelist.out \
+ test_close_count.out \
+ test_command_count.out \
+ test_eval.out \
+ test_insertcount.out \
test_listlbr.out \
test_listlbr_utf8.out \
- test_eval.out \
- test_options.out
+ test_mapping.out \
+ test_nested_function.out \
+ test_options.out \
+ test_qf_title.out \
+ test_signs.out \
+ test_utf8.out
.SUFFIXES: .in .out
@@ -165,9 +175,19 @@ test104.out: test104.in
test105.out: test105.in
test106.out: test106.in
test107.out: test107.in
+test_argument_count.out: test_argument_count.in
test_autoformat_join.out: test_autoformat_join.in
test_breakindent.out: test_breakindent.in
+test_changelist.out: test_changelist.in
+test_close_count.out: test_close_count.in
+test_command_count.out: test_command_count.in
+test_eval.out: test_eval.in
+test_insertcount.out: test_insertcount.in
test_listlbr.out: test_listlbr.in
test_listlbr_utf8.out: test_listlbr_utf8.in
-test_eval.out: test_eval.in
+test_mapping.out: test_mapping.in
+test_nested_function.out: test_nested_function.in
test_options.out: test_options.in
+test_qf_title.out: test_qf_title.in
+test_signs.out: test_signs.in
+test_utf8.out: test_utf8.in
diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak
index d715d0776..57f85ea67 100644
--- a/src/testdir/Make_dos.mak
+++ b/src/testdir/Make_dos.mak
@@ -35,12 +35,22 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
test94.out test95.out test96.out test98.out test99.out \
test100.out test101.out test102.out test103.out test104.out \
test105.out test106.out test107.out\
+ test_argument_count.out \
test_autoformat_join.out \
test_breakindent.out \
+ test_changelist.out \
+ test_close_count.out \
+ test_command_count.out \
+ test_eval.out \
+ test_insertcount.out \
test_listlbr.out \
test_listlbr_utf8.out \
- test_eval.out \
- test_options.out
+ test_mapping.out \
+ test_nested_function.out \
+ test_options.out \
+ test_qf_title.out \
+ test_signs.out \
+ test_utf8.out
SCRIPTS32 = test50.out test70.out
@@ -59,7 +69,7 @@ win32: fixff $(SCRIPTS16) $(SCRIPTS) $(SCRIPTS32) report
fixff:
-$(VIMPROG) -u dos.vim --noplugin "+argdo set ff=dos|upd" +q *.in *.ok
-$(VIMPROG) -u dos.vim --noplugin "+argdo set ff=unix|upd" +q \
- dotest.in test60.ok test71.ok test74.ok
+ dotest.in test60.ok test71.ok test74.ok test100.ok
report:
@echo ""
@@ -81,6 +91,7 @@ clean:
-if exist Xfind rd /s /q Xfind
-if exist viminfo del viminfo
-del test.log
+ -if exist benchmark.out del benchmark.out
.in.out:
-if exist $*.failed del $*.failed
@@ -97,3 +108,11 @@ clean:
nolog:
-del test.log
+
+benchmark:
+ bench_re_freeze.out
+
+bench_re_freeze.out: bench_re_freeze.vim
+ -if exist benchmark.out del benchmark.out
+ $(VIMPROG) -u dos.vim -U NONE --noplugin $*.in
+ @IF EXIST benchmark.out ( type benchmark.out )
diff --git a/src/testdir/Make_ming.mak b/src/testdir/Make_ming.mak
index 899351769..5718d4601 100644
--- a/src/testdir/Make_ming.mak
+++ b/src/testdir/Make_ming.mak
@@ -12,11 +12,13 @@ ifneq (sh.exe, $(SHELL))
DEL = rm -f
MV = mv
CP = cp
+CAT = cat
DIRSLASH = /
else
DEL = del
MV = rename
CP = copy
+CAT = type
DIRSLASH = \\
endif
@@ -55,17 +57,29 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
test94.out test95.out test96.out test98.out test99.out \
test100.out test101.out test102.out test103.out test104.out \
test105.out test106.out test107.out \
+ test_argument_count.out \
test_autoformat_join.out \
test_breakindent.out \
+ test_changelist.out \
+ test_close_count.out \
+ test_command_count.out \
+ test_eval.out \
+ test_insertcount.out \
test_listlbr.out \
test_listlbr_utf8.out \
- test_eval.out \
- test_options.out
+ test_mapping.out \
+ test_nested_function.out \
+ test_options.out \
+ test_qf_title.out \
+ test_signs.out \
+ test_utf8.out
SCRIPTS32 = test50.out test70.out
SCRIPTS_GUI = test16.out
+SCRIPTS_BENCH = bench_re_freeze.out
+
.SUFFIXES: .in .out
vimall: fixff $(SCRIPTS16) $(SCRIPTS) $(SCRIPTS_GUI) $(SCRIPTS32)
@@ -74,6 +88,8 @@ vimall: fixff $(SCRIPTS16) $(SCRIPTS) $(SCRIPTS_GUI) $(SCRIPTS32)
nongui: fixff $(SCRIPTS16) $(SCRIPTS)
echo ALL DONE
+benchmark: $(SCRIPTS_BENCH)
+
small:
echo ALL DONE
@@ -108,3 +124,8 @@ clean:
-$(DEL) X*
-$(DEL) test.ok
-$(DEL) viminfo
+
+bench_re_freeze.out: bench_re_freeze.vim
+ -$(DEL) benchmark.out
+ $(VIMPROG) -u dos.vim -U NONE --noplugin $*.in
+ $(CAT) benchmark.out
diff --git a/src/testdir/Make_os2.mak b/src/testdir/Make_os2.mak
index b37bf2aae..1ba2dfe94 100644
--- a/src/testdir/Make_os2.mak
+++ b/src/testdir/Make_os2.mak
@@ -37,12 +37,24 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
test94.out test95.out test96.out test98.out test99.out \
test100.out test101.out test102.out test103.out test104.out \
test105.out test106.out test107.out \
+ test_argument_count.out \
test_autoformat_join.out \
- test_eval.out \
test_breakindent.out \
- test_listlbr_utf8.out \
+ test_changelist.out \
+ test_close_count.out \
+ test_command_count.out \
+ test_eval.out \
+ test_insertcount.out \
test_listlbr.out \
- test_options.out
+ test_listlbr_utf8.out \
+ test_mapping.out \
+ test_nested_function.out \
+ test_options.out \
+ test_qf_title.out \
+ test_signs.out \
+ test_utf8.out
+
+SCRIPTS_BENCH = bench_re_freeze.out
.SUFFIXES: .in .out
@@ -51,6 +63,8 @@ all: /tmp $(SCRIPTS)
$(SCRIPTS): $(VIMPROG)
+benchmark: $(SCRIPTS_BENCH)
+
clean:
-rm -rf *.out Xdotest test.ok tiny.vim small.vim mbyte.vim viminfo
@@ -69,3 +83,10 @@ clean:
# Create a directory for temp files
/tmp:
-mkdir /tmp
+
+bench_re_freeze.out: bench_re_freeze.vim
+ -del $*.failed test.ok benchmark.out
+ copy $*.ok test.ok
+ $(VIMPROG) -u os2.vim --noplugin -s dotest.in $*.in
+ type benchmark.out
+
diff --git a/src/testdir/Make_vms.mms b/src/testdir/Make_vms.mms
index 9c6f1189a..9fecf9fa6 100644
--- a/src/testdir/Make_vms.mms
+++ b/src/testdir/Make_vms.mms
@@ -4,7 +4,7 @@
# Authors: Zoltan Arpadffy, <arpadffy@polarhome.com>
# Sandor Kopanyi, <sandor.kopanyi@mailbox.hu>
#
-# Last change: 2014 May 28
+# Last change: 2014 Dec 13
#
# This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
# Edit the lines in the Configuration section below to select.
@@ -45,7 +45,7 @@
# It fails because VMS does not support this feature yet.
# WANT_MZSCH = YES
-# Comment out if you have ODS-5 file system
+# Comment out if you have ODS-5 file system
# HAVE_ODS5 = YES
# Comment out if you have gzip on your system
@@ -54,10 +54,10 @@
# Comment out if you have GNU compatible diff on your system
# HAVE_GDIFF = YES
-# Comment out if you have GNU compatible cksum on your system
+# Comment out if you have GNU compatible cksum on your system
# HAVE_CKSUM = YES
-# Comment out if you have ICONV support
+# Comment out if you have ICONV support
# HAVE_ICONV = YES
# Comment out if you have LUA support
@@ -96,12 +96,22 @@ SCRIPT = test1.out test2.out test3.out test4.out test5.out \
test95.out test96.out test98.out test99.out \
test100.out test101.out test103.out test104.out \
test105.out test106.out test107.out \
+ test_argument_count.out \
test_autoformat_join.out \
test_breakindent.out \
+ test_changelist.out \
+ test_close_count.out \
+ test_command_count.out \
+ test_eval.out \
+ test_insertcount.out \
test_listlbr.out \
test_listlbr_utf8.out \
- test_eval.out \
- test_options.out
+ test_mapping.out \
+ test_nested_function.out \
+ test_options.out \
+ test_qf_title.out \
+ test_signs.out \
+ test_utf8.out
# Known problems:
# test17: ?
diff --git a/src/testdir/Makefile b/src/testdir/Makefile
index abfef353b..e76a72b00 100644
--- a/src/testdir/Makefile
+++ b/src/testdir/Makefile
@@ -33,21 +33,35 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
test94.out test95.out test96.out test97.out test98.out \
test99.out test100.out test101.out test102.out test103.out \
test104.out test105.out test106.out test107.out \
+ test_argument_count.out \
test_autoformat_join.out \
test_breakindent.out \
+ test_changelist.out \
+ test_close_count.out \
+ test_command_count.out \
+ test_eval.out \
+ test_insertcount.out \
test_listlbr.out \
test_listlbr_utf8.out \
- test_eval.out \
- test_options.out
+ test_mapping.out \
+ test_nested_function.out \
+ test_options.out \
+ test_qf_title.out \
+ test_signs.out \
+ test_utf8.out
SCRIPTS_GUI = test16.out
+SCRIPTS_BENCH = bench_re_freeze.out
+
.SUFFIXES: .in .out
nongui: nolog $(SCRIPTS) report
gui: nolog $(SCRIPTS) $(SCRIPTS_GUI) report
+benchmark: $(SCRIPTS_BENCH)
+
report:
@echo
@echo 'Test results:'
@@ -59,7 +73,7 @@ report:
$(SCRIPTS) $(SCRIPTS_GUI): $(VIMPROG)
RM_ON_RUN = test.out X* viminfo
-RM_ON_START = tiny.vim small.vim mbyte.vim mzscheme.vim lua.vim test.ok
+RM_ON_START = tiny.vim small.vim mbyte.vim mzscheme.vim lua.vim test.ok benchmark.out
RUN_VIM = VIMRUNTIME=$(SCRIPTSOURCE); export VIMRUNTIME; $(VALGRIND) $(VIMPROG) -u unix.vim -U NONE --noplugin -s dotest.in
clean:
@@ -114,5 +128,14 @@ test49.out: test49.vim
test60.out: test60.vim
+bench_re_freeze.out: bench_re_freeze.vim
+ -rm -rf benchmark.out $(RM_ON_RUN)
+ # Sleep a moment to avoid that the xterm title is messed up.
+ # 200 msec is sufficient, but only modern sleep supports a fraction of
+ # a second, fall back to a second if it fails.
+ @-/bin/sh -c "sleep .2 > /dev/null 2>&1 || sleep 1"
+ -$(RUN_VIM) $*.in
+ @/bin/sh -c "if test -f benchmark.out; then cat benchmark.out; fi"
+
nolog:
-rm -f test.log
diff --git a/src/testdir/README.txt b/src/testdir/README.txt
new file mode 100644
index 000000000..d42c7c9bc
--- /dev/null
+++ b/src/testdir/README.txt
@@ -0,0 +1,18 @@
+This directory contains tests for various Vim features.
+
+If it makes sense, try to add a new test to an already existing file. You may
+want to separate it from other tests in that file using :" (that's an Ex
+command comment).
+
+The numbered tests are older, we have switched to named tests.
+
+To add a new test:
+1) Create test_<subject>.in and test_<subject>.ok files.
+2) Add them to all Makefiles (Make*) in alphabetical order (search for an
+ existing test_file.out to see where to add the new one).
+3) Use make test_<subject>.out to run a single test file in src/testdir/.
+4) Also add an entry in src/Makefile.
+
+Keep in mind that the files are used as if everything was typed.
+A line break is like pressing Enter. If that happens on the last line you'll
+hear a beep.
diff --git a/src/testdir/bench_re_freeze.in b/src/testdir/bench_re_freeze.in
new file mode 100644
index 000000000..7b1bfa345
--- /dev/null
+++ b/src/testdir/bench_re_freeze.in
@@ -0,0 +1,13 @@
+Test for Benchmarking RE engine
+
+STARTTEST
+:so small.vim
+:if !has("reltime") | qa! | endif
+:set nocp cpo&vim
+:so bench_re_freeze.vim
+:call Measure('samples/re.freeze.txt', '\s\+\%#\@<!$', '+5')
+:/^" Benchmark/,$w! benchmark.out
+:qa!
+ENDTEST
+
+" Benchmark_results:
diff --git a/src/testdir/bench_re_freeze.vim b/src/testdir/bench_re_freeze.vim
new file mode 100644
index 000000000..ee8443825
--- /dev/null
+++ b/src/testdir/bench_re_freeze.vim
@@ -0,0 +1,13 @@
+"Test for benchmarking the RE engine
+
+so small.vim
+if !has("reltime") | finish | endif
+func! Measure(file, pattern, arg)
+ for re in range(3)
+ let sstart=reltime()
+ let cmd=printf("../vim -u NONE -N --cmd ':set re=%d'".
+ \ " -c 'call search(\"%s\", \"\", \"\", 10000)' -c ':q!' %s", re, escape(a:pattern, '\\'), empty(a:arg) ? '' : a:arg)
+ call system(cmd. ' '. a:file)
+ $put =printf('file: %s, re: %d, time: %s', a:file, re, reltimestr(reltime(sstart)))
+ endfor
+endfunc
diff --git a/src/testdir/samples/re.freeze.txt b/src/testdir/samples/re.freeze.txt
new file mode 100644
index 000000000..d768c23c5
--- /dev/null
+++ b/src/testdir/samples/re.freeze.txt
@@ -0,0 +1,6 @@
+:set re=0 or 2
+Search for the pattern: /\s\+\%#\@<!$/
+vim should not freeze.
+
+<td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td>
+
diff --git a/src/testdir/test100.in b/src/testdir/test100.in
index 61d28c15f..7bd88fe9c 100644
--- a/src/testdir/test100.in
+++ b/src/testdir/test100.in
@@ -16,17 +16,19 @@ STARTTEST
:new one
:0put ='ONE: expecting global undolevels: 5, local undolevels: -123456 (default)'
:call FillBuffer()
-:call feedkeys(":earlier 10\n", 't')
+:earlier 10
:call UndoLevel()
+:set ff=unix
:%w! test.out
:new two
:0put ='TWO: expecting global undolevels: 5, local undolevels: 2 (first) then 10 (afterwards)'
:setlocal ul=2
:call FillBuffer()
-:call feedkeys(":earlier 10\n", 't')
+:earlier 10
:call UndoLevel()
:setlocal ul=10
:call UndoLevel()
+:set ff=unix
:%w >> test.out
:wincmd p
:redir >>test.out | echo "global value shouldn't be changed and still be 5!" | echo 'ONE: expecting global undolevels: 5, local undolevels: -123456 (default)'|:setglobal undolevels? | echon ' global' | setlocal undolevels? | echon ' local' |echo "" |redir end
@@ -35,6 +37,7 @@ STARTTEST
:1put ='global value should be changed to 50'
:2put ='THREE: expecting global undolevels: 50, local undolevels: -123456 (default)'
:call UndoLevel()
+:set ff=unix
:%w >> test.out
:"sleep 10
:"
diff --git a/src/testdir/test101.in b/src/testdir/test101.in
index 04c934f2c..31fc33439 100644
--- a/src/testdir/test101.in
+++ b/src/testdir/test101.in
@@ -25,6 +25,9 @@ n:AddR
:AddR
/
:AddR
+:set nohls
+/
+:AddR
:let r1=r[0][0]
:" I guess it is not guaranteed that screenattr outputs always the same character
:call map(r, 'v:val[1].":".(v:val[0]==r1?"highlighted":"not highlighted")')
diff --git a/src/testdir/test101.ok b/src/testdir/test101.ok
index 3ed7436cf..f063b85de 100644
--- a/src/testdir/test101.ok
+++ b/src/testdir/test101.ok
@@ -8,4 +8,5 @@ start:
1:highlighted
0:not highlighted
1:highlighted
+0:not highlighted
Vim(let):E706:
diff --git a/src/testdir/test102.in b/src/testdir/test102.in
index 35e9f6c2c..33b401948 100644
--- a/src/testdir/test102.in
+++ b/src/testdir/test102.in
@@ -1,6 +1,7 @@
Test if fnameescape is correct for special chars like !
STARTTEST
+:so small.vim
:%d
:let fname = 'Xspa ce'
:try | exe "w! " . fnameescape(fname) | put='Space' | endtry
diff --git a/src/testdir/test11.in b/src/testdir/test11.in
index 47de470a2..9e9e257c1 100644
--- a/src/testdir/test11.in
+++ b/src/testdir/test11.in
@@ -46,13 +46,13 @@ STARTTEST
:w>>test.out " Append it to the output file
:set shelltemp " need temp files here
:au FilterReadPre *.out call rename(expand("<afile>"), expand("<afile>") . ".t")
-:au FilterReadPre *.out exe '!sed s/e/E/ ' . shellescape(expand("<afile>")) . ".t >" . shellescape(expand("<afile>"))
-:au FilterReadPre *.out exe '!rm ' . shellescape(expand("<afile>")) . '.t'
+:au FilterReadPre *.out exe 'silent !sed s/e/E/ ' . shellescape(expand("<afile>")) . ".t >" . shellescape(expand("<afile>"))
+:au FilterReadPre *.out exe 'silent !rm ' . shellescape(expand("<afile>")) . '.t'
:au FilterReadPost *.out '[,']s/x/X/g
:e! test.out " Edit the output file
:23,$!cat
:23,$s/\r$// " remove CR for when sed adds them
-:au! FileReadPre *.gz exe '!gzip -d ' . shellescape(expand("<afile>"))
+:au! FileReadPre *.gz exe 'silent !gzip -d ' . shellescape(expand("<afile>"))
:au FileReadPre *.gz call rename(expand("<afile>:r"), expand("<afile>"))
:au! FileReadPost *.gz '[,']s/l/L/
:$r Xtestfile.gz " Read compressed file
diff --git a/src/testdir/test3.in b/src/testdir/test3.in
index de8670038..7757569e3 100644
--- a/src/testdir/test3.in
+++ b/src/testdir/test3.in
@@ -464,6 +464,14 @@ label: if (asdf &&
asdfasdf
}
+{
+for ( int i = 0;
+ i < 10; i++ )
+{
+}
+ i = 0;
+}
+
class bob
{
int foo() {return 1;}
diff --git a/src/testdir/test3.ok b/src/testdir/test3.ok
index 0d0e76fce..e75de0ffa 100644
--- a/src/testdir/test3.ok
+++ b/src/testdir/test3.ok
@@ -452,6 +452,14 @@ label: if (asdf &&
asdfasdf
}
+{
+ for ( int i = 0;
+ i < 10; i++ )
+ {
+ }
+ i = 0;
+}
+
class bob
{
int foo() {return 1;}
diff --git a/src/testdir/test39.in b/src/testdir/test39.in
index c1e1cc49a..c4e46fff2 100644
--- a/src/testdir/test39.in
+++ b/src/testdir/test39.in
@@ -23,6 +23,9 @@ G$khhhhhkkcmno
/^aaaa/
:exe ":norm! l\<C-V>jjjlllI\<Right>\<Right> \<Esc>"
:/^aa/,/^$/w >> test.out
+/xaaa$/
+:exe ":norm! \<C-V>jjjI<>\<Left>p\<Esc>"
+:/xaaa$/,/^$/w >> test.out
:" Test for Visual block was created with the last <C-v>$
/^A23$/
:exe ":norm! l\<C-V>j$Aab\<Esc>"
@@ -35,11 +38,14 @@ G$khhhhhkkcmno
/^C23$/
:exe ":norm! l\<C-V>j$hhAab\<Esc>"
:.,/^$/w >> test.out
-:" Test for Visual block insert when virtualedit=all
-:set ve=all
+:" Test for Visual block insert when virtualedit=all and utf-8 encoding
+:set ve=all enc=utf-8
:/\t\tline
:exe ":norm! 07l\<C-V>jjIx\<Esc>"
-:set ve=
+:.,/^$/w >> test.out
+:" Test for Visual block append when virtualedit=all
+:exe ":norm! 012l\<C-v>jjAx\<Esc>"
+:set ve= enc=latin1
:.,/^$/w >> test.out
:" gUe must uppercase a whole word, also when changes to SS
Gothe youtueuu endYpk0wgUe
@@ -77,6 +83,15 @@ bbbbbb
cccccc
dddddd
+xaaa
+bbbb
+cccc
+dddd
+
+yaaa
+
+bbb
+
A23
4567
diff --git a/src/testdir/test39.ok b/src/testdir/test39.ok
index ef7a2c644..5c517e222 100644
--- a/src/testdir/test39.ok
+++ b/src/testdir/test39.ok
Binary files differ
diff --git a/src/testdir/test4.in b/src/testdir/test4.in
index 4aa2fe5a8..b8bd9fc9c 100644
--- a/src/testdir/test4.in
+++ b/src/testdir/test4.in
@@ -17,6 +17,9 @@ othis should be auto-indented
G?this is a
othis should be in column 1:wq " append text without autoindent to Xxx
G:r Xxx " include Xxx in the current file
+:set fo+=r " issue #57 do not move cursor on <c-o> when autoindent is set
+Go# abcdef2hi
+d0o# abcdef2hid0
:?startstart?,$w! test.out
:qa!
ENDTEST
diff --git a/src/testdir/test4.ok b/src/testdir/test4.ok
index dffecda4d..d032e4c31 100644
--- a/src/testdir/test4.ok
+++ b/src/testdir/test4.ok
@@ -15,3 +15,6 @@ vim: set noai :
this is a test
this should be in column 1
end of test file Xxx
+# abc
+def
+def
diff --git a/src/testdir/test48.in b/src/testdir/test48.in
index 48f4abbf7..d480f8cc1 100644
--- a/src/testdir/test48.in
+++ b/src/testdir/test48.in
@@ -44,6 +44,10 @@ $4lDi<-- 'D' should be intact
/^"r"
$5lrxa<-- should be 'x'
:"
+:" Test "r" on a tab
+:" Note that for this test, 'ts' must be 8 (the default).
+^5lrxA<-- should be ' x '
+:"
:" Test to make sure 'x' can delete control characters
:set display=uhex
^xxxxxxi[This line should contain only the text between the brackets.]
@@ -72,6 +76,7 @@ this is a test
this is a test
this is a test
"r"
+"r"
ab sd
abcv6efi.him0kl
diff --git a/src/testdir/test48.ok b/src/testdir/test48.ok
index 334cb5a29..14cd9b12e 100644
--- a/src/testdir/test48.ok
+++ b/src/testdir/test48.ok
@@ -12,6 +12,7 @@ this is a test
this is a test
this is a test
"r" x<-- should be 'x'
+"r" x <-- should be ' x '
[This line should contain only the text between the brackets.]
v i m <-- should show the name of a noted text editor
6 . 0 <-- and its version number
diff --git a/src/testdir/test53.in b/src/testdir/test53.in
index 011c9ae39..8ca9c9ed2 100644
--- a/src/testdir/test53.in
+++ b/src/testdir/test53.in
@@ -79,6 +79,8 @@ ggdgn.
:" test repeating gUgn
/^Depp
gggUgn.
+gg/a:0\@!\zs\d\+
+nygnop
:/^start:/,/^end:/wq! test.out
ENDTEST
@@ -108,6 +110,11 @@ delete first and last chars
uniquepattern uniquepattern
my very excellent mother just served us nachos
for (i=0; i<=10; i++)
+a:10
+
+a:1
+
+a:20
Y
text
Y
diff --git a/src/testdir/test53.ok b/src/testdir/test53.ok
index d7ffa6bc5..0c0b9ded1 100644
--- a/src/testdir/test53.ok
+++ b/src/testdir/test53.ok
@@ -49,6 +49,12 @@ elete first and last char
uniquepattern
my very excellent mongoose just served us nachos
for (j=0; i<=10; i++)
+a:10
+
+a:1
+1
+
+a:20
text
Y
diff --git a/src/testdir/test55.in b/src/testdir/test55.in
index 8e073f30f..c4e82d429 100644
--- a/src/testdir/test55.in
+++ b/src/testdir/test55.in
@@ -282,6 +282,21 @@ let l = [0, 1, 2, 3]
: $put =ps
: endfor
:endfor
+:unlet l
+:let l = [1, 2, 3, 4]
+:lockvar! l
+:$put =string(l)
+:unlockvar l[1]
+:unlet l[0:1]
+:$put =string(l)
+:unlet l[1:2]
+:$put =string(l)
+:unlockvar l[1]
+:let l[0:1] = [0, 1]
+:$put =string(l)
+:let l[1:2] = [0, 1]
+:$put =string(l)
+:unlet l
:" :lockvar/islocked() triggering script autoloading
:set rtp+=./sautest
:lockvar g:footest#x
@@ -386,6 +401,11 @@ let l = [0, 1, 2, 3]
: $put =v:exception[:15] . v:exception[-1:-1]
:endtry
:$put =string(d)
+:"
+:" test for range assign
+:let l = [0]
+:let l[:] = [1, 2]
+:$put =string(l)
:endfun
:"
:call Test(1, 2, [3, 4], {5: 6}) " This may take a while
diff --git a/src/testdir/test55.ok b/src/testdir/test55.ok
index dfd8060db..ba029b289 100644
--- a/src/testdir/test55.ok
+++ b/src/testdir/test55.ok
@@ -86,6 +86,11 @@ FFFFFFF
FFpFFpp
0000-000
ppppppp
+[1, 2, 3, 4]
+[1, 2, 3, 4]
+[1, 2, 3, 4]
+[1, 2, 3, 4]
+[1, 2, 3, 4]
locked g:footest#x:-1
exists g:footest#x:0
g:footest#x: 1
@@ -124,6 +129,7 @@ caught a:000[3]
{'a': {'b': 'B'}}
Vim(call):E737: a
{'a': {'b': 'B'}}
+[1, 2]
Vim(foldopen):E490:
diff --git a/src/testdir/test62.in b/src/testdir/test62.in
index 93d968b33..c201fe713 100644
--- a/src/testdir/test62.in
+++ b/src/testdir/test62.in
@@ -13,7 +13,7 @@ STARTTEST
:" Open three tab pages and use ":tabdo"
:0tabnew
:1tabnew
-:888tabnew
+:$tabnew
:tabdo call append(line('$'), 'this is tab page ' . tabpagenr())
:tabclose! 2
:tabrewind
diff --git a/src/testdir/test63.in b/src/testdir/test63.in
index 87f5ef6b5..1f073a78a 100644
--- a/src/testdir/test63.in
+++ b/src/testdir/test63.in
@@ -3,12 +3,13 @@ Test for ":match", ":2match", ":3match", "clearmatches()", "getmatches()",
STARTTEST
:so small.vim
+:set encoding=utf8
:" --- Check that "matcharg()" returns the correct group and pattern if a match
:" --- is defined.
:let @r = "*** Test 1: "
-:highlight MyGroup1 ctermbg=red
-:highlight MyGroup2 ctermbg=green
-:highlight MyGroup3 ctermbg=blue
+:highlight MyGroup1 term=bold ctermbg=red guibg=red
+:highlight MyGroup2 term=italic ctermbg=green guibg=green
+:highlight MyGroup3 term=underline ctermbg=blue guibg=blue
:match MyGroup1 /TODO/
:2match MyGroup2 /FIXME/
:3match MyGroup3 /XXX/
@@ -164,7 +165,27 @@ STARTTEST
:if v1 != v5 && v6 == v1 && v8 == v5 && v10 == v5 && v11 == v1
: let @r .= "OK\n"
:else
-: let @r .= "FAILED\n"
+: let @r .= "FAILED: " . v5 . "/" . v6 . "/" . v8 . "/" . v10 . "/" . v11 . "\n"
+:endif
+:call clearmatches()
+:"
+:call setline(1, 'abcdΣabcdef')
+:call matchaddpos("MyGroup1", [[1, 4, 2], [1, 9, 2]])
+:1
+:redraw!
+:let v1 = screenattr(1, 1)
+:let v4 = screenattr(1, 4)
+:let v5 = screenattr(1, 5)
+:let v6 = screenattr(1, 6)
+:let v7 = screenattr(1, 7)
+:let v8 = screenattr(1, 8)
+:let v9 = screenattr(1, 9)
+:let v10 = screenattr(1, 10)
+:let @r .= string(getmatches())."\n"
+:if v1 != v4 && v5 == v4 && v6 == v1 && v7 == v1 && v8 == v4 && v9 == v4 && v10 == v1
+: let @r .= "OK\n"
+:else
+: let @r .= "FAILED: " . v4 . "/" . v5 . "/" . v6 . "/" . v7 . "/" . v8 . "/" . v9 . "/" . v10 . "\n"
:endif
:call clearmatches()
G"rp
diff --git a/src/testdir/test63.ok b/src/testdir/test63.ok
index f804b693a..5d619395b 100644
--- a/src/testdir/test63.ok
+++ b/src/testdir/test63.ok
@@ -12,3 +12,5 @@ Results of test63:
*** Test 11:
[{'group': 'MyGroup1', 'id': 3, 'priority': 10, 'pos1': [1, 5, 1], 'pos2': [1, 8, 3]}]
OK
+[{'group': 'MyGroup1', 'id': 11, 'priority': 10, 'pos1': [1, 4, 2], 'pos2': [1, 9, 2]}]
+OK
diff --git a/src/testdir/test64.in b/src/testdir/test64.in
index 2abdcd1c0..f2452fc0f 100644
--- a/src/testdir/test64.in
+++ b/src/testdir/test64.in
@@ -459,7 +459,7 @@ STARTTEST
: let text = t[2]
: let matchidx = 3
: for engine in [0, 1, 2]
-: if engine == 2 && re == 0 || engine == 1 && re ==1
+: if engine == 2 && re == 0 || engine == 1 && re == 1
: continue
: endif
: let &regexpengine = engine
@@ -608,6 +608,17 @@ yeGopA END:"
"ayb20gg/..\%$
"bybGo"apo"bp:"
:"
+:" Check for detecting error
+:set regexpengine=2
+:for pat in [' \ze*', ' \zs*']
+: try
+: let l = matchlist('x x', pat)
+: $put ='E888 NOT detected for ' . pat
+: catch
+: $put ='E888 detected for ' . pat
+: endtry
+:endfor
+:"
:""""" Write the results """""""""""""
:/\%#=1^Results/,$wq! test.out
ENDTEST
diff --git a/src/testdir/test64.ok b/src/testdir/test64.ok
index e7d173141..ffc0b5341 100644
--- a/src/testdir/test64.ok
+++ b/src/testdir/test64.ok
@@ -1097,3 +1097,5 @@ Test
Test END
EN
E
+E888 detected for \ze*
+E888 detected for \zs*
diff --git a/src/testdir/test71.in b/src/testdir/test71.in
index 155fd413b..944b69dc5 100644
--- a/src/testdir/test71.in
+++ b/src/testdir/test71.in
@@ -13,6 +13,8 @@ STARTTEST
:let cm0_bytes = getline('.', '.')
:/^start of cm=blowfish bytes/+1
:let cm1_bytes = getline('.', '.')
+:/^start of cm=blowfish2 bytes/+1
+:let cm2_bytes = getline('.', '.')
:bwipe!
:call append(0, text_lines)
:$d
@@ -36,6 +38,18 @@ barfoo
:e Xtestfile
barfoo
:let cm1_read_back = getline('.', '$')
+:set key=
+:set cryptmethod=blowfish2
+:" If the blowfish test fails 'cryptmethod' will be 'zip' now.
+:%s/^/\=&cryptmethod == 'blowfish2' ? "OK " : "blowfish test failed "/
+:X
+bar2foo
+bar2foo
+:w! Xtestfile
+:bwipe!
+:e Xtestfile
+bar2foo
+:let cm2_read_back = getline('.', '$')
:bwipe!
:set bin noeol key=
:call append(0, cm0_bytes)
@@ -57,7 +71,20 @@ foofoo
:set nobin
:e Xtestfile
barbar
+:let cm1_read_bin = getline('.', '$')
+:bwipe!
+:set bin noeol key=
+:call append(0, cm2_bytes)
+:$d
+:set fenc=latin1
+:w! Xtestfile
+:bwipe!
+:set nobin
+:e Xtestfile
+barburp
+:call append(0, cm1_read_bin)
:call append(0, cm0_read_bin)
+:call append(0, cm2_read_back)
:call append(0, cm1_read_back)
:call append(0, cm0_read_back)
:set key= fenc=latin1
diff --git a/src/testdir/test71.ok b/src/testdir/test71.ok
index 24652c438..de1b0ab83 100644
--- a/src/testdir/test71.ok
+++ b/src/testdir/test71.ok
@@ -4,7 +4,12 @@ line 3 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
OK 01234567890123456789012345678901234567
OK line 2 foo bar blah
OK line 3 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+OK OK 01234567890123456789012345678901234567
+OK OK line 2 foo bar blah
+OK OK line 3 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1234567890
abbccddeff
asdfasdfasdf
0001112223333
+abcdefghijklmnopqrstuvwxyz
+!@#$%^&*()_+=-`~
diff --git a/src/testdir/test71a.in b/src/testdir/test71a.in
index 85bd22cd0..e79a39895 100644
--- a/src/testdir/test71a.in
+++ b/src/testdir/test71a.in
@@ -12,3 +12,7 @@ end of cm=zip bytes
start of cm=blowfish bytes
VimCrypt~02!k)#S=#MJAͥM!
end of cm=blowfish bytes
+
+start of cm=blowfish2 bytes
+VimCrypt~03!N;^C).FS6[T˧ؾ9 2 Q@ߚIv.`$%
+end of cm=blowfish2 bytes
diff --git a/src/testdir/test72.in b/src/testdir/test72.in
index 3b3a6a432..a407eea4e 100644
--- a/src/testdir/test72.in
+++ b/src/testdir/test72.in
@@ -81,7 +81,8 @@ uu:w >>test.out
:"
:" With encryption, cryptmethod=blowfish
:e! Xtestfile
-:set undofile cm=blowfish
+rubbish
+:set undofile cm=blowfish ff&
ggdGijan
feb
mar
@@ -104,6 +105,32 @@ u:.w >>test.out
u:.w >>test.out
u:.w >>test.out
:"
+:" With encryption, cryptmethod=blowfish2
+:e! Xtestfile
+rubbish
+:set undofile cm=blowfish2 ff&
+ggdGijan
+feb
+mar
+apr
+jun:set ul=100
+kk0ifoo :set ul=100
+dd:set ul=100
+ibar :set ul=100
+:X
+foo2bar
+foo2bar
+:w!
+:bwipe!
+:e Xtestfile
+foo2bar
+:set key=
+/bar
+:.w >>test.out
+u:.w >>test.out
+u:.w >>test.out
+u:.w >>test.out
+:"
:" Rename the undo file so that it gets cleaned up.
:if has("vms")
: call rename("_un_Xtestfile", "Xtestundo")
diff --git a/src/testdir/test72.ok b/src/testdir/test72.ok
index bb267d0d8..8d30ba10b 100644
--- a/src/testdir/test72.ok
+++ b/src/testdir/test72.ok
@@ -25,3 +25,7 @@ bar apr
apr
foo mar
mar
+bar apr
+apr
+foo mar
+mar
diff --git a/src/testdir/test75.in b/src/testdir/test75.in
index b7f2783f5..8fabccdf5 100644
--- a/src/testdir/test75.in
+++ b/src/testdir/test75.in
@@ -23,16 +23,16 @@ STARTTEST
Go:"
:" Outside of the range, minimum
:inoremap <Char-0x1040> a
-:call feedkeys("a\u1040\<Esc>")
+:execute "normal a\u1040\<Esc>"
:" Inside of the range, minimum
:inoremap <Char-0x103f> b
-:call feedkeys("a\u103f\<Esc>")
+:execute "normal a\u103f\<Esc>"
:" Inside of the range, maximum
:inoremap <Char-0xf03f> c
-:call feedkeys("a\uf03f\<Esc>")
+:execute "normal a\uf03f\<Esc>"
:" Outside of the range, maximum
:inoremap <Char-0xf040> d
-:call feedkeys("a\uf040\<Esc>")
+:execute "normal a\uf040\<Esc>"
:"
:/^eof/+1,$w! test.out
:qa!
diff --git a/src/testdir/test86.in b/src/testdir/test86.in
index b1692939a..819ae9587 100644
--- a/src/testdir/test86.in
+++ b/src/testdir/test86.in
@@ -1384,6 +1384,7 @@ EOF
:debug silent! py test_keyboard_interrupt()
:redir END
:0 debuggreedy
+:call inputrestore()
:silent $put =output
:unlet output
:py del test_keyboard_interrupt
diff --git a/src/testdir/test87.in b/src/testdir/test87.in
index 9111a499b..e24df4131 100644
--- a/src/testdir/test87.in
+++ b/src/testdir/test87.in
@@ -1361,6 +1361,7 @@ EOF
:debug silent! py3 test_keyboard_interrupt()
:redir END
:0 debuggreedy
+:call inputrestore()
:silent $put =output
:unlet output
:py3 del test_keyboard_interrupt
diff --git a/src/testdir/test91.in b/src/testdir/test91.in
index e900a522d..b66776b1e 100644
--- a/src/testdir/test91.in
+++ b/src/testdir/test91.in
@@ -55,6 +55,7 @@ STARTTEST
:tabnew
:tabnew
:let t:var_list = [1, 2, 3]
+:let t:other = 777
:let def_list = [4, 5, 6, 7]
:tabrewind
:$put =string(gettabvar(3, 'var_list'))
diff --git a/src/testdir/test91.ok b/src/testdir/test91.ok
index 22e157220..809952b69 100644
--- a/src/testdir/test91.ok
+++ b/src/testdir/test91.ok
@@ -26,8 +26,8 @@ iso-8859-2
0
[1, 2, 3]
[1, 2, 3]
-''
-[4, 5, 6, 7]
+{'var_list': [1, 2, 3], 'other': 777}
+{'var_list': [1, 2, 3], 'other': 777}
[4, 5, 6, 7]
''
[4, 5, 6, 7]
diff --git a/src/testdir/test_argument_count.in b/src/testdir/test_argument_count.in
new file mode 100644
index 000000000..db7eadb72
--- /dev/null
+++ b/src/testdir/test_argument_count.in
@@ -0,0 +1,47 @@
+Tests for :[count]argument! and :[count]argdelete vim: set ft=vim :
+
+STARTTEST
+:so small.vim
+:%argd
+:argadd a b c d
+:set hidden
+:let buffers = []
+:augroup TEST
+:au BufEnter * call add(buffers, expand('%:t'))
+:augroup END
+:$argu
+:$-argu
+:-argu
+:1argu
+:+2argu
+:augroup TEST
+:au!
+:augroup END
+:let arglists = []
+:.argd
+:call add(arglists, argv())
+:-argd
+:call add(arglists, argv())
+:$argd
+:call add(arglists, argv())
+:1arga c
+:1arga b
+:$argu
+:$arga x
+:call add(arglists, argv())
+:0arga Y
+:call add(arglists, argv())
+:%argd
+:call add(arglists, argv())
+:arga a b c d e f
+:2,$-argd
+:call add(arglists, argv())
+:e! test.out
+:call append(0, buffers)
+:let lnr = line('$')
+:call append(lnr, map(copy(arglists), 'join(v:val, " ")'))
+:w
+:qa!
+ENDTEST
+
+
diff --git a/src/testdir/test_argument_count.ok b/src/testdir/test_argument_count.ok
new file mode 100644
index 000000000..f51562620
--- /dev/null
+++ b/src/testdir/test_argument_count.ok
@@ -0,0 +1,13 @@
+d
+c
+b
+a
+c
+
+a b d
+a d
+a
+a b c x
+Y a b c x
+
+a f
diff --git a/src/testdir/test_breakindent.in b/src/testdir/test_breakindent.in
index 8f40e4f7e..a255457b2 100644
--- a/src/testdir/test_breakindent.in
+++ b/src/testdir/test_breakindent.in
@@ -6,18 +6,18 @@ STARTTEST
:10new|:vsp|:vert resize 20
:put =\"\tabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP\"
:set ts=4 sw=4 sts=4 breakindent
-:fu! ScreenChar(width)
+:fu! ScreenChar(line, width)
: let c=''
: for i in range(1,a:width)
-: let c.=nr2char(screenchar(line('.'), i))
+: let c.=nr2char(screenchar(a:line, i))
: endfor
: let c.="\n"
: for i in range(1,a:width)
-: let c.=nr2char(screenchar(line('.')+1, i))
+: let c.=nr2char(screenchar(a:line+1, i))
: endfor
: let c.="\n"
: for i in range(1,a:width)
-: let c.=nr2char(screenchar(line('.')+2, i))
+: let c.=nr2char(screenchar(a:line+2, i))
: endfor
: return c
:endfu
@@ -27,44 +27,45 @@ STARTTEST
: $put =g:line1
: wincmd p
:endfu
+:set briopt=min:0
:let g:test="Test 1: Simple breakindent"
-:let line1=ScreenChar(8)
+:let line1=ScreenChar(line('.'),8)
:call DoRecordScreen()
:let g:test="Test 2: Simple breakindent + sbr=>>"
:set sbr=>>
-:let line1=ScreenChar(8)
+:let line1=ScreenChar(line('.'),8)
:call DoRecordScreen()
:let g:test ="Test 3: Simple breakindent + briopt:sbr"
:set briopt=sbr,min:0 sbr=++
-:let line1=ScreenChar(8)
+:let line1=ScreenChar(line('.'),8)
:call DoRecordScreen()
:let g:test ="Test 4: Simple breakindent + min width: 18"
:set sbr= briopt=min:18
-:let line1=ScreenChar(8)
+:let line1=ScreenChar(line('.'),8)
:call DoRecordScreen()
:let g:test =" Test 5: Simple breakindent + shift by 2"
:set briopt=shift:2,min:0
-:let line1=ScreenChar(8)
+:let line1=ScreenChar(line('.'),8)
:call DoRecordScreen()
:let g:test=" Test 6: Simple breakindent + shift by -1"
:set briopt=shift:-1,min:0
-:let line1=ScreenChar(8)
+:let line1=ScreenChar(line('.'),8)
:call DoRecordScreen()
:let g:test=" Test 7: breakindent + shift by +1 + nu + sbr=? briopt:sbr"
:set briopt=shift:1,sbr,min:0 nu sbr=? nuw=4
-:let line1=ScreenChar(10)
+:let line1=ScreenChar(line('.'),10)
:call DoRecordScreen()
:let g:test=" Test 8: breakindent + shift:1 + nu + sbr=# list briopt:sbr"
:set briopt=shift:1,sbr,min:0 nu sbr=# list
-:let line1=ScreenChar(10)
+:let line1=ScreenChar(line('.'),10)
:call DoRecordScreen()
:let g:test=" Test 9: breakindent + shift by +1 + 'nu' + sbr=# list"
:set briopt-=sbr
-:let line1=ScreenChar(10)
+:let line1=ScreenChar(line('.'),10)
:call DoRecordScreen()
:let g:test=" Test 10: breakindent + shift by +1 + 'nu' + sbr=~ cpo+=n"
:set cpo+=n sbr=~ nu nuw=4 nolist briopt=sbr,min:0
-:let line1=ScreenChar(10)
+:let line1=ScreenChar(line('.'),10)
:call DoRecordScreen()
:wincmd p
:let g:test="\n Test 11: strdisplaywidth when breakindent is on"
@@ -73,6 +74,31 @@ STARTTEST
:let width = strlen(text[1:])+indent(2)*4+strlen(&sbr)*3 " text wraps 3 times
:$put =g:test
:$put =printf(\"strdisplaywidth: %d == calculated: %d\", strdisplaywidth(text), width)
+:let g:str="\t\t\t\t\t{"
+:let g:test=" Test 12: breakindent + long indent"
+:wincmd p
+:set all& breakindent linebreak briopt=min:10 nu numberwidth=3 ts=4
+:$put =g:str
+zt:let line1=ScreenChar(1,10)
+:wincmd p
+:call DoRecordScreen()
+:"
+:" Test, that the string " a\tb\tc\td\te" is correctly
+:" displayed in a 20 column wide window (see bug report
+:" https://groups.google.com/d/msg/vim_dev/ZOdg2mc9c9Y/TT8EhFjEy0IJ
+:only
+:vert 20new
+:set all& nocp breakindent briopt=min:10
+:call setline(1, [" a\tb\tc\td\te", " z y x w v"])
+:/^\s*a
+fbgjyl:let line1 = @0
+:?^\s*z
+fygjyl:let line2 = @0
+:quit!
+:$put ='Test 13: breakindent with wrapping Tab'
+:$put =line1
+:$put =line2
+:"
:%w! test.out
:qa!
ENDTEST
diff --git a/src/testdir/test_breakindent.ok b/src/testdir/test_breakindent.ok
index 723cb2501..e50265ecd 100644
--- a/src/testdir/test_breakindent.ok
+++ b/src/testdir/test_breakindent.ok
@@ -53,3 +53,12 @@ Test 4: Simple breakindent + min width: 18
Test 11: strdisplaywidth when breakindent is on
strdisplaywidth: 46 == calculated: 64
+ {
+
+ Test 12: breakindent + long indent
+56
+
+~
+Test 13: breakindent with wrapping Tab
+d
+w
diff --git a/src/testdir/test_changelist.in b/src/testdir/test_changelist.in
new file mode 100644
index 000000000..6c7c4306c
--- /dev/null
+++ b/src/testdir/test_changelist.in
@@ -0,0 +1,22 @@
+Test changelist position after splitting window
+Set 'undolevels' to make changelist for sourced file
+
+STARTTEST
+:so small.vim
+Gkylp:set ul=100
+Gylp:set ul=100
+gg
+:vsplit
+:try
+: normal g;
+: normal ggVGcpass
+:catch
+: normal ggVGcfail
+:finally
+: %w! test.out
+:endtry
+:qa!
+ENDTEST
+
+1
+2
diff --git a/src/testdir/test_changelist.ok b/src/testdir/test_changelist.ok
new file mode 100644
index 000000000..2ae28399f
--- /dev/null
+++ b/src/testdir/test_changelist.ok
@@ -0,0 +1 @@
+pass
diff --git a/src/testdir/test_close_count.in b/src/testdir/test_close_count.in
new file mode 100644
index 000000000..f07da99b0
--- /dev/null
+++ b/src/testdir/test_close_count.in
@@ -0,0 +1,153 @@
+Tests for :[count]close! and :[count]hide vim: set ft=vim :
+
+STARTTEST
+:so small.vim
+:let tests = []
+:for i in range(5)
+:new
+:endfor
+:4wincmd w
+:close!
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+:1close!
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+:$close!
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+:1wincmd w
+:2close!
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+:1wincmd w
+:new
+:new
+:2wincmd w
+:-1close!
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+:2wincmd w
+:+1close!
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+:e! test.out
+:call append(0, map(copy(tests), 'join(v:val, " ")'))
+:w
+:only!
+:b1
+ENDTEST
+
+STARTTEST
+:let tests = []
+:for i in range(5)
+:new
+:endfor
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+:4wincmd w
+:.hide
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+:1hide
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+:$hide
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+:1wincmd w
+:2hide
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+:1wincmd w
+:new
+:new
+:3wincmd w
+:-hide
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+:2wincmd w
+:+hide
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+:e! test.out
+:call append(line('$'), map(copy(tests), 'join(v:val, " ")'))
+Go
+:w
+:only!
+:b1
+ENDTEST
+
+STARTTEST
+:let tests = []
+:set hidden
+:for i in range(5)
+:new
+:endfor
+:1wincmd w
+:$ hide
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+:$-1 close!
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+:1wincmd w
+:.+close!
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+:e! test.out
+:call append(line('$'), map(copy(tests), 'join(v:val, " ")'))
+Go
+:w
+:only!
+:b1
+ENDTEST
+
+STARTTEST
+:let tests = []
+:set hidden
+:for i in range(5)
+:new
+:endfor
+:4wincmd w
+c
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+1c
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+9c
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+:1wincmd w
+2c
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+:only!
+:e! test.out
+:call append(line('$'), map(copy(tests), 'join(v:val, " ")'))
+:w
+:qa!
+ENDTEST
+
+
diff --git a/src/testdir/test_close_count.ok b/src/testdir/test_close_count.ok
new file mode 100644
index 000000000..1cee87048
--- /dev/null
+++ b/src/testdir/test_close_count.ok
@@ -0,0 +1,23 @@
+6 5 4 2 1
+5 4 2 1
+5 4 2
+5 2
+7 5 2
+7 5
+
+13 12 11 10 9 1
+13 12 11 9 1
+12 11 9 1
+12 11 9
+12 9
+15 12 9
+15 12
+
+20 19 18 17 16
+20 19 18 16
+20 18 16
+
+25 24 23 21 1
+24 23 21 1
+24 23 21
+24 21
diff --git a/src/testdir/test_command_count.in b/src/testdir/test_command_count.in
new file mode 100644
index 000000000..16daad0b2
--- /dev/null
+++ b/src/testdir/test_command_count.in
@@ -0,0 +1,130 @@
+Test for user command counts vim: set ft=vim :
+
+STARTTEST
+:so tiny.vim
+:let g:lines = []
+:com -range=% RangeLines :call add(g:lines, 'RangeLines '.<line1>.' '.<line2>)
+:com -range -addr=arguments RangeArguments :call add(g:lines, 'RangeArguments '.<line1>.' '.<line2>)
+:com -range=% -addr=arguments RangeArgumentsAll :call add(g:lines, 'RangeArgumentsAll '.<line1>.' '.<line2>)
+:com -range -addr=loaded_buffers RangeLoadedBuffers :call add(g:lines, 'RangeLoadedBuffers '.<line1>.' '.<line2>)
+:com -range=% -addr=loaded_buffers RangeLoadedBuffersAll :call add(g:lines, 'RangeLoadedBuffersAll '.<line1>.' '.<line2>)
+:com -range -addr=buffers RangeBuffers :call add(g:lines, 'RangeBuffers '.<line1>.' '.<line2>)
+:com -range=% -addr=buffers RangeBuffersAll :call add(g:lines, 'RangeBuffersAll '.<line1>.' '.<line2>)
+:com -range -addr=windows RangeWindows :call add(g:lines, 'RangeWindows '.<line1>.' '.<line2>)
+:com -range=% -addr=windows RangeWindowsAll :call add(g:lines, 'RangeWindowsAll '.<line1>.' '.<line2>)
+:com -range -addr=tabs RangeTabs :call add(g:lines, 'RangeTabs '.<line1>.' '.<line2>)
+:com -range=% -addr=tabs RangeTabsAll :call add(g:lines, 'RangeTabsAll '.<line1>.' '.<line2>)
+:set hidden
+:arga a b c d
+:argdo echo "loading buffers"
+:argu 3
+:.-,$-RangeArguments
+:%RangeArguments
+:RangeArgumentsAll
+:N
+:.RangeArguments
+:split|split|split|split
+:3wincmd w
+:.,$RangeWindows
+:%RangeWindows
+:RangeWindowsAll
+:only
+:blast|bd
+:.,$RangeLoadedBuffers
+:%RangeLoadedBuffers
+:RangeLoadedBuffersAll
+:.,$RangeBuffers
+:%RangeBuffers
+:RangeBuffersAll
+:tabe|tabe|tabe|tabe
+:normal 2gt
+:.,$RangeTabs
+:%RangeTabs
+:RangeTabsAll
+:1tabonly
+:s/\n/\r\r\r\r\r/
+:2ma<
+:$-ma>
+:'<,'>RangeLines
+:com -range=% -buffer LocalRangeLines :call add(g:lines, 'LocalRangeLines '.<line1>.' '.<line2>)
+:'<,'>LocalRangeLines
+:b1
+ENDTEST
+
+STARTTEST
+:call add(g:lines, '')
+:%argd
+:arga a b c d
+:let v:errmsg = ''
+:5argu
+:call add(g:lines, '5argu ' . v:errmsg)
+:$argu
+:call add(g:lines, '4argu ' . expand('%:t'))
+:let v:errmsg = ''
+:1argu
+:call add(g:lines, '1argu ' . expand('%:t'))
+:let v:errmsg = ''
+:100b
+:call add(g:lines, '100b ' . v:errmsg)
+:split|split|split|split
+:let v:errmsg = ''
+:0close
+:call add(g:lines, '0close ' . v:errmsg)
+:$wincmd w
+:$close
+:call add(g:lines, '$close ' . winnr())
+:let v:errmsg = ''
+:$+close
+:call add(g:lines, '$+close ' . v:errmsg)
+:$tabe
+:call add(g:lines, '$tabe ' . tabpagenr())
+:let v:errmsg = ''
+:$+tabe
+:call add(g:lines, '$+tabe ' . v:errmsg)
+:only!
+:e x
+:0tabm
+:normal 1gt
+:call add(g:lines, '0tabm ' . expand('%:t'))
+:tabonly!
+:only!
+:e! test.out
+:call append(0, g:lines)
+:unlet g:lines
+:w|bd
+:se hidden
+:b1
+ENDTEST
+
+STARTTEST
+:only!
+:let g:lines = []
+:%argd
+:arga a b c d e f
+:3argu
+:let args = ''
+:.,$-argdo let args .= ' '.expand('%')
+:call add(g:lines, 'argdo:' . args)
+:split|split|split|split
+:2wincmd w
+:let windows = ''
+:.,$-windo let windows .= ' '.winnr()
+:call add(g:lines, 'windo:'. windows)
+:b2
+:let buffers = ''
+:.,$-bufdo let buffers .= ' '.bufnr('%')
+:call add(g:lines, 'bufdo:' . buffers)
+:let buffers = ''
+:3,7bufdo let buffers .= ' '.bufnr('%')
+:call add(g:lines, 'bufdo:' . buffers)
+:tabe|tabe|tabe|tabe
+:normal! 2gt
+:let tabpages = ''
+:.,$-tabdo let tabpages .= ' '.tabpagenr()
+:call add(g:lines, 'tabdo:' . tabpages)
+:e! test.out
+:call append('$', g:lines)
+:w|qa!
+ENDTEST
+
+
diff --git a/src/testdir/test_command_count.ok b/src/testdir/test_command_count.ok
new file mode 100644
index 000000000..d554ae765
--- /dev/null
+++ b/src/testdir/test_command_count.ok
@@ -0,0 +1,35 @@
+RangeArguments 2 4
+RangeArguments 1 5
+RangeArgumentsAll 1 5
+RangeArguments 2 2
+RangeWindows 3 5
+RangeWindows 1 5
+RangeWindowsAll 1 5
+RangeLoadedBuffers 2 4
+RangeLoadedBuffers 1 4
+RangeLoadedBuffersAll 1 4
+RangeBuffers 2 5
+RangeBuffers 1 5
+RangeBuffersAll 1 5
+RangeTabs 2 5
+RangeTabs 1 5
+RangeTabsAll 1 5
+RangeLines 2 5
+LocalRangeLines 2 5
+
+5argu E16: Invalid range
+4argu d
+1argu a
+100b E16: Invalid range
+0close
+$close 3
+$+close E16: Invalid range
+$tabe 2
+$+tabe E16: Invalid range
+0tabm x
+
+argdo: c d e
+windo: 2 3 4
+bufdo: 2 3 4 5 6 7 8 9 10 12
+bufdo: 3 4 5 6 7
+tabdo: 2 3 4
diff --git a/src/testdir/test_insertcount.in b/src/testdir/test_insertcount.in
new file mode 100644
index 000000000..c7595b1ce
--- /dev/null
+++ b/src/testdir/test_insertcount.in
@@ -0,0 +1,14 @@
+Tests for repeating insert and replace.
+
+STARTTEST
+:so small.vim
+:/Second
+4gro
+:/^First/,$wq! test.out
+:" get here when failed and in Insert mode
+:.wq! test.out
+ENDTEST
+
+First line
+Second line
+Last line
diff --git a/src/testdir/test_insertcount.ok b/src/testdir/test_insertcount.ok
new file mode 100644
index 000000000..57afab00f
--- /dev/null
+++ b/src/testdir/test_insertcount.ok
@@ -0,0 +1,3 @@
+First line
+ooooecond line
+Last line
diff --git a/src/testdir/test_listlbr.in b/src/testdir/test_listlbr.in
index 0cce4c23a..f6618c5a4 100644
--- a/src/testdir/test_listlbr.in
+++ b/src/testdir/test_listlbr.in
@@ -2,7 +2,7 @@ Test for linebreak and list option (non-utf8)
STARTTEST
:so small.vim
-:if !exists("+linebreak") | e! test.ok | w! test.out | qa! | endif
+:if !exists("+linebreak") || !has("conceal") | e! test.ok | w! test.out | qa! | endif
:10new|:vsp|:vert resize 20
:put =\"\tabcdef hijklmn\tpqrstuvwxyz_1060ABCDEFGHIJKLMNOP \"
:norm! zt
@@ -46,6 +46,24 @@ STARTTEST
:redraw!
:let line=ScreenChar(winwidth(0))
:call DoRecordScreen()
+:let line="_S_\t bla"
+:$put =line
+:$
+:norm! zt
+:let g:test ="Test 5: set linebreak with conceal and set list and tab displayed by different char (line may not be truncated)"
+:set cpo&vim list linebreak conceallevel=2 concealcursor=nv listchars=tab:ab
+:syn match ConcealVar contained /_/ conceal
+:syn match All /.*/ contains=ConcealVar
+:let line=ScreenChar(winwidth(0))
+:call DoRecordScreen()
+:set cpo&vim linebreak
+:let g:test ="Test 6: set linebreak with visual block mode"
+:let line="REMOVE: this not"
+:$put =line
+:let line="REMOVE: aaaaaaaaaaaaa"
+:$put =line
+:1/^REMOVE:
+0jf x:$put
:%w! test.out
:qa!
ENDTEST
diff --git a/src/testdir/test_listlbr.ok b/src/testdir/test_listlbr.ok
index be323d4dc..ee7466766 100644
--- a/src/testdir/test_listlbr.ok
+++ b/src/testdir/test_listlbr.ok
@@ -25,3 +25,14 @@ Test 4: set linebreak with tab and 1 line as long as screen: should break!
+aaaaaaaaaaaaaaaaaa
~
~
+_S_ bla
+
+Test 5: set linebreak with conceal and set list and tab displayed by different char (line may not be truncated)
+Sabbbbbb bla
+~
+~
+~
+this not
+aaaaaaaaaaaaa
+REMOVE:
+REMOVE:
diff --git a/src/testdir/test_listlbr_utf8.in b/src/testdir/test_listlbr_utf8.in
index f8888d533..ba12adae0 100644
--- a/src/testdir/test_listlbr_utf8.in
+++ b/src/testdir/test_listlbr_utf8.in
@@ -30,11 +30,22 @@ STARTTEST
:redraw!
:let line=ScreenChar(winwidth(0))
:call DoRecordScreen()
+:"
:let g:test ="Test 2: set nolinebreak list"
:set list nolinebreak
:redraw!
:let line=ScreenChar(winwidth(0))
:call DoRecordScreen()
+:"
+:let g:test ="Test 3: set linebreak nolist"
+:$put =\"\t*mask = nil;\"
+:$
+:norm! zt
+:set nolist linebreak
+:redraw!
+:let line=ScreenChar(winwidth(0))
+:call DoRecordScreen()
+:"
:%w! test.out
:qa!
ENDTEST
diff --git a/src/testdir/test_listlbr_utf8.ok b/src/testdir/test_listlbr_utf8.ok
index 576ccfb40..634cf3906 100644
--- a/src/testdir/test_listlbr_utf8.ok
+++ b/src/testdir/test_listlbr_utf8.ok
@@ -12,3 +12,10 @@ Test 2: set nolinebreak list
+pqrstuvwxyz␣1060ABC
+DEFGHIJKLMNOPˑ¶
+ *mask = nil;
+
+Test 3: set linebreak nolist
+ *mask = nil;
+~
+~
+~
diff --git a/src/testdir/test_mapping.in b/src/testdir/test_mapping.in
new file mode 100644
index 000000000..5f895a46f
--- /dev/null
+++ b/src/testdir/test_mapping.in
@@ -0,0 +1,25 @@
+Test for mappings and abbreviations
+
+STARTTEST
+:so small.vim
+:so mbyte.vim
+:set encoding=utf-8
+: " abbreviations with р (0x80) should work
+:inoreab чкпр vim
+GAчкпр
+
+
+: " langmap should not get remapped in insert mode
+:inoremap { FAIL_ilangmap
+:set langmap=+{ langnoremap
+o+
+: " expr mapping with langmap
+:inoremap <expr> { "FAIL_iexplangmap"
+o+
+
+:/^test/,$w! test.out
+:qa!
+ENDTEST
+
+test starts here:
+
diff --git a/src/testdir/test_mapping.ok b/src/testdir/test_mapping.ok
new file mode 100644
index 000000000..8d9497658
--- /dev/null
+++ b/src/testdir/test_mapping.ok
@@ -0,0 +1,4 @@
+test starts here:
+vim
++
++
diff --git a/src/testdir/test_nested_function.in b/src/testdir/test_nested_function.in
new file mode 100644
index 000000000..534164a50
--- /dev/null
+++ b/src/testdir/test_nested_function.in
@@ -0,0 +1,34 @@
+Tests for Nested function vim: set ft=vim :
+
+STARTTEST
+:so small.vim
+:fu! NestedFunc()
+: fu! Func1()
+: $put ='Func1'
+: endfunction
+: call Func1()
+: fu! s:func2()
+: $put ='s:func2'
+: endfunction
+: call s:func2()
+: fu! s:_func3()
+: $put ='s:_func3'
+: endfunction
+: call s:_func3()
+: let fn = 'Func4'
+: fu! {fn}()
+: $put ='Func4'
+: endfunction
+: call {fn}()
+: let fn = 'func5'
+: fu! s:{fn}()
+: $put ='s:func5'
+: endfunction
+: call s:{fn}()
+:endfunction
+:call NestedFunc()
+:/^result:/,$w! test.out
+:qa!
+ENDTEST
+
+result:
diff --git a/src/testdir/test_nested_function.ok b/src/testdir/test_nested_function.ok
new file mode 100644
index 000000000..c1fd19afe
--- /dev/null
+++ b/src/testdir/test_nested_function.ok
@@ -0,0 +1,6 @@
+result:
+Func1
+s:func2
+s:_func3
+Func4
+s:func5
diff --git a/src/testdir/test_qf_title.in b/src/testdir/test_qf_title.in
new file mode 100644
index 000000000..fce0c260e
--- /dev/null
+++ b/src/testdir/test_qf_title.in
@@ -0,0 +1,18 @@
+Tests for quickfix window's title vim: set ft=vim :
+
+STARTTEST
+:so small.vim
+:if !has('quickfix') | e! test.ok | wq! test.out | endif
+:set efm=%E%f:%l:%c:%m
+:cgetexpr ['file:1:1:message']
+:let qflist=getqflist()
+:call setqflist(qflist, 'r')
+:copen
+:let g:quickfix_title=w:quickfix_title
+:wincmd p
+:$put =g:quickfix_title
+:/^Results/,$w test.out
+:qa!
+ENDTEST
+
+Results of test_qf_title:
diff --git a/src/testdir/test_qf_title.ok b/src/testdir/test_qf_title.ok
new file mode 100644
index 000000000..4ebdbeff3
--- /dev/null
+++ b/src/testdir/test_qf_title.ok
@@ -0,0 +1,2 @@
+Results of test_qf_title:
+:setqflist()
diff --git a/src/testdir/test_signs.in b/src/testdir/test_signs.in
new file mode 100644
index 000000000..a2f15e932
--- /dev/null
+++ b/src/testdir/test_signs.in
@@ -0,0 +1,22 @@
+Tests for signs
+STARTTEST
+:so small.vim
+:if !has("signs")
+: e! test.ok
+: wq! test.out
+:endif
+:"
+:sign define JumpSign text=x
+:exe 'sign place 42 line=2 name=JumpSign buffer=' . bufnr('')
+:" Split the window to the bottom to verify :sign-jump will stay in the current
+:" window if the buffer is displayed there
+:bot split
+:exe 'sign jump 42 buffer=' . bufnr('')
+:call append(line('$'), winnr())
+:$-1,$w! test.out
+ENDTEST
+
+STARTTEST
+:qa!
+ENDTEST
+
diff --git a/src/testdir/test_signs.ok b/src/testdir/test_signs.ok
new file mode 100644
index 000000000..1f8c977ec
--- /dev/null
+++ b/src/testdir/test_signs.ok
@@ -0,0 +1,2 @@
+
+2
diff --git a/src/testdir/test_utf8.in b/src/testdir/test_utf8.in
new file mode 100644
index 000000000..713fee2c8
--- /dev/null
+++ b/src/testdir/test_utf8.in
@@ -0,0 +1,18 @@
+Tests for Unicode manipulations vim: set ft=vim :
+
+STARTTEST
+:so small.vim
+:set encoding=utf-8
+:" Visual block Insert adjusts for multi-byte char
+:new
+:call setline(1, ["aaa", "あああ", "bbb"])
+:exe ":norm! gg0l\<C-V>jjIx\<Esc>"
+:let r = getline(1, '$')
+:
+:bwipeout!
+:$put=r
+:call garbagecollect(1)
+:/^start:/,$wq! test.out
+ENDTEST
+
+start:
diff --git a/src/testdir/test_utf8.ok b/src/testdir/test_utf8.ok
new file mode 100644
index 000000000..c5bed5485
--- /dev/null
+++ b/src/testdir/test_utf8.ok
@@ -0,0 +1,4 @@
+start:
+axaa
+xあああ
+bxbb
diff --git a/src/testdir/test_writefile.in b/src/testdir/test_writefile.in
new file mode 100644
index 000000000..f2dc7d50b
--- /dev/null
+++ b/src/testdir/test_writefile.in
@@ -0,0 +1,18 @@
+Tests for writefile()
+
+STARTTEST
+:source small.vim
+:%delete _
+:let f = tempname()
+:call writefile(["over","written"], f, "b")
+:call writefile(["hello","world"], f, "b")
+:call writefile(["!", "good"], f, "a")
+:call writefile(["morning"], f, "ab")
+:call writefile(["", "vimmers"], f, "ab")
+:bwipeout!
+:$put =readfile(f)
+:1 delete _
+:w! test.out
+:qa!
+ENDTEST
+
diff --git a/src/testdir/test_writefile.ok b/src/testdir/test_writefile.ok
new file mode 100644
index 000000000..dfb6a2b29
--- /dev/null
+++ b/src/testdir/test_writefile.ok
@@ -0,0 +1,5 @@
+hello
+world!
+good
+morning
+vimmers
diff --git a/src/ui.c b/src/ui.c
index db13555f4..b268cd78d 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -558,6 +558,51 @@ clip_copy_selection(clip)
}
/*
+ * Save and restore clip_unnamed before doing possibly many changes. This
+ * prevents accessing the clipboard very often which might slow down Vim
+ * considerably.
+ */
+
+/*
+ * Save clip_unnamed and reset it.
+ */
+ void
+start_global_changes()
+{
+ clip_unnamed_saved = clip_unnamed;
+
+ if (clip_did_set_selection > 0)
+ {
+ clip_unnamed = FALSE;
+ clip_did_set_selection = FALSE;
+ }
+}
+
+/*
+ * Restore clip_unnamed and set the selection when needed.
+ */
+ void
+end_global_changes()
+{
+ if (clip_did_set_selection == FALSE) /* not when -1 */
+ {
+ clip_did_set_selection = TRUE;
+ clip_unnamed = clip_unnamed_saved;
+ if (clip_unnamed & CLIP_UNNAMED)
+ {
+ clip_own_selection(&clip_star);
+ clip_gen_set_selection(&clip_star);
+ }
+ if (clip_unnamed & CLIP_UNNAMED_PLUS)
+ {
+ clip_own_selection(&clip_plus);
+ clip_gen_set_selection(&clip_plus);
+ }
+ }
+ clip_unnamed_saved = FALSE;
+}
+
+/*
* Called when Visual mode is ended: update the selection.
*/
void
@@ -1428,6 +1473,15 @@ clip_gen_lose_selection(cbd)
clip_gen_set_selection(cbd)
VimClipboard *cbd;
{
+ if (!clip_did_set_selection)
+ {
+ /* Updating postponed, so that accessing the system clipboard won't
+ * hang Vim when accessing it many times (e.g. on a :g comand). */
+ if (cbd == &clip_plus && (clip_unnamed_saved & CLIP_UNNAMED_PLUS))
+ return;
+ else if (cbd == &clip_star && (clip_unnamed_saved & CLIP_UNNAMED))
+ return;
+ }
#ifdef FEAT_XCLIPBOARD
# ifdef FEAT_GUI
if (gui.in_use)
diff --git a/src/undo.c b/src/undo.c
index 5db25f04e..24dcf0548 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -81,8 +81,25 @@
#define UH_MAGIC 0x18dade /* value for uh_magic when in use */
#define UE_MAGIC 0xabc123 /* value for ue_magic when in use */
+/* Size of buffer used for encryption. */
+#define CRYPT_BUF_SIZE 8192
+
#include "vim.h"
+/* Structure passed around between functions.
+ * Avoids passing cryptstate_T when encryption not available. */
+typedef struct {
+ buf_T *bi_buf;
+ FILE *bi_fp;
+#ifdef FEAT_CRYPT
+ cryptstate_T *bi_state;
+ char_u *bi_buffer; /* CRYPT_BUF_SIZE, NULL when not buffering */
+ size_t bi_used; /* bytes written to/read from bi_buffer */
+ size_t bi_avail; /* bytes available in bi_buffer */
+#endif
+} bufinfo_T;
+
+
static long get_undolevel __ARGS((void));
static void u_unch_branch __ARGS((u_header_T *uhp));
static u_entry_T *u_get_headentry __ARGS((void));
@@ -98,18 +115,26 @@ static void u_freeentry __ARGS((u_entry_T *, long));
#ifdef FEAT_PERSISTENT_UNDO
static void corruption_error __ARGS((char *mesg, char_u *file_name));
static void u_free_uhp __ARGS((u_header_T *uhp));
-static size_t fwrite_crypt __ARGS((buf_T *buf UNUSED, char_u *ptr, size_t len, FILE *fp));
-static char_u *read_string_decrypt __ARGS((buf_T *buf UNUSED, FILE *fd, int len));
-static int serialize_header __ARGS((FILE *fp, buf_T *buf, char_u *hash));
-static int serialize_uhp __ARGS((FILE *fp, buf_T *buf, u_header_T *uhp));
-static u_header_T *unserialize_uhp __ARGS((FILE *fp, char_u *file_name));
-static int serialize_uep __ARGS((FILE *fp, buf_T *buf, u_entry_T *uep));
-static u_entry_T *unserialize_uep __ARGS((FILE *fp, int *error, char_u *file_name));
-static void serialize_pos __ARGS((pos_T pos, FILE *fp));
-static void unserialize_pos __ARGS((pos_T *pos, FILE *fp));
-static void serialize_visualinfo __ARGS((visualinfo_T *info, FILE *fp));
-static void unserialize_visualinfo __ARGS((visualinfo_T *info, FILE *fp));
-static void put_header_ptr __ARGS((FILE *fp, u_header_T *uhp));
+static int undo_write __ARGS((bufinfo_T *bi, char_u *ptr, size_t len));
+static int undo_flush __ARGS((bufinfo_T *bi));
+static int fwrite_crypt __ARGS((bufinfo_T *bi, char_u *ptr, size_t len));
+static int undo_write_bytes __ARGS((bufinfo_T *bi, long_u nr, int len));
+static void put_header_ptr __ARGS((bufinfo_T *bi, u_header_T *uhp));
+static int undo_read_4c __ARGS((bufinfo_T *bi));
+static int undo_read_2c __ARGS((bufinfo_T *bi));
+static int undo_read_byte __ARGS((bufinfo_T *bi));
+static time_t undo_read_time __ARGS((bufinfo_T *bi));
+static int undo_read __ARGS((bufinfo_T *bi, char_u *buffer, size_t size));
+static char_u *read_string_decrypt __ARGS((bufinfo_T *bi, int len));
+static int serialize_header __ARGS((bufinfo_T *bi, char_u *hash));
+static int serialize_uhp __ARGS((bufinfo_T *bi, u_header_T *uhp));
+static u_header_T *unserialize_uhp __ARGS((bufinfo_T *bi, char_u *file_name));
+static int serialize_uep __ARGS((bufinfo_T *bi, u_entry_T *uep));
+static u_entry_T *unserialize_uep __ARGS((bufinfo_T *bi, int *error, char_u *file_name));
+static void serialize_pos __ARGS((bufinfo_T *bi, pos_T pos));
+static void unserialize_pos __ARGS((bufinfo_T *bi, pos_T *pos));
+static void serialize_visualinfo __ARGS((bufinfo_T *bi, visualinfo_T *info));
+static void unserialize_visualinfo __ARGS((bufinfo_T *bi, visualinfo_T *info));
#endif
#define U_ALLOC_LINE(size) lalloc((long_u)(size), FALSE)
@@ -859,68 +884,294 @@ u_free_uhp(uhp)
}
/*
- * Like fwrite() but crypt the bytes when 'key' is set.
- * Returns 1 if successful.
+ * Write a sequence of bytes to the undo file.
+ * Buffers and encrypts as needed.
+ * Returns OK or FAIL.
*/
- static size_t
-fwrite_crypt(buf, ptr, len, fp)
- buf_T *buf UNUSED;
+ static int
+undo_write(bi, ptr, len)
+ bufinfo_T *bi;
+ char_u *ptr;
+ size_t len;
+{
+#ifdef FEAT_CRYPT
+ if (bi->bi_buffer != NULL)
+ {
+ size_t len_todo = len;
+ char_u *p = ptr;
+
+ while (bi->bi_used + len_todo >= CRYPT_BUF_SIZE)
+ {
+ size_t n = CRYPT_BUF_SIZE - bi->bi_used;
+
+ mch_memmove(bi->bi_buffer + bi->bi_used, p, n);
+ len_todo -= n;
+ p += n;
+ bi->bi_used = CRYPT_BUF_SIZE;
+ if (undo_flush(bi) == FAIL)
+ return FAIL;
+ }
+ if (len_todo > 0)
+ {
+ mch_memmove(bi->bi_buffer + bi->bi_used, p, len_todo);
+ bi->bi_used += len_todo;
+ }
+ return OK;
+ }
+#endif
+ if (fwrite(ptr, len, (size_t)1, bi->bi_fp) != 1)
+ return FAIL;
+ return OK;
+}
+
+#ifdef FEAT_CRYPT
+ static int
+undo_flush(bi)
+ bufinfo_T *bi;
+{
+ if (bi->bi_buffer != NULL && bi->bi_used > 0)
+ {
+ crypt_encode_inplace(bi->bi_state, bi->bi_buffer, bi->bi_used);
+ if (fwrite(bi->bi_buffer, bi->bi_used, (size_t)1, bi->bi_fp) != 1)
+ return FAIL;
+ bi->bi_used = 0;
+ }
+ return OK;
+}
+#endif
+
+/*
+ * Write "ptr[len]" and crypt the bytes when needed.
+ * Returns OK or FAIL.
+ */
+ static int
+fwrite_crypt(bi, ptr, len)
+ bufinfo_T *bi;
char_u *ptr;
size_t len;
- FILE *fp;
{
#ifdef FEAT_CRYPT
char_u *copy;
char_u small_buf[100];
size_t i;
- if (*buf->b_p_key == NUL)
- return fwrite(ptr, len, (size_t)1, fp);
- if (len < 100)
- copy = small_buf; /* no malloc()/free() for short strings */
- else
+ if (bi->bi_state != NULL && bi->bi_buffer == NULL)
{
- copy = lalloc(len, FALSE);
- if (copy == NULL)
- return 0;
+ /* crypting every piece of text separately */
+ if (len < 100)
+ copy = small_buf; /* no malloc()/free() for short strings */
+ else
+ {
+ copy = lalloc(len, FALSE);
+ if (copy == NULL)
+ return 0;
+ }
+ crypt_encode(bi->bi_state, ptr, len, copy);
+ i = fwrite(copy, len, (size_t)1, bi->bi_fp);
+ if (copy != small_buf)
+ vim_free(copy);
+ return i == 1 ? OK : FAIL;
}
- crypt_encode(ptr, len, copy);
- i = fwrite(copy, len, (size_t)1, fp);
- if (copy != small_buf)
- vim_free(copy);
- return i;
-#else
- return fwrite(ptr, len, (size_t)1, fp);
#endif
+ return undo_write(bi, ptr, len);
}
/*
- * Read a string of length "len" from "fd".
- * When 'key' is set decrypt the bytes.
+ * Write a number, MSB first, in "len" bytes.
+ * Must match with undo_read_?c() functions.
+ * Returns OK or FAIL.
*/
- static char_u *
-read_string_decrypt(buf, fd, len)
- buf_T *buf UNUSED;
- FILE *fd;
+ static int
+undo_write_bytes(bi, nr, len)
+ bufinfo_T *bi;
+ long_u nr;
int len;
{
- char_u *ptr;
+ char_u buf[8];
+ int i;
+ int bufi = 0;
+
+ for (i = len - 1; i >= 0; --i)
+ buf[bufi++] = (char_u)(nr >> (i * 8));
+ return undo_write(bi, buf, (size_t)len);
+}
+
+/*
+ * Write the pointer to an undo header. Instead of writing the pointer itself
+ * we use the sequence number of the header. This is converted back to
+ * pointers when reading. */
+ static void
+put_header_ptr(bi, uhp)
+ bufinfo_T *bi;
+ u_header_T *uhp;
+{
+ undo_write_bytes(bi, (long_u)(uhp != NULL ? uhp->uh_seq : 0), 4);
+}
+
+ static int
+undo_read_4c(bi)
+ bufinfo_T *bi;
+{
+#ifdef FEAT_CRYPT
+ if (bi->bi_buffer != NULL)
+ {
+ char_u buf[4];
+ int n;
+
+ undo_read(bi, buf, (size_t)4);
+ n = ((unsigned)buf[0] << 24) + (buf[1] << 16) + (buf[2] << 8) + buf[3];
+ return n;
+ }
+#endif
+ return get4c(bi->bi_fp);
+}
+
+ static int
+undo_read_2c(bi)
+ bufinfo_T *bi;
+{
+#ifdef FEAT_CRYPT
+ if (bi->bi_buffer != NULL)
+ {
+ char_u buf[2];
+ int n;
+
+ undo_read(bi, buf, (size_t)2);
+ n = (buf[0] << 8) + buf[1];
+ return n;
+ }
+#endif
+ return get2c(bi->bi_fp);
+}
+
+ static int
+undo_read_byte(bi)
+ bufinfo_T *bi;
+{
+#ifdef FEAT_CRYPT
+ if (bi->bi_buffer != NULL)
+ {
+ char_u buf[1];
+
+ undo_read(bi, buf, (size_t)1);
+ return buf[0];
+ }
+#endif
+ return getc(bi->bi_fp);
+}
+
+ static time_t
+undo_read_time(bi)
+ bufinfo_T *bi;
+{
+#ifdef FEAT_CRYPT
+ if (bi->bi_buffer != NULL)
+ {
+ char_u buf[8];
+ time_t n = 0;
+ int i;
+
+ undo_read(bi, buf, (size_t)8);
+ for (i = 0; i < 8; ++i)
+ n = (n << 8) + buf[i];
+ return n;
+ }
+#endif
+ return get8ctime(bi->bi_fp);
+}
+
+/*
+ * Read "buffer[size]" from the undo file.
+ * Return OK or FAIL.
+ */
+ static int
+undo_read(bi, buffer, size)
+ bufinfo_T *bi;
+ char_u *buffer;
+ size_t size;
+{
+#ifdef FEAT_CRYPT
+ if (bi->bi_buffer != NULL)
+ {
+ int size_todo = (int)size;
+ char_u *p = buffer;
+
+ while (size_todo > 0)
+ {
+ size_t n;
+
+ if (bi->bi_used >= bi->bi_avail)
+ {
+ n = fread(bi->bi_buffer, 1, (size_t)CRYPT_BUF_SIZE, bi->bi_fp);
+ if (n <= 0)
+ {
+ /* Error may be checked for only later. Fill with zeros,
+ * so that the reader won't use garbage. */
+ vim_memset(p, 0, size_todo);
+ return FAIL;
+ }
+ bi->bi_avail = n;
+ bi->bi_used = 0;
+ crypt_decode_inplace(bi->bi_state, bi->bi_buffer, bi->bi_avail);
+ }
+ n = size_todo;
+ if (n > bi->bi_avail - bi->bi_used)
+ n = bi->bi_avail - bi->bi_used;
+ mch_memmove(p, bi->bi_buffer + bi->bi_used, n);
+ bi->bi_used += n;
+ size_todo -= (int)n;
+ p += n;
+ }
+ return OK;
+ }
+#endif
+ if (fread(buffer, (size_t)size, 1, bi->bi_fp) != 1)
+ return FAIL;
+ return OK;
+}
+
+/*
+ * Read a string of length "len" from "bi->bi_fd".
+ * "len" can be zero to allocate an empty line.
+ * Decrypt the bytes if needed.
+ * Append a NUL.
+ * Returns a pointer to allocated memory or NULL for failure.
+ */
+ static char_u *
+read_string_decrypt(bi, len)
+ bufinfo_T *bi;
+ int len;
+{
+ char_u *ptr = alloc((unsigned)len + 1);
- ptr = read_string(fd, len);
+ if (ptr != NULL)
+ {
+ if (len > 0 && undo_read(bi, ptr, len) == FAIL)
+ {
+ vim_free(ptr);
+ return NULL;
+ }
+ ptr[len] = NUL;
#ifdef FEAT_CRYPT
- if (ptr != NULL && *buf->b_p_key != NUL)
- crypt_decode(ptr, len);
+ if (bi->bi_state != NULL && bi->bi_buffer == NULL)
+ crypt_decode_inplace(bi->bi_state, ptr, len);
#endif
+ }
return ptr;
}
+/*
+ * Writes the (not encrypted) header and initializes encryption if needed.
+ */
static int
-serialize_header(fp, buf, hash)
- FILE *fp;
- buf_T *buf;
+serialize_header(bi, hash)
+ bufinfo_T *bi;
char_u *hash;
{
- int len;
+ int len;
+ buf_T *buf = bi->bi_buf;
+ FILE *fp = bi->bi_fp;
+ char_u time_buf[8];
/* Start writing, first the magic marker and undo info version. */
if (fwrite(UF_START_MAGIC, (size_t)UF_START_MAGIC_LEN, (size_t)1, fp) != 1)
@@ -934,108 +1185,124 @@ serialize_header(fp, buf, hash)
char_u *header;
int header_len;
- put_bytes(fp, (long_u)UF_VERSION_CRYPT, 2);
- header = prepare_crypt_write(buf, &header_len);
- if (header == NULL)
+ undo_write_bytes(bi, (long_u)UF_VERSION_CRYPT, 2);
+ bi->bi_state = crypt_create_for_writing(crypt_get_method_nr(buf),
+ buf->b_p_key, &header, &header_len);
+ if (bi->bi_state == NULL)
return FAIL;
len = (int)fwrite(header, (size_t)header_len, (size_t)1, fp);
vim_free(header);
if (len != 1)
{
- crypt_pop_state();
+ crypt_free_state(bi->bi_state);
+ bi->bi_state = NULL;
return FAIL;
}
+
+ if (crypt_whole_undofile(crypt_get_method_nr(buf)))
+ {
+ bi->bi_buffer = alloc(CRYPT_BUF_SIZE);
+ if (bi->bi_buffer == NULL)
+ {
+ crypt_free_state(bi->bi_state);
+ bi->bi_state = NULL;
+ return FAIL;
+ }
+ bi->bi_used = 0;
+ }
}
else
#endif
- put_bytes(fp, (long_u)UF_VERSION, 2);
+ undo_write_bytes(bi, (long_u)UF_VERSION, 2);
/* Write a hash of the buffer text, so that we can verify it is still the
* same when reading the buffer text. */
- if (fwrite(hash, (size_t)UNDO_HASH_SIZE, (size_t)1, fp) != 1)
+ if (undo_write(bi, hash, (size_t)UNDO_HASH_SIZE) == FAIL)
return FAIL;
/* buffer-specific data */
- put_bytes(fp, (long_u)buf->b_ml.ml_line_count, 4);
+ undo_write_bytes(bi, (long_u)buf->b_ml.ml_line_count, 4);
len = buf->b_u_line_ptr != NULL ? (int)STRLEN(buf->b_u_line_ptr) : 0;
- put_bytes(fp, (long_u)len, 4);
- if (len > 0 && fwrite_crypt(buf, buf->b_u_line_ptr, (size_t)len, fp) != 1)
+ undo_write_bytes(bi, (long_u)len, 4);
+ if (len > 0 && fwrite_crypt(bi, buf->b_u_line_ptr, (size_t)len) == FAIL)
return FAIL;
- put_bytes(fp, (long_u)buf->b_u_line_lnum, 4);
- put_bytes(fp, (long_u)buf->b_u_line_colnr, 4);
+ undo_write_bytes(bi, (long_u)buf->b_u_line_lnum, 4);
+ undo_write_bytes(bi, (long_u)buf->b_u_line_colnr, 4);
/* Undo structures header data */
- put_header_ptr(fp, buf->b_u_oldhead);
- put_header_ptr(fp, buf->b_u_newhead);
- put_header_ptr(fp, buf->b_u_curhead);
+ put_header_ptr(bi, buf->b_u_oldhead);
+ put_header_ptr(bi, buf->b_u_newhead);
+ put_header_ptr(bi, buf->b_u_curhead);
- put_bytes(fp, (long_u)buf->b_u_numhead, 4);
- put_bytes(fp, (long_u)buf->b_u_seq_last, 4);
- put_bytes(fp, (long_u)buf->b_u_seq_cur, 4);
- put_time(fp, buf->b_u_time_cur);
+ undo_write_bytes(bi, (long_u)buf->b_u_numhead, 4);
+ undo_write_bytes(bi, (long_u)buf->b_u_seq_last, 4);
+ undo_write_bytes(bi, (long_u)buf->b_u_seq_cur, 4);
+ time_to_bytes(buf->b_u_time_cur, time_buf);
+ undo_write(bi, time_buf, 8);
/* Optional fields. */
- putc(4, fp);
- putc(UF_LAST_SAVE_NR, fp);
- put_bytes(fp, (long_u)buf->b_u_save_nr_last, 4);
+ undo_write_bytes(bi, 4, 1);
+ undo_write_bytes(bi, UF_LAST_SAVE_NR, 1);
+ undo_write_bytes(bi, (long_u)buf->b_u_save_nr_last, 4);
- putc(0, fp); /* end marker */
+ undo_write_bytes(bi, 0, 1); /* end marker */
return OK;
}
static int
-serialize_uhp(fp, buf, uhp)
- FILE *fp;
- buf_T *buf;
+serialize_uhp(bi, uhp)
+ bufinfo_T *bi;
u_header_T *uhp;
{
int i;
u_entry_T *uep;
+ char_u time_buf[8];
- if (put_bytes(fp, (long_u)UF_HEADER_MAGIC, 2) == FAIL)
+ if (undo_write_bytes(bi, (long_u)UF_HEADER_MAGIC, 2) == FAIL)
return FAIL;
- put_header_ptr(fp, uhp->uh_next.ptr);
- put_header_ptr(fp, uhp->uh_prev.ptr);
- put_header_ptr(fp, uhp->uh_alt_next.ptr);
- put_header_ptr(fp, uhp->uh_alt_prev.ptr);
- put_bytes(fp, uhp->uh_seq, 4);
- serialize_pos(uhp->uh_cursor, fp);
+ put_header_ptr(bi, uhp->uh_next.ptr);
+ put_header_ptr(bi, uhp->uh_prev.ptr);
+ put_header_ptr(bi, uhp->uh_alt_next.ptr);
+ put_header_ptr(bi, uhp->uh_alt_prev.ptr);
+ undo_write_bytes(bi, uhp->uh_seq, 4);
+ serialize_pos(bi, uhp->uh_cursor);
#ifdef FEAT_VIRTUALEDIT
- put_bytes(fp, (long_u)uhp->uh_cursor_vcol, 4);
+ undo_write_bytes(bi, (long_u)uhp->uh_cursor_vcol, 4);
#else
- put_bytes(fp, (long_u)0, 4);
+ undo_write_bytes(bi, (long_u)0, 4);
#endif
- put_bytes(fp, (long_u)uhp->uh_flags, 2);
+ undo_write_bytes(bi, (long_u)uhp->uh_flags, 2);
/* Assume NMARKS will stay the same. */
for (i = 0; i < NMARKS; ++i)
- serialize_pos(uhp->uh_namedm[i], fp);
- serialize_visualinfo(&uhp->uh_visual, fp);
- put_time(fp, uhp->uh_time);
+ serialize_pos(bi, uhp->uh_namedm[i]);
+ serialize_visualinfo(bi, &uhp->uh_visual);
+ time_to_bytes(uhp->uh_time, time_buf);
+ undo_write(bi, time_buf, 8);
/* Optional fields. */
- putc(4, fp);
- putc(UHP_SAVE_NR, fp);
- put_bytes(fp, (long_u)uhp->uh_save_nr, 4);
+ undo_write_bytes(bi, 4, 1);
+ undo_write_bytes(bi, UHP_SAVE_NR, 1);
+ undo_write_bytes(bi, (long_u)uhp->uh_save_nr, 4);
- putc(0, fp); /* end marker */
+ undo_write_bytes(bi, 0, 1); /* end marker */
/* Write all the entries. */
for (uep = uhp->uh_entry; uep != NULL; uep = uep->ue_next)
{
- put_bytes(fp, (long_u)UF_ENTRY_MAGIC, 2);
- if (serialize_uep(fp, buf, uep) == FAIL)
+ undo_write_bytes(bi, (long_u)UF_ENTRY_MAGIC, 2);
+ if (serialize_uep(bi, uep) == FAIL)
return FAIL;
}
- put_bytes(fp, (long_u)UF_ENTRY_END_MAGIC, 2);
+ undo_write_bytes(bi, (long_u)UF_ENTRY_END_MAGIC, 2);
return OK;
}
static u_header_T *
-unserialize_uhp(fp, file_name)
- FILE *fp;
+unserialize_uhp(bi, file_name)
+ bufinfo_T *bi;
char_u *file_name;
{
u_header_T *uhp;
@@ -1051,56 +1318,56 @@ unserialize_uhp(fp, file_name)
#ifdef U_DEBUG
uhp->uh_magic = UH_MAGIC;
#endif
- uhp->uh_next.seq = get4c(fp);
- uhp->uh_prev.seq = get4c(fp);
- uhp->uh_alt_next.seq = get4c(fp);
- uhp->uh_alt_prev.seq = get4c(fp);
- uhp->uh_seq = get4c(fp);
+ uhp->uh_next.seq = undo_read_4c(bi);
+ uhp->uh_prev.seq = undo_read_4c(bi);
+ uhp->uh_alt_next.seq = undo_read_4c(bi);
+ uhp->uh_alt_prev.seq = undo_read_4c(bi);
+ uhp->uh_seq = undo_read_4c(bi);
if (uhp->uh_seq <= 0)
{
corruption_error("uh_seq", file_name);
vim_free(uhp);
return NULL;
}
- unserialize_pos(&uhp->uh_cursor, fp);
+ unserialize_pos(bi, &uhp->uh_cursor);
#ifdef FEAT_VIRTUALEDIT
- uhp->uh_cursor_vcol = get4c(fp);
+ uhp->uh_cursor_vcol = undo_read_4c(bi);
#else
- (void)get4c(fp);
+ (void)undo_read_4c(bi);
#endif
- uhp->uh_flags = get2c(fp);
+ uhp->uh_flags = undo_read_2c(bi);
for (i = 0; i < NMARKS; ++i)
- unserialize_pos(&uhp->uh_namedm[i], fp);
- unserialize_visualinfo(&uhp->uh_visual, fp);
- uhp->uh_time = get8ctime(fp);
+ unserialize_pos(bi, &uhp->uh_namedm[i]);
+ unserialize_visualinfo(bi, &uhp->uh_visual);
+ uhp->uh_time = undo_read_time(bi);
/* Optional fields. */
for (;;)
{
- int len = getc(fp);
+ int len = undo_read_byte(bi);
int what;
if (len == 0)
break;
- what = getc(fp);
+ what = undo_read_byte(bi);
switch (what)
{
case UHP_SAVE_NR:
- uhp->uh_save_nr = get4c(fp);
+ uhp->uh_save_nr = undo_read_4c(bi);
break;
default:
/* field not supported, skip */
while (--len >= 0)
- (void)getc(fp);
+ (void)undo_read_byte(bi);
}
}
/* Unserialize the uep list. */
last_uep = NULL;
- while ((c = get2c(fp)) == UF_ENTRY_MAGIC)
+ while ((c = undo_read_2c(bi)) == UF_ENTRY_MAGIC)
{
error = FALSE;
- uep = unserialize_uep(fp, &error, file_name);
+ uep = unserialize_uep(bi, &error, file_name);
if (last_uep == NULL)
uhp->uh_entry = uep;
else
@@ -1123,35 +1390,34 @@ unserialize_uhp(fp, file_name)
}
/*
- * Serialize "uep" to "fp".
+ * Serialize "uep".
*/
static int
-serialize_uep(fp, buf, uep)
- FILE *fp;
- buf_T *buf;
+serialize_uep(bi, uep)
+ bufinfo_T *bi;
u_entry_T *uep;
{
int i;
size_t len;
- put_bytes(fp, (long_u)uep->ue_top, 4);
- put_bytes(fp, (long_u)uep->ue_bot, 4);
- put_bytes(fp, (long_u)uep->ue_lcount, 4);
- put_bytes(fp, (long_u)uep->ue_size, 4);
+ undo_write_bytes(bi, (long_u)uep->ue_top, 4);
+ undo_write_bytes(bi, (long_u)uep->ue_bot, 4);
+ undo_write_bytes(bi, (long_u)uep->ue_lcount, 4);
+ undo_write_bytes(bi, (long_u)uep->ue_size, 4);
for (i = 0; i < uep->ue_size; ++i)
{
len = STRLEN(uep->ue_array[i]);
- if (put_bytes(fp, (long_u)len, 4) == FAIL)
+ if (undo_write_bytes(bi, (long_u)len, 4) == FAIL)
return FAIL;
- if (len > 0 && fwrite_crypt(buf, uep->ue_array[i], len, fp) != 1)
+ if (len > 0 && fwrite_crypt(bi, uep->ue_array[i], len) == FAIL)
return FAIL;
}
return OK;
}
static u_entry_T *
-unserialize_uep(fp, error, file_name)
- FILE *fp;
+unserialize_uep(bi, error, file_name)
+ bufinfo_T *bi;
int *error;
char_u *file_name;
{
@@ -1168,10 +1434,10 @@ unserialize_uep(fp, error, file_name)
#ifdef U_DEBUG
uep->ue_magic = UE_MAGIC;
#endif
- uep->ue_top = get4c(fp);
- uep->ue_bot = get4c(fp);
- uep->ue_lcount = get4c(fp);
- uep->ue_size = get4c(fp);
+ uep->ue_top = undo_read_4c(bi);
+ uep->ue_bot = undo_read_4c(bi);
+ uep->ue_lcount = undo_read_4c(bi);
+ uep->ue_size = undo_read_4c(bi);
if (uep->ue_size > 0)
{
array = (char_u **)U_ALLOC_LINE(sizeof(char_u *) * uep->ue_size);
@@ -1188,9 +1454,9 @@ unserialize_uep(fp, error, file_name)
for (i = 0; i < uep->ue_size; ++i)
{
- line_len = get4c(fp);
+ line_len = undo_read_4c(bi);
if (line_len >= 0)
- line = read_string_decrypt(curbuf, fp, line_len);
+ line = read_string_decrypt(bi, line_len);
else
{
line = NULL;
@@ -1207,83 +1473,71 @@ unserialize_uep(fp, error, file_name)
}
/*
- * Serialize "pos" to "fp".
+ * Serialize "pos".
*/
static void
-serialize_pos(pos, fp)
+serialize_pos(bi, pos)
+ bufinfo_T *bi;
pos_T pos;
- FILE *fp;
{
- put_bytes(fp, (long_u)pos.lnum, 4);
- put_bytes(fp, (long_u)pos.col, 4);
+ undo_write_bytes(bi, (long_u)pos.lnum, 4);
+ undo_write_bytes(bi, (long_u)pos.col, 4);
#ifdef FEAT_VIRTUALEDIT
- put_bytes(fp, (long_u)pos.coladd, 4);
+ undo_write_bytes(bi, (long_u)pos.coladd, 4);
#else
- put_bytes(fp, (long_u)0, 4);
+ undo_write_bytes(bi, (long_u)0, 4);
#endif
}
/*
- * Unserialize the pos_T at the current position in fp.
+ * Unserialize the pos_T at the current position.
*/
static void
-unserialize_pos(pos, fp)
+unserialize_pos(bi, pos)
+ bufinfo_T *bi;
pos_T *pos;
- FILE *fp;
{
- pos->lnum = get4c(fp);
+ pos->lnum = undo_read_4c(bi);
if (pos->lnum < 0)
pos->lnum = 0;
- pos->col = get4c(fp);
+ pos->col = undo_read_4c(bi);
if (pos->col < 0)
pos->col = 0;
#ifdef FEAT_VIRTUALEDIT
- pos->coladd = get4c(fp);
+ pos->coladd = undo_read_4c(bi);
if (pos->coladd < 0)
pos->coladd = 0;
#else
- (void)get4c(fp);
+ (void)undo_read_4c(bi);
#endif
}
/*
- * Serialize "info" to "fp".
+ * Serialize "info".
*/
static void
-serialize_visualinfo(info, fp)
+serialize_visualinfo(bi, info)
+ bufinfo_T *bi;
visualinfo_T *info;
- FILE *fp;
{
- serialize_pos(info->vi_start, fp);
- serialize_pos(info->vi_end, fp);
- put_bytes(fp, (long_u)info->vi_mode, 4);
- put_bytes(fp, (long_u)info->vi_curswant, 4);
+ serialize_pos(bi, info->vi_start);
+ serialize_pos(bi, info->vi_end);
+ undo_write_bytes(bi, (long_u)info->vi_mode, 4);
+ undo_write_bytes(bi, (long_u)info->vi_curswant, 4);
}
/*
- * Unserialize the visualinfo_T at the current position in fp.
+ * Unserialize the visualinfo_T at the current position.
*/
static void
-unserialize_visualinfo(info, fp)
+unserialize_visualinfo(bi, info)
+ bufinfo_T *bi;
visualinfo_T *info;
- FILE *fp;
-{
- unserialize_pos(&info->vi_start, fp);
- unserialize_pos(&info->vi_end, fp);
- info->vi_mode = get4c(fp);
- info->vi_curswant = get4c(fp);
-}
-
-/*
- * Write the pointer to an undo header. Instead of writing the pointer itself
- * we use the sequence number of the header. This is converted back to
- * pointers when reading. */
- static void
-put_header_ptr(fp, uhp)
- FILE *fp;
- u_header_T *uhp;
{
- put_bytes(fp, (long_u)(uhp != NULL ? uhp->uh_seq : 0), 4);
+ unserialize_pos(bi, &info->vi_start);
+ unserialize_pos(bi, &info->vi_end);
+ info->vi_mode = undo_read_4c(bi);
+ info->vi_curswant = undo_read_4c(bi);
}
/*
@@ -1317,9 +1571,9 @@ u_write_undo(name, forceit, buf, hash)
struct stat st_old;
struct stat st_new;
#endif
-#ifdef FEAT_CRYPT
- int do_crypt = FALSE;
-#endif
+ bufinfo_T bi;
+
+ vim_memset(&bi, 0, sizeof(bi));
if (name == NULL)
{
@@ -1474,14 +1728,12 @@ u_write_undo(name, forceit, buf, hash)
u_sync(TRUE);
/*
- * Write the header.
+ * Write the header. Initializes encryption, if enabled.
*/
- if (serialize_header(fp, buf, hash) == FAIL)
+ bi.bi_buf = buf;
+ bi.bi_fp = fp;
+ if (serialize_header(&bi, hash) == FAIL)
goto write_error;
-#ifdef FEAT_CRYPT
- if (*buf->b_p_key != NUL)
- do_crypt = TRUE;
-#endif
/*
* Iteratively serialize UHPs and their UEPs from the top down.
@@ -1497,7 +1749,7 @@ u_write_undo(name, forceit, buf, hash)
#ifdef U_DEBUG
++headers_written;
#endif
- if (serialize_uhp(fp, buf, uhp) == FAIL)
+ if (serialize_uhp(&bi, uhp) == FAIL)
goto write_error;
}
@@ -1516,7 +1768,7 @@ u_write_undo(name, forceit, buf, hash)
uhp = uhp->uh_next.ptr;
}
- if (put_bytes(fp, (long_u)UF_HEADER_END_MAGIC, 2) == OK)
+ if (undo_write_bytes(&bi, (long_u)UF_HEADER_END_MAGIC, 2) == OK)
write_ok = TRUE;
#ifdef U_DEBUG
if (headers_written != buf->b_u_numhead)
@@ -1526,6 +1778,11 @@ u_write_undo(name, forceit, buf, hash)
}
#endif
+#ifdef FEAT_CRYPT
+ if (bi.bi_state != NULL && undo_flush(&bi) == FAIL)
+ write_ok = FALSE;
+#endif
+
write_error:
fclose(fp);
if (!write_ok)
@@ -1551,8 +1808,9 @@ write_error:
theend:
#ifdef FEAT_CRYPT
- if (do_crypt)
- crypt_pop_state();
+ if (bi.bi_state != NULL)
+ crypt_free_state(bi.bi_state);
+ vim_free(bi.bi_buffer);
#endif
if (file_name != name)
vim_free(file_name);
@@ -1598,10 +1856,9 @@ u_read_undo(name, hash, orig_name)
struct stat st_orig;
struct stat st_undo;
#endif
-#ifdef FEAT_CRYPT
- int do_decrypt = FALSE;
-#endif
+ bufinfo_T bi;
+ vim_memset(&bi, 0, sizeof(bi));
if (name == NULL)
{
file_name = u_get_undo_file_name(curbuf->b_ffname, TRUE);
@@ -1644,6 +1901,8 @@ u_read_undo(name, hash, orig_name)
EMSG2(_("E822: Cannot open undo file for reading: %s"), file_name);
goto error;
}
+ bi.bi_buf = curbuf;
+ bi.bi_fp = fp;
/*
* Read the undo file header.
@@ -1664,12 +1923,24 @@ u_read_undo(name, hash, orig_name)
file_name);
goto error;
}
- if (prepare_crypt_read(fp) == FAIL)
+ bi.bi_state = crypt_create_from_file(fp, curbuf->b_p_key);
+ if (bi.bi_state == NULL)
{
EMSG2(_("E826: Undo file decryption failed: %s"), file_name);
goto error;
}
- do_decrypt = TRUE;
+ if (crypt_whole_undofile(bi.bi_state->method_nr))
+ {
+ bi.bi_buffer = alloc(CRYPT_BUF_SIZE);
+ if (bi.bi_buffer == NULL)
+ {
+ crypt_free_state(bi.bi_state);
+ bi.bi_state = NULL;
+ goto error;
+ }
+ bi.bi_avail = 0;
+ bi.bi_used = 0;
+ }
#else
EMSG2(_("E827: Undo file is encrypted: %s"), file_name);
goto error;
@@ -1681,12 +1952,12 @@ u_read_undo(name, hash, orig_name)
goto error;
}
- if (fread(read_hash, UNDO_HASH_SIZE, 1, fp) != 1)
+ if (undo_read(&bi, read_hash, (size_t)UNDO_HASH_SIZE) == FAIL)
{
corruption_error("hash", file_name);
goto error;
}
- line_count = (linenr_T)get4c(fp);
+ line_count = (linenr_T)undo_read_4c(&bi);
if (memcmp(hash, read_hash, UNDO_HASH_SIZE) != 0
|| line_count != curbuf->b_ml.ml_line_count)
{
@@ -1703,13 +1974,13 @@ u_read_undo(name, hash, orig_name)
}
/* Read undo data for "U" command. */
- str_len = get4c(fp);
+ str_len = undo_read_4c(&bi);
if (str_len < 0)
goto error;
if (str_len > 0)
- line_ptr = read_string_decrypt(curbuf, fp, str_len);
- line_lnum = (linenr_T)get4c(fp);
- line_colnr = (colnr_T)get4c(fp);
+ line_ptr = read_string_decrypt(&bi, str_len);
+ line_lnum = (linenr_T)undo_read_4c(&bi);
+ line_colnr = (colnr_T)undo_read_4c(&bi);
if (line_lnum < 0 || line_colnr < 0)
{
corruption_error("line lnum/col", file_name);
@@ -1717,32 +1988,32 @@ u_read_undo(name, hash, orig_name)
}
/* Begin general undo data */
- old_header_seq = get4c(fp);
- new_header_seq = get4c(fp);
- cur_header_seq = get4c(fp);
- num_head = get4c(fp);
- seq_last = get4c(fp);
- seq_cur = get4c(fp);
- seq_time = get8ctime(fp);
+ old_header_seq = undo_read_4c(&bi);
+ new_header_seq = undo_read_4c(&bi);
+ cur_header_seq = undo_read_4c(&bi);
+ num_head = undo_read_4c(&bi);
+ seq_last = undo_read_4c(&bi);
+ seq_cur = undo_read_4c(&bi);
+ seq_time = undo_read_time(&bi);
/* Optional header fields. */
for (;;)
{
- int len = getc(fp);
+ int len = undo_read_byte(&bi);
int what;
if (len == 0 || len == EOF)
break;
- what = getc(fp);
+ what = undo_read_byte(&bi);
switch (what)
{
case UF_LAST_SAVE_NR:
- last_save_nr = get4c(fp);
+ last_save_nr = undo_read_4c(&bi);
break;
default:
/* field not supported, skip */
while (--len >= 0)
- (void)getc(fp);
+ (void)undo_read_byte(&bi);
}
}
@@ -1758,7 +2029,7 @@ u_read_undo(name, hash, orig_name)
goto error;
}
- while ((c = get2c(fp)) == UF_HEADER_MAGIC)
+ while ((c = undo_read_2c(&bi)) == UF_HEADER_MAGIC)
{
if (num_read_uhps >= num_head)
{
@@ -1766,7 +2037,7 @@ u_read_undo(name, hash, orig_name)
goto error;
}
- uhp = unserialize_uhp(fp, file_name);
+ uhp = unserialize_uhp(&bi, file_name);
if (uhp == NULL)
goto error;
uhp_table[num_read_uhps++] = uhp;
@@ -1898,8 +2169,9 @@ error:
theend:
#ifdef FEAT_CRYPT
- if (do_decrypt)
- crypt_pop_state();
+ if (bi.bi_state != NULL)
+ crypt_free_state(bi.bi_state);
+ vim_free(bi.bi_buffer);
#endif
if (fp != NULL)
fclose(fp);
diff --git a/src/version.c b/src/version.c
index 47d5adb5f..4f9777ffa 100644
--- a/src/version.c
+++ b/src/version.c
@@ -189,6 +189,13 @@ static char *(features[]) =
#else
"-digraphs",
#endif
+#ifdef FEAT_GUI_W32
+# ifdef FEAT_DIRECTX
+ "+directx",
+# else
+ "-directx",
+# endif
+#endif
#ifdef FEAT_DND
"+dnd",
#else
@@ -735,6 +742,396 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 568,
+/**/
+ 567,
+/**/
+ 566,
+/**/
+ 565,
+/**/
+ 564,
+/**/
+ 563,
+/**/
+ 562,
+/**/
+ 561,
+/**/
+ 560,
+/**/
+ 559,
+/**/
+ 558,
+/**/
+ 557,
+/**/
+ 556,
+/**/
+ 555,
+/**/
+ 554,
+/**/
+ 553,
+/**/
+ 552,
+/**/
+ 551,
+/**/
+ 550,
+/**/
+ 549,
+/**/
+ 548,
+/**/
+ 547,
+/**/
+ 546,
+/**/
+ 545,
+/**/
+ 544,
+/**/
+ 543,
+/**/
+ 542,
+/**/
+ 541,
+/**/
+ 540,
+/**/
+ 539,
+/**/
+ 538,
+/**/
+ 537,
+/**/
+ 536,
+/**/
+ 535,
+/**/
+ 534,
+/**/
+ 533,
+/**/
+ 532,
+/**/
+ 531,
+/**/
+ 530,
+/**/
+ 529,
+/**/
+ 528,
+/**/
+ 527,
+/**/
+ 526,
+/**/
+ 525,
+/**/
+ 524,
+/**/
+ 523,
+/**/
+ 522,
+/**/
+ 521,
+/**/
+ 520,
+/**/
+ 519,
+/**/
+ 518,
+/**/
+ 517,
+/**/
+ 516,
+/**/
+ 515,
+/**/
+ 514,
+/**/
+ 513,
+/**/
+ 512,
+/**/
+ 511,
+/**/
+ 510,
+/**/
+ 509,
+/**/
+ 508,
+/**/
+ 507,
+/**/
+ 506,
+/**/
+ 505,
+/**/
+ 504,
+/**/
+ 503,
+/**/
+ 502,
+/**/
+ 501,
+/**/
+ 500,
+/**/
+ 499,
+/**/
+ 498,
+/**/
+ 497,
+/**/
+ 496,
+/**/
+ 495,
+/**/
+ 494,
+/**/
+ 493,
+/**/
+ 492,
+/**/
+ 491,
+/**/
+ 490,
+/**/
+ 489,
+/**/
+ 488,
+/**/
+ 487,
+/**/
+ 486,
+/**/
+ 485,
+/**/
+ 484,
+/**/
+ 483,
+/**/
+ 482,
+/**/
+ 481,
+/**/
+ 480,
+/**/
+ 479,
+/**/
+ 478,
+/**/
+ 477,
+/**/
+ 476,
+/**/
+ 475,
+/**/
+ 474,
+/**/
+ 473,
+/**/
+ 472,
+/**/
+ 471,
+/**/
+ 470,
+/**/
+ 469,
+/**/
+ 468,
+/**/
+ 467,
+/**/
+ 466,
+/**/
+ 465,
+/**/
+ 464,
+/**/
+ 463,
+/**/
+ 462,
+/**/
+ 461,
+/**/
+ 460,
+/**/
+ 459,
+/**/
+ 458,
+/**/
+ 457,
+/**/
+ 456,
+/**/
+ 455,
+/**/
+ 454,
+/**/
+ 453,
+/**/
+ 452,
+/**/
+ 451,
+/**/
+ 450,
+/**/
+ 449,
+/**/
+ 448,
+/**/
+ 447,
+/**/
+ 446,
+/**/
+ 445,
+/**/
+ 444,
+/**/
+ 443,
+/**/
+ 442,
+/**/
+ 441,
+/**/
+ 440,
+/**/
+ 439,
+/**/
+ 438,
+/**/
+ 437,
+/**/
+ 436,
+/**/
+ 435,
+/**/
+ 434,
+/**/
+ 433,
+/**/
+ 432,
+/**/
+ 431,
+/**/
+ 430,
+/**/
+ 429,
+/**/
+ 428,
+/**/
+ 427,
+/**/
+ 426,
+/**/
+ 425,
+/**/
+ 424,
+/**/
+ 423,
+/**/
+ 422,
+/**/
+ 421,
+/**/
+ 420,
+/**/
+ 419,
+/**/
+ 418,
+/**/
+ 417,
+/**/
+ 416,
+/**/
+ 415,
+/**/
+ 414,
+/**/
+ 413,
+/**/
+ 412,
+/**/
+ 411,
+/**/
+ 410,
+/**/
+ 409,
+/**/
+ 408,
+/**/
+ 407,
+/**/
+ 406,
+/**/
+ 405,
+/**/
+ 404,
+/**/
+ 403,
+/**/
+ 402,
+/**/
+ 401,
+/**/
+ 400,
+/**/
+ 399,
+/**/
+ 398,
+/**/
+ 397,
+/**/
+ 396,
+/**/
+ 395,
+/**/
+ 394,
+/**/
+ 393,
+/**/
+ 392,
+/**/
+ 391,
+/**/
+ 390,
+/**/
+ 389,
+/**/
+ 388,
+/**/
+ 387,
+/**/
+ 386,
+/**/
+ 385,
+/**/
+ 384,
+/**/
+ 383,
+/**/
+ 382,
+/**/
+ 381,
+/**/
+ 380,
+/**/
+ 379,
+/**/
+ 378,
+/**/
+ 377,
+/**/
+ 376,
+/**/
+ 375,
+/**/
+ 374,
+/**/
373,
/**/
372,
diff --git a/src/vim.h b/src/vim.h
index 01d377aeb..a3397b93c 100644
--- a/src/vim.h
+++ b/src/vim.h
@@ -134,6 +134,13 @@
# endif
#endif
+/* Check support for rendering options */
+#ifdef FEAT_GUI
+# if defined(FEAT_DIRECTX)
+# define FEAT_RENDER_OPTIONS
+# endif
+#endif
+
/* Visual Studio 2005 has 'deprecated' many of the standard CRT functions */
#if _MSC_VER >= 1400
# define _CRT_SECURE_NO_DEPRECATE
@@ -791,6 +798,7 @@ extern char *(*dyn_libintl_textdomain)(const char *domainname);
#define EXPAND_HISTORY 41
#define EXPAND_USER 42
#define EXPAND_SYNTIME 43
+#define EXPAND_USER_ADDR_TYPE 44
/* Values for exmode_active (0 is no exmode) */
#define EXMODE_NORMAL 1
@@ -828,6 +836,7 @@ extern char *(*dyn_libintl_textdomain)(const char *domainname);
#define EW_ICASE 0x100 /* ignore case */
#define EW_NOERROR 0x200 /* no error for bad regexp */
#define EW_NOTWILD 0x400 /* add match with literal name if exists */
+#define EW_KEEPDOLLAR 0x800 /* do not escape $, $var is expanded */
/* Note: mostly EW_NOTFOUND and EW_SILENT are mutually exclusive: EW_NOTFOUND
* is used when executing commands and EW_SILENT for interactive expanding. */
@@ -1319,6 +1328,7 @@ enum auto_event
EVENT_SHELLFILTERPOST, /* after ":1,2!cmd", ":w !cmd", ":r !cmd". */
EVENT_TEXTCHANGED, /* text was modified */
EVENT_TEXTCHANGEDI, /* text was modified in Insert mode*/
+ EVENT_CMDUNDEFINED, /* command undefined */
NUM_EVENTS /* MUST be the last one */
};
@@ -1995,7 +2005,7 @@ typedef int VimClipboard; /* This is required for the prototypes. */
#ifndef FEAT_VIRTUALEDIT
# define getvvcol(w, p, s, c, e) getvcol(w, p, s, c, e)
-# define virtual_active() 0
+# define virtual_active() FALSE
# define virtual_op FALSE
#endif
@@ -2274,7 +2284,7 @@ typedef int VimClipboard; /* This is required for the prototypes. */
#define AUTOLOAD_CHAR '#'
#ifdef FEAT_EVAL
-# define SET_NO_HLSEARCH(flag) no_hlsearch = (flag); set_vim_var_nr(VV_HLSEARCH, !no_hlsearch)
+# define SET_NO_HLSEARCH(flag) no_hlsearch = (flag); set_vim_var_nr(VV_HLSEARCH, !no_hlsearch && p_hls)
#else
# define SET_NO_HLSEARCH(flag) no_hlsearch = (flag)
#endif
diff --git a/src/window.c b/src/window.c
index f81f5527b..79c97d8a9 100644
--- a/src/window.c
+++ b/src/window.c
@@ -11,6 +11,7 @@
static int path_is_url __ARGS((char_u *p));
#if defined(FEAT_WINDOWS) || defined(PROTO)
+static void cmd_with_count __ARGS((char *cmd, char_u *bufp, size_t bufsize, long Prenum));
static void win_init __ARGS((win_T *newp, win_T *oldp, int flags));
static void win_init_some __ARGS((win_T *newp, win_T *oldp));
static void frame_comp_pos __ARGS((frame_T *topfrp, int *row, int *col));
@@ -167,10 +168,7 @@ do_window(nchar, Prenum, xchar)
case '^':
CHECK_CMDWIN
reset_VIsual_and_resel(); /* stop Visual mode */
- STRCPY(cbuf, "split #");
- if (Prenum)
- vim_snprintf((char *)cbuf + 7, sizeof(cbuf) - 7,
- "%ld", Prenum);
+ cmd_with_count("split #", cbuf, sizeof(cbuf), Prenum);
do_cmdline_cmd(cbuf);
break;
@@ -199,14 +197,16 @@ newwindow:
case Ctrl_Q:
case 'q':
reset_VIsual_and_resel(); /* stop Visual mode */
- do_cmdline_cmd((char_u *)"quit");
+ cmd_with_count("quit", cbuf, sizeof(cbuf), Prenum);
+ do_cmdline_cmd(cbuf);
break;
/* close current window */
case Ctrl_C:
case 'c':
reset_VIsual_and_resel(); /* stop Visual mode */
- do_cmdline_cmd((char_u *)"close");
+ cmd_with_count("close", cbuf, sizeof(cbuf), Prenum);
+ do_cmdline_cmd(cbuf);
break;
#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
@@ -235,7 +235,8 @@ newwindow:
case 'o':
CHECK_CMDWIN
reset_VIsual_and_resel(); /* stop Visual mode */
- do_cmdline_cmd((char_u *)"only");
+ cmd_with_count("only", cbuf, sizeof(cbuf), Prenum);
+ do_cmdline_cmd(cbuf);
break;
/* cursor to next window with wrap around */
@@ -479,14 +480,18 @@ newwindow:
case ']':
case Ctrl_RSB:
CHECK_CMDWIN
- reset_VIsual_and_resel(); /* stop Visual mode */
+ /* keep Visual mode, can select words to use as a tag */
if (Prenum)
postponed_split = Prenum;
else
postponed_split = -1;
+#ifdef FEAT_QUICKFIX
+ if (nchar != '}')
+ g_do_tagpreview = 0;
+#endif
- /* Execute the command right here, required when
- * "wincmd ]" was used in a function. */
+ /* Execute the command right here, required when "wincmd ]"
+ * was used in a function. */
do_nv_ident(Ctrl_RSB, NUL);
break;
@@ -590,7 +595,7 @@ wingotofile:
#endif
case ']':
case Ctrl_RSB:
- reset_VIsual_and_resel(); /* stop Visual mode */
+ /* keep Visual mode, can select words to use as a tag */
if (Prenum)
postponed_split = Prenum;
else
@@ -619,6 +624,20 @@ wingotofile:
}
}
+ static void
+cmd_with_count(cmd, bufp, bufsize, Prenum)
+ char *cmd;
+ char_u *bufp;
+ size_t bufsize;
+ long Prenum;
+{
+ size_t len = STRLEN(cmd);
+
+ STRCPY(bufp, cmd);
+ if (Prenum > 0)
+ vim_snprintf((char *)bufp + len, bufsize - len, "%ld", Prenum);
+}
+
/*
* split the current window, implements CTRL-W s and :split
*
@@ -684,7 +703,7 @@ win_split_ins(size, flags, new_wp, dir)
int available;
int oldwin_height = 0;
int layout;
- frame_T *frp, *curfrp;
+ frame_T *frp, *curfrp, *frp2, *prevfrp;
int before;
int minheight;
int wmh1;
@@ -730,12 +749,29 @@ win_split_ins(size, flags, new_wp, dir)
needed = wmw1 + 1;
if (flags & WSP_ROOM)
needed += p_wiw - wmw1;
- if (p_ea || (flags & (WSP_BOT | WSP_TOP)))
+ if (flags & (WSP_BOT | WSP_TOP))
{
minwidth = frame_minwidth(topframe, NOWIN);
available = topframe->fr_width;
needed += minwidth;
}
+ else if (p_ea)
+ {
+ minwidth = frame_minwidth(oldwin->w_frame, NOWIN);
+ prevfrp = oldwin->w_frame;
+ for (frp = oldwin->w_frame->fr_parent; frp != NULL;
+ frp = frp->fr_parent)
+ {
+ if (frp->fr_layout == FR_ROW)
+ for (frp2 = frp->fr_child; frp2 != NULL;
+ frp2 = frp2->fr_next)
+ if (frp2 != prevfrp)
+ minwidth += frame_minwidth(frp2, NOWIN);
+ prevfrp = frp;
+ }
+ available = topframe->fr_width;
+ needed += minwidth;
+ }
else
{
minwidth = frame_minwidth(oldwin->w_frame, NOWIN);
@@ -775,7 +811,7 @@ win_split_ins(size, flags, new_wp, dir)
if (frp->fr_win != oldwin && frp->fr_win != NULL
&& (frp->fr_win->w_width > new_size
|| frp->fr_win->w_width > oldwin->w_width
- - new_size - STATUS_HEIGHT))
+ - new_size - 1))
{
do_equal = TRUE;
break;
@@ -798,12 +834,29 @@ win_split_ins(size, flags, new_wp, dir)
needed = wmh1 + STATUS_HEIGHT;
if (flags & WSP_ROOM)
needed += p_wh - wmh1;
- if (p_ea || (flags & (WSP_BOT | WSP_TOP)))
+ if (flags & (WSP_BOT | WSP_TOP))
{
minheight = frame_minheight(topframe, NOWIN) + need_status;
available = topframe->fr_height;
needed += minheight;
}
+ else if (p_ea)
+ {
+ minheight = frame_minheight(oldwin->w_frame, NOWIN) + need_status;
+ prevfrp = oldwin->w_frame;
+ for (frp = oldwin->w_frame->fr_parent; frp != NULL;
+ frp = frp->fr_parent)
+ {
+ if (frp->fr_layout == FR_COL)
+ for (frp2 = frp->fr_child; frp2 != NULL;
+ frp2 = frp2->fr_next)
+ if (frp2 != prevfrp)
+ minheight += frame_minheight(frp2, NOWIN);
+ prevfrp = frp;
+ }
+ available = topframe->fr_height;
+ needed += minheight;
+ }
else
{
minheight = frame_minheight(oldwin->w_frame, NOWIN) + need_status;
@@ -1144,6 +1197,11 @@ win_split_ins(size, flags, new_wp, dir)
p_wh = size;
}
+#ifdef FEAT_JUMPLIST
+ /* Keep same changelist position in new window. */
+ wp->w_changelistidx = oldwin->w_changelistidx;
+#endif
+
/*
* make the new window the current window
*/
@@ -1232,7 +1290,7 @@ win_init(newp, oldp, flags)
}
/*
- * Initialize window "newp" from window"old".
+ * Initialize window "newp" from window "old".
* Only the essential things are copied.
*/
static void
@@ -4364,20 +4422,19 @@ win_enter_ext(wp, undo_sync, curwin_invalid, trigger_enter_autocmds, trigger_lea
buf_jump_open_win(buf)
buf_T *buf;
{
-# ifdef FEAT_WINDOWS
- win_T *wp;
+ win_T *wp = NULL;
- for (wp = firstwin; wp != NULL; wp = wp->w_next)
- if (wp->w_buffer == buf)
- break;
+ if (curwin->w_buffer == buf)
+ wp = curwin;
+# ifdef FEAT_WINDOWS
+ else
+ for (wp = firstwin; wp != NULL; wp = wp->w_next)
+ if (wp->w_buffer == buf)
+ break;
if (wp != NULL)
win_enter(wp, FALSE);
- return wp;
-# else
- if (curwin->w_buffer == buf)
- return curwin;
- return NULL;
# endif
+ return wp;
}
/*
@@ -4389,12 +4446,10 @@ buf_jump_open_win(buf)
buf_jump_open_tab(buf)
buf_T *buf;
{
+ win_T *wp = buf_jump_open_win(buf);
# ifdef FEAT_WINDOWS
- win_T *wp;
tabpage_T *tp;
- /* First try the current tab page. */
- wp = buf_jump_open_win(buf);
if (wp != NULL)
return wp;
@@ -4412,13 +4467,8 @@ buf_jump_open_tab(buf)
break;
}
}
-
- return wp;
-# else
- if (curwin->w_buffer == buf)
- return curwin;
- return NULL;
# endif
+ return wp;
}
#endif
@@ -6623,8 +6673,8 @@ restore_snapshot_rec(sn, fr)
|| defined(PROTO)
/*
* Set "win" to be the curwin and "tp" to be the current tab page.
- * restore_win() MUST be called to undo.
- * No autocommands will be executed.
+ * restore_win() MUST be called to undo, also when FAIL is returned.
+ * No autocommands will be executed until restore_win() is called.
* When "no_display" is TRUE the display won't be affected, no redraw is
* triggered, another tabpage access is limited.
* Returns FAIL if switching to "win" failed.
@@ -6657,12 +6707,7 @@ switch_win(save_curwin, save_curtab, win, tp, no_display)
goto_tabpage_tp(tp, FALSE, FALSE);
}
if (!win_valid(win))
- {
-# ifdef FEAT_AUTOCMD
- unblock_autocmds();
-# endif
return FAIL;
- }
curwin = win;
curbuf = curwin->w_buffer;
# endif