* Problems with vi-goto-mark and vi-set-mark @ 2007-04-15 16:49 ` Felix Rosencrantz 2007-04-15 18:14 ` William Scott 2007-04-15 19:53 ` Peter Stephenson 0 siblings, 2 replies; 9+ messages in thread From: Felix Rosencrantz @ 2007-04-15 16:49 UTC (permalink / raw) To: Zsh users list I've recently been trying to use viins/vicmd mode. I've hit a small problem with the vi-set-mark and vi-goto-mark, they seem to be broken in the latest version of zsh. Though it looks like it was working in 4.2.5. To reproduce: zsh -f % bindkey -v % echo <ESC>maiabcdef # ESC changes to vicmd mode # ma creates mark 'a' at the position # i go back to viins mode # abcdef actually doing self-inserts % echo <ESC>`a # <ESC> changes to vicmd mode # `a is suppose to go to mark 'a' from the previous line, but in the latest version it doesn't seem to work. It look like it has been broken for more than a year in 4.3.0 -FR. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Problems with vi-goto-mark and vi-set-mark 2007-04-15 16:49 ` Problems with vi-goto-mark and vi-set-mark Felix Rosencrantz @ 2007-04-15 18:14 ` William Scott 2007-04-15 18:48 ` fREW 2007-04-15 19:53 ` Peter Stephenson 1 sibling, 1 reply; 9+ messages in thread From: William Scott @ 2007-04-15 18:14 UTC (permalink / raw) To: Felix Rosencrantz; +Cc: Zsh users list Felix Rosencrantz wrote: > I've recently been trying to use viins/vicmd mode. I've hit a small > problem with the vi-set-mark and vi-goto-mark, they seem to be broken > in the latest version of zsh. Though it looks like it was working in > 4.2.5. > > To reproduce: > zsh -f > % bindkey -v > % echo <ESC>maiabcdef > # ESC changes to vicmd mode > # ma creates mark 'a' at the position > # i go back to viins mode > # abcdef actually doing self-inserts > % echo <ESC>`a > # <ESC> changes to vicmd mode > # `a is suppose to go to mark 'a' from the previous line, but in > the latest version it doesn't seem to work. It look like it has been > broken for more than a year in 4.3.0 > > -FR. > I just verified it works in 4.2.3 (which comes with Apple OS X) and not with my 4.3.2 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Problems with vi-goto-mark and vi-set-mark 2007-04-15 18:14 ` William Scott @ 2007-04-15 18:48 ` fREW 0 siblings, 0 replies; 9+ messages in thread From: fREW @ 2007-04-15 18:48 UTC (permalink / raw) To: William Scott; +Cc: Felix Rosencrantz, Zsh users list On 4/15/07, William Scott <wgscott@chemistry.ucsc.edu> wrote: > > > Felix Rosencrantz wrote: > > I've recently been trying to use viins/vicmd mode. I've hit a small > > problem with the vi-set-mark and vi-goto-mark, they seem to be broken > > in the latest version of zsh. Though it looks like it was working in > > 4.2.5. > > > > To reproduce: > > zsh -f > > % bindkey -v > > % echo <ESC>maiabcdef > > # ESC changes to vicmd mode > > # ma creates mark 'a' at the position > > # i go back to viins mode > > # abcdef actually doing self-inserts > > % echo <ESC>`a > > # <ESC> changes to vicmd mode > > # `a is suppose to go to mark 'a' from the previous line, but in > > the latest version it doesn't seem to work. It look like it has been > > broken for more than a year in 4.3.0 > > > > -FR. > > > > > I just verified it works in 4.2.3 (which comes with Apple OS X) and not > with my 4.3.2 > > Also broken in Gentoo, 4.3.2. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Problems with vi-goto-mark and vi-set-mark 2007-04-15 16:49 ` Problems with vi-goto-mark and vi-set-mark Felix Rosencrantz 2007-04-15 18:14 ` William Scott @ 2007-04-15 19:53 ` Peter Stephenson 2007-04-15 20:59 ` fREW 2007-04-16 14:58 ` Felix Rosencrantz 1 sibling, 2 replies; 9+ messages in thread From: Peter Stephenson @ 2007-04-15 19:53 UTC (permalink / raw) To: Zsh users list "Felix Rosencrantz" wrote: > I've recently been trying to use viins/vicmd mode. I've hit a small > problem with the vi-set-mark and vi-goto-mark, they seem to be broken > in the latest version of zsh. Though it looks like it was working in > 4.2.5. Yes, I don't use vi mode so don't notice this sort of thing. We could do with someone writing interactive tests for zle commands. We could also do with someone to look after vi mode. We could do with people doing a lot of things. The change is that getchar() used not to set the last character, which was done at a higher level, but the replacements which support multibyte do (even if multibyte mode isn't compiled in). This means the character read is always treated as if it was the same as the last character. I think the following fixes it, but I'm not sure what the feature is in vi-goto-mark that has the special behaviour if the last character is repeated. If you know and can test it, please do. Index: Src/Zle/zle.h =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Zle/zle.h,v retrieving revision 1.34 diff -u -r1.34 zle.h --- Src/Zle/zle.h 3 Dec 2006 21:07:18 -0000 1.34 +++ Src/Zle/zle.h 15 Apr 2007 19:22:16 -0000 @@ -72,6 +72,7 @@ #define ZC_toupper towupper #define LASTFULLCHAR lastchar_wide +#define LASTFULLCHAR_T ZLE_INT_T #else /* Not MULTIBYTE_SUPPORT: old single-byte code */ @@ -130,6 +131,7 @@ #define ZC_toupper tuupper #define LASTFULLCHAR lastchar +#define LASTFULLCHAR_T int #endif Index: Src/Zle/zle_move.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_move.c,v retrieving revision 1.8 diff -u -r1.8 zle_move.c --- Src/Zle/zle_move.c 1 Nov 2005 02:50:29 -0000 1.8 +++ Src/Zle/zle_move.c 15 Apr 2007 19:22:16 -0000 @@ -484,9 +484,10 @@ vigotomark(UNUSED(char **args)) { ZLE_INT_T ch; + LASTFULLCHAR_T lfc = LASTFULLCHAR; ch = getfullchar(0); - if (ch == LASTFULLCHAR) + if (ch == lfc) ch = 26; else { if (ch < ZWC('a') || ch > ZWC('z')) -- Peter Stephenson <p.w.stephenson@ntlworld.com> Web page now at http://homepage.ntlworld.com/p.w.stephenson/ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Problems with vi-goto-mark and vi-set-mark 2007-04-15 19:53 ` Peter Stephenson @ 2007-04-15 20:59 ` fREW 2007-04-15 22:16 ` Peter Stephenson 2007-04-16 14:58 ` Felix Rosencrantz 1 sibling, 1 reply; 9+ messages in thread From: fREW @ 2007-04-15 20:59 UTC (permalink / raw) To: Peter Stephenson; +Cc: Zsh users list On 4/15/07, Peter Stephenson <p.w.stephenson@ntlworld.com> wrote: > "Felix Rosencrantz" wrote: > > I've recently been trying to use viins/vicmd mode. I've hit a small > > problem with the vi-set-mark and vi-goto-mark, they seem to be broken > > in the latest version of zsh. Though it looks like it was working in > > 4.2.5. > > Yes, I don't use vi mode so don't notice this sort of thing. We could > do with someone writing interactive tests for zle commands. We could > also do with someone to look after vi mode. We could do with people > doing a lot of things. > > The change is that getchar() used not to set the last character, which > was done at a higher level, but the replacements which support multibyte > do (even if multibyte mode isn't compiled in). This means the character > read is always treated as if it was the same as the last character. > > I think the following fixes it, but I'm not sure what the feature is in > vi-goto-mark that has the special behaviour if the last character is > repeated. If you know and can test it, please do. > > Index: Src/Zle/zle.h > =================================================================== > RCS file: /cvsroot/zsh/zsh/Src/Zle/zle.h,v > retrieving revision 1.34 > diff -u -r1.34 zle.h > --- Src/Zle/zle.h 3 Dec 2006 21:07:18 -0000 1.34 > +++ Src/Zle/zle.h 15 Apr 2007 19:22:16 -0000 > @@ -72,6 +72,7 @@ > #define ZC_toupper towupper > > #define LASTFULLCHAR lastchar_wide > +#define LASTFULLCHAR_T ZLE_INT_T > > #else /* Not MULTIBYTE_SUPPORT: old single-byte code */ > > @@ -130,6 +131,7 @@ > #define ZC_toupper tuupper > > #define LASTFULLCHAR lastchar > +#define LASTFULLCHAR_T int > > #endif > > Index: Src/Zle/zle_move.c > =================================================================== > RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_move.c,v > retrieving revision 1.8 > diff -u -r1.8 zle_move.c > --- Src/Zle/zle_move.c 1 Nov 2005 02:50:29 -0000 1.8 > +++ Src/Zle/zle_move.c 15 Apr 2007 19:22:16 -0000 > @@ -484,9 +484,10 @@ > vigotomark(UNUSED(char **args)) > { > ZLE_INT_T ch; > + LASTFULLCHAR_T lfc = LASTFULLCHAR; > > ch = getfullchar(0); > - if (ch == LASTFULLCHAR) > + if (ch == lfc) > ch = 26; > else { > if (ch < ZWC('a') || ch > ZWC('z')) > > -- > Peter Stephenson <p.w.stephenson@ntlworld.com> > Web page now at http://homepage.ntlworld.com/p.w.stephenson/ > Do you have any examples of how one could make zle unit tests? I would gladly do it depending on how much time I end up having this summer. -fREW ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Problems with vi-goto-mark and vi-set-mark 2007-04-15 20:59 ` fREW @ 2007-04-15 22:16 ` Peter Stephenson 0 siblings, 0 replies; 9+ messages in thread From: Peter Stephenson @ 2007-04-15 22:16 UTC (permalink / raw) To: Zsh users list, pws fREW wrote: > Do you have any examples of how one could make zle unit tests? I > would gladly do it depending on how much time I end up having this > summer. Thanks for the offer. It should "simply" be a case of taking the code that tests completion and making a version for general editing tests. See Test/comptest for the functions used and the Test/Y* tests for how the functions in comptest are used. Although the results should be simpler than comptest, it might not be very clear what's going on in comptest and hence what needs taking out. The zpty calls are the key to it; they interact with a subshell in a pseudoterminal, which where the tests run. A lot of the rest is configuration to make the results visible (which will still be needed). Any basically working system for general zle tests, even without the tests themselves, would be extremely good to have. -- Peter Stephenson <p.w.stephenson@ntlworld.com> Web page now at http://homepage.ntlworld.com/p.w.stephenson/ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Problems with vi-goto-mark and vi-set-mark 2007-04-15 19:53 ` Peter Stephenson 2007-04-15 20:59 ` fREW @ 2007-04-16 14:58 ` Felix Rosencrantz 1 sibling, 0 replies; 9+ messages in thread From: Felix Rosencrantz @ 2007-04-16 14:58 UTC (permalink / raw) To: Peter Stephenson; +Cc: Zsh users list Thanks for the patch, Peter. It seems to be working better now. Though there does seem to be some oddness when trying multiple vi-goto-mark-line and then doing a vi-goto-mark for the same mark. Though not sure, will need to come up with a reproducible case. -FR. On 4/15/07, Peter Stephenson <p.w.stephenson@ntlworld.com> wrote: > "Felix Rosencrantz" wrote: > > I've recently been trying to use viins/vicmd mode. I've hit a small > > problem with the vi-set-mark and vi-goto-mark, they seem to be broken > > in the latest version of zsh. Though it looks like it was working in > > 4.2.5. > > Yes, I don't use vi mode so don't notice this sort of thing. We could > do with someone writing interactive tests for zle commands. We could > also do with someone to look after vi mode. We could do with people > doing a lot of things. > > The change is that getchar() used not to set the last character, which > was done at a higher level, but the replacements which support multibyte > do (even if multibyte mode isn't compiled in). This means the character > read is always treated as if it was the same as the last character. > > I think the following fixes it, but I'm not sure what the feature is in > vi-goto-mark that has the special behaviour if the last character is > repeated. If you know and can test it, please do. > > Index: Src/Zle/zle.h > =================================================================== > RCS file: /cvsroot/zsh/zsh/Src/Zle/zle.h,v > retrieving revision 1.34 > diff -u -r1.34 zle.h > --- Src/Zle/zle.h 3 Dec 2006 21:07:18 -0000 1.34 > +++ Src/Zle/zle.h 15 Apr 2007 19:22:16 -0000 > @@ -72,6 +72,7 @@ > #define ZC_toupper towupper > > #define LASTFULLCHAR lastchar_wide > +#define LASTFULLCHAR_T ZLE_INT_T > > #else /* Not MULTIBYTE_SUPPORT: old single-byte code */ > > @@ -130,6 +131,7 @@ > #define ZC_toupper tuupper > > #define LASTFULLCHAR lastchar > +#define LASTFULLCHAR_T int > > #endif > > Index: Src/Zle/zle_move.c > =================================================================== > RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_move.c,v > retrieving revision 1.8 > diff -u -r1.8 zle_move.c > --- Src/Zle/zle_move.c 1 Nov 2005 02:50:29 -0000 1.8 > +++ Src/Zle/zle_move.c 15 Apr 2007 19:22:16 -0000 > @@ -484,9 +484,10 @@ > vigotomark(UNUSED(char **args)) > { > ZLE_INT_T ch; > + LASTFULLCHAR_T lfc = LASTFULLCHAR; > > ch = getfullchar(0); > - if (ch == LASTFULLCHAR) > + if (ch == lfc) > ch = 26; > else { > if (ch < ZWC('a') || ch > ZWC('z')) > > -- > Peter Stephenson <p.w.stephenson@ntlworld.com> > Web page now at http://homepage.ntlworld.com/p.w.stephenson/ > ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re Google Summer of Code.... @ 2007-04-16 14:45 ` Felix Rosencrantz 2007-04-16 16:24 ` Peter Stephenson 0 siblings, 1 reply; 9+ messages in thread From: Felix Rosencrantz @ 2007-04-16 14:45 UTC (permalink / raw) To: Peter Stephenson; +Cc: Zsh users list On 4/15/07, Peter Stephenson <p.w.stephenson@ntlworld.com> wrote: > Yes, I don't use vi mode so don't notice this sort of thing. We could > do with someone writing interactive tests for zle commands. We could > also do with someone to look after vi mode. We could do with people > doing a lot of things. It's looks like it is too late for 2007, but maybe we could get a 2008 SOC intern to help with zsh. I mentioned this about a year ago. I know in past years, they've had an intern work on Bash. Also, Zsh has had a strong history of student participation. It was originally written by Paul Falstad while as student at Princeton. I believe Sven worked on the bulk of the new completion system while being a student. I'm sure there have been other serious student contributors who have helped, whose contribution was significant, though I can't name them. http://code.google.com/soc/ One of the things we would need to do is create a list of project ideas (if one doesn't already exist). Which might be useful in general for folks who would be interesting in helping out. It seems like there might be interest in helping from folks -FR. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Re Google Summer of Code.... 2007-04-16 14:45 ` Re Google Summer of Code Felix Rosencrantz @ 2007-04-16 16:24 ` Peter Stephenson 0 siblings, 0 replies; 9+ messages in thread From: Peter Stephenson @ 2007-04-16 16:24 UTC (permalink / raw) To: Zsh users list "Felix Rosencrantz" wrote: > It's looks like it is too late for 2007, but maybe we could get a 2008 > SOC intern to help with zsh. I mentioned this about a year ago. I > know in past years, they've had an intern work on Bash. It would be useful, although the zsh code is quite difficult to come to cold, particularly the areas that really need the work. The project would probably need quite a lot of supervision. -- Peter Stephenson <p.w.stephenson@ntlworld.com> Web page now at http://homepage.ntlworld.com/p.w.stephenson/ ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2007-04-16 15:58 UTC | newest] Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <f.rosencrantz@gmail.com> 2007-04-15 16:49 ` Problems with vi-goto-mark and vi-set-mark Felix Rosencrantz 2007-04-15 18:14 ` William Scott 2007-04-15 18:48 ` fREW 2007-04-15 19:53 ` Peter Stephenson 2007-04-15 20:59 ` fREW 2007-04-15 22:16 ` Peter Stephenson 2007-04-16 14:58 ` Felix Rosencrantz 2007-04-16 14:45 ` Re Google Summer of Code Felix Rosencrantz 2007-04-16 16:24 ` Peter Stephenson
Code repositories for project(s) associated with this public inbox https://git.vuxu.org/mirror/zsh/ This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).