Re: Off-topic (or not) :sort

2014-06-26 Fir de Conversatie Bram Moolenaar
Ben Fritz wrote: > On Tuesday, June 24, 2014 10:39:28 AM UTC-5, Ben Fritz wrote: > > > > I thought your sort could be done in Vim with 2 passes, but unfortunately > > it does not work: > > > > sort r /^\d\+/ > > sort! /.*#/ > > Bram, any chance that a way to guarantee a stable sort could be >

Re: Off-topic (or not) :sort

2014-06-26 Fir de Conversatie Bram Moolenaar
Ben Fritz wrote: > On Thursday, June 26, 2014 11:48:53 AM UTC-5, Jun T. wrote: > > 2014/06/26 23:09, Ben Fritz wrote: > > > Could this be fixed, by using (l2.lnum - l1.lnum) rather than > > > (l1.lnum - l2.lnum) if lines are equal, when using reverse sort? > > > > Well... the change is easy (se

Re: Off-topic (or not) :sort

2014-06-26 Fir de Conversatie Bram Moolenaar
Jun Takimoto wrote: > 2014/06/26 01:07, Ben Fritz wrote: > > > On Tuesday, June 24, 2014 10:39:28 AM UTC-5, Ben Fritz wrote: > >> > >> I thought your sort could be done in Vim with 2 passes, but > >> unfortunately it does not work: > >> > >> sort r /^\d\+/ > >> sort! /.*#/ > >> > > > > Bram

Re: Off-topic (or not) :sort

2014-06-26 Fir de Conversatie Ben Fritz
On Thursday, June 26, 2014 11:48:53 AM UTC-5, Jun T. wrote: > 2014/06/26 23:09, Ben Fritz wrote: > > > Could this be fixed, by using (l2.lnum - l1.lnum) rather than > > > (l1.lnum - l2.lnum) if lines are equal, when using reverse sort? > > > > Well... the change is easy (see the patch below),

Re: Off-topic (or not) :sort

2014-06-26 Fir de Conversatie Jun T.
2014/06/26 23:09, Ben Fritz wrote: > Could this be fixed, by using (l2.lnum - l1.lnum) rather than > (l1.lnum - l2.lnum) if lines are equal, when using reverse sort? Well... the change is easy (see the patch below), but I think the current behavior of :sort! is a 'feature', not a bug. Changing i

Re: Off-topic (or not) :sort

2014-06-26 Fir de Conversatie Ben Fritz
On Thursday, June 26, 2014 8:06:34 AM UTC-5, Jun T. wrote: > 2014/06/26 01:07, Ben Fritz wrote: > > > On Tuesday, June 24, 2014 10:39:28 AM UTC-5, Ben Fritz wrote: > >> > >> I thought your sort could be done in Vim with 2 passes, but unfortunately > >> it does not work: > >> > >> sort r /^\d\+

Re: Off-topic (or not) :sort

2014-06-26 Fir de Conversatie Jun T.
2014/06/26 01:07, Ben Fritz wrote: > On Tuesday, June 24, 2014 10:39:28 AM UTC-5, Ben Fritz wrote: >> >> I thought your sort could be done in Vim with 2 passes, but unfortunately it >> does not work: >> >> sort r /^\d\+/ >> sort! /.*#/ >> > > Bram, any chance that a way to guarantee a stable

Re: Off-topic (or not) :sort

2014-06-25 Fir de Conversatie Christian Brabandt
Hi Bram! On Mi, 25 Jun 2014, Bram Moolenaar wrote: > > +/* pattern did not match in any line, skip sorting */ > > +if (skip_sort == eap->line2) > > + goto sortend; > > I don't think this works when eap->line1 is not 1, sorting a range of > lines. Indeed. Here is the correct version.

Re: Off-topic (or not) :sort

2014-06-25 Fir de Conversatie Ben Fritz
On Tuesday, June 24, 2014 10:39:28 AM UTC-5, Ben Fritz wrote: > > I thought your sort could be done in Vim with 2 passes, but unfortunately it > does not work: > > sort r /^\d\+/ > sort! /.*#/ > Bram, any chance that a way to guarantee a stable sort could be included, so sorting by multiple f

Re: Off-topic (or not) :sort

2014-06-25 Fir de Conversatie lilydjwg
On Tue, Jun 24, 2014 at 05:52:10AM -0700, Axel Bender wrote: > @Ben Fritz > > As I see it, you can use a search pattern (r) for certain tasks, but it isn't > a solution. Please, consider the following sample: > > 19500623 # ÖST # USA # Curitiba > 19500621 # ÖST # MEX # Macapa > 19500825 # AND #

Re: Off-topic (or not) :sort

2014-06-25 Fir de Conversatie Bram Moolenaar
Christian Brabandt wrote: > On Di, 24 Jun 2014, Christian Brabandt wrote: > > > On Di, 24 Jun 2014, Axel Bender wrote: > > > > > Does anyone know a UTF-8-aware (respecting $LC_ALL and/or $LANGUAGE) sort > > > tool for Windows (GNUWin32's doesn't work), preferably a working GNU sort > > > that

Re: Off-topic (or not) :sort

2014-06-24 Fir de Conversatie Christian Brabandt
On Di, 24 Jun 2014, Christian Brabandt wrote: > On Di, 24 Jun 2014, Axel Bender wrote: > > > Does anyone know a UTF-8-aware (respecting $LC_ALL and/or $LANGUAGE) sort > > tool for Windows (GNUWin32's doesn't work), preferably a working GNU sort > > that does the job? [OFF-TOPIC] > > Cygwin, Ms

Re: Off-topic (or not) :sort

2014-06-24 Fir de Conversatie Benoit Pierre
On Tue, Jun 24, 2014 at 8:06 PM, Christian Brabandt wrote: > On Di, 24 Jun 2014, Axel Bender wrote: > >> Does anyone know a UTF-8-aware (respecting $LC_ALL and/or $LANGUAGE) sort >> tool for Windows (GNUWin32's doesn't work), preferably a working GNU sort >> that does the job? [OFF-TOPIC] > > Cy

Re: Off-topic (or not) :sort

2014-06-24 Fir de Conversatie Christian Brabandt
On Di, 24 Jun 2014, Axel Bender wrote: > Does anyone know a UTF-8-aware (respecting $LC_ALL and/or $LANGUAGE) sort > tool for Windows (GNUWin32's doesn't work), preferably a working GNU sort > that does the job? [OFF-TOPIC] Cygwin, Msys, Interix? Not sure, but not sure, which one does support

Re: Off-topic (or not) :sort

2014-06-24 Fir de Conversatie Ben Fritz
On Tuesday, June 24, 2014 7:52:10 AM UTC-5, Axel Bender wrote: > @Ben Fritz > > > > As I see it, you can use a search pattern (r) for certain tasks, but it isn't > a solution. Please, consider the following sample: > > > > 19500623 # ÖST # USA # Curitiba > > 19500621 # ÖST # MEX # Macapa >

Re: Off-topic (or not) :sort

2014-06-24 Fir de Conversatie Axel Bender
@Ben Fritz As I see it, you can use a search pattern (r) for certain tasks, but it isn't a solution. Please, consider the following sample: 19500623 # ÖST # USA # Curitiba 19500621 # ÖST # MEX # Macapa 19500825 # AND # FRA # Curitiba 19500620 # MEX # BRA # Recife 19500625 # BEL # FRA # Curitiba

Re: Off-topic (or not) :sort

2014-06-24 Fir de Conversatie Ben Fritz
On Tuesday, June 24, 2014 6:44:19 AM UTC-5, Axel Bender wrote: > Does anyone know a UTF-8-aware (respecting $LC_ALL and/or $LANGUAGE) sort > tool for Windows (GNUWin32's doesn't work), preferably a working GNU sort > that does the job? [OFF-TOPIC] > > It would be a nice idea [NO LONGER OFF-TOPIC

Off-topic (or not) :sort

2014-06-24 Fir de Conversatie Axel Bender
Does anyone know a UTF-8-aware (respecting $LC_ALL and/or $LANGUAGE) sort tool for Windows (GNUWin32's doesn't work), preferably a working GNU sort that does the job? [OFF-TOPIC] It would be a nice idea [NO LONGER OFF-TOPIC] to add the possibility to add sort columns (like in GNU's --key=.) to