Index: FL/Fl_Text_Display.H
===================================================================
--- FL/Fl_Text_Display.H	(Revision 12667)
+++ FL/Fl_Text_Display.H	(Arbeitskopie)
@@ -404,6 +404,30 @@
   void linenumber_format(const char* val);
   const char* linenumber_format() const;
 
+  /**
+   Sets the line highlight mode.
+   \param val False = disabled, True = enabled
+   */
+  void line_highlight(bool val);
+
+  /**
+   Sets the line highlight color.
+   \param val line highlight color
+   */
+  void line_highlight_color(Fl_Color val) { line_highlight_color_ = val; }
+
+  /**
+   Gets the current line highlight mode.
+   \return False = disabled, True = enabled
+   */
+  bool line_highlight() const { return line_highlight_; }
+
+  /**
+   Gets the current line highlight color.
+   \return highlight color or (Fl_Color)-1 if none has been set
+   */
+  Fl_Color line_highlight_color() const { return line_highlight_color_; }
+
 protected:
   // Most (all?) of this stuff should only be called from resize() or
   // draw().
@@ -416,7 +440,7 @@
   void draw_cursor(int, int);
   
   void draw_string(int style, int x, int y, int toX, const char *string,
-                   int nChars) const;
+                   int nChars, bool highlight = false) const;
   
   void draw_vline(int visLineNum, int leftClip, int rightClip,
                   int leftCharIndex, int rightCharIndex);
@@ -591,6 +615,10 @@
   Fl_Color    linenumber_bgcolor_;
   Fl_Align    linenumber_align_;
   const char* linenumber_format_;
+
+  // Line highlight mode/color
+  bool line_highlight_;
+  Fl_Color line_highlight_color_;
 };
 
 #endif
Index: src/Fl_Text_Display.cxx
===================================================================
--- src/Fl_Text_Display.cxx	(Revision 12667)
+++ src/Fl_Text_Display.cxx	(Arbeitskopie)
@@ -175,6 +175,9 @@
   linenumber_align_   = FL_ALIGN_RIGHT;
   linenumber_format_  = strdup("%d");
 
+  line_highlight_ = false;
+  line_highlight_color_ = (Fl_Color)-1;
+
   // Method calls -- only AFTER all members initialized
   color(FL_BACKGROUND2_COLOR, FL_SELECTION_COLOR);
   box(FL_DOWN_FRAME);
@@ -300,6 +303,31 @@
 }
 
 /**
+ Set highlighted drawing of the line the cursor is in
+ (current line).
+ The background of the current line will be drawn in a different
+ color across the whole text widget width, when requested by this method.
+ Additionally if line number display is turned on, the current line
+ number will be drawn with a bold text.
+
+ A value of False (default) disables this feature.
+ A value of True enables it and sets the default highlight color to
+ fl_color_average( color() selection_color(), .85f ).
+ Change this default highlight color \b AFTER you have called this method
+ using Fl_Text_Display::line_highlight_color(Fl_Color val).
+*/
+void Fl_Text_Display::line_highlight(bool val) {
+  line_highlight_ = val;
+  if (line_highlight_) {
+ 	 if (line_highlight_color_ == (Fl_Color)-1)
+      line_highlight_color_ = fl_color_average( color(), selection_color(), 0.85f );
+  }
+  else {
+    line_highlight_color_ = (Fl_Color)-1;
+  }
+}
+
+/**
  Returns the alignment used for line numbers (if enabled).
 */
 Fl_Align Fl_Text_Display::linenumber_align() const {
@@ -1991,11 +2019,13 @@
 
   startX = X;
   startIndex = 0;
+
+  bool hl = mCursorPos >= lineStartPos && mCursorPos <= lineStartPos + lineLen;
   if (!lineStr) {
     // just clear the background
     if (mode==DRAW_LINE) {
       style = position_style(lineStartPos, lineLen, -1);
-      draw_string( style|BG_ONLY_MASK, text_area.x, Y, text_area.x+text_area.w, lineStr, lineLen );
+      draw_string( style|BG_ONLY_MASK, text_area.x, Y, text_area.x+text_area.w, lineStr, lineLen, hl );
     }
     if (mode==FIND_INDEX) {
       IS_UTF8_ALIGNED2(buffer(), lineStartPos)
@@ -2021,7 +2051,7 @@
         double xAbs = (mode==GET_WIDTH) ? startX : startX+mHorizOffset-text_area.x;
         w = ((int(xAbs/tab)+1)*tab) - xAbs;
         if (mode==DRAW_LINE)
-          draw_string( style|BG_ONLY_MASK, startX, Y, startX+w, 0, 0 );
+          draw_string( style|BG_ONLY_MASK, startX, Y, startX+w, 0, 0, hl );
         if (mode==FIND_INDEX && startX+w>rightClip) {
           // find x pos inside block
           free(lineStr);
@@ -2033,7 +2063,7 @@
         // draw a text segment
         w = string_width( lineStr+startIndex, i-startIndex, style );
         if (mode==DRAW_LINE)
-          draw_string( style, startX, Y, startX+w, lineStr+startIndex, i-startIndex );
+          draw_string( style, startX, Y, startX+w, lineStr+startIndex, i-startIndex, hl );
         if (mode==FIND_INDEX && startX+w>rightClip) {
           // find x pos inside block
 	  int di = find_x(lineStr+startIndex, i-startIndex, style, -(rightClip-startX)); // STR #2788
@@ -2056,7 +2086,7 @@
     double xAbs = (mode==GET_WIDTH) ? startX : startX+mHorizOffset-text_area.x;
     w = ((int(xAbs/tab)+1)*tab) - xAbs;
     if (mode==DRAW_LINE)
-      draw_string( style|BG_ONLY_MASK, startX, Y, startX+w, 0, 0 );
+      draw_string( style|BG_ONLY_MASK, startX, Y, startX+w, 0, 0, hl );
     if (mode==FIND_INDEX) {
       // find x pos inside block
       free(lineStr);
@@ -2067,7 +2097,7 @@
   } else {
     w = string_width( lineStr+startIndex, i-startIndex, style );
     if (mode==DRAW_LINE)
-      draw_string( style, startX, Y, startX+w, lineStr+startIndex, i-startIndex );
+      draw_string( style, startX, Y, startX+w, lineStr+startIndex, i-startIndex, hl );
     if (mode==FIND_INDEX) {
       // find x pos inside block
       int di = find_x(lineStr+startIndex, i-startIndex, style, -(rightClip-startX)); // STR #2788
@@ -2085,7 +2115,7 @@
   startX += w;
   style = position_style(lineStartPos, lineLen, i);
   if (mode==DRAW_LINE)
-    draw_string( style|BG_ONLY_MASK, startX, Y, text_area.x+text_area.w, lineStr, lineLen );
+    draw_string( style|BG_ONLY_MASK, startX, Y, text_area.x+text_area.w, lineStr, lineLen, hl );
 
   free(lineStr);
   IS_UTF8_ALIGNED2(buffer(), (lineStartPos+lineLen))
@@ -2190,10 +2220,12 @@
  \param toX rightmost position if this is a fill operation
  \param string text if this is a drawing operation
  \param nChars number of characters to draw
+ \param highlight draw line highlighted with color set with Fl_Text_Display::line_highlight_color(Fl_Color val)
  */
 void Fl_Text_Display::draw_string(int style,
                                   int X, int Y, int toX,
-                                  const char *string, int nChars) const {
+                                  const char *string, int nChars,
+                                  bool highlight) const {
   IS_UTF8_ALIGNED(string)
 
   const Style_Table_Entry * styleRec;
@@ -2202,6 +2234,8 @@
   if ( style & FILL_MASK ) {
     if (style & TEXT_ONLY_MASK) return;
     clear_rect( style, X, Y, toX - X, mMaxsize );
+    if ( highlight && line_highlight_ )
+      fl_rectf( X, Y, w() - X, mMaxsize, line_highlight_color_ );
     return;
   }
   /* Set font, color, and gc depending on style.  For normal text, GCs
@@ -2254,6 +2288,12 @@
     background = fl_inactive(background);
   }
 
+  if ( highlight && line_highlight_ ) {
+    fl_color( line_highlight_color_ );
+    fl_rectf( X, Y, w() - X, mMaxsize );
+    if (background == color())
+      background = fl_color();
+  }
   if (!(style & TEXT_ONLY_MASK)) {
     fl_color( background );
     fl_rectf( X, Y, toX - X, mMaxsize );
@@ -2975,8 +3015,6 @@
     //fl_line(x()+mLineNumWidth-1, y(), x()+mLineNumWidth-1, y()+h());
 
     // Draw line number text
-    fl_font(linenumber_font(), linenumber_size());
-
     Y = y() + yoff;
     line = get_absolute_top_line_number();
 
@@ -2985,6 +3023,10 @@
     for (visLine=0; visLine < mNVisibleLines; visLine++) {
       lineStart = mLineStarts[visLine];
       if (lineStart != -1 && (lineStart==0 || buffer()->char_at(lineStart-1)=='\n')) {
+   Fl_Font ft = linenumber_font();
+   if (line_highlight_ && mCursorPos >= lineStart && mCursorPos <= buffer()->line_end(lineStart))
+     ft |= FL_BOLD;
+   fl_font(ft, linenumber_size());
 	sprintf(lineNumString, linenumber_format(), line);
 	int xx = x() + xoff + 3,
 	    yy = Y,
Index: test/editor.cxx
===================================================================
--- test/editor.cxx	(Revision 12667)
+++ test/editor.cxx	(Arbeitskopie)
@@ -640,6 +640,14 @@
   e->redraw();
 }
 
+void line_highlight_cb(Fl_Widget *w, void* v) {
+  EditorWindow* e = (EditorWindow*)v;
+  Fl_Menu_Bar* m = (Fl_Menu_Bar*)w;
+  const Fl_Menu_Item* i = m->mvalue();
+  e->editor->line_highlight(i->value());
+  e->redraw();
+}
+
 void find_cb(Fl_Widget* w, void* v) {
   EditorWindow* e = (EditorWindow*)v;
   const char *val;
@@ -879,6 +887,7 @@
     { "Preferences",      0, 0, 0, FL_SUBMENU },
       { "Line Numbers",   FL_COMMAND + 'l', (Fl_Callback *)linenumbers_cb, 0, FL_MENU_TOGGLE },
       { "Word Wrap",      0,                (Fl_Callback *)wordwrap_cb, 0, FL_MENU_TOGGLE },
+      { "Highlight line", FL_COMMAND + 'h', (Fl_Callback *)line_highlight_cb, 0, FL_MENU_TOGGLE },
       { 0 },
     { 0 },
 
