aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--src/plain.cc6
2 files changed, 7 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 89348d3c..9a60a71b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -31,6 +31,7 @@ dillo-3.2.0 [Not released yet]
- Allow image formats to be ignored with the "ignore_image_formats" option.
- Add the "link_action" option to define custom menu entries to open links
with external programs or scripts.
+ - Add support for line fragments in plain text files (file://foo/bar.txt#L42).
Patches: Rodrigo Arias Mallo
+- Add primitive support for SVG using the nanosvg.h library.
- Add support for ch, rem, vw, vh, vmin and vmax CSS units.
diff --git a/src/plain.cc b/src/plain.cc
index 8be30cb7..0f5d6a48 100644
--- a/src/plain.cc
+++ b/src/plain.cc
@@ -54,6 +54,7 @@ public:
style::Style *widgetStyle;
size_t Start_Ofs; /* Offset of where to start reading next */
int state;
+ long currentLine;
DilloPlain(BrowserWindow *bw);
~DilloPlain();
@@ -95,6 +96,7 @@ DilloPlain::DilloPlain(BrowserWindow *p_bw)
dw = new Textblock (prefs.limit_text_width);
Start_Ofs = 0;
state = ST_SeekingEol;
+ currentLine = 0L;
Layout *layout = (Layout*) bw->render_layout;
// TODO (1x) No URL?
@@ -142,6 +144,10 @@ void DilloPlain::addLine(char *Buf, uint_t BufSize)
char buf[129];
char *end = Buf + BufSize;
+ currentLine++; /* Start at 1 */
+ sprintf(buf, "L%ld", currentLine); /* Always fits */
+ DW2TB(dw)->addAnchor(buf, widgetStyle);
+
if (BufSize > 0) {
// Limit word length to avoid X11 coordinate
// overflow with extremely long lines.