changeset 23190:4a2c42792d6c

highlight all occurrences of a selected word in the editor (bug #41470) * file-editor-tab.cc (file_editor_tab): connect scintillas double click signal the new slot handle_double_click, define indicator used for highlighting the words; (update_lexer): calculate a suitable color of the indicator; (notice_settings): determine from settings whether to highlight all occurrences or not; (handle_double_click): new slot where all occurrences are searched and highlighted with the indicator if it is desired and if it was a double click without modifiers * file-editor-tab.h: new slot handle_double_click, new class variables for the setting whether to highlight all or not and for the related indicator * octave-qscintilla.h, octave-qscintilla.cc (clear_indicator): new function for clearing all occurrences of a given indicator * settings-dialog.ui: new checkbox for highlighting all occurrences of a selected word in the editor * settings-dialog.cc (settings_dialog): initialize new checkbox without value from settings file; (write_changed_settings): save checkbox state into settings file
author Torsten <mttl@mailbox.org>
date Fri, 17 Feb 2017 07:54:31 +0100
parents e2e182a8e699
children 5f79bb3fdd28
files libgui/src/m-editor/file-editor-tab.cc libgui/src/m-editor/file-editor-tab.h libgui/src/m-editor/octave-qscintilla.cc libgui/src/m-editor/octave-qscintilla.h libgui/src/settings-dialog.cc libgui/src/settings-dialog.ui
diffstat 6 files changed, 377 insertions(+), 265 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor-tab.cc	Wed Feb 15 13:10:39 2017 +0100
+++ b/libgui/src/m-editor/file-editor-tab.cc	Fri Feb 17 07:54:31 2017 +0100
@@ -115,6 +115,9 @@
   connect (_edit_area, SIGNAL (SCN_CHARADDED (int)),
            this, SLOT (handle_char_added (int)));
 
+  connect (_edit_area, SIGNAL (SCN_DOUBLECLICK (int, int, int)),
+           this, SLOT (handle_double_click (int, int, int)));
+
   connect (_edit_area, SIGNAL (linesChanged ()),
            this, SLOT (handle_lines_changed ()));
 
@@ -229,6 +232,14 @@
   _enc_indicator->setText (_encoding);
   // no changes in encoding yet
   _new_encoding = _encoding;
+
+  // indicators
+  _indicator_highlight_all
+        = _edit_area->indicatorDefine (QsciScintilla::StraightBoxIndicator);
+  if (_indicator_highlight_all == -1)
+    _indicator_highlight_all = 1;
+
+  _edit_area->setIndicatorDrawUnder (true, _indicator_highlight_all);
 }
 
 file_editor_tab::~file_editor_tab (void)
@@ -754,6 +765,13 @@
   _edit_area->setMarginsBackgroundColor (bg);
   _edit_area->setFoldMarginColors (bg,fg);
 
+  // color indicator for highlighting all occurrences:
+  // applications highlight color with more transparency
+  QColor hg = QApplication::palette ().color (QPalette::Highlight);
+  hg.setAlphaF (0.25);
+  _edit_area->setIndicatorForegroundColor (hg, _indicator_highlight_all);
+  _edit_area->setIndicatorOutlineColor (hg, _indicator_highlight_all);
+
   // fix line number width with respect to the font size of the lexer
   if (settings->value ("editor/showLineNumbers", true).toBool ())
     auto_margin_width ();
@@ -2382,6 +2400,10 @@
   else
     _line_break = 0;
 
+  // highlight all occurrences of a word selected by a double click
+  _highlight_all_occurrences = settings->value (
+                    "editor/highlight_all_occurrences", true).toBool ();
+
   // reload changed files
   _always_reload_changed_files =
         settings->value ("editor/always_reload_changed_files",false).toBool ();
@@ -2716,6 +2738,77 @@
   }
 }
 
+// Slot handling a double click into the text area
+void
+file_editor_tab::handle_double_click (int, int, int modifier)
+{
+  if (! modifier)
+    {
+      // double clicks without modifier
+      // clear any existing indicators of this type
+      _edit_area->clear_indicator (_indicator_highlight_all);
+
+      if (_highlight_all_occurrences)
+        {
+          // highlighting of all occurrences of the clicked word is enabled
+
+          // get the resulting cursor position
+          // (required if click was beyond a line ending)
+          int line, col;
+          _edit_area->getCursorPosition (&line, &col);
+
+          // get the word at the cursor (if any)
+          QString word = _edit_area->wordAtLineIndex (line, col);
+          word = word.trimmed ();
+
+          if (! word.isEmpty ())
+            {
+              // word is not empty, so find all occurrences of the word
+
+              // remember first visible line for restoring the view afterwards
+              int first_line = _edit_area->firstVisibleLine ();
+
+              // search for first occurrence of the detected word
+              bool find_result_available
+                      = _edit_area->findFirst (word,
+                                               false,   // no regexp
+                                               true,    // case sensitive
+                                               true,    // whole words only
+                                               false,   // do not wrap
+                                               true,    // forward
+                                               0,0,     // from the beginning
+                                               false
+#if defined (HAVE_QSCI_VERSION_2_6_0)
+                                             , true
+#endif
+                                            );
+
+              // loop over all occurrences and set the related indicator
+              int oline, ocol;
+              int wlen = word.length ();
+
+              while (find_result_available)
+                {
+                  // get cursor position after having found an occurrence
+                  _edit_area->getCursorPosition (&oline, &ocol);
+                  // set the indicator
+                  _edit_area->fillIndicatorRange (oline, ocol - wlen,
+                                                  oline, ocol,
+                                                  _indicator_highlight_all);
+                  // find next occurrence
+                  find_result_available = _edit_area->findNext ();
+                }
+
+              // restore the visible area of the file, the cursor position,
+              // and the selection
+              _edit_area->setFirstVisibleLine (first_line);
+              _edit_area->setCursorPosition (line, col);
+              _edit_area->setSelection (line, col - wlen, line, col);
+            }
+        }
+    }
+}
+
 void
 file_editor_tab::do_smart_indent ()
 {
--- a/libgui/src/m-editor/file-editor-tab.h	Wed Feb 15 13:10:39 2017 +0100
+++ b/libgui/src/m-editor/file-editor-tab.h	Fri Feb 17 07:54:31 2017 +0100
@@ -216,6 +216,7 @@
 
   void handle_cursor_moved (int line, int col);
   void handle_char_added (int character);
+  void handle_double_click (int p, int l, int modifier);
   void handle_lines_changed (void);
 
 private:
@@ -304,6 +305,8 @@
   int _line;
   int _col;
   bool _lines_changed;
+  bool _highlight_all_occurrences;
+  int _indicator_highlight_all;
 
 };
 
--- a/libgui/src/m-editor/octave-qscintilla.cc	Wed Feb 15 13:10:39 2017 +0100
+++ b/libgui/src/m-editor/octave-qscintilla.cc	Fri Feb 17 07:54:31 2017 +0100
@@ -342,4 +342,14 @@
   QsciScintilla::focusInEvent (focusEvent);
 }
 
+// helper function for clearing all indicators of a specific style
+void
+octave_qscintilla::clear_indicator (int indicator_style)
+{
+  int end_pos = text ().length ();
+  int end_line, end_col;
+  lineIndexFromPosition (end_pos, &end_line, &end_col);
+  clearIndicatorRange (0, 0, end_line, end_col, indicator_style);
+}
+
 #endif
--- a/libgui/src/m-editor/octave-qscintilla.h	Wed Feb 15 13:10:39 2017 +0100
+++ b/libgui/src/m-editor/octave-qscintilla.h	Fri Feb 17 07:54:31 2017 +0100
@@ -45,6 +45,7 @@
   void context_run ();
   void get_global_textcursor_pos (QPoint *global_pos, QPoint *local_pos);
   bool get_actual_word ();
+  void clear_indicator (int indicator_style);
 
 signals:
 
--- a/libgui/src/settings-dialog.cc	Wed Feb 15 13:10:39 2017 +0100
+++ b/libgui/src/settings-dialog.cc	Fri Feb 17 07:54:31 2017 +0100
@@ -417,6 +417,8 @@
     settings->value ("editor/show_toolbar",true).toBool ());
   ui->cb_code_folding->setChecked (
     settings->value ("editor/code_folding",true).toBool ());
+  ui->editor_highlight_all_occurrences->setChecked (
+    settings->value ("editor/highlight_all_occurrences",true).toBool ());
 
   ui->editor_codeCompletion->setChecked (
     settings->value ("editor/codeCompletion", true).toBool ());
@@ -808,6 +810,8 @@
                       ui->cb_edit_status_bar->isChecked ());
   settings->setValue ("editor/show_toolbar",
                       ui->cb_edit_tool_bar->isChecked ());
+  settings->setValue ("editor/highlight_all_occurrences",
+                      ui->editor_highlight_all_occurrences->isChecked ());
   settings->setValue ("editor/codeCompletion",
                       ui->editor_codeCompletion->isChecked ());
   settings->setValue ("editor/codeCompletion_threshold",
--- a/libgui/src/settings-dialog.ui	Wed Feb 15 13:10:39 2017 +0100
+++ b/libgui/src/settings-dialog.ui	Fri Feb 17 07:54:31 2017 +0100
@@ -500,7 +500,7 @@
             <x>0</x>
             <y>0</y>
             <width>642</width>
-            <height>904</height>
+            <height>900</height>
            </rect>
           </property>
           <layout class="QVBoxLayout" name="verticalLayout_16">
@@ -512,6 +512,148 @@
              <layout class="QVBoxLayout" name="verticalLayout_13">
               <item>
                <layout class="QGridLayout" name="editor_common_settings_grid">
+                <property name="topMargin">
+                 <number>0</number>
+                </property>
+                <item row="3" column="2">
+                 <widget class="QCheckBox" name="editor_ws_indent_checkbox">
+                  <property name="enabled">
+                   <bool>false</bool>
+                  </property>
+                  <property name="text">
+                   <string>Do not show whitespace used for indentation</string>
+                  </property>
+                 </widget>
+                </item>
+                <item row="10" column="0">
+                 <widget class="QCheckBox" name="cb_show_hscrollbar">
+                  <property name="enabled">
+                   <bool>true</bool>
+                  </property>
+                  <property name="sizePolicy">
+                   <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+                    <horstretch>0</horstretch>
+                    <verstretch>0</verstretch>
+                   </sizepolicy>
+                  </property>
+                  <property name="text">
+                   <string>Show horizontal scroll bar</string>
+                  </property>
+                  <property name="checked">
+                   <bool>true</bool>
+                  </property>
+                 </widget>
+                </item>
+                <item row="1" column="0">
+                 <widget class="QCheckBox" name="editor_longWindowTitle">
+                  <property name="sizePolicy">
+                   <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+                    <horstretch>0</horstretch>
+                    <verstretch>0</verstretch>
+                   </sizepolicy>
+                  </property>
+                  <property name="text">
+                   <string>Show complete path in window title</string>
+                  </property>
+                 </widget>
+                </item>
+                <item row="1" column="1">
+                 <spacer name="horizontalSpacer_24">
+                  <property name="orientation">
+                   <enum>Qt::Horizontal</enum>
+                  </property>
+                  <property name="sizeType">
+                   <enum>QSizePolicy::Fixed</enum>
+                  </property>
+                  <property name="sizeHint" stdset="0">
+                   <size>
+                    <width>10</width>
+                    <height>0</height>
+                   </size>
+                  </property>
+                 </spacer>
+                </item>
+                <item row="2" column="0">
+                 <widget class="QCheckBox" name="editor_showLineNumbers">
+                  <property name="enabled">
+                   <bool>true</bool>
+                  </property>
+                  <property name="sizePolicy">
+                   <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+                    <horstretch>0</horstretch>
+                    <verstretch>0</verstretch>
+                   </sizepolicy>
+                  </property>
+                  <property name="text">
+                   <string>Show line numbers</string>
+                  </property>
+                 </widget>
+                </item>
+                <item row="5" column="2">
+                 <layout class="QGridLayout" name="editor_grid_current_line" rowstretch="0" columnstretch="0,0,0,0,0">
+                  <property name="horizontalSpacing">
+                   <number>12</number>
+                  </property>
+                  <property name="verticalSpacing">
+                   <number>0</number>
+                  </property>
+                  <item row="0" column="1">
+                   <widget class="QLabel" name="editor_label_cl_color">
+                    <property name="enabled">
+                     <bool>false</bool>
+                    </property>
+                    <property name="text">
+                     <string>Color</string>
+                    </property>
+                   </widget>
+                  </item>
+                  <item row="0" column="3">
+                   <spacer name="horizontalSpacer_11">
+                    <property name="orientation">
+                     <enum>Qt::Horizontal</enum>
+                    </property>
+                    <property name="sizeType">
+                     <enum>QSizePolicy::Fixed</enum>
+                    </property>
+                    <property name="sizeHint" stdset="0">
+                     <size>
+                      <width>80</width>
+                      <height>20</height>
+                     </size>
+                    </property>
+                   </spacer>
+                  </item>
+                  <item row="0" column="4">
+                   <spacer name="horizontalSpacer_9">
+                    <property name="orientation">
+                     <enum>Qt::Horizontal</enum>
+                    </property>
+                    <property name="sizeHint" stdset="0">
+                     <size>
+                      <width>40</width>
+                      <height>20</height>
+                     </size>
+                    </property>
+                   </spacer>
+                  </item>
+                 </layout>
+                </item>
+                <item row="5" column="0">
+                 <widget class="QCheckBox" name="editor_highlightCurrentLine">
+                  <property name="enabled">
+                   <bool>true</bool>
+                  </property>
+                  <property name="sizePolicy">
+                   <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+                    <horstretch>0</horstretch>
+                    <verstretch>0</verstretch>
+                   </sizepolicy>
+                  </property>
+                  <property name="text">
+                   <string>Highlight current line</string>
+                  </property>
+                 </widget>
+                </item>
                 <item row="1" column="2">
                  <layout class="QGridLayout" name="gridLayout_6">
                   <item row="0" column="0">
@@ -587,71 +729,6 @@
                   </item>
                  </layout>
                 </item>
-                <item row="5" column="2">
-                 <layout class="QGridLayout" name="editor_grid_current_line" rowstretch="0" columnstretch="0,0,0,0,0">
-                  <property name="horizontalSpacing">
-                   <number>12</number>
-                  </property>
-                  <property name="verticalSpacing">
-                   <number>0</number>
-                  </property>
-                  <item row="0" column="1">
-                   <widget class="QLabel" name="editor_label_cl_color">
-                    <property name="enabled">
-                     <bool>false</bool>
-                    </property>
-                    <property name="text">
-                     <string>Color</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item row="0" column="3">
-                   <spacer name="horizontalSpacer_11">
-                    <property name="orientation">
-                     <enum>Qt::Horizontal</enum>
-                    </property>
-                    <property name="sizeType">
-                     <enum>QSizePolicy::Fixed</enum>
-                    </property>
-                    <property name="sizeHint" stdset="0">
-                     <size>
-                      <width>80</width>
-                      <height>20</height>
-                     </size>
-                    </property>
-                   </spacer>
-                  </item>
-                  <item row="0" column="4">
-                   <spacer name="horizontalSpacer_9">
-                    <property name="orientation">
-                     <enum>Qt::Horizontal</enum>
-                    </property>
-                    <property name="sizeHint" stdset="0">
-                     <size>
-                      <width>40</width>
-                      <height>20</height>
-                     </size>
-                    </property>
-                   </spacer>
-                  </item>
-                 </layout>
-                </item>
-                <item row="5" column="0">
-                 <widget class="QCheckBox" name="editor_highlightCurrentLine">
-                  <property name="enabled">
-                   <bool>true</bool>
-                  </property>
-                  <property name="sizePolicy">
-                   <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
-                    <horstretch>0</horstretch>
-                    <verstretch>0</verstretch>
-                   </sizepolicy>
-                  </property>
-                  <property name="text">
-                   <string>Highlight current line</string>
-                  </property>
-                 </widget>
-                </item>
                 <item row="3" column="0">
                  <widget class="QCheckBox" name="editor_ws_checkbox">
                   <property name="sizePolicy">
@@ -665,7 +742,23 @@
                   </property>
                  </widget>
                 </item>
-                <item row="7" column="0">
+                <item row="9" column="0">
+                 <widget class="QCheckBox" name="cb_edit_status_bar">
+                  <property name="sizePolicy">
+                   <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+                    <horstretch>0</horstretch>
+                    <verstretch>0</verstretch>
+                   </sizepolicy>
+                  </property>
+                  <property name="text">
+                   <string>Show status bar</string>
+                  </property>
+                  <property name="checked">
+                   <bool>true</bool>
+                  </property>
+                 </widget>
+                </item>
+                <item row="8" column="0">
                  <widget class="QCheckBox" name="cb_code_folding">
                   <property name="sizePolicy">
                    <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
@@ -681,78 +774,7 @@
                   </property>
                  </widget>
                 </item>
-                <item row="3" column="2">
-                 <widget class="QCheckBox" name="editor_ws_indent_checkbox">
-                  <property name="enabled">
-                   <bool>false</bool>
-                  </property>
-                  <property name="text">
-                   <string>Do not show whitespace used for indentation</string>
-                  </property>
-                 </widget>
-                </item>
-                <item row="9" column="0">
-                 <widget class="QCheckBox" name="cb_show_hscrollbar">
-                  <property name="enabled">
-                   <bool>true</bool>
-                  </property>
-                  <property name="sizePolicy">
-                   <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
-                    <horstretch>0</horstretch>
-                    <verstretch>0</verstretch>
-                   </sizepolicy>
-                  </property>
-                  <property name="text">
-                   <string>Show horizontal scroll bar</string>
-                  </property>
-                  <property name="checked">
-                   <bool>true</bool>
-                  </property>
-                 </widget>
-                </item>
-                <item row="8" column="0">
-                 <widget class="QCheckBox" name="cb_edit_status_bar">
-                  <property name="sizePolicy">
-                   <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
-                    <horstretch>0</horstretch>
-                    <verstretch>0</verstretch>
-                   </sizepolicy>
-                  </property>
-                  <property name="text">
-                   <string>Show status bar</string>
-                  </property>
-                  <property name="checked">
-                   <bool>true</bool>
-                  </property>
-                 </widget>
-                </item>
-                <item row="1" column="0">
-                 <widget class="QCheckBox" name="editor_longWindowTitle">
-                  <property name="sizePolicy">
-                   <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
-                    <horstretch>0</horstretch>
-                    <verstretch>0</verstretch>
-                   </sizepolicy>
-                  </property>
-                  <property name="text">
-                   <string>Show complete path in window title</string>
-                  </property>
-                 </widget>
-                </item>
-                <item row="4" column="0">
-                 <widget class="QCheckBox" name="cb_show_eol">
-                  <property name="sizePolicy">
-                   <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
-                    <horstretch>0</horstretch>
-                    <verstretch>0</verstretch>
-                   </sizepolicy>
-                  </property>
-                  <property name="text">
-                   <string>Show EOL characters</string>
-                  </property>
-                 </widget>
-                </item>
-                <item row="8" column="2">
+                <item row="9" column="2">
                  <widget class="QCheckBox" name="cb_edit_tool_bar">
                   <property name="sizePolicy">
                    <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
@@ -768,11 +790,8 @@
                   </property>
                  </widget>
                 </item>
-                <item row="2" column="0">
-                 <widget class="QCheckBox" name="editor_showLineNumbers">
-                  <property name="enabled">
-                   <bool>true</bool>
-                  </property>
+                <item row="2" column="2">
+                 <widget class="QCheckBox" name="cb_show_eol">
                   <property name="sizePolicy">
                    <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
                     <horstretch>0</horstretch>
@@ -780,25 +799,23 @@
                    </sizepolicy>
                   </property>
                   <property name="text">
-                   <string>Show line numbers</string>
+                   <string>Show EOL characters</string>
                   </property>
                  </widget>
                 </item>
-                <item row="1" column="1">
-                 <spacer name="horizontalSpacer_24">
-                  <property name="orientation">
-                   <enum>Qt::Horizontal</enum>
-                  </property>
-                  <property name="sizeType">
-                   <enum>QSizePolicy::Fixed</enum>
+               </layout>
+              </item>
+              <item>
+               <layout class="QHBoxLayout" name="horizontalLayout_22">
+                <property name="topMargin">
+                 <number>0</number>
+                </property>
+                <item>
+                 <widget class="QCheckBox" name="editor_highlight_all_occurrences">
+                  <property name="text">
+                   <string>Highlight all occurrences of a word selected by a double click</string>
                   </property>
-                  <property name="sizeHint" stdset="0">
-                   <size>
-                    <width>10</width>
-                    <height>0</height>
-                   </size>
-                  </property>
-                 </spacer>
+                 </widget>
                 </item>
                </layout>
               </item>
@@ -927,6 +944,67 @@
                 <property name="topMargin">
                  <number>0</number>
                 </property>
+                <item row="2" column="5">
+                 <layout class="QHBoxLayout" name="horizontalLayout_18">
+                  <item>
+                   <widget class="QCheckBox" name="editor_break_checkbox">
+                    <property name="enabled">
+                     <bool>true</bool>
+                    </property>
+                    <property name="sizePolicy">
+                     <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+                      <horstretch>0</horstretch>
+                      <verstretch>0</verstretch>
+                     </sizepolicy>
+                    </property>
+                    <property name="toolTip">
+                     <string>This works well for monospaced fonts. The line is drawn at a position based on the width of a space character in the default font. It may not work very well if styles use proportional fonts or if varied font sizes or bold, italic and normal texts are used.</string>
+                    </property>
+                    <property name="text">
+                     <string>Break long lines at line length</string>
+                    </property>
+                    <property name="checked">
+                     <bool>false</bool>
+                    </property>
+                   </widget>
+                  </item>
+                  <item>
+                   <widget class="QCheckBox" name="editor_wrap_checkbox">
+                    <property name="enabled">
+                     <bool>true</bool>
+                    </property>
+                    <property name="sizePolicy">
+                     <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+                      <horstretch>0</horstretch>
+                      <verstretch>0</verstretch>
+                     </sizepolicy>
+                    </property>
+                    <property name="toolTip">
+                     <string>This works well for monospaced fonts. The line is drawn at a position based on the width of a space character in the default font. It may not work very well if styles use proportional fonts or if varied font sizes or bold, italic and normal texts are used.</string>
+                    </property>
+                    <property name="text">
+                     <string>Wrap lines at window border</string>
+                    </property>
+                    <property name="checked">
+                     <bool>false</bool>
+                    </property>
+                   </widget>
+                  </item>
+                  <item>
+                   <spacer name="horizontalSpacer_17">
+                    <property name="orientation">
+                     <enum>Qt::Horizontal</enum>
+                    </property>
+                    <property name="sizeHint" stdset="0">
+                     <size>
+                      <width>40</width>
+                      <height>20</height>
+                     </size>
+                    </property>
+                   </spacer>
+                  </item>
+                 </layout>
+                </item>
                 <item row="0" column="3">
                  <spacer name="horizontalSpacer_37">
                   <property name="orientation">
@@ -943,22 +1021,6 @@
                   </property>
                  </spacer>
                 </item>
-                <item row="5" column="5">
-                 <spacer name="horizontalSpacer_14">
-                  <property name="orientation">
-                   <enum>Qt::Horizontal</enum>
-                  </property>
-                  <property name="sizeType">
-                   <enum>QSizePolicy::Fixed</enum>
-                  </property>
-                  <property name="sizeHint" stdset="0">
-                   <size>
-                    <width>10</width>
-                    <height>0</height>
-                   </size>
-                  </property>
-                 </spacer>
-                </item>
                 <item row="0" column="2">
                  <widget class="QSpinBox" name="editor_long_line_column">
                   <property name="sizePolicy">
@@ -1033,67 +1095,6 @@
                   </item>
                  </layout>
                 </item>
-                <item row="2" column="5">
-                 <layout class="QHBoxLayout" name="horizontalLayout_18">
-                  <item>
-                   <widget class="QCheckBox" name="editor_break_checkbox">
-                    <property name="enabled">
-                     <bool>true</bool>
-                    </property>
-                    <property name="sizePolicy">
-                     <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
-                      <horstretch>0</horstretch>
-                      <verstretch>0</verstretch>
-                     </sizepolicy>
-                    </property>
-                    <property name="toolTip">
-                     <string>This works well for monospaced fonts. The line is drawn at a position based on the width of a space character in the default font. It may not work very well if styles use proportional fonts or if varied font sizes or bold, italic and normal texts are used.</string>
-                    </property>
-                    <property name="text">
-                     <string>Break long lines at line length</string>
-                    </property>
-                    <property name="checked">
-                     <bool>false</bool>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QCheckBox" name="editor_wrap_checkbox">
-                    <property name="enabled">
-                     <bool>true</bool>
-                    </property>
-                    <property name="sizePolicy">
-                     <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
-                      <horstretch>0</horstretch>
-                      <verstretch>0</verstretch>
-                     </sizepolicy>
-                    </property>
-                    <property name="toolTip">
-                     <string>This works well for monospaced fonts. The line is drawn at a position based on the width of a space character in the default font. It may not work very well if styles use proportional fonts or if varied font sizes or bold, italic and normal texts are used.</string>
-                    </property>
-                    <property name="text">
-                     <string>Wrap lines at window border</string>
-                    </property>
-                    <property name="checked">
-                     <bool>false</bool>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <spacer name="horizontalSpacer_17">
-                    <property name="orientation">
-                     <enum>Qt::Horizontal</enum>
-                    </property>
-                    <property name="sizeHint" stdset="0">
-                     <size>
-                      <width>40</width>
-                      <height>20</height>
-                     </size>
-                    </property>
-                   </spacer>
-                  </item>
-                 </layout>
-                </item>
                </layout>
               </item>
              </layout>
@@ -1126,6 +1127,19 @@
                   </property>
                  </widget>
                 </item>
+                <item row="2" column="10">
+                 <spacer name="horizontalSpacer_20">
+                  <property name="orientation">
+                   <enum>Qt::Horizontal</enum>
+                  </property>
+                  <property name="sizeHint" stdset="0">
+                   <size>
+                    <width>40</width>
+                    <height>20</height>
+                   </size>
+                  </property>
+                 </spacer>
+                </item>
                 <item row="0" column="0">
                  <widget class="QLabel" name="label_13">
                   <property name="text">
@@ -1140,8 +1154,8 @@
                   </property>
                  </widget>
                 </item>
-                <item row="2" column="10">
-                 <spacer name="horizontalSpacer_20">
+                <item row="0" column="10">
+                 <spacer name="horizontalSpacer_13">
                   <property name="orientation">
                    <enum>Qt::Horizontal</enum>
                   </property>
@@ -1160,20 +1174,6 @@
                   </property>
                  </widget>
                 </item>
-                <item row="2" column="0">
-                 <widget class="QLabel" name="label_14">
-                  <property name="text">
-                   <string>Tab width</string>
-                  </property>
-                 </widget>
-                </item>
-                <item row="0" column="6">
-                 <widget class="QCheckBox" name="editor_ind_guides_checkbox">
-                  <property name="text">
-                   <string>Show indentation guides</string>
-                  </property>
-                 </widget>
-                </item>
                 <item row="2" column="2">
                  <widget class="QSpinBox" name="editor_tab_width_spinbox">
                   <property name="sizePolicy">
@@ -1190,6 +1190,20 @@
                   </property>
                  </widget>
                 </item>
+                <item row="2" column="0">
+                 <widget class="QLabel" name="label_14">
+                  <property name="text">
+                   <string>Tab width</string>
+                  </property>
+                 </widget>
+                </item>
+                <item row="0" column="6">
+                 <widget class="QCheckBox" name="editor_ind_guides_checkbox">
+                  <property name="text">
+                   <string>Show indentation guides</string>
+                  </property>
+                 </widget>
+                </item>
                 <item row="2" column="6">
                  <widget class="QCheckBox" name="editor_bs_unind_checkbox">
                   <property name="text">
@@ -1220,19 +1234,6 @@
                   </property>
                  </widget>
                 </item>
-                <item row="0" column="10">
-                 <spacer name="horizontalSpacer_13">
-                  <property name="orientation">
-                   <enum>Qt::Horizontal</enum>
-                  </property>
-                  <property name="sizeHint" stdset="0">
-                   <size>
-                    <width>40</width>
-                    <height>20</height>
-                   </size>
-                  </property>
-                 </spacer>
-                </item>
                </layout>
               </item>
              </layout>