source: patches/vim-7.0-fixes-10.patch @ f74ae22

clfs-1.2clfs-2.1clfs-3.0.0-systemdclfs-3.0.0-sysvinitsystemdsysvinit
Last change on this file since f74ae22 was f74ae22, checked in by Jim Gifford <clfs@…>, 18 years ago

Updated Patches

  • Property mode set to 100644
File size: 63.8 KB
  • configure

    Submitted By: Jim Gifford (jim at linuxfromscratch dot org)
    Date: 2006-08-27
    Initial Package Version: 7.0
    Origin: Upstream
    Upstream Status: Applied
    Description: Contains Patch 001-004, 006-026, 028-031, 033-044, 036-056,
            058-064, and 066 from Upstream
            005, 027, 032, 045, 057, and 066 is for the extras, Mac, or
            Windows 32 only
    
    diff -Naur vim70.orig/configure vim70/configure
    old new  
    33# This is just a stub for the Unix configure script, to provide support for
    44# doing "./configure" in the top Vim directory.
    55
    6 cd src && ./configure "$@"
     6cd src && exec ./configure "$@"
  • runtime/autoload/ccomplete.vim

    diff -Naur vim70.orig/runtime/autoload/ccomplete.vim vim70/runtime/autoload/ccomplete.vim
    old new  
    11" Vim completion script
    22" Language:     C
    33" Maintainer:   Bram Moolenaar <Bram@vim.org>
    4 " Last Change:  2006 May 03
     4" Last Change:  2006 May 08
    55
    66
    77" This function is used for the 'omnifunc' option.
     
    458458" member.
    459459function! s:StructMembers(typename, items, all)
    460460  " Todo: What about local structures?
    461   let fnames = join(map(tagfiles(), 'escape(v:val, " \\")'))
     461  let fnames = join(map(tagfiles(), 'escape(v:val, " \\#%")'))
    462462  if fnames == ''
    463463    return []
    464464  endif
  • runtime/autoload/gzip.vim

    diff -Naur vim70.orig/runtime/autoload/gzip.vim vim70/runtime/autoload/gzip.vim
    old new  
    11" Vim autoload file for editing compressed files.
    22" Maintainer: Bram Moolenaar <Bram@vim.org>
    3 " Last Change: 2006 Mar 31
     3" Last Change: 2006 Jul 19
    44
    55" These functions are used by the gzip plugin.
    66
     
    127127    let nmt = s:tempname(nm)
    128128    if rename(nm, nmt) == 0
    129129      if exists("b:gzip_comp_arg")
    130         call system(a:cmd . " " . b:gzip_comp_arg . " " . nmt)
     130        call system(a:cmd . " " . b:gzip_comp_arg . " '" . nmt . "'")
    131131      else
    132         call system(a:cmd . " " . nmt)
     132        call system(a:cmd . " '" . nmt . "'")
    133133      endif
    134134      call rename(nmt . "." . expand("<afile>:e"), nm)
    135135    endif
  • runtime/autoload/paste.vim

    diff -Naur vim70.orig/runtime/autoload/paste.vim vim70/runtime/autoload/paste.vim
    old new  
    11" Vim support file to help with paste mappings and menus
    22" Maintainer:   Bram Moolenaar <Bram@vim.org>
    3 " Last Change:  2006 Apr 21
     3" Last Change:  2006 Jun 23
    44
    55" Define the string to use for items that are present both in Edit, Popup and
    66" Toolbar menu.  Also used in mswin.vim and macmap.vim.
     
    1212if has("virtualedit")
    1313  let paste#paste_cmd = {'n': ":call paste#Paste()<CR>"}
    1414  let paste#paste_cmd['v'] = '"-c<Esc>' . paste#paste_cmd['n']
    15   let paste#paste_cmd['i'] = '<Esc>' . paste#paste_cmd['n'] . 'gi'
     15  let paste#paste_cmd['i'] = 'x<BS><Esc>' . paste#paste_cmd['n'] . 'gi'
    1616
    1717  func! paste#Paste()
    1818    let ove = &ve
  • runtime/autoload/spellfile.vim

    diff -Naur vim70.orig/runtime/autoload/spellfile.vim vim70/runtime/autoload/spellfile.vim
    old new  
    11" Vim script to download a missing spell file
    22" Maintainer:   Bram Moolenaar <Bram@vim.org>
    3 " Last Change:  2006 Feb 01
     3" Last Change:  2006 May 10
    44
    55if !exists('g:spellfile_URL')
    6   let g:spellfile_URL = 'ftp://ftp.vim.org/pub/vim/unstable/runtime/spell'
     6  let g:spellfile_URL = 'ftp://ftp.vim.org/pub/vim/runtime/spell'
    77endif
    88let s:spellfile_URL = ''    " Start with nothing so that s:donedict is reset.
    99
     
    6161    new
    6262    setlocal bin
    6363    echo 'Downloading ' . fname . '...'
    64     exe 'Nread ' g:spellfile_URL . '/' . fname
     64    call spellfile#Nread(fname)
    6565    if getline(2) !~ 'VIMspell'
    6666      " Didn't work, perhaps there is an ASCII one.
    6767      g/^/d
    6868      let fname = a:lang . '.ascii.spl'
    6969      echo 'Could not find it, trying ' . fname . '...'
    70       exe 'Nread ' g:spellfile_URL . '/' . fname
     70      call spellfile#Nread(fname)
    7171      if getline(2) !~ 'VIMspell'
    7272        echo 'Sorry, downloading failed'
    7373        bwipe!
     
    9595        g/^/d
    9696        let fname = substitute(fname, '\.spl$', '.sug', '')
    9797        echo 'Downloading ' . fname . '...'
    98         exe 'Nread ' g:spellfile_URL . '/' . fname
     98        call spellfile#Nread(fname)
    9999        if getline(2) !~ 'VIMsug'
    100100          echo 'Sorry, downloading failed'
    101101        else
     
    109109    bwipe
    110110  endif
    111111endfunc
     112
     113" Read "fname" from the ftp server.
     114function! spellfile#Nread(fname)
     115  let machine = substitute(g:spellfile_URL, 'ftp://\([^/]*\).*', '\1', '')
     116  let dir = substitute(g:spellfile_URL, 'ftp://[^/]*/\(.*\)', '\1', '')
     117  exe 'Nread "' . machine . ' anonymous vim7user ' . dir . '/' . a:fname . '"'
     118endfunc
  • runtime/plugin/matchparen.vim

    diff -Naur vim70.orig/runtime/plugin/matchparen.vim vim70/runtime/plugin/matchparen.vim
    old new  
    11" Vim plugin for showing matching parens
    22" Maintainer:  Bram Moolenaar <Bram@vim.org>
    3 " Last Change: 2006 Apr 27
     3" Last Change: 2006 Jun 26
    44
    55" Exit quickly when:
    66" - this plugin was already loaded (or disabled)
     
    9090  " Find the match.  When it was just before the cursor move it there for a
    9191  " moment.
    9292  if before > 0
    93     let save_cursor = getpos('.')
     93    let save_cursor = winsaveview()
    9494    call cursor(c_lnum, c_col - before)
    9595  endif
    9696
    9797  " When not in a string or comment ignore matches inside them.
    9898  let s_skip ='synIDattr(synID(line("."), col("."), 0), "name") ' .
    99         \ '=~?  "string\\|comment"'
     99        \ '=~?  "string\\|character\\|singlequote\\|comment"'
    100100  execute 'if' s_skip '| let s_skip = 0 | endif'
    101101
    102102  let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline)
    103103
    104104  if before > 0
    105     call setpos('.', save_cursor)
     105    call winrestview(save_cursor)
    106106  endif
    107107
    108108  " If a match is found setup match highlighting.
  • runtime/scripts.vim

    diff -Naur vim70.orig/runtime/scripts.vim vim70/runtime/scripts.vim
    old new  
    11" Vim support file to detect file types in scripts
    22"
    33" Maintainer:   Bram Moolenaar <Bram@vim.org>
    4 " Last change:  2006 Mar 28
     4" Last change:  2006 Jul 08
    55
    66" This file is called by an autocommand for every file that has just been
    77" loaded into a buffer.  It checks if the type of file can be recognized by
     
    5454    let s:name = substitute(s:line1, '^#!\s*\S*[/\\]\(\i\+\).*', '\1', '')
    5555  endif
    5656
     57  " tcl scripts may have #!/bin/sh in the first line and "exec wish" in the
     58  " third line.  Suggested by Steven Atkinson.
     59  if getline(3) =~ '^exec wish'
     60    let s:name = 'wish'
     61  endif
     62
    5763  " Bourne-like shell scripts: bash bash2 ksh ksh93 sh
    5864  if s:name =~ '^\(bash\d*\|\|ksh\d*\|sh\)\>'
    5965    call SetFileTypeSH(s:line1) " defined in filetype.vim
  • src/buffer.c

    diff -Naur vim70.orig/src/buffer.c vim70/src/buffer.c
    old new  
    54205420    buf_T       *newbuf;
    54215421    int         differ = TRUE;
    54225422    linenr_T    lnum;
    5423 #ifdef FEAT_AUTOCMD
    54245423    aco_save_T  aco;
    5425 #else
    5426     buf_T       *old_curbuf = curbuf;
    5427 #endif
    54285424    exarg_T     ea;
    54295425
    54305426    /* Allocate a buffer without putting it in the buffer list. */
     
    54395435        return TRUE;
    54405436    }
    54415437
    5442 #ifdef FEAT_AUTOCMD
    54435438    /* set curwin/curbuf to buf and save a few things */
    54445439    aucmd_prepbuf(&aco, newbuf);
    5445 #else
    5446     curbuf = newbuf;
    5447     curwin->w_buffer = newbuf;
    5448 #endif
    54495440
    54505441    if (ml_open(curbuf) == OK
    54515442            && readfile(buf->b_ffname, buf->b_fname,
     
    54665457    }
    54675458    vim_free(ea.cmd);
    54685459
    5469 #ifdef FEAT_AUTOCMD
    54705460    /* restore curwin/curbuf and a few other things */
    54715461    aucmd_restbuf(&aco);
    5472 #else
    5473     curbuf = old_curbuf;
    5474     curwin->w_buffer = old_curbuf;
    5475 #endif
    54765462
    54775463    if (curbuf != newbuf)       /* safety check */
    54785464        wipe_buffer(newbuf, FALSE);
  • src/configure

    diff -Naur vim70.orig/src/configure vim70/src/configure
    old new  
    22# run the automatically generated configure script
    33CONFIG_STATUS=auto/config.status \
    44        auto/configure "$@" --srcdir="${srcdir:-.}" --cache-file=auto/config.cache
     5result=$?
     6
    57# Stupid autoconf 2.5x causes this file to be left behind.
    68if test -f configure.lineno; then rm -f configure.lineno; fi
     9
     10exit $result
  • src/edit.c

    diff -Naur vim70.orig/src/edit.c vim70/src/edit.c
    old new  
    719719#ifdef FEAT_INS_EXPAND
    720720        /*
    721721         * Special handling of keys while the popup menu is visible or wanted
    722          * and the cursor is still in the completed word.
     722         * and the cursor is still in the completed word.  Only when there is
     723         * a match, skip this when no matches were found.
    723724         */
    724         if (compl_started && pum_wanted() && curwin->w_cursor.col >= compl_col)
     725        if (compl_started
     726                && pum_wanted()
     727                && curwin->w_cursor.col >= compl_col
     728                && (compl_shown_match == NULL
     729                    || compl_shown_match != compl_shown_match->cp_next))
    725730        {
    726731            /* BS: Delete one character from "compl_leader". */
    727732            if ((c == K_BS || c == Ctrl_H)
     
    751756                    continue;
    752757                }
    753758
    754                 /* Pressing CTRL-Y selects the current match.  Shen
     759                /* Pressing CTRL-Y selects the current match.  When
    755760                 * compl_enter_selects is set the Enter key does the same. */
    756761                if (c == Ctrl_Y || (compl_enter_selects
    757762                                   && (c == CAR || c == K_KENTER || c == NL)))
     
    877882                /* Close the cmdline window. */
    878883                cmdwin_result = K_IGNORE;
    879884                got_int = FALSE; /* don't stop executing autocommands et al. */
     885                nomove = TRUE;
    880886                goto doESCkey;
    881887            }
    882888#endif
     
    24092415    compl_matches = ins_compl_make_cyclic();
    24102416    compl_started = TRUE;
    24112417    compl_used_match = TRUE;
     2418    compl_cont_status = 0;
    24122419
    24132420    compl_curr_match = compl_first_match;
    24142421    ins_complete(Ctrl_N);
     
    27532760        }
    27542761        else
    27552762# endif
     2763            if (count > 0)      /* avoid warning for using "files" uninit */
    27562764        {
    27572765            ins_compl_files(count, files, thesaurus, flags,
    27582766                                                        &regmatch, buf, &dir);
     
    30153023    if ((int)(p - line) - (int)compl_col <= 0)
    30163024        return K_BS;
    30173025
    3018     /* For redo we need to repeat this backspace. */
    3019     AppendCharToRedobuff(K_BS);
    3020 
    30213026    /* Deleted more than what was used to find matches or didn't finish
    30223027     * finding all matches: need to look for matches all over again. */
    30233028    if (curwin->w_cursor.col <= compl_col + compl_length
     
    30463051    ins_compl_delete();
    30473052    ins_bytes(compl_leader + curwin->w_cursor.col - compl_col);
    30483053    compl_used_match = FALSE;
    3049     compl_enter_selects = FALSE;
    30503054
    30513055    if (compl_started)
    30523056        ins_compl_set_original_text(compl_leader);
     
    30763080        compl_restarting = FALSE;
    30773081    }
    30783082
     3083#if 0   /* disabled, made CTRL-L, BS and typing char jump to original text. */
    30793084    if (!compl_used_match)
    30803085    {
    30813086        /* Go to the original text, since none of the matches is inserted. */
     
    30873092        compl_curr_match = compl_shown_match;
    30883093        compl_shows_dir = compl_direction;
    30893094    }
     3095#endif
     3096    compl_enter_selects = !compl_used_match;
    30903097
    30913098    /* Show the popup menu with a different set of matches. */
    30923099    ins_compl_show_pum();
     
    31153122#endif
    31163123        ins_char(c);
    31173124
    3118     /* For redo we need to count this character so that the number of
    3119      * backspaces is correct. */
    3120     AppendCharToRedobuff(c);
    3121 
    31223125    /* If we didn't complete finding matches we must search again. */
    31233126    if (compl_was_interrupted)
    31243127        ins_compl_restart();
     
    31753178    char_u      *p;
    31763179    int         len = curwin->w_cursor.col - compl_col;
    31773180    int         c;
     3181    compl_T     *cp;
    31783182
    31793183    p = compl_shown_match->cp_str;
    31803184    if ((int)STRLEN(p) <= len)   /* the match is too short */
    3181         return;
     3185    {
     3186        /* When still at the original match use the first entry that matches
     3187         * the leader. */
     3188        if (compl_shown_match->cp_flags & ORIGINAL_TEXT)
     3189        {
     3190            p = NULL;
     3191            for (cp = compl_shown_match->cp_next; cp != NULL
     3192                                 && cp != compl_first_match; cp = cp->cp_next)
     3193            {
     3194                if (ins_compl_equal(cp, compl_leader,
     3195                                                   (int)STRLEN(compl_leader)))
     3196                {
     3197                    p = cp->cp_str;
     3198                    break;
     3199                }
     3200            }
     3201            if (p == NULL || (int)STRLEN(p) <= len)
     3202                return;
     3203        }
     3204        else
     3205            return;
     3206    }
    31823207    p += len;
    31833208#ifdef FEAT_MBYTE
    31843209    c = mb_ptr2char(p);
     
    31983223    int     c;
    31993224{
    32003225    char_u      *ptr;
    3201     int         temp;
    32023226    int         want_cindent;
    32033227    int         retval = FALSE;
    32043228
     
    33543378            if (compl_curr_match != NULL || compl_leader != NULL || c == Ctrl_E)
    33553379            {
    33563380                char_u  *p;
     3381                int     temp = 0;
    33573382
    33583383                /*
    33593384                 * If any of the original typed text has been changed, eg when
     
    33693394                    ptr = compl_leader;
    33703395                else
    33713396                    ptr = compl_orig_text;
    3372                 p = compl_orig_text;
    3373                 for (temp = 0; p[temp] != NUL && p[temp] == ptr[temp]; ++temp)
    3374                     ;
     3397                if (compl_orig_text != NULL)
     3398                {
     3399                    p = compl_orig_text;
     3400                    for (temp = 0; p[temp] != NUL && p[temp] == ptr[temp];
     3401                                                                       ++temp)
     3402                        ;
    33753403#ifdef FEAT_MBYTE
    3376                 if (temp > 0)
    3377                     temp -= (*mb_head_off)(compl_orig_text, p + temp);
     3404                    if (temp > 0)
     3405                        temp -= (*mb_head_off)(compl_orig_text, p + temp);
    33783406#endif
    3379                 for (p += temp; *p != NUL; mb_ptr_adv(p))
    3380                     AppendCharToRedobuff(K_BS);
    3381                 AppendToRedobuffLit(ptr + temp, -1);
     3407                    for (p += temp; *p != NUL; mb_ptr_adv(p))
     3408                        AppendCharToRedobuff(K_BS);
     3409                }
     3410                if (ptr != NULL)
     3411                    AppendToRedobuffLit(ptr + temp, -1);
    33823412            }
    33833413
    33843414#ifdef FEAT_CINDENT
     
    41004130                && compl_shown_match->cp_next != NULL
    41014131                && compl_shown_match->cp_next != compl_first_match)
    41024132            compl_shown_match = compl_shown_match->cp_next;
     4133
     4134        /* If we didn't find it searching forward, and compl_shows_dir is
     4135         * backward, find the last match. */
     4136        if (compl_shows_dir == BACKWARD
     4137                && !ins_compl_equal(compl_shown_match,
     4138                                      compl_leader, (int)STRLEN(compl_leader))
     4139                && (compl_shown_match->cp_next == NULL
     4140                    || compl_shown_match->cp_next == compl_first_match))
     4141        {
     4142            while (!ins_compl_equal(compl_shown_match,
     4143                                      compl_leader, (int)STRLEN(compl_leader))
     4144                    && compl_shown_match->cp_prev != NULL
     4145                    && compl_shown_match->cp_prev != compl_first_match)
     4146                compl_shown_match = compl_shown_match->cp_prev;
     4147        }
    41034148    }
    41044149
    41054150    if (allow_get_expansion && insert_match
     
    41244169    {
    41254170        if (compl_shows_dir == FORWARD && compl_shown_match->cp_next != NULL)
    41264171        {
    4127             if (compl_pending != 0)
    4128                 --compl_pending;
    41294172            compl_shown_match = compl_shown_match->cp_next;
    41304173            found_end = (compl_first_match != NULL
    41314174                           && (compl_shown_match->cp_next == compl_first_match
     
    41344177        else if (compl_shows_dir == BACKWARD
    41354178                                        && compl_shown_match->cp_prev != NULL)
    41364179        {
    4137             if (compl_pending != 0)
    4138                 ++compl_pending;
    41394180            found_end = (compl_shown_match == compl_first_match);
    41404181            compl_shown_match = compl_shown_match->cp_prev;
    41414182            found_end |= (compl_shown_match == compl_first_match);
    41424183        }
    41434184        else
    41444185        {
     4186            if (!allow_get_expansion)
     4187            {
     4188                if (advance)
     4189                {
     4190                    if (compl_shows_dir == BACKWARD)
     4191                        compl_pending -= todo + 1;
     4192                    else
     4193                        compl_pending += todo + 1;
     4194                }
     4195                return -1;
     4196            }
     4197
    41454198            if (advance)
    41464199            {
    41474200                if (compl_shows_dir == BACKWARD)
     
    41494202                else
    41504203                    ++compl_pending;
    41514204            }
    4152             if (!allow_get_expansion)
    4153                 return -1;
    41544205
    41554206            /* Find matches. */
    41564207            num_matches = ins_compl_get_exp(&compl_startpos);
    4157             if (compl_pending != 0 && compl_direction == compl_shows_dir
     4208
     4209            /* handle any pending completions */
     4210            while (compl_pending != 0 && compl_direction == compl_shows_dir
    41584211                                                                   && advance)
    4159                 compl_shown_match = compl_curr_match;
     4212            {
     4213                if (compl_pending > 0 && compl_shown_match->cp_next != NULL)
     4214                {
     4215                    compl_shown_match = compl_shown_match->cp_next;
     4216                    --compl_pending;
     4217                }
     4218                if (compl_pending < 0 && compl_shown_match->cp_prev != NULL)
     4219                {
     4220                    compl_shown_match = compl_shown_match->cp_prev;
     4221                    ++compl_pending;
     4222                }
     4223                else
     4224                    break;
     4225            }
    41604226            found_end = FALSE;
    41614227        }
    41624228        if ((compl_shown_match->cp_flags & ORIGINAL_TEXT) == 0
     
    42654331        return;
    42664332    count = 0;
    42674333
    4268     ++no_mapping;
     4334    /* Check for a typed key.  Do use mappings, otherwise vim_is_ctrl_x_key()
     4335     * can't do its work correctly. */
    42694336    c = vpeekc_any();
    4270     --no_mapping;
    42714337    if (c != NUL)
    42724338    {
    42734339        if (vim_is_ctrl_x_key(c) && c != Ctrl_X && c != Ctrl_R)
     
    42774343            (void)ins_compl_next(FALSE, ins_compl_key2count(c),
    42784344                                                    c != K_UP && c != K_DOWN);
    42794345        }
    4280         else if (c != Ctrl_R)
    4281             compl_interrupted = TRUE;
     4346        else
     4347        {
     4348            /* Need to get the character to have KeyTyped set.  We'll put it
     4349             * back with vungetc() below. */
     4350            c = safe_vgetc();
     4351
     4352            /* Don't interrupt completion when the character wasn't typed,
     4353             * e.g., when doing @q to replay keys. */
     4354            if (c != Ctrl_R && KeyTyped)
     4355                compl_interrupted = TRUE;
     4356
     4357            vungetc(c);
     4358        }
    42824359    }
    42834360    if (compl_pending != 0 && !got_int)
    4284         (void)ins_compl_next(FALSE, compl_pending > 0
    4285                                       ? compl_pending : -compl_pending, TRUE);
     4361    {
     4362        int todo = compl_pending > 0 ? compl_pending : -compl_pending;
     4363
     4364        compl_pending = 0;
     4365        (void)ins_compl_next(FALSE, todo, TRUE);
     4366    }
    42864367}
    42874368
    42884369/*
     
    46114692                                     (int)STRLEN(compl_pattern), curs_col);
    46124693            if (compl_xp.xp_context == EXPAND_UNSUCCESSFUL
    46134694                    || compl_xp.xp_context == EXPAND_NOTHING)
    4614                 return FAIL;
    4615             startcol = (int)(compl_xp.xp_pattern - compl_pattern);
    4616             compl_col = startcol;
    4617             compl_length = curs_col - startcol;
     4695                /* No completion possible, use an empty pattern to get a
     4696                 * "pattern not found" message. */
     4697                compl_col = curs_col;
     4698            else
     4699                compl_col = (int)(compl_xp.xp_pattern - compl_pattern);
     4700            compl_length = curs_col - compl_col;
    46184701        }
    46194702        else if (ctrl_x_mode == CTRL_X_FUNCTION || ctrl_x_mode == CTRL_X_OMNI)
    46204703        {
     
    46684751            else
    46694752                compl_col = spell_word_start(startcol);
    46704753            if (compl_col >= (colnr_T)startcol)
    4671                 return FAIL;
    4672             spell_expand_check_cap(compl_col);
     4754            {
     4755                compl_length = 0;
     4756                compl_col = curs_col;
     4757            }
     4758            else
     4759            {
     4760                spell_expand_check_cap(compl_col);
     4761                compl_length = (int)curs_col - compl_col;
     4762            }
    46734763            /* Need to obtain "line" again, it may have become invalid. */
    46744764            line = ml_get(curwin->w_cursor.lnum);
    4675             compl_length = (int)curs_col - compl_col;
    46764765            compl_pattern = vim_strnsave(line + compl_col, compl_length);
    46774766            if (compl_pattern == NULL)
    46784767#endif
  • src/eval.c

    diff -Naur vim70.orig/src/eval.c vim70/src/eval.c
    old new  
    82528252        EMSG(_("E785: complete() can only be used in Insert mode"));
    82538253        return;
    82548254    }
     8255
     8256    /* Check for undo allowed here, because if something was already inserted
     8257     * the line was already saved for undo and this check isn't done. */
     8258    if (!undo_allowed())
     8259        return;
     8260
    82558261    if (argvars[1].v_type != VAR_LIST || argvars[1].vval.v_list == NULL)
    82568262    {
    82578263        EMSG(_(e_invarg));
     
    97929798    varnumber_T         n;
    97939799    int                 error = FALSE;
    97949800
     9801    /* Position the cursor.  Needed after a message that ends in a space. */
     9802    windgoto(msg_row, msg_col);
     9803
    97959804    ++no_mapping;
    97969805    ++allow_keys;
    97979806    if (argvars[0].v_type == VAR_UNKNOWN)
     
    1131211321
    1131311322static int inputsecret_flag = 0;
    1131411323
     11324static void get_user_input __ARGS((typval_T *argvars, typval_T *rettv, int inputdialog));
     11325
    1131511326/*
    11316  * "input()" function
    11317  *     Also handles inputsecret() when inputsecret is set.
     11327 * This function is used by f_input() and f_inputdialog() functions. The third
     11328 * argument to f_input() specifies the type of completion to use at the
     11329 * prompt. The third argument to f_inputdialog() specifies the value to return
     11330 * when the user cancels the prompt.
    1131811331 */
    1131911332    static void
    11320 f_input(argvars, rettv)
     11333get_user_input(argvars, rettv, inputdialog)
    1132111334    typval_T    *argvars;
    1132211335    typval_T    *rettv;
     11336    int         inputdialog;
    1132311337{
    1132411338    char_u      *prompt = get_tv_string_chk(&argvars[0]);
    1132511339    char_u      *p = NULL;
     
    1136911383            if (defstr != NULL)
    1137011384                stuffReadbuffSpec(defstr);
    1137111385
    11372             if (argvars[2].v_type != VAR_UNKNOWN)
     11386            if (!inputdialog && argvars[2].v_type != VAR_UNKNOWN)
    1137311387            {
    1137411388                char_u  *xp_name;
    11375                 int             xp_namelen;
     11389                int     xp_namelen;
    1137611390                long    argt;
    1137711391
    1137811392                rettv->vval.v_string = NULL;
     
    1140411418}
    1140511419
    1140611420/*
     11421 * "input()" function
     11422 *     Also handles inputsecret() when inputsecret is set.
     11423 */
     11424    static void
     11425f_input(argvars, rettv)
     11426    typval_T    *argvars;
     11427    typval_T    *rettv;
     11428{
     11429    get_user_input(argvars, rettv, FALSE);
     11430}
     11431
     11432/*
    1140711433 * "inputdialog()" function
    1140811434 */
    1140911435    static void
     
    1144311469    }
    1144411470    else
    1144511471#endif
    11446         f_input(argvars, rettv);
     11472        get_user_input(argvars, rettv, TRUE);
    1144711473}
    1144811474
    1144911475/*
     
    1147111497    }
    1147211498
    1147311499    msg_start();
     11500    msg_row = Rows - 1; /* for when 'cmdheight' > 1 */
    1147411501    lines_left = Rows;  /* avoid more prompt */
    1147511502    msg_scroll = TRUE;
    1147611503    msg_clr_eos();
     
    1325013277        if (argvars[2].v_type != VAR_UNKNOWN)
    1325113278            EMSG2(_(e_toomanyarg), "remove()");
    1325213279        else if ((d = argvars[0].vval.v_dict) != NULL
    13253                 && !tv_check_lock(d->dv_lock, (char_u *)"remove()"))
     13280                && !tv_check_lock(d->dv_lock, (char_u *)"remove() argument"))
    1325413281        {
    1325513282            key = get_tv_string_chk(&argvars[1]);
    1325613283            if (key != NULL)
     
    1327013297    else if (argvars[0].v_type != VAR_LIST)
    1327113298        EMSG2(_(e_listdictarg), "remove()");
    1327213299    else if ((l = argvars[0].vval.v_list) != NULL
    13273             && !tv_check_lock(l->lv_lock, (char_u *)"remove()"))
     13300            && !tv_check_lock(l->lv_lock, (char_u *)"remove() argument"))
    1327413301    {
    1327513302        int         error = FALSE;
    1327613303
     
    1415714184    typval_T    *rettv;
    1415814185{
    1415914186    buf_T       *buf;
    14160 #ifdef FEAT_AUTOCMD
    1416114187    aco_save_T  aco;
    14162 #else
    14163     buf_T       *save_curbuf;
    14164 #endif
    1416514188    char_u      *varname, *bufvarname;
    1416614189    typval_T    *varp;
    1416714190    char_u      nbuf[NUMBUFLEN];
     
    1417814201    if (buf != NULL && varname != NULL && varp != NULL)
    1417914202    {
    1418014203        /* set curbuf to be our buf, temporarily */
    14181 #ifdef FEAT_AUTOCMD
    1418214204        aucmd_prepbuf(&aco, buf);
    14183 #else
    14184         save_curbuf = curbuf;
    14185         curbuf = buf;
    14186 #endif
    1418714205
    1418814206        if (*varname == '&')
    1418914207        {
     
    1421014228        }
    1421114229
    1421214230        /* reset notion of buffer */
    14213 #ifdef FEAT_AUTOCMD
    1421414231        aucmd_restbuf(&aco);
    14215 #else
    14216         curbuf = save_curbuf;
    14217 #endif
    1421814232    }
    1421914233}
    1422014234
     
    1643816452    long        i = 0;
    1643916453    long        n;
    1644016454
    16441     /* List must be: [fnum, lnum, col, coladd] */
    16442     if (arg->v_type != VAR_LIST || l == NULL
    16443                                       || l->lv_len != (fnump == NULL ? 3 : 4))
     16455    /* List must be: [fnum, lnum, col, coladd], where "fnum" is only there
     16456     * when "fnump" isn't NULL and "coladd" is optional. */
     16457    if (arg->v_type != VAR_LIST
     16458            || l == NULL
     16459            || l->lv_len < (fnump == NULL ? 2 : 3)
     16460            || l->lv_len > (fnump == NULL ? 3 : 4))
    1644416461        return FAIL;
    1644516462
    1644616463    if (fnump != NULL)
     
    1646616483#ifdef FEAT_VIRTUALEDIT
    1646716484    n = list_find_nr(l, i, NULL);
    1646816485    if (n < 0)
    16469         return FAIL;
    16470     posp->coladd = n;
     16486        posp->coladd = 0;
     16487    else
     16488        posp->coladd = n;
    1647116489#endif
    1647216490
    1647316491    return OK;
     
    1775917777    }
    1776017778    else                    /* add a new variable */
    1776117779    {
     17780        /* Can't add "v:" variable. */
     17781        if (ht == &vimvarht)
     17782        {
     17783            EMSG2(_(e_illvar), name);
     17784            return;
     17785        }
     17786
    1776217787        /* Make sure the variable name is valid. */
    1776317788        for (p = varname; *p != NUL; ++p)
    1776417789            if (!eval_isnamec1(*p) && (p == varname || !VIM_ISDIGIT(*p))
     
    1878618811                if (dict_add(fudi.fd_dict, fudi.fd_di) == FAIL)
    1878718812                {
    1878818813                    vim_free(fudi.fd_di);
     18814                    vim_free(fp);
    1878918815                    goto erret;
    1879018816                }
    1879118817            }
     
    1896318989    else if (lead > 0)
    1896418990    {
    1896518991        lead = 3;
    18966         if (eval_fname_sid(lv.ll_exp_name != NULL ? lv.ll_exp_name : *pp))
     18992        if ((lv.ll_exp_name != NULL && eval_fname_sid(lv.ll_exp_name))
     18993                                                       || eval_fname_sid(*pp))
    1896718994        {
    1896818995            /* It's "s:" or "<SID>" */
    1896918996            if (current_SID <= 0)
     
    1968519712    v->di_tv.vval.v_list = &fc.l_varlist;
    1968619713    vim_memset(&fc.l_varlist, 0, sizeof(list_T));
    1968719714    fc.l_varlist.lv_refcount = 99999;
     19715    fc.l_varlist.lv_lock = VAR_FIXED;
    1968819716
    1968919717    /*
    1969019718     * Set a:firstline to "firstline" and a:lastline to "lastline".
  • src/ex_cmds.h

    diff -Naur vim70.orig/src/ex_cmds.h vim70/src/ex_cmds.h
    old new  
    262262EX(CMD_comclear,        "comclear",     ex_comclear,
    263263                        TRLBAR|CMDWIN),
    264264EX(CMD_compiler,        "compiler",     ex_compiler,
    265                         BANG|TRLBAR|WORD1),
     265                        BANG|TRLBAR|WORD1|CMDWIN),
    266266EX(CMD_continue,        "continue",     ex_continue,
    267267                        TRLBAR|SBOXOK|CMDWIN),
    268268EX(CMD_confirm,         "confirm",      ex_wrongmodifier,
  • src/ex_docmd.c

    diff -Naur vim70.orig/src/ex_docmd.c vim70/src/ex_docmd.c
    old new  
    833833     * If requested, store and reset the global values controlling the
    834834     * exception handling (used when debugging).
    835835     */
    836     else if (flags & DOCMD_EXCRESET)
     836    if (flags & DOCMD_EXCRESET)
    837837        save_dbg_stuff(&debug_saved);
    838838
    839839    initial_trylevel = trylevel;
     
    17101710    save_cmdmod = cmdmod;
    17111711    vim_memset(&cmdmod, 0, sizeof(cmdmod));
    17121712
     1713    /* "#!anything" is handled like a comment. */
     1714    if ((*cmdlinep)[0] == '#' && (*cmdlinep)[1] == '!')
     1715        goto doend;
     1716
    17131717    /*
    17141718     * Repeat until no more command modifiers are found.
    17151719     */
  • src/ex_getln.c

    diff -Naur vim70.orig/src/ex_getln.c vim70/src/ex_getln.c
    old new  
    59825982    typestr[0] = cmdwin_type;
    59835983    typestr[1] = NUL;
    59845984    apply_autocmds(EVENT_CMDWINENTER, typestr, typestr, FALSE, curbuf);
     5985    if (restart_edit != 0)      /* autocmd with ":startinsert" */
     5986        stuffcharReadbuff(K_NOP);
    59855987# endif
    59865988
    59875989    i = RedrawingDisabled;
  • src/fileio.c

    diff -Naur vim70.orig/src/fileio.c vim70/src/fileio.c
    old new  
    64506450    int         old_ro = buf->b_p_ro;
    64516451    buf_T       *savebuf;
    64526452    int         saved = OK;
    6453 #ifdef FEAT_AUTOCMD
    64546453    aco_save_T  aco;
    64556454
    64566455    /* set curwin/curbuf for "buf" and save some things */
    64576456    aucmd_prepbuf(&aco, buf);
    6458 #else
    6459     buf_T       *save_curbuf = curbuf;
    6460 
    6461     curbuf = buf;
    6462     curwin->w_buffer = buf;
    6463 #endif
    64646457
    64656458    /* We only want to read the text from the file, not reset the syntax
    64666459     * highlighting, clear marks, diff status, etc.  Force the fileformat
     
    65736566            curbuf->b_p_ro |= old_ro;
    65746567    }
    65756568
    6576 #ifdef FEAT_AUTOCMD
    65776569    /* restore curwin/curbuf and a few other things */
    65786570    aucmd_restbuf(&aco);
    65796571    /* Careful: autocommands may have made "buf" invalid! */
    6580 #else
    6581     curwin->w_buffer = save_curbuf;
    6582     curbuf = save_curbuf;
    6583 #endif
    65846572}
    65856573
    65866574/*ARGSUSED*/
     
    80888076 * Search a window for the current buffer.  Save the cursor position and
    80898077 * screen offset.
    80908078 * Set "curbuf" and "curwin" to match "buf".
     8079 * When FEAT_AUTOCMD is not defined another version is used, see below.
    80918080 */
    80928081    void
    80938082aucmd_prepbuf(aco, buf)
     
    81518140/*
    81528141 * Cleanup after executing autocommands for a (hidden) buffer.
    81538142 * Restore the window as it was (if possible).
     8143 * When FEAT_AUTOCMD is not defined another version is used, see below.
    81548144 */
    81558145    void
    81568146aucmd_restbuf(aco)
     
    90639053    return retval;
    90649054}
    90659055
     9056#else   /* FEAT_AUTOCMD */
     9057
     9058/*
     9059 * Prepare for executing commands for (hidden) buffer "buf".
     9060 * This is the non-autocommand version, it simply saves "curbuf" and sets
     9061 * "curbuf" and "curwin" to match "buf".
     9062 */
     9063    void
     9064aucmd_prepbuf(aco, buf)
     9065    aco_save_T  *aco;           /* structure to save values in */
     9066    buf_T       *buf;           /* new curbuf */
     9067{
     9068    aco->save_buf = buf;
     9069    curbuf = buf;
     9070    curwin->w_buffer = buf;
     9071}
     9072
     9073/*
     9074 * Restore after executing commands for a (hidden) buffer.
     9075 * This is the non-autocommand version.
     9076 */
     9077    void
     9078aucmd_restbuf(aco)
     9079    aco_save_T  *aco;           /* structure holding saved values */
     9080{
     9081    curbuf = aco->save_buf;
     9082    curwin->w_buffer = curbuf;
     9083}
     9084
    90669085#endif  /* FEAT_AUTOCMD */
    90679086
     9087
    90689088#if defined(FEAT_AUTOCMD) || defined(FEAT_WILDIGN) || defined(PROTO)
    90699089/*
    90709090 * Try matching a filename with a "pattern" ("prog" is NULL), or use the
  • src/gui_at_fs.c

    diff -Naur vim70.orig/src/gui_at_fs.c vim70/src/gui_at_fs.c
    old new  
    18611861    XtPointer   pnew;
    18621862{
    18631863    SFDir       *dir;
    1864     int         nw;
     1864    int         nw = (int)(long)pnew;
    18651865
    18661866    dir = &(SFdirs[SFdirPtr + (int)(long)n]);
    18671867
    18681868#ifdef FEAT_GUI_NEXTAW
    1869     if ((int)(long)pnew < 0)
     1869    if (nw < 0)
    18701870    {
    1871         if ((int)(long)pnew > -SFvScrollHeight)
    1872             (int)(long)pnew = -1;
     1871        if (nw > -SFvScrollHeight)
     1872            nw = -1;
    18731873        else
    1874             (int)(long)pnew = -SFlistSize;
     1874            nw = -SFlistSize;
    18751875    }
    1876     else if ((int)(long)pnew > 0)
     1876    else if (nw > 0)
    18771877    {
    1878         if ((int)(long)pnew < SFvScrollHeight)
    1879             (int)(long)pnew = 1;
     1878        if (nw < SFvScrollHeight)
     1879            nw = 1;
    18801880        else
    1881             (int)(long)pnew = SFlistSize;
     1881            nw = SFlistSize;
    18821882    }
    18831883#endif
    1884     nw = dir->vOrigin + (int)(long)pnew;
     1884    nw += dir->vOrigin;
    18851885
    18861886    if (nw > dir->nEntries - SFlistSize)
    18871887        nw = dir->nEntries - SFlistSize;
     
    19411941    XtPointer   pnew;
    19421942{
    19431943    SFDir       *dir;
    1944     int         nw;
     1944    int         nw = (int)(long)pnew;
    19451945
    19461946    dir = &(SFdirs[SFdirPtr + (int)(long)n]);
    19471947
    19481948#ifdef FEAT_GUI_NEXTAW
    1949     if ((int)(long)pnew < 0)
     1949    if (nw < 0)
    19501950    {
    1951         if ((int)(long)pnew > -SFhScrollWidth)
    1952             (int)(long)pnew = -1;
     1951        if (nw > -SFhScrollWidth)
     1952            nw = -1;
    19531953        else
    1954             (int)(long)pnew = -SFcharsPerEntry;
     1954            nw = -SFcharsPerEntry;
    19551955    }
    1956     else if ((int)(long)pnew > 0)
     1956    else if (nw > 0)
    19571957    {
    1958         if ((int)(long)pnew < SFhScrollWidth)
    1959             (int)(long)pnew = 1;
     1958        if (nw < SFhScrollWidth)
     1959            nw = 1;
    19601960        else
    1961             (int)(long)pnew = SFcharsPerEntry;
     1961            nw = SFcharsPerEntry;
    19621962    }
    19631963#endif
    1964     nw = dir->hOrigin + (int)(long)pnew;
     1964    nw += dir->hOrigin;
    19651965
    19661966    if (nw > dir->nChars - SFcharsPerEntry)
    19671967        nw = dir->nChars - SFcharsPerEntry;
     
    20382038    XtPointer   client_data;
    20392039    XtPointer   pnew;
    20402040{
    2041     int         nw;
     2041    int         nw = (int)(long)pnew;
    20422042    float       f;
    20432043
    20442044#ifdef FEAT_GUI_NEXTAW
    2045     if ((int)(long)pnew < 0)
     2045    if (nw < 0)
    20462046    {
    2047         if ((int)(long)pnew > -SFpathScrollWidth)
    2048             (int)(long)pnew = -1;
     2047        if (nw > -SFpathScrollWidth)
     2048            nw = -1;
    20492049        else
    2050             (int)(long)pnew = -3;
     2050            nw = -3;
    20512051    }
    2052     else if ((int)(long)pnew > 0)
     2052    else if (nw > 0)
    20532053    {
    2054         if ((int)(long)pnew < SFpathScrollWidth)
    2055             (int)(long)pnew = 1;
     2054        if (nw < SFpathScrollWidth)
     2055            nw = 1;
    20562056        else
    2057             (int)(long)pnew = 3;
     2057            nw = 3;
    20582058    }
    20592059#endif
    2060     nw = SFdirPtr + (int)(long)pnew;
     2060    nw += SFdirPtr;
    20612061
    20622062    if (nw > SFdirEnd - 3)
    20632063        nw = SFdirEnd - 3;
  • src/gui.c

    diff -Naur vim70.orig/src/gui.c vim70/src/gui.c
    old new  
    45154515    int         y;
    45164516{
    45174517    win_T       *wp;
    4518     char_u      st[6];
     4518    char_u      st[8];
    45194519
    45204520    /* Ignore this while still starting up. */
    45214521    if (!gui.in_use || gui.starting)
     
    46034603    /* Don't move the mouse when it's left or right of the Vim window */
    46044604    if (x < 0 || x > Columns * gui.char_width)
    46054605        return;
     4606    if (y >= 0
    46064607# ifdef FEAT_WINDOWS
    4607     if (Y_2_ROW(y) >= tabline_height())
    4608 # else
    4609     if (y >= 0)
     4608            && Y_2_ROW(y) >= tabline_height()
    46104609# endif
     4610       )
    46114611        wp = xy2win(x, y);
    46124612    if (wp != curwin && wp != NULL)     /* If in other than current window */
    46134613    {
  • src/gui_xmebw.c

    diff -Naur vim70.orig/src/gui_xmebw.c vim70/src/gui_xmebw.c
    old new  
    4747#include "gui_xmebwp.h"
    4848
    4949/* Provide some missing wrappers, which are missed from the LessTif
    50  * implementation.
     50 * implementation.  Also missing in Motif 1.2 and earlier.
    5151 *
    5252 * We neither use XmeGetPixmapData or _XmGetPixmapData, since with LessTif the
    5353 * pixmap will not appear in it's caches properly. We cache the interresting
    5454 * values in XmEnhancedButtonPart instead ourself.
    5555 */
    56 #ifdef LESSTIF_VERSION
     56#if defined(LESSTIF_VERSION) || (XmVersion <= 1002)
    5757# ifndef Lab_IsMenupane
    5858#  define Lab_IsMenupane(w) (Lab_MenuType(w) == (int)XmMENU_POPUP || \
    5959                    Lab_MenuType(w) == (int)XmMENU_PULLDOWN)
     
    480480            || (eb->core.height <= 2 * eb->primitive.highlight_thickness))
    481481        return;
    482482
    483 #ifndef LESSTIF_VERSION
     483#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
    484484    {
    485485        XmDisplay       dpy;
    486486
     
    641641    GC          tmp_gc = NULL;
    642642    Boolean     replaceGC = False;
    643643    Boolean     deadjusted = False;
    644 #ifndef LESSTIF_VERSION
     644#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
    645645    XmDisplay   dpy = (XmDisplay)XmGetXmDisplay(XtDisplay(eb));
    646646    Boolean     etched_in = dpy->display.enable_etched_in_menu;
    647647#else
     
    726726        if ((((ShellWidget) XtParent(XtParent(eb)))->shell.popped_up)
    727727                && _XmGetInDragMode((Widget) eb))
    728728        {
    729 #ifndef LESSTIF_VERSION
     729#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
    730730            XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid));
    731731            Boolean etched_in = dpy->display.enable_etched_in_menu;
    732732#else
     
    810810
    811811    if (Lab_IsMenupane(eb))
    812812    {
    813 #ifndef LESSTIF_VERSION
     813#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
    814814        XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid));
    815815        Boolean etched_in = dpy->display.enable_etched_in_menu;
    816816#else
     
    11501150Redisplay(Widget w, XEvent *event, Region region)
    11511151{
    11521152    XmEnhancedButtonWidget  eb = (XmEnhancedButtonWidget) w;
    1153 #ifndef LESSTIF_VERSION
     1153#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
    11541154    XmDisplay               dpy;
    11551155    XtEnum                  default_button_emphasis;
    11561156#endif
     
    11621162    if (!XtIsRealized((Widget)eb))
    11631163        return;
    11641164
    1165 #ifndef LESSTIF_VERSION
     1165#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
    11661166    dpy = (XmDisplay)XmGetXmDisplay(XtDisplay(eb));
    11671167    default_button_emphasis = dpy->display.default_button_emphasis;
    11681168#endif
     
    12411241    {
    12421242        int adjust = 0;
    12431243
    1244 #ifndef LESSTIF_VERSION
     1244#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
    12451245        /*
    12461246         *  NOTE: PushButton has two types of shadows: primitive-shadow and
    12471247         *  default-button-shadow.  If pushbutton is in a menu only primitive
     
    12891289                          adjust, adjust, rectwidth, rectheight, borderwidth);
    12901290            }
    12911291
    1292 #ifndef LESSTIF_VERSION
     1292#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
    12931293            switch (default_button_emphasis)
    12941294            {
    12951295                case XmINTERNAL_HIGHLIGHT:
     
    13651365                    default_button_shadow_thickness =
    13661366                               eb->pushbutton.default_button_shadow_thickness;
    13671367
    1368 #ifndef LESSTIF_VERSION
     1368#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
    13691369                /*
    13701370                 * Compute location of bounding box to contain the
    13711371                 * defaultButtonShadow.
  • src/if_perl.xs

    diff -Naur vim70.orig/src/if_perl.xs vim70/src/if_perl.xs
    old new  
    155155static int (*perl_run)(PerlInterpreter*);
    156156static int (*perl_parse)(PerlInterpreter*, XSINIT_t, int, char**, char**);
    157157static void* (*Perl_get_context)(void);
    158 static void (*Perl_croak)(pTHX_ const char*, ...) __attribute__((noreturn));
    159 static void (*Perl_croak_nocontext)(const char*, ...) __attribute__((noreturn));
     158static void (*Perl_croak)(pTHX_ const char*, ...);
     159static void (*Perl_croak_nocontext)(const char*, ...);
    160160static I32 (*Perl_dowantarray)(pTHX);
    161161static void (*Perl_free_tmps)(pTHX);
    162162static HV* (*Perl_gv_stashpv)(pTHX_ const char*, I32);
     
    10561056    int i;
    10571057    long lnum;
    10581058    char *line;
    1059     buf_T *savebuf;
    10601059    PPCODE:
    10611060    if (buf_valid(vimbuf))
    10621061    {
     
    10691068            line = SvPV(ST(i),PL_na);
    10701069            if (lnum > 0 && lnum <= vimbuf->b_ml.ml_line_count && line != NULL)
    10711070            {
    1072                 savebuf = curbuf;
    1073                 curbuf = vimbuf;
     1071                aco_save_T      aco;
     1072
     1073                /* set curwin/curbuf for "vimbuf" and save some things */
     1074                aucmd_prepbuf(&aco, vimbuf);
     1075
    10741076                if (u_savesub(lnum) == OK)
    10751077                {
    10761078                    ml_replace(lnum, (char_u *)line, TRUE);
    10771079                    changed_bytes(lnum, 0);
    10781080                }
    1079                 curbuf = savebuf;
     1081
     1082                /* restore curwin/curbuf and a few other things */
     1083                aucmd_restbuf(&aco);
     1084                /* Careful: autocommands may have made "vimbuf" invalid! */
    10801085            }
    10811086        }
    10821087    }
     
    10871092
    10881093    PREINIT:
    10891094    long i, lnum = 0, count = 0;
    1090     buf_T *savebuf;
    10911095    PPCODE:
    10921096    if (buf_valid(vimbuf))
    10931097    {
     
    11141118            {
    11151119                if (lnum > 0 && lnum <= vimbuf->b_ml.ml_line_count)
    11161120                {
    1117                     savebuf = curbuf;
    1118                     curbuf = vimbuf;
     1121                    aco_save_T  aco;
     1122
     1123                    /* set curwin/curbuf for "vimbuf" and save some things */
     1124                    aucmd_prepbuf(&aco, vimbuf);
     1125
    11191126                    if (u_savedel(lnum, 1) == OK)
    11201127                    {
    11211128                        ml_delete(lnum, 0);
    11221129                        deleted_lines_mark(lnum, 1L);
    1123                         if (savebuf == curbuf)
     1130                        if (aco.save_buf == curbuf)
    11241131                            check_cursor();
    11251132                    }
    1126                     curbuf = savebuf;
     1133
     1134                    /* restore curwin/curbuf and a few other things */
     1135                    aucmd_restbuf(&aco);
     1136                    /* Careful: autocommands may have made "vimbuf" invalid! */
     1137
    11271138                    update_curbuf(VALID);
    11281139                }
    11291140            }
     
    11381149    int         i;
    11391150    long        lnum;
    11401151    char        *line;
    1141     buf_T       *savebuf;
    11421152    PPCODE:
    11431153    if (buf_valid(vimbuf))
    11441154    {
     
    11511161            line = SvPV(ST(i),PL_na);
    11521162            if (lnum >= 0 && lnum <= vimbuf->b_ml.ml_line_count && line != NULL)
    11531163            {
    1154                 savebuf = curbuf;
    1155                 curbuf = vimbuf;
     1164                aco_save_T      aco;
     1165
     1166                /* set curwin/curbuf for "vimbuf" and save some things */
     1167                aucmd_prepbuf(&aco, vimbuf);
     1168
    11561169                if (u_inssub(lnum + 1) == OK)
    11571170                {
    11581171                    ml_append(lnum, (char_u *)line, (colnr_T)0, FALSE);
    11591172                    appended_lines_mark(lnum, 1L);
    11601173                }
    1161                 curbuf = savebuf;
     1174
     1175                /* restore curwin/curbuf and a few other things */
     1176                aucmd_restbuf(&aco);
     1177                /* Careful: autocommands may have made "vimbuf" invalid! */
     1178
    11621179                update_curbuf(VALID);
    11631180            }
    11641181        }
  • src/if_ruby.c

    diff -Naur vim70.orig/src/if_ruby.c vim70/src/if_ruby.c
    old new  
    643643
    644644static VALUE set_buffer_line(buf_T *buf, linenr_T n, VALUE str)
    645645{
    646     buf_T *savebuf = curbuf;
    647     char *line = STR2CSTR(str);
     646    char        *line = STR2CSTR(str);
     647    aco_save_T  aco;
     648
     649    if (n > 0 && n <= buf->b_ml.ml_line_count && line != NULL)
     650    {
     651        /* set curwin/curbuf for "buf" and save some things */
     652        aucmd_prepbuf(&aco, buf);
    648653
    649     if (n > 0 && n <= buf->b_ml.ml_line_count && line != NULL) {
    650         curbuf = buf;
    651654        if (u_savesub(n) == OK) {
    652655            ml_replace(n, (char_u *)line, TRUE);
    653656            changed();
     
    655658            syn_changed(n); /* recompute syntax hl. for this line */
    656659#endif
    657660        }
    658         curbuf = savebuf;
     661
     662        /* restore curwin/curbuf and a few other things */
     663        aucmd_restbuf(&aco);
     664        /* Careful: autocommands may have made "buf" invalid! */
     665
    659666        update_curbuf(NOT_VALID);
    660667    }
    661     else {
     668    else
     669    {
    662670        rb_raise(rb_eIndexError, "index %d out of buffer", n);
    663671        return Qnil; /* For stop warning */
    664672    }
     
    676684
    677685static VALUE buffer_delete(VALUE self, VALUE num)
    678686{
    679     buf_T *buf = get_buf(self);
    680     buf_T *savebuf = curbuf;
    681     long n = NUM2LONG(num);
     687    buf_T       *buf = get_buf(self);
     688    long        n = NUM2LONG(num);
     689    aco_save_T  aco;
     690
     691    if (n > 0 && n <= buf->b_ml.ml_line_count)
     692    {
     693        /* set curwin/curbuf for "buf" and save some things */
     694        aucmd_prepbuf(&aco, buf);
    682695
    683     if (n > 0 && n <= buf->b_ml.ml_line_count) {
    684         curbuf = buf;
    685696        if (u_savedel(n, 1) == OK) {
    686697            ml_delete(n, 0);
    687698
     
    691702
    692703            changed();
    693704        }
    694         curbuf = savebuf;
     705
     706        /* restore curwin/curbuf and a few other things */
     707        aucmd_restbuf(&aco);
     708        /* Careful: autocommands may have made "buf" invalid! */
     709
    695710        update_curbuf(NOT_VALID);
    696711    }
    697     else {
     712    else
     713    {
    698714        rb_raise(rb_eIndexError, "index %d out of buffer", n);
    699715    }
    700716    return Qnil;
     
    702718
    703719static VALUE buffer_append(VALUE self, VALUE num, VALUE str)
    704720{
    705     buf_T *buf = get_buf(self);
    706     buf_T *savebuf = curbuf;
    707     char *line = STR2CSTR(str);
    708     long n = NUM2LONG(num);
     721    buf_T       *buf = get_buf(self);
     722    char        *line = STR2CSTR(str);
     723    long        n = NUM2LONG(num);
     724    aco_save_T  aco;
     725
     726    if (n >= 0 && n <= buf->b_ml.ml_line_count && line != NULL)
     727    {
     728        /* set curwin/curbuf for "buf" and save some things */
     729        aucmd_prepbuf(&aco, buf);
    709730
    710     if (n >= 0 && n <= buf->b_ml.ml_line_count && line != NULL) {
    711         curbuf = buf;
    712731        if (u_inssub(n + 1) == OK) {
    713732            ml_append(n, (char_u *) line, (colnr_T) 0, FALSE);
    714733
     
    718737
    719738            changed();
    720739        }
    721         curbuf = savebuf;
     740
     741        /* restore curwin/curbuf and a few other things */
     742        aucmd_restbuf(&aco);
     743        /* Careful: autocommands may have made "buf" invalid! */
     744
    722745        update_curbuf(NOT_VALID);
    723746    }
    724747    else {
  • src/main.c

    diff -Naur vim70.orig/src/main.c vim70/src/main.c
    old new  
    564564     */
    565565    if (p_lpl)
    566566    {
     567# ifdef VMS     /* Somehow VMS doesn't handle the "**". */
     568        source_runtime((char_u *)"plugin/*.vim", TRUE);
     569# else
    567570        source_runtime((char_u *)"plugin/**/*.vim", TRUE);
     571# endif
    568572        TIME_MSG("loading plugins");
    569573    }
    570574#endif
     
    32083212     * Register for remote command execution with :serversend and --remote
    32093213     * unless there was a -X or a --servername '' on the command line.
    32103214     * Only register nongui-vim's with an explicit --servername argument.
     3215     * When running as root --servername is also required.
    32113216     */
    32123217    if (X_DISPLAY != NULL && parmp->servername != NULL && (
    32133218#  ifdef FEAT_GUI
    3214                 gui.in_use ||
     3219                (gui.in_use
     3220#   ifdef UNIX
     3221                 && getuid() != 0
     3222#   endif
     3223                ) ||
    32153224#  endif
    32163225                parmp->serverName_arg != NULL))
    32173226    {
  • src/Makefile

    diff -Naur vim70.orig/src/Makefile vim70/src/Makefile
    old new  
    21772177        cd $(SHADOWDIR)/xxd; ln -s ../../xxd/*.[ch] ../../xxd/Make* .
    21782178        if test -d $(RSRC_DIR); then \
    21792179                cd $(SHADOWDIR); \
     2180                ln -s ../infplist.xml .; \
    21802181                ln -s ../$(RSRC_DIR) ../os_mac.rsr.hqx ../dehqx.py .; \
    21812182        fi
    21822183        mkdir $(SHADOWDIR)/testdir
  • src/mbyte.c

    diff -Naur vim70.orig/src/mbyte.c vim70/src/mbyte.c
    old new  
    311311
    312312#define IDX_MACROMAN    57
    313313    {"macroman",        ENC_8BIT + ENC_MACROMAN, 0},    /* Mac OS */
    314 #define IDX_COUNT       58
     314#define IDX_DECMCS      58
     315    {"dec-mcs",         ENC_8BIT,               0},     /* DEC MCS */
     316#define IDX_HPROMAN8    59
     317    {"hp-roman8",       ENC_8BIT,               0},     /* HP Roman8 */
     318#define IDX_COUNT       60
    315319};
    316320
    317321/*
     
    359363    {"932",             IDX_CP932},
    360364    {"949",             IDX_CP949},
    361365    {"936",             IDX_CP936},
     366    {"gbk",             IDX_CP936},
     367    {"gb18030",         IDX_CP936},     /* only 99% the same */
    362368    {"950",             IDX_CP950},
    363369    {"eucjp",           IDX_EUC_JP},
    364370    {"unix-jis",        IDX_EUC_JP},
     
    386392    {"950",             IDX_BIG5},
    387393#endif
    388394    {"mac",             IDX_MACROMAN},
     395    {"mac-roman",       IDX_MACROMAN},
    389396    {NULL,              0}
    390397};
    391398
  • src/menu.c

    diff -Naur vim70.orig/src/menu.c vim70/src/menu.c
    old new  
    511511         * name (without mnemonic and accelerator text). */
    512512        next_name = menu_name_skip(name);
    513513        dname = menu_text(name, NULL, NULL);
     514        if (dname == NULL)
     515            goto erret;
     516        if (*dname == NUL)
     517        {
     518            /* Only a mnemonic or accelerator is not valid. */
     519            EMSG(_("E792: Empty menu name"));
     520            goto erret;
     521        }
    514522
    515523        /* See if it's already there */
    516524        lower_pri = menup;
     
    704712        parent = menu;
    705713        name = next_name;
    706714        vim_free(dname);
     715        dname = NULL;
    707716        if (pri_tab[pri_idx + 1] != -1)
    708717            ++pri_idx;
    709718    }
     
    793802erret:
    794803    vim_free(path_name);
    795804    vim_free(dname);
     805
     806    /* Delete any empty submenu we added before discovering the error.  Repeat
     807     * for higher levels. */
     808    while (parent != NULL && parent->children == NULL)
     809    {
     810        if (parent->parent == NULL)
     811            menup = &root_menu;
     812        else
     813            menup = &parent->parent->children;
     814        for ( ; *menup != NULL && *menup != parent; menup = &((*menup)->next))
     815            ;
     816        if (*menup == NULL) /* safety check */
     817            break;
     818        parent = parent->parent;
     819        free_menu(menup);
     820    }
    796821    return FAIL;
    797822}
    798823
     
    17531778}
    17541779
    17551780/*
     1781 * Check that a pointer appears in the menu tree.  Used to protect from using
     1782 * a menu that was deleted after it was selected but before the event was
     1783 * handled.
     1784 * Return OK or FAIL.  Used recursively.
     1785 */
     1786    int
     1787check_menu_pointer(root, menu_to_check)
     1788    vimmenu_T *root;
     1789    vimmenu_T *menu_to_check;
     1790{
     1791    vimmenu_T   *p;
     1792
     1793    for (p = root; p != NULL; p = p->next)
     1794        if (p == menu_to_check
     1795                || (p->children != NULL
     1796                    && check_menu_pointer(p->children, menu_to_check) == OK))
     1797            return OK;
     1798    return FAIL;
     1799}
     1800
     1801/*
    17561802 * After we have started the GUI, then we can create any menus that have been
    17571803 * defined.  This is done once here.  add_menu_path() may have already been
    17581804 * called to define these menus, and may be called again.  This function calls
  • src/message.c

    diff -Naur vim70.orig/src/message.c vim70/src/message.c
    old new  
    41754175                        str_arg_l = 0;
    41764176                    else
    41774177                    {
    4178                         /* memchr on HP does not like n > 2^31  !!! */
    4179                         char *q = memchr(str_arg, '\0',
     4178                        /* Don't put the #if inside memchr(), it can be a
     4179                         * macro. */
    41804180#if SIZEOF_INT <= 2
    4181                                 precision
     4181                        char *q = memchr(str_arg, '\0', precision);
    41824182#else
    4183                                 precision <= (size_t)0x7fffffffL ? precision
    4184                                                        : (size_t)0x7fffffffL
     4183                        /* memchr on HP does not like n > 2^31  !!! */
     4184                        char *q = memchr(str_arg, '\0',
     4185                                  precision <= (size_t)0x7fffffffL ? precision
     4186                                                       : (size_t)0x7fffffffL);
    41854187#endif
    4186                                                        );
    41874188                        str_arg_l = (q == NULL) ? precision : q - str_arg;
    41884189                    }
    41894190                    break;
  • src/misc1.c

    diff -Naur vim70.orig/src/misc1.c vim70/src/misc1.c
    old new  
    44924492                int l = mb_ptr2len(s);
    44934493
    44944494                while (--l > 0)
    4495                     *d++ = *s++;
     4495                    *d++ = *++s;
    44964496            }
    44974497# endif
    44984498        }
  • src/netbeans.c

    diff -Naur vim70.orig/src/netbeans.c vim70/src/netbeans.c
    old new  
    19861986            if (buf->bufp != NULL)
    19871987                do_buffer(DOBUF_WIPE, DOBUF_FIRST, FORWARD,
    19881988                                                     buf->bufp->b_fnum, TRUE);
     1989            buf->bufp = NULL;
     1990            buf->initDone = FALSE;
    19891991            doupdate = 1;
    19901992/* =====================================================================*/
    19911993        }
  • src/normal.c

    diff -Naur vim70.orig/src/normal.c vim70/src/normal.c
    old new  
    25042504             * NOTE: Ignore right button down and drag mouse events.
    25052505             * Windows only shows the popup menu on the button up event.
    25062506             */
    2507 #if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON)
     2507#if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_GTK) \
     2508                          || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MAC)
    25082509            if (!is_click)
    25092510                return FALSE;
    25102511#endif
  • src/ops.c

    diff -Naur vim70.orig/src/ops.c vim70/src/ops.c
    old new  
    24132413        else
    24142414        {
    24152415            curwin->w_cursor = oap->end;
     2416            check_cursor_col();
    24162417
    24172418            /* Works just like an 'i'nsert on the next character. */
    24182419            if (!lineempty(curwin->w_cursor.lnum)
     
    34923493# endif
    34933494        if (flags & PUT_CURSEND)
    34943495        {
     3496            colnr_T len;
     3497
    34953498            curwin->w_cursor = curbuf->b_op_end;
    34963499            curwin->w_cursor.col++;
     3500
     3501            /* in Insert mode we might be after the NUL, correct for that */
     3502            len = (colnr_T)STRLEN(ml_get_curline());
     3503            if (curwin->w_cursor.col > len)
     3504                curwin->w_cursor.col = len;
    34973505        }
    34983506        else
    34993507            curwin->w_cursor.lnum = lnum;
  • src/option.c

    diff -Naur vim70.orig/src/option.c vim70/src/option.c
    old new  
    22942294                            {(char_u *)0L, (char_u *)0L}
    22952295#endif
    22962296                            },
    2297     {"spellsuggest", "sps", P_STRING|P_VI_DEF|P_EXPAND|P_SECURE,
     2297    {"spellsuggest", "sps", P_STRING|P_VI_DEF|P_EXPAND|P_SECURE|P_COMMA,
    22982298#ifdef FEAT_SPELL
    22992299                            (char_u *)&p_sps, PV_NONE,
    23002300                            {(char_u *)"best", (char_u *)0L}
     
    52275227            case PV_STL:        return &curwin->w_p_stl_flags;
    52285228#endif
    52295229#ifdef FEAT_EVAL
     5230# ifdef FEAT_FOLDING
    52305231            case PV_FDE:        return &curwin->w_p_fde_flags;
    52315232            case PV_FDT:        return &curwin->w_p_fdt_flags;
     5233# endif
    52325234# ifdef FEAT_BEVAL
    52335235            case PV_BEXPR:      return &curbuf->b_p_bexpr_flags;
    52345236# endif
    5235 #endif
    5236 #if defined(FEAT_EVAL)
    52375237# if defined(FEAT_CINDENT)
    52385238            case PV_INDE:       return &curbuf->b_p_inde_flags;
    52395239# endif
     
    63256325            else
    63266326                errmsg = check_stl_option(p_ruf);
    63276327        }
    6328         else
     6328        /* check 'statusline' only if it doesn't start with "%!" */
     6329        else if (varp != &p_stl || s[0] != '%' || s[1] != '!')
    63296330            errmsg = check_stl_option(s);
    63306331        if (varp == &p_ruf && errmsg == NULL)
    63316332            comp_col();
  • src/os_unix.c

    diff -Naur vim70.orig/src/os_unix.c vim70/src/os_unix.c
    old new  
    49714971                    if (((*file)[*num_file] = alloc(len + 2)) != NULL)
    49724972                    {
    49734973                        STRCPY((*file)[*num_file], p);
    4974                         if (!after_pathsep((*file)[*num_file] + len))
     4974                        if (!after_pathsep((*file)[*num_file],
     4975                                                    (*file)[*num_file] + len))
    49754976                        {
    49764977                            (*file)[*num_file][len] = psepc;
    49774978                            (*file)[*num_file][len + 1] = NUL;
     
    57575758    int         retval_int = 0;
    57585759    int         success = FALSE;
    57595760
    5760     /* Get a handle to the DLL module. */
     5761    /*
     5762     * Get a handle to the DLL module.
     5763     */
    57615764# if defined(USE_DLOPEN)
     5765    /* First clear any error, it's not cleared by the dlopen() call. */
     5766    (void)dlerror();
     5767
    57625768    hinstLib = dlopen((char *)libname, RTLD_LAZY
    57635769#  ifdef RTLD_LOCAL
    57645770            | RTLD_LOCAL
  • src/popupmnu.c

    diff -Naur vim70.orig/src/popupmnu.c vim70/src/popupmnu.c
    old new  
    552552{
    553553    pum_array = NULL;
    554554    redraw_all_later(SOME_VALID);
     555#ifdef FEAT_WINDOWS
     556    redraw_tabline = TRUE;
     557#endif
    555558    status_redraw_all();
    556559}
    557560
  • src/proto/menu.pro

    diff -Naur vim70.orig/src/proto/menu.pro vim70/src/proto/menu.pro
    old new  
    1010extern int menu_is_child_of_popup __ARGS((vimmenu_T *menu));
    1111extern int menu_is_toolbar __ARGS((char_u *name));
    1212extern int menu_is_separator __ARGS((char_u *name));
     13extern int check_menu_pointer __ARGS((vimmenu_T *root, vimmenu_T *menu_to_check));
    1314extern void gui_create_initial_menus __ARGS((vimmenu_T *menu));
    1415extern void gui_update_menus __ARGS((int modes));
    1516extern int gui_is_menu_shortcut __ARGS((int key));
  • src/proto/undo.pro

    diff -Naur vim70.orig/src/proto/undo.pro vim70/src/proto/undo.pro
    old new  
    44extern int u_savesub __ARGS((linenr_T lnum));
    55extern int u_inssub __ARGS((linenr_T lnum));
    66extern int u_savedel __ARGS((linenr_T lnum, long nlines));
     7extern int undo_allowed __ARGS((void));
    78extern void u_undo __ARGS((int count));
    89extern void u_redo __ARGS((int count));
    910extern void undo_time __ARGS((long step, int sec, int absolute));
  • src/quickfix.c

    diff -Naur vim70.orig/src/quickfix.c vim70/src/quickfix.c
    old new  
    602602                else
    603603                    type = 0;
    604604                /*
    605                  * Extract error message data from matched line
     605                 * Extract error message data from matched line.
     606                 * We check for an actual submatch, because "\[" and "\]" in
     607                 * the 'errorformat' may cause the wrong submatch to be used.
    606608                 */
    607609                if ((i = (int)fmt_ptr->addr[0]) > 0)            /* %f */
    608610                {
    609                     int c = *regmatch.endp[i];
     611                    int c;
     612
     613                    if (regmatch.startp[i] == NULL || regmatch.endp[i] == NULL)
     614                        continue;
    610615
    611616                    /* Expand ~/file and $HOME/file to full path. */
     617                    c = *regmatch.endp[i];
    612618                    *regmatch.endp[i] = NUL;
    613619                    expand_env(regmatch.startp[i], namebuf, CMDBUFFSIZE);
    614620                    *regmatch.endp[i] = c;
     
    618624                        continue;
    619625                }
    620626                if ((i = (int)fmt_ptr->addr[1]) > 0)            /* %n */
     627                {
     628                    if (regmatch.startp[i] == NULL)
     629                        continue;
    621630                    enr = (int)atol((char *)regmatch.startp[i]);
     631                }
    622632                if ((i = (int)fmt_ptr->addr[2]) > 0)            /* %l */
     633                {
     634                    if (regmatch.startp[i] == NULL)
     635                        continue;
    623636                    lnum = atol((char *)regmatch.startp[i]);
     637                }
    624638                if ((i = (int)fmt_ptr->addr[3]) > 0)            /* %c */
     639                {
     640                    if (regmatch.startp[i] == NULL)
     641                        continue;
    625642                    col = (int)atol((char *)regmatch.startp[i]);
     643                }
    626644                if ((i = (int)fmt_ptr->addr[4]) > 0)            /* %t */
     645                {
     646                    if (regmatch.startp[i] == NULL)
     647                        continue;
    627648                    type = *regmatch.startp[i];
     649                }
    628650                if (fmt_ptr->flags == '+' && !multiscan)        /* %+ */
    629651                    STRCPY(errmsg, IObuff);
    630652                else if ((i = (int)fmt_ptr->addr[5]) > 0)       /* %m */
    631653                {
     654                    if (regmatch.startp[i] == NULL || regmatch.endp[i] == NULL)
     655                        continue;
    632656                    len = (int)(regmatch.endp[i] - regmatch.startp[i]);
    633657                    vim_strncpy(errmsg, regmatch.startp[i], len);
    634658                }
    635659                if ((i = (int)fmt_ptr->addr[6]) > 0)            /* %r */
     660                {
     661                    if (regmatch.startp[i] == NULL)
     662                        continue;
    636663                    tail = regmatch.startp[i];
     664                }
    637665                if ((i = (int)fmt_ptr->addr[7]) > 0)            /* %p */
    638666                {
     667                    if (regmatch.startp[i] == NULL || regmatch.endp[i] == NULL)
     668                        continue;
    639669                    col = (int)(regmatch.endp[i] - regmatch.startp[i] + 1);
    640670                    if (*((char_u *)regmatch.startp[i]) != TAB)
    641671                        use_viscol = TRUE;
    642672                }
    643673                if ((i = (int)fmt_ptr->addr[8]) > 0)            /* %v */
    644674                {
     675                    if (regmatch.startp[i] == NULL)
     676                        continue;
    645677                    col = (int)atol((char *)regmatch.startp[i]);
    646678                    use_viscol = TRUE;
    647679                }
    648680                if ((i = (int)fmt_ptr->addr[9]) > 0)            /* %s */
    649681                {
     682                    if (regmatch.startp[i] == NULL || regmatch.endp[i] == NULL)
     683                        continue;
    650684                    len = (int)(regmatch.endp[i] - regmatch.startp[i]);
    651685                    if (len > CMDBUFFSIZE - 5)
    652686                        len = CMDBUFFSIZE - 5;
     
    24292463    qf_info_T   *qi;
    24302464{
    24312465    buf_T       *buf;
    2432 #ifdef FEAT_AUTOCMD
    24332466    aco_save_T  aco;
    2434 #else
    2435     buf_T       *save_curbuf;
    2436 #endif
    24372467
    24382468    /* Check if a buffer for the quickfix list exists.  Update it. */
    24392469    buf = qf_find_buf(qi);
    24402470    if (buf != NULL)
    24412471    {
    2442 #ifdef FEAT_AUTOCMD
    24432472        /* set curwin/curbuf to buf and save a few things */
    24442473        aucmd_prepbuf(&aco, buf);
    2445 #else
    2446         save_curbuf = curbuf;
    2447         curbuf = buf;
    2448 #endif
    24492474
    24502475        qf_fill_buffer(qi);
    24512476
    2452 #ifdef FEAT_AUTOCMD
    24532477        /* restore curwin/curbuf and a few other things */
    24542478        aucmd_restbuf(&aco);
    2455 #else
    2456         curbuf = save_curbuf;
    2457 #endif
    24582479
    24592480        (void)qf_win_pos_update(qi, 0);
    24602481    }
     
    29432964#if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL)
    29442965    char_u      *save_ei = NULL;
    29452966#endif
    2946 #ifndef FEAT_AUTOCMD
    2947     buf_T       *save_curbuf;
    2948 #else
    29492967    aco_save_T  aco;
     2968#ifdef FEAT_AUTOCMD
    29502969    char_u      *au_name =  NULL;
    29512970    int         flags = 0;
    29522971    colnr_T     col;
     
    31673186                     * need to be done now, in that buffer.  And the modelines
    31683187                     * need to be done (again).  But not the window-local
    31693188                     * options! */
    3170 #if defined(FEAT_AUTOCMD)
    31713189                    aucmd_prepbuf(&aco, buf);
    3172 #else
    3173                     save_curbuf = curbuf;
    3174                     curbuf = buf;
    3175                     curwin->w_buffer = curbuf;
    3176 #endif
    31773190#if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL)
    31783191                    apply_autocmds(EVENT_FILETYPE, buf->b_p_ft,
    31793192                                                     buf->b_fname, TRUE, buf);
    31803193#endif
    31813194                    do_modelines(OPT_NOWIN);
    3182 #if defined(FEAT_AUTOCMD)
    31833195                    aucmd_restbuf(&aco);
    3184 #else
    3185                     curbuf = save_curbuf;
    3186                     curwin->w_buffer = curbuf;
    3187 #endif
    31883196                }
    31893197            }
    31903198        }
     
    32853293{
    32863294    buf_T       *newbuf;
    32873295    int         failed = TRUE;
    3288 #ifdef FEAT_AUTOCMD
    32893296    aco_save_T  aco;
    3290 #else
    3291     buf_T       *old_curbuf = curbuf;
    3292 #endif
    32933297
    32943298    /* Allocate a buffer without putting it in the buffer list. */
    32953299    newbuf = buflist_new(NULL, NULL, (linenr_T)1, BLN_DUMMY);
     
    32993303    /* Init the options. */
    33003304    buf_copy_options(newbuf, BCO_ENTER | BCO_NOHELP);
    33013305
    3302 #ifdef FEAT_AUTOCMD
    33033306    /* set curwin/curbuf to buf and save a few things */
    33043307    aucmd_prepbuf(&aco, newbuf);
    3305 #else
    3306     curbuf = newbuf;
    3307     curwin->w_buffer = newbuf;
    3308 #endif
    33093308
    33103309    /* Need to set the filename for autocommands. */
    33113310    (void)setfname(curbuf, fname, NULL, FALSE);
     
    33363335        }
    33373336    }
    33383337
    3339 #ifdef FEAT_AUTOCMD
    33403338    /* restore curwin/curbuf and a few other things */
    33413339    aucmd_restbuf(&aco);
    3342 #else
    3343     curbuf = old_curbuf;
    3344     curwin->w_buffer = old_curbuf;
    3345 #endif
    33463340
    33473341    if (!buf_valid(newbuf))
    33483342        return NULL;
  • src/screen.c

    diff -Naur vim70.orig/src/screen.c vim70/src/screen.c
    old new  
    26122612#ifdef FEAT_LINEBREAK
    26132613    int         need_showbreak = FALSE;
    26142614#endif
    2615 #if defined(FEAT_SIGNS) || (defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS))
     2615#if defined(FEAT_SIGNS) || (defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)) \
     2616        || defined(FEAT_SYN_HL) || defined(FEAT_DIFF)
    26162617# define LINE_ATTR
    26172618    int         line_attr = 0;          /* atrribute for the whole line */
    26182619#endif
     
    26262627    int         prev_c = 0;             /* previous Arabic character */
    26272628    int         prev_c1 = 0;            /* first composing char for prev_c */
    26282629#endif
    2629 #if defined(FEAT_DIFF) || defined(LINE_ATTR)
     2630#if defined(LINE_ATTR)
    26302631    int         did_line_attr = 0;
    26312632#endif
    26322633
     
    41164117                    --ptr;          /* put it back at the NUL */
    41174118                }
    41184119#endif
    4119 #if defined(FEAT_DIFF) || defined(LINE_ATTR)
     4120#if defined(LINE_ATTR)
    41204121                else if ((
    41214122# ifdef FEAT_DIFF
    4122                             diff_hlf != (hlf_T)0
    4123 #  ifdef LINE_ATTR
    4124                             ||
    4125 #  endif
     4123                            diff_hlf != (hlf_T)0 ||
    41264124# endif
    4127 # ifdef LINE_ATTR
    41284125                            line_attr != 0
    4129 # endif
    41304126                        ) && (
    41314127# ifdef FEAT_RIGHTLEFT
    41324128                            wp->w_p_rl ? (col >= 0) :
     
    42374233         * At end of the text line or just after the last character.
    42384234         */
    42394235        if (c == NUL
    4240 #if defined(FEAT_DIFF) || defined(LINE_ATTR)
     4236#if defined(LINE_ATTR)
    42414237                || did_line_attr == 1
    42424238#endif
    42434239                )
     
    42584254                                || prevcol == (long)match_hl[0].startcol
    42594255                                || prevcol == (long)match_hl[1].startcol
    42604256                                || prevcol == (long)match_hl[2].startcol)
    4261 # if defined(FEAT_DIFF) || defined(LINE_ATTR)
     4257# if defined(LINE_ATTR)
    42624258                            && did_line_attr <= 1
    42634259# endif
    42644260                           )
     
    71337129        return;
    71347130    entered = TRUE;
    71357131
     7132    /*
     7133     * Note that the window sizes are updated before reallocating the arrays,
     7134     * thus we must not redraw here!
     7135     */
     7136    ++RedrawingDisabled;
     7137
    71367138    win_new_shellsize();    /* fit the windows in the new sized shell */
    71377139
    71387140    comp_col();         /* recompute columns for shown command and ruler */
     
    73677369#endif
    73687370
    73697371    entered = FALSE;
     7372    --RedrawingDisabled;
    73707373
    73717374#ifdef FEAT_AUTOCMD
    73727375    if (starting == 0)
  • src/spell.c

    diff -Naur vim70.orig/src/spell.c vim70/src/spell.c
    old new  
    21082108         * possible. */
    21092109        STRCPY(buf, line);
    21102110        if (lnum < wp->w_buffer->b_ml.ml_line_count)
    2111             spell_cat_line(buf + STRLEN(buf), ml_get(lnum + 1), MAXWLEN);
     2111            spell_cat_line(buf + STRLEN(buf),
     2112                          ml_get_buf(wp->w_buffer, lnum + 1, FALSE), MAXWLEN);
    21122113
    21132114        p = buf + skip;
    21142115        endp = buf + len;
     
    1007010071
    1007110072        /* List the suggestions. */
    1007210073        msg_start();
     10074        msg_row = Rows - 1;     /* for when 'cmdheight' > 1 */
    1007310075        lines_left = Rows;      /* avoid more prompt */
    1007410076        vim_snprintf((char *)IObuff, IOSIZE, _("Change \"%.*s\" to:"),
    1007510077                                                sug.su_badlen, sug.su_badptr);
  • src/structs.h

    diff -Naur vim70.orig/src/structs.h vim70/src/structs.h
    old new  
    22132213
    22142214/*
    22152215 * Struct to save values in before executing autocommands for a buffer that is
    2216  * not the current buffer.
     2216 * not the current buffer.  Without FEAT_AUTOCMD only "curbuf" is remembered.
    22172217 */
    22182218typedef struct
    22192219{
    22202220    buf_T       *save_buf;      /* saved curbuf */
     2221#ifdef FEAT_AUTOCMD
    22212222    buf_T       *new_curbuf;    /* buffer to be used */
    22222223    win_T       *save_curwin;   /* saved curwin, NULL if it didn't change */
    22232224    win_T       *new_curwin;    /* new curwin if save_curwin != NULL */
    22242225    pos_T       save_cursor;    /* saved cursor pos of save_curwin */
    22252226    linenr_T    save_topline;   /* saved topline of save_curwin */
    2226 #ifdef FEAT_DIFF
     2227# ifdef FEAT_DIFF
    22272228    int         save_topfill;   /* saved topfill of save_curwin */
     2229# endif
    22282230#endif
    22292231} aco_save_T;
    22302232
  • src/term.c

    diff -Naur vim70.orig/src/term.c vim70/src/term.c
    old new  
    47834783                return -1;
    47844784            current_menu = (vimmenu_T *)val;
    47854785            slen += num_bytes;
     4786
     4787            /* The menu may have been deleted right after it was used, check
     4788             * for that. */
     4789            if (check_menu_pointer(root_menu, current_menu) == FAIL)
     4790            {
     4791                key_name[0] = KS_EXTRA;
     4792                key_name[1] = (int)KE_IGNORE;
     4793            }
    47864794        }
    47874795# endif
    47884796# ifdef FEAT_GUI_TABLINE
  • src/undo.c

    diff -Naur vim70.orig/src/undo.c vim70/src/undo.c
    old new  
    8484static void u_unch_branch __ARGS((u_header_T *uhp));
    8585static u_entry_T *u_get_headentry __ARGS((void));
    8686static void u_getbot __ARGS((void));
    87 static int undo_allowed __ARGS((void));
    8887static int u_savecommon __ARGS((linenr_T, linenr_T, linenr_T));
    8988static void u_doit __ARGS((int count));
    9089static void u_undoredo __ARGS((int undo));
     
    196195 * Return TRUE when undo is allowed.  Otherwise give an error message and
    197196 * return FALSE.
    198197 */
    199     static int
     198    int
    200199undo_allowed()
    201200{
    202201    /* Don't allow changes when 'modifiable' is off.  */
  • src/version.c

    diff -Naur vim70.orig/src/version.c vim70/src/version.c
    old new  
    667667static int included_patches[] =
    668668{   /* Add new patch number below this line */
    669669/**/
     670    66,
     671/**/
     672    64,
     673/**/
     674    63,
     675/**/
     676    62,
     677/**/
     678    61,
     679/**/
     680    60,
     681/**/
     682    59,
     683/**/
     684    58,
     685/**/
     686    56,
     687/**/
     688    55,
     689/**/
     690    54,
     691/**/
     692    53,
     693/**/
     694    52,
     695/**/
     696    51,
     697/**/
     698    50,
     699/**/
     700    49,
     701/**/
     702    48,
     703/**/
     704    47,
     705/**/
     706    46,
     707/**/
     708    44,
     709/**/
     710    43,
     711/**/
     712    42,
     713/**/
     714    41,
     715/**/
     716    40,
     717/**/
     718    39,
     719/**/
     720    38,
     721/**/
     722    37,
     723/**/
     724    36,
     725/**/
     726    35,
     727/**/
     728    34,
     729/**/
     730    33,
     731/**/
     732    31,
     733/**/
     734    30,
     735/**/
     736    29,
     737/**/
     738    28,
     739/**/
     740    26,
     741/**/
     742    25,
     743/**/
     744    24,
     745/**/
     746    23,
     747/**/
     748    22,
     749/**/
     750    21,
     751/**/
     752    20,
     753/**/
     754    19,
     755/**/
     756    18,
     757/**/
     758    17,
     759/**/
     760    16,
     761/**/
     762    15,
     763/**/
     764    14,
     765/**/
     766    13,
     767/**/
     768    12,
     769/**/
     770    11,
     771/**/
     772    10,
     773/**/
     774    9,
     775/**/
     776    8,
     777/**/
     778    7,
     779/**/
     780    6,
     781/**/
     782    4,
     783/**/
     784    3,
     785/**/
     786    2,
     787/**/
     788    1,
     789/**/
    670790    0
    671791};
    672792
  • src/vim.h

    diff -Naur vim70.orig/src/vim.h vim70/src/vim.h
    old new  
    585585#define INSERT          0x10    /* Insert mode */
    586586#define LANGMAP         0x20    /* Language mapping, can be combined with
    587587                                   INSERT and CMDLINE */
    588 #define MAP_ALL_MODES   0x3f    /* all mode bits used for mapping */
    589588
    590589#define REPLACE_FLAG    0x40    /* Replace mode flag */
    591590#define REPLACE         (REPLACE_FLAG + INSERT)
     
    605604#define CONFIRM         0x800   /* ":confirm" prompt */
    606605#define SELECTMODE      0x1000  /* Select mode, only for mappings */
    607606
     607#define MAP_ALL_MODES   (0x3f | SELECTMODE)     /* all mode bits used for
     608                                                 * mapping */
     609
    608610/* directions */
    609611#define FORWARD                 1
    610612#define BACKWARD                (-1)
     
    19831985/* values for vim_handle_signal() that are not a signal */
    19841986#define SIGNAL_BLOCK    -1
    19851987#define SIGNAL_UNBLOCK  -2
    1986 #if !defined(UNIX) && !defined(VMS)
     1988#if !defined(UNIX) && !defined(VMS) && !defined(OS2)
    19871989# define vim_handle_signal(x) 0
    19881990#endif
    19891991
Note: See TracBrowser for help on using the repository browser.