Re: [dev] another text user interface for sam

From: Maxime Coste <frrrwww_AT_gmail.com>
Date: Wed, 2 Mar 2016 18:26:23 +0000

On Wed, Mar 02, 2016 at 04:16:02PM +0000, Connor Lane Smith wrote:
> On 2 March 2016 at 15:45, Maxime Coste <frrrwww_AT_gmail.com> wrote:
> > How does sam handles parallel grouping when we get multiple incompatible changes
> > to the same range of text ?
>
> It panics.
>
> Incidentally, I notice that Kakoune uses Boost's regular expressions,
> which means that reverse searches are very inefficient. That's rather
> unfortunate. Have you considered using an alternative regular
> expression library, if there were one with the necessary features
> (like we've been discussing)?

Yeah, I'd really like to get rid of boost, and possibly migrate to a
lighter regex lib. The problem is that no currently available libs match
the required feature set:

 * iterator based, or at least multi segment matching (I have each line as a
   separate string, but regex should see the buffer as a long byte string,
   I do not want to concatenate the whole buffer for regex searches).

 * support lookaheads and lookbehinds, until I find a clean, alternative way
   to express 'a double quote that is not preceeded by a pair number of
   antislash' to match the closers of C strings (as an example of their
   current usage)

 * A few other features that proved very useful in practice, but might
   be avoided:

   - \h for horizontal whitespaces, very handy whenever you match on
     multiple lines and \s does not do the trick anymore.

   - \K that provides a nice way to avoid lookbehinds in many cases

   - \` and \' (also named \A and \Z) to match start and end of subject string

standard c++ regex do provide an iterator based interface, but no lookbehinds,
no \h \K, \` or \'.

In my experience, we dont need a very powerful (and complex) regex language
for interactive use, its mostly the highlighting system that needs them,
so a refactoring of the highlighting system might be a good way to reduce
the number of needed features.

Cheers,

Maxime.
Received on Wed Mar 02 2016 - 19:26:23 CET

This archive was generated by hypermail 2.3.0 : Wed Mar 02 2016 - 19:36:13 CET