cached->id => cached->cache_id
document->id => document->cache_id
onload_snippets_owner => onload_snippets_document_id
Added the distinct document->document_id.
Always reset ecmascript when a document changes for example a next chunk
of it is loaded.
In the previous version, the first event that had KBD_MOD_PASTE
entered insert mode and was consumed for that; ELinks then inserted
the characters from the remaining events. Now, to make ELinks insert
the first character too, I'm changing things so that KBD_MOD_PASTE
does not cause insert mode to be entered; instead, ELinks inserts
those characters regardless of whether insert mode is on.
in move-link-left-line and others, so move-link-left-line ans others
do not use the keyboard prefix.
(cherry picked from commit 8b281e1404)
(cherry picked from commit 4f2a9eadfc)
Go to the page with a few lines. Follow a link to a page with more lines.
Move cursor down, do not stay on a link.
Go back and do move-link-prev-line. This caused a segmentation fault.
(cherry picked from commit 888ba87516)
(cherry picked from commit 1cbd02c141)
Change mode to NAVIGATE_LINKWISE to preserve the link position when
going back.
(cherry picked from commit 14b37d0362)
(cherry picked from commit a594b2a002)
move-link-down-line moves the cursor down to the line with a link.
move-link-up-line moves the cursor up to the line with a link.
move-link-prev-line moves to the previous link horizontally.
move-link-next-line moves to the next link horizontally.
(cherry picked from commit 8259a56e99)
(cherry picked from commit 2eb3532416)
Go to the page with a few lines. Follow a link to a page with more lines.
Move cursor down, do not stay on a link.
Go back and do move-link-prev-line. This caused a segmentation fault.
(cherry picked from commit 888ba87516)
move-link-down-line moves the cursor down to the line with a link.
move-link-up-line moves the cursor up to the line with a link.
move-link-prev-line moves to the previous link horizontally.
move-link-next-line moves to the next link horizontally.
(cherry picked from commit 8259a56e99)
start_document_refreshes() performs the NULL-pointer checks that
previously all callers to start_document_refresh() must perform
and then calls start_document_refresh().
start_document_refreshes performs the NULL-pointer checks that previously all callers to start_document_refresh must perform and then calls start_document_refresh.
Added EVENT_TEXTAREA used to notify the master terminal
about end of execution of an external program on a slave terminal.
The format of data sent to the master terminal by exec_on_slave_terminal
has changed. Now after 0, fg the value of term is sent.
Therfore this release of ELinks is incompatible with previous releases.
Patch by Witold Filipczyk, taken from his witekfl branch.
Conflicts:
src/viewer/text/textarea.c
Pass the session with some get_opt_* calls. These are the low-hanging fruit. Some places will be difficult because we don't have the session or for other reasons.
Update a comment in encode_multipart, which refers to html_form_control, which has since been renamed to html_special_form_control.
The comment was added with this commit:
commit b4dee890a61a6c8a27a8e4cd1dc3b3b93f1cdb08
Author: Petr Baudis <pasky@ucw.cz>
Date: Fri May 10 13:26:55 2002 +0000
Don't decode and back encode hidden form items (by mikulas, from 0.97).
The function was renamed with this commit:
commit c9d72739c715b3b0c7c6fec582780c1e8f444fc4
Author: Petr Baudis <pasky@ucw.cz>
Date: Sat Dec 18 02:22:28 2004 +0000
html_(tag|form*) -> html_special_\1, to naming prevent conflicts with HTML element handlers. As suggested by Jonas.
I don't remember why I cleared "returns", but it doesn't work
with www.hypermedia.pl/altkom/ and probably with many more sites.
[ From commit e887efc611 on the witekfl
branch. --KON ]
Use it for the actual I/O only. Previously, defining CONFIG_UTF8 and
enabling UTF-8 used to force many strings to the UTF-8 charset
regardless of the terminal charset option. Now, those strings always
follow the terminal charset. This fixes bug 914 which was caused
because _() returned strings in the terminal charset and functions
then assumed they were in UTF-8. This reduction in the effects of
UTF-8 I/O may also simplify future testing.
Previously, html_special_form_control converted
form_control.default_value to the terminal charset, and init_form_state
then copied the value to form_state.value. However, when CONFIG_UTF8
is defined and UTF-8 I/O is enabled, form_state.value is supposed to
be in UTF-8, rather than in the terminal charset.
This mismatch could not be conveniently fixed in
html_special_form_control because that does not know which terminal is
being used and whether UTF-8 I/O is enabled there. Also, constructing
a conversion table from the document charset to form_state.value could
have ruined renderer_context.convert_table, because src/intl/charsets.c
does not support multiple concurrent conversion tables.
So instead, we now keep form_control.default_value in the document
charset, and convert it in the viewer each time it is needed. Because
the result of the conversion is kept in form_state.value between
incremental renderings, this shouldn't even slow things down too much.
I am not implementing the proper charset conversions for the DOM
defaultValue property yet, because the current code doesn't have
them for other string properties either, and bug 805 is already open
for that.
I am going make fc->default_value use the charset of the document, and
recoding the string from the form history to that might lose characters.
This change also affects what ECMAScript sees in the defaultValue property.
<http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html#ID-26091157>
says it should represent the HTML "value" attribute, so changing it
based on form history is not appropriate.
straconcat reads the args with va_arg(ap, const unsigned char *),
and the NULL macro may have the wrong type (e.g. int).
Many places pass string literals of type char * to straconcat. This
is in principle also a violation, but I'm ignoring it for now because
if it becomes a problem with some C implementation, then so will the
use of unsigned char * with printf "%s", which is so widespread in
ELinks that I'm not going to try fixing it now.
In goto_mark, copy the current_link of the old view state to the
old_current_link of the new view state so that clear_link will properly
clear the highlight for that link.
This fixes a bug introduced with the removal of link_bg in commit
c91c763d49.
This allows code to use document->cached instead of
find_in_cache(document->uri), thereby increasing the likelihood
of getting the correct cache entry.
This should fix Bug 756 - "assertion (cached)->object.refcount >= 0 failed"
after HTTP proxy was changed.
Patches for this were written by me and then later by Jonas.
This commit combines our independent implementations.
As draw_textarea_utf8 loops over each character of the textarea content, it
checks whether the character is on the screen; draws it if so; increments
the screen co-ordinate; and updates the position in the textarea text.
The last step was being skipped when the character was not on the line,
so a line would be drawn from the beginning, even if the left edge of the
textarea is off the screen.
Closes: Bug 835 - Text in textarea is unaffected by horizontal scrolling of
document in UTF-8 mode
If utf8_char2cells isn't told where the string that contains
the given UTF-8 character ends, it computes that itself. Two users
of utf8_char2cells, format_textutf8 and split_line, were calling
utf8_char2cells in a loop without providing the end of the string,
resulting in numerous calls by utf8_char2cells to strlen.
With this patch, format_textutf8 and split_line each find the end
of the string once and provide it to utf8_char2cells.
This particularly improves performance with textareas, since
format_textutf8 is called multiple times each time the user interacts
with the textarea and when it must be redrawn.
Closes: Bug 823 - Big textarea is too slow with CONFIG_UTF8
UCS_ORPHAN_CELL is currently defined as U+0020 SPACE, which was
already used before this macro, so the behaviour does not change,
but the code seems clearer now.
I searched for ' ' and 32 and 0x20 and \x20, and replaced with
UCS_ORPHAN_CELL wherever UCS_NO_CHAR was involved. However,
some BFU widgets first draw spaces and then overwrite with text;
those will require a more complex fix if UCS_ORPHAN_CELL is ever
changed to some other character.
The configure script no longer recognizes "CONFIG_UTF_8=yes" lines
in custom features.conf files. They will have to be changed to
"CONFIG_UTF8=yes". This incompatibility was deemed acceptable
because no released version of ELinks supports CONFIG_UTF_8.
The --enable-utf-8 option was not renamed.
Suggested by Miciah on #elinks.
What was renamed:
add_utf_8 => add_utf8
cp2utf_8 => cp2utf8
encode_utf_8 => encode_utf8
get_translation_table_to_utf_8 => get_translation_table_to_utf8
goto invalid_utf_8_start_byte => goto invalid_utf8_start_byte
goto utf_8 => goto utf8
goto utf_8_select => goto utf8_select
terminal_interlink.utf_8 => terminal_interlink.utf8
utf_8_to_unicode => utf8_to_unicode
What was not renamed:
terminal._template_.utf_8_io option, TERM_OPT_UTF_8_IO
Compatibility with existing elinks.conf files would require an alias.
--enable-utf-8
Because the name of the charset is UTF-8, --enable-utf-8 looks better
than --enable-utf8.
CONFIG_UTF_8
Will be renamed in a later commit.
Unicode/utf_8.cp, table_utf_8, aliases_utf_8
Will be renamed in a later commit.
form_state.state_cell is no longer used for FC_TEXT, FC_PASSWORD, nor FC_FILE.
Instead, get_link_cursor_offset() computes the cell with utf8_ptr2chars
(a new function) or utf8_ptr2cells. This shouldn't slow down ELinks too
much, as it's done only for the selected link and only once per redraw.
The left side of a scrolled input field is always aligned at a
character boundary. The right side might not be.
The new comments describe how the members were apparently intended to
be used. However, the implementation does not actually work when
CONFIG_UTF_8 is defined, and the current semantics do not even allow
an efficient implementation of long (mostly scrolled out) strings.
Actions can now be bound to e.g. Ctrl-Alt-A. The keybinding code also
supports other combinations of modifiers, like Shift-Ctrl-Up, but the
escape sequence decoder doesn't yet.
Don't let Ctrl-Alt-letter combinations open menus.
The cast is not necessary since we already check the bounds, but by using a
cast here, it hopefully makes it more obvious what the long comment above
is pointing out: namely that we put the value of a signed integer into an
unsigned char.
This requires compiling cp2u() in even without CONFIG_UTF_8.
I also added an is_kbd_character macro to make try_document_key
more resilient to changes in the definition of term_event_key_T.
The previous version used only the low 8 bits of the key code.
This one arranges for the whole key to be rejected if it's not ASCII.
Perhaps the modifiers should be checked too, but I'm not changing that now.
Form fields and BFU text-input widgets then convert from UCS-4 to UTF-8.
If not all UTF-8 bytes fit, they don't insert anything. Thus it is no
longer possible to get invalid UTF-8 by hitting the length limit.
It is unclear to me which charset is supposed to be used for strings
in internal buffers. I made BFU insert UTF-8 whenever CONFIG_UTF_8,
but form fields use the charset of the terminal; that may have to be
changed.
As a side effect, this change should solve bug 782, because
term_send_ucs no longer encodes in UTF-8 if CONFIG_UTF_8 is defined.
I think the UTF-8 and codepage encoding calls I added are safe, too.
A similar bug may still surface somewhere else, but 782 could be
closed for now.
This change also lays the foundation for binding actions to non-ASCII
keys, but the keystroke name parser doesn't yet support that.
The CONFIG_UTF_8 mode does not currently support non-ASCII characters
in hot keys, either.
To reproduce the bug before this patch:
Enable CONFIG_UTF_8, UTF-8 I/O, and UTF-8 charset.
Go to www.google.com and type "abc" in the text input field.
Then press Left. The cursor jumps to "a" when it should go to "c".
When the user presses enter during a text type-ahead search, simply cancel
the search without additionally following the current link. Link type-ahead
searching still will follow the active link on enter.
Make move_up and move_down return no value. Instead, save the old y value
and compare it to the new after calling move_up or move_down in
move_page_up or move_page_down, respectively.
This fixes a bug where if given a prefix, if that prefix specified a number
of pages greater than move-page-up actually scrolled, there would be no
screen update, because the last call to move_up would return FRAME_EVENT_OK
which would be returned from move_page_up, even tho move_page_up would have
previously returned FRAME_EVENT_REFRESH.
Don't try the key as an accesskey if a menu was opened, whether it was just
the main menu or whether it was a submenu of the menu menu (we would try
the key as an accesskey in the latter case).
In send_kbd_event, replace the KBD_MOD_ALT modifier when trying the key as
an accesskey rather than when we don't.
Instead of saving the old link colours when selecting a link and using that
to restore them when unselecting it, just copy the data from the document.
- Eliminate struct link_bg and the .link_bg and .link_bg_n members
of struct document_view.
- Eliminate the free_link routine and don't call it from draw_doc,
clear_link, or detach_formatted.
- Add a .old_current_link member to struct view_state and initialise it in
init_vs.
- Don't save link_bg in draw_current_link.
- Rewrite clear_link to use the document data instead of link_bg.
- Modify init_link_drawing not to allocate ling_bg and to return a pointer
to a static variable for the template character.
Including double-width glyph support.
Note: textarea is now drawn with blank collumn at end of lines. It seems
that this is more intuitive for users. It behaves similar as textareas in
graphical interfaces. I hope it will hold your interest.
+----+ +----+ +----+
|aaA | [right] |aaa_| [right] |aaa |
|aaa | |aaa | |Aaa |
|bb | |bb | |bb |
+----+ +----+ +----+
+----+ +----+ +----+
|Aaa | [end] |aaa_| [c] |aaa |
|aaa | |aaa | |Caa |
|bb | |bb | |abb |
+----+ +----+ +----+
A, _, C - cursor positions.
[right] - right arrow
[end] - ACT_END (End button)
[c] - Letter c.
Now this code:
<textarea rows="3" cols="3">aaaaaabb</textarea>
represents textarea with 3x3 positions for chars.
Before this texteare behaved some kind of weirdly. That code above was
rendered like this:
+----+
|aaaa|
|aabb|
|_ |
+----+