Mercurial > vim
annotate src/README.md @ 23268:65fd662b434d v8.2.2180
patch 8.2.2180: Vim9: test for error after error is flaky
Commit: https://github.com/vim/vim/commit/6f17a3f0237302b82cc31fb889d9094b51856948
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Dec 21 18:11:24 2020 +0100
patch 8.2.2180: Vim9: test for error after error is flaky
Problem: Vim9: test for error after error is flaky.
Solution: Wait for job to finish instead of a fixed delay.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 21 Dec 2020 18:15:04 +0100 |
parents | b32b67a108f2 |
children | 7bc92a651472 |
rev | line source |
---|---|
16129
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1 ![Vim Logo](https://github.com/vim/vim/blob/master/runtime/vimlogo.gif) |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3 # Vim source code # |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
5 Here are a few hints for finding your way around the source code. This |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
6 doesn't make it less complex than it is, but it gets you started. |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
7 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
8 You might also want to read |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
9 [`:help development`](http://vimdoc.sourceforge.net/htmldoc/develop.html#development). |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
10 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
11 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
12 ## Jumping around ## |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
13 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
14 First of all, use `:make tags` to generate a tags file, so that you can jump |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
15 around in the source code. |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
16 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
17 To jump to a function or variable definition, move the cursor on the name and |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
18 use the `CTRL-]` command. Use `CTRL-T` or `CTRL-O` to jump back. |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
19 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
20 To jump to a file, move the cursor on its name and use the `gf` command. |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
21 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
22 Most code can be found in a file with an obvious name (incomplete list): |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
23 |
17377
cb008de2a6ec
patch 8.1.1687: the evalfunc.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
17370
diff
changeset
|
24 File name | Description |
cb008de2a6ec
patch 8.1.1687: the evalfunc.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
17370
diff
changeset
|
25 --------------- | ----------- |
17744
4a3dca734d36
patch 8.1.1869: code for the argument list is spread out
Bram Moolenaar <Bram@vim.org>
parents:
17652
diff
changeset
|
26 arglist.c | handling argument list |
16129
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
27 autocmd.c | autocommands |
17652
9efb4dda9720
patch 8.1.1823: command line history code is spread out
Bram Moolenaar <Bram@vim.org>
parents:
17576
diff
changeset
|
28 blob.c | blob data type |
16129
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
29 buffer.c | manipulating buffers (loaded files) |
18199
e2be5a6485f5
patch 8.1.2094: the fileio.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
18174
diff
changeset
|
30 bufwrite.c | writing a buffer to file |
16632
30de89c1d090
patch 8.1.1318: code for text changes is in a "misc" file
Bram Moolenaar <Bram@vim.org>
parents:
16411
diff
changeset
|
31 change.c | handling changes to text |
18265
fe5afdc03bd2
patch 8.1.2127: the indent.c file is a bit big
Bram Moolenaar <Bram@vim.org>
parents:
18199
diff
changeset
|
32 cindent.c | C and Lisp indentation |
19920
5e41b2e63c73
patch 8.2.0516: client-server code is spread out
Bram Moolenaar <Bram@vim.org>
parents:
19774
diff
changeset
|
33 clientserver.c | client server functionality |
19774
00a1b89256ea
patch 8.2.0443: clipboard code is spread out
Bram Moolenaar <Bram@vim.org>
parents:
19396
diff
changeset
|
34 clipboard.c | handling the clipboard |
17779
87a8760babec
patch 8.1.1886: command line expansion code is spread out
Bram Moolenaar <Bram@vim.org>
parents:
17744
diff
changeset
|
35 cmdexpand.c | command-line completion |
17652
9efb4dda9720
patch 8.1.1823: command line history code is spread out
Bram Moolenaar <Bram@vim.org>
parents:
17576
diff
changeset
|
36 cmdhist.c | command-line history |
16391
3fc956fc63b6
patch 8.1.1200: old style comments in debugger source
Bram Moolenaar <Bram@vim.org>
parents:
16186
diff
changeset
|
37 debugger.c | vim script debugger |
16129
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
38 diff.c | diff mode (vimdiff) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
18100
diff
changeset
|
39 drawline.c | drawing a window line |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
18100
diff
changeset
|
40 drawscreen.c | drawing the windows |
16129
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
41 eval.c | expression evaluation |
18010
cf8e0c7e0cb9
patch 8.1.2001: some source files are too big
Bram Moolenaar <Bram@vim.org>
parents:
17966
diff
changeset
|
42 evalbuffer.c | buffer related built-in functions |
16411
5b5c5daf57de
patch 8.1.1210: support for user commands is spread out
Bram Moolenaar <Bram@vim.org>
parents:
16407
diff
changeset
|
43 evalfunc.c | built-in functions |
17873
d50a5faa75bd
patch 8.1.1933: the eval.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
17861
diff
changeset
|
44 evalvars.c | vim variables |
18010
cf8e0c7e0cb9
patch 8.1.2001: some source files are too big
Bram Moolenaar <Bram@vim.org>
parents:
17966
diff
changeset
|
45 evalwindow.c | window related built-in functions |
16129
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
46 fileio.c | reading and writing files |
17966
46f95606b9ec
patch 8.1.1979: code for handling file names is spread out
Bram Moolenaar <Bram@vim.org>
parents:
17873
diff
changeset
|
47 filepath.c | dealing with file names and paths |
16129
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
48 findfile.c | search for files in 'path' |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
49 fold.c | folding |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
50 getchar.c | getting characters and key mapping |
21423
5db63c2c6929
patch 8.2.1262: src/ex_cmds.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
21054
diff
changeset
|
51 help.c | vim help related functions |
17389
635d7f5010b8
patch 8.1.1693: syntax coloring and highlighting is in one big file
Bram Moolenaar <Bram@vim.org>
parents:
17377
diff
changeset
|
52 highlight.c | syntax highlighting |
18265
fe5afdc03bd2
patch 8.1.2127: the indent.c file is a bit big
Bram Moolenaar <Bram@vim.org>
parents:
18199
diff
changeset
|
53 indent.c | text indentation |
16186
e12336bb8ced
patch 8.1.1098: quickfix code duplication
Bram Moolenaar <Bram@vim.org>
parents:
16129
diff
changeset
|
54 insexpand.c | Insert mode completion |
21437
b32b67a108f2
patch 8.2.1269: language and locale code spread out
Bram Moolenaar <Bram@vim.org>
parents:
21423
diff
changeset
|
55 locale.c | locale/language handling |
21054
b1fac55cf8a3
patch 8.2.1078: highlight and match functionality together in one file
Bram Moolenaar <Bram@vim.org>
parents:
20587
diff
changeset
|
56 map.c | mapping and abbreviations |
16129
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
57 mark.c | marks |
21054
b1fac55cf8a3
patch 8.2.1078: highlight and match functionality together in one file
Bram Moolenaar <Bram@vim.org>
parents:
20587
diff
changeset
|
58 match.c | highlight matching |
16129
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
59 mbyte.c | multi-byte character handling |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
60 memfile.c | storing lines for buffers in a swapfile |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
61 memline.c | storing lines for buffers in memory |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
62 menu.c | menus |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
63 message.c | (error) messages |
18135
1868ec23360e
patch 8.1.2062: the mouse code is spread out
Bram Moolenaar <Bram@vim.org>
parents:
18124
diff
changeset
|
64 mouse.c | handling the mouse |
16411
5b5c5daf57de
patch 8.1.1210: support for user commands is spread out
Bram Moolenaar <Bram@vim.org>
parents:
16407
diff
changeset
|
65 ops.c | handling operators ("d", "y", "p") |
16129
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
66 option.c | options |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
18010
diff
changeset
|
67 optionstr.c | handling string options |
18174
1ec6539cef68
patch 8.1.2082: some files have a weird name to fit in 8.3 characters
Bram Moolenaar <Bram@vim.org>
parents:
18172
diff
changeset
|
68 popupmenu.c | popup menu |
17377
cb008de2a6ec
patch 8.1.1687: the evalfunc.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
17370
diff
changeset
|
69 popupwin.c | popup window |
17370
ba06a1c42274
patch 8.1.1684: profiling functionality is spread out
Bram Moolenaar <Bram@vim.org>
parents:
16632
diff
changeset
|
70 profiler.c | vim script profiler |
16129
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
71 quickfix.c | quickfix commands (":make", ":cn") |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
72 regexp.c | pattern matching |
18164
f57481564f2c
patch 8.1.2077: the ops.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
18135
diff
changeset
|
73 register.c | handling registers |
17861
0a5c615cd949
patch 8.1.1927: code for dealing with script files is spread out
Bram Moolenaar <Bram@vim.org>
parents:
17779
diff
changeset
|
74 scriptfile.c | runtime directory handling and sourcing scripts |
18135
1868ec23360e
patch 8.1.2062: the mouse code is spread out
Bram Moolenaar <Bram@vim.org>
parents:
18124
diff
changeset
|
75 screen.c | lower level screen functions |
16129
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
76 search.c | pattern searching |
17536
e00d12c085a5
patch 8.1.1766: code for writing session file is spread out
Bram Moolenaar <Bram@vim.org>
parents:
17464
diff
changeset
|
77 session.c | sessions and views |
16129
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
78 sign.c | signs |
18172
6e53d83e021d
patch 8.1.2081: the spell.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
18164
diff
changeset
|
79 spell.c | spell checking core |
6e53d83e021d
patch 8.1.2081: the spell.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
18164
diff
changeset
|
80 spellfile.c | spell file handling |
6e53d83e021d
patch 8.1.2081: the spell.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
18164
diff
changeset
|
81 spellsuggest.c | spell correction suggestions |
17370
ba06a1c42274
patch 8.1.1684: profiling functionality is spread out
Bram Moolenaar <Bram@vim.org>
parents:
16632
diff
changeset
|
82 syntax.c | syntax and other highlighting |
16411
5b5c5daf57de
patch 8.1.1210: support for user commands is spread out
Bram Moolenaar <Bram@vim.org>
parents:
16407
diff
changeset
|
83 tag.c | tags |
16129
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
84 term.c | terminal handling, termcap codes |
17377
cb008de2a6ec
patch 8.1.1687: the evalfunc.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
17370
diff
changeset
|
85 testing.c | testing: assert and test functions |
20237
918245588b50
patch 8.2.0674: some source files are too big
Bram Moolenaar <Bram@vim.org>
parents:
20209
diff
changeset
|
86 textformat.c | text formatting |
20209
6ca6a372fef6
patch 8.2.0660: the search.c file is a bit big
Bram Moolenaar <Bram@vim.org>
parents:
19920
diff
changeset
|
87 textobject.c | text objects |
17377
cb008de2a6ec
patch 8.1.1687: the evalfunc.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
17370
diff
changeset
|
88 textprop.c | text properties |
19396
a961efb326e5
patch 8.2.0256: time and timer related code is spread out
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
89 time.c | time and timer functions |
20587
f502455965c0
patch 8.2.0847: typval related code is spread out
Bram Moolenaar <Bram@vim.org>
parents:
20237
diff
changeset
|
90 typval.c | vim script type/value functions |
16129
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
91 undo.c | undo and redo |
16411
5b5c5daf57de
patch 8.1.1210: support for user commands is spread out
Bram Moolenaar <Bram@vim.org>
parents:
16407
diff
changeset
|
92 usercmd.c | user defined commands |
5b5c5daf57de
patch 8.1.1210: support for user commands is spread out
Bram Moolenaar <Bram@vim.org>
parents:
16407
diff
changeset
|
93 userfunc.c | user defined functions |
17464
3e708b5c0509
patch 8.1.1730: wrong place for mark viminfo support
Bram Moolenaar <Bram@vim.org>
parents:
17389
diff
changeset
|
94 viminfo.c | viminfo handling |
16129
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
95 window.c | handling split windows |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
96 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
97 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
98 ## Debugging ## |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
99 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
100 If you have a reasonable recent version of gdb, you can use the `:Termdebug` |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
101 command to debug Vim. See `:help :Termdebug`. |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
102 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
103 When something is time critical or stepping through code is a hassle, use the |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
104 channel logging to create a time-stamped log file. Add lines to the code like |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
105 this: |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
106 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
107 ch_log(NULL, "Value is now %02x", value); |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
108 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
109 After compiling and starting Vim, do: |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
110 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
111 :call ch_logfile('debuglog', 'w') |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
112 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
113 And edit `debuglog` to see what happens. The channel functions already have |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
114 `ch_log()` calls, thus you always see that in the log. |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
115 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
116 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
117 ## Important Variables ## |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
118 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
119 The current mode is stored in `State`. The values it can have are `NORMAL`, |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
120 `INSERT`, `CMDLINE`, and a few others. |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
121 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
122 The current window is `curwin`. The current buffer is `curbuf`. These point |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
123 to structures with the cursor position in the window, option values, the file |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
124 name, etc. These are defined in |
16407
cbb6e28af4cb
patch 8.1.1208: links to repository use wrong file name
Bram Moolenaar <Bram@vim.org>
parents:
16391
diff
changeset
|
125 [`structs.h`](https://github.com/vim/vim/blob/master/src/structs.h). |
16129
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
126 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
127 All the global variables are declared in |
16407
cbb6e28af4cb
patch 8.1.1208: links to repository use wrong file name
Bram Moolenaar <Bram@vim.org>
parents:
16391
diff
changeset
|
128 [`globals.h`](https://github.com/vim/vim/blob/master/src/globals.h). |
16129
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
129 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
130 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
131 ## The main loop ## |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
132 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
133 This is conveniently called `main_loop()`. It updates a few things and then |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
134 calls `normal_cmd()` to process a command. This returns when the command is |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
135 finished. |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
136 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
137 The basic idea is that Vim waits for the user to type a character and |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
138 processes it until another character is needed. Thus there are several places |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
139 where Vim waits for a character to be typed. The `vgetc()` function is used |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
140 for this. It also handles mapping. |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
141 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
142 Updating the screen is mostly postponed until a command or a sequence of |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
143 commands has finished. The work is done by `update_screen()`, which calls |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
144 `win_update()` for every window, which calls `win_line()` for every line. |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
145 See the start of |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
146 [`screen.c`](https://github.com/vim/vim/blob/master/src/screen.c) |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
147 for more explanations. |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
148 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
149 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
150 ## Command-line mode ## |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
151 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
152 When typing a `:`, `normal_cmd()` will call `getcmdline()` to obtain a line |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
153 with an Ex command. `getcmdline()` contains a loop that will handle each typed |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
154 character. It returns when hitting `CR` or `Esc` or some other character that |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
155 ends the command line mode. |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
156 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
157 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
158 ## Ex commands ## |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
159 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
160 Ex commands are handled by the function `do_cmdline()`. It does the generic |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
161 parsing of the `:` command line and calls `do_one_cmd()` for each separate |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
162 command. It also takes care of while loops. |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
163 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
164 `do_one_cmd()` parses the range and generic arguments and puts them in the |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
165 `exarg_t` and passes it to the function that handles the command. |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
166 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
167 The `:` commands are listed in `ex_cmds.h`. The third entry of each item is |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
168 the name of the function that handles the command. The last entry are the |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
169 flags that are used for the command. |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
170 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
171 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
172 ## Normal mode commands ## |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
173 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
174 The Normal mode commands are handled by the `normal_cmd()` function. It also |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
175 handles the optional count and an extra character for some commands. These |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
176 are passed in a `cmdarg_t` to the function that handles the command. |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
177 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
178 There is a table `nv_cmds` in |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
179 [`normal.c`](https://github.com/vim/vim/blob/master/src/normal.c) |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
180 which lists the first character of every command. The second entry of each |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
181 item is the name of the function that handles the command. |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
182 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
183 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
184 ## Insert mode commands ## |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
185 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
186 When doing an `i` or `a` command, `normal_cmd()` will call the `edit()` |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
187 function. It contains a loop that waits for the next character and handles it. |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
188 It returns when leaving Insert mode. |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
189 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
190 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
191 ## Options ## |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
192 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
193 There is a list with all option names in |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
194 [`option.c`](https://github.com/vim/vim/blob/master/src/option.c), |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
195 called `options[]`. |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
196 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
197 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
198 ## The GUI ## |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
199 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
200 Most of the GUI code is implemented like it was a clever terminal. Typing a |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
201 character, moving a scrollbar, clicking the mouse, etc. are all translated |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
202 into events which are written in the input buffer. These are read by the |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
203 main code, just like reading from a terminal. The code for this is scattered |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
204 through [`gui.c`](https://github.com/vim/vim/blob/master/src/gui.c). |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
205 For example, `gui_send_mouse_event()` for a mouse click and `gui_menu_cb()` for |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
206 a menu action. Key hits are handled by the system-specific GUI code, which |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
207 calls `add_to_input_buf()` to send the key code. |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
208 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
209 Updating the GUI window is done by writing codes in the output buffer, just |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
210 like writing to a terminal. When the buffer gets full or is flushed, |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
211 `gui_write()` will parse the codes and draw the appropriate items. Finally the |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
212 system-specific GUI code will be called to do the work. |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
213 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
214 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
215 ## Debugging the GUI ## |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
216 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
217 Remember to prevent that gvim forks and the debugger thinks Vim has exited, |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
218 add the `-f` argument. In gdb: `run -f -g`. |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
219 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
220 When stepping through display updating code, the focus event is triggered |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
221 when going from the debugger to Vim and back. To avoid this, recompile with |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
222 some code in `gui_focus_change()` disabled. |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
223 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
224 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
225 ## Contributing ## |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
226 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
227 If you would like to help making Vim better, see the |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
228 [`CONTRIBUTING.md`](https://github.com/vim/vim/blob/master/CONTRIBUTING.md) |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
229 file. |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
230 |
52ae47071830
patch 8.1.1069: source README file doesn't look nice on github
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
231 |
18879 | 232 This is `README.md` for version 8.2 of the Vim source code. |