Compare commits

...

13 Commits

Author SHA1 Message Date
Bram Moolenaar
96bb621f25 updated for version 7.1-012 2007-06-19 18:52:53 +00:00
Bram Moolenaar
1ad2f13b37 updated for version 7.1-011 2007-06-19 18:27:18 +00:00
Bram Moolenaar
dc3213d855 updated for version 7.1-010 2007-06-19 16:03:50 +00:00
Bram Moolenaar
4b80a5179a updated for version 7.1-009 2007-06-19 15:44:58 +00:00
Bram Moolenaar
884aa898d4 updated for version 7.1-008 2007-06-19 15:31:05 +00:00
Bram Moolenaar
d827ada01c updated for version 7.1-008 2007-06-19 15:19:55 +00:00
Bram Moolenaar
e02d7b2a21 updated for version 7.1-007 2007-06-19 14:29:43 +00:00
Bram Moolenaar
512e6b838a updated for version 7.1-006 2007-06-19 13:36:52 +00:00
Bram Moolenaar
1864a4e0fd updated for version 7.1-005 2007-06-19 10:56:05 +00:00
Bram Moolenaar
b1269f1184 updated for version 7.1-004 2007-06-19 09:51:25 +00:00
Bram Moolenaar
2d8ab99d10 updated for version 7.1-003 2007-06-19 08:06:18 +00:00
Bram Moolenaar
1042527371 updated for version 7.1-002 2007-05-15 07:12:25 +00:00
Bram Moolenaar
a2dd900999 updated for version 7.1-001 2007-05-14 17:38:30 +00:00
15 changed files with 130 additions and 75 deletions

View File

@@ -1,4 +1,4 @@
*eval.txt* For Vim version 7.1. Last change: 2007 May 11
*eval.txt* For Vim version 7.1. Last change: 2007 Jun 09
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2824,6 +2824,8 @@ getfsize({fname}) *getfsize()*
given file {fname}.
If {fname} is a directory, 0 is returned.
If the file {fname} can't be found, -1 is returned.
If the size of {fname} is too big to fit in a Number then -2
is returned.
getfontname([{name}]) *getfontname()*
Without an argument returns the name of the normal font being

View File

@@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2007 May 10
" Last Change: 2007 May 15
" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
@@ -1286,7 +1286,7 @@ au BufNewFile,BufRead *.g setf pccts
au BufNewFile,BufRead *.it,*.ih setf ppwiz
" Oracle Pro*C/C++
au BufNewFile,BufRead .pc setf proc
au BufNewFile,BufRead *.pc setf proc
" Privoxy actions file
au BufNewFile,BufRead *.action setf privoxy

View File

@@ -171,6 +171,13 @@ open_buffer(read_stdin, eap)
/* Put the cursor on the first line. */
curwin->w_cursor.lnum = 1;
curwin->w_cursor.col = 0;
/* Set or reset 'modified' before executing autocommands, so that
* it can be changed there. */
if (!readonlymode && !bufempty())
changed();
else if (retval != FAIL)
unchanged(curbuf, FALSE);
#ifdef FEAT_AUTOCMD
# ifdef FEAT_EVAL
apply_autocmds_retval(EVENT_STDINREADPOST, NULL, NULL, FALSE,
@@ -194,16 +201,16 @@ open_buffer(read_stdin, eap)
/* When reading stdin, the buffer contents always needs writing, so set
* the changed flag. Unless in readonly mode: "ls | gview -".
* When interrupted and 'cpoptions' contains 'i' set changed flag. */
if ((read_stdin && !readonlymode && !bufempty())
if ((got_int && vim_strchr(p_cpo, CPO_INTMOD) != NULL)
#ifdef FEAT_AUTOCMD
|| modified_was_set /* ":set modified" used in autocmd */
# ifdef FEAT_EVAL
|| (aborting() && vim_strchr(p_cpo, CPO_INTMOD) != NULL)
# endif
#endif
|| (got_int && vim_strchr(p_cpo, CPO_INTMOD) != NULL))
)
changed();
else if (retval != FAIL)
else if (retval != FAIL && !read_stdin)
unchanged(curbuf, FALSE);
save_file_ff(curbuf); /* keep this fileformat */

View File

@@ -10136,7 +10136,13 @@ f_getfsize(argvars, rettv)
if (mch_isdir(fname))
rettv->vval.v_number = 0;
else
{
rettv->vval.v_number = (varnumber_T)st.st_size;
/* non-perfect check for overflow */
if ((off_t)rettv->vval.v_number != (off_t)st.st_size)
rettv->vval.v_number = -2;
}
}
else
rettv->vval.v_number = -1;

View File

@@ -3367,7 +3367,7 @@ do_ecmd(fnum, ffname, sfname, eap, newlnum, flags)
* was in this window (or another window). If not used
* before, reset the local window options to the global
* values. Also restores old folding stuff. */
get_winopts(buf);
get_winopts(curbuf);
#ifdef FEAT_SPELL
did_get_winopts = TRUE;
#endif
@@ -3649,8 +3649,8 @@ do_ecmd(fnum, ffname, sfname, eap, newlnum, flags)
#ifdef FEAT_SPELL
/* If the window options were changed may need to set the spell language.
* Can only do this after the buffer has been properly setup. */
if (did_get_winopts && curwin->w_p_spell && *buf->b_p_spl != NUL)
did_set_spelllang(buf);
if (did_get_winopts && curwin->w_p_spell && *curbuf->b_p_spl != NUL)
did_set_spelllang(curbuf);
#endif
if (command == NULL)

View File

@@ -460,7 +460,6 @@ typedef struct Gui
WindowPtr VimWindow;
MenuHandle MacOSHelpMenu; /* Help menu provided by the MacOS */
int MacOSHelpItems; /* Nr of help-items supplied by MacOS */
int MacOSHaveCntxMenu; /* Contextual menu available */
WindowPtr wid; /* Window id of text area */
int visibility; /* Is window partially/fully obscured? */
#endif

View File

@@ -53,8 +53,8 @@
# ifdef bindtextdomain
# undef bindtextdomain
# endif
# ifdef bindtextdomain_codeset
# undef bindtextdomain_codeset
# ifdef bind_textdomain_codeset
# undef bind_textdomain_codeset
# endif
# if defined(FEAT_GETTEXT) && !defined(ENABLE_NLS)
# define ENABLE_NLS /* so the texts in the dialog boxes are translated */

View File

@@ -36,8 +36,8 @@
# ifdef bindtextdomain
# undef bindtextdomain
# endif
# ifdef bindtextdomain_codeset
# undef bindtextdomain_codeset
# ifdef bind_textdomain_codeset
# undef bind_textdomain_codeset
# endif
# if defined(FEAT_GETTEXT) && !defined(ENABLE_NLS)
# define ENABLE_NLS /* so the texts in the dialog boxes are translated */
@@ -2188,8 +2188,10 @@ write_session_file(char_u *filename)
escaped_filename = vim_strsave_escaped(filename, escape_chars);
if (escaped_filename == NULL)
return FALSE;
mksession_cmdline = g_strconcat("mksession ", (char *)escaped_filename, NULL);
mksession_cmdline = g_strconcat("mksession ", (char *)escaped_filename,
NULL);
vim_free(escaped_filename);
/*
* Use a reasonable hardcoded set of 'sessionoptions' flags to avoid
* unpredictable effects when the session is saved automatically. Also,
@@ -2199,7 +2201,7 @@ write_session_file(char_u *filename)
*/
save_ssop_flags = ssop_flags;
ssop_flags = (SSOP_BLANK|SSOP_CURDIR|SSOP_FOLDS|SSOP_GLOBALS
|SSOP_HELP|SSOP_OPTIONS|SSOP_WINSIZE);
|SSOP_HELP|SSOP_OPTIONS|SSOP_WINSIZE|SSOP_TABPAGES);
do_cmdline_cmd((char_u *)"let Save_VV_this_session = v:this_session");
failed = (do_cmdline_cmd((char_u *)mksession_cmdline) == FAIL);

View File

@@ -1676,13 +1676,12 @@ gui_mac_doInContentClick(EventRecord *theEvent, WindowPtr whichWindow)
/* TODO: NEEDED? */
clickIsPopup = FALSE;
if ((gui.MacOSHaveCntxMenu) && (mouse_model_popup()))
if (IsShowContextualMenuClick(theEvent))
{
vimMouseButton = MOUSE_RIGHT;
vimModifiers &= ~MOUSE_CTRL;
clickIsPopup = TRUE;
}
if (mouse_model_popup() && IsShowContextualMenuClick(theEvent))
{
vimMouseButton = MOUSE_RIGHT;
vimModifiers &= ~MOUSE_CTRL;
clickIsPopup = TRUE;
}
/* Is it a double click ? */
dblClick = ((theEvent->when - lastMouseTick) < GetDblTime());
@@ -1920,24 +1919,19 @@ gui_mac_doActivateEvent(EventRecord *event)
WindowPtr whichWindow;
whichWindow = (WindowPtr) event->message;
if ((event->modifiers) & activeFlag)
/* Activate */
gui_focus_change(TRUE);
else
/* Dim scrollbars */
if (whichWindow == gui.VimWindow)
{
/* Deactivate */
gui_focus_change(FALSE);
/* DON'T KNOW what the code below was doing
found in the deactivate clause, but the
clause writing TRUE into in_focus (BUG)
*/
#if 0 /* Removed by Dany as per above June 2001 */
a_bool = false;
SetPreserveGlyph(a_bool);
SetOutlinePreferred(a_bool);
#endif
ControlRef rootControl;
GetRootControl(gui.VimWindow, &rootControl);
if ((event->modifiers) & activeFlag)
ActivateControl(rootControl);
else
DeactivateControl(rootControl);
}
/* Activate */
gui_focus_change((event->modifiers) & activeFlag);
}
@@ -2559,16 +2553,15 @@ gui_mac_handle_event(EventRecord *event)
OSErr error;
/* Handle contextual menu right now (if needed) */
if (gui.MacOSHaveCntxMenu)
if (IsShowContextualMenuClick(event))
{
if (IsShowContextualMenuClick(event))
{
# if 0
gui_mac_handle_contextual_menu(event);
gui_mac_handle_contextual_menu(event);
# else
gui_mac_doMouseDownEvent(event);
gui_mac_doMouseDownEvent(event);
# endif
return;
}
return;
}
/* Handle normal event */
switch (event->what)
@@ -2782,14 +2775,6 @@ gui_mch_prepare(int *argc, char **argv)
(void) InstallAEHandlers();
#endif
if (Gestalt(gestaltContextualMenuAttr, &gestalt_rc) == noErr)
gui.MacOSHaveCntxMenu = BitTst(&gestalt_rc, 31-gestaltContextualMenuTrapAvailable);
else
gui.MacOSHaveCntxMenu = false;
if (gui.MacOSHaveCntxMenu)
gui.MacOSHaveCntxMenu = (InitContextualMenus()==noErr);
pomme = NewMenu(256, "\p\024"); /* 0x14= = Apple Menu */
AppendMenu(pomme, "\pAbout VIM");
@@ -2941,6 +2926,7 @@ gui_mch_init(void)
#ifdef USE_CARBONKEYHANDLER
EventHandlerRef keyEventHandlerRef;
#endif
ControlRef rootControl;
if (Gestalt(gestaltSystemVersion, &gMacSystemVersion) != noErr)
gMacSystemVersion = 0x1000; /* TODO: Default to minimum sensible value */
@@ -2954,15 +2940,6 @@ gui_mch_init(void)
(void) InstallAEHandlers();
#endif
/* Ctrl click */
if (Gestalt(gestaltContextualMenuAttr, &gestalt_rc) == noErr)
gui.MacOSHaveCntxMenu = BitTst(&gestalt_rc, 31-gestaltContextualMenuTrapAvailable);
else
gui.MacOSHaveCntxMenu = false;
if (gui.MacOSHaveCntxMenu)
gui.MacOSHaveCntxMenu = (InitContextualMenus()==noErr);
pomme = NewMenu(256, "\p\024"); /* 0x14= = Apple Menu */
AppendMenu(pomme, "\pAbout VIM");
@@ -2981,6 +2958,7 @@ gui_mch_init(void)
gui.VimWindow = NewCWindow(nil, &windRect, "\pgVim on Macintosh", true,
zoomDocProc,
(WindowPtr)-1L, true, 0);
CreateRootControl(gui.VimWindow, &rootControl);
InstallReceiveHandler((DragReceiveHandlerUPP)receiveHandler,
gui.VimWindow, NULL);
SetPortWindowPort(gui.VimWindow);

View File

@@ -1051,7 +1051,9 @@ _WndProc(
if (pMenu != NULL && pMenu->strings[MENU_INDEX_TIP] != 0
&& GetMenuState(s_menuBar, pMenu->id, MF_BYCOMMAND) != -1)
{
++msg_hist_off;
msg(pMenu->strings[MENU_INDEX_TIP]);
--msg_hist_off;
setcursor();
out_flush();
did_menu_tip = TRUE;

View File

@@ -1360,8 +1360,7 @@ init_locale()
p = vim_getenv((char_u *)"VIMRUNTIME", &mustfree);
if (p != NULL && *p != NUL)
{
STRCPY(NameBuff, p);
STRCAT(NameBuff, "/lang");
vim_snprintf((char *)NameBuff, MAXPATHL, "%s/lang", p);
bindtextdomain(VIMPACKAGE, (char *)NameBuff);
}
if (mustfree)

View File

@@ -8219,6 +8219,25 @@ set_option_value(name, number, string, opt_flags)
varp = get_varp(&options[opt_idx]);
if (varp != NULL) /* hidden option is not changed */
{
if (number == 0 && string != NULL)
{
int index;
/* Either we are given a string or we are setting option
* to zero. */
for (index = 0; string[index] == '0'; ++index)
;
if (string[index] != NUL || index == 0)
{
/* There's another character after zeros or the string
* is empty. In both cases, we are trying to set a
* num option using a string. */
EMSG3(_("E521: Number required: &%s = '%s'"),
name, string);
return; /* do nothing as we hit an error */
}
}
if (flags & P_NUM)
(void)set_num_option(opt_idx, varp, number,
NULL, 0, opt_flags);

View File

@@ -3459,9 +3459,11 @@ win_line(wp, lnum, startrow, endrow, nochange)
#ifdef FEAT_DIFF
if (diff_hlf != (hlf_T)0)
{
if (diff_hlf == HLF_CHD && ptr - line >= change_start)
if (diff_hlf == HLF_CHD && ptr - line >= change_start
&& n_extra == 0)
diff_hlf = HLF_TXD; /* changed text */
if (diff_hlf == HLF_TXD && ptr - line > change_end)
if (diff_hlf == HLF_TXD && ptr - line > change_end
&& n_extra == 0)
diff_hlf = HLF_CHD; /* changed line */
line_attr = hl_attr(diff_hlf);
}

View File

@@ -3600,13 +3600,16 @@ current_block(oap, count, include, what, other)
{
oap->start = start_pos;
oap->motion_type = MCHAR;
oap->inclusive = FALSE;
if (sol)
{
incl(&curwin->w_cursor);
oap->inclusive = FALSE;
}
else
else if (lt(start_pos, curwin->w_cursor))
/* Include the character under the cursor. */
oap->inclusive = TRUE;
else
/* End is before the start (no text in between <>, [], etc.): don't
* operate on any text. */
curwin->w_cursor = start_pos;
}
return OK;
@@ -3734,7 +3737,7 @@ current_tagblock(oap, count_arg, include)
if (in_html_tag(FALSE))
{
/* cursor on start tag, move to just after it */
/* cursor on start tag, move to its '>' */
while (*ml_get_cursor() != '>')
if (inc_cursor() < 0)
break;
@@ -3838,7 +3841,7 @@ again:
/* Exclude the start tag. */
curwin->w_cursor = start_pos;
while (inc_cursor() >= 0)
if (*ml_get_cursor() == '>' && lt(curwin->w_cursor, end_pos))
if (*ml_get_cursor() == '>')
{
inc_cursor();
start_pos = curwin->w_cursor;
@@ -3860,7 +3863,11 @@ again:
#ifdef FEAT_VISUAL
if (VIsual_active)
{
if (*p_sel == 'e')
/* If the end is before the start there is no text between tags, select
* the char under the cursor. */
if (lt(end_pos, start_pos))
curwin->w_cursor = start_pos;
else if (*p_sel == 'e')
++curwin->w_cursor.col;
VIsual = start_pos;
VIsual_mode = 'v';
@@ -3872,7 +3879,15 @@ again:
{
oap->start = start_pos;
oap->motion_type = MCHAR;
oap->inclusive = TRUE;
if (lt(end_pos, start_pos))
{
/* End is before the start: there is no text between tags; operate
* on an empty area. */
curwin->w_cursor = start_pos;
oap->inclusive = FALSE;
}
else
oap->inclusive = TRUE;
}
retval = OK;

View File

@@ -666,6 +666,30 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
12,
/**/
11,
/**/
10,
/**/
9,
/**/
8,
/**/
7,
/**/
6,
/**/
5,
/**/
4,
/**/
3,
/**/
2,
/**/
1,
/**/
0
};