Mercurial > vim
annotate runtime/doc/os_unix.txt @ 33674:021e5bb88513 v9.0.2074
patch 9.0.2074: Completion menu may be wrong
Commit: https://github.com/vim/vim/commit/daef8c74375141974d61b85199b383017644978c
Author: Christian Brabandt <cb@256bit.org>
Date: Fri Oct 27 19:16:26 2023 +0200
patch 9.0.2074: Completion menu may be wrong
Problem: Completion menu may be wrong
Solution: Check for the original direction of the completion menu,
add more tests, make it work with 'noselect'
completion: move in right direction when filling completion_info()
When moving through the insert completion menu and switching directions,
we need to make sure we start at the correct position in the list and
move correctly forward/backwards through it, so that we do not skip
entries and the selected item points to the correct entry in the list
of completion entries generated by the completion_info() function.
The general case is this:
1) CTRL-X CTRL-N, we will traverse the list starting from
compl_first_match and then go forwards (using the cp->next pointer)
through the list (skipping the very first entry, which has the
CP_ORIGINAL_TEXT flag set (since that is the empty/non-selected entry
2) CTRL-X CTRL-P, we will traverse the list starting from
compl_first_match (which now points to the last entry). The previous
entry will have the CP_ORIGINAL_TEXT flag set, so we need to start
traversing the list from the second prev pointer.
There are in fact 2 special cases after starting the completion menu
with CTRL-X:
3) CTRL-N and then going backwards by pressing CTRL-P again.
compl_first_match will point to the same entry as in step 1 above,
but since compl_dir_foward() has been switched by pressing CTRL-P
to backwards we need to pretend to be in still in case 1 and still
traverse the list in forward direction using the cp_next pointer
4) CTRL-P and then going forwards by pressing CTRL-N again.
compl_first_match will point to the same entry as in step 2 above,
but since compl_dir_foward() has been switched by pressing CTRL-N
to forwards we need to pretend to be in still in case 2 and still
traverse the list in backward direction using the cp_prev pointer
For the 'noselect' case however, this is slightly different again. When
going backwards, we only need to go one cp_prev pointer back. And
resting of the direction works again slightly different. So we need to
take the noselect option into account when deciding in which direction
to iterate through the list of matches.
related: #13402
related: #12971
closes: #13408
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 27 Oct 2023 19:30:05 +0200 |
parents | 15c80d8bc515 |
children | 4635e43f2c6f |
rev | line source |
---|---|
31383 | 1 *os_unix.txt* For Vim version 9.0. Last change: 2022 Nov 25 |
7 | 2 |
3 | |
4 VIM REFERENCE MANUAL by Bram Moolenaar | |
5 | |
6 | |
7 *unix* *Unix* | |
8 This file contains the particularities for the Unix version of Vim. | |
9 | |
10 For compiling Vim on Unix see "INSTALL" and "Makefile" in the src directory. | |
11 | |
12 The default help file name is "/usr/local/lib/vim/help.txt" | |
13 The files "$HOME/.vimrc" and "$HOME/.exrc" are used instead of "s:.vimrc" and | |
237 | 14 "s:.exrc". Additionally "/usr/local/etc/vimrc" is used first. |
7 | 15 If "/usr/local/share" exists it is used instead of "/usr/local/lib". |
16 | |
17 Temporary files (for filtering) are put in "/tmp". If you want to place them | |
18 somewhere else, set the environment variable $TMPDIR to the directory you | |
19 prefer. | |
20 | |
21 With wildcard expansion you can use '~' (home directory) and '$' | |
22 (environment variable). | |
23 | |
24 *fork* *spoon* | |
25 For executing external commands fork()/exec() is used when possible, otherwise | |
26 system() is used, which is a bit slower. The output of ":version" includes | |
27 |+fork| when fork()/exec() is used, |+system()| when system() is used. This | |
28 can be changed at compile time. | |
237 | 29 (For forking of the GUI version see |gui-fork|.) |
7 | 30 |
31229
5b71c3884a2a
patch 9.0.0948: 'ttyfast' is set for arbitrary terminals
Bram Moolenaar <Bram@vim.org>
parents:
29314
diff
changeset
|
31 For historic reasons terminal updating under Unix is expected to be slow (e.g. |
5b71c3884a2a
patch 9.0.0948: 'ttyfast' is set for arbitrary terminals
Bram Moolenaar <Bram@vim.org>
parents:
29314
diff
changeset
|
32 serial line terminal, shell window in suntools), the 'showcmd' and 'ruler' |
5b71c3884a2a
patch 9.0.0948: 'ttyfast' is set for arbitrary terminals
Bram Moolenaar <Bram@vim.org>
parents:
29314
diff
changeset
|
33 options are off by default. If you have a fast terminal, try setting them |
5b71c3884a2a
patch 9.0.0948: 'ttyfast' is set for arbitrary terminals
Bram Moolenaar <Bram@vim.org>
parents:
29314
diff
changeset
|
34 on: > |
5b71c3884a2a
patch 9.0.0948: 'ttyfast' is set for arbitrary terminals
Bram Moolenaar <Bram@vim.org>
parents:
29314
diff
changeset
|
35 set showcmd ruler |
7 | 36 |
37 When using Vim in an xterm the mouse clicks can be used by Vim by setting | |
237 | 38 'mouse' to "a". If there is access to an X-server gui style copy/paste will |
7 | 39 be used and visual feedback will be provided while dragging with the mouse. |
40 If you then still want the xterm copy/paste with the mouse, press the shift | |
41 key when using the mouse. See |mouse-using|. Visual feedback while dragging | |
42 can also be achieved via the 'ttymouse' option if your xterm is new enough. | |
43 | |
44 *terminal-colors* | |
45 To use colors in Vim you can use the following example (if your terminal | |
46 supports colors, but "T_Co" is empty or zero): > | |
47 :set t_me=^[[0;1;36m " normal mode (undoes t_mr and t_md) | |
48 :set t_mr=^[[0;1;33;44m " reverse (invert) mode | |
49 :set t_md=^[[1;33;41m " bold mode | |
50 :set t_se=^[[1;36;40m " standout end | |
51 :set t_so=^[[1;32;45m " standout mode | |
52 :set t_ue=^[[0;1;36m " underline end | |
53 :set t_us=^[[1;32m " underline mode start | |
54 [the ^[ is an <Esc>, type CTRL-V <Esc> to enter it] | |
55 | |
56 For real color terminals the ":highlight" command can be used. | |
57 | |
231 | 58 The file "tools/vim132" is a shell script that can be used to put Vim in 132 |
7 | 59 column mode on a vt100 and lookalikes. |
60 | |
14421 | 61 vim:tw=78:ts=8:noet:ft=help:norl: |