brammool patch 8.1.0535: increment/decrement might get interrupted by updating…
… folds

Problem:    Increment/decrement might get interrupted by updating folds.
Solution:   Disable fold updating for a moment. (Christian Brabandt,
            closes #3599)
Latest commit 6b73188 Nov 17, 2018
Permalink
..
Failed to load latest commit information.
GvimExt patch 8.1.0492: "Edit with existing Vim" list can get long Oct 25, 2018
VisVim patch 7.4.1883 Jun 2, 2016
auto patch 8.1.0379: build dependencies are incomplete Sep 13, 2018
if_perl_msvc patch 7.4.1011 Dec 31, 2015
libvterm patch 8.1.0379: build dependencies are incomplete Sep 13, 2018
os_mac_rsrc updated for version 7.0d01 Apr 11, 2006
po Update runtime files. Nov 16, 2018
proto patch 8.1.0523: opening window from quickfix leaves empty buffer behind Nov 11, 2018
tee patch 8.1.0500: cleaning up in src/tee may not always work Oct 28, 2018
testdir patch 8.1.0533: screendump tests can be flaky Nov 16, 2018
xdiff patch 8.1.0432: compiler warning for signed/unsigned Sep 25, 2018
xpm patch 7.4.2135 Jul 31, 2016
xxd patch 8.0.1658: capitalize argument not available in long form Apr 3, 2018
INSTALL patch 8.1.0528: various typos in comments Nov 16, 2018
INSTALLami.txt updated for version 7.0001 Jun 13, 2004
INSTALLmac.txt patch 7.4.1043 Jan 3, 2016
INSTALLpc.txt patch 8.1.0408: MSVC: cannot use the "x64" native compiler option Sep 18, 2018
INSTALLvms.txt updated for version 7.3.925 May 6, 2013
INSTALLx.txt First step in the Vim 7.3 branch. Changed version numbers. May 15, 2010
Make_all.mak patch 8.1.0516: :move command marks buffer modified when nothing changed Nov 10, 2018
Make_bc5.mak patch 8.1.0474: directory where if_perl.c is written is inconsistent Oct 14, 2018
Make_cyg.mak patch 8.0.1141: MS-Windows build dependencies are incomplete Sep 23, 2017
Make_cyg_ming.mak patch 8.1.0490: MS-Windows: doesn't handle missing glibwinpthread-1.dll Oct 21, 2018
Make_dice.mak patch 7.4.2069 Jul 19, 2016
Make_dvc.mak updated for version 7.0001 Jun 13, 2004
Make_ivc.mak patch 8.1.0084: user name completion does not work on MS-Windows Jun 19, 2018
Make_manx.mak patch 7.4.2069 Jul 19, 2016
Make_ming.mak patch 8.0.1141: MS-Windows build dependencies are incomplete Sep 23, 2017
Make_mint.mak updated for version 7.2a Jun 24, 2008
Make_morph.mak patch 7.4.2069 Jul 19, 2016
Make_mvc.mak patch 8.1.0525: terminal test skips part on Windows Nov 12, 2018
Make_sas.mak patch 7.4.2069 Jul 19, 2016
Make_vms.mms patch 8.0.1312: balloon_show() only works in terminal when compiled w… Nov 18, 2017
Makefile patch 8.1.0419: Cygwin: running cproto fails with -O2 Sep 21, 2018
README.txt patch 8.0.1550: various small problems in source files Feb 27, 2018
alloc.h patch 8.1.0519: cannot save and restore the tag stack Nov 11, 2018
appveyor.bat patch 7.4.2311 Sep 2, 2016
arabic.c patch 8.1.0443: unnecessary static function prototypes Sep 30, 2018
arabic.h patch 7.4.2293 Aug 29, 2016
ascii.h patch 7.4.2293 Aug 29, 2016
beval.c patch 8.1.0444: unnecessary check for NULL pointer Oct 2, 2018
beval.h patch 8.1.0105: all tab stops are the same Jun 23, 2018
bigvim.bat patch 8.0.1385: Python 3.5 is getting old Dec 10, 2017
bigvim64.bat patch 7.4.2302 Sep 1, 2016
blowfish.c patch 8.1.0443: unnecessary static function prototypes Sep 30, 2018
buffer.c patch 8.1.0515: reloading a script gives errors for existing functions Nov 10, 2018
channel.c patch 8.1.0486: can't build in MS-Windows Oct 19, 2018
charset.c patch 8.1.0443: unnecessary static function prototypes Sep 30, 2018
config.h.in patch 8.1.0371: argument types for select() may be wrong Sep 12, 2018
config.mk.dist patch 8.0.0573: running parallel make after distclean fails Apr 20, 2017
config.mk.in patch 8.0.1699: leftover stuff for Python 1.4 Apr 11, 2018
configure updated for version 7.0-047 Aug 8, 2006
configure.ac patch 8.1.0379: build dependencies are incomplete Sep 13, 2018
create_cmdidxs.vim patch 8.0.0572: building the command table requires Perl Apr 20, 2017
crypt.c patch 8.0.1496: clearing a pointer takes two lines Feb 10, 2018
crypt_zip.c patch 8.1.0443: unnecessary static function prototypes Sep 30, 2018
dehqx.py patch 8.0.1648: resource fork tool doesn't work on Python 3 Mar 27, 2018
dict.c patch 8.1.0519: cannot save and restore the tag stack Nov 11, 2018
diff.c patch 8.1.0513: no error for set diffopt+=algorithm: Nov 5, 2018
digraph.c patch 8.1.0443: unnecessary static function prototypes Sep 30, 2018
dimm.idl updated for version 7.0001 Jun 13, 2004
dlldata.c updated for version 7.0001 Jun 13, 2004
dosinst.c patch 8.1.0534: MS-Windows installer uses different $HOME than Vim Nov 16, 2018
dosinst.h patch 8.0.1191: MS-Windows: missing 32 and 64 bit files in installer Oct 14, 2017
edit.c patch 8.1.0504: when CTRL-C is mapped it triggers InsertLeave Nov 2, 2018
eval.c patch 8.1.0495: :filter only supports some commands Oct 25, 2018
evalfunc.c patch 8.1.0521: cannot build with +eval but without +quickfix Nov 11, 2018
ex_cmdidxs.h patch 8.1.0487: no menus specifically for the terminal window Oct 19, 2018
ex_cmds.c patch 8.1.0516: :move command marks buffer modified when nothing changed Nov 10, 2018
ex_cmds.h patch 8.1.0487: no menus specifically for the terminal window Oct 19, 2018
ex_cmds2.c patch 8.1.0515: reloading a script gives errors for existing functions Nov 10, 2018
ex_docmd.c patch 8.1.0487: no menus specifically for the terminal window Oct 19, 2018
ex_eval.c patch 8.1.0443: unnecessary static function prototypes Sep 30, 2018
ex_getln.c patch 8.1.0499: :2vimgrep causes an ml_get error Oct 28, 2018
farsi.c patch 8.0.0544: cppcheck warnings Apr 7, 2017
farsi.h patch 7.4.2293 Aug 29, 2016
feature.h patch 8.1.0281: parsing command modifiers is not separated Aug 14, 2018
fileio.c patch 8.1.0528: various typos in comments Nov 16, 2018
fold.c patch 8.1.0527: using 'shiftwidth' from wrong buffer for folding Nov 14, 2018
getchar.c patch 8.1.0466: autocmd test fails Oct 7, 2018
glbl_ime.cpp patch 7.4.2293 Aug 29, 2016
glbl_ime.h patch 7.4.2293 Aug 29, 2016
globals.h patch 8.1.0515: reloading a script gives errors for existing functions Nov 10, 2018
gui.c patch 8.1.0528: various typos in comments Nov 16, 2018
gui.h patch 8.1.0228: dropping files is ignored while Vim is busy Jul 29, 2018
gui_at_fs.c patch 8.1.0443: unnecessary static function prototypes Sep 30, 2018
gui_at_sb.c patch 8.0.1688: some macros are used without a semicolon Apr 10, 2018
gui_at_sb.h patch 7.4.2293 Aug 29, 2016
gui_athena.c patch 8.1.0528: various typos in comments Nov 16, 2018
gui_beval.c patch 8.1.0405: too many #ifdefs for GTK Sep 18, 2018
gui_dwrite.cpp patch 8.0.1449: slow redrawing with DirectX Jan 31, 2018
gui_dwrite.h patch 8.0.1449: slow redrawing with DirectX Jan 31, 2018
gui_gtk.c patch 8.1.0528: various typos in comments Nov 16, 2018
gui_gtk_f.c patch 8.1.0405: too many #ifdefs for GTK Sep 18, 2018
gui_gtk_f.h patch 8.0.0521: GtkForm handling is outdated Mar 29, 2017
gui_gtk_res.xml patch 7.4.1019 Jan 1, 2016
gui_gtk_vms.h patch 7.4.2293 Aug 29, 2016
gui_gtk_x11.c patch 8.1.0528: various typos in comments Nov 16, 2018
gui_mac.c patch 8.1.0528: various typos in comments Nov 16, 2018
gui_motif.c patch 8.1.0528: various typos in comments Nov 16, 2018
gui_photon.c patch 8.1.0443: unnecessary static function prototypes Sep 30, 2018
gui_w32.c patch 8.1.0528: various typos in comments Nov 16, 2018
gui_w32_rc.h updated for version 7.0001 Jun 13, 2004
gui_x11.c patch 8.1.0443: unnecessary static function prototypes Sep 30, 2018
gui_x11_pm.h patch 7.4.2293 Aug 29, 2016
gui_xmdlg.c patch 8.0.0367: types in include files may be inconsistent Feb 25, 2017
gui_xmebw.c patch 8.1.0528: various typos in comments Nov 16, 2018
gui_xmebw.h patch 7.4.2293 Aug 29, 2016
gui_xmebwp.h patch 7.4.2293 Aug 29, 2016
gvim.exe.mnf Vim 8.1 release May 17, 2018
gvimtutor updated for version 7.1-298 May 10, 2008
hangulin.c patch 8.1.0443: unnecessary static function prototypes Sep 30, 2018
hardcopy.c patch 8.1.0443: unnecessary static function prototypes Sep 30, 2018
hashtab.c patch 8.0.0192: cannot build with tiny features Jan 15, 2017
if_cscope.c patch 8.1.0443: unnecessary static function prototypes Sep 30, 2018
if_cscope.h patch 7.4.2293 Aug 29, 2016
if_lua.c patch 8.1.0305: missing support for Lua 5.4 32 bits on Unix Aug 21, 2018
if_mzsch.c patch 8.1.0443: unnecessary static function prototypes Sep 30, 2018
if_mzsch.h patch 7.4.2293 Aug 29, 2016
if_ole.cpp patch 8.1.0178: warning for passing pointer to non-pointer argument Jul 11, 2018
if_ole.h updated for version 7.3.199 May 25, 2011
if_ole.idl updated for version 7.1-282 Mar 16, 2008
if_perl.xs patch 8.1.0420: generating vim.lib when using ActivePerl 5.20.3 or later Sep 21, 2018
if_perlsfio.c patch 7.4.2293 Aug 29, 2016
if_py_both.h patch 8.1.0247: Python: error message for failing import is incorrect Aug 7, 2018
if_python.c patch 8.0.1846: Python interface is incompatible with lldb May 15, 2018
if_python3.c patch 8.1.0443: unnecessary static function prototypes Sep 30, 2018
if_ruby.c patch 8.1.0380: "make proto" doesn't work well Sep 13, 2018
if_tcl.c patch 8.1.0528: various typos in comments Nov 16, 2018
if_xcmdsrv.c patch 8.1.0443: unnecessary static function prototypes Sep 30, 2018
iid_ole.c updated for version 7.1-065 Aug 12, 2007
infplist.xml updated for version 7.0c10 Apr 5, 2006
install-sh patch 8.0.0570: can't run make with several jobs Apr 20, 2017
installman.sh patch 8.1.0222: errors are reported for "make install" Jul 28, 2018
installml.sh patch 8.0.0576: can't build when configure choses "install-sh" Apr 21, 2017
integration.c patch 8.1.0443: unnecessary static function prototypes Sep 30, 2018
integration.h patch 7.4.2293 Aug 29, 2016
iscygpty.c patch 8.0.1550: various small problems in source files Feb 27, 2018
iscygpty.h patch 8.0.1030: MS-Windows: wrong size computation in is_cygpty() Aug 31, 2017
json.c patch 8.1.0443: unnecessary static function prototypes Sep 30, 2018
json_test.c patch 8.0.1550: various small problems in source files Feb 27, 2018
keymap.h patch 8.0.1786: no test for 'termwinkey' May 1, 2018
kword_test.c patch 8.0.0252: not properly recognizing word characters between 128 … Jan 28, 2017
link.390 updated for version 7.0001 Jun 13, 2004
link.sh updated for version 7.3.050 Nov 3, 2010
list.c patch 8.1.0519: cannot save and restore the tag stack Nov 11, 2018
macros.h patch 8.1.0528: various typos in comments Nov 16, 2018
main.c patch 8.1.0515: reloading a script gives errors for existing functions Nov 10, 2018
mark.c patch 8.1.0495: :filter only supports some commands Oct 25, 2018
mbyte.c patch 8.1.0443: unnecessary static function prototypes Sep 30, 2018
memfile.c patch 8.1.0423: MS-Windows: using dup-close for flushing a file Sep 21, 2018
memfile_test.c patch 7.4.2293 Aug 29, 2016
memline.c patch 8.1.0501: cppcheck warns for using array index before bounds check Oct 30, 2018
menu.c patch 8.1.0487: no menus specifically for the terminal window Oct 19, 2018
message.c patch 8.1.0466: autocmd test fails Oct 7, 2018
message_test.c patch 8.0.0540: building unit tests fails Apr 2, 2017
misc1.c patch 8.1.0534: MS-Windows installer uses different $HOME than Vim Nov 16, 2018
misc2.c patch 8.1.0519: cannot save and restore the tag stack Nov 11, 2018
move.c patch 8.1.0448: cursorline not removed when using 'cursorbind' Oct 2, 2018
msvc2008.bat updated for version 7.3.1308 Jul 4, 2013
msvc2010.bat updated for version 7.3.1308 Jul 4, 2013
msvc2015.bat patch 8.1.0408: MSVC: cannot use the "x64" native compiler option Sep 18, 2018
msvcsetup.bat updated for version 7.0216 Mar 6, 2006
msys32.bat patch 8.1.0128: building with MinGW does not work out-of-the-box Jun 30, 2018
msys64.bat patch 8.1.0128: building with MinGW does not work out-of-the-box Jun 30, 2018
mysign patch 8.0.0082 Nov 12, 2016
nbdebug.c patch 8.0.0012 Sep 25, 2016
nbdebug.h patch 7.4.2293 Aug 29, 2016
netbeans.c patch 8.1.0443: unnecessary static function prototypes Sep 30, 2018
normal.c patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name Nov 10, 2018
ops.c patch 8.1.0535: increment/decrement might get interrupted by updating… Nov 16, 2018
option.c patch 8.1.0515: reloading a script gives errors for existing functions Nov 10, 2018
option.h patch 8.1.0105: all tab stops are the same Jun 23, 2018
os_amiga.c patch 8.1.0528: various typos in comments Nov 16, 2018
os_amiga.h patch 8.0.1554: custom plugins loaded with --clean Mar 1, 2018
os_beos.c patch 7.4.2293 Aug 29, 2016
os_beos.h patch 7.4.2293 Aug 29, 2016
os_beos.rsrc updated for version 7.0001 Jun 13, 2004
os_dos.h patch 8.0.1554: custom plugins loaded with --clean Mar 1, 2018
os_mac.h patch 8.1.0423: MS-Windows: using dup-close for flushing a file Sep 21, 2018
os_mac.rsr.hqx updated for version 7.0001 Jun 13, 2004
os_mac_conv.c patch 8.0.1496: clearing a pointer takes two lines Feb 10, 2018
os_macosx.m patch 8.1.0467: cannot build with Mac OS X 10.5 Oct 8, 2018
os_mint.h patch 7.4.2293 Aug 29, 2016
os_mswin.c patch 8.1.0465: client-server test fails Oct 7, 2018
os_qnx.c patch 7.4.2293 Aug 29, 2016
os_qnx.h patch 7.4.2293 Aug 29, 2016
os_unix.c patch 8.1.0526: running out of signal stack in RealWaitForChar Nov 12, 2018
os_unix.h patch 8.1.0268: file type checking has too many #ifdef Aug 11, 2018
os_unixx.h patch 8.0.0346: Vim relies on limits.h to be included indirectly Feb 21, 2017
os_vms.c patch 8.0.1749: VMS: 100% CPU use, redefining mch_open() fails Apr 23, 2018
os_vms_conf.h patch 8.0.0109 Dec 1, 2016
os_vms_fix.com patch 8.1.0528: various typos in comments Nov 16, 2018
os_vms_mms.c updated for version 7.0073 May 19, 2005
os_w32dll.c patch 7.4.2293 Aug 29, 2016
os_w32exe.c patch 8.0.0281: some files are still using ARGSUSED instead of UNUSED Feb 1, 2017
os_win32.c patch 8.1.0528: various typos in comments Nov 16, 2018
os_win32.h patch 8.1.0423: MS-Windows: using dup-close for flushing a file Sep 21, 2018
osdef.sh patch 7.4.1159 Jan 23, 2016
osdef1.h.in patch 8.1.0319: bzero() function prototype doesn't work for Android Aug 22, 2018
osdef2.h.in patch 8.0.1506: new version of HP NonStop (Tandem) doesn't like a header Feb 12, 2018
pathdef.sh updated for version 7.0001 Jun 13, 2004
popupmnu.c patch 8.1.0487: no menus specifically for the terminal window Oct 19, 2018
proto.h patch 8.1.0135: undo message delays screen update for CTRL-O u Jul 1, 2018
protodef.h patch 8.1.0380: "make proto" doesn't work well Sep 13, 2018
pty.c patch 8.1.0443: unnecessary static function prototypes Sep 30, 2018
quickfix.c patch 8.1.0532: cannot distinguish between quickfix and location list Nov 16, 2018
regexp.c patch 8.1.0443: unnecessary static function prototypes Sep 30, 2018
regexp.h patch 8.1.0192: executing regexp recursively fails with a crash Jul 17, 2018
regexp_nfa.c patch 8.1.0192: executing regexp recursively fails with a crash Jul 17, 2018
screen.c patch 8.1.0528: various typos in comments Nov 16, 2018
search.c patch 8.1.0528: various typos in comments Nov 16, 2018
sha256.c patch 8.1.0443: unnecessary static function prototypes Sep 30, 2018
spell.c patch 8.1.0528: various typos in comments Nov 16, 2018
spell.h patch 8.0.1490: number of spell regions is spread out through the code Feb 10, 2018
spellfile.c patch 8.1.0528: various typos in comments Nov 16, 2018
structs.h patch 8.1.0515: reloading a script gives errors for existing functions Nov 10, 2018
syntax.c patch 8.1.0495: :filter only supports some commands Oct 25, 2018
tag.c patch 8.1.0519: cannot save and restore the tag stack Nov 11, 2018
tearoff.bmp updated for version 7.0001 Jun 13, 2004
term.c patch 8.1.0445: setting 'term' does not store location for termcap op… Oct 2, 2018
term.h patch 8.1.0253: saving and restoring window title does not always work Aug 7, 2018
terminal.c patch 8.1.0522: :terminal does not show trailing empty lines Nov 11, 2018
termlib.c patch 8.0.1236: Mac features are confusing Oct 28, 2017
toolbar.phi updated for version 7.0001 Jun 13, 2004
toolcheck updated for version 7.0001 Jun 13, 2004
tools.bmp Update runtime files. Oct 2, 2018
typemap updated for version 7.3.439 Feb 11, 2012
ui.c patch 8.1.0443: unnecessary static function prototypes Sep 30, 2018
undo.c patch 8.1.0443: unnecessary static function prototypes Sep 30, 2018
uninstal.c patch 8.0.1191: MS-Windows: missing 32 and 64 bit files in installer Oct 14, 2017
userfunc.c patch 8.1.0515: reloading a script gives errors for existing functions Nov 10, 2018
version.c patch 8.1.0535: increment/decrement might get interrupted by updating… Nov 16, 2018
version.h patch 8.1.0103: long version string cannot be translated Jun 23, 2018
vim.def Vim 8.1 release May 17, 2018
vim.h patch 8.1.0528: various typos in comments Nov 16, 2018
vim.ico updated for version 7.0001 Jun 13, 2004
vim.rc patch 7.4.2293 Aug 29, 2016
vim.tlb updated for version 7.0001 Jun 13, 2004
vim_alert.ico updated for version 7.0001 Jun 13, 2004
vim_error.ico updated for version 7.0001 Jun 13, 2004
vim_icon.xbm updated for version 7.0001 Jun 13, 2004
vim_info.ico updated for version 7.0001 Jun 13, 2004
vim_mask.xbm updated for version 7.0001 Jun 13, 2004
vim_quest.ico updated for version 7.0001 Jun 13, 2004
vimio.h patch 7.4.2293 Aug 29, 2016
vimrun.c patch 8.0.1550: various small problems in source files Feb 27, 2018
vimtutor patch 8.0.1703: in the tutor 'showcmd' is not set Apr 12, 2018
which.sh updated for version 7.0001 Jun 13, 2004
winclip.c patch 8.0.0281: some files are still using ARGSUSED instead of UNUSED Feb 1, 2017
window.c patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name Nov 10, 2018
workshop.c patch 8.1.0443: unnecessary static function prototypes Sep 30, 2018
workshop.h patch 7.4.2293 Aug 29, 2016
wsdebug.c patch 8.0.0012 Sep 25, 2016
wsdebug.h patch 7.4.2293 Aug 29, 2016
xpm_w32.c patch 7.4.2293 Aug 29, 2016
xpm_w32.h patch 7.4.1200 Jan 29, 2016

README.txt

README for the Vim source code

Here are a few hints for finding your way around the source code.  This
doesn't make it less complex than it is, but it gets you started.

You might also want to read ":help development".


JUMPING AROUND

First of all, use ":make tags" to generate a tags file, so that you can jump
around in the source code.

To jump to a function or variable definition, move the cursor on the name and
use the CTRL-] command.  Use CTRL-T or CTRL-O to jump back.

To jump to a file, move the cursor on its name and use the "gf" command.

Most code can be found in a file with an obvious name (incomplete list):
	buffer.c	manipulating buffers (loaded files)
	diff.c		diff mode (vimdiff)
	eval.c		expression evaluation
	fileio.c	reading and writing files
	fold.c		folding
	getchar.c	getting characters and key mapping
	mark.c		marks
	mbyte.c		multi-byte character handling
	memfile.c	storing lines for buffers in a swapfile
	memline.c	storing lines for buffers in memory
	menu.c		menus
	message.c	(error) messages
	ops.c		handling operators ("d", "y", "p")
	option.c	options
	quickfix.c	quickfix commands (":make", ":cn")
	regexp.c	pattern matching
	screen.c	updating the windows
	search.c	pattern searching
	spell.c		spell checking
	syntax.c	syntax and other highlighting
	tag.c		tags
	term.c		terminal handling, termcap codes
	undo.c		undo and redo
	window.c	handling split windows


DEBUGGING

If you have a reasonable recent version of gdb, you can use the :Termdebug
command to debug Vim.  See  ":help :Termdebug".

When something is time critical or stepping through code is a hassle, use the
channel logging to create a time-stamped log file.  Add lines to the code like
this:
	ch_log(NULL, "Value is now %02x", value);
After compiling and starting Vim, do:
	:call ch_logfile('debuglog', 'w')
And edit "debuglog" to see what happens.  The channel functions already have
ch_log() calls, thus you always see that in the log.


IMPORTANT VARIABLES

The current mode is stored in "State".  The values it can have are NORMAL,
INSERT, CMDLINE, and a few others.

The current window is "curwin".  The current buffer is "curbuf".  These point
to structures with the cursor position in the window, option values, the file
name, etc.  These are defined in structs.h.

All the global variables are declared in globals.h.


THE MAIN LOOP

This is conveniently called main_loop().  It updates a few things and then
calls normal_cmd() to process a command.  This returns when the command is
finished.

The basic idea is that Vim waits for the user to type a character and
processes it until another character is needed.  Thus there are several places
where Vim waits for a character to be typed.  The vgetc() function is used for
this.  It also handles mapping.

Updating the screen is mostly postponed until a command or a sequence of
commands has finished.  The work is done by update_screen(), which calls
win_update() for every window, which calls win_line() for every line.
See the start of screen.c for more explanations.


COMMAND-LINE MODE

When typing a ":", normal_cmd() will call getcmdline() to obtain a line with
an Ex command.  getcmdline() contains a loop that will handle each typed
character.  It returns when hitting <CR> or <Esc> or some other character that
ends the command line mode.


EX COMMANDS

Ex commands are handled by the function do_cmdline().  It does the generic
parsing of the ":" command line and calls do_one_cmd() for each separate
command.  It also takes care of while loops.

do_one_cmd() parses the range and generic arguments and puts them in the
exarg_t and passes it to the function that handles the command.

The ":" commands are listed in ex_cmds.h.  The third entry of each item is the
name of the function that handles the command.  The last entry are the flags
that are used for the command.


NORMAL MODE COMMANDS

The Normal mode commands are handled by the normal_cmd() function.  It also
handles the optional count and an extra character for some commands.  These
are passed in a cmdarg_t to the function that handles the command.

There is a table nv_cmds in normal.c which lists the first character of every
command.  The second entry of each item is the name of the function that
handles the command.


INSERT MODE COMMANDS

When doing an "i" or "a" command, normal_cmd() will call the edit() function.
It contains a loop that waits for the next character and handles it.  It
returns when leaving Insert mode.


OPTIONS

There is a list with all option names in option.c, called options[].


THE GUI

Most of the GUI code is implemented like it was a clever terminal.  Typing a
character, moving a scrollbar, clicking the mouse, etc. are all translated
into events which are written in the input buffer.  These are read by the
main code, just like reading from a terminal.  The code for this is scattered
through gui.c.  For example: gui_send_mouse_event() for a mouse click and
gui_menu_cb() for a menu action.  Key hits are handled by the system-specific
GUI code, which calls add_to_input_buf() to send the key code.

Updating the GUI window is done by writing codes in the output buffer, just
like writing to a terminal.  When the buffer gets full or is flushed,
gui_write() will parse the codes and draw the appropriate items.  Finally the
system-specific GUI code will be called to do the work.


DEBUGGING THE GUI

Remember to prevent that gvim forks and the debugger thinks Vim has exited,
add the "-f" argument.  In gdb: "run -f -g".

When stepping through display updating code, the focus event is triggered
when going from the debugger to Vim and back.  To avoid this, recompile with
some code in gui_focus_change() disabled.