Skip to content

Commit

Permalink
Use Ctrl+Q for Exit and Ctrl+E for Toggle Comment
Browse files Browse the repository at this point in the history
See #58.
  • Loading branch information
magiblot committed Mar 10, 2023
1 parent 907fdaa commit 00df962
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Some of the default keybindings are:
* `Ctrl+X`/`Shift+Del`: cut.
* `Ctrl+Z`, `Ctrl+Y`: undo/redo.
* `Tab`, `Shift+Tab`: indent/unindent.
* `Ctrl+Q`: toggle comment.
* `Ctrl+E`: toggle comment.
* `Ctrl+A`: select all.
* `Shift+Arrow`: extend selection.
* `Ctrl+F`: find.
Expand All @@ -94,14 +94,14 @@ Some of the default keybindings are:
* `Ctrl+S`: save document.
* `Ctrl+W`: close focused document.
* `F6`, `Shift+F6`: next/previous document (in MRU order).
* `Alt+X`: exit the application.
* `Ctrl+Q`/`Alt+X`: exit the application.

In environments with extended keyboard support (e.g. the Linux console, Windows or Kitty ≥ 0.20.0), the following key shortcuts may also work:

* `Ctrl+Shift+Z`: redo.
* `Ctrl+Tab`/`Alt+Tab`, `Ctrl+Shift+Tab`/`Alt+Shift+Tab`: next/previous document (in MRU order).
* `Shift+Enter`: find previous (in the "find" text box).
* `Ctrl+/`: toggle comment.
* `Ctrl+/`/`Ctrl+_`: toggle comment.

Support for these key combinations may vary among terminal applications, but any issue on this should be reported to [Turbo Vision](https://github.com/magiblot/tvision/issues) instead.

Expand Down
4 changes: 2 additions & 2 deletions doc/turbo.1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ As a text editor, Turbo aims at being intuitive and easy to use.
And simply because it is a Turbo Vision application, it offers a vintage look and feel.
.SS User interface shortcuts
.TP
\fBAlt+X\fR
\fBCtrl+Q\fR, \fBAlt+X\fR
Exit Turbo.
.TP
\fBAlt+\fIletter\fR
Expand Down Expand Up @@ -69,7 +69,7 @@ Go to line.
\fBCtrl+L\fR
Delete current line.
.TP
\fBCtrl+Q\fR
\fBCtrl+E\fR, \fBCtrl+/\fR, \fBCtrl+_\fR
Toggle comment.
.TP
\fBCtrl+V\fR, \fBShift+Ins\fR
Expand Down
8 changes: 5 additions & 3 deletions source/turbo/app.cc
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ TMenuBar *TurboApp::initMenuBar(TRect r)
*new TMenuItem( "Close All", cmCloseAll, kbNoKey, hcNoContext ) +
newLine() +
*new TMenuItem( "S~u~spend", cmDosShell, kbNoKey, hcNoContext ) +
*new TMenuItem( "E~x~it", cmQuit, kbAltX, hcNoContext, "Alt-X" ) +
*new TMenuItem( "E~x~it", cmQuit, kbCtrlQ, hcNoContext, "Ctrl-Q" ) +
*new TSubMenu( "~E~dit", kbAltE ) +
*new TMenuItem( "~U~ndo", cmUndo, kbCtrlZ, hcNoContext, "Ctrl-Z" ) +
*new TMenuItem( "Re~d~o", cmRedo, kbCtrlY, hcNoContext, "Ctrl-Y" ) +
Expand All @@ -145,7 +145,7 @@ TMenuBar *TurboApp::initMenuBar(TRect r)
*new TMenuItem( "Find ~N~ext", cmSearchAgain, kbF3, hcNoContext, "F3" ) +
*new TMenuItem( "Find ~P~revious", cmSearchPrev, kbShiftF3, hcNoContext, "Shift-F3" ) +
*new TSubMenu( "Se~l~ection", kbAltL ) +
*new TMenuItem( "~T~oggle Comment", cmToggleComment, kbCtrlQ, hcNoContext, "Ctrl-Q" ) +
*new TMenuItem( "~T~oggle Comment", cmToggleComment, kbCtrlE, hcNoContext, "Ctrl-E" ) +
newLine() +
*new TMenuItem( "~U~ppercase", cmSelUppercase, kbNoKey, hcNoContext ) +
*new TMenuItem( "~L~owercase", cmSelLowercase, kbNoKey, hcNoContext ) +
Expand All @@ -172,11 +172,12 @@ TStatusLine *TurboApp::initStatusLine( TRect r )
r.a.y = r.b.y-1;
return new TStatusLine( r,
*new TStatusDef( 0, 0xFFFF ) +
*new TStatusItem( 0, kbAltX, cmQuit ) +
*new TStatusItem( "~Ctrl-N~ New", kbNoKey, cmNew ) +
*new TStatusItem( "~Ctrl-O~ Open", kbNoKey, cmOpen ) +
*new TStatusItem( "~Ctrl-S~ Save", kbNoKey, cmSave ) +
*new TStatusItem( "~F6~ Next", kbF6, cmEditorNext ) +
*new TStatusItem( "~F12~ Menu" , kbF12, cmMenu ) +
*new TStatusItem( "~F12~ Menu", kbF12, cmMenu ) +
*new TStatusItem( 0, TKey(kbCtrlZ, kbShift), cmRedo ) +
*new TStatusItem( 0, kbCtrlX, cmCut ) +
*new TStatusItem( 0, kbCtrlC, cmCopy ) +
Expand All @@ -190,6 +191,7 @@ TStatusLine *TurboApp::initStatusLine( TRect r )
*new TStatusItem( 0, TKey(kbCtrlTab, kbShift), cmEditorPrev ) +
*new TStatusItem( 0, TKey(kbAltTab, kbShift), cmEditorPrev ) +
*new TStatusItem( 0, TKey('/', kbCtrlShift), cmToggleComment ) +
*new TStatusItem( 0, TKey('_', kbCtrlShift), cmToggleComment ) +
*new TStatusItem( 0, kbF5, cmZoom ) +
*new TStatusItem( 0, kbCtrlF5, cmResize )
);
Expand Down

0 comments on commit 00df962

Please sign in to comment.