Re: spacial



Hi,

> On Fri, 2004-04-30 at 13:40 +0200, Murray Cumming wrote:
> > On Fri, 2004-04-30 at 13:26, Rodrigo Moya wrote:
> > > On Fri, 2004-04-30 at 13:14 +0200, Murray Cumming wrote:
> > > I was not talking about 2 sets of changes, just 2 views of the same
> > > file. Modifications go to both, but you can have one view on line 100
> > > and the other on line 10000. Just like emacs does.
> > 
> > OK, so the document is really only open once, though the distinction is
> > vague.
> > 
> > To do the same thing, gedit would need to access the data used by the
> > first instance when it opens the second instance. That sounds like a lot
> > of work.
> >  
> really? If gedit uses gtksourceview, which is, AFAIK, just a GtkTextView
> with syntax highlighting, it could perfectly use the same GtkTextModel
> for both views. Or am I missing something?

Yep, you are right, gedit uses gtksourceview, and so it theoretically could support 
multiple views of a single document.
The reason I have not enabled this feature in gedit (even if the code mostly supports it) 
is that I think the way multiple-views work in GtkTextView/GtkTextBuffer is not very intuitive.
As you can see trying gtk-demo, you cannot, for example, have the cursor at line 10 in view 1
and the cursor at line 20 in view 2, because the cursor position is implemented as a model attribute
(I think it should be a view one). For the same reason you cannot select a piece of text in view 1
and another piece of text in view 2. Or you cannot enable syntax highlight in view 2 and disable it
in view 2, etc.
Note that these problems cannot be fixed without rewriting a lot of code in GtkTextView/GtkTextBuffer.

Ciao,
Paolo

P.S. See also bug #141487





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