| 145 | } |
| 146 | |
| 147 | UICodeEditor* UICodeEditorSplitter::createCodeEditor() { |
| 148 | UICodeEditor* editor = UICodeEditor::NewOpt( true, true ); |
| 149 | TextDocument& doc = editor->getDocument(); |
| 150 | /* document commands */ |
| 151 | doc.setCommand( "move-to-previous-line", [this] { |
| 152 | if ( mCurEditor ) |
| 153 | mCurEditor->moveToPreviousLine(); |
| 154 | } ); |
| 155 | doc.setCommand( "move-to-next-line", [this] { |
| 156 | if ( mCurEditor ) |
| 157 | mCurEditor->moveToNextLine(); |
| 158 | } ); |
| 159 | doc.setCommand( "select-to-previous-line", [this] { |
| 160 | if ( mCurEditor ) |
| 161 | mCurEditor->selectToPreviousLine(); |
| 162 | } ); |
| 163 | doc.setCommand( "select-to-next-line", [this] { |
| 164 | if ( mCurEditor ) |
| 165 | mCurEditor->selectToNextLine(); |
| 166 | } ); |
| 167 | doc.setCommand( "move-scroll-up", [this] { |
| 168 | if ( mCurEditor ) |
| 169 | mCurEditor->moveScrollUp(); |
| 170 | } ); |
| 171 | doc.setCommand( "move-scroll-down", [this] { |
| 172 | if ( mCurEditor ) |
| 173 | mCurEditor->moveScrollDown(); |
| 174 | } ); |
| 175 | doc.setCommand( "jump-lines-up", [this] { |
| 176 | if ( mCurEditor ) |
| 177 | mCurEditor->jumpLinesUp(); |
| 178 | } ); |
| 179 | doc.setCommand( "jump-lines-down", [this] { |
| 180 | if ( mCurEditor ) |
| 181 | mCurEditor->jumpLinesDown(); |
| 182 | } ); |
| 183 | doc.setCommand( "indent", [this] { |
| 184 | if ( mCurEditor ) |
| 185 | mCurEditor->indent(); |
| 186 | } ); |
| 187 | doc.setCommand( "unindent", [this] { |
| 188 | if ( mCurEditor ) |
| 189 | mCurEditor->unindent(); |
| 190 | } ); |
| 191 | doc.setCommand( "copy", [this] { |
| 192 | if ( mCurEditor ) |
| 193 | mCurEditor->copy(); |
| 194 | } ); |
| 195 | doc.setCommand( "cut", [this] { |
| 196 | if ( mCurEditor ) |
| 197 | mCurEditor->cut(); |
| 198 | } ); |
| 199 | doc.setCommand( "paste", [this] { |
| 200 | if ( mCurEditor ) |
| 201 | mCurEditor->paste(); |
| 202 | } ); |
| 203 | doc.setCommand( "font-size-grow", [this] { zoomIn(); } ); |
| 204 | doc.setCommand( "font-size-shrink", [this] { zoomOut(); } ); |
nothing calls this directly
no test coverage detected