Author: adamg Date: Sat Jul 9 07:07:38 2011 GMT Module: packages Tag: HEAD ---- Log message: - new
---- Files affected: packages/vim: 7.3.239 (NONE -> 1.1) (NEW) packages/vim: 7.3.240 (NONE -> 1.1) (NEW) ---- Diffs: ================================================================ Index: packages/vim/7.3.239 diff -u /dev/null packages/vim/7.3.239:1.1 --- /dev/null Sat Jul 9 09:07:38 2011 +++ packages/vim/7.3.239 Sat Jul 9 09:07:33 2011 @@ -0,0 +1,321 @@ +To: [email protected] +Subject: Patch 7.3.239 +Fcc: outbox +From: Bram Moolenaar <[email protected]> +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.239 +Problem: Python corrects the cursor column without taking 'virtualedit' + into account. (lilydjwg) +Solution: Call check_cursor_col_win(). +Files: src/if_py_both.h, src/mbyte.c, src/misc2.c, src/normal.c, + src/proto/mbyte.pro, src/proto/misc2.pro + + +*** ../vim-7.3.238/src/if_py_both.h 2011-06-26 04:01:37.000000000 +0200 +--- src/if_py_both.h 2011-07-07 14:28:19.000000000 +0200 +*************** +*** 534,540 **** + { + long lnum; + long col; +- long len; + + if (!PyArg_Parse(val, "(ll)", &lnum, &col)) + return -1; +--- 534,539 ---- +*************** +*** 549,566 **** + if (VimErrorCheck()) + return -1; + +- /* When column is out of range silently correct it. */ +- len = (long)STRLEN(ml_get_buf(this->win->w_buffer, lnum, FALSE)); +- if (col > len) +- col = len; +- + this->win->w_cursor.lnum = lnum; + this->win->w_cursor.col = col; + #ifdef FEAT_VIRTUALEDIT + this->win->w_cursor.coladd = 0; + #endif +! update_screen(VALID); + + return 0; + } + else if (strcmp(name, "height") == 0) +--- 548,562 ---- + if (VimErrorCheck()) + return -1; + + this->win->w_cursor.lnum = lnum; + this->win->w_cursor.col = col; + #ifdef FEAT_VIRTUALEDIT + this->win->w_cursor.coladd = 0; + #endif +! /* When column is out of range silently correct it. */ +! check_cursor_col_win(this->win); + ++ update_screen(VALID); + return 0; + } + else if (strcmp(name, "height") == 0) +*** ../vim-7.3.238/src/mbyte.c 2011-04-11 14:29:13.000000000 +0200 +--- src/mbyte.c 2011-07-07 14:27:07.000000000 +0200 +*************** +*** 3563,3569 **** + void + mb_adjust_cursor() + { +! mb_adjustpos(&curwin->w_cursor); + } + + /* +--- 3563,3569 ---- + void + mb_adjust_cursor() + { +! mb_adjustpos(curbuf, &curwin->w_cursor); + } + + /* +*************** +*** 3571,3577 **** + * If it points to a tail byte it's moved backwards to the head byte. + */ + void +! mb_adjustpos(lp) + pos_T *lp; + { + char_u *p; +--- 3571,3578 ---- + * If it points to a tail byte it's moved backwards to the head byte. + */ + void +! mb_adjustpos(buf, lp) +! buf_T *buf; + pos_T *lp; + { + char_u *p; +*************** +*** 3582,3588 **** + #endif + ) + { +! p = ml_get(lp->lnum); + lp->col -= (*mb_head_off)(p, p + lp->col); + #ifdef FEAT_VIRTUALEDIT + /* Reset "coladd" when the cursor would be on the right half of a +--- 3583,3589 ---- + #endif + ) + { +! p = ml_get_buf(buf, lp->lnum, FALSE); + lp->col -= (*mb_head_off)(p, p + lp->col); + #ifdef FEAT_VIRTUALEDIT + /* Reset "coladd" when the cursor would be on the right half of a +*** ../vim-7.3.238/src/misc2.c 2011-04-11 16:56:29.000000000 +0200 +--- src/misc2.c 2011-07-07 14:27:50.000000000 +0200 +*************** +*** 333,339 **** + #ifdef FEAT_MBYTE + /* prevent from moving onto a trail byte */ + if (has_mbyte) +! mb_adjustpos(pos); + #endif + + if (col < wcol) +--- 333,339 ---- + #ifdef FEAT_MBYTE + /* prevent from moving onto a trail byte */ + if (has_mbyte) +! mb_adjustpos(curbuf, pos); + #endif + + if (col < wcol) +*************** +*** 544,559 **** + void + check_cursor_col() + { + colnr_T len; + #ifdef FEAT_VIRTUALEDIT +! colnr_T oldcol = curwin->w_cursor.col; +! colnr_T oldcoladd = curwin->w_cursor.col + curwin->w_cursor.coladd; + #endif + +! len = (colnr_T)STRLEN(ml_get_curline()); + if (len == 0) +! curwin->w_cursor.col = 0; +! else if (curwin->w_cursor.col >= len) + { + /* Allow cursor past end-of-line when: + * - in Insert mode or restarting Insert mode +--- 544,569 ---- + void + check_cursor_col() + { ++ check_cursor_col_win(curwin); ++ } ++ ++ /* ++ * Make sure win->w_cursor.col is valid. ++ */ ++ void ++ check_cursor_col_win(win) ++ win_T *win; ++ { + colnr_T len; + #ifdef FEAT_VIRTUALEDIT +! colnr_T oldcol = win->w_cursor.col; +! colnr_T oldcoladd = win->w_cursor.col + win->w_cursor.coladd; + #endif + +! len = (colnr_T)STRLEN(ml_get_buf(win->w_buffer, win->w_cursor.lnum, FALSE)); + if (len == 0) +! win->w_cursor.col = 0; +! else if (win->w_cursor.col >= len) + { + /* Allow cursor past end-of-line when: + * - in Insert mode or restarting Insert mode +*************** +*** 567,599 **** + || (ve_flags & VE_ONEMORE) + #endif + || virtual_active()) +! curwin->w_cursor.col = len; + else + { +! curwin->w_cursor.col = len - 1; + #ifdef FEAT_MBYTE +! /* prevent cursor from moving on the trail byte */ + if (has_mbyte) +! mb_adjust_cursor(); + #endif + } + } +! else if (curwin->w_cursor.col < 0) +! curwin->w_cursor.col = 0; + + #ifdef FEAT_VIRTUALEDIT + /* If virtual editing is on, we can leave the cursor on the old position, + * only we must set it to virtual. But don't do it when at the end of the + * line. */ + if (oldcol == MAXCOL) +! curwin->w_cursor.coladd = 0; + else if (ve_flags == VE_ALL) + { +! if (oldcoladd > curwin->w_cursor.col) +! curwin->w_cursor.coladd = oldcoladd - curwin->w_cursor.col; + else + /* avoid weird number when there is a miscalculation or overflow */ +! curwin->w_cursor.coladd = 0; + } + #endif + } +--- 577,609 ---- + || (ve_flags & VE_ONEMORE) + #endif + || virtual_active()) +! win->w_cursor.col = len; + else + { +! win->w_cursor.col = len - 1; + #ifdef FEAT_MBYTE +! /* Move the cursor to the head byte. */ + if (has_mbyte) +! mb_adjustpos(win->w_buffer, &win->w_cursor); + #endif + } + } +! else if (win->w_cursor.col < 0) +! win->w_cursor.col = 0; + + #ifdef FEAT_VIRTUALEDIT + /* If virtual editing is on, we can leave the cursor on the old position, + * only we must set it to virtual. But don't do it when at the end of the + * line. */ + if (oldcol == MAXCOL) +! win->w_cursor.coladd = 0; + else if (ve_flags == VE_ALL) + { +! if (oldcoladd > win->w_cursor.col) +! win->w_cursor.coladd = oldcoladd - win->w_cursor.col; + else + /* avoid weird number when there is a miscalculation or overflow */ +! win->w_cursor.coladd = 0; + } + #endif + } +*** ../vim-7.3.238/src/normal.c 2011-06-20 00:45:55.000000000 +0200 +--- src/normal.c 2011-07-07 14:27:57.000000000 +0200 +*************** +*** 8774,8780 **** + { + --pp->col; + #ifdef FEAT_MBYTE +! mb_adjustpos(pp); + #endif + } + else if (pp->lnum > 1) +--- 8774,8780 ---- + { + --pp->col; + #ifdef FEAT_MBYTE +! mb_adjustpos(curbuf, pp); + #endif + } + else if (pp->lnum > 1) +*** ../vim-7.3.238/src/proto/mbyte.pro 2010-08-15 21:57:28.000000000 +0200 +--- src/proto/mbyte.pro 2011-07-07 14:27:09.000000000 +0200 +*************** +*** 56,62 **** + int utf_valid_string __ARGS((char_u *s, char_u *end)); + int dbcs_screen_tail_off __ARGS((char_u *base, char_u *p)); + void mb_adjust_cursor __ARGS((void)); +! void mb_adjustpos __ARGS((pos_T *lp)); + char_u *mb_prevptr __ARGS((char_u *line, char_u *p)); + int mb_charlen __ARGS((char_u *str)); + int mb_charlen_len __ARGS((char_u *str, int len)); +--- 56,62 ---- + int utf_valid_string __ARGS((char_u *s, char_u *end)); + int dbcs_screen_tail_off __ARGS((char_u *base, char_u *p)); + void mb_adjust_cursor __ARGS((void)); +! void mb_adjustpos __ARGS((buf_T *buf, pos_T *lp)); + char_u *mb_prevptr __ARGS((char_u *line, char_u *p)); + int mb_charlen __ARGS((char_u *str)); + int mb_charlen_len __ARGS((char_u *str, int len)); +*** ../vim-7.3.238/src/proto/misc2.pro 2011-04-11 16:56:29.000000000 +0200 +--- src/proto/misc2.pro 2011-07-07 14:26:57.000000000 +0200 +*************** +*** 14,19 **** +--- 14,20 ---- + linenr_T get_cursor_rel_lnum __ARGS((win_T *wp, linenr_T lnum)); + void check_cursor_lnum __ARGS((void)); + void check_cursor_col __ARGS((void)); ++ void check_cursor_col_win __ARGS((win_T *win)); + void check_cursor __ARGS((void)); + void adjust_cursor_col __ARGS((void)); + int leftcol_changed __ARGS((void)); +*** ../vim-7.3.238/src/version.c 2011-07-07 15:04:38.000000000 +0200 +--- src/version.c 2011-07-07 15:05:49.000000000 +0200 +*************** +*** 711,712 **** +--- 711,714 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 239, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +256. You are able to write down over 250 symptoms of being an internet + addict, even though they only asked for 101. + + /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// ================================================================ Index: packages/vim/7.3.240 diff -u /dev/null packages/vim/7.3.240:1.1 --- /dev/null Sat Jul 9 09:07:38 2011 +++ packages/vim/7.3.240 Sat Jul 9 09:07:36 2011 @@ -0,0 +1,795 @@ +To: [email protected] +Subject: Patch 7.3.240 +Fcc: outbox +From: Bram Moolenaar <[email protected]> +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Note: I haven't verified this works or even compiles. Please send me a +patch if you see a problem and can fix it. + +Patch 7.3.240 +Problem: External commands can't use pipes on MS-Windows. +Solution: Implement pipes and use them when 'shelltemp' isn't set. (Vincent + Berthoux) +Files: src/eval.c, src/ex_cmds.c, src/misc2.c, src/os_unix.c, + src/os_win32.c, src/proto/misc2.pro, src/ui.c + + +*** ../vim-7.3.239/src/eval.c 2011-06-19 02:55:32.000000000 +0200 +--- src/eval.c 2011-07-07 15:44:56.000000000 +0200 +*************** +*** 11931,11937 **** + #ifdef FEAT_SEARCHPATH + "file_in_path", + #endif +! #if defined(UNIX) && !defined(USE_SYSTEM) + "filterpipe", + #endif + #ifdef FEAT_FIND_ID +--- 11931,11937 ---- + #ifdef FEAT_SEARCHPATH + "file_in_path", + #endif +! #if (defined(UNIX) && !defined(USE_SYSTEM)) || defined(WIN3264) + "filterpipe", + #endif + #ifdef FEAT_FIND_ID +*** ../vim-7.3.239/src/ex_cmds.c 2011-06-12 22:03:15.000000000 +0200 +--- src/ex_cmds.c 2011-07-07 15:44:56.000000000 +0200 +*************** +*** 1107,1113 **** + if (do_out) + shell_flags |= SHELL_DOOUT; + +! #if !defined(USE_SYSTEM) && defined(UNIX) + if (!do_in && do_out && !p_stmp) + { + /* Use a pipe to fetch stdout of the command, do not use a temp file. */ +--- 1107,1113 ---- + if (do_out) + shell_flags |= SHELL_DOOUT; + +! #if (!defined(USE_SYSTEM) && defined(UNIX)) || defined(WIN3264) + if (!do_in && do_out && !p_stmp) + { + /* Use a pipe to fetch stdout of the command, do not use a temp file. */ +*** ../vim-7.3.239/src/misc2.c 2011-07-07 15:08:53.000000000 +0200 +--- src/misc2.c 2011-07-07 15:55:42.000000000 +0200 +*************** +*** 2146,2151 **** +--- 2146,2170 ---- + } + } + ++ #if (defined(UNIX) && !defined(USE_SYSTEM)) || defined(WIN3264) ++ /* ++ * Append the text in "gap" below the cursor line and clear "gap". ++ */ ++ void ++ append_ga_line(gap) ++ garray_T *gap; ++ { ++ /* Remove trailing CR. */ ++ if (gap->ga_len > 0 ++ && !curbuf->b_p_bin ++ && ((char_u *)gap->ga_data)[gap->ga_len - 1] == CAR) ++ --gap->ga_len; ++ ga_append(gap, NUL); ++ ml_append(curwin->w_cursor.lnum++, gap->ga_data, 0, FALSE); ++ gap->ga_len = 0; ++ } ++ #endif ++ + /************************************************************************ + * functions that use lookup tables for various things, generally to do with + * special key codes. +*** ../vim-7.3.239/src/os_unix.c 2011-04-11 16:56:29.000000000 +0200 +--- src/os_unix.c 2011-07-07 15:54:58.000000000 +0200 +*************** +*** 3660,3686 **** + /* Nothing to do. */ + } + +- #ifndef USE_SYSTEM +- static void append_ga_line __ARGS((garray_T *gap)); +- +- /* +- * Append the text in "gap" below the cursor line and clear "gap". +- */ +- static void +- append_ga_line(gap) +- garray_T *gap; +- { +- /* Remove trailing CR. */ +- if (gap->ga_len > 0 +- && !curbuf->b_p_bin +- && ((char_u *)gap->ga_data)[gap->ga_len - 1] == CAR) +- --gap->ga_len; +- ga_append(gap, NUL); +- ml_append(curwin->w_cursor.lnum++, gap->ga_data, 0, FALSE); +- gap->ga_len = 0; +- } +- #endif +- + int + mch_call_shell(cmd, options) + char_u *cmd; +--- 3660,3665 ---- +*** ../vim-7.3.239/src/os_win32.c 2011-05-25 17:06:16.000000000 +0200 +--- src/os_win32.c 2011-07-07 16:08:30.000000000 +0200 +*************** +*** 417,422 **** +--- 417,427 ---- + static PGNSECINFO pGetNamedSecurityInfo; + #endif + ++ typedef BOOL (WINAPI *PSETHANDLEINFORMATION)(HANDLE, DWORD, DWORD); ++ ++ static BOOL allowPiping = FALSE; ++ static PSETHANDLEINFORMATION pSetHandleInformation; ++ + /* + * Set g_PlatformId to VER_PLATFORM_WIN32_NT (NT) or + * VER_PLATFORM_WIN32_WINDOWS (Win95). +*************** +*** 467,472 **** +--- 472,489 ---- + } + } + #endif ++ /* ++ * If we are on windows NT, try to load the pipe functions, only ++ * available from Win2K. ++ */ ++ if (g_PlatformId == VER_PLATFORM_WIN32_NT) ++ { ++ HANDLE kernel32 = GetModuleHandle("kernel32"); ++ pSetHandleInformation = (PSETHANDLEINFORMATION)GetProcAddress( ++ kernel32, "SetHandleInformation"); ++ ++ allowPiping = pSetHandleInformation != NULL; ++ } + done = TRUE; + } + } +*************** +*** 1635,1641 **** + } + + #if ((defined(__MINGW32__) || defined (__CYGWIN32__)) && \ +! __MSVCRT_VERSION__ >= 0x800) || (defined(_MSC_VER) && _MSC_VER >= 1400) + /* + * Bad parameter handler. + * +--- 1652,1658 ---- + } + + #if ((defined(__MINGW32__) || defined (__CYGWIN32__)) && \ +! __MSVCRT_VERSION__ >= 0x800) || (defined(_MSC_VER) && _MSC_VER >= 1400) + /* + * Bad parameter handler. + * +*************** +*** 3210,3216 **** + * 4. Prompt the user to press a key to close the console window + */ + static int +! mch_system(char *cmd, int options) + { + STARTUPINFO si; + PROCESS_INFORMATION pi; +--- 3227,3233 ---- + * 4. Prompt the user to press a key to close the console window + */ + static int +! mch_system_classic(char *cmd, int options) + { + STARTUPINFO si; + PROCESS_INFORMATION pi; +*************** +*** 3315,3320 **** +--- 3332,3829 ---- + + return ret; + } ++ ++ /* ++ * Thread launched by the gui to send the current buffer data to the ++ * process. This way avoid to hang up vim totally if the children ++ * process take a long time to process the lines. ++ */ ++ static DWORD WINAPI ++ sub_process_writer(LPVOID param) ++ { ++ HANDLE g_hChildStd_IN_Wr = param; ++ linenr_T lnum = curbuf->b_op_start.lnum; ++ DWORD len = 0; ++ DWORD l; ++ char_u *lp = ml_get(lnum); ++ char_u *s; ++ int written = 0; ++ ++ for (;;) ++ { ++ l = (DWORD)STRLEN(lp + written); ++ if (l == 0) ++ len = 0; ++ else if (lp[written] == NL) ++ { ++ /* NL -> NUL translation */ ++ WriteFile(g_hChildStd_IN_Wr, "", 1, &len, NULL); ++ } ++ else ++ { ++ s = vim_strchr(lp + written, NL); ++ WriteFile(g_hChildStd_IN_Wr, (char *)lp + written, ++ s == NULL ? l : (DWORD)(s - (lp + written)), ++ &len, NULL); ++ } ++ if (len == (int)l) ++ { ++ /* Finished a line, add a NL, unless this line should not have ++ * one. */ ++ if (lnum != curbuf->b_op_end.lnum ++ || !curbuf->b_p_bin ++ || (lnum != curbuf->b_no_eol_lnum ++ && (lnum != curbuf->b_ml.ml_line_count ++ || curbuf->b_p_eol))) ++ { ++ WriteFile(g_hChildStd_IN_Wr, "\n", 1, &ignored, NULL); ++ } ++ ++ ++lnum; ++ if (lnum > curbuf->b_op_end.lnum) ++ break; ++ ++ lp = ml_get(lnum); ++ written = 0; ++ } ++ else if (len > 0) ++ written += len; ++ } ++ ++ /* finished all the lines, close pipe */ ++ CloseHandle(g_hChildStd_IN_Wr); ++ ExitThread(0); ++ } ++ ++ ++ # define BUFLEN 100 /* length for buffer, stolen from unix version */ ++ ++ /* <<Diff was trimmed, longer than 597 lines>> _______________________________________________ pld-cvs-commit mailing list [email protected] http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit
