mirror of
https://github.com/neovim/neovim
synced 2025-07-23 14:51:52 +00:00
Compare commits
18 Commits
release-0.
...
v0.3.7
Author | SHA1 | Date | |
---|---|---|---|
ede21f9518 | |||
361d4be588 | |||
bd4bb61f35 | |||
8a6bb66e80 | |||
4553fc5e6c | |||
877d539904 | |||
60c3c92db1 | |||
d7cf93ce34 | |||
1060bfd033 | |||
f891131c6b | |||
9a5488c2a6 | |||
1793ba8176 | |||
947069ba14 | |||
46c7e12f27 | |||
b98be54148 | |||
f1843c0035 | |||
1204421888 | |||
aaa8c3d711 |
@ -112,8 +112,8 @@ set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
|
|||||||
# version string, else they are combined with the result of `git describe`.
|
# version string, else they are combined with the result of `git describe`.
|
||||||
set(NVIM_VERSION_MAJOR 0)
|
set(NVIM_VERSION_MAJOR 0)
|
||||||
set(NVIM_VERSION_MINOR 3)
|
set(NVIM_VERSION_MINOR 3)
|
||||||
set(NVIM_VERSION_PATCH 5)
|
set(NVIM_VERSION_PATCH 7)
|
||||||
set(NVIM_VERSION_PRERELEASE "-dev") # for package maintainers
|
set(NVIM_VERSION_PRERELEASE "") # for package maintainers
|
||||||
|
|
||||||
# API level
|
# API level
|
||||||
set(NVIM_API_LEVEL 5) # Bump this after any API change.
|
set(NVIM_API_LEVEL 5) # Bump this after any API change.
|
||||||
|
@ -24,29 +24,34 @@ Nvim supports Python |remote-plugin|s and the Vim legacy |python2| and
|
|||||||
|python3| interfaces (which are implemented as remote-plugins).
|
|python3| interfaces (which are implemented as remote-plugins).
|
||||||
Note: Only the Vim 7.3 API is supported; bindeval (Vim 7.4) is not.
|
Note: Only the Vim 7.3 API is supported; bindeval (Vim 7.4) is not.
|
||||||
|
|
||||||
|
|
||||||
PYTHON QUICKSTART ~
|
PYTHON QUICKSTART ~
|
||||||
|
|
||||||
Install the "pynvim" Python package:
|
To use Python plugins, you need the "pynvim" module. Run |:checkhealth| to see
|
||||||
|
if you already have it (some package managers install the module with Nvim
|
||||||
|
itself).
|
||||||
|
|
||||||
- Run |:checkhealth| to see if you already have the package (some package
|
For Python 3 plugins:
|
||||||
managers install the "pynvim" Python package with Nvim itself).
|
1. Make sure Python 3.4+ is available in your $PATH.
|
||||||
|
2. Install the module (try "pip" if "pip3" is missing): >
|
||||||
|
pip3 install --user --upgrade pynvim
|
||||||
|
|
||||||
- For Python 2 plugins, make sure Python 2.7 is available in your $PATH, then
|
For Python 2 plugins:
|
||||||
install the package systemwide: >
|
1. Make sure Python 2.7 is available in your $PATH.
|
||||||
sudo pip2 install --upgrade pynvim
|
2. Install the module (try "pip" if "pip2" is missing): >
|
||||||
< or for the current user: >
|
pip2 install --user --upgrade pynvim
|
||||||
pip2 install --user --upgrade pynvim
|
|
||||||
< If "pip2" is missing, try "pip".
|
|
||||||
|
|
||||||
- For Python 3 plugins, make sure Python 3.4+ is available in your $PATH, then
|
The pip `--upgrade` flag ensures that you get the latest version even if
|
||||||
install the package systemwide: >
|
a previous version was already installed.
|
||||||
sudo pip3 install --upgrade pynvim
|
|
||||||
< or for the current user: >
|
See also |python-virtualenv|.
|
||||||
pip3 install --user --upgrade pynvim
|
|
||||||
< If "pip3" is missing, try "pip".
|
Note: The old "neovim" module was renamed to "pynvim".
|
||||||
|
https://github.com/neovim/neovim/wiki/Following-HEAD#20181118
|
||||||
|
If you run into problems, uninstall _both_ then install "pynvim" again: >
|
||||||
|
pip uninstall neovim pynvim
|
||||||
|
pip install pynvim
|
||||||
|
|
||||||
- The `--upgrade` flag ensures you have the latest version even if a previous
|
|
||||||
version was already installed.
|
|
||||||
|
|
||||||
PYTHON PROVIDER CONFIGURATION ~
|
PYTHON PROVIDER CONFIGURATION ~
|
||||||
*g:python_host_prog*
|
*g:python_host_prog*
|
||||||
@ -67,8 +72,9 @@ To disable Python 2 support: >
|
|||||||
To disable Python 3 support: >
|
To disable Python 3 support: >
|
||||||
let g:loaded_python3_provider = 1
|
let g:loaded_python3_provider = 1
|
||||||
|
|
||||||
PYTHON VIRTUALENVS ~
|
|
||||||
|
|
||||||
|
PYTHON VIRTUALENVS ~
|
||||||
|
*python-virtualenv*
|
||||||
If you plan to use per-project virtualenvs often, you should assign one
|
If you plan to use per-project virtualenvs often, you should assign one
|
||||||
virtualenv for Neovim and hard-code the interpreter path via
|
virtualenv for Neovim and hard-code the interpreter path via
|
||||||
|g:python3_host_prog| (or |g:python_host_prog|) so that the "pynvim" package
|
|g:python3_host_prog| (or |g:python_host_prog|) so that the "pynvim" package
|
||||||
@ -91,6 +97,7 @@ Ruby integration *provider-ruby*
|
|||||||
Nvim supports Ruby |remote-plugin|s and the Vim legacy |ruby-vim| interface
|
Nvim supports Ruby |remote-plugin|s and the Vim legacy |ruby-vim| interface
|
||||||
(which is itself implemented as a Nvim remote-plugin).
|
(which is itself implemented as a Nvim remote-plugin).
|
||||||
|
|
||||||
|
|
||||||
RUBY QUICKSTART ~
|
RUBY QUICKSTART ~
|
||||||
|
|
||||||
To use Ruby plugins with Nvim, install the latest "neovim" RubyGem: >
|
To use Ruby plugins with Nvim, install the latest "neovim" RubyGem: >
|
||||||
@ -98,6 +105,7 @@ To use Ruby plugins with Nvim, install the latest "neovim" RubyGem: >
|
|||||||
|
|
||||||
Run |:checkhealth| to see if your system is up-to-date.
|
Run |:checkhealth| to see if your system is up-to-date.
|
||||||
|
|
||||||
|
|
||||||
RUBY PROVIDER CONFIGURATION ~
|
RUBY PROVIDER CONFIGURATION ~
|
||||||
*g:loaded_ruby_provider*
|
*g:loaded_ruby_provider*
|
||||||
To disable Ruby support: >
|
To disable Ruby support: >
|
||||||
@ -120,6 +128,7 @@ Node.js integration *provider-nodejs*
|
|||||||
Nvim supports Node.js |remote-plugin|s.
|
Nvim supports Node.js |remote-plugin|s.
|
||||||
https://github.com/neovim/node-client/
|
https://github.com/neovim/node-client/
|
||||||
|
|
||||||
|
|
||||||
NODEJS QUICKSTART~
|
NODEJS QUICKSTART~
|
||||||
|
|
||||||
To use javascript remote-plugins with Nvim, install the "neovim" npm package: >
|
To use javascript remote-plugins with Nvim, install the "neovim" npm package: >
|
||||||
@ -127,6 +136,7 @@ To use javascript remote-plugins with Nvim, install the "neovim" npm package: >
|
|||||||
|
|
||||||
Run |:checkhealth| to see if your system is up-to-date.
|
Run |:checkhealth| to see if your system is up-to-date.
|
||||||
|
|
||||||
|
|
||||||
NODEJS PROVIDER CONFIGURATION~
|
NODEJS PROVIDER CONFIGURATION~
|
||||||
*g:loaded_node_provider*
|
*g:loaded_node_provider*
|
||||||
To disable Node.js support: >
|
To disable Node.js support: >
|
||||||
|
BIN
runtime/nvim.png
BIN
runtime/nvim.png
Binary file not shown.
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 5.7 KiB |
@ -37,29 +37,24 @@ VERSION=$("$ROOT_DIR"/build/bin/nvim --version | head -n 1 | grep -o 'v.*')
|
|||||||
|
|
||||||
cd "$APP_BUILD_DIR"
|
cd "$APP_BUILD_DIR"
|
||||||
|
|
||||||
curl -Lo "$APP_BUILD_DIR"/appimage_functions.sh https://github.com/AppImage/AppImages/raw/master/functions.sh
|
# Only downloads linuxdeploy if the remote file is different from local
|
||||||
. ./appimage_functions.sh
|
if [ -e "$APP_BUILD_DIR"/linuxdeploy-x86_64.AppImage ]; then
|
||||||
|
curl -Lo "$APP_BUILD_DIR"/linuxdeploy-x86_64.AppImage \
|
||||||
|
-z "$APP_BUILD_DIR"/linuxdeploy-x86_64.AppImage \
|
||||||
|
https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
|
||||||
|
else
|
||||||
|
curl -Lo "$APP_BUILD_DIR"/linuxdeploy-x86_64.AppImage \
|
||||||
|
https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
|
||||||
|
fi
|
||||||
|
|
||||||
# Copy desktop and icon file to AppDir for AppRun to pick them up.
|
chmod +x "$APP_BUILD_DIR"/linuxdeploy-x86_64.AppImage
|
||||||
# get_apprun
|
|
||||||
# get_desktop
|
# metainfo is not packaged automatically by linuxdeploy
|
||||||
cp "$ROOT_DIR/runtime/nvim.desktop" "$APP_DIR/"
|
|
||||||
cp "$ROOT_DIR/runtime/nvim.png" "$APP_DIR/"
|
|
||||||
mkdir "$APP_DIR/usr/share/metainfo/"
|
mkdir "$APP_DIR/usr/share/metainfo/"
|
||||||
cp "$ROOT_DIR/runtime/nvim.appdata.xml" "$APP_DIR/usr/share/metainfo/"
|
cp "$ROOT_DIR/runtime/nvim.appdata.xml" "$APP_DIR/usr/share/metainfo/"
|
||||||
|
|
||||||
cd "$APP_DIR"
|
cd "$APP_DIR"
|
||||||
|
|
||||||
# copy dependencies
|
|
||||||
copy_deps
|
|
||||||
# Move the libraries to usr/bin
|
|
||||||
move_lib
|
|
||||||
|
|
||||||
# Delete stuff that should not go into the AppImage.
|
|
||||||
# Delete dangerous libraries; see
|
|
||||||
# https://github.com/AppImage/AppImages/blob/master/excludelist
|
|
||||||
delete_blacklisted
|
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# AppDir complete. Now package it as an AppImage.
|
# AppDir complete. Now package it as an AppImage.
|
||||||
########################################################################
|
########################################################################
|
||||||
@ -78,21 +73,24 @@ chmod 755 AppRun
|
|||||||
|
|
||||||
cd "$APP_BUILD_DIR" # Get out of AppImage directory.
|
cd "$APP_BUILD_DIR" # Get out of AppImage directory.
|
||||||
|
|
||||||
|
# Set the name of the file generated by appimage
|
||||||
|
export OUTPUT=nvim.appimage
|
||||||
|
|
||||||
|
# If it's a release generate the zsync file
|
||||||
|
if [ -n "$TAG" ]; then
|
||||||
|
export UPDATE_INFORMATION="gh-releases-zsync|neovim|neovim|$TAG|nvim.appimage.zsync"
|
||||||
|
fi
|
||||||
|
|
||||||
# Generate AppImage.
|
# Generate AppImage.
|
||||||
# - Expects: $ARCH, $APP, $VERSION env vars
|
# - Expects: $ARCH, $APP, $VERSION env vars
|
||||||
# - Expects: ./$APP.AppDir/ directory
|
# - Expects: ./$APP.AppDir/ directory
|
||||||
# - Produces: ../out/$APP-$VERSION.glibc$GLIBC_NEEDED-$ARCH.AppImage
|
# - Produces: ./nvim.appimage
|
||||||
if [ -n "$TAG" ]; then
|
./linuxdeploy-x86_64.AppImage --appdir $APP.AppDir -d $ROOT_DIR/runtime/nvim.desktop -i \
|
||||||
generate_type2_appimage -u "gh-releases-zsync|neovim|neovim|$TAG|nvim.appimage.zsync"
|
"$ROOT_DIR/runtime/nvim.png" --output appimage
|
||||||
else
|
|
||||||
generate_type2_appimage
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Moving the final executable to a different folder so it isn't in the
|
# Moving the final executable to a different folder so it isn't in the
|
||||||
# way for a subsequent build.
|
# way for a subsequent build.
|
||||||
|
|
||||||
mv "$ROOT_DIR"/out/*.AppImage* "$ROOT_DIR"/build/bin
|
mv "$ROOT_DIR"/build/nvim.appimage* "$ROOT_DIR"/build/bin
|
||||||
# Remove the (now empty) folder the AppImage was built in
|
|
||||||
rmdir "$ROOT_DIR"/out
|
|
||||||
|
|
||||||
echo 'genappimage.sh: finished'
|
echo 'genappimage.sh: finished'
|
||||||
|
@ -15,10 +15,6 @@
|
|||||||
# - Tag the commit.
|
# - Tag the commit.
|
||||||
# Create the "version bump" commit:
|
# Create the "version bump" commit:
|
||||||
# - CMakeLists.txt: Set NVIM_VERSION_PRERELEASE to "-dev"
|
# - CMakeLists.txt: Set NVIM_VERSION_PRERELEASE to "-dev"
|
||||||
#
|
|
||||||
# Manual steps:
|
|
||||||
# - CMakeLists.txt: Bump NVIM_VERSION_* as appropriate.
|
|
||||||
# - git push --follow-tags
|
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
set -u
|
set -u
|
||||||
@ -95,5 +91,9 @@ _do_bump_commit
|
|||||||
echo "
|
echo "
|
||||||
Next steps:
|
Next steps:
|
||||||
- Double-check NVIM_VERSION_* in CMakeLists.txt
|
- Double-check NVIM_VERSION_* in CMakeLists.txt
|
||||||
- git push --follow-tags
|
- Push the tag:
|
||||||
- update website: index.html"
|
git push --follow-tags
|
||||||
|
- Update the 'stable' tag:
|
||||||
|
git push --force upstream HEAD^:refs/tags/stable
|
||||||
|
git fetch --tags
|
||||||
|
- Update website: index.html"
|
||||||
|
@ -594,7 +594,7 @@ void nvim_set_current_dir(String dir, Error *err)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
post_chdir(kCdScopeGlobal);
|
post_chdir(kCdScopeGlobal, true);
|
||||||
try_end(err);
|
try_end(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1559,6 +1559,7 @@ void do_autochdir(void)
|
|||||||
if (starting == 0
|
if (starting == 0
|
||||||
&& curbuf->b_ffname != NULL
|
&& curbuf->b_ffname != NULL
|
||||||
&& vim_chdirfile(curbuf->b_ffname) == OK) {
|
&& vim_chdirfile(curbuf->b_ffname) == OK) {
|
||||||
|
post_chdir(kCdScopeGlobal, false);
|
||||||
shorten_fnames(true);
|
shorten_fnames(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7218,7 +7218,7 @@ void free_cd_dir(void)
|
|||||||
/// Deal with the side effects of changing the current directory.
|
/// Deal with the side effects of changing the current directory.
|
||||||
///
|
///
|
||||||
/// @param scope Scope of the function call (global, tab or window).
|
/// @param scope Scope of the function call (global, tab or window).
|
||||||
void post_chdir(CdScope scope)
|
void post_chdir(CdScope scope, bool trigger_dirchanged)
|
||||||
{
|
{
|
||||||
// Always overwrite the window-local CWD.
|
// Always overwrite the window-local CWD.
|
||||||
xfree(curwin->w_localdir);
|
xfree(curwin->w_localdir);
|
||||||
@ -7258,7 +7258,10 @@ void post_chdir(CdScope scope)
|
|||||||
}
|
}
|
||||||
|
|
||||||
shorten_fnames(true);
|
shorten_fnames(true);
|
||||||
do_autocmd_dirchanged(cwd, scope);
|
|
||||||
|
if (trigger_dirchanged) {
|
||||||
|
do_autocmd_dirchanged(cwd, scope);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// `:cd`, `:tcd`, `:lcd`, `:chdir`, `:tchdir` and `:lchdir`.
|
/// `:cd`, `:tcd`, `:lcd`, `:chdir`, `:tchdir` and `:lchdir`.
|
||||||
@ -7320,7 +7323,7 @@ void ex_cd(exarg_T *eap)
|
|||||||
if (vim_chdir(new_dir, scope)) {
|
if (vim_chdir(new_dir, scope)) {
|
||||||
EMSG(_(e_failed));
|
EMSG(_(e_failed));
|
||||||
} else {
|
} else {
|
||||||
post_chdir(scope);
|
post_chdir(scope, true);
|
||||||
// Echo the new current directory if the command was typed.
|
// Echo the new current directory if the command was typed.
|
||||||
if (KeyTyped || p_verbose >= 5) {
|
if (KeyTyped || p_verbose >= 5) {
|
||||||
ex_pwd(eap);
|
ex_pwd(eap);
|
||||||
|
@ -1244,6 +1244,13 @@ openscript (
|
|||||||
EMSG(_(e_nesting));
|
EMSG(_(e_nesting));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Disallow sourcing a file in the sandbox, the commands would be executed
|
||||||
|
// later, possibly outside of the sandbox.
|
||||||
|
if (check_secure()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (ignore_script)
|
if (ignore_script)
|
||||||
/* Not reading from script, also don't open one. Warning message? */
|
/* Not reading from script, also don't open one. Warning message? */
|
||||||
return;
|
return;
|
||||||
|
@ -76,7 +76,8 @@
|
|||||||
|
|
||||||
/// @param flags Flags for open() call.
|
/// @param flags Flags for open() call.
|
||||||
///
|
///
|
||||||
/// @return The open memory file.
|
/// @return - The open memory file, on success.
|
||||||
|
/// - NULL, on failure (e.g. file does not exist).
|
||||||
memfile_T *mf_open(char_u *fname, int flags)
|
memfile_T *mf_open(char_u *fname, int flags)
|
||||||
{
|
{
|
||||||
memfile_T *mfp = xmalloc(sizeof(memfile_T));
|
memfile_T *mfp = xmalloc(sizeof(memfile_T));
|
||||||
|
@ -277,6 +277,9 @@ int ml_open(buf_T *buf)
|
|||||||
|
|
||||||
// Open the memfile. No swap file is created yet.
|
// Open the memfile. No swap file is created yet.
|
||||||
memfile_T *mfp = mf_open(NULL, 0);
|
memfile_T *mfp = mf_open(NULL, 0);
|
||||||
|
if (mfp == NULL) {
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
buf->b_ml.ml_mfp = mfp;
|
buf->b_ml.ml_mfp = mfp;
|
||||||
buf->b_ml.ml_flags = ML_EMPTY;
|
buf->b_ml.ml_flags = ML_EMPTY;
|
||||||
@ -360,10 +363,12 @@ int ml_open(buf_T *buf)
|
|||||||
return OK;
|
return OK;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
if (hp) {
|
if (mfp != NULL) {
|
||||||
mf_put(mfp, hp, false, false);
|
if (hp) {
|
||||||
|
mf_put(mfp, hp, false, false);
|
||||||
|
}
|
||||||
|
mf_close(mfp, true); // will also xfree(mfp->mf_fname)
|
||||||
}
|
}
|
||||||
mf_close(mfp, true); // will also xfree(mfp->mf_fname)
|
|
||||||
buf->b_ml.ml_mfp = NULL;
|
buf->b_ml.ml_mfp = NULL;
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
@ -839,7 +844,7 @@ void ml_recover(void)
|
|||||||
mf_open() will consume "fname_used"! */
|
mf_open() will consume "fname_used"! */
|
||||||
mfp = mf_open(fname_used, O_RDONLY);
|
mfp = mf_open(fname_used, O_RDONLY);
|
||||||
fname_used = p;
|
fname_used = p;
|
||||||
if (mfp->mf_fd < 0) {
|
if (mfp == NULL || mfp->mf_fd < 0) {
|
||||||
EMSG2(_("E306: Cannot open %s"), fname_used);
|
EMSG2(_("E306: Cannot open %s"), fname_used);
|
||||||
goto theend;
|
goto theend;
|
||||||
}
|
}
|
||||||
|
@ -306,6 +306,15 @@ static char *(p_cot_values[]) = { "menu", "menuone", "longest", "preview",
|
|||||||
static char *(p_icm_values[]) = { "nosplit", "split", NULL };
|
static char *(p_icm_values[]) = { "nosplit", "split", NULL };
|
||||||
static char *(p_scl_values[]) = { "yes", "no", "auto", NULL };
|
static char *(p_scl_values[]) = { "yes", "no", "auto", NULL };
|
||||||
|
|
||||||
|
/// All possible flags for 'shm'.
|
||||||
|
static char_u SHM_ALL[] = {
|
||||||
|
SHM_RO, SHM_MOD, SHM_FILE, SHM_LAST, SHM_TEXT, SHM_LINES, SHM_NEW, SHM_WRI,
|
||||||
|
SHM_ABBREVIATIONS, SHM_WRITE, SHM_TRUNC, SHM_TRUNCALL, SHM_OVER,
|
||||||
|
SHM_OVERALL, SHM_SEARCH, SHM_ATTENTION, SHM_INTRO, SHM_COMPLETIONMENU,
|
||||||
|
SHM_RECORDING, SHM_FILEINFO,
|
||||||
|
0,
|
||||||
|
};
|
||||||
|
|
||||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||||
# include "option.c.generated.h"
|
# include "option.c.generated.h"
|
||||||
#endif
|
#endif
|
||||||
@ -2417,11 +2426,6 @@ static bool valid_filetype(char_u *val)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
// MSVC optimizations are disabled for this function because it
|
|
||||||
// incorrectly generates an empty string for SHM_ALL.
|
|
||||||
#pragma optimize("", off)
|
|
||||||
#endif
|
|
||||||
/*
|
/*
|
||||||
* Handle string options that need some action to perform when changed.
|
* Handle string options that need some action to perform when changed.
|
||||||
* Returns NULL for success, or an error message for an error.
|
* Returns NULL for success, or an error message for an error.
|
||||||
@ -3311,9 +3315,6 @@ did_set_string_option (
|
|||||||
|
|
||||||
return errmsg;
|
return errmsg;
|
||||||
}
|
}
|
||||||
#ifdef _MSC_VER
|
|
||||||
#pragma optimize("", on)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Simple int comparison function for use with qsort()
|
* Simple int comparison function for use with qsort()
|
||||||
|
@ -178,14 +178,6 @@ enum {
|
|||||||
SHM_RO, SHM_MOD, SHM_FILE, SHM_LAST, SHM_TEXT, SHM_LINES, SHM_NEW, SHM_WRI, \
|
SHM_RO, SHM_MOD, SHM_FILE, SHM_LAST, SHM_TEXT, SHM_LINES, SHM_NEW, SHM_WRI, \
|
||||||
0, \
|
0, \
|
||||||
})
|
})
|
||||||
/// All possible flags for 'shm'.
|
|
||||||
#define SHM_ALL ((char_u[]) { \
|
|
||||||
SHM_RO, SHM_MOD, SHM_FILE, SHM_LAST, SHM_TEXT, SHM_LINES, SHM_NEW, SHM_WRI, \
|
|
||||||
SHM_ABBREVIATIONS, SHM_WRITE, SHM_TRUNC, SHM_TRUNCALL, SHM_OVER, \
|
|
||||||
SHM_OVERALL, SHM_SEARCH, SHM_ATTENTION, SHM_INTRO, SHM_COMPLETIONMENU, \
|
|
||||||
SHM_RECORDING, SHM_FILEINFO, \
|
|
||||||
0, \
|
|
||||||
})
|
|
||||||
|
|
||||||
/* characters for p_go: */
|
/* characters for p_go: */
|
||||||
#define GO_ASEL 'a' /* autoselect */
|
#define GO_ASEL 'a' /* autoselect */
|
||||||
|
@ -4920,7 +4920,7 @@ regmatch (
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const char_u *const line =
|
const char_u *const line =
|
||||||
reg_getline(behind_pos.rs_u.pos.lnum);
|
reg_getline(rp->rs_un.regsave.rs_u.pos.lnum);
|
||||||
|
|
||||||
rp->rs_un.regsave.rs_u.pos.col -=
|
rp->rs_un.regsave.rs_u.pos.col -=
|
||||||
utf_head_off(line,
|
utf_head_off(line,
|
||||||
|
@ -5338,10 +5338,11 @@ void screen_puts_len(char_u *text, int textlen, int row, int col, int attr)
|
|||||||
schar_from_ascii(ScreenLines[off - 1], ' ');
|
schar_from_ascii(ScreenLines[off - 1], ' ');
|
||||||
ScreenAttrs[off - 1] = 0;
|
ScreenAttrs[off - 1] = 0;
|
||||||
// redraw the previous cell, make it empty
|
// redraw the previous cell, make it empty
|
||||||
if (put_dirty_first == -1) {
|
if (put_dirty_first == -1 || col-1 < put_dirty_first) {
|
||||||
put_dirty_first = col-1;
|
put_dirty_first = col-1;
|
||||||
}
|
}
|
||||||
put_dirty_last = col+1;
|
put_dirty_last = col+1;
|
||||||
|
put_dirty_last = MAX(put_dirty_last, col+1);
|
||||||
// force the cell at "col" to be redrawn
|
// force the cell at "col" to be redrawn
|
||||||
force_redraw_next = true;
|
force_redraw_next = true;
|
||||||
}
|
}
|
||||||
@ -5422,10 +5423,10 @@ void screen_puts_len(char_u *text, int textlen, int row, int col, int attr)
|
|||||||
ScreenLines[off + 1][0] = 0;
|
ScreenLines[off + 1][0] = 0;
|
||||||
ScreenAttrs[off + 1] = attr;
|
ScreenAttrs[off + 1] = attr;
|
||||||
}
|
}
|
||||||
if (put_dirty_first == -1) {
|
if (put_dirty_first == -1 || col < put_dirty_first) {
|
||||||
put_dirty_first = col;
|
put_dirty_first = col;
|
||||||
}
|
}
|
||||||
put_dirty_last = col+mbyte_cells;
|
put_dirty_last = MAX(put_dirty_last, col+mbyte_cells);
|
||||||
}
|
}
|
||||||
|
|
||||||
off += mbyte_cells;
|
off += mbyte_cells;
|
||||||
|
@ -2510,7 +2510,7 @@ buf_T *open_spellbuf(void)
|
|||||||
buf->b_spell = true;
|
buf->b_spell = true;
|
||||||
buf->b_p_swf = true; // may create a swap file
|
buf->b_p_swf = true; // may create a swap file
|
||||||
if (ml_open(buf) == FAIL) {
|
if (ml_open(buf) == FAIL) {
|
||||||
abort();
|
ELOG("Error opening a new memline");
|
||||||
}
|
}
|
||||||
ml_open_file(buf); // create swap file now
|
ml_open_file(buf); // create swap file now
|
||||||
|
|
||||||
|
@ -1304,8 +1304,6 @@ static void redraw(bool restore_cursor)
|
|||||||
|
|
||||||
static void adjust_topline(Terminal *term, buf_T *buf, long added)
|
static void adjust_topline(Terminal *term, buf_T *buf, long added)
|
||||||
{
|
{
|
||||||
int height, width;
|
|
||||||
vterm_get_size(term->vt, &height, &width);
|
|
||||||
FOR_ALL_WINDOWS_IN_TAB(wp, curtab) {
|
FOR_ALL_WINDOWS_IN_TAB(wp, curtab) {
|
||||||
if (wp->w_buffer == buf) {
|
if (wp->w_buffer == buf) {
|
||||||
linenr_T ml_end = buf->b_ml.ml_line_count;
|
linenr_T ml_end = buf->b_ml.ml_line_count;
|
||||||
@ -1314,7 +1312,7 @@ static void adjust_topline(Terminal *term, buf_T *buf, long added)
|
|||||||
if (following || (wp == curwin && is_focused(term))) {
|
if (following || (wp == curwin && is_focused(term))) {
|
||||||
// "Follow" the terminal output
|
// "Follow" the terminal output
|
||||||
wp->w_cursor.lnum = ml_end;
|
wp->w_cursor.lnum = ml_end;
|
||||||
set_topline(wp, MAX(wp->w_cursor.lnum - height + 1, 1));
|
set_topline(wp, MAX(wp->w_cursor.lnum - wp->w_height + 1, 1));
|
||||||
} else {
|
} else {
|
||||||
// Ensure valid cursor for each window displaying this terminal.
|
// Ensure valid cursor for each window displaying this terminal.
|
||||||
wp->w_cursor.lnum = MIN(wp->w_cursor.lnum, ml_end);
|
wp->w_cursor.lnum = MIN(wp->w_cursor.lnum, ml_end);
|
||||||
|
@ -286,6 +286,15 @@ describe("getcwd()", function ()
|
|||||||
command("call delete('../"..directories.global.."', 'd')")
|
command("call delete('../"..directories.global.."', 'd')")
|
||||||
eq("", helpers.eval("getcwd()"))
|
eq("", helpers.eval("getcwd()"))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it("works with 'autochdir' after local directory was set (#9892)", function()
|
||||||
|
local curdir = cwd()
|
||||||
|
command('lcd ' .. directories.global)
|
||||||
|
command('lcd -')
|
||||||
|
command('set autochdir')
|
||||||
|
command('edit ' .. directories.global .. '/foo')
|
||||||
|
eq(curdir .. pathsep .. directories.global, cwd())
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
local Screen = require('test.functional.ui.screen')
|
local Screen = require('test.functional.ui.screen')
|
||||||
local helpers = require('test.functional.helpers')(after_each)
|
local helpers = require('test.functional.helpers')(after_each)
|
||||||
local lfs = require('lfs')
|
local lfs = require('lfs')
|
||||||
local feed_command, eq, eval, expect, source =
|
local eq, eval, expect, source =
|
||||||
helpers.feed_command, helpers.eq, helpers.eval, helpers.expect, helpers.source
|
helpers.eq, helpers.eval, helpers.expect, helpers.source
|
||||||
local clear = helpers.clear
|
local clear = helpers.clear
|
||||||
local command = helpers.command
|
local command = helpers.command
|
||||||
|
local expect_err = helpers.expect_err
|
||||||
local feed = helpers.feed
|
local feed = helpers.feed
|
||||||
local nvim_prog = helpers.nvim_prog
|
local nvim_prog = helpers.nvim_prog
|
||||||
local ok = helpers.ok
|
local ok = helpers.ok
|
||||||
@ -17,9 +18,14 @@ describe(':recover', function()
|
|||||||
before_each(clear)
|
before_each(clear)
|
||||||
|
|
||||||
it('fails if given a non-existent swapfile', function()
|
it('fails if given a non-existent swapfile', function()
|
||||||
local swapname = 'bogus-swapfile'
|
local swapname = 'bogus_swapfile'
|
||||||
feed_command('recover '..swapname) -- This should not segfault. #2117
|
local swapname2 = 'bogus_swapfile.swp'
|
||||||
eq('E305: No swap file found for '..swapname, eval('v:errmsg'))
|
expect_err('E305: No swap file found for '..swapname,
|
||||||
|
command, 'recover '..swapname) -- Should not segfault. #2117
|
||||||
|
-- Also check filename ending with ".swp". #9504
|
||||||
|
expect_err('Vim%(recover%):E306: Cannot open '..swapname2,
|
||||||
|
command, 'recover '..swapname2) -- Should not segfault. #2117
|
||||||
|
eq(2, eval('1+1')) -- Still alive?
|
||||||
end)
|
end)
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
@ -8,7 +8,7 @@ local exit_altscreen = thelpers.exit_altscreen
|
|||||||
|
|
||||||
if helpers.pending_win32(pending) then return end
|
if helpers.pending_win32(pending) then return end
|
||||||
|
|
||||||
describe('terminal altscreen', function()
|
describe(':terminal altscreen', function()
|
||||||
local screen
|
local screen
|
||||||
|
|
||||||
before_each(function()
|
before_each(function()
|
||||||
|
@ -6,7 +6,7 @@ local eval, feed_command, source = helpers.eval, helpers.feed_command, helpers.s
|
|||||||
local eq, neq = helpers.eq, helpers.neq
|
local eq, neq = helpers.eq, helpers.neq
|
||||||
local write_file = helpers.write_file
|
local write_file = helpers.write_file
|
||||||
|
|
||||||
describe('terminal buffer', function()
|
describe(':terminal buffer', function()
|
||||||
local screen
|
local screen
|
||||||
|
|
||||||
before_each(function()
|
before_each(function()
|
||||||
|
@ -7,7 +7,7 @@ local feed_command = helpers.feed_command
|
|||||||
local hide_cursor = thelpers.hide_cursor
|
local hide_cursor = thelpers.hide_cursor
|
||||||
local show_cursor = thelpers.show_cursor
|
local show_cursor = thelpers.show_cursor
|
||||||
|
|
||||||
describe('terminal cursor', function()
|
describe(':terminal cursor', function()
|
||||||
local screen
|
local screen
|
||||||
|
|
||||||
before_each(function()
|
before_each(function()
|
||||||
|
@ -5,7 +5,7 @@ local feed, clear, nvim = helpers.feed, helpers.clear, helpers.nvim
|
|||||||
local nvim_dir, command = helpers.nvim_dir, helpers.command
|
local nvim_dir, command = helpers.nvim_dir, helpers.command
|
||||||
local eq, eval = helpers.eq, helpers.eval
|
local eq, eval = helpers.eq, helpers.eval
|
||||||
|
|
||||||
describe('terminal window highlighting', function()
|
describe(':terminal window highlighting', function()
|
||||||
local screen
|
local screen
|
||||||
|
|
||||||
before_each(function()
|
before_each(function()
|
||||||
|
@ -4,7 +4,7 @@ local clear, eq, eval = helpers.clear, helpers.eq, helpers.eval
|
|||||||
local feed, nvim = helpers.feed, helpers.nvim
|
local feed, nvim = helpers.feed, helpers.nvim
|
||||||
local feed_data = thelpers.feed_data
|
local feed_data = thelpers.feed_data
|
||||||
|
|
||||||
describe('terminal mouse', function()
|
describe(':terminal mouse', function()
|
||||||
local screen
|
local screen
|
||||||
|
|
||||||
before_each(function()
|
before_each(function()
|
||||||
|
@ -12,7 +12,7 @@ local curbufmeths = helpers.curbufmeths
|
|||||||
local nvim = helpers.nvim
|
local nvim = helpers.nvim
|
||||||
local feed_data = thelpers.feed_data
|
local feed_data = thelpers.feed_data
|
||||||
|
|
||||||
describe('terminal scrollback', function()
|
describe(':terminal scrollback', function()
|
||||||
local screen
|
local screen
|
||||||
|
|
||||||
before_each(function()
|
before_each(function()
|
||||||
@ -344,7 +344,7 @@ describe('terminal scrollback', function()
|
|||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
describe('terminal prints more lines than the screen height and exits', function()
|
describe(':terminal prints more lines than the screen height and exits', function()
|
||||||
it('will push extra lines to scrollback', function()
|
it('will push extra lines to scrollback', function()
|
||||||
clear()
|
clear()
|
||||||
local screen = Screen.new(30, 7)
|
local screen = Screen.new(30, 7)
|
||||||
@ -460,7 +460,7 @@ describe("'scrollback' option", function()
|
|||||||
screen:detach()
|
screen:detach()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('defaults to 10000 in terminal buffers', function()
|
it('defaults to 10000 in :terminal buffers', function()
|
||||||
set_fake_shell()
|
set_fake_shell()
|
||||||
command('terminal')
|
command('terminal')
|
||||||
eq(10000, curbufmeths.get_option('scrollback'))
|
eq(10000, curbufmeths.get_option('scrollback'))
|
||||||
|
@ -20,7 +20,7 @@ local read_file = helpers.read_file
|
|||||||
|
|
||||||
if helpers.pending_win32(pending) then return end
|
if helpers.pending_win32(pending) then return end
|
||||||
|
|
||||||
describe('tui', function()
|
describe('TUI', function()
|
||||||
local screen
|
local screen
|
||||||
|
|
||||||
before_each(function()
|
before_each(function()
|
||||||
|
@ -3,8 +3,12 @@ local thelpers = require('test.functional.terminal.helpers')
|
|||||||
local feed, clear = helpers.feed, helpers.clear
|
local feed, clear = helpers.feed, helpers.clear
|
||||||
local wait = helpers.wait
|
local wait = helpers.wait
|
||||||
local iswin = helpers.iswin
|
local iswin = helpers.iswin
|
||||||
|
local command = helpers.command
|
||||||
|
local retry = helpers.retry
|
||||||
|
local eq = helpers.eq
|
||||||
|
local eval = helpers.eval
|
||||||
|
|
||||||
describe('terminal window', function()
|
describe(':terminal window', function()
|
||||||
local screen
|
local screen
|
||||||
|
|
||||||
before_each(function()
|
before_each(function()
|
||||||
@ -12,6 +16,19 @@ describe('terminal window', function()
|
|||||||
screen = thelpers.screen_setup()
|
screen = thelpers.screen_setup()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('sets topline correctly #8556', function()
|
||||||
|
-- Test has hardcoded assumptions of dimensions.
|
||||||
|
eq(7, eval('&lines'))
|
||||||
|
command('set shell=sh')
|
||||||
|
command('terminal')
|
||||||
|
retry(nil, nil, function() assert(nil ~= eval('b:terminal_job_pid')) end)
|
||||||
|
-- Terminal/shell contents must exceed the height of this window.
|
||||||
|
command('topleft 1split')
|
||||||
|
feed([[i<cr>]])
|
||||||
|
-- Check topline _while_ in terminal-mode.
|
||||||
|
retry(nil, nil, function() eq(6, eval('winsaveview()["topline"]')) end)
|
||||||
|
end)
|
||||||
|
|
||||||
describe("with 'number'", function()
|
describe("with 'number'", function()
|
||||||
it('wraps text', function()
|
it('wraps text', function()
|
||||||
feed([[<C-\><C-N>]])
|
feed([[<C-\><C-N>]])
|
||||||
|
@ -9,7 +9,7 @@ local eval = helpers.eval
|
|||||||
local iswin = helpers.iswin
|
local iswin = helpers.iswin
|
||||||
local retry = helpers.retry
|
local retry = helpers.retry
|
||||||
|
|
||||||
describe('terminal', function()
|
describe(':terminal', function()
|
||||||
local screen
|
local screen
|
||||||
|
|
||||||
before_each(function()
|
before_each(function()
|
||||||
|
Reference in New Issue
Block a user