~ubuntu-branches/debian/sid/neovim/sid

« back to all changes in this revision

Viewing changes to src/nvim/ex_getln.c

  • Committer: Package Import Robot
  • Author(s): James McCoy
  • Date: 2016-04-18 21:42:19 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20160418214219-1e6d4o1fwqarzk46
Tags: 0.1.3-1
* New upstream release.  (Closes: #820562)
* debian/control:
  + Remove unnecessary luarocks Build-Depends
  + Add libkvm-dev Build-Depends for kfreebsd-*
  + Add python(3)-neovim to Recommends.  (Closes: #812737)
  + Declare compiance with policy 3.9.8, no changes needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1130
1130
    if (!mouse_has(MOUSE_COMMAND)) {
1131
1131
      return command_line_not_changed(s);                   // Ignore mouse
1132
1132
    }
1133
 
    cmdline_paste(0, true, true);
 
1133
    cmdline_paste(eval_has_provider("clipboard") ? '*' : 0, true, true);
1134
1134
    redrawcmd();
1135
1135
    return command_line_changed(s);
1136
1136
 
2424
2424
  xfree(p);
2425
2425
}
2426
2426
 
2427
 
/*
2428
 
 * paste a yank register into the command line.
2429
 
 * used by CTRL-R command in command-line mode
2430
 
 * insert_reg() can't be used here, because special characters from the
2431
 
 * register contents will be interpreted as commands.
2432
 
 *
2433
 
 * return FAIL for failure, OK otherwise
2434
 
 */
2435
 
static int 
2436
 
cmdline_paste (
2437
 
    int regname,
2438
 
    int literally,          /* Insert text literally instead of "as typed" */
2439
 
    int remcr              /* remove trailing CR */
2440
 
)
 
2427
/// Paste a yank register into the command line.
 
2428
/// Used by CTRL-R command in command-line mode.
 
2429
/// insert_reg() can't be used here, because special characters from the
 
2430
/// register contents will be interpreted as commands.
 
2431
///
 
2432
/// @param regname   Register name.
 
2433
/// @param literally Insert text literally instead of "as typed".
 
2434
/// @param remcr     When true, remove trailing CR.
 
2435
///
 
2436
/// @returns FAIL for failure, OK otherwise
 
2437
static bool cmdline_paste(int regname, bool literally, bool remcr)
2441
2438
{
2442
2439
  long i;
2443
2440
  char_u              *arg;
2957
2954
    }
2958
2955
  }
2959
2956
 
2960
 
  /* Find longest common part */
 
2957
  // Find longest common part
2961
2958
  if (mode == WILD_LONGEST && xp->xp_numfiles > 0) {
2962
2959
    size_t len;
2963
 
    for (len = 0; xp->xp_files[0][len]; ++len) {
2964
 
      for (i = 0; i < xp->xp_numfiles; ++i) {
 
2960
    size_t mb_len = 1;
 
2961
    int c0;
 
2962
    int ci;
 
2963
 
 
2964
    for (len = 0; xp->xp_files[0][len]; len += mb_len) {
 
2965
      if (has_mbyte) {
 
2966
        mb_len = (* mb_ptr2len)(&xp->xp_files[0][len]);
 
2967
        c0 = (* mb_ptr2char)(&xp->xp_files[0][len]);
 
2968
      } else {
 
2969
        c0 = xp->xp_files[0][len];
 
2970
      }
 
2971
      for (i = 1; i < xp->xp_numfiles; ++i) {
 
2972
        if (has_mbyte) {
 
2973
          ci =(* mb_ptr2char)(&xp->xp_files[i][len]);
 
2974
        } else {
 
2975
          ci = xp->xp_files[i][len];
 
2976
        }
 
2977
 
2965
2978
        if (p_fic && (xp->xp_context == EXPAND_DIRECTORIES
2966
2979
                      || xp->xp_context == EXPAND_FILES
2967
2980
                      || xp->xp_context == EXPAND_SHELLCMD
2968
2981
                      || xp->xp_context == EXPAND_BUFFERS)) {
2969
 
          if (TOLOWER_LOC(xp->xp_files[i][len]) !=
2970
 
              TOLOWER_LOC(xp->xp_files[0][len]))
 
2982
          if (vim_tolower(c0) != vim_tolower(ci)) {
2971
2983
            break;
2972
 
        } else if (xp->xp_files[i][len] != xp->xp_files[0][len])
 
2984
          }
 
2985
        } else if (c0 != ci) {
2973
2986
          break;
 
2987
        }
2974
2988
      }
2975
2989
      if (i < xp->xp_numfiles) {
2976
2990
        if (!(options & WILD_NO_BEEP)) {
2979
2993
        break;
2980
2994
      }
2981
2995
    }
 
2996
 
2982
2997
    ss = (char_u *)xstrndup((char *)xp->xp_files[0], len);
2983
 
    findex = -1;                            /* next p_wc gets first one */
 
2998
    findex = -1;  // next p_wc gets first one
2984
2999
  }
2985
3000
 
2986
3001
  // Concatenate all matching names
5136
5151
 
5137
5152
    /* Don't execute autocommands while deleting the window. */
5138
5153
    block_autocmds();
 
5154
    // Avoid command-line window first character being concealed
 
5155
    curwin->w_p_cole = 0;
5139
5156
    wp = curwin;
5140
5157
    bp = curbuf;
5141
5158
    win_goto(old_curwin);