Mercurial > vim
comparison runtime/doc/diff.txt @ 26743:c2c40cefc17b v8.2.3900
patch 8.2.3900: it is not easy to use a script-local function for an option
Commit: https://github.com/vim/vim/commit/8bb65f230d3025037f34021a72616038da0601ee
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Sun Dec 26 10:51:39 2021 +0000
patch 8.2.3900: it is not easy to use a script-local function for an option
Problem: It is not easy to use a script-local function for an option.
Solution: recognize s: and <SID> at the start of the expression. (Yegappan
Lakshmanan, closes #9401)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 26 Dec 2021 12:00:04 +0100 |
parents | e69e7133c9cf |
children | 3649b5a6b1b6 |
comparison
equal
deleted
inserted
replaced
26742:00732e690ee8 | 26743:c2c40cefc17b |
---|---|
396 mode, so that a CTRL-Z doesn't end the text on DOS. | 396 mode, so that a CTRL-Z doesn't end the text on DOS. |
397 | 397 |
398 The `redraw!` command may not be needed, depending on whether executing a | 398 The `redraw!` command may not be needed, depending on whether executing a |
399 shell command shows something on the display or not. | 399 shell command shows something on the display or not. |
400 | 400 |
401 If the 'diffexpr' expression starts with s: or |<SID>|, then it is replaced | |
402 with the script ID (|local-function|). Example: > | |
403 set diffexpr=s:MyDiffExpr() | |
404 set diffexpr=<SID>SomeDiffExpr() | |
405 < | |
401 *E810* *E97* | 406 *E810* *E97* |
402 Vim will do a test if the diff output looks alright. If it doesn't, you will | 407 Vim will do a test if the diff output looks alright. If it doesn't, you will |
403 get an error message. Possible causes: | 408 get an error message. Possible causes: |
404 - The "diff" program cannot be executed. | 409 - The "diff" program cannot be executed. |
405 - The "diff" program doesn't produce normal "ed" style diffs (see above). | 410 - The "diff" program doesn't produce normal "ed" style diffs (see above). |
447 Vim will change directory to "/tmp" or another temp directory before | 452 Vim will change directory to "/tmp" or another temp directory before |
448 evaluating 'patchexpr'. This hopefully avoids that files in the current | 453 evaluating 'patchexpr'. This hopefully avoids that files in the current |
449 directory are accidentally patched. Vim will also delete files starting with | 454 directory are accidentally patched. Vim will also delete files starting with |
450 v:fname_in and ending in ".rej" and ".orig". | 455 v:fname_in and ending in ".rej" and ".orig". |
451 | 456 |
457 If the 'patchexpr' expression starts with s: or |<SID>|, then it is replaced | |
458 with the script ID (|local-function|). Example: > | |
459 set patchexpr=s:MyPatchExpr() | |
460 set patchexpr=<SID>SomePatchExpr() | |
461 < | |
452 vim:tw=78:ts=8:noet:ft=help:norl: | 462 vim:tw=78:ts=8:noet:ft=help:norl: |