MCPcopy Create free account
hub / github.com/SpartanJ/eepp / createCodeEditor

Method createCodeEditor

src/eepp/ui/tools/uicodeeditorsplitter.cpp:147–296  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145}
146
147UICodeEditor* 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(); } );

Callers

nothing calls this directly

Calls 15

registerSplitterCommandsFunction · 0.85
getDocumentMethod · 0.80
moveScrollUpMethod · 0.80
moveScrollDownMethod · 0.80
jumpLinesUpMethod · 0.80
jumpLinesDownMethod · 0.80
isLockedMethod · 0.80
addUnlockedCommandMethod · 0.80
rbeginMethod · 0.80
openContainingFolderMethod · 0.80
copyFilePathMethod · 0.80

Tested by

no test coverage detected