diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2021-12-09 21:23:03 +0100 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2021-12-09 23:17:29 +0100 |
commit | d9c1669a5474ee0d09dbe60372a2959207187290 (patch) | |
tree | 2f2b3cf29f58c25bfe8e523cac394f8f225bbf52 /src/nvim/misc1.c | |
parent | 51822f065590154561a59435ca920207fd39bdda (diff) | |
download | rneovim-d9c1669a5474ee0d09dbe60372a2959207187290.tar.gz rneovim-d9c1669a5474ee0d09dbe60372a2959207187290.tar.bz2 rneovim-d9c1669a5474ee0d09dbe60372a2959207187290.zip |
refactor(misc1): move out misc functions which obviously belong elsewhere
Also make some function names more descriptive/regular.
Diffstat (limited to 'src/nvim/misc1.c')
-rw-r--r-- | src/nvim/misc1.c | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/src/nvim/misc1.c b/src/nvim/misc1.c index bd2188ec15..103fb3b450 100644 --- a/src/nvim/misc1.c +++ b/src/nvim/misc1.c @@ -373,32 +373,6 @@ int get_last_leader_offset(char_u *line, char_u **flags) return result; } -int gchar_pos(pos_T *pos) - FUNC_ATTR_NONNULL_ARG(1) -{ - // When searching columns is sometimes put at the end of a line. - if (pos->col == MAXCOL) { - return NUL; - } - return utf_ptr2char(ml_get_pos(pos)); -} - -/* - * check_status: called when the status bars for the buffer 'buf' - * need to be updated - */ -void check_status(buf_T *buf) -{ - FOR_ALL_WINDOWS_IN_TAB(wp, curtab) { - if (wp->w_buffer == buf && wp->w_status_height) { - wp->w_redr_status = TRUE; - if (must_redraw < VALID) { - must_redraw = VALID; - } - } - } -} - /// Ask for a reply from the user, 'y' or 'n' /// /// No other characters are accepted, the message is repeated until a valid @@ -972,21 +946,6 @@ done: } /* - * Free the list of files returned by expand_wildcards() or other expansion - * functions. - */ -void FreeWild(int count, char_u **files) -{ - if (count <= 0 || files == NULL) { - return; - } - while (count--) { - xfree(files[count]); - } - xfree(files); -} - -/* * Return TRUE when need to go to Insert mode because of 'insertmode'. * Don't do this when still processing a command or a mapping. * Don't do this when inside a ":normal" command. @@ -995,26 +954,3 @@ int goto_im(void) { return p_im && stuff_empty() && typebuf_typed(); } - -/// Put the timestamp of an undo header in "buf[buflen]" in a nice format. -void add_time(char_u *buf, size_t buflen, time_t tt) -{ - struct tm curtime; - - if (time(NULL) - tt >= 100) { - os_localtime_r(&tt, &curtime); - if (time(NULL) - tt < (60L * 60L * 12L)) { - // within 12 hours - (void)strftime((char *)buf, buflen, "%H:%M:%S", &curtime); - } else { - // longer ago - (void)strftime((char *)buf, buflen, "%Y/%m/%d %H:%M:%S", &curtime); - } - } else { - int64_t seconds = time(NULL) - tt; - vim_snprintf((char *)buf, buflen, - NGETTEXT("%" PRId64 " second ago", - "%" PRId64 " seconds ago", (uint32_t)seconds), - seconds); - } -} |