[scintilla] [patch] added SC_LINE_END_TYPE_NONE

3 views
Skip to first unread message

Robin Haberkorn

unread,
11:18 AM (10 hours ago) 11:18 AM
to scintilla...@googlegroups.com
Dear Scintilla hackers,

here's a patch that adds a new SC_LINE_END_TYPE_NONE,
which disables the special treatment of EOL characters.
When enabled, Scintilla will lay out the entire document
on a single line.
After SCI_SETLINEENDTYPESALLOWED(SC_LINE_END_TYPE_NONE)
LF and CR are rendered by their character representations.

I am using this to turn Scintilla into a command-line
widget for SciTECO, where command-lines are not terminated
by Enter and may have to fit into a single line.
It might also be useful to turn Scintilla into a kind of
hex-editor in combination with character representations.
However, in my experience excessively long lines cannot
be layed out efficiently. This is also noticable when
having very long documents *without* any line breaks at all.
That's not yet been a roadblock in the command-line use case
for me, though.

I am aware that this feature might not be of interest
to many people, so if necessary I will permanently
maintain it as a patch in my Scintilla fork.

Best regards,
Robin
0001-added-SC_LINE_END_TYPE_NONE-allows-ignoring-all-line.patch
signature.asc

Neil Hodgson

unread,
4:59 PM (4 hours ago) 4:59 PM
to scintilla...@googlegroups.com
Robin Haberkorn:

> here's a patch that adds a new SC_LINE_END_TYPE_NONE,
> which disables the special treatment of EOL characters.
> When enabled, Scintilla will lay out the entire document
> on a single line.

The purpose of the LineEndTypesSupported method is to allow lexers to
*opt in* to new forms of line end. This is required because the line
structure of files is an important element in how they are lexed.
Lexers often store data about portions of the file indexed by line
number and this may be desynchronized when they encounter unexpected
line end modes.

The patch forces allowing LineEndType::None in many different cases as
it becomes the default. LineEndType::Default is the option that each
lexer has been written to and tested with in the past and should
continue to be the default unless a lexer specifically opts in to
allowing LineEndType::None.

> I am using this to turn Scintilla into a command-line
> widget for SciTECO, where command-lines are not terminated
> by Enter and may have to fit into a single line.

That sounds like it only needs to be turned on for the "null" lexer.

I have only looked at this a little and there may be further issues.

Neil
Reply all
Reply to author
Forward
0 new messages