Author: adamg Date: Fri Feb 6 16:47:38 2009 GMT Module: SOURCES Tag: HEAD ---- Log message: - new
---- Files affected: SOURCES: 7.2.093 (NONE -> 1.1) (NEW) SOURCES: 7.2.094 (NONE -> 1.1) (NEW) ---- Diffs: ================================================================ Index: SOURCES/7.2.093 diff -u /dev/null SOURCES/7.2.093:1.1 --- /dev/null Fri Feb 6 17:47:39 2009 +++ SOURCES/7.2.093 Fri Feb 6 17:47:32 2009 @@ -0,0 +1,234 @@ +To: [email protected] +Subject: Patch 7.2.093 (extra) +Fcc: outbox +From: Bram Moolenaar <[email protected]> +Mime-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.093 (extra) +Problem: Win32: inputdialog() and find/replace dialogs can't handle + multi-byte text. +Solution: Use the wide version of dialog functions when available. (Yanwei + Jia) +Files: src/gui_w32.c, src/gui_w48.c + + +*** ../vim-7.2.092/src/gui_w32.c Thu Nov 20 17:09:09 2008 +--- src/gui_w32.c Wed Jan 28 21:15:29 2009 +*************** +*** 1582,1587 **** +--- 1582,1598 ---- + s_findrep_struct.lpstrReplaceWith[0] = NUL; + s_findrep_struct.wFindWhatLen = MSWIN_FR_BUFSIZE; + s_findrep_struct.wReplaceWithLen = MSWIN_FR_BUFSIZE; ++ # if defined(FEAT_MBYTE) && defined(WIN3264) ++ s_findrep_struct_w.lStructSize = sizeof(s_findrep_struct_w); ++ s_findrep_struct_w.lpstrFindWhat = ++ (LPWSTR)alloc(MSWIN_FR_BUFSIZE * sizeof(WCHAR)); ++ s_findrep_struct_w.lpstrFindWhat[0] = NUL; ++ s_findrep_struct_w.lpstrReplaceWith = ++ (LPWSTR)alloc(MSWIN_FR_BUFSIZE * sizeof(WCHAR)); ++ s_findrep_struct_w.lpstrReplaceWith[0] = NUL; ++ s_findrep_struct_w.wFindWhatLen = MSWIN_FR_BUFSIZE; ++ s_findrep_struct_w.wReplaceWithLen = MSWIN_FR_BUFSIZE; ++ # endif + #endif + + theend: +*************** +*** 2938,2945 **** + + /* If the edit box exists, copy the string. */ + if (s_textfield != NULL) +! GetDlgItemText(hwnd, DLG_NONBUTTON_CONTROL + 2, + s_textfield, IOSIZE); + + /* + * Need to check for IDOK because if the user just hits Return to +--- 2949,2975 ---- + + /* If the edit box exists, copy the string. */ + if (s_textfield != NULL) +! { +! # if defined(FEAT_MBYTE) && defined(WIN3264) +! /* If the OS is Windows NT, and 'encoding' differs from active +! * codepage: use wide function and convert text. */ +! if (os_version.dwPlatformId == VER_PLATFORM_WIN32_NT +! && enc_codepage >= 0 && (int)GetACP() != enc_codepage) +! { +! WCHAR *wp = (WCHAR *)alloc(IOSIZE * sizeof(WCHAR)); +! char_u *p; +! +! GetDlgItemTextW(hwnd, DLG_NONBUTTON_CONTROL + 2, wp, IOSIZE); +! p = utf16_to_enc(wp, NULL); +! vim_strncpy(s_textfield, p, IOSIZE); +! vim_free(p); +! vim_free(wp); +! } +! else +! # endif +! GetDlgItemText(hwnd, DLG_NONBUTTON_CONTROL + 2, + s_textfield, IOSIZE); ++ } + + /* + * Need to check for IDOK because if the user just hits Return to +*** ../vim-7.2.092/src/gui_w48.c Wed Jan 28 14:17:21 2009 +--- src/gui_w48.c Wed Jan 28 21:10:26 2009 +*************** +*** 153,158 **** +--- 153,161 ---- + #ifdef MSWIN_FIND_REPLACE + static UINT s_findrep_msg = 0; /* set in gui_w[16/32].c */ + static FINDREPLACE s_findrep_struct; ++ # if defined(FEAT_MBYTE) && defined(WIN3264) ++ static FINDREPLACEW s_findrep_struct_w; ++ # endif + static HWND s_findrep_hwnd = NULL; + static int s_findrep_is_find; /* TRUE for find dialog, FALSE + for find/replace dialog */ +*************** +*** 884,889 **** +--- 887,931 ---- + #endif + + #ifdef MSWIN_FIND_REPLACE ++ # if defined(FEAT_MBYTE) && defined(WIN3264) ++ /* ++ * copy useful data from structure LPFINDREPLACE to structure LPFINDREPLACEW ++ */ ++ static void ++ findrep_atow(LPFINDREPLACEW lpfrw, LPFINDREPLACE lpfr) ++ { ++ WCHAR *wp; ++ ++ lpfrw->hwndOwner = lpfr->hwndOwner; ++ lpfrw->Flags = lpfr->Flags; ++ ++ wp = enc_to_utf16(lpfr->lpstrFindWhat, NULL); ++ wcsncpy(lpfrw->lpstrFindWhat, wp, lpfrw->wFindWhatLen - 1); ++ vim_free(wp); ++ ++ /* the field "lpstrReplaceWith" doesn't need to be copied */ ++ } ++ ++ /* ++ * copy useful data from structure LPFINDREPLACEW to structure LPFINDREPLACE ++ */ ++ static void ++ findrep_wtoa(LPFINDREPLACE lpfr, LPFINDREPLACEW lpfrw) ++ { ++ char_u *p; ++ ++ lpfr->Flags = lpfrw->Flags; ++ ++ p = utf16_to_enc(lpfrw->lpstrFindWhat, NULL); ++ vim_strncpy(lpfr->lpstrFindWhat, p, lpfr->wFindWhatLen - 1); ++ vim_free(p); ++ ++ p = utf16_to_enc(lpfrw->lpstrReplaceWith, NULL); ++ vim_strncpy(lpfr->lpstrReplaceWith, p, lpfr->wReplaceWithLen - 1); ++ vim_free(p); ++ } ++ # endif ++ + /* + * Handle a Find/Replace window message. + */ +*************** +*** 893,898 **** +--- 935,950 ---- + int flags = 0; + int down; + ++ # if defined(FEAT_MBYTE) && defined(WIN3264) ++ /* If the OS is Windows NT, and 'encoding' differs from active codepage: ++ * convert text from wide string. */ ++ if (os_version.dwPlatformId == VER_PLATFORM_WIN32_NT ++ && enc_codepage >= 0 && (int)GetACP() != enc_codepage) ++ { ++ findrep_wtoa(&s_findrep_struct, &s_findrep_struct_w); ++ } ++ # endif ++ + if (s_findrep_struct.Flags & FR_DIALOGTERM) + /* Give main window the focus back. */ + (void)SetFocus(s_hwnd); +*************** +*** 2562,2568 **** + if (!IsWindow(s_findrep_hwnd)) + { + initialise_findrep(eap->arg); +! s_findrep_hwnd = FindText((LPFINDREPLACE) &s_findrep_struct); + } + + set_window_title(s_findrep_hwnd, +--- 2614,2632 ---- + if (!IsWindow(s_findrep_hwnd)) + { + initialise_findrep(eap->arg); +! # if defined(FEAT_MBYTE) && defined(WIN3264) +! /* If the OS is Windows NT, and 'encoding' differs from active +! * codepage: convert text and use wide function. */ +! if (os_version.dwPlatformId == VER_PLATFORM_WIN32_NT +! && enc_codepage >= 0 && (int)GetACP() != enc_codepage) +! { +! findrep_atow(&s_findrep_struct_w, &s_findrep_struct); +! s_findrep_hwnd = FindTextW( +! (LPFINDREPLACEW) &s_findrep_struct_w); +! } +! else +! # endif +! s_findrep_hwnd = FindText((LPFINDREPLACE) &s_findrep_struct); + } + + set_window_title(s_findrep_hwnd, +*************** +*** 2587,2593 **** + if (!IsWindow(s_findrep_hwnd)) + { + initialise_findrep(eap->arg); +! s_findrep_hwnd = ReplaceText((LPFINDREPLACE) &s_findrep_struct); + } + + set_window_title(s_findrep_hwnd, +--- 2651,2668 ---- + if (!IsWindow(s_findrep_hwnd)) + { + initialise_findrep(eap->arg); +! # if defined(FEAT_MBYTE) && defined(WIN3264) +! if (os_version.dwPlatformId == VER_PLATFORM_WIN32_NT +! && enc_codepage >= 0 && (int)GetACP() != enc_codepage) +! { +! findrep_atow(&s_findrep_struct_w, &s_findrep_struct); +! s_findrep_hwnd = ReplaceTextW( +! (LPFINDREPLACEW) &s_findrep_struct_w); +! } +! else +! # endif +! s_findrep_hwnd = ReplaceText( +! (LPFINDREPLACE) &s_findrep_struct); + } + + set_window_title(s_findrep_hwnd, +*** ../vim-7.2.092/src/version.c Wed Jan 28 19:08:31 2009 +--- src/version.c Wed Jan 28 21:19:56 2009 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 93, + /**/ + +-- +I'm not familiar with this proof, but I'm aware of a significant +following of toddlers who believe that peanut butter is the solution +to all of life's problems... -- Tim Hammerquist + + /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// ================================================================ Index: SOURCES/7.2.094 diff -u /dev/null SOURCES/7.2.094:1.1 --- /dev/null Fri Feb 6 17:47:39 2009 +++ SOURCES/7.2.094 Fri Feb 6 17:47:37 2009 @@ -0,0 +1,112 @@ +To: [email protected] +Subject: Patch 7.2.094 +Fcc: outbox +From: Bram Moolenaar <[email protected]> +Mime-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.094 +Problem: Compiler warning for signed/unsigned compare. +Solution: Add type cast. Also fix a few typos. +Files: src/edit.c + + +*** ../vim-7.2.093/src/edit.c Tue Jan 13 12:29:03 2009 +--- src/edit.c Wed Jan 28 21:13:51 2009 +*************** +*** 1958,1963 **** +--- 1958,1964 ---- + * Only matters when there are composing characters. + * Return TRUE when something was deleted. + */ ++ /*ARGSUSED*/ + static int + del_char_after_col(limit_col) + int limit_col; +*************** +*** 1971,1977 **** + * skip forward again when going too far back because of a + * composing character. */ + mb_adjust_cursor(); +! while (curwin->w_cursor.col < limit_col) + { + int l = utf_ptr2len(ml_get_cursor()); + +--- 1972,1978 ---- + * skip forward again when going too far back because of a + * composing character. */ + mb_adjust_cursor(); +! while (curwin->w_cursor.col < (colnr_T)limit_col) + { + int l = utf_ptr2len(ml_get_cursor()); + +*************** +*** 4240,4246 **** + } + + /* check if compl_curr_match has changed, (e.g. other type of +! * expansion added somenthing) */ + if (type != 0 && compl_curr_match != old_match) + found_new_match = OK; + +--- 4241,4247 ---- + } + + /* check if compl_curr_match has changed, (e.g. other type of +! * expansion added something) */ + if (type != 0 && compl_curr_match != old_match) + found_new_match = OK; + +*************** +*** 4741,4747 **** + } + compl_length = curwin->w_cursor.col - (int)compl_col; + /* IObuff is used to add a "word from the next line" would we +! * have enough space? just being paranoic */ + #define MIN_SPACE 75 + if (compl_length > (IOSIZE - MIN_SPACE)) + { +--- 4742,4748 ---- + } + compl_length = curwin->w_cursor.col - (int)compl_col; + /* IObuff is used to add a "word from the next line" would we +! * have enough space? just being paranoid */ + #define MIN_SPACE 75 + if (compl_length > (IOSIZE - MIN_SPACE)) + { +*************** +*** 8206,8212 **** + /* + * If the cursor is on an indent, ^T/^D insert/delete one + * shiftwidth. Otherwise ^T/^D behave like a "<<" or ">>". +! * Always round the indent to 'shiftwith', this is compatible + * with vi. But vi only supports ^T and ^D after an + * autoindent, we support it everywhere. + */ +--- 8207,8213 ---- + /* + * If the cursor is on an indent, ^T/^D insert/delete one + * shiftwidth. Otherwise ^T/^D behave like a "<<" or ">>". +! * Always round the indent to 'shiftwidth', this is compatible + * with vi. But vi only supports ^T and ^D after an + * autoindent, we support it everywhere. + */ +*** ../vim-7.2.093/src/version.c Wed Jan 28 21:22:20 2009 +--- src/version.c Wed Feb 4 11:17:02 2009 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 94, + /**/ + +-- +Despite the cost of living, have you noticed how it remains so popular? + + /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// ================================================================ _______________________________________________ pld-cvs-commit mailing list [email protected] http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit
