Re: Patch 7.2.121
Charles Campbell wrote: > Bram Moolenaar wrote: > > Patch 7.2.121 > > Problem:In gvim "!grep a *.c" spews out a lot of text that can't be > > stopped with CTRL-C. > > Solution: When looping to read and show text, do check for typed > > characters > > every two seconds. > > Files: src/os_unix.c > > > > > Patches 1-120 are available via ftp from ftp.nluug.nl > (pub/vim/patches/7.2/...), but 121 is missing. Upload failed at first. Should be there now. -- Corduroy pillows: They're making headlines! /// Bram Moolenaar -- b...@moolenaar.net -- 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/// --~--~-~--~~~---~--~~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: Patch 7.2.121
Bram Moolenaar wrote: > Patch 7.2.121 > Problem:In gvim "!grep a *.c" spews out a lot of text that can't be > stopped with CTRL-C. > Solution: When looping to read and show text, do check for typed characters > every two seconds. > Files: src/os_unix.c > Patches 1-120 are available via ftp from ftp.nluug.nl (pub/vim/patches/7.2/...), but 121 is missing. Regards, Chip Campbell --~--~-~--~~~---~--~~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Patch 7.2.121
Patch 7.2.121 Problem:In gvim "!grep a *.c" spews out a lot of text that can't be stopped with CTRL-C. Solution: When looping to read and show text, do check for typed characters every two seconds. Files: src/os_unix.c *** ../vim-7.2.120/src/os_unix.cWed Feb 4 14:18:44 2009 --- src/os_unix.c Sun Feb 22 00:54:05 2009 *** *** 4092,4097 --- 4092,4100 int fromshell_fd; garray_Tga; int noread_cnt; + # if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H) + struct timeval start_tv; + # endif # ifdef FEAT_GUI if (pty_master_fd >= 0) *** *** 4201,4207 ga_init2(&ga, 1, BUFLEN); noread_cnt = 0; ! for (;;) { /* --- 4204,4212 ga_init2(&ga, 1, BUFLEN); noread_cnt = 0; ! # if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H) ! gettimeofday(&start_tv, NULL); ! # endif for (;;) { /* *** *** 4214,4238 * that a typed password is echoed for ssh or gpg command. * Don't get characters when the child has already * finished (wait_pid == 0). -* Don't get extra characters when we already have one. * Don't read characters unless we didn't get output for a !* while, avoids that ":r !ls" eats typeahead. */ len = 0; if (!(options & SHELL_EXPAND) && ((options & (SHELL_READ|SHELL_WRITE|SHELL_COOKED)) != (SHELL_READ|SHELL_WRITE|SHELL_COOKED) ! #ifdef FEAT_GUI || gui.in_use ! #endif ) && wait_pid == 0 ! && (ta_len > 0 ! || (noread_cnt > 4 ! && (len = ui_inchar(ta_buf, ! BUFLEN, 10L, 0)) > 0))) { /* * For pipes: * Check for CTRL-C: send interrupt signal to child. --- 4219,4252 * that a typed password is echoed for ssh or gpg command. * Don't get characters when the child has already * finished (wait_pid == 0). * Don't read characters unless we didn't get output for a !* while (noread_cnt > 4), avoids that ":r !ls" eats !* typeahead. */ len = 0; if (!(options & SHELL_EXPAND) && ((options & (SHELL_READ|SHELL_WRITE|SHELL_COOKED)) != (SHELL_READ|SHELL_WRITE|SHELL_COOKED) ! # ifdef FEAT_GUI || gui.in_use ! # endif ) && wait_pid == 0 ! && (ta_len > 0 || noread_cnt > 4)) { + if (ta_len == 0) + { + /* Get extra characters when we don't have any. + * Reset the counter and timer. */ + noread_cnt = 0; + # if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H) + gettimeofday(&start_tv, NULL); + # endif + len = ui_inchar(ta_buf, BUFLEN, 10L, 0); + } + if (ta_len > 0 || len > 0) + { /* * For pipes: * Check for CTRL-C: send interrupt signal to child. *** *** 4334,4342 { ta_len -= len; mch_memmove(ta_buf, ta_buf + len, ta_len); - noread_cnt = 0; } } } if (got_int) --- 4348,4356 { ta_len -= len; mch_memmove(ta_buf, ta_buf + len, ta_len); } } + } } if (got_int) *** *** ,4449 --- 4458,4482 out_flush(); if (got_int)
Patch 7.2.120
Patch 7.2.120 Problem:When opening the quickfix window or splitting the window and setting the location list, the location list is copied and then deleted, which is inefficient. Solution: Don't copy the location list when not needed. (Lech Lorens) Files: src/quickfix.c, src/vim.h, src/window.c *** ../vim-7.2.119/src/quickfix.c Sun Feb 22 00:01:42 2009 --- src/quickfix.c Sat Feb 21 22:54:25 2009 *** *** 1419,1424 --- 1419,1425 int opened_window = FALSE; win_T *win; win_T *altwin; + int flags; #endif win_T *oldwin = curwin; int print_message = TRUE; *** *** 1531,1537 if (qf_ptr->qf_type == 1 && (!curwin->w_buffer->b_help || cmdmod.tab != 0)) { win_T *wp; - int n; if (cmdmod.tab != 0) wp = NULL; --- 1532,1537 *** *** 1547,1559 * Split off help window; put it at far top if no position * specified, the current window is vertically split and narrow. */ ! n = WSP_HELP; # ifdef FEAT_VERTSPLIT if (cmdmod.split == 0 && curwin->w_width != Columns && curwin->w_width < 80) ! n |= WSP_TOP; # endif ! if (win_split(0, n) == FAIL) goto theend; opened_window = TRUE; /* close it when fail */ --- 1547,1562 * Split off help window; put it at far top if no position * specified, the current window is vertically split and narrow. */ ! flags = WSP_HELP; # ifdef FEAT_VERTSPLIT if (cmdmod.split == 0 && curwin->w_width != Columns && curwin->w_width < 80) ! flags |= WSP_TOP; # endif ! if (qi != &ql_info) ! flags |= WSP_NEWLOC; /* don't copy the location list */ ! ! if (win_split(0, flags) == FAIL) goto theend; opened_window = TRUE; /* close it when fail */ *** *** 1563,1569 if (qi != &ql_info) /* not a quickfix list */ { /* The new window should use the supplied location list */ - qf_free_all(curwin); curwin->w_llist = qi; qi->qf_refcount++; } --- 1566,1571 *** *** 1624,1630 { ll_ref = curwin->w_llist_ref; ! if (win_split(0, WSP_ABOVE) == FAIL) goto failed;/* not enough room for window */ opened_window = TRUE; /* close it when fail */ p_swb = empty_option; /* don't split again */ --- 1626,1635 { ll_ref = curwin->w_llist_ref; ! flags = WSP_ABOVE; ! if (ll_ref != NULL) ! flags |= WSP_NEWLOC; ! if (win_split(0, flags) == FAIL) goto failed;/* not enough room for window */ opened_window = TRUE; /* close it when fail */ p_swb = empty_option; /* don't split again */ *** *** 1636,1642 { /* The new window should use the location list from the * location list window */ - qf_free_all(curwin); curwin->w_llist = ll_ref; ll_ref->qf_refcount++; } --- 1641,1646 *** *** 2311,2325 if (eap->cmdidx == CMD_copen || eap->cmdidx == CMD_cwindow) /* Create the new window at the very bottom. */ win_goto(lastwin); ! if (win_split(height, WSP_BELOW) == FAIL) return; /* not enough room for window */ #ifdef FEAT_SCROLLBIND curwin->w_p_scb = FALSE; #endif - /* Remove the location list for the quickfix window */ - qf_free_all(curwin); - if (eap->cmdidx == CMD_lopen || eap->cmdidx == CMD_lwindow) { /* --- 2315,2326 if (eap->cmdidx == CMD_copen || eap->cmdidx == CMD_cwindow) /* Create the new window at the very bottom. */ win_goto(lastwin); ! if (win_split(height, WSP_BELOW | WSP_NEWLOC) == FAIL) return; /* not enough room for window */ #ifdef FEAT_SCROLLBIND curwin->w_p_scb = FALSE; #endif if (eap->cmdidx == CMD_lopen || eap->cmdidx == CMD_lwindow) { /* *** ../vim-7.2.119/src/vim.hThu Nov 20 14:11:47 2008 --- src/vim.h Sat Feb 21 22:53:03 2009 *** *** 1057,1062 --- 1057,1063 #define WSP_HELP 16 /* creating the help window */ #define WSP_BELOW 32 /* put new window below/right */ #define WSP_ABOVE 64
Patch 7.2.119
Patch 7.2.119 Problem:Status line is redrawn too often. Solution: Check ScreeenLinesUC[] properly. (Yukihiro Nakadaira) Files: src/screen.c *** ../vim-7.2.118/src/screen.c Sun Feb 22 00:01:42 2009 --- src/screen.cSun Feb 22 01:07:38 2009 *** *** 6362,6368 && c == 0x8e && ScreenLines2[off] != ptr[1]) || (enc_utf8 ! && (ScreenLinesUC[off] != (u8char_T)u8c || screen_comp_differs(off, u8cc))) #endif || ScreenAttrs[off] != attr --- 6362,6368 && c == 0x8e && ScreenLines2[off] != ptr[1]) || (enc_utf8 ! && (ScreenLinesUC[off] != (u8char_T)(c >= 0x80 ? u8c : 0) || screen_comp_differs(off, u8cc))) #endif || ScreenAttrs[off] != attr *** ../vim-7.2.118/src/version.cSun Feb 22 00:58:03 2009 --- src/version.c Sun Feb 22 01:09:54 2009 *** *** 678,679 --- 678,681 { /* Add new patch number below this line */ + /**/ + 119, /**/ -- In a world without walls and borders, who needs windows and gates? /// Bram Moolenaar -- b...@moolenaar.net -- 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/// --~--~-~--~~~---~--~~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Patch 7.2.118
Patch 7.2.118 Problem: at the more prompt only does half a page. Solution: Make go up a whole page. Also make 'f' go a page forward, but not quit the more prompt. (Markus Heidelberg) Files: src/message.c *** ../vim-7.2.117/src/message.cWed Feb 11 18:46:48 2009 --- src/message.c Fri Feb 20 05:20:15 2009 *** *** 976,982 } } else if (msg_scrolled > Rows - 2 !&& (c == 'j' || c == K_DOWN || c == 'd')) c = K_IGNORE; } } while ((had_got_int && c == Ctrl_C) --- 976,982 } } else if (msg_scrolled > Rows - 2 !&& (c == 'j' || c == K_DOWN || c == 'd' || c == 'f')) c = K_IGNORE; } } while ((had_got_int && c == Ctrl_C) *** *** 2504,2510 break; case 'u': /* Up half a page */ - case K_PAGEUP: scroll = -(Rows / 2); break; --- 2504,2509 *** *** 2513,2522 --- 2512,2523 break; case 'b': /* one page back */ + case K_PAGEUP: scroll = -(Rows - 1); break; case ' ': /* one extra page */ + case 'f': case K_PAGEDOWN: case K_LEFTMOUSE: scroll = Rows - 1; *** ../vim-7.2.117/src/version.cSun Feb 22 00:01:42 2009 --- src/version.c Sun Feb 22 00:57:16 2009 *** *** 678,679 --- 678,681 { /* Add new patch number below this line */ + /**/ + 118, /**/ -- hundred-and-one symptoms of being an internet addict: 109. You actually read -- and enjoy -- lists like this. /// Bram Moolenaar -- b...@moolenaar.net -- 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/// --~--~-~--~~~---~--~~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Patch 7.2.117
Patch 7.2.117 Problem:Location list incorrectly labelled "Quickfix List". Solution: Break out of both loops for finding window for location list buffer. (Lech Lorens) Files: src/buffer.c, src/quickfix.c, src/screen.c *** ../vim-7.2.116/src/buffer.c Tue Jan 6 16:13:42 2009 --- src/buffer.cTue Feb 17 04:00:51 2009 *** *** 5098,5104 */ FOR_ALL_TAB_WINDOWS(tp, win) if (win->w_buffer == buf) ! break; if (win != NULL && win->w_llist_ref != NULL) return _("[Location List]"); else --- 5098,5105 */ FOR_ALL_TAB_WINDOWS(tp, win) if (win->w_buffer == buf) ! goto win_found; ! win_found: if (win != NULL && win->w_llist_ref != NULL) return _("[Location List]"); else *** ../vim-7.2.116/src/quickfix.c Sat Nov 15 14:10:23 2008 --- src/quickfix.c Sat Feb 21 22:54:25 2009 *** *** 1610,1619 { goto_tabpage_win(tp, wp); usable_win = 1; ! break; } } } /* * If there is only one window and it is the quickfix window, create a --- 1612,1622 { goto_tabpage_win(tp, wp); usable_win = 1; ! goto win_found; } } } + win_found: /* * If there is only one window and it is the quickfix window, create a *** ../vim-7.2.116/src/screen.c Sat Feb 21 21:22:44 2009 --- src/screen.cSat Feb 21 21:04:19 2009 *** *** 7452,7461 { outofmem = TRUE; #ifdef FEAT_WINDOWS ! break; #endif } } #ifdef FEAT_MBYTE for (i = 0; i < p_mco; ++i) --- 7452,7464 { outofmem = TRUE; #ifdef FEAT_WINDOWS ! goto give_up; #endif } } + #ifdef FEAT_WINDOWS + give_up: + #endif #ifdef FEAT_MBYTE for (i = 0; i < p_mco; ++i) *** ../vim-7.2.116/src/version.cSat Feb 21 22:57:10 2009 --- src/version.c Sat Feb 21 23:58:24 2009 *** *** 678,679 --- 678,681 { /* Add new patch number below this line */ + /**/ + 117, /**/ -- Laughing helps. It's like jogging on the inside. /// Bram Moolenaar -- b...@moolenaar.net -- 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/// --~--~-~--~~~---~--~~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Patch 7.2.116
Patch 7.2.116 Problem:Not all memory is freed when EXITFREE is defined. Solution: Free allocated memory on exit. (Dominique Pelle) Files: src/ex_docmd.c, src/gui_gtk_x11.c, src/misc2.c, src/search.c, src/tag.c *** ../vim-7.2.115/src/tag.cTue Jan 13 17:27:18 2009 --- src/tag.c Tue Feb 17 03:43:32 2009 *** *** 2542,2547 --- 2542,2556 { ga_clear_strings(&tag_fnames); do_tag(NULL, DT_FREE, 0, 0, 0); + tag_freematch(); + + # if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX) + if (ptag_entry.tagname) + { + vim_free(ptag_entry.tagname); + ptag_entry.tagname = NULL; + } + # endif } #endif *** ../vim-7.2.115/src/version.cSat Feb 21 22:29:12 2009 --- src/version.c Sat Feb 21 22:56:14 2009 *** *** 678,679 --- 678,681 { /* Add new patch number below this line */ + /**/ + 116, /**/ -- hundred-and-one symptoms of being an internet addict: 106. When told to "go to your room" you inform your parents that you can't...because you were kicked out and banned. /// Bram Moolenaar -- b...@moolenaar.net -- 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/// --~--~-~--~~~---~--~~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Patch 7.2.115
Patch 7.2.115 Problem:Some debugging code is never used. Solution: Remove nbtrace() and nbprt(). (Dominique Pelle) Files: src/nbdebug.c, src/nbdebug.h *** ../vim-7.2.114/src/nbdebug.cTue Jun 24 23:54:30 2008 --- src/nbdebug.c Tue Feb 17 03:26:07 2009 *** *** 33,39 u_int nb_dlevel = 0; /* nb_debug verbosity level */ void nbdb(char *, ...); - void nbtrace(char *, ...); static int lookup(char *); #ifdef USE_NB_ERRORHANDLER --- 33,38 *** *** 100,124 }/* end nbdebug_log_init */ - - - void - nbtrace( - char*fmt, - ...) - { - va_list ap; - - if (nb_debug!= NULL && (nb_dlevel & (NB_TRACE | NB_TRACE_VERBOSE))) { - va_start(ap, fmt); - vfprintf(nb_debug, fmt, ap); - va_end(ap); - fflush(nb_debug); - } - - }/* end nbtrace */ - - void nbdbg( char*fmt, --- 99,104 *** *** 136,158 }/* end nbdbg */ - void - nbprt( - char*fmt, - ...) - { - va_list ap; - - if (nb_debug != NULL && nb_dlevel & NB_PRINT) { - va_start(ap, fmt); - vfprintf(nb_debug, fmt, ap); - va_end(ap); - fflush(nb_debug); - } - - }/* end nbprt */ - - static int lookup( char*file) --- 116,121 *** ../vim-7.2.114/src/nbdebug.hWed Jun 25 00:47:21 2008 --- src/nbdebug.h Tue Feb 17 03:26:38 2009 *** *** 43,50 void nbdbg(char *, ...); - void nbprt(char *, ...); - void nbtrace(char *, ...); void nbdebug_wait __ARGS((u_int wait_flags, char *wait_var, u_int wait_secs)); void nbdebug_log_init __ARGS((char *log_var, char *level_var)); --- 43,48 *** *** 70,88 { } - void - nbprt( - char*fmt, - ...) - { - } - - void - nbtrace( - char*fmt, - ...) - { - } - #endif /* NBDEBUG */ #endif /* NBDEBUG_H */ --- 68,72 *** ../vim-7.2.114/src/version.cSat Feb 21 22:12:43 2009 --- src/version.c Sat Feb 21 22:28:21 2009 *** *** 678,679 --- 678,681 { /* Add new patch number below this line */ + /**/ + 115, /**/ -- hundred-and-one symptoms of being an internet addict: 105. When someone asks you for your address, you tell them your URL. /// Bram Moolenaar -- b...@moolenaar.net -- 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/// --~--~-~--~~~---~--~~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Patch 7.2.114
Patch 7.2.114 Problem:Using wrong printf format. Solution: Use "%ld" instead of "%d". (Dominique Pelle) Files: src/netbeans.c *** ../vim-7.2.113/src/netbeans.c Tue Jan 6 16:13:42 2009 --- src/netbeans.c Tue Feb 17 03:21:33 2009 *** *** 1924,1930 vim_free(path); if (bufp == NULL) { ! nbdebug(("File %s not found in setBufferNumber\n", args)); EMSG2("E642: File %s not found in setBufferNumber", args); return FAIL; } --- 1924,1930 vim_free(path); if (bufp == NULL) { ! nbdebug(("File %s not found in setBufferNumber\n", args)); EMSG2("E642: File %s not found in setBufferNumber", args); return FAIL; } *** *** 2318,2324 } if (pos) { ! coloncmd(":sign place %d line=%d name=%d buffer=%d", serNum, pos->lnum, typeNum, buf->bufp->b_fnum); if (typeNum == curPCtype) coloncmd(":sign jump %d buffer=%d", serNum, --- 2318,2324 } if (pos) { ! coloncmd(":sign place %d line=%ld name=%d buffer=%d", serNum, pos->lnum, typeNum, buf->bufp->b_fnum); if (typeNum == curPCtype) coloncmd(":sign jump %d buffer=%d", serNum, *** *** 2422,2428 GUARDED) == 0) { coloncmd( ! ":sign place %d line=%d name=%d buffer=%d", guardId++, lnum, GUARDED, buf->bufp->b_fnum); } --- 2422,2428 GUARDED) == 0) { coloncmd( ! ":sign place %d line=%ld name=%d buffer=%d", guardId++, lnum, GUARDED, buf->bufp->b_fnum); } *** ../vim-7.2.113/src/version.cSat Feb 21 22:03:06 2009 --- src/version.c Sat Feb 21 22:11:21 2009 *** *** 678,679 --- 678,681 { /* Add new patch number below this line */ + /**/ + 114, /**/ -- hundred-and-one symptoms of being an internet addict: 104. When people ask about the Presidential Election you ask "Which country?" /// Bram Moolenaar -- b...@moolenaar.net -- 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/// --~--~-~--~~~---~--~~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Patch 7.2.113
Patch 7.2.113 Problem:Crash for substitute() call using submatch(1) while there is no such submatch. (Yukihiro Nakadaira) Solution: Also check the start of the submatch is set, it can be NULL when an attempted match didn't work out. Files: src/regexp.c *** ../vim-7.2.112/src/regexp.c Fri Aug 8 13:45:31 2008 --- src/regexp.cSat Feb 21 21:46:49 2009 *** *** 4532,4538 cleanup_subexpr(); if (!REG_MULTI) /* Single-line regexp */ { ! if (reg_endp[no] == NULL) { /* Backref was not set: Match an empty string. */ len = 0; --- 4532,4538 cleanup_subexpr(); if (!REG_MULTI) /* Single-line regexp */ { ! if (reg_startp[no] == NULL || reg_endp[no] == NULL) { /* Backref was not set: Match an empty string. */ len = 0; *** *** 4548,4554 } else/* Multi-line regexp */ { ! if (reg_endpos[no].lnum < 0) { /* Backref was not set: Match an empty string. */ len = 0; --- 4548,4554 } else/* Multi-line regexp */ { ! if (reg_startpos[no].lnum < 0 || reg_endpos[no].lnum < 0) { /* Backref was not set: Match an empty string. */ len = 0; *** *** 7279,7291 } else { ! if (submatch_match->endp[no] == NULL) retval = NULL; else - { - s = submatch_match->startp[no]; retval = vim_strnsave(s, (int)(submatch_match->endp[no] - s)); - } } return retval; --- 7279,7289 } else { ! s = submatch_match->startp[no]; ! if (s == NULL || submatch_match->endp[no] == NULL) retval = NULL; else retval = vim_strnsave(s, (int)(submatch_match->endp[no] - s)); } return retval; *** ../vim-7.2.112/src/version.cSat Feb 21 21:22:44 2009 --- src/version.c Sat Feb 21 22:01:56 2009 *** *** 678,679 --- 678,681 { /* Add new patch number below this line */ + /**/ + 113, /**/ -- hundred-and-one symptoms of being an internet addict: 103. When you find yourself in the "Computer" section of Barnes & Noble enjoying yourself. /// Bram Moolenaar -- b...@moolenaar.net -- 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/// --~--~-~--~~~---~--~~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Patch 7.2.112
Patch 7.2.112 Problem:Cursor invisible in Visual mode when 'number' is set and cursor in first column. (Matti Niemenmaa, Renato Alves) Solution: Check that vcol_prev is smaller than vcol. Files: src/screen.c *** ../vim-7.2.111/src/screen.c Sat Feb 21 21:10:24 2009 --- src/screen.cSat Feb 21 21:04:19 2009 *** *** 3422,3427 --- 3422,3428 && (*mb_ptr2cells)(ptr) > 1) #endif || ((int)vcol_prev == fromcol_prev + && vcol_prev < vcol /* not at margin */ && vcol < tocol)) area_attr = attr; /* start highlighting */ else if (area_attr != 0 *** ../vim-7.2.111/src/version.cSat Feb 21 21:10:24 2009 --- src/version.c Sat Feb 21 21:20:51 2009 *** *** 678,679 --- 678,681 { /* Add new patch number below this line */ + /**/ + 112, /**/ -- hundred-and-one symptoms of being an internet addict: 102. When filling out your driver's license application, you give your IP address. /// Bram Moolenaar -- b...@moolenaar.net -- 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/// --~--~-~--~~~---~--~~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Patch 7.2.111
Patch 7.2.111 Problem:When using Visual block mode with 'cursorcolumn' it's unclear what is selected. Solution: Don't use 'cursorcolumn' highlighting inside the Visual selection. (idea by Dominique Pelle) Files: src/screen.c *** ../vim-7.2.110/src/screen.c Wed Oct 1 21:09:02 2008 --- src/screen.cSat Feb 21 21:04:19 2009 *** *** 2596,2601 --- 2596,2602 int noinvcur = FALSE; /* don't invert the cursor */ #ifdef FEAT_VISUAL pos_T *top, *bot; + int lnum_in_visual_area = FALSE; #endif pos_T pos; long v; *** *** 2792,2800 top = &VIsual; bot = &curwin->w_cursor; } if (VIsual_mode == Ctrl_V) /* block mode */ { ! if (lnum >= top->lnum && lnum <= bot->lnum) { fromcol = wp->w_old_cursor_fcol; tocol = wp->w_old_cursor_lcol; --- 2793,2802 top = &VIsual; bot = &curwin->w_cursor; } + lnum_in_visual_area = (lnum >= top->lnum && lnum <= bot->lnum); if (VIsual_mode == Ctrl_V) /* block mode */ { ! if (lnum_in_visual_area) { fromcol = wp->w_old_cursor_fcol; tocol = wp->w_old_cursor_lcol; *** *** 4557,4563 * highlight the cursor position itself. */ if (wp->w_p_cuc && vcol == (long)wp->w_virtcol && lnum != wp->w_cursor.lnum ! && draw_state == WL_LINE) { vcol_save_attr = char_attr; char_attr = hl_combine_attr(char_attr, hl_attr(HLF_CUC)); --- 4560,4567 * highlight the cursor position itself. */ if (wp->w_p_cuc && vcol == (long)wp->w_virtcol && lnum != wp->w_cursor.lnum ! && draw_state == WL_LINE ! && !lnum_in_visual_area) { vcol_save_attr = char_attr; char_attr = hl_combine_attr(char_attr, hl_attr(HLF_CUC)); *** ../vim-7.2.110/src/version.cSat Feb 21 20:36:30 2009 --- src/version.c Sat Feb 21 21:08:14 2009 *** *** 678,679 --- 678,681 { /* Add new patch number below this line */ + /**/ + 111, /**/ -- Contrary to popular belief, Unix is user friendly. It just happens to be selective about who it makes friends with. -- Dave Parnas /// Bram Moolenaar -- b...@moolenaar.net -- 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/// --~--~-~--~~~---~--~~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: [PATCH] GTK2 GUI statusline flickers
Yukihiro Nakadaira wrote: > When encoding is utf-8 and 'statusline' options is used, statusline > flickers for every cursor moving. This occurs on GTK2 GUI. Maybe video > driver is related. > The following patch fixes this problem. This prevent unnecessary > redrawing properly. Thanks, I'll include it. -- hundred-and-one symptoms of being an internet addict: 101. U can read htis w/o ny porblm and cant figur eout Y its evn listd. /// Bram Moolenaar -- b...@moolenaar.net -- 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/// --~--~-~--~~~---~--~~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Patch 7.2.110
Patch 7.2.110 Problem:Compiler warning for unused variable. Solution: Init the variable. Files: src/ex_docmd.c *** ../vim-7.2.109/src/ex_docmd.c Wed Jan 28 15:42:07 2009 --- src/ex_docmd.c Tue Feb 17 03:47:13 2009 *** *** 5916,5922 char_u*q; char_u*start; ! char_u*end; char_u*ksp; size_tlen, totlen; --- 5916,5922 char_u*q; char_u*start; ! char_u*end = NULL; char_u*ksp; size_tlen, totlen; *** ../vim-7.2.109/src/version.cSat Feb 21 20:27:00 2009 --- src/version.c Sat Feb 21 20:35:50 2009 *** *** 678,679 --- 678,681 { /* Add new patch number below this line */ + /**/ + 110, /**/ -- hundred-and-one symptoms of being an internet addict: 100. The most exciting sporting events you noticed during summer 1996 was Netscape vs. Microsoft. /// Bram Moolenaar -- b...@moolenaar.net -- 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/// --~--~-~--~~~---~--~~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Patch 7.2.109
Patch 7.2.109 Problem:'langmap' does not work for multi-byte characters. Solution: Add a list of mapped multi-byte characters. (based on work by Konstantin Korikov, Agathoklis Hatzimanikas) Files: runtime/doc/options.txt, src/edit.c, src/getchar.c, src/macros.h, src/normal.c, src/option.c, src/proto/option.pro, src/window.c *** ../vim-7.2.108/runtime/doc/options.txt Fri Nov 28 10:59:57 2008 --- runtime/doc/options.txt Wed Feb 11 18:59:34 2009 *** *** 4175,4183 be able to execute Normal mode commands. This is the opposite of the 'keymap' option, where characters are mapped in Insert mode. - This only works for 8-bit characters. The value of 'langmap' may be - specified with multi-byte characters (e.g., UTF-8), but only the lower - 8 bits of each character will be used. Example (for Greek, in UTF-8): *greek* > :set langmap=ΑA,ΒB,ΨC,ΔD,ΕE,ΦF,ΓG,ΗH,ΙI,ΞJ,ΚK,ΛL,ΜM,ΝN,ΟO,ΠP,QQ,ΡR,ΣS,ΤT,ΘU,ΩV,WW,ΧX,ΥY,ΖZ,αa,βb,ψc,δd,εe,φf,γg,ηh,ιi,ξj,κk,λl,μm,νn,οo,πp,qq,ρr,σs,τt,θu,ωv,ςw,χx,υy,ζz --- 4188,4193 *** ../vim-7.2.108/src/edit.c Wed Feb 4 11:19:40 2009 --- src/edit.c Sat Feb 21 19:54:03 2009 *** *** 7703,7711 */ ++no_mapping; regname = plain_vgetc(); - #ifdef FEAT_LANGMAP LANGMAP_ADJUST(regname, TRUE); - #endif if (regname == Ctrl_R || regname == Ctrl_O || regname == Ctrl_P) { /* Get a third key for literal register insertion */ --- 7703,7709 *** *** 7714,7722 add_to_showcmd_c(literally); #endif regname = plain_vgetc(); - #ifdef FEAT_LANGMAP LANGMAP_ADJUST(regname, TRUE); - #endif } --no_mapping; --- 7712,7718 *** ../vim-7.2.108/src/macros.h Wed Aug 15 20:41:07 2007 --- src/macros.hSat Feb 21 19:55:38 2009 *** *** 127,141 #ifdef FEAT_LANGMAP /* * Adjust chars in a language according to 'langmap' option. ! * NOTE that there is NO overhead if 'langmap' is not set; but even ! * when set we only have to do 2 ifs and an array lookup. * Don't apply 'langmap' if the character comes from the Stuff buffer. * The do-while is just to ignore a ';' after the macro. */ ! # define LANGMAP_ADJUST(c, condition) do { \ ! if (*p_langmap && (condition) && !KeyStuffed && (c) >= 0 && (c) < 256) \ ! c = langmap_mapchar[c]; \ } while (0) #endif /* --- 127,157 #ifdef FEAT_LANGMAP /* * Adjust chars in a language according to 'langmap' option. ! * NOTE that there is no noticeable overhead if 'langmap' is not set. ! * When set the overhead for characters < 256 is small. * Don't apply 'langmap' if the character comes from the Stuff buffer. * The do-while is just to ignore a ';' after the macro. */ ! # ifdef FEAT_MBYTE ! # define LANGMAP_ADJUST(c, condition) \ ! do { \ ! if (*p_langmap && (condition) && !KeyStuffed && (c) >= 0) \ ! { \ ! if ((c) < 256) \ ! c = langmap_mapchar[c]; \ ! else \ ! c = langmap_adjust_mb(c); \ ! } \ } while (0) + # else + # define LANGMAP_ADJUST(c, condition) \ + do { \ + if (*p_langmap && (condition) && !KeyStuffed && (c) >= 0 && (c) < 256) \ + c = langmap_mapchar[c]; \ + } while (0) + # endif + #else + # define LANGMAP_ADJUST(c, condition) /* nop */ #endif /* *** ../vim-7.2.108/src/normal.c Wed Feb 4 11:45:28 2009 --- src/normal.cSat Feb 21 19:55:17 2009 *** *** 651,660 * Get the command character from the user. */ c = safe_vgetc(); - - #ifdef FEAT_LANGMAP LANGMAP_ADJUST(c, TRUE); - #endif #ifdef FEAT_VISUAL /* --- 651,657 *** *** 744,752 } ++no_zero_mapping; /* don't map zero here */ c = plain_vgetc(); - #ifdef FEAT_LANGMAP LANGMAP_ADJUST(c, TRUE); - #endif --no_zero_mapping; if (ctrl_w) { --- 741,747 *** *** 769,777 ++no_mapping; ++allow_keys; /* no mapping for nchar, but keys */ c = plain_vgetc(); /* get next character */ - #ifdef FEAT_LANGMAP LANGMAP_ADJUST(c, TRUE); - #endif --no_mapping; --allow_keys; #ifdef FEAT_CMDL_INFO --- 764,770 *** *** 959,967 * "gr", "g'" and "g`". */ ca.nchar = plain_vgetc(); - #ifdef FEAT_LANGMAP LANGMAP_ADJUST(ca.nchar, TRUE); - #endif #ifdef FEAT_CMDL_INFO need_flushbuf |= add_to_showcmd(ca.nchar); #endif --- 952,958 *** *** 1062,1071 } #endif - #ifdef FEAT_LANGMAP /* adjust chars > 127, except after "tTfFr" commands */ LANGMAP_AD
Re: Bug report that didn't get reported?
Paul B. Mahol wrote: > Tony Mechelynck wrote: > > On 21/02/09 06:30, Bram Moolenaar wrote: > > > > > > Ben Fritz wrote: > > > > > >> Saw this interesting post to a tip on the wiki: > > >> > > >> http://vim.wikia.com/index.php?title=Fix_broken_arrow_key_navigation_in_insert_mode&diff=22116&oldid=prev > > >> > > >> Apparently this xterm bug report: > > >> > > >> http://bugs.gentoo.org/212546 > > >> > > >> has been blamed on Vim, but for whatever reason the poster does not > > >> expect useful help from this list. > > >> > > >> Just making sure people were aware of it here. > > > > > > I'm missing the part where it says what exactly it is that Vim would be > > > doing wrong. I don't see the problem anyway. > > > > > > > A comment to that bug report says the problem disappears when invoking > > "xterm -kt vt220". From what I can tell, the problem seems to be related > > with some gentoo-specific "bugfixes" (sic) to the xterm code and/or > > configuration. > > Wrong. Same heppens here on FreeBSD, xterm version X.Org 6.8.99.903 > (238) > Disabling tcap-query makes vim happy. > > I think it is vim bug because when starting vim intro message appears > and quickly dissapears. That's normal. It happens when the assumption Vim makes about the number of colors supported is corrected when the termcap-query results comes in. Vim needs to redraw the screen then. It also means you might get wrong colors when you disable termcap-query. In the situation that it doesn't work properly, what is the output of ":set termcap"? -- hundred-and-one symptoms of being an internet addict: 98. The Alta Vista administrators ask you what sites are missing in their index files. /// Bram Moolenaar -- b...@moolenaar.net -- 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/// --~--~-~--~~~---~--~~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: PATCH: Completion for find and sfind arguments (todo.txt)
On Sun, Feb 22, 2009 at 2:17 AM, Nazri Ramliy wrote: > Attached patch correct the mentioned problem(s). I just noticed another problem, with the patch compilation fails when --with-features=tiny. Attached patch fixes this problem too. nazri. --~--~-~--~~~---~--~~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~--- Index: ex_docmd.c === --- ex_docmd.c (revision 1365) +++ ex_docmd.c (working copy) @@ -3422,6 +3422,11 @@ */ switch (ea.cmdidx) { + case CMD_find: + case CMD_sfind: + case CMD_tabfind: + xp->xp_context = EXPAND_FILES_IN_PATH; + break; case CMD_cd: case CMD_chdir: case CMD_lcd: Index: ex_getln.c === --- ex_getln.c (revision 1365) +++ ex_getln.c (working copy) @@ -4063,6 +4063,7 @@ char_u *tail; if (context != EXPAND_FILES + && context != EXPAND_FILES_IN_PATH && context != EXPAND_SHELLCMD && context != EXPAND_DIRECTORIES) { @@ -4377,7 +4378,9 @@ if (options & WILD_SILENT) flags |= EW_SILENT; -if (xp->xp_context == EXPAND_FILES || xp->xp_context == EXPAND_DIRECTORIES) +if (xp->xp_context == EXPAND_FILES + || xp->xp_context == EXPAND_DIRECTORIES + || xp->xp_context == EXPAND_FILES_IN_PATH) { /* * Expand file or directory names. @@ -4407,6 +4410,8 @@ if (xp->xp_context == EXPAND_FILES) flags |= EW_FILE; + else if (xp->xp_context == EXPAND_FILES_IN_PATH) + flags |= (EW_FILE | EW_PATH); else flags = (flags | EW_DIR) & ~EW_FILE; ret = expand_wildcards(1, &pat, num_file, file, flags); Index: misc1.c === --- misc1.c (revision 1365) +++ misc1.c (working copy) @@ -9097,7 +9097,254 @@ } #endif +#if defined(FEAT_SEARCHPATH) +/* + * Expand the files matching pattern, starting from the given path, save + * the matches in their equivalent fullpath. + */ +static int +expand_to_fullpath(path, gap, pattern, flags) +char_u *path; +garray_T *gap; +char_u *pattern; +int flags; /* EW_* flags */ +{ +int i; +int c; +int old_len; +int new_len; +char_u **files; +char_u *fullpath; + +old_len = gap->ga_len; +c = mch_expandpath(gap, pattern, flags); + +files = (gap->ga_data != NULL) ? (char_u **)gap->ga_data : (char_u **)""; +new_len = gap->ga_len; + +for(i = old_len; i < new_len; i++) +{ + fullpath = concat_fnames(path, files[i], TRUE); + vim_free(files[i]); + files[i] = fullpath; +} +return c; +} + /* + * Moves psep to the previous path separator in path, starting from the + * end of path. Returns FAIL is psep ends up at the beginning of path. + */ +static int +find_previous_pathsep(path, psep) +char_u *path; +char_u **psep; +{ +/* + * As we're looking for the previous path separator, skip the current + * separator. + */ +if (vim_ispathsep(**psep)) + (*psep)--; + +while (*psep >= path && !vim_ispathsep(**psep)) + (*psep)--; + +if (*psep != path && vim_ispathsep(**psep)) + return OK; + +return FAIL; +} + +/* + * Returns TRUE if maybe_unique is unique wrt other_paths in gap. maybe_unique + * is the end portion of ((char_u **)gap->ga_data)[i]. + */ +static int +is_unique(maybe_unique, gap, i) +char_u *maybe_unique; +garray_T *gap; +int i; +{ +int j; +int candidate_len; +int other_path_len; +char_u *rival; +char_u **other_paths; + +other_paths = (gap->ga_data != NULL) ? (char_u **)gap->ga_data : (char_u **)""; + +for (j = 0; j < gap->ga_len && !got_int; j++) +{ + /* Don't compare it with itself */ + if(j == i) + continue; + + candidate_len = STRLEN(maybe_unique); + other_path_len = STRLEN(other_paths[j]); + + if(other_path_len < candidate_len) + /* It's different, */ + continue; + + rival = other_paths[j] + other_path_len - candidate_len; + + if (fnamecmp(maybe_unique, rival) == 0) + return FALSE; +} + +return TRUE; +} + +/* + * Sorts, removes duplicates and modifies all the fullpath names in gap so that + * they are unique with respect to each other. Beware, this is at least O(n^2) + * wrt gap->ga_len. + */ +static void +uniquefy_paths(gap) +garray_T *gap; +{ +int i; +int path_len; +char_u *pathsep_p; +char_u *path; +char_u **fnames = (char_u **) gap->ga_data; + +int j; +int sort_again = 0; + +/* Remove duplicate entries */ +sort_strings(fnames, gap->ga_len); +for (i = 0; i < gap->ga_len - 1; i++) + if (fnamecmp(fnames[i], fnames[i+1]) == 0) + { + vim_free(fnames[i]); + for (j = i+1; j < gap->ga_len; j++) + fnames[j-1] = fnames[j]; + gap->ga_len--; + i--; + } + +
Re: Bug report that didn't get reported?
On Feb 21, 10:27 am, Tony Mechelynck wrote: > Well, I tried to understand what was said in the various comments to > that bug; maybe I misunderstood, or maybe I thought the mentioned > changes were "Gentoo patches" when they were actually "X.org patches". not "X.org patches" (X.org is just another packager for xterm). > other F keys), work OK in both cases. In both cases, xterm sets $TERM to > xterm even if started with $TERM unset, or set to the empty string. > Using "export TERM=vt220" within xterm before starting Vim makes all > "special keys" unrecognized: obviously -kt vt220 does not make xterm > behave as a "real" vt220. The "-kt" option doesn't change the $TERM setting. It corresponds to the middle of the left-control-mouse menu. (The vt220 keyboard doesn't have different behavior for control/meta keys). -- Thomas E. Dickey http://invisible-island.net ftp://invisible-island.net --~--~-~--~~~---~--~~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: incremental search in lists
On Sun, Feb 22, 2009 at 2:27 AM, Nazri Ramliy wrote: > You can extend your keyboard shortcut so that it redirects the output > of :messages to a register, then open a new window or tab, then paste > the content of that register. > > :redir @a > :messages > :redir END > And then you can hit '/' and voila! Incremental search! Combine this with a customized syntax highlight of your liking... ah the possibilities are endless with vim! nazri. --~--~-~--~~~---~--~~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: incremental search in lists
On Sat, Feb 21, 2009 at 11:55 PM, mobi phil wrote: > Usecase1... in my daily work it is always interesting to go back to old > messages... I have a keyboard shortcut for the messages list (ctrl _lm)... > but here the story ends. What I would love to do is to be able to search in > this list. You can extend your keyboard shortcut so that it redirects the output of :messages to a register, then open a new window or tab, then paste the content of that register. :redir @a :messages :redir END nazri --~--~-~--~~~---~--~~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: PATCH: Completion for find and sfind arguments (todo.txt)
On Sat, Feb 21, 2009 at 10:38 PM, Dominique Pelle wrote: > I'm trying your patch on Linux x86 (from Vim-7.2.108). > I notice something broken. > > I do: > > $ mkdir foobar/ > $ vim -u NONE > set nocompatible > set wildmode=longest,list > set wildmenu > set path=. > > If I type: > > :find foo > > I would expect to complete up to foobar/ (it does > that without patch) but after patch it does not complete > the directory name anymore. Thanks for trying it out and reporting the problem. It happens during the 'uniquefying' process. To be specific it's the find_previous_pathsep function. The foobar/ name gets uniquefied as an empty string due the ending slash. During fixing this I (carefully) read :he 'path' and noticed that the completion should also be applied to :tabfind, and it should not be applied when the path is a fullpath or starts with a dot. Attached patch correct the mentioned problem(s). nazri --~--~-~--~~~---~--~~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~--- Index: ex_docmd.c === --- ex_docmd.c (revision 1365) +++ ex_docmd.c (working copy) @@ -3422,6 +3422,11 @@ */ switch (ea.cmdidx) { + case CMD_find: + case CMD_sfind: + case CMD_tabfind: + xp->xp_context = EXPAND_FILES_IN_PATH; + break; case CMD_cd: case CMD_chdir: case CMD_lcd: Index: ex_getln.c === --- ex_getln.c (revision 1365) +++ ex_getln.c (working copy) @@ -4063,6 +4063,7 @@ char_u *tail; if (context != EXPAND_FILES + && context != EXPAND_FILES_IN_PATH && context != EXPAND_SHELLCMD && context != EXPAND_DIRECTORIES) { @@ -4377,7 +4378,9 @@ if (options & WILD_SILENT) flags |= EW_SILENT; -if (xp->xp_context == EXPAND_FILES || xp->xp_context == EXPAND_DIRECTORIES) +if (xp->xp_context == EXPAND_FILES + || xp->xp_context == EXPAND_DIRECTORIES + || xp->xp_context == EXPAND_FILES_IN_PATH) { /* * Expand file or directory names. @@ -4407,6 +4410,8 @@ if (xp->xp_context == EXPAND_FILES) flags |= EW_FILE; + else if (xp->xp_context == EXPAND_FILES_IN_PATH) + flags |= (EW_FILE | EW_PATH); else flags = (flags | EW_DIR) & ~EW_FILE; ret = expand_wildcards(1, &pat, num_file, file, flags); Index: misc1.c === --- misc1.c (revision 1365) +++ misc1.c (working copy) @@ -9097,7 +9097,254 @@ } #endif +#if defined(FEAT_SEARCHPATH) +/* + * Expand the files matching pattern, starting from the given path, save + * the matches in their equivalent fullpath. + */ +static int +expand_to_fullpath(path, gap, pattern, flags) +char_u *path; +garray_T *gap; +char_u *pattern; +int flags; /* EW_* flags */ +{ +int i; +int c; +int old_len; +int new_len; +char_u **files; +char_u *fullpath; + +old_len = gap->ga_len; +c = mch_expandpath(gap, pattern, flags); + +files = (gap->ga_data != NULL) ? (char_u **)gap->ga_data : (char_u **)""; +new_len = gap->ga_len; + +for(i = old_len; i < new_len; i++) +{ + fullpath = concat_fnames(path, files[i], TRUE); + vim_free(files[i]); + files[i] = fullpath; +} +return c; +} + /* + * Moves psep to the previous path separator in path, starting from the + * end of path. Returns FAIL is psep ends up at the beginning of path. + */ +static int +find_previous_pathsep(path, psep) +char_u *path; +char_u **psep; +{ +/* + * As we're looking for the previous path separator, skip the current + * separator. + */ +if (vim_ispathsep(**psep)) + (*psep)--; + +while (*psep >= path && !vim_ispathsep(**psep)) + (*psep)--; + +if (*psep != path && vim_ispathsep(**psep)) + return OK; + +return FAIL; +} + +/* + * Returns TRUE if maybe_unique is unique wrt other_paths in gap. maybe_unique + * is the end portion of ((char_u **)gap->ga_data)[i]. + */ +static int +is_unique(maybe_unique, gap, i) +char_u *maybe_unique; +garray_T *gap; +int i; +{ +int j; +int candidate_len; +int other_path_len; +char_u *rival; +char_u **other_paths; + +other_paths = (gap->ga_data != NULL) ? (char_u **)gap->ga_data : (char_u **)""; + +for (j = 0; j < gap->ga_len && !got_int; j++) +{ + /* Don't compare it with itself */ + if(j == i) + continue; + + candidate_len = STRLEN(maybe_unique); + other_path_len = STRLEN(other_paths[j]); + + if(other_path_len < candidate_len) + /* It's different, */ + continue; + + rival = other_paths[j] + other_path_len - candidate_len; + + if (fnamecmp(maybe_unique, rival) == 0) + return FALSE; +} + +return TRUE; +} + +/* + * Sorts, removes duplicates and modifies a
incremental search in lists
Hello, I am a obsessed with vim. However I miss a lot the feature to be able to (incremental) search in lists exactly as one searches in windows (buffers). Such lists are useful concepts in vim, mainly as they are similar to modal dialogs as you do not want to see them all the time, just when you need them. :messages :map :ll Usecase1... in my daily work it is always interesting to go back to old messages... I have a keyboard shortcut for the messages list (ctrl _lm)... but here the story ends. What I would love to do is to be able to search in this list. Usecase2... MRU. I know there are lot of MRU implementations, but all of them they open a window and they destroy the layout of the windows... however what I think would be clever is to have a list with MRU shown, incremental search in it, enter, list is closed, and open file in the latest window as a new buffer... Similar way it would be powerfull to search in a loaded tags list, or why not, imagine a concatenated source file with all your source code. In such a buffer of concatenated files, you could incrementally search (I am using it often, but opened in a window), and once you identified the correct line, enter, and the file that represents that part of the concatenation would be opened on your last window. Custom lists would be very interesting, and some commands to read a list from a file (elements of the list would be obviously the lines). Another maybe exaggerated idea would be a feature to search inside completion lists... I press ctrlx f/i, thousands of files listed, or items listed, would be nice to have a shortcut that would bring me into incremental search mode, and select faster the item I am interested in... If you did not understand my description I am happy to give further details. Thank you for your attention, Mobi http://www.mobiphil.com/?p=97 --~--~-~--~~~---~--~~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
How to split multiple CSS rules into one line each?
I guess the title is pretty much self-explanatory. But I'll give an example of what I want. Assume I have this line: a.anything {color:#eee;display:block;width:300px;} So, I want to split this above line into this: a.anything { color:#eee; display:block; width:300px; } So, what is the best way of doing that? Using regexp + substitution? Or is there a simpler way to do it? All the best, Leandro. --~--~-~--~~~---~--~~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: Bug report that didn't get reported?
On 21/02/09 14:02, Markus Heidelberg wrote: > Tony Mechelynck, 21.02.2009: >> On 21/02/09 06:30, Bram Moolenaar wrote: >>> Ben Fritz wrote: >>> Saw this interesting post to a tip on the wiki: http://vim.wikia.com/index.php?title=Fix_broken_arrow_key_navigation_in_insert_mode&diff=22116&oldid=prev Apparently this xterm bug report: http://bugs.gentoo.org/212546 has been blamed on Vim, but for whatever reason the poster does not expect useful help from this list. Just making sure people were aware of it here. >>> I'm missing the part where it says what exactly it is that Vim would be >>> doing wrong. I don't see the problem anyway. >>> >> A comment to that bug report says the problem disappears when invoking >> "xterm -kt vt220". From what I can tell, the problem seems to be related >> with some gentoo-specific "bugfixes" (sic) to the xterm code and/or >> configuration. > > Which comment in the bug report leads you to such an assumption? > Gentoo is one of the sane distributions, that believe patches belong to > upstream instead of damaging the packages. And actually Gentoo doesn't > add patches to xterm, it fetches > ftp://invisible-island.net/xterm/xterm-239.tgz, extracts and compiles > it. The only modifications are these in the build script: > > # Fix permissions -- it grabs them from live system, and they can > # be suid or sgid like they were in pre-unix98 pty or pre-utempter days, > # respectively (#69510). > # (info from Thomas Dickey) - Donnie Berkholz > fperms 0755 /usr/bin/xterm > > # restore the navy blue > sed -i "s:blue2$:blue:" "${D}"${DEFAULTS_DIR}/XTerm-color > > # Fix for bug #91453 at Thomas Dickey's suggestion: > echo "*allowWindowOps: false">> "${D}"/${DEFAULTS_DIR}/XTerm > echo "*allowWindowOps: false">> "${D}"/${DEFAULTS_DIR}/UXTerm > > Whereas if I look into > http://download.opensuse.org/source/distribution/11.1/repo/oss/suse/src/xterm-236-1.42.src.rpm > I can see several patches. I don't say there is no reason for them, but > you can mostly be sure, that Gentoo doesn't introduce bugs with patches, > as it's done in other distributions. > > I use Gentoo and have 239 installed and it works, I also successfully > tested 235 and 237 (there is no ebuild for your version 236) when > invoking xterm without arguments. With -kt vt220 it doesn't work > correctly in all the tested versions. Maybe you can try it once with > this command line argument? > > Markus > > Well, I tried to understand what was said in the various comments to that bug; maybe I misunderstood, or maybe I thought the mentioned changes were "Gentoo patches" when they were actually "X.org patches". Here, without that command-line argument, but not with it, Vim correctly distinguishes between . With the argument, they are all seen as regardless of Shift and Ctrl (I'm using the "grey" keys, not the "NumLock-off numeric keyboard", and I checked with the Ctrl-K prefix). "Ordinary" (unshifted un-Ctrl-ed) arrow keys, and the "ordinary" F1 key (I didn't check the other F keys), work OK in both cases. In both cases, xterm sets $TERM to xterm even if started with $TERM unset, or set to the empty string. Using "export TERM=vt220" within xterm before starting Vim makes all "special keys" unrecognized: obviously -kt vt220 does not make xterm behave as a "real" vt220. Best regards, Tony. -- There is a certain impertinence in allowing oneself to be burned for an opinion. -- Anatole France --~--~-~--~~~---~--~~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: [PATCH] GTK2 GUI statusline flickers
Tony Mechelynck wrote: > On 21/02/09 13:03, Yukihiro Nakadaira wrote: >> When encoding is utf-8 and 'statusline' options is used, statusline >> flickers for every cursor moving. This occurs on GTK2 GUI. Maybe video >> driver is related. >> The following patch fixes this problem. This prevent unnecessary >> redrawing properly. > > Works for me, using (at the moment) gvim 7.2.108 with GTK2/Gnome2 GUI. > - I have a custom status line. > - I'm using a multi-CPU-capable kernel on a single-CPU motherboard > clocked at 1200 MHz (2400 bogomips). > - I have a SiS 660 video card connected to a Samsung SyncMaster 570BTFT > screen displaying at width=1024, height=768, colors=16777216 (red=256, > green=256, blue=256) using the "sis" X-driver distributed with openSUSE > 11.1 in (I think) its "xorg-x11-server" package. > - Here's the output of "Xorg -version": > > X.Org X Server 1.5.2 > Release Date: 10 October 2008 > X Protocol Version 11, Revision 0 > Build Operating System: openSUSE SUSE LINUX > Current Operating System: Linux linux 2.6.27.7-9-pae #1 SMP 2008-12-04 > 18:10:04 +0100 i686 > Build Date: 03 December 2008 09:21:06AM > > Before reporting problems, check http://wiki.x.org > to make sure that you have the latest version. > Module Loader present > > > > (The wiki mentioned in the above -version listing gives 1.5.1 as the > "latest" X-server version.) I am using Ubuntu 9.4 alpha 4 and X.Org X Server 1.6.0 Rc2. The problem appear with fglrx and xorg's ati driver. I think that the problem itself is not Vim's problem. But the code I mentioned seems not work as author intended. -- Yukihiro Nakadaira - yukihiro.nakada...@gmail.com --~--~-~--~~~---~--~~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: Bug report that didn't get reported?
On Feb 21, 12:30 am, Bram Moolenaar wrote: > Ben Fritz wrote: > > Saw this interesting post to a tip on the wiki: > > >http://vim.wikia.com/index.php?title=Fix_broken_arrow_key_navigation_... > > > Apparently this xterm bug report: > > >http://bugs.gentoo.org/212546 ... (and a few others - though I have some cross-threads from the users of gnome-terminal, whose behavior regarding modifiers is FUBAR'd) > I'm missing the part where it says what exactly it is that Vim would be > doing wrong. I don't see the problem anyway. I suppose it's either some non-default setting in their personal or system configuration, or else some keyboards don't work as expected with the feature. (I turned it on in the compile since several people requested it). Perhaps you can elicit enough information from the people reporting the bug to see exactly what the problem is. -- Thomas E. Dickey http://invisible-island.net ftp://invisible-island.net --~--~-~--~~~---~--~~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: PATCH: Completion for find and sfind arguments (todo.txt)
Nazri Ramliy wrote: > On Fri, Feb 20, 2009 at 9:18 AM, Nazri wrote: >> I'm refining the patch - fixing a memory leak (stupid me :), and >> improving the shortening of the matching paths to get the minimum >> unique length of each. This is much much better than the simple (and >> not necessarily correct all the time) "relative to your working >> directory" or "home directory". The old method just won't work if your >> path setting does not include your home directory. The new method can >> produce sufficiently short paths to be comfortably seen on the >> wildmenu. > > Here's the improved patch. > > There's one major outstanding issue that I'm aware of - it does not > skip symbolic links. This may result in infinite cycle if there exists > a symbolic link that creates a cycle in the file system. > > I don't have access to a windows platform so I can't test the patch on > windows. It may have problems with those different drive letters. > > nazri. Hi Nazri I'm trying your patch on Linux x86 (from Vim-7.2.108). I notice something broken. I do: $ mkdir foobar/ $ vim -u NONE set nocompatible set wildmode=longest,list set wildmenu set path=. If I type: :find foo I would expect to complete up to foobar/ (it does that without patch) but after patch it does not complete the directory name anymore. Cheers -- Dominique --~--~-~--~~~---~--~~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: Bug report that didn't get reported?
Tony Mechelynck, 21.02.2009: > > On 21/02/09 06:30, Bram Moolenaar wrote: > > > > Ben Fritz wrote: > > > >> Saw this interesting post to a tip on the wiki: > >> > >> http://vim.wikia.com/index.php?title=Fix_broken_arrow_key_navigation_in_insert_mode&diff=22116&oldid=prev > >> > >> Apparently this xterm bug report: > >> > >> http://bugs.gentoo.org/212546 > >> > >> has been blamed on Vim, but for whatever reason the poster does not > >> expect useful help from this list. > >> > >> Just making sure people were aware of it here. > > > > I'm missing the part where it says what exactly it is that Vim would be > > doing wrong. I don't see the problem anyway. > > > > A comment to that bug report says the problem disappears when invoking > "xterm -kt vt220". From what I can tell, the problem seems to be related > with some gentoo-specific "bugfixes" (sic) to the xterm code and/or > configuration. Which comment in the bug report leads you to such an assumption? Gentoo is one of the sane distributions, that believe patches belong to upstream instead of damaging the packages. And actually Gentoo doesn't add patches to xterm, it fetches ftp://invisible-island.net/xterm/xterm-239.tgz, extracts and compiles it. The only modifications are these in the build script: # Fix permissions -- it grabs them from live system, and they can # be suid or sgid like they were in pre-unix98 pty or pre-utempter days, # respectively (#69510). # (info from Thomas Dickey) - Donnie Berkholz fperms 0755 /usr/bin/xterm # restore the navy blue sed -i "s:blue2$:blue:" "${D}"${DEFAULTS_DIR}/XTerm-color # Fix for bug #91453 at Thomas Dickey's suggestion: echo "*allowWindowOps: false" >> "${D}"/${DEFAULTS_DIR}/XTerm echo "*allowWindowOps: false" >> "${D}"/${DEFAULTS_DIR}/UXTerm Whereas if I look into http://download.opensuse.org/source/distribution/11.1/repo/oss/suse/src/xterm-236-1.42.src.rpm I can see several patches. I don't say there is no reason for them, but you can mostly be sure, that Gentoo doesn't introduce bugs with patches, as it's done in other distributions. I use Gentoo and have 239 installed and it works, I also successfully tested 235 and 237 (there is no ebuild for your version 236) when invoking xterm without arguments. With -kt vt220 it doesn't work correctly in all the tested versions. Maybe you can try it once with this command line argument? Markus --~--~-~--~~~---~--~~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: [PATCH] GTK2 GUI statusline flickers
On 21/02/09 13:03, Yukihiro Nakadaira wrote: > When encoding is utf-8 and 'statusline' options is used, statusline > flickers for every cursor moving. This occurs on GTK2 GUI. Maybe video > driver is related. > The following patch fixes this problem. This prevent unnecessary > redrawing properly. Works for me, using (at the moment) gvim 7.2.108 with GTK2/Gnome2 GUI. - I have a custom status line. - I'm using a multi-CPU-capable kernel on a single-CPU motherboard clocked at 1200 MHz (2400 bogomips). - I have a SiS 660 video card connected to a Samsung SyncMaster 570BTFT screen displaying at width=1024, height=768, colors=16777216 (red=256, green=256, blue=256) using the "sis" X-driver distributed with openSUSE 11.1 in (I think) its "xorg-x11-server" package. - Here's the output of "Xorg -version": X.Org X Server 1.5.2 Release Date: 10 October 2008 X Protocol Version 11, Revision 0 Build Operating System: openSUSE SUSE LINUX Current Operating System: Linux linux 2.6.27.7-9-pae #1 SMP 2008-12-04 18:10:04 +0100 i686 Build Date: 03 December 2008 09:21:06AM Before reporting problems, check http://wiki.x.org to make sure that you have the latest version. Module Loader present (The wiki mentioned in the above -version listing gives 1.5.1 as the "latest" X-server version.) Best regards, Tony. -- A special cleaning ordinance bans housewives from hiding dirt and dust under a rug in a dwelling. [real standing law in Pennsylvania, United States of America] --~--~-~--~~~---~--~~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
[PATCH] GTK2 GUI statusline flickers
When encoding is utf-8 and 'statusline' options is used, statusline flickers for every cursor moving. This occurs on GTK2 GUI. Maybe video driver is related. The following patch fixes this problem. This prevent unnecessary redrawing properly. Index: src/screen.c === --- src/screen.c(revision 1365) +++ src/screen.c(working copy) @@ -6358,7 +6358,7 @@ && c == 0x8e && ScreenLines2[off] != ptr[1]) || (enc_utf8 - && (ScreenLinesUC[off] != (u8char_T)u8c + && (ScreenLinesUC[off] != (u8char_T)(c >= 0x80 ? u8c : 0) || screen_comp_differs(off, u8cc))) #endif || ScreenAttrs[off] != attr -- Yukihiro Nakadaira - yukihiro.nakada...@gmail.com --~--~-~--~~~---~--~~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: Bug report that didn't get reported?
On 21/02/09 12:25, Paul B. Mahol wrote: > Tony Mechelynck wrote: >> On 21/02/09 06:30, Bram Moolenaar wrote: >>> Ben Fritz wrote: >>> Saw this interesting post to a tip on the wiki: http://vim.wikia.com/index.php?title=Fix_broken_arrow_key_navigation_in_insert_mode&diff=22116&oldid=prev Apparently this xterm bug report: http://bugs.gentoo.org/212546 has been blamed on Vim, but for whatever reason the poster does not expect useful help from this list. Just making sure people were aware of it here. >>> I'm missing the part where it says what exactly it is that Vim would be >>> doing wrong. I don't see the problem anyway. >>> >> A comment to that bug report says the problem disappears when invoking >> "xterm -kt vt220". From what I can tell, the problem seems to be related >> with some gentoo-specific "bugfixes" (sic) to the xterm code and/or >> configuration. > > Wrong. Same heppens here on FreeBSD, xterm version X.Org 6.8.99.903 > (238) > Disabling tcap-query makes vim happy. > > I think it is vim bug because when starting vim intro message appears > and > quickly dissapears. It could also be a "system vimrc" as installed by some Linux distributions. Do you still see the bug when starting Vim with vim -N -u NONE ? If you don't, check the output of ":scriptnames" immediately after startup in a Vim started in the usual way. (The location of the "system vimrc" is also shown near the middle of the output of ":version" but ":scriptnames" lists _all_ the scripts sourced so far in the present Vim session -- it could also be a global plugin added or changed by respect to those in ftp://ftp.vim.org/pub/vim/runtime/plugin/.) Best regards, Tony. -- Plato, by the way, wanted to banish all poets from his proposed Utopia because they were liars. The truth was that Plato knew philosophers couldn't compete successfully with poets. -- Kilgore Trout (Philip J. Farmer) "Venus on the Half Shell" --~--~-~--~~~---~--~~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: Bug report that didn't get reported?
Tony Mechelynck wrote: > On 21/02/09 06:30, Bram Moolenaar wrote: > > > > Ben Fritz wrote: > > > >> Saw this interesting post to a tip on the wiki: > >> > >> http://vim.wikia.com/index.php?title=Fix_broken_arrow_key_navigation_in_insert_mode&diff=22116&oldid=prev > >> > >> Apparently this xterm bug report: > >> > >> http://bugs.gentoo.org/212546 > >> > >> has been blamed on Vim, but for whatever reason the poster does not > >> expect useful help from this list. > >> > >> Just making sure people were aware of it here. > > > > I'm missing the part where it says what exactly it is that Vim would be > > doing wrong. I don't see the problem anyway. > > > > A comment to that bug report says the problem disappears when invoking > "xterm -kt vt220". From what I can tell, the problem seems to be related > with some gentoo-specific "bugfixes" (sic) to the xterm code and/or > configuration. Wrong. Same heppens here on FreeBSD, xterm version X.Org 6.8.99.903 (238) Disabling tcap-query makes vim happy. I think it is vim bug because when starting vim intro message appears and quickly dissapears. --~--~-~--~~~---~--~~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: Bug report that didn't get reported?
On 21/02/09 06:30, Bram Moolenaar wrote: > > Ben Fritz wrote: > >> Saw this interesting post to a tip on the wiki: >> >> http://vim.wikia.com/index.php?title=Fix_broken_arrow_key_navigation_in_insert_mode&diff=22116&oldid=prev >> >> Apparently this xterm bug report: >> >> http://bugs.gentoo.org/212546 >> >> has been blamed on Vim, but for whatever reason the poster does not >> expect useful help from this list. >> >> Just making sure people were aware of it here. > > I'm missing the part where it says what exactly it is that Vim would be > doing wrong. I don't see the problem anyway. > A comment to that bug report says the problem disappears when invoking "xterm -kt vt220". From what I can tell, the problem seems to be related with some gentoo-specific "bugfixes" (sic) to the xterm code and/or configuration. On SuSE Linux (openSUSE 11.1) where I am, when I invoke Vim in console mode in an xterm started with no command-line arguments at all, both arrow keys (in Normal and Insert modes) and F keys (I tried F1 to bring up the help) work perfectly. Here, "xterm -version" answers "X.Org 6.8.99.903(236)". My X server executable is called Xorg, and "Xorg -version" gives back some 10 lines or so of information which I won't post here unless asked for them. Best regards, Tony. -- "Yeah, but you're taking the universe out of context." --~--~-~--~~~---~--~~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---