~ubuntu-branches/ubuntu/maverick/vim/maverick

« back to all changes in this revision

Viewing changes to src/os_mswin.c

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2009-05-04 11:13:42 UTC
  • mfrom: (1.1.8 upstream) (0.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090504111342-60miqybsixdpc345
Tags: 2:7.2.148-2ubuntu1
* Merge from Debian unstable, remaining changes:
  - debian/runtime/vimrc: "syntax on" is a sane default for non-tiny vim.
  - runtime/syntax/debcontrol.vim:
    + Add "metapackages" to the list of valid sections.
  - runtime/syntax/grub.vim:
    + Add Ubuntu-specific 'quiet' keyword.
  - Drop vim-lesstif package and lesstif2-dev build-dependency.
  - Enable Python interpreter on basic builds.
  - Disable autoindent, line-wrapping, and backup files by default.
* Dropped changes, merged in Debian:
  - Add jaunty, karmic to the list of valid suites.
  - runtime/syntax/debsources.vim:
    + Add "jaunty" to debsourcesDistrKeyword
  - Create a .pot file for translations.
* Drop gutsy from the list of valid distro series, it's been EOLed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1224
1224
#endif /* FEAT_MBYTE */
1225
1225
 
1226
1226
/*
 
1227
 * Wait for another process to Close the Clipboard.
 
1228
 * Returns TRUE for success.
 
1229
 */
 
1230
    int
 
1231
vim_open_clipboard()
 
1232
{
 
1233
    int delay = 10;
 
1234
 
 
1235
    while (!OpenClipboard(NULL))
 
1236
    {
 
1237
        if (delay > 500)
 
1238
            return FALSE;  /* waited too long, give up */
 
1239
        Sleep(delay);
 
1240
        delay *= 2;     /* wait for 10, 20, 40, 80, etc. msec */
 
1241
    }
 
1242
    return TRUE;
 
1243
}
 
1244
 
 
1245
/*
1227
1246
 * Get the current selection and put it in the clipboard register.
1228
1247
 *
1229
1248
 * NOTE: Must use GlobalLock/Unlock here to ensure Win32s compatibility.
1254
1273
     * Don't pass GetActiveWindow() as an argument to OpenClipboard() because
1255
1274
     * then we can't paste back into the same window for some reason - webb.
1256
1275
     */
1257
 
    if (!OpenClipboard(NULL))
 
1276
    if (!vim_open_clipboard())
1258
1277
        return;
1259
1278
 
1260
1279
    /* Check for vim's own clipboard format first.  This only gets the type of
1562
1581
     * because then we can't paste back into the same window for some
1563
1582
     * reason - webb.
1564
1583
     */
1565
 
    if (OpenClipboard(NULL))
 
1584
    if (vim_open_clipboard())
1566
1585
    {
1567
1586
        if (EmptyClipboard())
1568
1587
        {