aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-01-29 23:43:36 +1000
committerDavid Walter Seikel2014-01-29 23:43:36 +1000
commit710d1517f1666a63867ffdb3c94aa738d066ec67 (patch)
tree7661ee83771985273e42ba079e0411aa71a3601f
parentSIGWINCH, the final piece of the terminal resizing puzzle. (diff)
downloadboxes-710d1517f1666a63867ffdb3c94aa738d066ec67.zip
boxes-710d1517f1666a63867ffdb3c94aa738d066ec67.tar.gz
boxes-710d1517f1666a63867ffdb3c94aa738d066ec67.tar.bz2
boxes-710d1517f1666a63867ffdb3c94aa738d066ec67.tar.xz
Clean up some comments.
-rw-r--r--boxes.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/boxes.c b/boxes.c
index bc95825..f04ebec 100644
--- a/boxes.c
+++ b/boxes.c
@@ -196,11 +196,11 @@ GLOBALS(
196 * 196 *
197 * TODO - disentangle boxes from views. 197 * TODO - disentangle boxes from views.
198 * 198 *
199 * TODO - Show status line instead of command line when it's not being edited.
200 *
201 * TODO - should split this up into editing, UI, and boxes parts, 199 * TODO - should split this up into editing, UI, and boxes parts,
202 * so the developer can leave out bits they are not using. 200 * so the developer can leave out bits they are not using.
203 * 201 *
202 * TODO - Show status line instead of command line when it's not being edited.
203 *
204 * TODO - should review it all for UTF8 readiness. Think I can pull that off 204 * TODO - should review it all for UTF8 readiness. Think I can pull that off
205 * by keeping everything on the output side as "screen position", and using 205 * by keeping everything on the output side as "screen position", and using
206 * the formatter to sort out the input to output mapping. 206 * the formatter to sort out the input to output mapping.
@@ -951,8 +951,8 @@ void formatCheckCursor(view *view, long *cX, long *cY, char *input)
951} 951}
952 952
953// TODO - Should convert control characters to reverse video, and deal with UTF8. 953// TODO - Should convert control characters to reverse video, and deal with UTF8.
954/* FIXME - We get passed a NULL input, apparently when the file length is close to the screen length. -
955 954
955/* FIXME - We get passed a NULL input, apparently when the file length is close to the screen length. -
956> On Thu, 6 Sep 2012 11:56:17 +0800 Roy Tam <roytam@gmail.com> wrote: 956> On Thu, 6 Sep 2012 11:56:17 +0800 Roy Tam <roytam@gmail.com> wrote:
957> 957>
958> > 2012/9/6 David Seikel <onefang@gmail.com>: 958> > 2012/9/6 David Seikel <onefang@gmail.com>:
@@ -1821,16 +1821,6 @@ static struct keyCommand * lineCommand(long extra, char *command)
1821 return currentBox->view->content->context->modes[currentBox->view->mode].keys; 1821 return currentBox->view->content->context->modes[currentBox->view->mode].keys;
1822} 1822}
1823 1823
1824// Basically this is the main loop.
1825
1826/* Unhandled complications -
1827Less and more have the "ZZ" command, but nothing else seems to have multi ordinary character commands.
1828
1829Some editors have a shortcut command concept. The smallest unique first part of each command will match, as well as anything longer.
1830 A further complication is if we are not implementing some commands that might change what is "shortest unique prefix".
1831*/
1832
1833
1834char *termSize(long extra, int *params, int count) 1824char *termSize(long extra, int *params, int count)
1835{ 1825{
1836 struct _view *view = (struct _view *) extra; // Though we pretty much stomp on this straight away. 1826 struct _view *view = (struct _view *) extra; // Though we pretty much stomp on this straight away.
@@ -1871,6 +1861,15 @@ struct CSI CSI_terminators[] =
1871 {NULL, NULL} 1861 {NULL, NULL}
1872}; 1862};
1873 1863
1864// Basically this is the main loop.
1865
1866/* Unhandled complications -
1867Less and more have the "ZZ" command, but nothing else seems to have multi ordinary character commands.
1868
1869Some editors have a shortcut command concept. The smallest unique first part of each command will match, as well as anything longer.
1870 A further complication is if we are not implementing some commands that might change what is "shortest unique prefix".
1871*/
1872
1874void editLine(long extra, void (*lineChar)(long extra, char *buffer), struct keyCommand * (*lineCommand)(long extra, char *command)) 1873void editLine(long extra, void (*lineChar)(long extra, char *buffer), struct keyCommand * (*lineCommand)(long extra, char *command))
1875{ 1874{
1876 struct pollfd pollfds[1]; 1875 struct pollfd pollfds[1];
@@ -2015,12 +2014,12 @@ void editLine(long extra, void (*lineChar)(long extra, char *buffer), struct key
2015 { 2014 {
2016 /* ECMA-048 section 5.2 defines this, and is unreadable. 2015 /* ECMA-048 section 5.2 defines this, and is unreadable.
2017 General CSI format - CSI [private] n1 ; n2 [extra] final 2016 General CSI format - CSI [private] n1 ; n2 [extra] final
2018 private 0x3c to 0x3f [<=>?] if first byte is one of these, this is a private command, if it's one of the other n1 ones, it's not private. 2017 private 0x3c to 0x3f "<=>?" if first byte is one of these, this is a private command, if it's one of the other n1 ones, it's not private.
2019 n1 0x30 to 0x3f [01234567890:;<=>?] ASCII digits forming a "number" 2018 n1 0x30 to 0x3f "01234567890:;<=>?" ASCII digits forming a "number"
2020 0x3a [:] used for floats, not expecting any. Could also be used as some other sort of inter digit separator. 2019 0x3a [:] used for floats, not expecting any. Could also be used as some other sort of inter digit separator.
2021 0x3b [;] separates the parameters 2020 0x3b [;] separates the parameters
2022 extra 0x20 to 0x2f [ !"#$%&'()*+,-./] Can be multiple, likely isn't. 2021 extra 0x20 to 0x2f [ !"#$%&'()*+,-./] Can be multiple, likely isn't.
2023 final 0x40 to 0x7e "@A .. Z[\]^_`a .. z{|}~" it's private if 0x70 to 0x7e [p ..z{|}~] 2022 final 0x40 to 0x7e "@A .. Z[\]^_`a .. z{|}~" it's private if 0x70 to 0x7e "p .. z{|}~"
2024 Though the "private" ~ is used for key codes. 2023 Though the "private" ~ is used for key codes.
2025 We also have SS3 "\x1BO" for other keys, but that's not a CSI. 2024 We also have SS3 "\x1BO" for other keys, but that's not a CSI.
2026 C0 controls, DEL (0x7f), or high characters are undefined. 2025 C0 controls, DEL (0x7f), or high characters are undefined.
@@ -2195,7 +2194,8 @@ struct keyCommand simpleCommandKeys[] =
2195}; 2194};
2196 2195
2197 2196
2198// TODO - simple emacs editor. 2197// Construct a simple emacs editor.
2198
2199// Mostly control keys, some meta keys. 2199// Mostly control keys, some meta keys.
2200// Ctrl-h and Ctrl-x have more keys in the commands. Some of those extra keys are commands by themselves. Up to "Ctrl-x 4 Ctrl-g" which apparently is identical to just Ctrl-g. shrugs 2200// Ctrl-h and Ctrl-x have more keys in the commands. Some of those extra keys are commands by themselves. Up to "Ctrl-x 4 Ctrl-g" which apparently is identical to just Ctrl-g. shrugs
2201// Ctrl-h is backspace / del. Pffft. 2201// Ctrl-h is backspace / del. Pffft.
@@ -2422,7 +2422,7 @@ struct keyCommand simpleLessKeys[] =
2422 {"End", "endOfLine"}, 2422 {"End", "endOfLine"},
2423 {"q", "quit"}, 2423 {"q", "quit"},
2424 {":q", "quit"}, // TODO - A vi ism, should do ex command stuff instead. 2424 {":q", "quit"}, // TODO - A vi ism, should do ex command stuff instead.
2425// {"ZZ", "quit"}, // The infrastructure here does not support this style of command. 2425 {"ZZ", "quit"}, // The infrastructure here does not support this style of command.
2426 {"PgDn", "downPage"}, 2426 {"PgDn", "downPage"},
2427 {"f", "downPage"}, 2427 {"f", "downPage"},
2428 {" ", "downPage"}, 2428 {" ", "downPage"},
@@ -2459,7 +2459,7 @@ struct keyCommand simpleMoreKeys[] =
2459 {"Return", "downLine"}, 2459 {"Return", "downLine"},
2460 {"q", "quit"}, 2460 {"q", "quit"},
2461 {":q", "quit"}, // See comments for "less". 2461 {":q", "quit"}, // See comments for "less".
2462// {"ZZ", "quit"}, // See comments for "less". 2462 {"ZZ", "quit"}, // See comments for "less".
2463 {"f", "downPage"}, 2463 {"f", "downPage"},
2464 {" ", "downPage"}, 2464 {" ", "downPage"},
2465 {"^F", "downPage"}, 2465 {"^F", "downPage"},
@@ -2871,9 +2871,9 @@ void boxes_main(void)
2871 PARENB enable parity 2871 PARENB enable parity
2872 CS8 8 bit characters 2872 CS8 8 bit characters
2873 2873
2874 VEOF "sends" EOF on ^D 2874 VEOF "sends" EOF on ^D, ICANON turns that on.
2875 VSTART restart output on ^Q, IXON turns that on. 2875 VSTART restart output on ^Q, IXON turns that on.
2876 VSTATUS display status info and sends SIGINFO on ^T. Not in POSIX, not supported in Linux. Does not seem to be any method of turning it off where it is supported. 2876 VSTATUS display status info and sends SIGINFO (STATUS) on ^T. Not in POSIX, not supported in Linux. ICANON turns that on.
2877 VSTOP stop output on ^S, IXON turns that on. 2877 VSTOP stop output on ^S, IXON turns that on.
2878 */ 2878 */
2879 termio.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IUCLC | IXON | IXOFF | IXANY); 2879 termio.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IUCLC | IXON | IXOFF | IXANY);