Skip to content

Commit

Permalink
Merge tag 'v0.4.4'
Browse files Browse the repository at this point in the history
NVIM v0.4.4

Maintenance release for v0.4.x series.

FIXES:

fd02e63 neovim#12701 ui: fix problem with sattr_T overflow
3e3002b neovim#12710 fs: Ensure FileInfo struct is initialized
e4629f2 neovim#12496 main.c: fix hang issue with recoverymode neovim#12520
f558af8 neovim#12209 fixed hang issue with --headless and -r option specified
cda1190 neovim#12180 TUI: block signals on suspend
8399f73 neovim#12142 Fix issues revealed by gcc10 setting -fno-common by default
5e47cf2 netrw.vim: do not save +/* registers
5d41bfc neovim#11907 quickfix.c: Fix vimgrep regression
641e229 neovim#11903 screen: add missing redraws after a message
47bd62c loop_close: close all handles
d273036 loop_close: call uv_stop(), fix bug
284b398 neovim#11821 loop_close: timout after 2 seconds
1b2666c messages: echo "line1\r\nline2" should not clear line1
1bf90bf neovim#11651 API: fix crash on copy_object(kObjectTypeWindow)
fafd636 neovim#11566 libcallnr: Use int, not int64_t, as the return type for Vim compat
972dd75 neovim#11460 win_line: Fix crash with 'rightleft' in :terminal
4c48cf3 f_getenv/setenv: Access v_special when v_type is VAR_SPECIAL
2cd1ff7 neovim#11360 paste: Select-mode, Visual-mode
  • Loading branch information
qvacua committed Aug 12, 2020
2 parents 4cff4dc + ee77d86 commit 4e6e090
Show file tree
Hide file tree
Showing 48 changed files with 659 additions and 165 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ addons:
- valgrind
- xclip
homebrew:
update: false
update: true
packages:
- ccache
- ninja
Expand Down
17 changes: 11 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
# version string, else they are combined with the result of `git describe`.
set(NVIM_VERSION_MAJOR 0)
set(NVIM_VERSION_MINOR 4)
set(NVIM_VERSION_PATCH 3)
set(NVIM_VERSION_PATCH 4)
set(NVIM_VERSION_PRERELEASE "") # for package maintainers

# API level
Expand Down Expand Up @@ -315,6 +315,11 @@ if(UNIX)
endif()
endif()

check_c_compiler_flag(-fno-common HAVE_FNO_COMMON)
if (HAVE_FNO_COMMON)
add_compile_options(-fno-common)
endif()

check_c_compiler_flag(-fdiagnostics-color=auto HAS_DIAG_COLOR_FLAG)
if(HAS_DIAG_COLOR_FLAG)
if(CMAKE_GENERATOR MATCHES "Ninja")
Expand Down Expand Up @@ -465,17 +470,17 @@ if((CLANG_ASAN_UBSAN OR CLANG_MSAN OR CLANG_TSAN) AND NOT CMAKE_C_COMPILER_ID MA
message(FATAL_ERROR "Sanitizers are only supported for Clang")
endif()

if(ENABLE_LIBICONV)
find_package(Iconv REQUIRED)
include_directories(SYSTEM ${Iconv_INCLUDE_DIRS})
endif()

if(ENABLE_LIBINTL)
# LibIntl (not Intl) selects our FindLibIntl.cmake script. #8464
find_package(LibIntl REQUIRED)
include_directories(SYSTEM ${LibIntl_INCLUDE_DIRS})
endif()

if(ENABLE_LIBICONV)
find_package(Iconv REQUIRED)
include_directories(SYSTEM ${Iconv_INCLUDE_DIRS})
endif()

# Determine platform's threading library. Set CMAKE_THREAD_PREFER_PTHREAD
# explicitly to indicate a strong preference for pthread.
set(CMAKE_THREAD_PREFER_PTHREAD ON)
Expand Down
2 changes: 1 addition & 1 deletion ci/before_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if [[ "${TRAVIS_OS_NAME}" != osx ]] && command -v pyenv; then
echo 'Setting Python versions via pyenv'

# Prefer Python 2 over 3 (more conservative).
pyenv global 2.7.15:3.7
pyenv global 2.7.15:3.7.1

echo 'Updated Python info:'
(
Expand Down
6 changes: 6 additions & 0 deletions cmake/FindLibIntl.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ endif()
if (LibIntl_LIBRARY)
list(APPEND CMAKE_REQUIRED_LIBRARIES "${LibIntl_LIBRARY}")
endif()
if (MSVC)
list(APPEND CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARY})
endif()
check_c_source_compiles("
#include <libintl.h>
Expand All @@ -57,6 +60,9 @@ int main(int argc, char** argv) {
bind_textdomain_codeset(\"foo\", \"bar\");
textdomain(\"foo\");
}" HAVE_WORKING_LIBINTL)
if (MSVC)
list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARY})
endif()
if (LibIntl_INCLUDE_DIR)
list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES "${LibIntl_INCLUDE_DIR}")
endif()
Expand Down
36 changes: 0 additions & 36 deletions runtime/autoload/netrw.vim
Original file line number Diff line number Diff line change
Expand Up @@ -688,10 +688,6 @@ fun! netrw#Explore(indx,dosplit,style,...)
endif

" save registers
if has("clipboard")
sil! let keepregstar = @*
sil! let keepregplus = @+
endif
sil! let keepregslash= @/

" if dosplit
Expand Down Expand Up @@ -915,10 +911,6 @@ fun! netrw#Explore(indx,dosplit,style,...)
" call Decho("..case Nexplore with starpat=".starpat.": (indx=".indx.")",'~'.expand("<slnum>"))
if !exists("w:netrw_explore_list") " sanity check
NetrwKeepj call netrw#ErrorMsg(s:WARNING,"using Nexplore or <s-down> improperly; see help for netrw-starstar",40)
if has("clipboard")
sil! let @* = keepregstar
sil! let @+ = keepregplus
endif
sil! let @/ = keepregslash
" call Dret("netrw#Explore")
return
Expand All @@ -940,10 +932,6 @@ fun! netrw#Explore(indx,dosplit,style,...)
" call Decho("case Pexplore with starpat=".starpat.": (indx=".indx.")",'~'.expand("<slnum>"))
if !exists("w:netrw_explore_list") " sanity check
NetrwKeepj call netrw#ErrorMsg(s:WARNING,"using Pexplore or <s-up> improperly; see help for netrw-starstar",41)
if has("clipboard")
sil! let @* = keepregstar
sil! let @+ = keepregplus
endif
sil! let @/ = keepregslash
" call Dret("netrw#Explore")
return
Expand Down Expand Up @@ -995,10 +983,6 @@ fun! netrw#Explore(indx,dosplit,style,...)
catch /^Vim\%((\a\+)\)\=:E480/
keepalt call netrw#ErrorMsg(s:WARNING,'no files matched pattern<'.pattern.'>',45)
if &hls | let keepregslash= s:ExplorePatHls(pattern) | endif
if has("clipboard")
sil! let @* = keepregstar
sil! let @+ = keepregplus
endif
sil! let @/ = keepregslash
" call Dret("netrw#Explore : no files matched pattern")
return
Expand Down Expand Up @@ -1031,10 +1015,6 @@ fun! netrw#Explore(indx,dosplit,style,...)

if w:netrw_explore_listlen == 0 || (w:netrw_explore_listlen == 1 && w:netrw_explore_list[0] =~ '\*\*\/')
keepalt NetrwKeepj call netrw#ErrorMsg(s:WARNING,"no files matched",42)
if has("clipboard")
sil! let @* = keepregstar
sil! let @+ = keepregplus
endif
sil! let @/ = keepregslash
" call Dret("netrw#Explore : no files matched")
return
Expand Down Expand Up @@ -1079,10 +1059,6 @@ fun! netrw#Explore(indx,dosplit,style,...)
if !exists("g:netrw_quiet")
keepalt NetrwKeepj call netrw#ErrorMsg(s:WARNING,"your vim needs the +path_extra feature for Exploring with **!",44)
endif
if has("clipboard")
sil! let @* = keepregstar
sil! let @+ = keepregplus
endif
sil! let @/ = keepregslash
" call Dret("netrw#Explore : missing +path_extra")
return
Expand Down Expand Up @@ -1152,10 +1128,6 @@ fun! netrw#Explore(indx,dosplit,style,...)
" there's no danger of a late FocusGained event on initialization.
" Consequently, set s:netrw_events to 2.
let s:netrw_events= 2
if has("clipboard")
sil! let @* = keepregstar
sil! let @+ = keepregplus
endif
sil! let @/ = keepregslash
" call Dret("netrw#Explore : @/<".@/.">")
endfun
Expand Down Expand Up @@ -9559,10 +9531,6 @@ fun! s:NetrwWideListing()
let newcolstart = w:netrw_bannercnt + fpc
let newcolend = newcolstart + fpc - 1
" call Decho("bannercnt=".w:netrw_bannercnt." fpl=".w:netrw_fpl." fpc=".fpc." newcol[".newcolstart.",".newcolend."]",'~'.expand("<slnum>"))
if has("clipboard")
sil! let keepregstar = @*
sil! let keepregplus = @+
endif
while line("$") >= newcolstart
if newcolend > line("$") | let newcolend= line("$") | endif
let newcolqty= newcolend - newcolstart
Expand All @@ -9575,10 +9543,6 @@ fun! s:NetrwWideListing()
exe "sil! NetrwKeepj ".newcolstart.','.newcolend.'d _'
exe 'sil! NetrwKeepj '.w:netrw_bannercnt
endwhile
if has("clipboard")
sil! let @*= keepregstar
sil! let @+= keepregplus
endif
exe "sil! NetrwKeepj ".w:netrw_bannercnt.',$s/\s\+$//e'
NetrwKeepj call histdel("/",-1)
exe 'nno <buffer> <silent> w :call search(''^.\\|\s\s\zs\S'',''W'')'."\<cr>"
Expand Down
3 changes: 3 additions & 0 deletions runtime/autoload/provider/node.vim
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ function! provider#node#Detect() abort
if exists('g:node_host_prog')
return expand(g:node_host_prog)
endif
if !executable('node')
return ''
endif
if !s:is_minimum_version(v:null, 6, 0)
return ''
endif
Expand Down
10 changes: 5 additions & 5 deletions runtime/doc/options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2348,7 +2348,7 @@ A jump table for the options with a short description can be found at |Q_op|.

*'fillchars'* *'fcs'*
'fillchars' 'fcs' string (default "")
local to window
global or local to window |global-local|
Characters to fill the statuslines and vertical separators.
It is a comma separated list of items:

Expand Down Expand Up @@ -3657,7 +3657,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'listchars'* *'lcs'*
'listchars' 'lcs' string (default: "tab:> ,trail:-,nbsp:+"
Vi default: "eol:$")
local to window
global or local to window |global-local|
Strings to use in 'list' mode and for the |:list| command. It is a
comma separated list of string settings.

Expand Down Expand Up @@ -3698,9 +3698,9 @@ A jump table for the options with a short description can be found at |Q_op|.
off and the line continues beyond the right of the
screen.
*lcs-precedes*
precedes:c Character to show in the first column, when 'wrap'
is off and there is text preceding the character
visible in the first column.
precedes:c Character to show in the first visible column of the
physical line, when there is text preceding the
character visible in the first column.
*lcs-conceal*
conceal:c Character to show in place of concealed text, when
'conceallevel' is set to 1. A space when omitted.
Expand Down
1 change: 1 addition & 0 deletions runtime/nvim.appdata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
</screenshots>

<releases>
<release date="2019-11-06" version="0.4.3"/>
<release date="2019-09-15" version="0.4.2"/>
<release date="2019-09-15" version="0.4.1"/>
<release date="2019-09-15" version="0.4.0"/>
Expand Down
3 changes: 3 additions & 0 deletions src/nvim/api/private/helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -1363,6 +1363,9 @@ Dictionary copy_dictionary(Dictionary dict)
Object copy_object(Object obj)
{
switch (obj.type) {
case kObjectTypeBuffer:
case kObjectTypeTabpage:
case kObjectTypeWindow:
case kObjectTypeNil:
case kObjectTypeBoolean:
case kObjectTypeInteger:
Expand Down
4 changes: 2 additions & 2 deletions src/nvim/api/vim.c
Original file line number Diff line number Diff line change
Expand Up @@ -1267,7 +1267,7 @@ Boolean nvim_paste(String data, Boolean crlf, Integer phase, Error *err)
draining = true;
goto theend;
}
if (!(State & CMDLINE) && !(State & INSERT) && (phase == -1 || phase == 1)) {
if (!(State & (CMDLINE | INSERT)) && (phase == -1 || phase == 1)) {
ResetRedobuff();
AppendCharToRedobuff('a'); // Dot-repeat.
}
Expand All @@ -1285,7 +1285,7 @@ Boolean nvim_paste(String data, Boolean crlf, Integer phase, Error *err)
}
}
}
if (!(State & CMDLINE) && !(State & INSERT) && (phase == -1 || phase == 3)) {
if (!(State & (CMDLINE | INSERT)) && (phase == -1 || phase == 3)) {
AppendCharToRedobuff(ESC); // Dot-repeat.
}
theend:
Expand Down
12 changes: 12 additions & 0 deletions src/nvim/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -3530,8 +3530,20 @@ int build_stl_str_hl(
}
}
if (n == curitem && group_start_userhl == group_end_userhl) {
// empty group
out_p = t;
group_len = 0;
for (n = groupitems[groupdepth] + 1; n < curitem; n++) {
// do not use the highlighting from the removed group
if (items[n].type == Highlight) {
items[n].type = Empty;
}
// adjust the start position of TabPage to the next
// item position
if (items[n].type == TabPage) {
items[n].start = out_p;
}
}
}
}

Expand Down
1 change: 0 additions & 1 deletion src/nvim/channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "nvim/ascii.h"

static bool did_stdio = false;
PMap(uint64_t) *channels = NULL;

/// next free id for a job or rpc channel
/// 1 is reserved for stdio channel
Expand Down
2 changes: 1 addition & 1 deletion src/nvim/channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ struct Channel {
bool callback_scheduled;
};

EXTERN PMap(uint64_t) *channels;
EXTERN PMap(uint64_t) *channels INIT(= NULL);

#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "channel.h.generated.h"
Expand Down
19 changes: 11 additions & 8 deletions src/nvim/eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -8493,7 +8493,7 @@ static void f_getenv(typval_T *argvars, typval_T *rettv, FunPtr fptr)

if (p == NULL) {
rettv->v_type = VAR_SPECIAL;
rettv->vval.v_number = kSpecialVarNull;
rettv->vval.v_special = kSpecialVarNull;
return;
}
rettv->vval.v_string = p;
Expand Down Expand Up @@ -12656,7 +12656,7 @@ static void libcall_common(typval_T *argvars, typval_T *rettv, int out_type)
const char *libname = (char *) argvars[0].vval.v_string;
const char *funcname = (char *) argvars[1].vval.v_string;

int in_type = argvars[2].v_type;
VarType in_type = argvars[2].v_type;

// input variables
char *str_in = (in_type == VAR_STRING)
Expand All @@ -12665,8 +12665,8 @@ static void libcall_common(typval_T *argvars, typval_T *rettv, int out_type)

// output variables
char **str_out = (out_type == VAR_STRING)
? (char **) &rettv->vval.v_string : NULL;
int64_t int_out = 0;
? (char **)&rettv->vval.v_string : NULL;
int int_out = 0;

bool success = os_libcall(libname, funcname,
str_in, int_in,
Expand All @@ -12678,7 +12678,7 @@ static void libcall_common(typval_T *argvars, typval_T *rettv, int out_type)
}

if (out_type == VAR_NUMBER) {
rettv->vval.v_number = (int) int_out;
rettv->vval.v_number = (varnumber_T)int_out;
}
}

Expand Down Expand Up @@ -15446,7 +15446,7 @@ static void f_setenv(typval_T *argvars, typval_T *rettv, FunPtr fptr)
const char *name = tv_get_string_buf(&argvars[0], namebuf);

if (argvars[1].v_type == VAR_SPECIAL
&& argvars[1].vval.v_number == kSpecialVarNull) {
&& argvars[1].vval.v_special == kSpecialVarNull) {
os_unsetenv(name);
} else {
os_setenv(name, tv_get_string_buf(&argvars[1], valbuf), 1);
Expand Down Expand Up @@ -20877,6 +20877,7 @@ void ex_echo(exarg_T *eap)
char_u *arg = eap->arg;
typval_T rettv;
bool atstart = true;
bool need_clear = true;
const int did_emsg_before = did_emsg;

if (eap->skip)
Expand Down Expand Up @@ -20919,7 +20920,7 @@ void ex_echo(exarg_T *eap)
char *tofree = encode_tv2echo(&rettv, NULL);
if (*tofree != NUL) {
msg_ext_set_kind("echo");
msg_multiline_attr(tofree, echo_attr, true);
msg_multiline_attr(tofree, echo_attr, true, &need_clear);
}
xfree(tofree);
}
Expand All @@ -20932,7 +20933,9 @@ void ex_echo(exarg_T *eap)
emsg_skip--;
} else {
// remove text that may still be there from the command
msg_clr_eos();
if (need_clear) {
msg_clr_eos();
}
if (eap->cmdidx == CMD_echo) {
msg_end();
}
Expand Down
Loading

0 comments on commit 4e6e090

Please sign in to comment.