diff options
author | pommicket <pommicket@gmail.com> | 2022-07-22 14:54:07 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2022-07-22 14:54:07 -0400 |
commit | 35b1b0129e8791a9412173acf3756606d0cc397d (patch) | |
tree | 6e631f6382cabf4ad2522bf4386828aaabae3347 /menu.c | |
parent | 47a65f608f485af32d2df12be489146ad67839e1 (diff) |
go syntax highlighting
also :goto-line now clamps numbers < 1 and > nlines instead of rejecting them
Diffstat (limited to 'menu.c')
-rw-r--r-- | menu.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -244,7 +244,9 @@ static void menu_update(Ted *ted) { char *end; long line_number = strtol(contents, &end, 0); TextBuffer *buffer = ted->prev_active_buffer; - if (line_number > 0 && *end == '\0' && line_number <= (long)buffer->nlines) { + if (*contents != '\0' && *end == '\0') { + if (line_number < 1) line_number = 1; + if (line_number > buffer->nlines) line_number = (long)buffer->nlines; BufferPos pos = {(u32)line_number - 1, 0}; if (line_buffer->line_buffer_submitted) { |