Skip to content

Commit 9fef8ef

Browse files
committed
GUI - add M-u for upcasing next word or selection
1 parent c3f7afe commit 9fef8ef

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

app/gui/qt/mainwindow.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,9 @@ MainWindow::MainWindow(QApplication &app, QSplashScreen* splash)
218218
QShortcut *cutToBuffer = new QShortcut(ctrlKey(']'), workspace);
219219
connect(cutToBuffer, SIGNAL(activated()), workspace, SLOT(cut()));
220220

221+
//upcase next word
222+
QShortcut *upcaseWord= new QShortcut(metaKey('u'), workspace);
223+
connect(upcaseWord, SIGNAL(activated()), workspace, SLOT(upcaseWordOrSelection()));
221224

222225
//Goto nth Tab
223226
QShortcut *changeTab = new QShortcut(metaKey(int2char(ws)), this);

app/gui/qt/sonicpiscintilla.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,3 +387,14 @@ void SonicPiScintilla::moveLines(int numLines) {
387387
}
388388
}
389389
}
390+
391+
void SonicPiScintilla::upcaseWordOrSelection(){
392+
if(hasSelectedText()) {
393+
SendScintilla(SCI_UPPERCASE);
394+
} else {
395+
setMark();
396+
SendScintilla(SCI_WORDRIGHT);
397+
SendScintilla(SCI_UPPERCASE);
398+
deselect();
399+
}
400+
}

app/gui/qt/sonicpiscintilla.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class SonicPiScintilla : public QsciScintilla
4747
int incLineNumWithinBounds(int linenum, int inc);
4848
void moveLines(int numLines);
4949
void deselect();
50+
void upcaseWordOrSelection();
5051

5152
private:
5253
void addKeyBinding(QSettings &qs, int cmd, int key);

0 commit comments

Comments
 (0)