Re: Improve word boundaries for text widgets

On Fri, Sep 26, 2014 at 7:37 PM, Christian Hergert <christian hergert me> wrote:

Another idea for GtkTextView is to add a vfunc to let GtkSourceView
define custom word boundaries for word movements and selection. But
all what GtkSourceView would do is to define the "Vim" word boundaries,
which are generic. The Vim word boundaries are good enough, we don't
need more flexibility. So I prefer to implement directly the Vim word
boundaries in GTK+, and have a consistent behavior with other widgets.

I would really like this to be a vfunc so that it could be handled by
per-language overrides in GtkSourceView/GtkSourceLanguage.

Additionally, I'd like double-click and triple-click to be different
things. Imagine triple-click selecting the whole scope in some C code
for example.

I agree that we probably need a vfunc - there's different use cases
that need different variants: natural language, code, xml, etc. For
best results, we may even want a way to use different word breaking
rules in different regions of the buffer. As an example, you might
have comments embedded in code.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]