diff options
author | Jason Downs <downsj@cvs.openbsd.org> | 1996-10-14 03:56:09 +0000 |
---|---|---|
committer | Jason Downs <downsj@cvs.openbsd.org> | 1996-10-14 03:56:09 +0000 |
commit | 0a64da4f22aa6e7dc9ce23604386381860186ad4 (patch) | |
tree | 532d8d1430151973edf5c77219a3c0c08afbd3d4 | |
parent | 6ddf388c16e872b21b49b92394473229e943f96e (diff) |
Backout a previous change that didn't work, and update to version 4.5.
41 files changed, 288 insertions, 196 deletions
diff --git a/usr.bin/vim/README b/usr.bin/vim/README index 39dcfa5edcd..67c1a5d38e4 100644 --- a/usr.bin/vim/README +++ b/usr.bin/vim/README @@ -1,6 +1,6 @@ -$OpenBSD: README,v 1.2 1996/09/21 06:22:50 downsj Exp $ +$OpenBSD: README,v 1.3 1996/10/14 03:55:06 downsj Exp $ -README for version 4.4 of Vim: Vi IMproved. +README for version 4.5 of Vim: Vi IMproved. Vim is an almost compatible version of the UNIX editor vi. Only the "Q" command is missing. Many new features have been added: multi level undo, diff --git a/usr.bin/vim/cmdcmds.c b/usr.bin/vim/cmdcmds.c index 6401177cf62..e8c0ffdf221 100644 --- a/usr.bin/vim/cmdcmds.c +++ b/usr.bin/vim/cmdcmds.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmdcmds.c,v 1.4 1996/09/24 17:53:49 downsj Exp $ */ +/* $OpenBSD: cmdcmds.c,v 1.5 1996/10/14 03:55:07 downsj Exp $ */ /* vi:set ts=4 sw=4: * * VIM - Vi IMproved by Bram Moolenaar @@ -287,6 +287,7 @@ do_move(line1, line2, n) /* * First we copy the old text to its new location -- webb + * Also copy the flag that ":global" command uses. */ if (u_save(n, n + 1) == FAIL) return FAIL; diff --git a/usr.bin/vim/cmdline.c b/usr.bin/vim/cmdline.c index 7e50783fdb0..9c0ce156ad0 100644 --- a/usr.bin/vim/cmdline.c +++ b/usr.bin/vim/cmdline.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmdline.c,v 1.4 1996/09/22 01:18:00 downsj Exp $ */ +/* $OpenBSD: cmdline.c,v 1.5 1996/10/14 03:55:08 downsj Exp $ */ /* vi:set ts=4 sw=4: * * VIM - Vi IMproved by Bram Moolenaar @@ -300,8 +300,13 @@ getcmdline(firstc, count) c = hkmap(c); #endif } - if (c == Ctrl('C')) - got_int = FALSE; /* ignore got_int when CTRL-C was typed here */ + + /* + * Ignore got_int when CTRL-C was typed here. + * Don't ignore it in :global, we really need to break then. + */ + if (c == Ctrl('C') && !global_busy) + got_int = FALSE; /* free old command line when finished moving around in the * history list */ @@ -4529,7 +4534,8 @@ showmatches(buff) flushbuf(); /* show one line at a time */ if (got_int) { - got_int = FALSE; + if (!global_busy) + got_int = FALSE; break; } } diff --git a/usr.bin/vim/doc/vim_40.txt b/usr.bin/vim/doc/vim_40.txt index 8a9e986b2a2..034bcb153a2 100644 --- a/usr.bin/vim/doc/vim_40.txt +++ b/usr.bin/vim/doc/vim_40.txt @@ -1,4 +1,4 @@ -*vim_40.txt* For Vim version 4.4. Last modification: 1996 Sep 1 +*vim_40.txt* For Vim version 4.5. Last modification: 1996 Sep 1 Welcome to Vim Version 4.0! diff --git a/usr.bin/vim/doc/vim_ami.txt b/usr.bin/vim/doc/vim_ami.txt index 2ba3374d7ca..18650c9f48b 100644 --- a/usr.bin/vim/doc/vim_ami.txt +++ b/usr.bin/vim/doc/vim_ami.txt @@ -1,4 +1,4 @@ -*vim_ami.txt* For Vim version 4.4. Last modification: 1996 Apr 19 +*vim_ami.txt* For Vim version 4.5. Last modification: 1996 Apr 19 This file contains the particularities for the Amiga version of Vim. diff --git a/usr.bin/vim/doc/vim_arch.txt b/usr.bin/vim/doc/vim_arch.txt index a7fb9fb3b6f..a9b493597ee 100644 --- a/usr.bin/vim/doc/vim_arch.txt +++ b/usr.bin/vim/doc/vim_arch.txt @@ -1,4 +1,4 @@ -*vim_arch.txt* For Vim version 4.4. Last modification: 1996 Mar 6 +*vim_arch.txt* For Vim version 4.5. Last modification: 1996 Mar 6 This file contains the particularities for the Archimedes version of Vim. diff --git a/usr.bin/vim/doc/vim_diff.txt b/usr.bin/vim/doc/vim_diff.txt index 654fff63343..daa4f500bdb 100644 --- a/usr.bin/vim/doc/vim_diff.txt +++ b/usr.bin/vim/doc/vim_diff.txt @@ -1,4 +1,4 @@ -*vim_diff.txt* For Vim version 4.4. Last modification: 1996 July 18 +*vim_diff.txt* For Vim version 4.5. Last modification: 1996 July 18 This is a summary of the differences between VIM and vi. It is not complete. see also |vim_ref.txt|, look for comments in {}, like "{not in Vi}". diff --git a/usr.bin/vim/doc/vim_digr.txt b/usr.bin/vim/doc/vim_digr.txt index a58d7723559..50513077118 100644 --- a/usr.bin/vim/doc/vim_digr.txt +++ b/usr.bin/vim/doc/vim_digr.txt @@ -1,4 +1,4 @@ -*vim_digr.txt* For Vim version 4.4. Last modification: 1996 June 8 +*vim_digr.txt* For Vim version 4.5. Last modification: 1996 June 8 These are the default digraph characters for Vim. diff --git a/usr.bin/vim/doc/vim_dos.txt b/usr.bin/vim/doc/vim_dos.txt index 5a0860839ba..5866b4f9c7b 100644 --- a/usr.bin/vim/doc/vim_dos.txt +++ b/usr.bin/vim/doc/vim_dos.txt @@ -1,4 +1,4 @@ -*vim_dos.txt* For Vim version 4.4. Last modification: 1996 Aug 17 +*vim_dos.txt* For Vim version 4.5. Last modification: 1996 Sep 29 This file contains the particularities for the MS-DOS version of Vim. @@ -327,9 +327,11 @@ HOW TO COPY/PASTE TEXT FROM/TO VIM IN A DOS BOX (posted to comp.editors by John Velman <velman@igate1.hac.com>) -1) to get VIM to run in a window, instead of full screen, press alt+enter - (I've always used alt+shift+enter, but either one seems to work). This - toggles back and forth between full screen and a dos window. +1) to get VIM to run in a window, instead of full screen, press alt+enter. + This toggles back and forth between full screen and a dos window. + NOTE: In Windows 95 you must have the property "Fast Pasting" unchecked! + In the properties dialog box for the MS-DOS window, go to "MS-DOS + Prompt/Misc/Fast pasting" and make sure that it is NOT checked. 2) To paste something *into* vim, put vim in insert mode. diff --git a/usr.bin/vim/doc/vim_gui.txt b/usr.bin/vim/doc/vim_gui.txt index 017f6f49e09..d8c4cb40289 100644 --- a/usr.bin/vim/doc/vim_gui.txt +++ b/usr.bin/vim/doc/vim_gui.txt @@ -1,4 +1,4 @@ -*vim_gui.txt* For Vim version 4.4. Last modification: 1996 Sep 12 +*vim_gui.txt* For Vim version 4.5. Last modification: 1996 Oct 5 Vim's Graphical User Interface @@ -113,6 +113,12 @@ which make Motif applications look even better, highly recommended! Don't use "Vim*geometry" in the defaults. This will break the menus. Use "Vim.geometry" instead. +If you get an error message "Cannot allocate colormap entry for "gray60", +try adding this to your Vim resources (change the colors to your liking): + +Vim*scrollBackground: Black +Vim*scrollForeground: Blue + The resources can also be set with arguments to vim: argument meaning *-gui* diff --git a/usr.bin/vim/doc/vim_help.txt b/usr.bin/vim/doc/vim_help.txt index ea2d5d6d27b..6993e41ef1f 100644 --- a/usr.bin/vim/doc/vim_help.txt +++ b/usr.bin/vim/doc/vim_help.txt @@ -1,4 +1,4 @@ -*vim_help.txt* For Vim version 4.4. Last modification: 1996 Aug 3 +*vim_help.txt* For Vim version 4.5. Last modification: 1996 Sep 30 VIM help file @@ -861,8 +861,8 @@ Short explanation of each option: *option_list* |:range| % equal to 1,$ (the entire file) |:range| * equal to '<,'> (visual area) |:range| 't position of mark t -|:range| /{pattern} the next line where {pattern} matches -|:range| ?{pattern} the previous line where {pattern} matches +|:range| /{pattern}[/] the next line where {pattern} matches +|:range| ?{pattern}[?] the previous line where {pattern} matches |:range| +[num] add [num] to the preceding line number (default: 1) @@ -1130,9 +1130,11 @@ There are three mailing lists for Vim: beta-test versions and ports to different systems. -NOTE: You can only send messages to these lists if you have subscribed! Also: -you need to send the messages from the same location as the one you subscribed -from (yes, Majordomo is inflexible). +NOTE: +- You can only send messages to these lists if you have subscribed! +- You need to send the messages from the same location as where you subscribed + from (yes, Majordomo is inflexible). +- Maximum message size is 40000 characters. If you want to join, send a message to <majordomo@prz.tu-berlin.de> diff --git a/usr.bin/vim/doc/vim_idx.txt b/usr.bin/vim/doc/vim_idx.txt index f7f28c96c2e..fa557bc8b36 100644 --- a/usr.bin/vim/doc/vim_idx.txt +++ b/usr.bin/vim/doc/vim_idx.txt @@ -1,4 +1,4 @@ -*vim_idx.txt* For Vim version 4.4. Last modification: 1996 Aug 4 +*vim_idx.txt* For Vim version 4.5. Last modification: 1996 Sep 16 This file contains a list of all commands for each mode, with a tag and a short description. The list is sorted on ASCII value. @@ -805,6 +805,7 @@ arguments. |:dsearch| :ds[earch] list one #define |:dsplit| :dsp[lit] split window and jump to #define |:edit| :e[dit] edit a file +|:endif| :en[dif] end previous :if |:ex| :ex same as ":edit" |:exit| :exi[t] same as ":xit" |:file| :f[ile] show or set the current file name @@ -814,6 +815,7 @@ arguments. |:gui| :gu[i] start the GUI |:gvim| :gv[im] start the GUI |:help| :h[elp] open a help window +|:if| :if ignore all commands until matching :endif |:insert| :i[nsert] insert text |:iabbrev| :ia[bbrev] like ":abbrev" but for Insert mode |:iabclear| :iabc[lear] like ":abclear" but for Insert mode diff --git a/usr.bin/vim/doc/vim_menu.txt b/usr.bin/vim/doc/vim_menu.txt index 5057e79c5e6..e413c7af7cb 100644 --- a/usr.bin/vim/doc/vim_menu.txt +++ b/usr.bin/vim/doc/vim_menu.txt @@ -1,4 +1,4 @@ -" *vim_menu.txt* For Vim version 4.4. Last modification: 1996 May 29 +" *vim_menu.txt* For Vim version 4.5. Last modification: 1996 May 29 " " These menu commands should recreate the default Vim menus. " You can use this as a start for your own set of menus. diff --git a/usr.bin/vim/doc/vim_mint.txt b/usr.bin/vim/doc/vim_mint.txt index 5ac9d567653..8ef88e6d8d1 100644 --- a/usr.bin/vim/doc/vim_mint.txt +++ b/usr.bin/vim/doc/vim_mint.txt @@ -1,4 +1,4 @@ -*vim_mint.txt* For Vim version 4.4. Last modification 1996 June 11 +*vim_mint.txt* For Vim version 4.5. Last modification 1996 June 11 This file contains the particularities for the Atari MiNT version of Vim. diff --git a/usr.bin/vim/doc/vim_os2.txt b/usr.bin/vim/doc/vim_os2.txt index 6a6c11226b9..7c73313e52b 100644 --- a/usr.bin/vim/doc/vim_os2.txt +++ b/usr.bin/vim/doc/vim_os2.txt @@ -1,4 +1,4 @@ -*vim_os2.txt* For Vim version 4.4. Last modification: 1996 July 20 +*vim_os2.txt* For Vim version 4.5. Last modification: 1996 Sep 17 This file contains the particularities for the OS/2 version of Vim. @@ -7,10 +7,10 @@ NOTE This OS/2 port works well for me and a couple of other OS/2 users; however, since I haven't had much feedback, that either means no (OS/2-specific) bugs -exist (besides the one mentioned below), or no one has yet created a situation -in which any bugs are apparent. Report any problems or other comments to -paul@wau.mis.ah.nl (email valid up to at least September 1996, after that try -paul@wurtel.hobby.nl, paul@murphy.nl, or paulS@toecompst.nl). +exist (besides the ones mentioned below), or no one has yet created a +situation in which any bugs are apparent. Report any problems or other +comments to paul@wau.mis.ah.nl (email valid up to at least November 1996, +after that try paul@wurtel.demon.nl, paul@murphy.nl, or paulS@toecompst.nl). Textmode/notextmode, binary mode, and FAT handling all seem to work well, which would seem to be the most likely places for trouble. @@ -25,6 +25,11 @@ This can be reproduced with ":!start epm". Now quit Vim, and start Vim again with the file that was in the buffer at the time epm was started. I'm working on this! +A second problem is that Vim doesn't understand the situation when using it +when accessing the OS/2 system via the network, e.g. using telnet from a Unix +system, and then starting Vim. This will be looked into as soon as I get my +network running with OS/2... In the meantime any help will be appreciated. + PREREQUISITES @@ -37,10 +42,11 @@ I've included a copy of emx.dll, which should be copied to one of the directories listed in your LIBPATH. Emx is GPL'ed, but the emx.dll library is not (read COPYING.EMX to find out what that means to you). -This emx.dll is from the emxfix04.zip package, which unfortunately has a bug -in select(). Versions of Vim before 3.27 will appear to hang when starting -(actually, while processing vimrc). Hit return a couple of times until Vim -starts working if this happens. Next, get an up to date version of Vim! +This emx.dll is from the emxfix04.zip package, which unfortunately has a bug, +eh, I mean a POSIX feature, in select(). Versions of Vim before 3.27 will +appear to hang when starting (actually, while processing vimrc). Hit return a +couple of times until Vim starts working if this happens. Next, get an up to +date version of Vim! HELP AND VIMRC FILE diff --git a/usr.bin/vim/doc/vim_ref.txt b/usr.bin/vim/doc/vim_ref.txt index 72a1ffb15a8..77ab282e3f6 100644 --- a/usr.bin/vim/doc/vim_ref.txt +++ b/usr.bin/vim/doc/vim_ref.txt @@ -1,4 +1,4 @@ -*vim_ref.txt* For Vim version 4.4. Last modification: 1996 Sep 12 +*vim_ref.txt* For Vim version 4.5. Last modification: 1996 Oct 2 VIM REFERENCE MANUAL @@ -613,10 +613,11 @@ problems if you have a file with only <NL>s and have a line like Avoiding trojan horses: *trojan_horse* While reading the "vimrc" or the "exrc" file in the current directory, some commands can be disabled for security reasons by setting the 'secure' option. -Otherwise it would be possible that you accidentally use a vimrc file that -somebody else created and contains nasty commands. The disabled commands are -the ones that start a shell, the ones that write to a file, and ":autocmd". -The ":map" commands are echoed, so you can see which keys are being mapped. +This is always done when executing the command from a tags file. Otherwise it +would be possible that you accidentally use a vimrc or tags file that somebody +else created and contains nasty commands. The disabled commands are the ones +that start a shell, the ones that write to a file, and ":autocmd". The ":map" +commands are echoed, so you can see which keys are being mapped. If you want Vim to execute all commands in a local vimrc file, you can reset the 'secure' option in the EXINIT or VIMINIT environment variable or in the global "exrc" or "vimrc" file. This is not possible in "vimrc" or @@ -628,6 +629,9 @@ the vimrc file before you start Vim in that directory, or reset the 'exrc' option. Some Unix systems allow a user to do "chown" on a file. This makes it possible for another user to create a nasty vimrc and make you the owner. Be careful! + When using tag search commands, executing the search command (the last +part of the line in the tags file) is always done in secure mode. This works +just like executing a command from a vimrc/exrc in the current directory. *slow_start* If Vim takes a long time to start up, there may be a few causes: @@ -4041,7 +4045,10 @@ N Repeat the latest "/" or "?" [count] times in *#* # Same as "*", but search backward. The English pound - sign (character 163) also works. {not in Vi} + sign (character 163) also works. If the "#" key works + as backspace, try using "stty erase <BS>" before + starting Vim (<BS> is CTRL-H or a real backspace). + {not in Vi} *gstar* g* Like "*", but don't put "\<" and "\>" around the word. @@ -4154,6 +4161,15 @@ TOP" is given when searching backwards or forwards respectively. This can be switched off by setting the 's' flag in the 'shortmess' option. The highlight method 'w' is used for this message (default: standout). + *search_range* +You cannot limit the search command "/" to a certain range of lines. A trick +to do this anyway is to use the ":substitute" command with the 'c' flag. +Example: + :.,300s/Pattern//gc +This command will search from the cursor position until line 300 for +"Pattern". At the match, you will be asked to type a character. Type 'q' to +stop at this match, type 'n' to find the next match. + The "*", "#", "g*" and "g#" commands look for a word near the cursor in this order, the first one that is found is used: - The keyword currently under the cursor. @@ -4812,6 +4828,10 @@ This means: A line starting with '#' or an identifier and containing the tag followed by white space and a '('. This will find macro names and function names with a type prepended. {the extra searches are not in Vi}. +Note that Vim forbids some commands, for security reasons. This works like +using the 'secure' option for exrc/vimrc files in the current directory. See +|trojan_horse|. {this security prevention is not present in Vi}. + In Vi the ":tag" command sets the last search pattern when the tag is searched for. In Vim this is not done, the previous search pattern is still remembered, unless the 't' flag is present in 'cpoptions'. The search pattern is always @@ -6124,7 +6144,7 @@ too: "-0.5s" is minus half a 'shiftwidth'. The examples given below assume a cino= cino=(0 if (c1 && (c2 || if (c1 && (c2 || c3)) c3)) - foo; + foo; foo; if (c1 && if (c1 && (c2 || c3) (c2 || c3) } } @@ -7805,7 +7825,7 @@ compatible (cp) toggle (default off, on when compiled with COMPATIBLE backspace 0 normal backspace backup off no backup file cindent off no C code indentation - cpoptions "bcefFkmorsStx$!%" vi-compatible flags + cpoptions "bBcefFkmorsStwx$!%<" vi-compatible flags digraph off no digraphs esckeys off no <Esc>-keys in Insert mode expandtab off tabs not expanded to spaces @@ -7928,6 +7948,9 @@ cpoptions (cpo) string (default "BceFs", unless compiled with "n" command. Otherwise Vim only puts the pattern in the history for search pattern, but doesn't change the last used search pattern. + w When using "cw" on a blank character, only change one + character and not all blanks until the start of the + next word. x <Esc> on the command line executes the command line. The default in Vim is to abandon the command line, because <Esc> normally aborts a command. |c_<Esc>| @@ -8252,7 +8275,7 @@ hidden (hid) toggle (default off) off. See also |vim_win.txt|. *'highlight'* *'hl'* -highlight (hl) string (default "8b,db,es,hs,mb,Mn,nu,rs,sr,tb,vr,ws") +highlight (hl) string (default "8b,db,es,mb,Mn,nu,rs,sr,tb,vr,ws") global {not in Vi} This option can be used to set highlighting mode for various @@ -8262,7 +8285,6 @@ highlight (hl) string (default "8b,db,es,hs,mb,Mn,nu,rs,sr,tb,vr,ws") 8 Meta & special keys listed with ":map" d directories in CTRL-D listing e error messages - h help file headers m "--More--" message M Mode (e.g., "-- INSERT --") n line number for ":number" and ":#" commands @@ -8279,6 +8301,8 @@ highlight (hl) string (default "8b,db,es,hs,mb,Mn,nu,rs,sr,tb,vr,ws") u underline (termcap entry "us" and "ue") n no highlighting The default is used for occasions that are not included. + If you want to change what the display modes do, see |colors| for an + example. *'history'* *'hi'* history (hi) number (default 20) diff --git a/usr.bin/vim/doc/vim_rlh.txt b/usr.bin/vim/doc/vim_rlh.txt index 9f8dcbfbbe8..5e5e1f4d4f4 100644 --- a/usr.bin/vim/doc/vim_rlh.txt +++ b/usr.bin/vim/doc/vim_rlh.txt @@ -1,4 +1,4 @@ -*vim_rlh.txt* For Vim version 4.4. Last modification: 1996 June 11 +*vim_rlh.txt* For Vim version 4.5. Last modification: 1996 June 11 Right to Left and Hebrew Mapping for Vim *hebrew* ======================================== diff --git a/usr.bin/vim/doc/vim_tags b/usr.bin/vim/doc/vim_tags index 6af387cac7e..cf2c158a206 100644 --- a/usr.bin/vim/doc/vim_tags +++ b/usr.bin/vim/doc/vim_tags @@ -1389,6 +1389,7 @@ cmdline_history vim_ref.txt /\*cmdline_history\* cmdline_lines vim_ref.txt /\*cmdline_lines\* cmdline_ranges vim_ref.txt /\*cmdline_ranges\* cmdline_special vim_ref.txt /\*cmdline_special\* +colors vim_unix.txt /\*colors\* compilation vim_40.txt /\*compilation\* compl_current vim_ref.txt /\*compl_current\* compl_define vim_ref.txt /\*compl_define\* @@ -1727,6 +1728,7 @@ scroll-smooth vim_tips.txt /\*scroll-smooth\* scrolling vim_ref.txt /\*scrolling\* search_offset vim_ref.txt /\*search_offset\* search_pattern vim_ref.txt /\*search_pattern\* +search_range vim_ref.txt /\*search_range\* section vim_ref.txt /\*section\* sentence vim_ref.txt /\*sentence\* set_option vim_ref.txt /\*set_option\* diff --git a/usr.bin/vim/doc/vim_tips.txt b/usr.bin/vim/doc/vim_tips.txt index 95c44523a76..3de43a298d7 100644 --- a/usr.bin/vim/doc/vim_tips.txt +++ b/usr.bin/vim/doc/vim_tips.txt @@ -1,4 +1,4 @@ -*vim_tips.txt* For Vim version 4.4. Last modification: 1996 Aug 30 +*vim_tips.txt* For Vim version 4.5. Last modification: 1996 Aug 30 Contents: diff --git a/usr.bin/vim/doc/vim_unix.txt b/usr.bin/vim/doc/vim_unix.txt index 1761d41698a..11c9f9624aa 100644 --- a/usr.bin/vim/doc/vim_unix.txt +++ b/usr.bin/vim/doc/vim_unix.txt @@ -1,4 +1,4 @@ -*vim_unix.txt* For Vim version 4.4. Last modification: 1996 Apr 23 +*vim_unix.txt* For Vim version 4.5. Last modification: 1996 Sep 20 This file contains the particularities for the Unix version of Vim. @@ -30,6 +30,7 @@ When using Vim in an xterm the mouse clicks can be used by Vim by setting 'mouse' to "a". If you then still want the xterm copy/paste with the mouse, press the shift key when using the mouse. See |mouse_using|. + *colors* To use colors in Vim you can use the following example (if your terminal supports colors!): :set t_me=^[[0;1;36m " normal mode (undoes t_mr and t_md) @@ -40,5 +41,7 @@ supports colors!): :set t_ue=^[[0;1;36m " underline end :set t_us=^[[1;32m " underline mode start +[the ^[ is an <Esc>, type CTRL-V <Esc> to enter it] + The file "tools/Vim132" is a shell script that can be used to put Vim in 132 column mode on a vt100 and lookalikes. diff --git a/usr.bin/vim/doc/vim_w32.txt b/usr.bin/vim/doc/vim_w32.txt index 1abe28ae949..4f24df39c00 100644 --- a/usr.bin/vim/doc/vim_w32.txt +++ b/usr.bin/vim/doc/vim_w32.txt @@ -1,4 +1,4 @@ -*vim_w32.txt* For Vim version 4.4. Last modification: 1996 Aug 12 +*vim_w32.txt* For Vim version 4.5. Last modification: 1996 Sep 30 This file documents the idiosyncrasies of the Win32 version of Vim. @@ -278,7 +278,7 @@ Q. So if the Win32 version updates the screen so slowly on Windows 95 and the Win32 version? A. Firstly, the Win32 version isn't that slow, especially when the screen is set to some non-standard number of 'lines' or 'columns'. Secondly, the - 16-bit DOS version has some severe limitations: it can't edit big files and + 16-bit DOS version has some severe limitations: It can't do big changes and it doesn't know about long filenames. The Win32 version doesn't have these limitations and it's faster overall (the same is true for the 32-bit DJGPP DOS version of Vim). The Win32 version is smarter about handling the @@ -327,7 +327,12 @@ A. You don't. The console mode input routines simply do not work correctly in reportedly do work. Q. How do I type dead keys on Windows NT? -A. Dead keys work on NT. Just type them as you would in any other application. +A. Dead keys work on NT 3.51. Just type them as you would in any other + application. + On NT 4.0, you need to make sure that the default locale (set in the + Keyboard part of the Control Panel) is the same as the currently active + locale. Otherwise the NT code will get confused and crash! This is a NT + 4.0 problem, not really a Vim problem. Q. When will a real GUI version of Vim (gvim) for Win32 with scrollbars, menus, pasting from the clipboard, and so on become available? diff --git a/usr.bin/vim/doc/vim_win.txt b/usr.bin/vim/doc/vim_win.txt index 1e62bc8b439..f1ac6f6dcd0 100644 --- a/usr.bin/vim/doc/vim_win.txt +++ b/usr.bin/vim/doc/vim_win.txt @@ -1,4 +1,4 @@ -*vim_win.txt* For Vim version 4.4. Last modification: 1996 Aug 6 +*vim_win.txt* For Vim version 4.5. Last modification: 1996 Aug 6 Editing with multiple windows and buffers. diff --git a/usr.bin/vim/edit.c b/usr.bin/vim/edit.c index b1e8d404e31..3af8e14d70e 100644 --- a/usr.bin/vim/edit.c +++ b/usr.bin/vim/edit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: edit.c,v 1.3 1996/09/21 23:12:32 downsj Exp $ */ +/* $OpenBSD: edit.c,v 1.4 1996/10/14 03:55:10 downsj Exp $ */ /* vi:set ts=4 sw=4: * * VIM - Vi IMproved by Bram Moolenaar @@ -304,7 +304,12 @@ edit(initstr, startln, count) emsg_on_display = FALSE; /* may remove error message now */ c = vgetc(); - if (c == Ctrl('C')) + + /* + * Ignore got_int when CTRL-C was typed here. + * Don't ignore it in :global, we really need to break then. + */ + if (c == Ctrl('C') && !global_busy) got_int = FALSE; #ifdef RIGHTLEFT @@ -1567,7 +1572,7 @@ docomplete: (p_ws || done_dir == BOTH_DIRECTIONS)) { edit_submode_extra = e_patnotf; - edit_submode_highl = TRUE; + edit_submode_highl = 'e'; } else if (curr_match != NULL && complete_direction == FORWARD && curr_match->next != NULL) @@ -1657,12 +1662,12 @@ docomplete: else if (tot == 0) { edit_submode_extra = e_patnotf; - edit_submode_highl = TRUE; + edit_submode_highl = 'e'; } } /* eat the ESC to avoid leaving insert mode */ - if (got_int) + if (got_int && !global_busy) { (void)vgetc(); got_int = FALSE; @@ -1681,7 +1686,7 @@ docomplete: if (curr_match == NULL || curr_match->original) { edit_submode_extra = (char_u *)"Back at original"; - edit_submode_highl = TRUE; + edit_submode_highl = 'w'; } else if (first_match != NULL && first_match->next != NULL && @@ -1689,7 +1694,7 @@ docomplete: first_match->next->original)) { edit_submode_extra = (char_u *)"(the only match)"; - edit_submode_highl = FALSE; + edit_submode_highl = NUL; } } @@ -2754,11 +2759,16 @@ insertchar(c, force_formatting, second_indent) /* * If there's any pending input, grab up to INPUT_BUFLEN at once. * This speeds up normal text input considerably. + * Don't do this when 'cindent' is set, because we might need to re-indent + * at a ':', or any other character. */ #define INPUT_BUFLEN 100 if (!ISSPECIAL(c) && vpeekc() != NUL && State != REPLACE +#ifdef CINDENT + && !curbuf->b_p_cin +#endif #ifdef RIGHTLEFT - && !p_ri + && !p_ri #endif ) { diff --git a/usr.bin/vim/fileio.c b/usr.bin/vim/fileio.c index 42cd96f255b..fc37d542d6c 100644 --- a/usr.bin/vim/fileio.c +++ b/usr.bin/vim/fileio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fileio.c,v 1.2 1996/09/21 06:22:58 downsj Exp $ */ +/* $OpenBSD: fileio.c,v 1.3 1996/10/14 03:55:11 downsj Exp $ */ /* vi:set ts=4 sw=4: * * VIM - Vi IMproved by Bram Moolenaar @@ -2138,14 +2138,13 @@ vim_tempname(extra_char) return NULL; #else -# ifndef USE_TMPNAM /* tmpnam() will make its own name */ - STRCPY(itmp, TEMPNAME); -# endif - if ((p = vim_strchr(itmp, '?')) != NULL) - *p = extra_char; # ifdef USE_TMPNAM + /* tmpnam() will make its own name */ if (*tmpnam((char *)itmp) == NUL) # else + STRCPY(itmp, TEMPNAME); + if ((p = vim_strchr(itmp, '?')) != NULL) + *p = extra_char; if (*mktemp((char *)itmp) == NUL) # endif return NULL; diff --git a/usr.bin/vim/globals.h b/usr.bin/vim/globals.h index d6d9515645e..b2cda667ddc 100644 --- a/usr.bin/vim/globals.h +++ b/usr.bin/vim/globals.h @@ -1,4 +1,4 @@ -/* $OpenBSD: globals.h,v 1.3 1996/09/22 01:18:02 downsj Exp $ */ +/* $OpenBSD: globals.h,v 1.4 1996/10/14 03:55:11 downsj Exp $ */ /* vi:set ts=4 sw=4: * * VIM - Vi IMproved by Bram Moolenaar @@ -261,7 +261,7 @@ EXTERN int arrow_used; /* Normally FALSE, set to TRUE after #ifdef INSERT_EXPAND EXTERN char_u *edit_submode INIT(= NULL); /* msg for CTRL-X submode */ EXTERN char_u *edit_submode_extra INIT(= NULL);/* extra info for msg */ -EXTERN int edit_submode_highl; /* extra info highlighted */ +EXTERN int edit_submode_highl; /* highlight method for extra info */ EXTERN int ctrl_x_mode INIT(= 0); /* Which Ctrl-X mode are we in? */ #endif @@ -406,7 +406,7 @@ EXTERN char_u e_abort[] INIT(="Command aborted"); EXTERN char_u e_ambmap[] INIT(="Ambiguous mapping"); EXTERN char_u e_argreq[] INIT(="Argument required"); EXTERN char_u e_backslash[] INIT(="\\ should be followed by /, ? or &"); -EXTERN char_u e_curdir[] INIT(="Command not allowed from from .exrc/.vimrc in current dir"); +EXTERN char_u e_curdir[] INIT(="Command not allowed from exrc/vimrc in current dir or tag search"); EXTERN char_u e_errorf[] INIT(="No errorfile name"); EXTERN char_u e_exists[] INIT(="File exists (use ! to override)"); EXTERN char_u e_failed[] INIT(="Command failed"); diff --git a/usr.bin/vim/gui_at_sb.c b/usr.bin/vim/gui_at_sb.c index e321c2d4ed7..5decd9c16d0 100644 --- a/usr.bin/vim/gui_at_sb.c +++ b/usr.bin/vim/gui_at_sb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gui_at_sb.c,v 1.2 1996/09/21 06:23:02 downsj Exp $ */ +/* $OpenBSD: gui_at_sb.c,v 1.3 1996/10/14 03:55:12 downsj Exp $ */ /* vi:set ts=4 sw=4: */ /* MODIFIED ATHENA SCROLLBAR (USING ARROWHEADS AT ENDS OF TRAVEL) */ /* Modifications Copyright 1992 by Mitch Trachtenberg */ @@ -367,10 +367,10 @@ static void PaintArrows(sbw) if (XtIsRealized((Widget) sbw)) { - if (thickness * 2 > sbw->scrollbar.length) + if ((int)thickness * 2 > (int)sbw->scrollbar.length) { size = sbw->scrollbar.length / 2; - off = (thickness - size) / 2; + off = (int)(thickness - size) / 2; } else { @@ -798,7 +798,7 @@ static void HandleThumb(w, event, params, num_params) /* also call Move and Notify if we're already in continuous scroll mode */ if (sbw->scrollbar.scroll_mode == SMODE_CONT || (loc >= sbw->scrollbar.topLoc && - loc <= sbw->scrollbar.topLoc + sbw->scrollbar.shownLength)) + loc <= sbw->scrollbar.topLoc + (int)sbw->scrollbar.shownLength)) { XtCallActionProc(w, "MoveThumb", event, params, *num_params); XtCallActionProc(w, "NotifyThumb", event, params, *num_params); @@ -875,7 +875,7 @@ static void NotifyScroll(w, event, params, num_params) ExtractPosition(event, &x, &y, &state); loc = PICKLENGTH(sbw, x, y); - if (sbw->scrollbar.thickness * 2 > sbw->scrollbar.length) + if ((int)sbw->scrollbar.thickness * 2 > (int)sbw->scrollbar.length) arrow_size = sbw->scrollbar.length / 2; else arrow_size = sbw->scrollbar.thickness; @@ -966,8 +966,8 @@ static float FractionLoc(sbw, x, y) margin = MARGIN(sbw); x -= margin; y -= margin; - height = sbw->core.height - 2 * margin; - width = sbw->core.width - 2 * margin; + height = (float)sbw->core.height - 2 * margin; + width = (float)sbw->core.width - 2 * margin; return PICKLENGTH(sbw, x / width, y / height); } diff --git a/usr.bin/vim/gui_athena.c b/usr.bin/vim/gui_athena.c index 781147644f3..d18dfdcea0b 100644 --- a/usr.bin/vim/gui_athena.c +++ b/usr.bin/vim/gui_athena.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gui_athena.c,v 1.2 1996/09/21 06:23:03 downsj Exp $ */ +/* $OpenBSD: gui_athena.c,v 1.3 1996/10/14 03:55:13 downsj Exp $ */ /* vi:set ts=4 sw=4: * * VIM - Vi IMproved by Bram Moolenaar @@ -474,8 +474,8 @@ gui_mch_get_winsize() XtNwidth, &total_width, NULL); - gui.num_rows = (total_height - base_height) / gui.char_height; - gui.num_cols = (total_width - base_width) / gui.char_width; + gui.num_rows = (int)(total_height - base_height) / gui.char_height; + gui.num_cols = (int)(total_width - base_width) / gui.char_width; Rows = gui.num_rows; Columns = gui.num_cols; @@ -1009,11 +1009,11 @@ gui_athena_pullright_action(w, event, args, nargs) XtNheight, &height, NULL); - if (event->xmotion.x >= width || event->xmotion.y >= height) + if (event->xmotion.x >= (int)width || event->xmotion.y >= (int)height) return; /* We do the pull-off when the pointer is in the rightmost 1/4th */ - if (event->xmotion.x < (width * 3) / 4) + if (event->xmotion.x < (int)(width * 3) / 4) return; pullright_name = strnsave((char_u *)XtName(menuw), diff --git a/usr.bin/vim/main.c b/usr.bin/vim/main.c index bf1b3c08665..6385399f0b9 100644 --- a/usr.bin/vim/main.c +++ b/usr.bin/vim/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.4 1996/09/24 22:12:57 downsj Exp $ */ +/* $OpenBSD: main.c,v 1.5 1996/10/14 03:55:14 downsj Exp $ */ /* vi:set ts=4 sw=4: * * VIM - Vi IMproved by Bram Moolenaar @@ -154,7 +154,6 @@ main(argc, argv) int check_version = FALSE; /* check .vimrc version number */ int argv_idx; /* index in argv[n][] */ int invoked_as_ex = FALSE; /* argv[0] is "ex" */ - int term_inited = FALSE; #if defined(MSDOS) || defined(WIN32) || defined(OS2) static struct initmap @@ -476,6 +475,16 @@ main(argc, argv) } } + /* note that we may use mch_windexit() before mch_windinit()! */ + mch_windinit(); /* inits Rows and Columns */ +/* + * Set the default values for the options that use Rows and Columns. + */ + set_init_2(); + + firstwin->w_height = Rows - 1; + cmdline_row = Rows - 1; + /* * Process the other command line arguments. * -e[errorfile] quickfix mode @@ -539,24 +548,6 @@ main(argc, argv) } else /* must be a file name */ { - if (!term_inited) - { -#ifdef USE_GUI - if (!gui.starting) -#endif - termcapinit(term); - - /* note that we may use mch_windexit() before mch_windinit()! */ - mch_windinit(); /* inits Rows and Columns */ - /* - * Set the default values for the options that use Rows and - * Columns. - */ - set_init_2(); - - term_inited = TRUE; - } - /* * Skip a single "--" argument, used in front of a file name that * starts with '-'. @@ -586,23 +577,6 @@ main(argc, argv) } } } - if (!term_inited) - { -#ifdef USE_GUI - if (!gui.starting) -#endif - termcapinit(term); - - /* note that we may use mch_windexit() before mch_windinit()! */ - mch_windinit(); /* inits Rows and Columns */ - /* - * Set the default values for the options that use Rows and - * Columns. - */ - set_init_2(); - - term_inited = TRUE; - } RedrawingDisabled = TRUE; @@ -639,7 +613,7 @@ main(argc, argv) curbuf->b_nwindows = 1; /* there is one window */ win_init(curwin); /* init current window */ init_yank(); /* init yank buffers */ - if (full_screen && !term_inited) + if (full_screen) termcapinit(term); /* set terminal name and get terminal capabilities */ screenclear(); /* clear screen (just inits screen structures, @@ -1074,7 +1048,7 @@ ex */ } } dont_wait_return = FALSE; - if (got_int) + if (got_int && !global_busy) { (void)vgetc(); /* flush all buffers */ got_int = FALSE; diff --git a/usr.bin/vim/memfile.c b/usr.bin/vim/memfile.c index 1d05aa49655..65bf552c660 100644 --- a/usr.bin/vim/memfile.c +++ b/usr.bin/vim/memfile.c @@ -1,4 +1,4 @@ -/* $OpenBSD: memfile.c,v 1.2 1996/09/21 06:23:07 downsj Exp $ */ +/* $OpenBSD: memfile.c,v 1.3 1996/10/14 03:55:15 downsj Exp $ */ /* vi:set ts=4 sw=4: * * VIM - Vi IMproved by Bram Moolenaar @@ -48,19 +48,21 @@ #endif /* - * Some systems have the page size in statfs, some in stat + * Some systems have the page size in statfs.f_bsize, some in stat.st_blksize */ -#ifdef HAVE_SYS_STATFS_H -# include <sys/statfs.h> -# define STATFS statfs -# define F_BSIZE f_bsize -# ifdef MINT -# define fstatfs(fd, buf, len, nul) fstat((fd), (buf)) -# endif -#else +#ifdef HAVE_ST_BLKSIZE # define STATFS stat # define F_BSIZE st_blksize # define fstatfs(fd, buf, len, nul) fstat((fd), (buf)) +#else +# ifdef HAVE_SYS_STATFS_H +# include <sys/statfs.h> +# define STATFS statfs +# define F_BSIZE f_bsize +# ifdef MINT /* do we still need this? */ +# define fstatfs(fd, buf, len, nul) fstat((fd), (buf)) +# endif +# endif #endif /* @@ -131,7 +133,8 @@ mf_open(fname, trunc_file) MEMFILE *mfp; int i; off_t size; -#ifdef UNIX +#if defined(STATFS) && defined(UNIX) && !defined(__QNX__) +# define USE_FSTATFS struct STATFS stf; #endif @@ -168,7 +171,7 @@ mf_open(fname, trunc_file) } mfp->mf_page_size = MEMFILE_PAGE_SIZE; -#ifdef UNIX +#ifdef USE_FSTATFS /* * Try to set the page size equal to the block size of the device. * Speeds up I/O a lot. diff --git a/usr.bin/vim/message.c b/usr.bin/vim/message.c index bbd32768b87..5f59d945760 100644 --- a/usr.bin/vim/message.c +++ b/usr.bin/vim/message.c @@ -1,4 +1,4 @@ -/* $OpenBSD: message.c,v 1.3 1996/09/22 01:18:03 downsj Exp $ */ +/* $OpenBSD: message.c,v 1.4 1996/10/14 03:55:16 downsj Exp $ */ /* vi:set ts=4 sw=4: * * VIM - Vi IMproved by Bram Moolenaar @@ -278,7 +278,8 @@ wait_return(redraw) do { c = vgetc(); - got_int = FALSE; + if (!global_busy) + got_int = FALSE; } while (c == Ctrl('C') #ifdef USE_GUI || c == K_SCROLLBAR || c == K_HORIZ_SCROLLBAR diff --git a/usr.bin/vim/misccmds.c b/usr.bin/vim/misccmds.c index c7631498cf7..7f84db7b967 100644 --- a/usr.bin/vim/misccmds.c +++ b/usr.bin/vim/misccmds.c @@ -1,4 +1,4 @@ -/* $OpenBSD: misccmds.c,v 1.3 1996/09/22 01:18:04 downsj Exp $ */ +/* $OpenBSD: misccmds.c,v 1.4 1996/10/14 03:55:18 downsj Exp $ */ /* vi:set ts=4 sw=4: * * VIM - Vi IMproved by Bram Moolenaar @@ -3485,6 +3485,7 @@ get_c_indent() * asdfasdf); * here; */ +term_again: l = ml_get_curline(); if (find_last_paren(l) && (trypos = find_match_paren(ind_maxparen, @@ -3523,7 +3524,10 @@ get_c_indent() if (*skipwhite(l) == '}' && (trypos = find_start_brace(ind_maxcomment)) != NULL) /* XXX */ + { curwin->w_cursor.lnum = trypos->lnum; + goto term_again; + } } } } diff --git a/usr.bin/vim/normal.c b/usr.bin/vim/normal.c index 9dfc5aa30ba..0a7df497fda 100644 --- a/usr.bin/vim/normal.c +++ b/usr.bin/vim/normal.c @@ -1,4 +1,4 @@ -/* $OpenBSD: normal.c,v 1.4 1996/09/26 14:13:07 downsj Exp $ */ +/* $OpenBSD: normal.c,v 1.5 1996/10/14 03:55:20 downsj Exp $ */ /* vi:set ts=4 sw=4: * * VIM - Vi IMproved by Bram Moolenaar @@ -720,7 +720,7 @@ goto_line: --n; } else - n = Prenum; + n = Prenum1 - 1; op_motion_type = MLINE; setpcmark(); curwin->w_cursor.lnum = curwin->w_topline + n; @@ -734,10 +734,10 @@ goto_line: op_motion_type = MLINE; setpcmark(); curwin->w_cursor.lnum = curwin->w_botline - 1; - if (Prenum >= curwin->w_cursor.lnum) + if (Prenum1 - 1 >= curwin->w_cursor.lnum) curwin->w_cursor.lnum = 1; else - curwin->w_cursor.lnum -= Prenum; + curwin->w_cursor.lnum -= Prenum1 - 1; cursor_correct(); /* correct for 'so' */ beginline(MAYBE); break; @@ -968,6 +968,7 @@ lineop: */ if (Prenum1 == 1 && vim_strchr(p_cpo, CPO_CW) != NULL) { + op_inclusive = TRUE; op_motion_type = MCHAR; break; } @@ -985,6 +986,7 @@ lineop: * "cw" will change only one character! This is done by * setting flag2. */ + op_inclusive = TRUE; flag = FALSE; flag2 = TRUE; } @@ -2415,6 +2417,16 @@ do_pending_operator(c, nchar, finish_op, searchbuff, command_busy, colnr_t start, end; op_block_mode = TRUE; + + /* make the start the upper left corner of the block */ + if (curbuf->b_op_start.col > curbuf->b_op_end.col) + { + int t; + + t = curbuf->b_op_start.col; + curbuf->b_op_start.col = curbuf->b_op_end.col; + curbuf->b_op_end.col = t; + } getvcol(curwin, &(curbuf->b_op_start), &op_start_vcol, NULL, &op_end_vcol); if (!redo_VIsual_busy) diff --git a/usr.bin/vim/ops.c b/usr.bin/vim/ops.c index c95fb1571ad..5805a73c6d5 100644 --- a/usr.bin/vim/ops.c +++ b/usr.bin/vim/ops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ops.c,v 1.2 1996/09/21 06:23:13 downsj Exp $ */ +/* $OpenBSD: ops.c,v 1.3 1996/10/14 03:55:22 downsj Exp $ */ /* vi:set ts=4 sw=4: * * VIM - Vi IMproved by Bram Moolenaar @@ -755,7 +755,10 @@ do_delete() /* replace the line */ ml_replace(curwin->w_cursor.lnum, newp, FALSE); } + curwin->w_cursor.lnum = lnum; + adjust_cursor(); + CHANGED; updateScreen(VALID_TO_CURSCHAR); op_line_count = 0; /* no lines deleted */ diff --git a/usr.bin/vim/option.c b/usr.bin/vim/option.c index c9201ce4e05..cabb928e474 100644 --- a/usr.bin/vim/option.c +++ b/usr.bin/vim/option.c @@ -1,4 +1,4 @@ -/* $OpenBSD: option.c,v 1.2 1996/09/21 06:23:14 downsj Exp $ */ +/* $OpenBSD: option.c,v 1.3 1996/10/14 03:55:24 downsj Exp $ */ /* vi:set ts=4 sw=4: * * VIM - Vi IMproved by Bram Moolenaar @@ -263,7 +263,7 @@ static struct option options[] = {"hidden", "hid", P_BOOL, (char_u *)&p_hid, (char_u *)FALSE}, {"highlight", "hl", P_STRING, (char_u *)&p_hl, - (char_u *)"8b,db,es,hs,mb,Mn,nu,rs,sr,tb,vr,ws"}, + (char_u *)"8b,db,es,mb,Mn,nu,rs,sr,tb,vr,ws"}, {"history", "hi", P_NUM, (char_u *)&p_hi, #ifdef COMPATIBLE (char_u *)0L}, diff --git a/usr.bin/vim/screen.c b/usr.bin/vim/screen.c index dbf54324566..331f0305a7a 100644 --- a/usr.bin/vim/screen.c +++ b/usr.bin/vim/screen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: screen.c,v 1.2 1996/09/21 06:23:18 downsj Exp $ */ +/* $OpenBSD: screen.c,v 1.3 1996/10/14 03:55:27 downsj Exp $ */ /* vi:set ts=4 sw=4: * * VIM - Vi IMproved by Bram Moolenaar @@ -2985,14 +2985,14 @@ showmode() if (edit_submode_extra != NULL) { msg_outchar(' '); /* add a space in between */ - if (edit_submode_highl) + if (edit_submode_highl != NUL) { stop_highlight(); - set_highlight('r'); /* Highlight mode */ + set_highlight(edit_submode_highl); /* Highlight mode */ start_highlight(); } msg_outstr(edit_submode_extra); - if (edit_submode_highl) + if (edit_submode_highl != NUL) { stop_highlight(); set_highlight('M'); /* Highlight mode */ diff --git a/usr.bin/vim/tag.c b/usr.bin/vim/tag.c index 10371571f6f..6168baadf5e 100644 --- a/usr.bin/vim/tag.c +++ b/usr.bin/vim/tag.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tag.c,v 1.2 1996/09/21 06:23:21 downsj Exp $ */ +/* $OpenBSD: tag.c,v 1.3 1996/10/14 03:55:28 downsj Exp $ */ /* vi:set ts=4 sw=4: * * VIM - Vi IMproved by Bram Moolenaar @@ -1103,7 +1103,7 @@ jumpto_tag(lbuf, } else /* not a search command, just copy it */ { - for (p = pbuf; *str && *str != '\n'; ) + for (p = pbuf; *str && *str != '\n' && *str != '\r'; ) { #ifdef EMACS_TAGS if (is_etag && *str == ',') /* stop at ',' after line number */ diff --git a/usr.bin/vim/term.c b/usr.bin/vim/term.c index cbd619e34fb..ff77bad39ef 100644 --- a/usr.bin/vim/term.c +++ b/usr.bin/vim/term.c @@ -1,4 +1,4 @@ -/* $OpenBSD: term.c,v 1.3 1996/09/22 01:18:07 downsj Exp $ */ +/* $OpenBSD: term.c,v 1.4 1996/10/14 03:55:30 downsj Exp $ */ /* vi:set ts=4 sw=4: * * VIM - Vi IMproved by Bram Moolenaar @@ -1362,7 +1362,8 @@ getlinecol() { char_u tbuf[TBUFSZ]; - if (term_strings[KS_NAME] != NULL && TGETENT(tbuf, term_strings[KS_NAME]) > 0) + if (term_strings[KS_NAME] != NULL && *term_strings[KS_NAME] != NUL && + TGETENT(tbuf, term_strings[KS_NAME]) > 0) { if (Columns == 0) Columns = tgetnum("co"); diff --git a/usr.bin/vim/unix.c b/usr.bin/vim/unix.c index 3003ef20f5e..9d4a85ff761 100644 --- a/usr.bin/vim/unix.c +++ b/usr.bin/vim/unix.c @@ -1,4 +1,4 @@ -/* $OpenBSD: unix.c,v 1.2 1996/09/21 06:23:24 downsj Exp $ */ +/* $OpenBSD: unix.c,v 1.3 1996/10/14 03:55:32 downsj Exp $ */ /* vi:set ts=4 sw=4: * * VIM - Vi IMproved by Bram Moolenaar @@ -108,7 +108,7 @@ static char_u *oldicon = NULL; static char_u *extra_shell_arg = NULL; static int show_shell_mess = TRUE; #endif -static int core_dump = FALSE; /* core dump in mch_windexit() */ +static int deadly_signal = 0; /* The signal we caught */ #ifdef SYS_SIGLIST_DECLARED /* @@ -126,67 +126,66 @@ static struct { int sig; /* Signal number, eg. SIGSEGV etc */ char *name; /* Signal name (not char_u!). */ - int dump; /* Should this signal cause a core dump? */ } signal_info[] = { #ifdef SIGHUP - {SIGHUP, "HUP", FALSE}, + {SIGHUP, "HUP"}, #endif #ifdef SIGINT - {SIGINT, "INT", FALSE}, + {SIGINT, "INT"}, #endif #ifdef SIGQUIT - {SIGQUIT, "QUIT", TRUE}, + {SIGQUIT, "QUIT"}, #endif #ifdef SIGILL - {SIGILL, "ILL", TRUE}, + {SIGILL, "ILL"}, #endif #ifdef SIGTRAP - {SIGTRAP, "TRAP", TRUE}, + {SIGTRAP, "TRAP"}, #endif #ifdef SIGABRT - {SIGABRT, "ABRT", TRUE}, + {SIGABRT, "ABRT"}, #endif #ifdef SIGEMT - {SIGEMT, "EMT", TRUE}, + {SIGEMT, "EMT"}, #endif #ifdef SIGFPE - {SIGFPE, "FPE", TRUE}, + {SIGFPE, "FPE"}, #endif #ifdef SIGBUS - {SIGBUS, "BUS", TRUE}, + {SIGBUS, "BUS"}, #endif #ifdef SIGSEGV - {SIGSEGV, "SEGV", TRUE}, + {SIGSEGV, "SEGV"}, #endif #ifdef SIGSYS - {SIGSYS, "SYS", TRUE}, + {SIGSYS, "SYS"}, #endif #ifdef SIGALRM - {SIGALRM, "ALRM", FALSE}, + {SIGALRM, "ALRM"}, #endif #ifdef SIGTERM - {SIGTERM, "TERM", FALSE}, + {SIGTERM, "TERM"}, #endif #ifdef SIGVTALRM - {SIGVTALRM, "VTALRM", FALSE}, + {SIGVTALRM, "VTALRM"}, #endif #ifdef SIGPROF - {SIGPROF, "PROF", FALSE}, + {SIGPROF, "PROF"}, #endif #ifdef SIGXCPU - {SIGXCPU, "XCPU", TRUE}, + {SIGXCPU, "XCPU"}, #endif #ifdef SIGXFSZ - {SIGXFSZ, "XFSZ", TRUE}, + {SIGXFSZ, "XFSZ"}, #endif #ifdef SIGUSR1 - {SIGUSR1, "USR1", FALSE}, + {SIGUSR1, "USR1"}, #endif #ifdef SIGUSR2 - {SIGUSR2, "USR2", FALSE}, + {SIGUSR2, "USR2"}, #endif - {-1, "Unknown!", -1} + {-1, "Unknown!"} }; void @@ -395,15 +394,11 @@ deathtrap SIGDEFARG(sigarg) #ifdef SIGHASARG int i; - for (i = 0; signal_info[i].dump != -1; i++) - { + /* try to find the name of this signal */ + for (i = 0; signal_info[i].sig != -1; i++) if (sigarg == signal_info[i].sig) - { - if (signal_info[i].dump) - core_dump = TRUE; break; - } - } + deadly_signal = sigarg; #endif /* @@ -518,7 +513,7 @@ catch_signals(func) { int i; - for (i = 0; signal_info[i].dump != -1; i++) + for (i = 0; signal_info[i].sig != -1; i++) signal(signal_info[i].sig, func); } @@ -1318,11 +1313,11 @@ mch_windexit(r) static void may_core_dump() { -#ifdef SIGQUIT - signal(SIGQUIT, SIG_DFL); - if (core_dump) - kill(getpid(), SIGQUIT); /* force a core dump */ -#endif + if (deadly_signal != 0) + { + signal(deadly_signal, SIG_DFL); + kill(getpid(), deadly_signal); /* Die using the signal we caught */ + } } static int curr_tmode = 0; /* contains current raw/cooked mode (0 = cooked) */ @@ -2423,7 +2418,10 @@ RealWaitForChar(fd, msec) FD_ZERO(&rfds); /* calls bzero() on a sun */ FD_ZERO(&efds); FD_SET(fd, &rfds); +#ifndef __QNX__ + /* For QNX select() always returns 1 if this is set. Why? */ FD_SET(fd, &efds); +#endif return (select(fd + 1, &rfds, NULL, &efds, (msec >= 0) ? &tv : NULL) > 0); #endif } diff --git a/usr.bin/vim/version.c b/usr.bin/vim/version.c index 8c599644fe9..dc8bd6b0353 100644 --- a/usr.bin/vim/version.c +++ b/usr.bin/vim/version.c @@ -1,5 +1,6 @@ -/* $OpenBSD: version.c,v 1.2 1996/09/21 06:23:25 downsj Exp $ */ +/* $OpenBSD: version.c,v 1.3 1996/10/14 03:55:34 downsj Exp $ */ /* vi:set ts=4 sw=4: + * vi:set comments=sbl\:*\ -,mb\:*,el\:*\ -,sr\:/\*,mb\:*,el\:*\/,fb\:- : * * VIM - Vi IMproved by Bram Moolenaar * @@ -19,6 +20,33 @@ * interesting. Differences between version 3.0 and 4.x can be found in * "../doc/vim_40.txt". * + * Changes between version 4.4 BETA and 4.5: + * - Ignore CR in line from tags file, also when there is no search command. + * - Fixed small cindent problem, when using 'cino' with non-zero after '}'. + * - Corrected error message for security violation for tag file commands. + * - Fixed bug: When 'shell' set to "sh", "!echo text >x<Tab>" would create + * the file "x*". Now completion of file names starts after a ">", "<" and + * following "&" and "!" characters. + * - Added a few more changes for QNX. + * - Fixed: when 'showmode' was not set, CTRL-X submode (error) messages would + * not be shown correctly. + * - MSDOS: Fixed computation of mouse area again, didn't work for 50 lines + * screen. + * - Fixed: Cursor was not positioned after ":move" command. + * - Fixed a few compiler warnings for Athena on Sun OS 5.2. + * - Added 'w' flag to 'cpoptions', to fix vi incompatibility for "cw" on a + * row of blanks. + * - Fixed making a core dump on certain signals. + * - Fixed check for Sun OS 4.x.x for xxd.c. + * - Fixed problem with expanding two-character directory names for Win32 + * version. + * - Fixed: highlight mode for completion sub-messages was always 'r', now it + * depends on the type of message: 'e' for errors, 'w' for warnings. + * - Fixed: 'cindentkeys' were not checked when inserting text from a mapping. + * - Fixed: a ":global" that requires input, could not be broken with CTRL-C. + * - Fixed: "1H" and "1L" were off by one line. + * - Included version 1.5 of ctags. + * * Changes between version 4.3 BETA and 4.4 BETA: * - Moved outputting newline from getout() to mch_windexit(). Helps when * switching display pages in xterm after an error message for ":!". @@ -43,7 +71,7 @@ * - Fixed: With GUI Athena the scrollbar could get stuck at the bottom. * - Fixed: When using :imenu to insert more than one line of text, only the * first line could be undone. - * - Fixed: Word completion (CTRL-N) in Insert mode, when there was not + * - Fixed: Word completion (CTRL-N) in Insert mode, when there was no * matching word, the "Pattern not found" message was not shown. * - Fixed: Pattern completion (CTRL-X I) in Insert mode; the file name shown * was overwritten with the mode message. @@ -300,11 +328,11 @@ #include "version.h" -char *Version = "VIM 4.4"; +char *Version = "VIM 4.5"; #ifdef HAVE_DATE_TIME -char *longVersion = "VIM - Vi IMproved 4.4 BETA (1996 Sep 11, compiled " __DATE__ " " __TIME__ ")"; +char *longVersion = "VIM - Vi IMproved 4.5 (1996 Oct 7, compiled " __DATE__ " " __TIME__ ")"; #else -char *longVersion = "VIM - Vi IMproved 4.4 BETA (1996 Sep 11)"; +char *longVersion = "VIM - Vi IMproved 4.5 (1996 Oct 7)"; #endif static void version_msg __ARGS((char *s)); diff --git a/usr.bin/vim/version.h b/usr.bin/vim/version.h index 5949316faee..c85ebbba4e0 100644 --- a/usr.bin/vim/version.h +++ b/usr.bin/vim/version.h @@ -1,4 +1,4 @@ -/* $OpenBSD: version.h,v 1.2 1996/09/21 06:23:26 downsj Exp $ */ +/* $OpenBSD: version.h,v 1.3 1996/10/14 03:55:34 downsj Exp $ */ /* vi:set ts=4 sw=4: * * VIM - Vi IMproved by Bram Moolenaar @@ -22,8 +22,8 @@ #define VIM_VERSION_MAJOR 4 #define VIM_VERSION_MAJOR_STR "4" -#define VIM_VERSION_MINOR 4 -#define VIM_VERSION_MINOR_STR "4" +#define VIM_VERSION_MINOR 5 +#define VIM_VERSION_MINOR_STR "5" #define VIM_VERSION_BUILD 1 #define VIM_VERSION_BUILD_STR "1" diff --git a/usr.bin/vim/vim.h b/usr.bin/vim/vim.h index 0bfd8a88bf6..efbe4aff0c6 100644 --- a/usr.bin/vim/vim.h +++ b/usr.bin/vim/vim.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vim.h,v 1.2 1996/09/21 06:23:27 downsj Exp $ */ +/* $OpenBSD: vim.h,v 1.3 1996/10/14 03:55:36 downsj Exp $ */ /* vi:set ts=4 sw=4: * * VIM - Vi IMproved by Bram Moolenaar @@ -420,7 +420,7 @@ enum auto_events #define TERMBUFSIZE 1024 -#if defined(AMIGA) || defined(__linux__) +#if defined(AMIGA) || defined(__linux__) || defined(__QNX__) # define TBUFSZ 2048 /* buffer size for termcap entry */ #else # define TBUFSZ 1024 /* buffer size for termcap entry */ |