Re: Patch 7.4.2259
Andy Wokula wrote: > Am 27.08.2016 um 13:35 schrieb Bram Moolenaar: > > > > Urtica Dioica wrote: > > > >> I do like the idea for the feature. I tried it, it has some bugs, but > >> they'll get ironed out eventually. > >> > >> But I've gotta ask, does no one else use search command line history? > >> The new bindings override the old forward/backward command history > >> bindings (and that are still used by the other command lines). The > >> only way to access search history now is with the command line window > >> (). > >> > >> Is that the plan? I won't fight the decision, but I will say I'm not > >> happy losing the old (useful) bindings. > > > > Hmm, I thought that the keys were unused in this mode. But you are > > right, they were used for command line history. > > > > Looking for other keys, there are not so many available: > > CTRL-@ > > CTRL-G > > CTRL-O > > CTRL-T > > CTRL-X > > > > Note that CTRL-T already has a meaning of going to an older tag stack > > entry. So using it for "previous" makes some sense. > > On the other hand, CTRL-O hints at Older. > > > > Note that while searching for this the new CTRL-N and CTRL-P were > > actually useful. > > > > Taking up two more characters for this means there is hardly any left. > > But there isn't much choice. Adding an option to change the behavior is > > not nice either. > > > > So how about this: Use CTRL-T for going up, like what CTRL-P did, and > > use CTRL-G for going down, what CTRL-N did. On a regular keyboard the T > > is above the G, so that's the hint for the user. > > What about a sub-mode started with CTRL-X where you can use `n' and `N'? > > In Insert mode there is already such a mode for scrolling: > i_CTRL-X_CTRL-E > then, CTRL-E / CTRL-Y can be used to scroll down/up. > > This could even be used (later) to scroll the window while in Cmdline mode. Another sub-mode sounds complicated. I now made CTRL-G and CTRL-T do something when 'incsearch' is set and searching. We can still use them for something else in other situations. -- >From "know your smileys": :-{} Too much lipstick /// Bram Moolenaar -- b...@moolenaar.net -- 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/// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Patch 7.4.2259
Am 27.08.2016 um 13:35 schrieb Bram Moolenaar: Urtica Dioica wrote: I do like the idea for the feature. I tried it, it has some bugs, but they'll get ironed out eventually. But I've gotta ask, does no one else use search command line history? The new bindings override the old forward/backward command history bindings (and that are still used by the other command lines). The only way to access search history now is with the command line window (). Is that the plan? I won't fight the decision, but I will say I'm not happy losing the old (useful) bindings. Hmm, I thought that the keys were unused in this mode. But you are right, they were used for command line history. Looking for other keys, there are not so many available: CTRL-@ CTRL-G CTRL-O CTRL-T CTRL-X Note that CTRL-T already has a meaning of going to an older tag stack entry. So using it for "previous" makes some sense. On the other hand, CTRL-O hints at Older. Note that while searching for this the new CTRL-N and CTRL-P were actually useful. Taking up two more characters for this means there is hardly any left. But there isn't much choice. Adding an option to change the behavior is not nice either. So how about this: Use CTRL-T for going up, like what CTRL-P did, and use CTRL-G for going down, what CTRL-N did. On a regular keyboard the T is above the G, so that's the hint for the user. What about a sub-mode started with CTRL-X where you can use `n' and `N'? In Insert mode there is already such a mode for scrolling: i_CTRL-X_CTRL-E then, CTRL-E / CTRL-Y can be used to scroll down/up. This could even be used (later) to scroll the window while in Cmdline mode. -- Andy -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Patch 7.4.2259
Hirohito Higashi wrote: > 2016-8-27(Sat) 2:14:14 UTC+9 Bram Moolenaar: > > Patch 7.4.2259 > > Problem:With 'incsearch' can only see the next match. > > Solution: Make CTRL-N/CTRL-P move to the previous/next match. (Christian > > Brabandt) > > Files: runtime/doc/cmdline.txt, src/ex_getln.c, > > src/testdir/Make_all.mak, > > src/testdir/test_search.vim, src/Makefile > [...] > > Probably, I think that the attached patch is better to include. > It's not an error because the static function. > However it is better to mimic the other static functions. The || defined(PROTO) is for when generating function prototypes. And static functions are skipped then. Thus this is not needed. -- In order for something to become clean, something else must become dirty; but you can get everything dirty without getting anything clean. /// Bram Moolenaar -- b...@moolenaar.net -- 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/// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Patch 7.4.2259
Urtica Dioica wrote: > I do like the idea for the feature. I tried it, it has some bugs, but > they'll get ironed out eventually. > > But I've gotta ask, does no one else use search command line history? > The new bindings override the old forward/backward command history > bindings (and that are still used by the other command lines). The > only way to access search history now is with the command line window > (). > > Is that the plan? I won't fight the decision, but I will say I'm not > happy losing the old (useful) bindings. Hmm, I thought that the keys were unused in this mode. But you are right, they were used for command line history. Looking for other keys, there are not so many available: CTRL-@ CTRL-G CTRL-O CTRL-T CTRL-X Note that CTRL-T already has a meaning of going to an older tag stack entry. So using it for "previous" makes some sense. On the other hand, CTRL-O hints at Older. Note that while searching for this the new CTRL-N and CTRL-P were actually useful. Taking up two more characters for this means there is hardly any left. But there isn't much choice. Adding an option to change the behavior is not nice either. So how about this: Use CTRL-T for going up, like what CTRL-P did, and use CTRL-G for going down, what CTRL-N did. On a regular keyboard the T is above the G, so that's the hint for the user. -- You are only young once, but you can stay immature indefinitely. /// Bram Moolenaar -- b...@moolenaar.net -- 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/// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Patch 7.4.2259
Hi, On Sat, Aug 27, 2016 at 4:08 AM, Taro MURAOKA wrote: > 2016/8/27 17:22:49 UTC+9 Urtica dioica: >> I do like the idea for the feature. I tried it, it has some bugs, but >> they'll get ironed out eventually. > > > I have the same problem. > > Procedure to reproduce the problem is like this: > > 1. With enabling 'incsearch' > 2. Enter search mode by hitting `/` > 3. Try to access search hitories by typing CTRL-P some times > > Expected behavior (before 7.4.2259) is going for back search histories. > But actual behavior (after 7.4.2259) is show previous matches. > > Of course I can access search histories by CTRL-P with 'noincsearch'. > But it looks like some kind of breaking changes. > So I think it would be better to change bindings for accessing histories > or showing next/previous matches. > Based on the information in index.txt, only the following keys are not used in the command-line mode: CTRL-G CTRL-O CTRL-T CTRL-X (but reserved) We have to pick some key binding from this. Another alternative is to use CTRL-X CTRL-N and CTRL-X CTRL-P. But this requires multiple key presses. - Yegappan -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Patch 7.4.2259
2016/8/27 17:22:49 UTC+9 Urtica dioica: > I do like the idea for the feature. I tried it, it has some bugs, but they'll > get ironed out eventually. I have the same problem. Procedure to reproduce the problem is like this: 1. With enabling 'incsearch' 2. Enter search mode by hitting `/` 3. Try to access search hitories by typing CTRL-P some times Expected behavior (before 7.4.2259) is going for back search histories. But actual behavior (after 7.4.2259) is show previous matches. Of course I can access search histories by CTRL-P with 'noincsearch'. But it looks like some kind of breaking changes. So I think it would be better to change bindings for accessing histories or showing next/previous matches. -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Patch 7.4.2259
Hi, On Sat, Aug 27, 2016 at 1:22 AM, Urtica dioica wrote: > I do like the idea for the feature. I tried it, it has some bugs, but they'll > get ironed > out eventually. > Can you describe the steps to reproduce the bugs that you encountered? > > But I've gotta ask, does no one else use search command line history? > The new bindings override the old forward/backward command history > bindings (and that are still used by the other command lines). The only way > to access search history now is with the command line window (). > I will let Christian comment on the choice of the key bindings (/). Thanks, Yegappan > > Is that the plan? I won't fight the decision, but I will say I'm not happy > losing > the old (useful) bindings. > -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Patch 7.4.2259
I do like the idea for the feature. I tried it, it has some bugs, but they'll get ironed out eventually. But I've gotta ask, does no one else use search command line history? The new bindings override the old forward/backward command history bindings (and that are still used by the other command lines). The only way to access search history now is with the command line window (). Is that the plan? I won't fight the decision, but I will say I'm not happy losing the old (useful) bindings. -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Patch 7.4.2259
Hi Bram and list, 2016-8-27(Sat) 2:14:14 UTC+9 Bram Moolenaar: > Patch 7.4.2259 > Problem:With 'incsearch' can only see the next match. > Solution: Make CTRL-N/CTRL-P move to the previous/next match. (Christian > Brabandt) > Files: runtime/doc/cmdline.txt, src/ex_getln.c, src/testdir/Make_all.mak, > src/testdir/test_search.vim, src/Makefile [...] Probably, I think that the attached patch is better to include. It's not an error because the static function. However it is better to mimic the other static functions. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/ex_getln.c b/src/ex_getln.c index f6e5097..881d057 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -7077,7 +7077,7 @@ script_get(exarg_T *eap, char_u *cmd) return (char_u *)ga.ga_data; } -#ifdef FEAT_SEARCH_EXTRA +#if defined(FEAT_SEARCH_EXTRA) || defined(PROTO) static void set_search_match(pos_T *t) {
Re: Patch 7.4.2259
Yegappan Lakshmanan wrote: > On Fri, Aug 26, 2016 at 10:14 AM, Bram Moolenaar wrote: > > > > Patch 7.4.2259 > > Problem:With 'incsearch' can only see the next match. > > Solution: Make CTRL-N/CTRL-P move to the previous/next match. (Christian > > Brabandt) > > Files: runtime/doc/cmdline.txt, src/ex_getln.c, > > src/testdir/Make_all.mak, > > src/testdir/test_search.vim, src/Makefile > > Thanks for including this enhancement. It is very useful to have this > feature. I thought it was useful. But now I'll stop including new features, only bug fixes until the release! -- >From "know your smileys": :~)A man with a tape recorder up his nose /// Bram Moolenaar -- b...@moolenaar.net -- 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/// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Patch 7.4.2259
Hi Bram, On Fri, Aug 26, 2016 at 10:14 AM, Bram Moolenaar wrote: > > Patch 7.4.2259 > Problem:With 'incsearch' can only see the next match. > Solution: Make CTRL-N/CTRL-P move to the previous/next match. (Christian > Brabandt) > Files: runtime/doc/cmdline.txt, src/ex_getln.c, src/testdir/Make_all.mak, > src/testdir/test_search.vim, src/Makefile > Thanks for including this enhancement. It is very useful to have this feature. Regards, Yegappan -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Patch 7.4.2259
Patch 7.4.2259 Problem:With 'incsearch' can only see the next match. Solution: Make CTRL-N/CTRL-P move to the previous/next match. (Christian Brabandt) Files: runtime/doc/cmdline.txt, src/ex_getln.c, src/testdir/Make_all.mak, src/testdir/test_search.vim, src/Makefile *** ../vim-7.4.2258/runtime/doc/cmdline.txt 2015-09-08 18:46:04.337233673 +0200 --- runtime/doc/cmdline.txt 2016-08-26 18:56:26.060363506 +0200 *** *** 404,414 --- 409,427 *c_CTRL-N* CTRL-NAfter using 'wildchar' which got multiple matches, go to next match. Otherwise recall more recent command-line from history. + */_CTRL-N* + When 'incsearch' is set, entering a search pattern for "/" or + "?" and the current match is displayed then CTRL-N will move + to the next match (does not take |search-offset| into account) *c_CTRL-P* *c_* CTRL-PAfter using 'wildchar' which got multiple matches, go to previous match. Otherwise recall older command-line from history. only works with the GUI, on the Amiga and with MS-DOS. + */_CTRL-P* + When 'incsearch' is set, entering a search pattern for "/" or + "?" and the current match is displayed then CTRL-P will move + to the previous match (does not take |search-offset| into account). *c_CTRL-A* CTRL-AAll names that match the pattern in front of the cursor are inserted. *** ../vim-7.4.2258/src/ex_getln.c 2016-07-10 22:11:11.866751401 +0200 --- src/ex_getln.c 2016-08-26 19:03:54.320578262 +0200 *** *** 137,142 --- 137,145 #endif sort_func_compare(const void *s1, const void *s2); #endif + #ifdef FEAT_SEARCH_EXTRA + static void set_search_match(pos_T *t); + #endif /* * getcmdline() - accept a command line starting with firstc. *** *** 178,183 --- 181,189 colnr_T old_curswant; colnr_T old_leftcol; linenr_T old_topline; + pos_T cursor_start; + pos_T match_start = curwin->w_cursor; + pos_T match_end; # ifdef FEAT_DIFF int old_topfill; # endif *** *** 223,229 --- 229,237 ccline.overstrike = FALSE;/* always start in insert mode */ #ifdef FEAT_SEARCH_EXTRA + clearpos(&match_end); old_cursor = curwin->w_cursor;/* needs to be restored later */ + cursor_start = old_cursor; old_curswant = curwin->w_curswant; old_leftcol = curwin->w_leftcol; old_topline = curwin->w_topline; *** *** 996,1001 --- 1004,1018 /* Truncate at the end, required for multi-byte chars. */ ccline.cmdbuff[ccline.cmdlen] = NUL; + #ifdef FEAT_SEARCH_EXTRA + if (ccline.cmdlen == 0) + old_cursor = cursor_start; + else + { + old_cursor = match_start; + decl(&old_cursor); + } + #endif redrawcmd(); } else if (ccline.cmdlen == 0 && c != Ctrl_W *** *** 1021,1026 --- 1038,1047 msg_col = 0; msg_putchar(' '); /* delete ':' */ } + #ifdef FEAT_SEARCH_EXTRA + if (ccline.cmdlen == 0) + old_cursor = cursor_start; + #endif redraw_cmdline = TRUE; goto returncmd; /* back to cmd mode */ } *** *** 1104,1109 --- 1125,1134 ccline.cmdbuff[i++] = ccline.cmdbuff[j++]; /* Truncate at the end, required for multi-byte chars. */ ccline.cmdbuff[ccline.cmdlen] = NUL; + #ifdef FEAT_SEARCH_EXTRA + if (ccline.cmdlen == 0) + old_cursor = cursor_start; + #endif redrawcmd(); goto cmdline_changed; *** *** 1440,1465 if (p_is && !cmd_silent && (firstc == '/' || firstc == '?')) { /* Add a character from under the cursor for 'incsearch' */ ! if (did_incsearch ! && !equalpos(curwin->