Bug #82618 Control Caret Color and Width
Submitted: 18 Aug 2016 0:10 Modified: 3 Feb 2018 12:26
Reporter: Gaston Martinez Email Updates:
Status: Verified Impact on me:
Category:MySQL Workbench Severity:S4 (Feature request)
Version:6.3 OS:Windows
Assigned to: CPU Architecture:Any
Tags: scintilla

[18 Aug 2016 0:10] Gaston Martinez
Feature request, be able to control the caret color and width in the code editor window so a dark background and hi-res monitors can be used.
The file code_editor.xml contains the Scintilla coloring schema and it also contains three settings that are actually messages sent to scintilla: usetabs, tabwidth, indentation. It would be nice to have a caret_fore setting and a caret_width setting where the foreground color and the width for the caret could be set.

How to repeat:
Not a bug, a feature request

Suggested fix:
Add the following code to the code_editor.cpp file at line 655:

  if (iterator->first == "caret_fore")
    std::string value = iterator->second;
    Color color = Color::parse(value);
    int raw_color = (int)(255 * color.red) + ((int)(255 * color.green) << 8) + ((int)(255 * color.blue) << 16);
    _code_editor_impl->send_editor(this, SCI_SETCARETFORE, raw_color, 0);
    if (iterator->first == "caret_width")
      int int_value = base::atoi<int>(iterator->second, 0);
      _code_editor_impl->send_editor(this, SCI_SETCARETWIDTH, int_value, 0);
[3 Feb 2018 12:26] MySQL Verification Team
Hello Gaston Martinez,

Thank you for the feature request and patch.
Please note that in order to submit contributions you must first sign the Oracle Contribution Agreement (OCA). For additional information please check http://www.oracle.com/technetwork/community/oca-486395.html.
If you have any questions, please contact the MySQL community team - https://dev.mysql.com/community/