Re: What's the "Hangul shaper"? Sounds like a power tool...



Havoc Pennington:
> "Neil Hodgson" <nhodgson bigpond net au> writes:
> >    Not only is it Broken On Purpose but some Tk users insist it is the
Right
> > Thing To Do, to the extent that they want this behaviour added to
Scintilla,
> > my text widget. So if you do fix it, you should probably make the fix
> > conditional.
> >
>
> Do they have a decent rationale for the behavior? If so I'm happy to
> declare it a feature. ;-)

   There is the idea that a text file is a sequence of lines each terminated
with a line terminator - the old terminator versus separator ideological
split. I was told that C's standard IO library is permitted to, and some
implementations do, insert a final newline at the end of files in order to
maintain this concept.

   In the Python IDE world, there is some shared code, originally between
IDLE (Tk text widget) and PythonWin (Scintilla based), and more recently
used more widely. This code assumes Tk's view of the final newline so
various hacks are applied to bridge the gap. Continuing to provide Tk
semantics in the GTK+ text widget will help porting code to it.

> Skip I'm thinking this morning that one hard thing about the change is
> that the TextView always has to _display_ a single line, so you have
> somewhere to put the cursor, even if there are no lines. I think the
> display code pukes all over the place when you have zero lines.

   That is one of the reasons given. However my view is that if a file
contains a newline, then it should be possible to place the caret both
before and after that newline so there are two lines in the file. So I see a
file as containing one more line than the number of newline characters or
newline character sequences. Then, a file always contains at least one line.

   Neil





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