Compare commits

..

30 Commits

Author SHA1 Message Date
Bram Moolenaar
56da797e6d updated for version 7.0-185 2007-01-16 14:46:32 +00:00
Bram Moolenaar
84c4d79ad4 updated for version 7.0-184 2007-01-16 14:18:41 +00:00
Bram Moolenaar
863b53b72e updated for version 7.0-183 2007-01-14 14:28:34 +00:00
Bram Moolenaar
89ed3dfd87 updated for version 7.0-182 2007-01-09 19:23:12 +00:00
Bram Moolenaar
9460b9d215 updated for version 7.0-181 2007-01-09 14:37:01 +00:00
Bram Moolenaar
d675e2c513 updated for version 7.0-180 2007-01-09 14:09:25 +00:00
Bram Moolenaar
df88dda91c updated for version 7.0-179 2007-01-09 13:34:50 +00:00
Bram Moolenaar
201863f75d updated for version 7.0-178 2006-12-05 21:06:46 +00:00
Bram Moolenaar
cf8e7d14aa updated for version 7.0-177 2006-12-05 20:43:17 +00:00
Bram Moolenaar
9c4b4ab3a6 updated for version 7.0-176 2006-12-05 20:29:56 +00:00
Bram Moolenaar
61b974b9ee updated for version 7.0-175 2006-12-05 09:32:29 +00:00
Bram Moolenaar
3b1b6c6259 updated for version 7.0-174 2006-11-28 20:40:00 +00:00
Bram Moolenaar
f278987c97 updated for version 7.0-173 2006-11-28 19:54:04 +00:00
Bram Moolenaar
4632d298ad updated for version 7.0-172 2006-11-28 17:36:37 +00:00
Bram Moolenaar
3d20ca1ad1 updated for version 7.0-171 2006-11-28 16:43:58 +00:00
Bram Moolenaar
85f868c3ae updated for version 7.0-170 2006-11-28 16:16:58 +00:00
Bram Moolenaar
b0c9a85bc8 updated for version 7.0-169 2006-11-28 15:14:56 +00:00
Bram Moolenaar
9334c3447a updated for version 7.0-168 2006-11-21 19:57:30 +00:00
Bram Moolenaar
b42dc236e9 updated for version 7.0-167 2006-11-21 18:36:05 +00:00
Bram Moolenaar
508b9e895d updated for version 7.0-166 2006-11-21 10:43:23 +00:00
Bram Moolenaar
93db975fa4 updated for version 7.0-165 2006-11-21 10:29:45 +00:00
Bram Moolenaar
9a51c6e35d updated for version 7.0-164 2006-11-14 19:25:02 +00:00
Bram Moolenaar
c65c491295 updated for version 7.0-163 2006-11-14 17:29:46 +00:00
Bram Moolenaar
84212825ed updated for version 7.0-162 2006-11-07 21:59:47 +00:00
Bram Moolenaar
908d53a230 updated for version 7.0-161 2006-11-07 18:05:31 +00:00
Bram Moolenaar
d333d1e086 updated for version 7.0-160 2006-11-07 17:43:47 +00:00
Bram Moolenaar
3f2d9814e5 updated for version 7.0-159 2006-11-07 17:02:30 +00:00
Bram Moolenaar
6ae133b915 updated for version 7.0-158 2006-11-01 20:25:45 +00:00
Bram Moolenaar
e9da72e482 updated for version 7.0-157 2006-11-01 17:34:40 +00:00
Bram Moolenaar
5a6404cff4 updated for version 7.0-156 2006-11-01 17:12:57 +00:00
33 changed files with 661 additions and 232 deletions

View File

@@ -1,4 +1,4 @@
*netbeans.txt* For Vim version 7.0. Last change: 2006 Mar 09
*netbeans.txt* For Vim version 7.0. Last change: 2006 Nov 14
VIM REFERENCE MANUAL by Gordon Prieur
@@ -259,8 +259,8 @@ problems and has been fixed in 2.2. To decrease the likelihood of this
confusion happening again, netbeans_saved() has been renamed to
netbeans_save_buffer().
We are now at version 2.3. For the differences between 2.2 and 2.3 search for
"2.3" below.
We are now at version 2.4. For the differences between 2.3 and 2.4 search for
"2.4" below.
The messages are currently sent over a socket. Since the messages are in
plain UTF-8 text this protocol could also be used with any other communication
@@ -605,6 +605,15 @@ getLength Return the length of the buffer in bytes.
getMark Not implemented.
getAnno serNum
Return the line number of the annotation in the buffer.
Argument:
serNum serial number of this placed annotation
The reply is:
123 lnum line number of the annotation
123 0 invalid annotation serial number
New in version 2.4.
getModified When a buffer is specified: Return zero if the buffer does not
have changes, one if it does have changes.
When no buffer is specified (buffer number zero): Return the

View File

@@ -384,7 +384,7 @@ endif
" Programming menu
if !exists("g:ctags_command")
if has("vms")
let g:ctags_command = "mc vim:ctags ."
let g:ctags_command = "mc vim:ctags *.*"
else
let g:ctags_command = "ctags -R ."
endif

View File

@@ -2,7 +2,7 @@
# Makefile for Vim on OpenVMS
#
# Maintainer: Zoltan Arpadffy <arpadffy@polarhome.com>
# Last change: 2006 Apr 30
# Last change: 2006 Sep 04
#
# This has script been tested on VMS 6.2 to 8.2 on DEC Alpha, VAX and IA64
# with MMS and MMK
@@ -13,7 +13,7 @@
#
# Edit the lines in the Configuration section below for fine tuning.
#
# To build: mms/descrip=Make_vms.mms
# To build: mms/descrip=Make_vms.mms /ignore=warning
# To clean up: mms/descrip=Make_vms.mms clean
#
# Hints and detailed description could be found in INSTALLVMS.TXT file.
@@ -21,10 +21,6 @@
######################################################################
# Configuration section.
######################################################################
# Platform selection
# Define this if you will use the VAX platform to build.
# VAX = YES
# VMS version
# Uncomment if you use VMS version 6.2 or older
# OLD_VMS = YES
@@ -49,6 +45,7 @@ GUI = YES
# GUI with GTK
# If you have GTK installed you might want to enable this option.
# NOTE: you will need to properly define GTK_DIR below
# GTK = YES
# GUI/Motif with XPM
@@ -97,7 +94,7 @@ CCVER = YES
# Compiler setup
.IFDEF VAX
.IFDEF MMSVAX
.IFDEF DECC # VAX with DECC
CC_DEF = cc # /decc # some system requires this switch
# but when it is not required /ver might fail
@@ -165,8 +162,8 @@ GTK = ""
# NOTE: you need to set up your GTK_DIR (GTK root directory), because it is
# unique on every system - logicals are not accepted
# please note: directory should end with . in order to /trans=conc work
# Example: GTK_DIR = $1$DGA104:[USERS.ZAY.WORK.GTK1210.]
GTK_DIR = DKA0:[GTK1210.]
# This value for GTK_DIR is an example.
GTK_DIR = $1$DGA104:[USERS.ZAY.WORK.GTK1210.]
DEFS = "HAVE_CONFIG_H","FEAT_GUI_GTK"
LIBS = ,OS_VMS_GTK.OPT/OPT
GUI_FLAG = /name=(as_is,short)/float=ieee/ieee=denorm
@@ -274,7 +271,6 @@ TAG_DEF = ,"FEAT_TAG_ANYWHITE"
# Please, do not change anything below without programming experience.
######################################################################
MODEL_DEF = "FEAT_$(MODEL)",
# These go into pathdef.c
@@ -360,7 +356,8 @@ pathdef.c : check_ccver $(CONFIG_H)
-@ write pd "char_u *all_lflags = (char_u *)""$(LD_DEF)$(LDFLAGS) /exe=$(TARGET) *.OBJ $(ALL_LIBS)"";"
-@ write pd "char_u *compiler_version = (char_u *) ""''CC_VER'"";"
-@ write pd "char_u *compiled_user = (char_u *) "$(VIMUSER)";"
-@ write pd "char_u *compiled_sys = (char_u *) "$(VIMHOST)";"
-@ write pd "char_u *compiled_sys = (char_u *) "$(VIMHOST)";"
-@ write pd "char_u *compiled_arch = (char_u *) ""$(MMSARCH_NAME)"";"
-@ close pd
if_perl.c : if_perl.xs

View File

@@ -4145,11 +4145,13 @@ fix_fname(fname)
/*
* Force expanding the path always for Unix, because symbolic links may
* mess up the full path name, even though it starts with a '/'.
* Also expand always for VMS, it may have alternate paths that need to be
* resolved.
* Also expand when there is ".." in the file name, try to remove it,
* because "c:/src/../README" is equal to "c:/README".
* For MS-Windows also expand names like "longna~1" to "longname".
*/
#ifdef UNIX
#if defined(UNIX) || defined(VMS)
return FullName_save(fname, TRUE);
#else
if (!vim_isAbsName(fname) || strstr((char *)fname, "..") != NULL
@@ -4220,7 +4222,7 @@ alist_name(aep)
/* Use the name from the associated buffer if it exists. */
bp = buflist_findnr(aep->ae_fnum);
if (bp == NULL)
if (bp == NULL || bp->b_fname == NULL)
return aep->ae_fname;
return bp->b_fname;
}

View File

@@ -9204,6 +9204,10 @@ ins_eol(c)
#ifdef FEAT_CINDENT
can_cindent = TRUE;
#endif
#ifdef FEAT_FOLDING
/* When inserting a line the cursor line must never be in a closed fold. */
foldOpenCursor();
#endif
return (!i);
}

View File

@@ -166,7 +166,6 @@ struct ufunc
int uf_tm_count; /* nr of calls */
proftime_T uf_tm_total; /* time spend in function + children */
proftime_T uf_tm_self; /* time spend in function itself */
proftime_T uf_tm_start; /* time at function call */
proftime_T uf_tm_children; /* time spent in children this call */
/* profiling the function per line */
int *uf_tml_count; /* nr of times line was executed */
@@ -899,6 +898,7 @@ set_internal_string_var(name, value)
}
static lval_T *redir_lval = NULL;
static garray_T redir_ga; /* only valid when redir_lval is not NULL */
static char_u *redir_endp = NULL;
static char_u *redir_varname = NULL;
@@ -933,6 +933,9 @@ var_redir_start(name, append)
return FAIL;
}
/* The output is stored in growarray "redir_ga" until redirection ends. */
ga_init2(&redir_ga, (int)sizeof(char), 500);
/* Parse the variable name (can be a dict or list entry). */
redir_endp = get_lval(redir_varname, NULL, redir_lval, FALSE, FALSE, FALSE,
FNE_CHECK_START);
@@ -975,42 +978,36 @@ var_redir_start(name, append)
}
/*
* Append "value[len]" to the variable set by var_redir_start().
* Append "value[value_len]" to the variable set by var_redir_start().
* The actual appending is postponed until redirection ends, because the value
* appended may in fact be the string we write to, changing it may cause freed
* memory to be used:
* :redir => foo
* :let foo
* :redir END
*/
void
var_redir_str(value, len)
var_redir_str(value, value_len)
char_u *value;
int len;
int value_len;
{
char_u *val;
typval_T tv;
int save_emsg;
int err;
size_t len;
if (redir_lval == NULL)
return;
if (len == -1)
/* Append the entire string */
val = vim_strsave(value);
if (value_len == -1)
len = STRLEN(value); /* Append the entire string */
else
/* Append only the specified number of characters */
val = vim_strnsave(value, len);
if (val == NULL)
return;
len = value_len; /* Append only "value_len" characters */
tv.v_type = VAR_STRING;
tv.vval.v_string = val;
save_emsg = did_emsg;
did_emsg = FALSE;
set_var_lval(redir_lval, redir_endp, &tv, FALSE, (char_u *)".");
err = did_emsg;
did_emsg |= save_emsg;
if (err)
if (ga_grow(&redir_ga, (int)len) == OK)
{
mch_memmove((char *)redir_ga.ga_data + redir_ga.ga_len, value, len);
redir_ga.ga_len += len;
}
else
var_redir_stop();
vim_free(tv.vval.v_string);
}
/*
@@ -1019,8 +1016,19 @@ var_redir_str(value, len)
void
var_redir_stop()
{
typval_T tv;
if (redir_lval != NULL)
{
/* Append the trailing NUL. */
ga_append(&redir_ga, NUL);
/* Assign the text to the variable. */
tv.v_type = VAR_STRING;
tv.vval.v_string = redir_ga.ga_data;
set_var_lval(redir_lval, redir_endp, &tv, FALSE, (char_u *)".");
vim_free(tv.vval.v_string);
clear_lval(redir_lval);
vim_free(redir_lval);
redir_lval = NULL;
@@ -3185,9 +3193,18 @@ ex_call(eap)
failed = TRUE;
break;
}
/* Handle a function returning a Funcref, Dictionary or List. */
if (handle_subscript(&arg, &rettv, !eap->skip, TRUE) == FAIL)
{
failed = TRUE;
break;
}
clear_tv(&rettv);
if (doesrange || eap->skip)
break;
/* Stop when immediately aborting on error, or when an interrupt
* occurred or an exception was thrown but not caught.
* get_func_tv() returned OK, so that the check for trailing
@@ -16065,6 +16082,10 @@ error:
}
}
/* add a terminating NUL */
ga_grow(&ga, 1);
ga_append(&ga, NUL);
rettv->vval.v_string = ga.ga_data;
}
@@ -18540,12 +18561,14 @@ ex_function(eap)
if (!eap->skip)
{
/* Check the name of the function. */
/* Check the name of the function. Unless it's a dictionary function
* (that we are overwriting). */
if (name != NULL)
arg = name;
else
arg = fudi.fd_newkey;
if (arg != NULL)
if (arg != NULL && (fudi.fd_di == NULL
|| fudi.fd_di->di_tv.v_type != VAR_FUNC))
{
if (*arg == K_SPECIAL)
j = 3;
@@ -19764,6 +19787,7 @@ call_user_func(fp, argcount, argvars, rettv, firstline, lastline, selfdict)
char_u *name;
#ifdef FEAT_PROFILE
proftime_T wait_start;
proftime_T call_start;
#endif
/* If depth of calling is getting too high, don't execute the function */
@@ -19943,7 +19967,7 @@ call_user_func(fp, argcount, argvars, rettv, firstline, lastline, selfdict)
|| (fc.caller != NULL && &fc.caller->func->uf_profiling))
{
++fp->uf_tm_count;
profile_start(&fp->uf_tm_start);
profile_start(&call_start);
profile_zero(&fp->uf_tm_children);
}
script_prof_save(&wait_start);
@@ -19973,14 +19997,14 @@ call_user_func(fp, argcount, argvars, rettv, firstline, lastline, selfdict)
if (do_profiling == PROF_YES && (fp->uf_profiling
|| (fc.caller != NULL && &fc.caller->func->uf_profiling)))
{
profile_end(&fp->uf_tm_start);
profile_sub_wait(&wait_start, &fp->uf_tm_start);
profile_add(&fp->uf_tm_total, &fp->uf_tm_start);
profile_self(&fp->uf_tm_self, &fp->uf_tm_start, &fp->uf_tm_children);
profile_end(&call_start);
profile_sub_wait(&wait_start, &call_start);
profile_add(&fp->uf_tm_total, &call_start);
profile_self(&fp->uf_tm_self, &call_start, &fp->uf_tm_children);
if (fc.caller != NULL && &fc.caller->func->uf_profiling)
{
profile_add(&fc.caller->func->uf_tm_children, &fp->uf_tm_start);
profile_add(&fc.caller->func->uf_tml_children, &fp->uf_tm_start);
profile_add(&fc.caller->func->uf_tm_children, &call_start);
profile_add(&fc.caller->func->uf_tml_children, &call_start);
}
}
#endif

View File

@@ -8219,8 +8219,9 @@ ex_at(eap)
c = *eap->arg;
if (c == NUL || (c == '*' && *eap->cmd == '*'))
c = '@';
/* put the register in mapbuf */
if (do_execreg(c, TRUE, vim_strchr(p_cpo, CPO_EXECBUF) != NULL) == FAIL)
/* Put the register in the typeahead buffer with the "silent" flag. */
if (do_execreg(c, TRUE, vim_strchr(p_cpo, CPO_EXECBUF) != NULL, TRUE)
== FAIL)
{
beep_flush();
}
@@ -8370,6 +8371,7 @@ ex_redir(eap)
if (ASCII_ISALPHA(*arg)
# ifdef FEAT_CLIPBOARD
|| *arg == '*'
|| *arg == '+'
# endif
|| *arg == '"')
{
@@ -8380,6 +8382,7 @@ ex_redir(eap)
(islower(redir_reg)
# ifdef FEAT_CLIPBOARD
|| redir_reg == '*'
|| redir_reg == '+'
# endif
|| redir_reg == '"'))
{
@@ -9672,6 +9675,7 @@ makeopens(fd, dirnow)
win_T *edited_win = NULL;
int tabnr;
win_T *tab_firstwin;
frame_T *tab_topframe;
if (ssop_flags & SSOP_BUFFERS)
only_save_windows = FALSE; /* Save ALL buffers */
@@ -9783,6 +9787,7 @@ makeopens(fd, dirnow)
* autocommands.
*/
tab_firstwin = firstwin; /* first window in tab page "tabnr" */
tab_topframe = topframe;
for (tabnr = 1; ; ++tabnr)
{
int need_tabnew = FALSE;
@@ -9794,9 +9799,15 @@ makeopens(fd, dirnow)
if (tp == NULL)
break; /* done all tab pages */
if (tp == curtab)
{
tab_firstwin = firstwin;
tab_topframe = topframe;
}
else
{
tab_firstwin = tp->tp_firstwin;
tab_topframe = tp->tp_topframe;
}
if (tabnr > 1)
need_tabnew = TRUE;
}
@@ -9835,7 +9846,7 @@ makeopens(fd, dirnow)
*/
if (put_line(fd, "set splitbelow splitright") == FAIL)
return FAIL;
if (ses_win_rec(fd, topframe) == FAIL)
if (ses_win_rec(fd, tab_topframe) == FAIL)
return FAIL;
if (!p_sb && put_line(fd, "set nosplitbelow") == FAIL)
return FAIL;

View File

@@ -340,7 +340,7 @@ do_errthrow(cstack, cmdname)
/* If no exception is to be thrown or the conversion should be done after
* returning to a previous invocation of do_one_cmd(), do nothing. */
if (*msg_list == NULL)
if (msg_list == NULL || *msg_list == NULL)
return;
if (throw_exception(*msg_list, ET_ERROR, cmdname) == FAIL)
@@ -2026,8 +2026,11 @@ leave_cleanup(csp)
/* If an error was about to be converted to an exception when
* enter_cleanup() was called, free the message list. */
free_msglist(*msg_list);
*msg_list = NULL;
if (msg_list != NULL)
{
free_msglist(*msg_list);
*msg_list = NULL;
}
}
/*

View File

@@ -34,7 +34,7 @@ struct cmdline_info
int xp_context; /* type of expansion */
# ifdef FEAT_EVAL
char_u *xp_arg; /* user-defined expansion arg */
int input_fn; /* Invoked for input() function */
int input_fn; /* when TRUE Invoked for input() function */
# endif
};
@@ -1390,7 +1390,17 @@ getcmdline(firstc, count, indent)
{
c = gchar_cursor();
if (c != NUL)
{
if (c == firstc || vim_strchr((char_u *)(
p_magic ? "\\^$.*[" : "\\^$"), c)
!= NULL)
{
/* put a backslash before special characters */
stuffcharReadbuff(c);
c = '\\';
}
break;
}
}
goto cmdline_not_changed;
}

View File

@@ -1133,7 +1133,7 @@
/*
* +ARP Amiga only. Use arp.library, DOS 2.0 is not required.
*/
#ifndef NO_ARP
#if !defined(NO_ARP) && !defined(__amigaos4__)
# define FEAT_ARP
#endif

View File

@@ -6178,8 +6178,8 @@ move_lines(frombuf, tobuf)
if (retval != FAIL)
{
curbuf = frombuf;
while (!bufempty())
if (ml_delete(curbuf->b_ml.ml_line_count, FALSE) == FAIL)
for (lnum = curbuf->b_ml.ml_line_count; lnum > 0; --lnum)
if (ml_delete(lnum, FALSE) == FAIL)
{
/* Oops! We could try putting back the saved lines, but that
* might fail again... */

View File

@@ -76,7 +76,7 @@ static int maphash_valid = FALSE;
*/
static mapblock_T *first_abbr = NULL; /* first entry in abbrlist */
static int KeyNoremap = FALSE; /* remapping disabled */
static int KeyNoremap = 0; /* remapping flags */
/*
* variables used by vgetorpeek() and flush_buffers()
@@ -1035,6 +1035,8 @@ ins_typebuf(str, noremap, offset, nottyped, silent)
/*
* Put character "c" back into the typeahead buffer.
* Can be used for a character obtained by vgetc() that needs to be put back.
* Uses cmd_silent, KeyTyped and KeyNoremap to restore the flags belonging to
* the char.
*/
void
ins_char_typebuf(c)
@@ -1061,7 +1063,7 @@ ins_char_typebuf(c)
buf[1] = NUL;
#endif
}
(void)ins_typebuf(buf, REMAP_YES, 0, !KeyTyped, FALSE);
(void)ins_typebuf(buf, KeyNoremap, 0, !KeyTyped, cmd_silent);
}
/*
@@ -2270,9 +2272,8 @@ vgetorpeek(advance)
gotchars(typebuf.tb_buf
+ typebuf.tb_off, 1);
}
KeyNoremap = (typebuf.tb_noremap[
typebuf.tb_off]
& (RM_NONE|RM_SCRIPT));
KeyNoremap = typebuf.tb_noremap[
typebuf.tb_off];
del_typebuf(1, 0);
}
break; /* got character, break for loop */
@@ -4196,7 +4197,8 @@ check_abbr(c, ptr, col, mincol)
if (typebuf.tb_no_abbr_cnt) /* abbrev. are not recursive */
return FALSE;
if (KeyNoremap) /* no remapping implies no abbreviation */
if ((KeyNoremap & (RM_NONE|RM_SCRIPT)) != 0)
/* no remapping implies no abbreviation */
return FALSE;
/*

View File

@@ -1092,6 +1092,7 @@ extern char_u *all_cflags;
extern char_u *all_lflags;
# ifdef VMS
extern char_u *compiler_version;
extern char_u *compiled_arch;
# endif
extern char_u *compiled_user;
extern char_u *compiled_sys;

View File

@@ -2216,11 +2216,55 @@ gui_mch_show_toolbar(int showit)
#endif
#if defined(FEAT_GUI_TABLINE) || defined(PROTO)
static void
add_tabline_popup_menu_entry(HMENU pmenu, UINT item_id, char_u *item_text)
{
#ifdef FEAT_MBYTE
WCHAR *wn = NULL;
int n;
if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
{
/* 'encoding' differs from active codepage: convert menu name
* and use wide function */
wn = enc_to_ucs2(item_text, NULL);
if (wn != NULL)
{
MENUITEMINFOW infow;
infow.cbSize = sizeof(infow);
infow.fMask = MIIM_TYPE | MIIM_ID;
infow.wID = item_id;
infow.fType = MFT_STRING;
infow.dwTypeData = wn;
infow.cch = (UINT)wcslen(wn);
n = InsertMenuItemW(pmenu, item_id, FALSE, &infow);
vim_free(wn);
if (n == 0 && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
/* Failed, try using non-wide function. */
wn = NULL;
}
}
if (wn == NULL)
#endif
{
MENUITEMINFO info;
info.cbSize = sizeof(info);
info.fMask = MIIM_TYPE | MIIM_ID;
info.wID = item_id;
info.fType = MFT_STRING;
info.dwTypeData = item_text;
info.cch = (UINT)STRLEN(item_text);
InsertMenuItem(pmenu, item_id, FALSE, &info);
}
}
static void
show_tabline_popup_menu(void)
{
HMENU tab_pmenu;
MENUITEMINFO minfo;
long rval;
POINT pt;
@@ -2236,21 +2280,10 @@ show_tabline_popup_menu(void)
if (tab_pmenu == NULL)
return;
minfo.cbSize = sizeof(MENUITEMINFO);
minfo.fMask = MIIM_TYPE|MIIM_ID;
minfo.fType = MFT_STRING;
minfo.dwTypeData = _("Close tab");
minfo.wID = TABLINE_MENU_CLOSE;
InsertMenuItem(tab_pmenu, TABLINE_MENU_CLOSE, FALSE, &minfo);
minfo.dwTypeData = _("New tab");
minfo.wID = TABLINE_MENU_NEW;
InsertMenuItem(tab_pmenu, TABLINE_MENU_NEW, FALSE, &minfo);
minfo.dwTypeData = _("Open tab...");
minfo.wID = TABLINE_MENU_OPEN;
InsertMenuItem(tab_pmenu, TABLINE_MENU_OPEN, FALSE, &minfo);
add_tabline_popup_menu_entry(tab_pmenu, TABLINE_MENU_CLOSE, _("Close tab"));
add_tabline_popup_menu_entry(tab_pmenu, TABLINE_MENU_NEW, _("New tab"));
add_tabline_popup_menu_entry(tab_pmenu, TABLINE_MENU_OPEN,
_("Open tab..."));
GetCursorPos(&pt);
rval = TrackPopupMenuEx(tab_pmenu, TPM_RETURNCMD, pt.x, pt.y, s_tabhwnd,
@@ -2372,8 +2405,7 @@ gui_mch_update_tabline(void)
tiw.mask = TCIF_TEXT;
tiw.iImage = -1;
tiw.pszText = wstr;
SendMessage(s_tabhwnd, TCM_INSERTITEMW, (WPARAM)nr,
(LPARAM)&tiw);
SendMessage(s_tabhwnd, TCM_SETITEMW, (WPARAM)nr, (LPARAM)&tiw);
vim_free(wstr);
}
}
@@ -2455,6 +2487,30 @@ initialise_findrep(char_u *initial_string)
}
#endif
static void
set_window_title(HWND hwnd, char *title)
{
#ifdef FEAT_MBYTE
if (title != NULL && enc_codepage >= 0 && enc_codepage != (int)GetACP())
{
WCHAR *wbuf;
int n;
/* Convert the title from 'encoding' to ucs2. */
wbuf = (WCHAR *)enc_to_ucs2((char_u *)title, NULL);
if (wbuf != NULL)
{
n = SetWindowTextW(hwnd, wbuf);
vim_free(wbuf);
if (n != 0 || GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
return;
/* Retry with non-wide function (for Windows 98). */
}
}
#endif
(void)SetWindowText(hwnd, (LPCSTR)title);
}
void
gui_mch_find_dialog(exarg_T *eap)
{
@@ -2470,8 +2526,8 @@ gui_mch_find_dialog(exarg_T *eap)
s_findrep_hwnd = FindText((LPFINDREPLACE) &s_findrep_struct);
}
(void)SetWindowText(s_findrep_hwnd,
(LPCSTR)_("Find string (use '\\\\' to find a '\\')"));
set_window_title(s_findrep_hwnd,
_("Find string (use '\\\\' to find a '\\')"));
(void)SetFocus(s_findrep_hwnd);
s_findrep_is_find = TRUE;
@@ -2495,8 +2551,8 @@ gui_mch_replace_dialog(exarg_T *eap)
s_findrep_hwnd = ReplaceText((LPFINDREPLACE) &s_findrep_struct);
}
(void)SetWindowText(s_findrep_hwnd,
(LPCSTR)_("Find & Replace (use '\\\\' to find a '\\')"));
set_window_title(s_findrep_hwnd,
_("Find & Replace (use '\\\\' to find a '\\')"));
(void)SetFocus(s_findrep_hwnd);
s_findrep_is_find = FALSE;
@@ -2976,13 +3032,25 @@ gui_mch_init_font(char_u *font_name, int fontset)
return OK;
}
#ifndef WPF_RESTORETOMAXIMIZED
# define WPF_RESTORETOMAXIMIZED 2 /* just in case someone doesn't have it */
#endif
/*
* Return TRUE if the GUI window is maximized, filling the whole screen.
*/
int
gui_mch_maximized()
{
return IsZoomed(s_hwnd);
WINDOWPLACEMENT wp;
wp.length = sizeof(WINDOWPLACEMENT);
if (GetWindowPlacement(s_hwnd, &wp))
return wp.showCmd == SW_SHOWMAXIMIZED
|| (wp.showCmd == SW_SHOWMINIMIZED
&& wp.flags == WPF_RESTORETOMAXIMIZED);
return 0;
}
/*
@@ -3015,25 +3083,7 @@ gui_mch_settitle(
char_u *title,
char_u *icon)
{
#ifdef FEAT_MBYTE
if (title != NULL && enc_codepage >= 0 && enc_codepage != (int)GetACP())
{
WCHAR *wbuf;
int n;
/* Convert the title from 'encoding' to ucs2. */
wbuf = (WCHAR *)enc_to_ucs2(title, NULL);
if (wbuf != NULL)
{
n = SetWindowTextW(s_hwnd, wbuf);
vim_free(wbuf);
if (n != 0 || GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
return;
/* Retry with non-wide function (for Windows 98). */
}
}
#endif
SetWindowText(s_hwnd, (LPCSTR)(title == NULL ? "VIM" : (char *)title));
set_window_title(s_hwnd, (title == NULL ? "VIM" : (char *)title));
}
#ifdef FEAT_MOUSESHAPE

View File

@@ -627,10 +627,11 @@ cs_cnt_matches(idx)
* If the database is out of date, or there's some other problem,
* cscope will output error messages before the number-of-lines output.
* Display/discard any output that doesn't match what we want.
* Accept "\S*cscope: X lines", also matches "mlcscope".
*/
if ((stok = strtok(buf, (const char *)" ")) == NULL)
continue;
if (strcmp((const char *)stok, "cscope:"))
if (strstr((const char *)stok, "cscope:") == NULL)
continue;
if ((stok = strtok(NULL, (const char *)" ")) == NULL)
@@ -1008,7 +1009,7 @@ cs_find_common(opt, pat, forceit, verbose, use_ll)
totmatches = 0;
for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
{
if (csinfo[i].fname == NULL)
if (csinfo[i].fname == NULL || csinfo[i].to_fp == NULL)
continue;
/* send cmd to cscope */

View File

@@ -2392,7 +2392,23 @@ create_windows(parmp)
(void)open_buffer(FALSE, NULL); /* create memfile, read file */
#if defined(HAS_SWAP_EXISTS_ACTION)
check_swap_exists_action();
if (swap_exists_action == SEA_QUIT)
{
if (got_int || only_one_window())
{
/* abort selected or quit and only one window */
did_emsg = FALSE; /* avoid hit-enter prompt */
getout(1);
}
/* We can't close the window, it would disturb what
* happens next. Clear the file name and set the arg
* index to -1 to delete it later. */
setfname(curbuf, NULL, NULL, FALSE);
curwin->w_arg_idx = -1;
swap_exists_action = SEA_NONE;
}
else
handle_swap_exists(NULL);
#endif
#ifdef FEAT_AUTOCMD
dorewind = TRUE; /* start again */
@@ -2432,6 +2448,8 @@ edit_buffers(parmp)
{
int arg_idx; /* index in argument list */
int i;
int advance = TRUE;
buf_T *old_curbuf;
# ifdef FEAT_AUTOCMD
/*
@@ -2440,31 +2458,65 @@ edit_buffers(parmp)
++autocmd_no_enter;
++autocmd_no_leave;
# endif
/* When w_arg_idx is -1 remove the window (see create_windows()). */
if (curwin->w_arg_idx == -1)
{
win_close(curwin, TRUE);
advance = FALSE;
}
arg_idx = 1;
for (i = 1; i < parmp->window_count; ++i)
{
if (parmp->window_layout == WIN_TABS)
/* When w_arg_idx is -1 remove the window (see create_windows()). */
if (curwin->w_arg_idx == -1)
{
if (curtab->tp_next == NULL) /* just checking */
break;
goto_tabpage(0);
}
else
{
if (curwin->w_next == NULL) /* just checking */
break;
win_enter(curwin->w_next, FALSE);
++arg_idx;
win_close(curwin, TRUE);
advance = FALSE;
continue;
}
if (advance)
{
if (parmp->window_layout == WIN_TABS)
{
if (curtab->tp_next == NULL) /* just checking */
break;
goto_tabpage(0);
}
else
{
if (curwin->w_next == NULL) /* just checking */
break;
win_enter(curwin->w_next, FALSE);
}
}
advance = TRUE;
/* Only open the file if there is no file in this window yet (that can
* happen when .vimrc contains ":sall") */
* happen when .vimrc contains ":sall"). */
if (curbuf == firstwin->w_buffer || curbuf->b_ffname == NULL)
{
curwin->w_arg_idx = arg_idx;
/* edit file from arg list, if there is one */
/* Edit file from arg list, if there is one. When "Quit" selected
* at the ATTENTION prompt close the window. */
old_curbuf = curbuf;
(void)do_ecmd(0, arg_idx < GARGCOUNT
? alist_name(&GARGLIST[arg_idx]) : NULL,
NULL, NULL, ECMD_LASTL, ECMD_HIDE);
if (curbuf == old_curbuf)
{
if (got_int || only_one_window())
{
/* abort selected or quit and only one window */
did_emsg = FALSE; /* avoid hit-enter prompt */
getout(1);
}
win_close(curwin, TRUE);
advance = FALSE;
}
if (arg_idx == GARGCOUNT - 1)
arg_had_last = TRUE;
++arg_idx;

View File

@@ -667,7 +667,7 @@ codepage_invalid:
* API */
n = IsDBCSLeadByteEx(enc_dbcs, (BYTE)i) ? 2 : 1;
#else
# ifdef MACOS
# if defined(MACOS) || defined(__amigaos4__)
/*
* if mblen() is not available, character which MSB is turned on
* are treated as leading byte character. (note : This assumption
@@ -2294,8 +2294,14 @@ mb_strnicmp(s1, s2, nn)
}
/* Check directly first, it's faster. */
for (j = 0; j < l; ++j)
{
if (s1[i + j] != s2[i + j])
break;
if (s1[i + j] == 0)
/* Both stings have the same bytes but are incomplete or
* have illegal bytes, accept them as equal. */
l = j;
}
if (j < l)
{
/* If one of the two characters is incomplete return -1. */

View File

@@ -655,7 +655,7 @@ mf_sync(mfp, flags)
# endif
#endif
#ifdef AMIGA
# ifdef __AROS__
# if defined(__AROS__) || defined(__amigaos4__)
if (fsync(mfp->mf_fd) != 0)
status = FAIL;
# else
@@ -1028,12 +1028,12 @@ mf_read(mfp, hp)
size = page_size * hp->bh_page_count;
if (lseek(mfp->mf_fd, offset, SEEK_SET) != offset)
{
EMSG(_("E294: Seek error in swap file read"));
PERROR(_("E294: Seek error in swap file read"));
return FAIL;
}
if ((unsigned)vim_read(mfp->mf_fd, hp->bh_data, size) != size)
{
EMSG(_("E295: Read error in swap file"));
PERROR(_("E295: Read error in swap file"));
return FAIL;
}
return OK;
@@ -1085,7 +1085,7 @@ mf_write(mfp, hp)
offset = (off_t)page_size * nr;
if (lseek(mfp->mf_fd, offset, SEEK_SET) != offset)
{
EMSG(_("E296: Seek error in swap file write"));
PERROR(_("E296: Seek error in swap file write"));
return FAIL;
}
if (hp2 == NULL) /* freed block, fill with dummy data */

View File

@@ -55,10 +55,14 @@
# include <time.h>
#endif
#ifdef SASC
#if defined(SASC) || defined(__amigaos4__)
# include <proto/dos.h> /* for Open() and Close() */
#endif
#ifdef HAVE_ERRNO_H
# include <errno.h>
#endif
typedef struct block0 ZERO_BL; /* contents of the first block */
typedef struct pointer_block PTR_BL; /* contents of a pointer block */
typedef struct data_block DATA_BL; /* contents of a data block */
@@ -1325,7 +1329,11 @@ theend:
mf_put(mfp, hp, FALSE, FALSE);
mf_close(mfp, FALSE); /* will also vim_free(mfp->mf_fname) */
}
vim_free(buf);
if (buf != NULL)
{
vim_free(buf->b_ml.ml_stack);
vim_free(buf);
}
if (serious_error && called_from_main)
ml_close(curbuf, TRUE);
#ifdef FEAT_AUTOCMD
@@ -3564,8 +3572,9 @@ makeswapname(fname, ffname, buf, dir_name)
#else
(buf->b_p_sn || buf->b_shortname),
#endif
#ifdef RISCOS
/* Avoid problems if fname has special chars, eg <Wimp$Scrap> */
#if defined(VMS) || defined(RISCOS)
/* Avoid problems if fname has special chars, eg <Wimp$Scrap>.
* For VMS always use full path for swapfile. */
ffname,
#else
# ifdef HAVE_READLINK
@@ -4481,7 +4490,7 @@ ml_updatechunk(buf, line, len, updtype)
curchnk = buf->b_ml.ml_chunksize + curix;
if (updtype == ML_CHNK_DELLINE)
len *= -1;
len = -len;
curchnk->mlcs_totalsize += len;
if (updtype == ML_CHNK_ADDLINE)
{

View File

@@ -2246,7 +2246,7 @@ ex_emenu(eap)
{
/* When executing a script or function execute the commands right now.
* Otherwise put them in the typeahead buffer. */
#ifdef FEAT_En
#ifdef FEAT_EVAL
if (current_SID != 0)
exec_normal_cmd(menu->strings[idx], menu->noremap[idx],
menu->silent[idx]);

View File

@@ -1556,7 +1556,7 @@ msg_prt_line(s, list)
int c_extra = 0;
char_u *p_extra = NULL; /* init to make SASC shut up */
int n;
int attr= 0;
int attr = 0;
char_u *trail = NULL;
#ifdef FEAT_MBYTE
int l;
@@ -1581,7 +1581,7 @@ msg_prt_line(s, list)
while (!got_int)
{
if (n_extra)
if (n_extra > 0)
{
--n_extra;
if (c_extra)
@@ -1595,7 +1595,7 @@ msg_prt_line(s, list)
col += (*mb_ptr2cells)(s);
mch_memmove(buf, s, (size_t)l);
buf[l] = NUL;
msg_puts_attr(buf, attr);
msg_puts(buf);
s += l;
continue;
}
@@ -1635,6 +1635,9 @@ msg_prt_line(s, list)
p_extra = transchar_byte(c);
c_extra = NUL;
c = *p_extra++;
/* Use special coloring to be able to distinguish <hex> from
* the same in plain text. */
attr = hl_attr(HLF_8);
}
else if (c == ' ' && trail != NULL && s > trail)
{

View File

@@ -61,7 +61,7 @@
/* The first implementation (working only with Netbeans) returned "1.1". The
* protocol implemented here also supports A-A-P. */
static char *ExtEdProtocolVersion = "2.3";
static char *ExtEdProtocolVersion = "2.4";
static long pos2off __ARGS((buf_T *, pos_T *));
static pos_T *off2pos __ARGS((buf_T *, long));
@@ -1269,6 +1269,29 @@ nb_do_cmd(
(int)curwin->w_cursor.col,
pos2off(curbuf, &curwin->w_cursor));
nb_reply_text(cmdno, text);
/* =====================================================================*/
}
else if (streq((char *)cmd, "getAnno"))
{
long linenum = 0;
#ifdef FEAT_SIGNS
if (buf == NULL || buf->bufp == NULL)
{
nbdebug((" null bufp in getAnno"));
EMSG("E652: null bufp in getAnno");
retval = FAIL;
}
else
{
int serNum;
cp = (char *)args;
serNum = strtol(cp, &cp, 10);
/* If the sign isn't found linenum will be zero. */
linenum = (long)buf_findsign(buf->bufp, serNum);
}
#endif
nb_reply_nr(cmdno, linenum);
/* =====================================================================*/
}
else if (streq((char *)cmd, "getLength"))

View File

@@ -651,9 +651,8 @@ normal_cmd(oap, toplevel)
/* Fake a "c"hange command. When "restart_edit" is set (e.g., because
* 'insertmode' is set) fake a "d"elete command, Insert mode will
* restart automatically.
* Insert the typed character in the typeahead buffer, so that it will
* be mapped in Insert mode. Required for ":lmap" to work. May cause
* mapping a character from ":vnoremap"... */
* Insert the typed character in the typeahead buffer, so that it can
* be mapped in Insert mode. Required for ":lmap" to work. */
ins_char_typebuf(c);
if (restart_edit != 0)
c = 'd';
@@ -8860,7 +8859,7 @@ nv_at(cap)
#endif
while (cap->count1-- && !got_int)
{
if (do_execreg(cap->nchar, FALSE, FALSE) == FAIL)
if (do_execreg(cap->nchar, FALSE, FALSE, FALSE) == FAIL)
{
clearopbeep(cap->oap);
break;

View File

@@ -95,8 +95,8 @@ static void shift_block __ARGS((oparg_T *oap, int amount));
static void block_insert __ARGS((oparg_T *oap, char_u *s, int b_insert, struct block_def*bdp));
#endif
static int stuff_yank __ARGS((int, char_u *));
static void put_reedit_in_typebuf __ARGS((void));
static int put_in_typebuf __ARGS((char_u *s, int colon));
static void put_reedit_in_typebuf __ARGS((int silent));
static int put_in_typebuf __ARGS((char_u *s, int colon, int silent));
static void stuffescaped __ARGS((char_u *arg, int literally));
#ifdef FEAT_MBYTE
static void mb_adjust_opend __ARGS((oparg_T *oap));
@@ -1120,10 +1120,11 @@ stuff_yank(regname, p)
* return FAIL for failure, OK otherwise
*/
int
do_execreg(regname, colon, addcr)
do_execreg(regname, colon, addcr, silent)
int regname;
int colon; /* insert ':' before each line */
int addcr; /* always add '\n' to end of line */
int silent; /* set "silent" flag in typeahead buffer */
{
static int lastc = NUL;
long i;
@@ -1173,9 +1174,9 @@ do_execreg(regname, colon, addcr)
/* When in Visual mode "'<,'>" will be prepended to the command.
* Remove it when it's already there. */
if (VIsual_active && STRNCMP(p, "'<,'>", 5) == 0)
retval = put_in_typebuf(p + 5, TRUE);
retval = put_in_typebuf(p + 5, TRUE, silent);
else
retval = put_in_typebuf(p, TRUE);
retval = put_in_typebuf(p, TRUE, silent);
}
vim_free(p);
}
@@ -1186,7 +1187,7 @@ do_execreg(regname, colon, addcr)
p = get_expr_line();
if (p == NULL)
return FAIL;
retval = put_in_typebuf(p, colon);
retval = put_in_typebuf(p, colon, silent);
vim_free(p);
}
#endif
@@ -1198,7 +1199,7 @@ do_execreg(regname, colon, addcr)
EMSG(_(e_noinstext));
return FAIL;
}
retval = put_in_typebuf(p, colon);
retval = put_in_typebuf(p, colon, silent);
vim_free(p);
}
else
@@ -1213,20 +1214,20 @@ do_execreg(regname, colon, addcr)
/*
* Insert lines into typeahead buffer, from last one to first one.
*/
put_reedit_in_typebuf();
put_reedit_in_typebuf(silent);
for (i = y_current->y_size; --i >= 0; )
{
/* insert NL between lines and after last line if type is MLINE */
if (y_current->y_type == MLINE || i < y_current->y_size - 1
|| addcr)
{
if (ins_typebuf((char_u *)"\n", remap, 0, TRUE, FALSE) == FAIL)
if (ins_typebuf((char_u *)"\n", remap, 0, TRUE, silent) == FAIL)
return FAIL;
}
if (ins_typebuf(y_current->y_array[i], remap, 0, TRUE, FALSE)
if (ins_typebuf(y_current->y_array[i], remap, 0, TRUE, silent)
== FAIL)
return FAIL;
if (colon && ins_typebuf((char_u *)":", remap, 0, TRUE, FALSE)
if (colon && ins_typebuf((char_u *)":", remap, 0, TRUE, silent)
== FAIL)
return FAIL;
}
@@ -1240,7 +1241,8 @@ do_execreg(regname, colon, addcr)
* used only after other typeahead has been processed.
*/
static void
put_reedit_in_typebuf()
put_reedit_in_typebuf(silent)
int silent;
{
char_u buf[3];
@@ -1257,25 +1259,26 @@ put_reedit_in_typebuf()
buf[0] = restart_edit == 'I' ? 'i' : restart_edit;
buf[1] = NUL;
}
if (ins_typebuf(buf, REMAP_NONE, 0, TRUE, FALSE) == OK)
if (ins_typebuf(buf, REMAP_NONE, 0, TRUE, silent) == OK)
restart_edit = NUL;
}
}
static int
put_in_typebuf(s, colon)
put_in_typebuf(s, colon, silent)
char_u *s;
int colon; /* add ':' before the line */
int silent;
{
int retval = OK;
put_reedit_in_typebuf();
put_reedit_in_typebuf(silent);
if (colon)
retval = ins_typebuf((char_u *)"\n", REMAP_YES, 0, TRUE, FALSE);
retval = ins_typebuf((char_u *)"\n", REMAP_YES, 0, TRUE, silent);
if (retval == OK)
retval = ins_typebuf(s, REMAP_YES, 0, TRUE, FALSE);
retval = ins_typebuf(s, REMAP_YES, 0, TRUE, silent);
if (colon && retval == OK)
retval = ins_typebuf((char_u *)":", REMAP_YES, 0, TRUE, FALSE);
retval = ins_typebuf((char_u *)":", REMAP_YES, 0, TRUE, silent);
return retval;
}

View File

@@ -30,20 +30,31 @@
# include <exec/types.h>
# include <exec/exec.h>
# include <libraries/dos.h>
# include <libraries/dosextens.h>
# include <intuition/intuition.h>
#else
# include <proto/dos.h>
# include <libraries/dosextens.h>
# include <proto/intuition.h>
# include <proto/exec.h>
#endif
/* XXX These are included from os_amiga.h
#include <proto/exec.h>
#include <proto/dos.h>
#include <proto/intuition.h>
*/
#include <exec/memory.h>
#include <libraries/dosextens.h>
#include <dos/dostags.h> /* for 2.0 functions */
#include <dos/dosasl.h>
/* From version 4 of AmigaOS, several system structures must be allocated
* and freed using system functions. "struct AnchorPath" is one.
*/
#ifdef __amigaos4__
# include <dos/anchorpath.h>
# define free_fib(x) FreeDosObject(DOS_FIB, x)
#else
# define free_fib(x) vim_free(fib)
#endif
#if defined(LATTICE) && !defined(SASC) && defined(FEAT_ARP)
# include <libraries/arp_pragmas.h>
#endif
@@ -56,7 +67,9 @@
#undef FALSE
#define FALSE (0)
#if !defined(AZTEC_C) && !defined(__AROS__)
#ifdef __amigaos4__
# define dos_packet(a, b, c) DoPkt(a, b, c, 0, 0, 0, 0)
#elif !defined(AZTEC_C) && !defined(__AROS__)
static long dos_packet __ARGS((struct MsgPort *, long, long));
#endif
static int lock2name __ARGS((BPTR lock, char_u *buf, long len));
@@ -68,7 +81,9 @@ static BPTR raw_in = (BPTR)NULL;
static BPTR raw_out = (BPTR)NULL;
static int close_win = FALSE; /* set if Vim opened the window */
#ifndef __amigaos4__ /* Use autoopen for AmigaOS4 */
struct IntuitionBase *IntuitionBase = NULL;
#endif
#ifdef FEAT_ARP
struct ArpBase *ArpBase = NULL;
#endif
@@ -186,9 +201,17 @@ mch_char_avail()
mch_avail_mem(special)
int special;
{
#ifdef __amigaos4__
return (long_u)AvailMem(MEMF_ANY);
#else
return (long_u)AvailMem(special ? (long)MEMF_CHIP : (long)MEMF_ANY);
#endif
}
/*
* Waits a specified amount of time, or until input arrives if
* ignoreinput is FALSE.
*/
void
mch_delay(msec, ignoreinput)
long msec;
@@ -252,6 +275,7 @@ mch_init()
out_flush();
wb_window = NULL;
#ifndef __amigaos4__
if ((IntuitionBase = (struct IntuitionBase *)
OpenLibrary((UBYTE *)intlibname, 0L)) == NULL)
{
@@ -260,6 +284,7 @@ mch_init()
mch_errmsg("!?\n");
mch_exit(3);
}
#endif
}
#include <workbench/startup.h>
@@ -284,7 +309,7 @@ mch_check_win(argc, argv)
{
int i;
BPTR nilfh, fh;
char_u buf1[20];
char_u buf1[24];
char_u buf2[BUF2SIZE];
static char_u *(constrings[3]) = {(char_u *)"con:0/0/662/210/",
(char_u *)"con:0/0/640/200/",
@@ -295,35 +320,39 @@ mch_check_win(argc, argv)
char *av;
char_u *device = NULL;
int exitval = 4;
#ifndef __amigaos4__
struct Library *DosBase;
#endif
int usewin = FALSE;
/*
* check if we are running under DOS 2.0x or higher
*/
#ifndef __amigaos4__
DosBase = OpenLibrary(DOS_LIBRARY, 37L);
if (DosBase != NULL)
/* if (((struct Library *)DOSBase)->lib_Version >= 37) */
{
CloseLibrary(DosBase);
#ifdef FEAT_ARP
# ifdef FEAT_ARP
dos2 = TRUE;
#endif
# endif
}
else /* without arp functions we NEED 2.0 */
{
#ifndef FEAT_ARP
# ifndef FEAT_ARP
mch_errmsg(_("Need Amigados version 2.04 or later\n"));
exit(3);
#else
# else
/* need arp functions for dos 1.x */
if (!(ArpBase = (struct ArpBase *) OpenLibrary((UBYTE *)ArpName, ArpVersion)))
{
fprintf(stderr, _("Need %s version %ld\n"), ArpName, ArpVersion);
exit(3);
}
#endif
# endif
}
#endif /* __amigaos4__ */
/*
* scan argv[] for the "-f" and "-d" arguments
@@ -398,8 +427,15 @@ mch_check_win(argc, argv)
/*
* Make a unique name for the temp file (which we will not delete!).
* Use a pointer on the stack (nobody else will be using it).
* Under AmigaOS4, this assumption might change in the future, so
* we use a pointer to the current task instead. This should be a
* shared structure and thus globally unique.
*/
#ifdef __amigaos4__
sprintf((char *)buf1, "t:nc%p", FindTask(0));
#else
sprintf((char *)buf1, "t:nc%ld", (long)buf1);
#endif
if ((fh = Open((UBYTE *)buf1, (long)MODE_NEWFILE)) == (BPTR)NULL)
{
mch_errmsg(_("Cannot create "));
@@ -513,7 +549,8 @@ mch_input_isatty()
/*
* fname_case(): Set the case of the file name, if it already exists.
* This will cause the file name to remain exactly the same.
* This will cause the file name to remain exactly the same
* if the file system ignores, but preserves case.
*/
/*ARGSUSED*/
void
@@ -528,9 +565,14 @@ fname_case(name, len)
if (fib != NULL)
{
flen = STRLEN(name);
/* TODO: Check if this fix applies to AmigaOS < 4 too.*/
#ifdef __amigaos4__
if (fib->fib_DirEntryType == ST_ROOT)
strcat(fib->fib_FileName, ":");
#endif
if (flen == strlen(fib->fib_FileName)) /* safety check */
mch_memmove(name, fib->fib_FileName, flen);
vim_free(fib);
free_fib(fib);
}
}
@@ -548,13 +590,17 @@ get_fib(fname)
if (fname == NULL) /* safety check */
return NULL;
fib = (struct FileInfoBlock *)malloc(sizeof(struct FileInfoBlock));
#ifdef __amigaos4__
fib = AllocDosObject(DOS_FIB,0);
#else
fib = (struct FileInfoBlock *)alloc(sizeof(struct FileInfoBlock));
#endif
if (fib != NULL)
{
flock = Lock((UBYTE *)fname, (long)ACCESS_READ);
if (flock == (BPTR)NULL || !Examine(flock, fib))
{
vim_free(fib); /* in case of an error the memory is freed here */
free_fib(fib); /* in case of an error the memory is freed here */
fib = NULL;
}
if (flock)
@@ -613,6 +659,7 @@ mch_get_user_name(s, len)
char_u *s;
int len;
{
/* TODO: Implement this. */
*s = NUL;
return FAIL;
}
@@ -625,7 +672,11 @@ mch_get_host_name(s, len)
char_u *s;
int len;
{
#if defined(__amigaos4__) && defined(__CLIB2__)
gethostname(s, len);
#else
vim_strncpy(s, "Amiga", len - 1);
#endif
}
/*
@@ -634,7 +685,14 @@ mch_get_host_name(s, len)
long
mch_get_pid()
{
#ifdef __amigaos4__
/* This is as close to a pid as we can come. We could use CLI numbers also,
* but then we would have two different types of process identifiers.
*/
return((long)FindTask(0));
#else
return (long)0;
#endif
}
/*
@@ -746,7 +804,7 @@ mch_getperm(name)
if (fib != NULL)
{
retval = fib->fib_Protection;
vim_free(fib);
free_fib(fib);
}
return retval;
}
@@ -790,8 +848,12 @@ mch_isdir(name)
fib = get_fib(name);
if (fib != NULL)
{
#ifdef __amigaos4__
retval = (FIB_IS_DRAWER(fib)) ? TRUE : FALSE;
#else
retval = ((fib->fib_DirEntryType >= 0) ? TRUE : FALSE);
vim_free(fib);
#endif
free_fib(fib);
}
return retval;
}
@@ -912,7 +974,7 @@ mch_exit(r)
mch_settmode(tmode)
int tmode;
{
#ifdef __AROS__
#if defined(__AROS__) || defined(__amigaos4__)
if (!SetMode(raw_in, tmode == TMODE_RAW ? 1 : 0))
#else
if (dos_packet(MP(raw_in), (long)ACTION_SCREEN_MODE,
@@ -954,14 +1016,21 @@ mch_screenmode(arg)
mch_get_shellsize()
{
struct ConUnit *conUnit;
#ifndef __amigaos4__
char id_a[sizeof(struct InfoData) + 3];
struct InfoData *id;
#endif
struct InfoData *id=0;
if (!term_console) /* not an amiga window */
return FAIL;
goto out;
/* insure longword alignment */
#ifdef __amigaos4__
if(!(id = AllocDosObject(DOS_INFODATA, 0)))
goto out;
#else
id = (struct InfoData *)(((long)id_a + 3L) & ~3L);
#endif
/*
* Should make console aware of real window size, not the one we set.
@@ -983,7 +1052,7 @@ mch_get_shellsize()
/* it's not an amiga window, maybe aux device */
/* terminal type should be set */
term_console = FALSE;
return FAIL;
goto out;
}
if (oldwindowtitle == NULL)
oldwindowtitle = (char_u *)wb_window->Title;
@@ -1006,6 +1075,12 @@ mch_get_shellsize()
}
return OK;
out:
#ifdef __amigaos4__
FreeDosObject(DOS_INFODATA, id); /* Safe to pass NULL */
#endif
return FAIL;
}
/*
@@ -1046,7 +1121,7 @@ out_num(n)
OUT_STR_NF(tltoa((unsigned long)n));
}
#if !defined(AZTEC_C) && !defined(__AROS__)
#if !defined(AZTEC_C) && !defined(__AROS__) && !defined(__amigaos4__)
/*
* Sendpacket.c
*
@@ -1371,8 +1446,12 @@ Chk_Abort(void)
* Use and abuse as you please.
*/
#define ANCHOR_BUF_SIZE (512)
#define ANCHOR_SIZE (sizeof(struct AnchorPath) + ANCHOR_BUF_SIZE)
#ifdef __amigaos4__
# define ANCHOR_BUF_SIZE 1024
#else
# define ANCHOR_BUF_SIZE (512)
# define ANCHOR_SIZE (sizeof(struct AnchorPath) + ANCHOR_BUF_SIZE)
#endif
int
mch_expandpath(gap, pat, flags)
@@ -1385,19 +1464,32 @@ mch_expandpath(gap, pat, flags)
char_u *starbuf, *sp, *dp;
int start_len;
int matches;
#ifdef __amigaos4__
struct TagItem AnchorTags[] = {
{ADO_Strlen, ANCHOR_BUF_SIZE},
{ADO_Flags, APF_DODOT|APF_DOWILD|APF_MultiAssigns},
{TAG_DONE, 0L}
};
#endif
start_len = gap->ga_len;
/* Get our AnchorBase */
#ifdef __amigaos4__
Anchor = AllocDosObject(DOS_ANCHORPATH, AnchorTags);
#else
Anchor = (struct AnchorPath *)alloc_clear((unsigned)ANCHOR_SIZE);
#endif
if (Anchor == NULL)
return 0;
#ifndef __amigaos4__
Anchor->ap_Strlen = ANCHOR_BUF_SIZE; /* ap_Length not supported anymore */
#ifdef APF_DODOT
# ifdef APF_DODOT
Anchor->ap_Flags = APF_DODOT | APF_DOWILD; /* allow '.' for current dir */
#else
# else
Anchor->ap_Flags = APF_DoDot | APF_DoWild; /* allow '.' for current dir */
# endif
#endif
#ifdef FEAT_ARP
@@ -1432,7 +1524,11 @@ mch_expandpath(gap, pat, flags)
*/
while (Result == 0)
{
#ifdef __amigaos4__
addfile(gap, (char_u *)Anchor->ap_Buffer, flags);
#else
addfile(gap, (char_u *)Anchor->ap_Buf, flags);
#endif
#ifdef FEAT_ARP
if (dos2)
#endif
@@ -1469,7 +1565,11 @@ mch_expandpath(gap, pat, flags)
#endif
Return:
#ifdef __amigaos4__
FreeDosObject(DOS_ANCHORPATH, Anchor);
#else
vim_free(Anchor);
#endif
return matches;
}

View File

@@ -17,9 +17,12 @@
#define HAVE_AVAIL_MEM
#ifndef HAVE_CONFIG_H
# ifdef AZTEC_C
# if defined(AZTEC_C) || defined(__amigaos4__)
# define HAVE_STAT_H
# endif
# ifdef __amigaos4__
# define HAVE_STDARG_H
# endif
# define HAVE_STDLIB_H
# define HAVE_STRING_H
# define HAVE_FCNTL_H
@@ -34,16 +37,25 @@
# define HAVE_DATE_TIME
# endif
#define DFLT_ERRORFILE "AztecC.Err"
#define DFLT_RUNTIMEPATH "home:vimfiles,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,home:vimfiles/after"
#define BASENAMELEN 26 /* Amiga */
#define TEMPNAME "t:v?XXXXXX"
#define TEMPNAMELEN 12
#endif /* HAVE_CONFIG_H */
#ifndef DFLT_ERRORFILE
# define DFLT_ERRORFILE "AztecC.Err" /* Should this change? */
#endif
#ifndef DFLT_RUNTIMEPATH
# define DFLT_RUNTIMEPATH "home:vimfiles,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,home:vimfiles/after"
#endif
#ifndef BASENAMELEN
# define BASENAMELEN 26 /* Amiga */
#endif
#ifndef TEMPNAME
# define TEMPNAME "t:v?XXXXXX"
# define TEMPNAMELEN 12
#endif
#include <exec/types.h>
#include <libraries/dos.h>
#include <libraries/dosextens.h>
@@ -155,9 +167,9 @@ typedef long off_t;
#endif
#ifdef FEAT_VIMINFO
#ifndef VIMINFO_FILE
# define VIMINFO_FILE "s:.viminfo"
#endif
# ifndef VIMINFO_FILE
# define VIMINFO_FILE "s:.viminfo"
# endif
#endif /* FEAT_VIMINFO */
#ifndef EXRC_FILE

View File

@@ -2202,7 +2202,7 @@ slash_adjust(p)
#endif
/*
* Get absolute file name into buffer 'buf' of length 'len' bytes.
* Get absolute file name into "buf[len]".
*
* return FAIL for failure, OK for success
*/
@@ -2212,22 +2212,49 @@ mch_FullName(fname, buf, len, force)
int len;
int force; /* also expand when already absolute path */
{
#ifdef VMS
/*
* VMS does this in a completely different way.
*
* By default a file found in a complex path is written to the first
* directory in the path and not to the original directory. This
* behaviour should be avoided for the existing files and we need to find
* the exact path of the edited file.
*/
{
char_u *fixed_fname = vms_fixfilename(fname);
int fd = mch_open((char *)fixed_fname, O_RDONLY | O_EXTRA, 0);
if (fd > 0)
{
char nbuf[MAXNAMLEN];
/* File exists, use getname() to get the real name. */
if (getname(fd, nbuf))
vim_strncpy(fixed_fname, (char_u *)nbuf, (size_t)(len - 1));
close(fd);
}
if (STRLEN(fixed_fname) >= len)
return FAIL;
STRCPY(buf, fixed_fname);
}
#else /* not VMS */
int l;
#ifdef OS2
# ifdef OS2
int only_drive; /* file name is only a drive letter */
#endif
#ifdef HAVE_FCHDIR
# endif
# ifdef HAVE_FCHDIR
int fd = -1;
static int dont_fchdir = FALSE; /* TRUE when fchdir() doesn't work */
#endif
# endif
char_u olddir[MAXPATHL];
char_u *p;
int retval = OK;
#ifdef VMS
fname = vms_fixfilename(fname);
#endif
/* expand it if forced or not an absolute path */
if (force || !mch_isFullName(fname))
{
@@ -2236,16 +2263,16 @@ mch_FullName(fname, buf, len, force)
* and then do the getwd() (and get back to where we were).
* This will get the correct path name with "../" things.
*/
#ifdef OS2
# ifdef OS2
only_drive = 0;
if (((p = vim_strrchr(fname, '/')) != NULL)
|| ((p = vim_strrchr(fname, '\\')) != NULL)
|| (((p = vim_strchr(fname, ':')) != NULL) && ++only_drive))
#else
# else
if ((p = vim_strrchr(fname, '/')) != NULL)
#endif
# endif
{
#ifdef HAVE_FCHDIR
# ifdef HAVE_FCHDIR
/*
* Use fchdir() if possible, it's said to be faster and more
* reliable. But on SunOS 4 it might not work. Check this by
@@ -2261,14 +2288,14 @@ mch_FullName(fname, buf, len, force)
dont_fchdir = TRUE; /* don't try again */
}
}
#endif
# endif
/* Only change directory when we are sure we can return to where
* we are now. After doing "su" chdir(".") might not work. */
if (
#ifdef HAVE_FCHDIR
# ifdef HAVE_FCHDIR
fd < 0 &&
#endif
# endif
(mch_dirname(olddir, MAXPATHL) == FAIL
|| mch_chdir((char *)olddir) != 0))
{
@@ -2277,7 +2304,7 @@ mch_FullName(fname, buf, len, force)
}
else
{
#ifdef OS2
# ifdef OS2
/*
* compensate for case where ':' from "D:" was the only
* path separator detected in the file name; the _next_
@@ -2285,7 +2312,7 @@ mch_FullName(fname, buf, len, force)
*/
if (only_drive)
p++;
#endif
# endif
/* The directory is copied into buf[], to be able to remove
* the file name without changing it (could be a string in
* read-only memory) */
@@ -2300,14 +2327,14 @@ mch_FullName(fname, buf, len, force)
fname = p + 1;
*buf = NUL;
}
#ifdef OS2
# ifdef OS2
if (only_drive)
{
p--;
if (retval != FAIL)
fname--;
}
#endif
# endif
}
}
if (mch_dirname(buf, len) == FAIL)
@@ -2317,14 +2344,14 @@ mch_FullName(fname, buf, len, force)
}
if (p != NULL)
{
#ifdef HAVE_FCHDIR
# ifdef HAVE_FCHDIR
if (fd >= 0)
{
l = fchdir(fd);
close(fd);
}
else
#endif
# endif
l = mch_chdir((char *)olddir);
if (l != 0)
EMSG(_(e_prev_dir));
@@ -2333,15 +2360,14 @@ mch_FullName(fname, buf, len, force)
l = STRLEN(buf);
if (l >= len)
retval = FAIL;
#ifndef VMS
else
{
if (l > 0 && buf[l - 1] != '/' && *fname != NUL
&& STRCMP(fname, ".") != 0)
STRCAT(buf, "/");
}
#endif
}
/* Catch file names which are too long. */
if (retval == FAIL || STRLEN(buf) + STRLEN(fname) >= len)
return FAIL;
@@ -2350,6 +2376,8 @@ mch_FullName(fname, buf, len, force)
if (STRCMP(fname, ".") != 0)
STRCAT(buf, fname);
#endif /* VMS */
return OK;
}

View File

@@ -17,7 +17,7 @@ extern void *get_register __ARGS((int name, int copy));
extern void put_register __ARGS((int name, void *reg));
extern int yank_register_mline __ARGS((int regname));
extern int do_record __ARGS((int c));
extern int do_execreg __ARGS((int regname, int colon, int addcr));
extern int do_execreg __ARGS((int regname, int colon, int addcr, int silent));
extern int insert_reg __ARGS((int regname, int literally));
extern int get_spec_reg __ARGS((int regname, char_u **argp, int *allocated, int errmsg));
extern int cmdline_paste_reg __ARGS((int regname, int literally, int remcr));

View File

@@ -51,7 +51,7 @@
# include <sys/termios.h>
#endif
#if HAVE_SYS_IOCTL_H
#ifdef HAVE_SYS_IOCTL_H
# include <sys/ioctl.h>
#endif
@@ -69,14 +69,14 @@
# endif
#endif
#if HAVE_UNISTD_H
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#if HAVE_TERMIO_H
# include <termio.h>
#else
# if HAVE_TERMIOS_H
# ifdef HAVE_TERMIOS_H
# include <termios.h>
# endif
#endif

View File

@@ -455,6 +455,7 @@ update_screen(type)
&& curwin->w_topline == curwin->w_lines[0].wl_lnum)
#ifdef FEAT_VISUAL
|| (type == INVERTED
&& VIsual_active
&& curwin->w_old_cursor_lnum == curwin->w_cursor.lnum
&& curwin->w_old_visual_mode == VIsual_mode
&& (curwin->w_valid & VALID_VIRTCOL)

View File

@@ -341,11 +341,15 @@ u_savecommon(top, bot, newbot)
uhp->uh_alt_next = old_curhead;
if (old_curhead != NULL)
{
uhp->uh_alt_prev = old_curhead->uh_alt_prev;
if (uhp->uh_alt_prev != NULL)
uhp->uh_alt_prev->uh_alt_next = uhp;
old_curhead->uh_alt_prev = uhp;
if (curbuf->b_u_oldhead == old_curhead)
curbuf->b_u_oldhead = uhp;
}
uhp->uh_alt_prev = NULL;
else
uhp->uh_alt_prev = NULL;
if (curbuf->b_u_newhead != NULL)
curbuf->b_u_newhead->uh_prev = uhp;
@@ -856,6 +860,11 @@ undo_time(step, sec, absolute)
uhp = curbuf->b_u_curhead;
while (uhp != NULL)
{
/* Go back to the first branch with a mark. */
while (uhp->uh_alt_prev != NULL
&& uhp->uh_alt_prev->uh_walk == mark)
uhp = uhp->uh_alt_prev;
/* Find the last branch with a mark, that's the one. */
last = uhp;
while (last->uh_alt_next != NULL
@@ -865,6 +874,8 @@ undo_time(step, sec, absolute)
{
/* Make the used branch the first entry in the list of
* alternatives to make "u" and CTRL-R take this branch. */
while (uhp->uh_alt_prev != NULL)
uhp = uhp->uh_alt_prev;
if (last->uh_alt_next != NULL)
last->uh_alt_next->uh_alt_prev = last->uh_alt_prev;
last->uh_alt_prev->uh_alt_next = last->uh_alt_next;

View File

@@ -666,6 +666,66 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
185,
/**/
184,
/**/
183,
/**/
182,
/**/
181,
/**/
180,
/**/
179,
/**/
178,
/**/
177,
/**/
176,
/**/
175,
/**/
174,
/**/
173,
/**/
172,
/**/
171,
/**/
170,
/**/
169,
/**/
168,
/**/
167,
/**/
166,
/**/
165,
/**/
164,
/**/
163,
/**/
162,
/**/
161,
/**/
160,
/**/
159,
/**/
158,
/**/
157,
/**/
156,
/**/
155,
/**/
@@ -1083,6 +1143,14 @@ list_version()
#endif
#ifdef VMS
MSG_PUTS("\nOpenVMS version");
# ifdef HAVE_PATHDEF
if (*compiled_arch != NUL)
{
MSG_PUTS(" - ");
MSG_PUTS(compiled_arch);
}
# endif
#endif
/* Print the list of patch numbers if there is at least one. */

View File

@@ -4273,7 +4273,7 @@ win_alloc_lines(wp)
win_T *wp;
{
wp->w_lines_valid = 0;
wp->w_lines = (wline_T *)alloc((unsigned)(Rows * sizeof(wline_T)));
wp->w_lines = (wline_T *)alloc_clear((unsigned)(Rows * sizeof(wline_T)));
if (wp->w_lines == NULL)
return FAIL;
return OK;