1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-10-17 06:24:12 -04:00
Commit Graph

371 Commits

Author SHA1 Message Date
Witold Filipczyk
e94a912f1e [style] spaces -> tab 2020-06-05 18:07:45 +02:00
sgerwk
76a973e902 show an alert when the search string is not found 2020-06-05 14:13:37 +02:00
Witold Filipczyk
5c57cf6270 [fragment] Do not move to the top, when nonexisting fragment is in current document. Refs #42
Behaviour similar to bigger browsers.
2020-04-28 19:13:36 +02:00
sgerwk
d1be5c322f add -remote 'search(string)' 2020-04-25 19:55:16 +02:00
Witold Filipczyk
51dd9e7e6e [color] Revert changes related to leading and trailing spaces and colours
It did not look good.
2019-11-21 21:01:49 +01:00
Witold Filipczyk
3d96b0d7d7 Revert "Compile with C++."
This reverts commit 4f4df33638.
2019-04-21 12:27:40 +02:00
Witold Filipczyk
4f4df33638 Compile with C++.
Weak points:
- alignof
- js problems

Todo:
- make js work with C++ and mozjs-17
- then mozjs-24
- then mozjs-52
- then mozjs-60
- decrease number of warnings
2019-02-17 20:46:16 +01:00
Witold Filipczyk
6dfdd36398 form_control -> el_form_control 2018-09-09 19:18:53 +02:00
Witold Filipczyk
d8be2c505e Rename struct box to struct el_box.
In the future I want to copy some code from netsurf, so I'm preparing.
2018-09-09 19:14:56 +02:00
sgerwk
2f58dfce13 when searching in a node, only search within its box 2018-06-25 10:47:51 +02:00
Fabienne Ducroquet
3665ee2ef7 Move check on number of search points to move_search_do
If doc_view->document->number_of_search_points is 0, move_search_number
crashes at:

pt = doc_view->document->search_points;
x = pt[number].x;
y = pt[number].y;

so it is not sufficient to make find_first_search_in_view return
immediately in this case, move_search_do should return immediately.
2018-06-07 17:25:21 +02:00
Witold Filipczyk
f2c0a380ab Check if nothing has found. Refs #21 2018-04-15 18:08:54 +02:00
Witold Filipczyk
ad5f8165b2 Wraparound search 2018-04-15 16:45:23 +02:00
Witold Filipczyk
798a7cc4e6 Reuse existing functions to scroll. Added horizontal_scroll_extended. 2018-04-15 14:32:18 +02:00
Witold Filipczyk
7a006b6dd2 Rewritten searching. Refs #21
Before only visible part of screen was searched for pattern.
Now whole document is searched, and beginings of found text
is remembered in document->search_points.
2018-04-14 21:49:52 +02:00
Witold Filipczyk
fd1ae61131 Let search for more unbreakable spaces. Refs #20 2018-04-07 11:43:28 +02:00
Witold Filipczyk
fbfbe4013c Interpret 0xA0 (nbsp in UTF-8 mode) as space char for searches. Issue #20 2018-04-06 20:02:49 +02:00
Felix Janda
bfb4733f39 Don't use <sys/signal.h>
This legacy header appears to be unused. Removing its includes
avoids numerous warnings when compiling with musl libc:

/usr/include/sys/signal.h:1:2: warning: #warning redirecting incorrect #include <sys/signal.h> to <signal.h> [-Wcpp]
2017-11-23 17:51:41 -05:00
rkd77
be719e1ac1
Merge pull request #10 from aelmahmoudy/select_forms
Make select forms look more like other forms.
2017-11-22 12:02:06 +01:00
rkd77
77ea5759ed
Merge pull request #9 from aelmahmoudy/preferred_document_width_option
Add preferred_document_width option.
2017-11-22 11:59:17 +01:00
rkd77
a6996b7d3a
Merge pull request #7 from aelmahmoudy/keep_forms_bold
Keep forms in bold even when active.
2017-11-22 11:55:40 +01:00
rkd77
f44fdc25ed
Merge pull request #5 from aelmahmoudy/dont_underline_active_textarea
Avoid underlining active text areas.
2017-11-22 11:53:32 +01:00
Yozo Hida
948d019fc0 Add preferred_document_width option.
Option document.browse.preferred_document_width controls the
width of the document, so that documents are rendered with narrower
width than screen width.  Makes it easier to read paragraphs.

Patch originally from Shalon Wood <dstar@pele.cx>, see bug #1063.

Instead of using max_document_width as the hard limit to the document
width, it uses a soft limit, where if the document does not fit (due to
tables, etc.), then larger width is used.  This reduces the need for
horizontal scrolling for wide documents.

Also added toggle-document-width action to toggle between preferred
width and full screen width.  This is bound to 'M' by default.  Initial
toggle status is determined by document.browse.use_preferred_document_width
option.

During dumps, document.dump.width option is still used.  Perhaps we
should consolidate document.dump.width option with
document.browse.preferred_document_width ?
2017-11-21 16:09:13 +01:00
Yozo Hida
7e58737619 Make select forms look more like other forms.
Insert "[_" and "_]" as part of the form link, and
include it as part of the link.
2017-11-21 16:06:33 +01:00
Yozo Hida
2a09148e5a Avoid underlining active text areas.
They already have underscores, so underlining them is redundant (and looks a
bit strange).
2017-11-21 16:04:27 +01:00
Yozo Hida
6ad3e541c8 Keep forms in bold even when active. 2017-11-21 16:02:26 +01:00
Yozo Hida
4ed958b067 Provide different color for text areas in insert mode.
The color is controlled by

  document.browse.links.active_link.insert_mode_colors.background
  document.browse.links.active_link.insert_mode_colors.text

Also avoid overloading local variable "i" in get_current_link().
2017-11-21 16:00:39 +01:00
Witold Filipczyk
0266633025 Fix issue with one char documents. Patch by Felix Janda 2017-11-14 09:54:05 +01:00
Witold Filipczyk
f3ab69bb13 Color trailing spaces with color of last non-space cell 2017-06-13 22:39:53 +02:00
Witold Filipczyk
c610fcf334 Off by one, also 200 instead of 30 2017-06-13 17:07:23 +02:00
Witold Filipczyk
da15322705 Cast to (const char *) in strrchr calls 2016-04-20 21:03:27 +02:00
Witold Filipczyk
96e65c105f Explicit cast in strstr for C++ 2016-04-20 20:46:33 +02:00
Witold Filipczyk
1b06539694 Explicit cast to (const char *) in strcasestr for C++ 2016-04-20 20:11:08 +02:00
Witold Filipczyk
52d6f37c8e Explicit cast to (const char *) for strchr function (C++) 2016-04-20 19:43:37 +02:00
Witold Filipczyk
2e721e051a template -> template_ for C++ compatibility 2016-04-20 18:05:00 +02:00
Witold Filipczyk
4efea7e314 Added support for label_key in references of dumps.
Added base parameter to dec2qwerty and qwerty2dec to avoid strlen calls
im dumps.
2016-02-07 11:51:17 +01:00
Witold Filipczyk
69986f1bd1 Multiplication instead of pow calls and minor style changes. 2016-01-31 12:38:18 +01:00
Martin Miller
28b7bd1ec2 Transfer changes for ascii link labeling 2016-01-31 10:23:08 +01:00
Fabienne Ducroquet
3379fc988c Respect alphabetical order for the actions
I didn’t respect the right order when I added the functions to move up and down
by half a page a few years ago.

Signed-off-by: Fabienne Ducroquet <fabiduc@gmail.com>
2013-12-18 16:38:57 +01:00
Fabienne Ducroquet
60a5fce0f0 Add a function to put the current line at the top of the screen
Signed-off-by: Fabienne Ducroquet <fabiduc@gmail.com>
2013-12-18 10:01:34 +01:00
Witold Filipczyk
40fdc14012 30 instead of 10. Python tutorial looks better. 2013-12-16 17:04:59 +01:00
Kalle Olavi Niemitalo
bfeb09fe37 doxygen: Document dump.c some more
Doxygen complained that the cp parameter of dump_output_alloc was not
documented.  Fix that, and document dump_output_prepare_frame too.
2012-11-18 20:16:37 +02:00
witekfl
ba9bbc9e46 draw_space: Check for a non-space only in first 10 chars of the line.
I know it is totally brainless, but buildlogs.pld-linux.org
looks good now.
2012-07-11 11:39:26 +02:00
witekfl
42d2433f4b Color leading spaces with the color of the first non-space character.
Also color trailing spaces with the color of the last character.

See for example gtk-doc.
2012-07-11 11:14:03 +02:00
witekfl
36070d3277 The union of the color and the node_number in the struct screen_char.
The long term goal is good looking of the Python docs in ELinks, especially
background colors. Every start tag and every text node would have associated
a natural number. Those numbers would be "drawn" in the document instead
of colors. Finally, the screen driver would change numbers into colors.

This will be done in small steps. The next step is to implement this change
in the screen driver.
2012-03-03 11:27:58 +01:00
Miciah Dashiel Butler Masters
3932af9b17 SMJS: handle view_state outliving wrapping object
Currently, it is possible for the JSObject that wraps a struct view_state
to outlive the view_state.  Using the properties of the JSObject wrapper
will then cause a crash.

This patch adds a smjs_detach_view_state_object function, which is called
in destroy_vs, to dissociate the struct view_state from the JSObject
wrapper.  To this end, the patch modifies the struct view_state to point
the JSObject wrapper.  smjs_get_view_state_object will use this pointer
if it is set, and copy_vs will copy this pointer to the new view_state.
The patch also modifies view_state_get_property and
view_state_set_property to return immediately if the view_state has been
destroyed.  Finally, the patch adds a finalizer (view_state_finalize)
that clears the pointer from the struct view_state to the JSObject.
2011-11-14 04:34:51 +00:00
Miciah Dashiel Butler Masters
daa6f36e83 Perform the work of try_form_insert_mode in enter
Currently, the function try_form_insert_mode checks whether the current
link is a text area, insert mode is off, and the current action is enter,
and if so, it sets insert mode on.  Perform this work in enter instead,
and delete try_form_insert_mode.

The old code works as follows: send_kbd_event → send_to_frame
→ frame_ev → frame_ev_kbd → try_form_insert_mode.  The new code works
as follows: send_kbd_event → do_action → enter.
2011-11-14 04:34:50 +00:00
witekfl
3d4fe9c4d2 Always do reload after submitting forms.
In fact, it does reload after pressing any button, but it should not
hurt. To remember to press 'x' for submitting forms was too hard.
2011-11-12 15:17:53 +01:00
Petr Baudis
9a001f051a Remove variables that were set but not used
Required to make new gcc with default warning settings happy.
2011-09-24 02:25:51 +02:00
Kalle Olavi Niemitalo
715571a5d6 HTML bug 1114: Don't doubly decode entities in attributes
The HTML parser decoded SGML entity references and numeric character
references in the following attributes, and then the renderer did the
same again:

link/@title
link/@hreflang
link/@type
link/@media
img/@alt
area/@alt
input[@type="image"]/@alt
input[@type="image"]/@name
input[@type="button"]/@value

The result was that e.g. title="&amp;#65;" displayed as "A"
even though it was supposed to display as "&#65;".

Fix by making the HTML parser tell the renderer that the entities have
already been decoded.
2011-05-01 22:54:45 +03:00