diff options
author | ckelsel <ckelsel@hotmail.com> | 2017-10-07 18:14:09 +0800 |
---|---|---|
committer | ckelsel <ckelsel@hotmail.com> | 2017-10-07 18:14:09 +0800 |
commit | f2b9ccec106b6c4619cc762ea77546810f1cbfd4 (patch) | |
tree | 93fb82598ecf1d227137cd093c16cc14b537e76c /src | |
parent | fae55937ac31c0d61c2c89ed0e9be43f3bd2a759 (diff) | |
parent | 01487d4385aeffae4b2365689c7d798f740f7100 (diff) | |
download | rneovim-f2b9ccec106b6c4619cc762ea77546810f1cbfd4.tar.gz rneovim-f2b9ccec106b6c4619cc762ea77546810f1cbfd4.tar.bz2 rneovim-f2b9ccec106b6c4619cc762ea77546810f1cbfd4.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/buffer.c | 10 | ||||
-rw-r--r-- | src/nvim/gettext.h | 1 | ||||
-rw-r--r-- | src/nvim/main.c | 5 | ||||
-rw-r--r-- | src/nvim/options.lua | 2 | ||||
-rw-r--r-- | src/nvim/path.c | 10 |
5 files changed, 22 insertions, 6 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 724a8578ac..fbfb4e02ea 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -3069,9 +3069,13 @@ static bool ti_change(char_u *str, char_u **last) /// Set current window title void resettitle(void) { - ui_call_set_title(cstr_as_string((char *)lasttitle)); - ui_call_set_icon(cstr_as_string((char *)lasticon)); - ui_flush(); + if (p_icon) { + ui_call_set_icon(cstr_as_string((char *)lasticon)); + } + if (p_title || p_icon) { + ui_call_set_title(cstr_as_string((char *)lasttitle)); + ui_flush(); + } } # if defined(EXITFREE) diff --git a/src/nvim/gettext.h b/src/nvim/gettext.h index aa0e97233e..60317b8484 100644 --- a/src/nvim/gettext.h +++ b/src/nvim/gettext.h @@ -13,6 +13,7 @@ #else # define _(x) ((char *)(x)) # define N_(x) x +# define ngettext(x, xs, n) ((n) == 1 ? (x) : (xs)) # define bindtextdomain(x, y) // empty # define bind_textdomain_codeset(x, y) // empty # define textdomain(x) // empty diff --git a/src/nvim/main.c b/src/nvim/main.c index 024c56dd05..ea7a58bda3 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -649,6 +649,11 @@ void getout(int exitval) /* Position the cursor again, the autocommands may have moved it */ ui_cursor_goto((int)Rows - 1, 0); + // Apply 'titleold'. + if (p_title && *p_titleold != NUL) { + ui_call_set_title(cstr_as_string((char *)p_titleold)); + } + #if defined(USE_ICONV) && defined(DYNAMIC_ICONV) iconv_end(); #endif diff --git a/src/nvim/options.lua b/src/nvim/options.lua index 103227f6b5..84ccb2e28d 100644 --- a/src/nvim/options.lua +++ b/src/nvim/options.lua @@ -2498,7 +2498,7 @@ return { no_mkrc=true, vi_def=true, varname='p_titleold', - defaults={if_true={vi=N_("Thanks for flying Vim")}} + defaults={if_true={vi=N_("")}} }, { full_name='titlestring', diff --git a/src/nvim/path.c b/src/nvim/path.c index f2339c8046..51adcfb135 100644 --- a/src/nvim/path.c +++ b/src/nvim/path.c @@ -1690,6 +1690,9 @@ int vim_FullName(const char *fname, char *buf, size_t len, bool force) if (strlen(fname) > (len - 1)) { xstrlcpy(buf, fname, len); // truncate +#ifdef WIN32 + slash_adjust(buf); +#endif return FAIL; } @@ -1702,6 +1705,9 @@ int vim_FullName(const char *fname, char *buf, size_t len, bool force) if (rv == FAIL) { xstrlcpy(buf, fname, len); // something failed; use the filename } +#ifdef WIN32 + slash_adjust(buf); +#endif return rv; } @@ -2196,11 +2202,11 @@ static int path_get_absolute_path(const char_u *fname, char_u *buf, // expand it if forced or not an absolute path if (force || !path_is_absolute_path(fname)) { - if ((p = vim_strrchr(fname, '/')) != NULL) { + if ((p = vim_strrchr(fname, PATHSEP)) != NULL) { // relative to root if (p == fname) { // only one path component - relative_directory[0] = '/'; + relative_directory[0] = PATHSEP; relative_directory[1] = NUL; } else { assert(p >= fname); |