diff options
303 files changed, 9752 insertions, 12070 deletions
diff --git a/.ci/before_script.sh b/.ci/before_script.sh index 23940ab2e2..4a75e89fbe 100755 --- a/.ci/before_script.sh +++ b/.ci/before_script.sh @@ -19,10 +19,6 @@ if [[ -n "${LLVM_SYMBOLIZER}" ]] && [[ ! $(type -P "${LLVM_SYMBOLIZER}") ]]; the echo "\$LLVM_SYMBOLIZER: '${LLVM_SYMBOLIZER}' is not executable." exit 1 fi -if [ "${BUILD_32BIT}" = ON ] && [ "${BUILD_MINGW}" = ON ]; then - >&2 echo "32-bit MinGW builds not supported." - exit 1 -fi if [[ "${TRAVIS_OS_NAME}" == osx ]]; then # Adds user to a dummy group. diff --git a/.ci/build.bat b/.ci/build.bat new file mode 100644 index 0000000000..c2f560fb7c --- /dev/null +++ b/.ci/build.bat @@ -0,0 +1,44 @@ +:: These are native MinGW builds, but they use the toolchain inside +:: MSYS2, this allows using all the dependencies and tools available +:: in MSYS2, but we cannot build inside the MSYS2 shell. +echo on +if "%CONFIGURATION%" == "MINGW_32" ( + set ARCH=i686 + set BITS=32 +) else ( + set ARCH=x86_64 + set BITS=64 +) +:: We cannot have sh.exe in the PATH (MinGW) +set PATH=%PATH:C:\Program Files\Git\usr\bin;=% +set PATH=C:\msys64\mingw%BITS%\bin;C:\Windows\System32;C:\Windows;%PATH% +:: The default cpack in the PATH is not CMake +set PATH=C:\Program Files (x86)\CMake\bin\cpack.exe;%PATH% + +:: Build third-party dependencies +C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm -Su" || goto :error +C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm --needed -S mingw-w64-%ARCH%-cmake mingw-w64-%ARCH%-perl mingw-w64-%ARCH%-python2 mingw-w64-%ARCH%-diffutils gperf" || goto :error + +mkdir .deps +cd .deps +cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release ..\third-party\ || goto :error +mingw32-make VERBOSE=1 || goto :error +cd .. + +:: Build Neovim +mkdir build +cd build +cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUSTED_OUTPUT_TYPE=gtest -DGPERF_PRG="C:\msys64\usr\bin\gperf.exe" .. || goto :error +mingw32-make VERBOSE=1 || goto :error +bin\nvim --version || goto :error + +:: Functional tests +mingw32-make functionaltest VERBOSE=1 || goto :error + +:: Build artifacts +cpack -G ZIP -C Release +if defined APPVEYOR_REPO_TAG_NAME cpack -G NSIS -C Release + +goto :EOF +:error +exit /b %errorlevel% diff --git a/.ci/common/build.sh b/.ci/common/build.sh index c89d4c559b..5cf34935d6 100644 --- a/.ci/common/build.sh +++ b/.ci/common/build.sh @@ -2,9 +2,6 @@ build_deps() { if [[ "${BUILD_32BIT}" == ON ]]; then DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} ${CMAKE_FLAGS_32BIT}" fi - if [[ "${BUILD_MINGW}" == ON ]]; then - DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} ${CMAKE_FLAGS_MINGW}" - fi if [[ "${FUNCTIONALTEST}" == "functionaltest-lua" ]]; then DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} -DUSE_BUNDLED_LUA=ON" fi @@ -47,9 +44,6 @@ build_nvim() { if [[ "${BUILD_32BIT}" == ON ]]; then CMAKE_FLAGS="${CMAKE_FLAGS} ${CMAKE_FLAGS_32BIT}" fi - if [[ "${BUILD_MINGW}" == ON ]]; then - CMAKE_FLAGS="${CMAKE_FLAGS} ${CMAKE_FLAGS_MINGW}" - fi mkdir -p "${BUILD_DIR}" cd "${BUILD_DIR}" diff --git a/.ci/install.sh b/.ci/install.sh index f809bb06ea..9df5b6e980 100755 --- a/.ci/install.sh +++ b/.ci/install.sh @@ -10,13 +10,6 @@ fi if [[ "${TRAVIS_OS_NAME}" == osx ]]; then brew install gettext brew reinstall -s libtool -elif [[ "${BUILD_MINGW}" == ON ]]; then - # TODO: When Travis gets a recent version of Mingw-w64 use packages: - # binutils-mingw-w64-i686 gcc-mingw-w64-i686 g++-mingw-w64-i686 mingw-w64-dev mingw-w64-tools - - echo "Downloading MinGW..." - curl -sSL "https://github.com/neovim/deps/raw/master/opt/i686-w64-mingw32-gcc-4.8.0-linux64_rubenvb.tar.xz" \ - | tar xJf - -C "${HOME}/.local" fi # Use default CC to avoid compilation problems when installing Python modules. diff --git a/.ci/run_tests.sh b/.ci/run_tests.sh index 656ea16e37..d542a2f121 100755 --- a/.ci/run_tests.sh +++ b/.ci/run_tests.sh @@ -3,14 +3,6 @@ set -e set -o pipefail -# TODO: Stop here for MinGW builds, -# building Neovim doesn't work yet. -if [[ "${BUILD_MINGW}" == ON ]]; then - echo "Neovim doesn't build on MinGW yet; stopping build." - touch "${SUCCESS_MARKER}" - exit -fi - CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" source "${CI_DIR}/common/build.sh" source "${CI_DIR}/common/test.sh" diff --git a/.gitignore b/.gitignore index 766c323c34..3fb3d62517 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ tags # Files generated by the tests /src/nvim/testdir/del /src/nvim/testdir/test*.out +/src/nvim/testdir/test*.res /src/nvim/testdir/test.log /src/nvim/testdir/messages /src/nvim/testdir/viminfo diff --git a/.travis.yml b/.travis.yml index 9d529c2632..84caa349ea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,8 +8,8 @@ env: # Travis has 1.5 virtual cores according to # http://docs.travis-ci.com/user/speeding-up-the-build/#Paralellizing-your-build-on-one-VM - MAKE_CMD="make -j2" - # Update PATH for pip and MinGW. - - PATH="$(python2.7 -c 'import site; print(site.getuserbase())')/bin:$HOME/.local/mingw32/bin:$PATH" + # Update PATH for pip. + - PATH="$(python2.7 -c 'import site; print(site.getuserbase())')/bin:$PATH" # LLVM symbolizer path. - LLVM_SYMBOLIZER="$(which llvm-symbolizer-3.4)" # Build directory for Neovim. @@ -34,8 +34,6 @@ env: - CMAKE_FLAGS_32BIT="-DCMAKE_SYSTEM_LIBRARY_PATH=/lib32:/usr/lib32:/usr/local/lib32 -DCMAKE_IGNORE_PATH=/lib:/usr/lib:/usr/local/lib -DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/cmake/i386-linux-gnu.toolchain.cmake" - # Additional CMake flags for MinGW builds. - - CMAKE_FLAGS_MINGW="-DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/cmake/mingw32-w64-cross-travis.toolchain.cmake" # Environment variables for Clang sanitizers. - ASAN_OPTIONS="detect_leaks=1:check_initialization_order=1:log_path=$LOG_DIR/asan" - ASAN_SYMBOLIZER_PATH="$LLVM_SYMBOLIZER" @@ -81,8 +79,6 @@ matrix: compiler: clang - os: osx compiler: gcc-4.9 - - os: linux - env: BUILD_MINGW=ON fast_finish: true before_install: .ci/before_install.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 1787f4e306..0a6a9accea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,7 +59,7 @@ set_property(CACHE CMAKE_BUILD_TYPE PROPERTY # version string, else it is combined with the result of `git describe`. set(NVIM_VERSION_MAJOR 0) set(NVIM_VERSION_MINOR 1) -set(NVIM_VERSION_PATCH 5) +set(NVIM_VERSION_PATCH 6) set(NVIM_VERSION_PRERELEASE "-dev") # for package maintainers file(TO_CMAKE_PATH ${CMAKE_CURRENT_LIST_DIR}/.git FORCED_GIT_DIR) @@ -328,7 +328,12 @@ 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() -option(ENABLE_JEMALLOC "enable jemalloc" ON) +if(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") + message(STATUS "detected OpenBSD; disabled jemalloc. #5318") + option(ENABLE_JEMALLOC "enable jemalloc" OFF) +else() + option(ENABLE_JEMALLOC "enable jemalloc" ON) +endif() if (ENABLE_JEMALLOC) if(CLANG_ASAN_UBSAN OR CLANG_MSAN OR CLANG_TSAN) @@ -395,14 +400,20 @@ endif() message(STATUS "Using the Lua interpreter ${LUA_PRG}.") # Setup busted. -find_program(BUSTED_PRG busted) +find_program(BUSTED_PRG NAMES busted busted.bat) find_program(BUSTED_LUA_PRG busted-lua) if(NOT BUSTED_OUTPUT_TYPE) - set(BUSTED_OUTPUT_TYPE "utfTerminal") + if(WIN32) + set(BUSTED_OUTPUT_TYPE "plainTerminal") + else() + set(BUSTED_OUTPUT_TYPE "utfTerminal") + endif() endif() find_program(LUACHECK_PRG luacheck) +find_program(GPERF_PRG gperf) + include(InstallHelpers) file(GLOB MANPAGES @@ -466,7 +477,11 @@ if(BUSTED_PRG) ${CMAKE_BINARY_DIR}/test/config/paths.lua) set(UNITTEST_PREREQS nvim-test unittest-headers) - set(FUNCTIONALTEST_PREREQS nvim tty-test shell-test) + if(WIN32) + set(FUNCTIONALTEST_PREREQS nvim shell-test) + else() + set(FUNCTIONALTEST_PREREQS nvim tty-test shell-test) + endif() set(BENCHMARK_PREREQS nvim tty-test) # Useful for automated build systems, if they want to manually run the tests. @@ -490,6 +505,7 @@ if(BUSTED_PRG) -DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test -DBUILD_DIR=${CMAKE_BINARY_DIR} -DTEST_TYPE=unit + -DSYSTEM_NAME=${CMAKE_SYSTEM_NAME} -P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake DEPENDS ${UNITTEST_PREREQS} ${TEST_TARGET_ARGS}) @@ -508,6 +524,7 @@ if(BUSTED_PRG) -DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test -DBUILD_DIR=${CMAKE_BINARY_DIR} -DTEST_TYPE=functional + -DSYSTEM_NAME=${CMAKE_SYSTEM_NAME} -P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake DEPENDS ${FUNCTIONALTEST_PREREQS} ${TEST_TARGET_ARGS}) @@ -522,6 +539,7 @@ if(BUSTED_PRG) -DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test -DBUILD_DIR=${CMAKE_BINARY_DIR} -DTEST_TYPE=benchmark + -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} -P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake DEPENDS ${BENCHMARK_PREREQS} ${TEST_TARGET_ARGS}) @@ -538,6 +556,7 @@ if(BUSTED_LUA_PRG) -DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test -DBUILD_DIR=${CMAKE_BINARY_DIR} -DTEST_TYPE=functional + -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} -P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake DEPENDS ${FUNCTIONALTEST_PREREQS} ${TEST_TARGET_ARGS}) @@ -548,6 +567,7 @@ if(LUACHECK_PRG) COMMAND ${CMAKE_COMMAND} -DLUACHECK_PRG=${LUACHECK_PRG} -DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test + -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} -P ${PROJECT_SOURCE_DIR}/cmake/RunTestsLint.cmake) endif() diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dbc048d939..54bed1e72e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,13 +1,18 @@ # Contributing to Neovim -## Getting started +Getting started +--------------- -- Help us review [open pull requests](https://github.com/neovim/neovim/pulls)! - See [Reviewing](#reviewing) for guidelines. -- Try an [entry-level issue][entry-level] if you are wondering where to start. -- Or [merge a Vim patch]. +If you want to help but don't know where to start, here are some +low-risk/isolated tasks: -## Reporting problems +- Help us [review pull requests](#reviewing)! +- Merge a [Vim patch]. +- Try a [complexity:low] issue. +- Fix [clang-scan] or [coverity](#coverity) warnings. + +Reporting problems +------------------ - Check the [**FAQ**][wiki-faq]. - Search [existing issues][github-issues] (including closed!) @@ -18,7 +23,8 @@ - [Bisecting][git-bisect] to the cause of a regression often leads to an immediate fix. -## Pull requests ("PRs") +Pull requests ("PRs") +--------------------- - To avoid duplicate work, you may want to create a `[WIP]` pull request so that others know what you are working on. @@ -32,15 +38,25 @@ - Try to [tidy your history][git-history-rewriting]: combine related commits with interactive rebasing, separate monolithic commits, etc. -### Stages: WIP, RFC +### Stages: WIP, RFC, RDY + +Pull requests have three stages: `[WIP]` (Work In Progress), `[RFC]` (Request +For Comment) and `[RDY]` (Ready). -Pull requests are processed in two stages: _WIP_ (Work In Progress) and _RFC_ -(Request For Comment). +- Untagged PRs are assumed to be `[RFC]`, i.e. you are requesting a review. +- Prepend `[WIP]` to the PR title if you are _not_ requesting feedback and the + work is still in flux. +- Prepend `[RDY]` to the PR title if you are _done_ with the PR and are only + waiting on it to be merged. -- Untagged PRs are assumed to be RFC, meaning the work is ready for review and - you would like feedback. -- Preprend `[WIP]` to the PR title if you are _not_ ready for feedback and the - work is still in flux. This saves time and confusion. +For example, a typical workflow is: + +1. You open a `[WIP]` PR where the work is _not_ ready for feedback, you just want to + let others know what you are doing. +2. Once the PR is ready for review, you replace `[WIP]` in the title with `[RFC]`. + You may add fix up commits to address issues that come up during review. +3. Once the PR is ready for merging, you rebase/squash your work appropriately and + then replace `[RFC]` in the title with `[RDY]`. ### Commit messages @@ -86,7 +102,8 @@ Use this commit-message format for coverity fixes: where `<id>` is the Coverity ID (CID). For example see [#804](https://github.com/neovim/neovim/pull/804). -## Reviewing +Reviewing +--------- To help review pull requests, start with [this checklist][review-checklist]. @@ -101,8 +118,6 @@ commits in the feature branch which aren't in the `master` branch; `-p` shows each commit's diff. To show the whole surrounding function of a change as context, use the `-W` argument as well. - -[entry-level]: https://github.com/neovim/neovim/issues?labels=entry-level&state=open [gcc-warnings]: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html [git-bisect]: http://git-scm.com/book/tr/v2/Git-Tools-Debugging-with-Git [git-feature-branch]: https://www.atlassian.com/git/tutorials/comparing-workflows @@ -121,4 +136,6 @@ as context, use the `-W` argument as well. [3174]: https://github.com/neovim/neovim/issues/3174 [travis CI]: https://travis-ci.org/neovim/neovim [quickbuild]: http://neovim-qb.szakmeister.net/dashboard -[merge a Vim patch]: https://github.com/neovim/neovim/wiki/Merging-patches-from-upstream-Vim +[Vim patch]: https://github.com/neovim/neovim/wiki/Merging-patches-from-upstream-Vim +[clang-scan]: https://neovim.io/doc/reports/clang/ +[complexity:low]: https://github.com/neovim/neovim/issues?q=is%3Aopen+is%3Aissue+label%3Acomplexity%3Alow @@ -1,12 +1,6 @@  -[Website](http://neovim.io) | -[Community](http://neovim.io/community/) | -[Wiki](https://github.com/neovim/neovim/wiki) | -[Documentation](http://neovim.io/doc) | -[Mailing List](https://groups.google.com/forum/#!forum/neovim) | -[Twitter](http://twitter.com/Neovim) | -[Bountysource](https://www.bountysource.com/teams/neovim) +[Website] | [Community] | [Wiki] | [Documentation] | [Mailing List] | [Twitter] | [Bountysource] [](https://travis-ci.org/neovim/neovim) [](https://ci.appveyor.com/project/neovim/neovim/branch/master) @@ -14,44 +8,48 @@ [](https://coveralls.io/r/neovim/neovim) [](https://scan.coverity.com/projects/2227) [](http://neovim.io/doc/reports/clang) -[](https://gitter.im/neovim/neovim?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[](https://gitter.im/neovim/neovim?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) Neovim is a project that seeks to aggressively refactor Vim in order to: - Simplify maintenance and encourage [contributions](CONTRIBUTING.md) - Split the work between multiple developers -- Enable the implementation of new/modern user interfaces without any - modifications to the core source +- Enable the implementation of new/modern UIs without modifications to the core - Improve extensibility with a new [plugin architecture](https://github.com/neovim/neovim/wiki/Plugin-UI-architecture) -For lots more details, see +For more details, see [the wiki](https://github.com/neovim/neovim/wiki/Introduction)! -### What's been done so far +[](https://waffle.io/neovim/neovim/metrics) + +What's been done so far +----------------------- -- Automatic [history merge](https://github.com/neovim/neovim/pull/2506) between multiple editor instances -- [XDG-compliant](https://github.com/neovim/neovim/pull/3470) configuration +- RPC API based on [MessagePack](https://msgpack.org) - Embedded [terminal emulator](https://neovim.io/doc/user/nvim_terminal_emulator.html) - Asynchronous [job control](https://github.com/neovim/neovim/pull/2247) -- [MessagePack](https://msgpack.org) remote API -- [Pushdown automaton](https://github.com/neovim/neovim/pull/3413) for state transitions +- [Shared data (shada)](https://github.com/neovim/neovim/pull/2506) among multiple editor instances +- [XDG base directories](https://github.com/neovim/neovim/pull/3470) support +- [libuv](https://github.com/libuv/libuv/)-based platform/OS/"mch" layer +- [Pushdown automaton](https://github.com/neovim/neovim/pull/3413) input model +- 1000s of new tests +- Legacy tests converted to Lua tests -See the [progress page](https://github.com/neovim/neovim/wiki/Progress) for a comprehensive list. - -[](https://waffle.io/neovim/neovim/metrics) +See [`:help nvim-features`][nvim-features] for a comprehensive list. -### What's being worked on now +What's being worked on now +-------------------------- -- Port all IO to [libuv](https://github.com/libuv/libuv/) -- Convert legacy tests to Lua tests -- VimL => Lua translator +See the [Roadmap]. -### How do I get it? +How do I get it? +---------------- There is a formula for OSX/homebrew, a PKGBUILD for Arch Linux, RPM, deb, and more. See [the wiki](https://github.com/neovim/neovim/wiki/Installing-Neovim)! -### License +License +------- Neovim is licensed under the terms of the Apache 2.0 license, except for parts that were contributed under the Vim license. @@ -76,6 +74,15 @@ See `LICENSE` for details. You can also sponsor the development of Vim. Vim sponsors can vote for features. The money goes to Uganda anyway. +[Website]: http://neovim.io +[Community]: http://neovim.io/community/ +[Wiki]: https://github.com/neovim/neovim/wiki +[Documentation]: http://neovim.io/doc +[Mailing List]: https://groups.google.com/forum/#!forum/neovim +[Twitter]: http://twitter.com/Neovim +[Bountysource]: https://www.bountysource.com/teams/neovim [license-commit]: https://github.com/neovim/neovim/commit/b17d9691a24099c9210289f16afb1a498a89d803 +[nvim-features]: https://neovim.io/doc/user/vim_diff.html#nvim-features +[Roadmap]: https://neovim.io/roadmap/ <!-- vim: set tw=80: --> diff --git a/appveyor.yml b/appveyor.yml index c5a768cb41..600b246be2 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,23 +1,10 @@ version: '{build}' -skip_tags: true -os: Windows Server 2012 R2 -environment: - GYP_MSVS_VERSION: 2015 - matrix: - - GENERATOR: Visual Studio 14 Win64 - DEPS_PATH: deps64 - - GENERATOR: Visual Studio 14 - DEPS_PATH: deps32 -matrix: - # Allow builds to fail - allow_failures: - - os: Windows Server 2012 R2 +configuration: +- MINGW_64 +- MINGW_32 install: [] build_script: -# See http://help.appveyor.com/discussions/problems/539-cloning-gyp-fails -- git config --global url."http://".insteadOf https:// -- mkdir %DEPS_PATH% -- cd %DEPS_PATH% -- cmake -G "%GENERATOR%" ..\third-party\ -- cmake --build . -- cd .. +- call .ci\build.bat +artifacts: +- path: build/Neovim.zip +- path: build/Neovim.exe diff --git a/cmake/FindMsgpack.cmake b/cmake/FindMsgpack.cmake index 015737d658..8881a34332 100644 --- a/cmake/FindMsgpack.cmake +++ b/cmake/FindMsgpack.cmake @@ -42,7 +42,12 @@ if(MSGPACK_USE_STATIC) "${CMAKE_STATIC_LIBRARY_PREFIX}msgpack${CMAKE_STATIC_LIBRARY_SUFFIX}") endif() -list(APPEND MSGPACK_NAMES msgpackc msgpack) +if(MSVC) + # The import library for the msgpack DLL has a different name + list(APPEND MSGPACK_NAMES msgpack_import) +else() + list(APPEND MSGPACK_NAMES msgpackc msgpack) +endif() find_library(MSGPACK_LIBRARY NAMES ${MSGPACK_NAMES} # Check each directory for all names to avoid using headers/libraries from diff --git a/cmake/RunTests.cmake b/cmake/RunTests.cmake index 9fa91ffb5d..58f19b6fa5 100644 --- a/cmake/RunTests.cmake +++ b/cmake/RunTests.cmake @@ -2,6 +2,9 @@ get_filename_component(BUSTED_DIR ${BUSTED_PRG} PATH) set(ENV{PATH} "${BUSTED_DIR}:$ENV{PATH}") set(ENV{VIMRUNTIME} ${WORKING_DIR}/runtime) +set(ENV{NVIM_RPLUGIN_MANIFEST} ${WORKING_DIR}/Xtest_rplugin_manifest) +set(ENV{XDG_CONFIG_HOME} ${WORKING_DIR}/Xtest_xdg/config) +set(ENV{XDG_DATA_HOME} ${WORKING_DIR}/Xtest_xdg/share) if(NVIM_PRG) set(ENV{NVIM_PROG} "${NVIM_PRG}") @@ -25,6 +28,7 @@ if(DEFINED ENV{TEST_FILTER}) set(TEST_TAG "--filter=$ENV{TEST_FILTER}") endif() +set(ENV{SYSTEM_NAME} ${SYSTEM_NAME}) execute_process( COMMAND ${BUSTED_PRG} ${TEST_TAG} ${TEST_FILTER} -v -o ${BUSTED_OUTPUT_TYPE} --lua=${LUA_PRG} --lazy --helper=${TEST_DIR}/${TEST_TYPE}/preload.lua @@ -34,6 +38,9 @@ execute_process( RESULT_VARIABLE res ${EXTRA_ARGS}) +file(REMOVE ${WORKING_DIR}/Xtest_rplugin_manifest) +file(REMOVE_RECURSE ${WORKING_DIR}/Xtest_xdg) + if(NOT res EQUAL 0) message(STATUS "Output to stderr:\n${err}") message(FATAL_ERROR "Running ${TEST_TYPE} tests failed with error: ${res}.") diff --git a/cmake/WindowsDllCopy.cmake b/cmake/WindowsDllCopy.cmake new file mode 100644 index 0000000000..fbbabf3a0c --- /dev/null +++ b/cmake/WindowsDllCopy.cmake @@ -0,0 +1,30 @@ +# In Windows we need to find dependency DLLs and install them along with our +# binaries. This script uses the following variables: +# +# - BINARY: The binary file whose dependencies need to be installed +# - DST: The destination path +# - CMAKE_PREFIX_PATH: A list of directories to search for dependencies + +if(NOT DEFINED BINARY) + message(FATAL_ERROR "Missing required argument -DBINARY=") +endif() +if(NOT DEFINED DST) + message(FATAL_ERROR "Missing required arguments -DDST=") +endif() +if(NOT DEFINED CMAKE_PREFIX_PATH) + message(FATAL_ERROR "Missing required arguments -DCMAKE_PREFIX_PATH=") +endif() + +include(GetPrerequisites) +get_prerequisites(${BINARY} DLLS 1 1 "" "${CMAKE_PREFIX_PATH}") +foreach(DLL_NAME ${DLLS}) + find_program(DLL_PATH ${DLL_NAME}) + if(NOT DLL_PATH) + message(FATAL_ERROR "Unable to find dependency ${DLL_NAME}") + endif() + + message("Copying ${DLL_NAME} to ${DST}") + execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${DLL_PATH} ${DST}) + unset(DLL_PATH CACHE) +endforeach() + diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index 0dd8b07b7a..cced1a8d04 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -3,6 +3,7 @@ set(GENERATED_RUNTIME_DIR ${PROJECT_BINARY_DIR}/runtime) set(GENERATED_SYN_VIM ${GENERATED_RUNTIME_DIR}/syntax/vim/generated.vim) set(GENERATED_HELP_TAGS ${GENERATED_RUNTIME_DIR}/doc/tags) set(GENERATED_PACKAGE_DIR ${GENERATED_RUNTIME_DIR}/pack/dist/opt) +set(FUNCS_DATA ${PROJECT_BINARY_DIR}/funcs_data.mpack) file(MAKE_DIRECTORY ${GENERATED_RUNTIME_DIR}) file(MAKE_DIRECTORY ${GENERATED_RUNTIME_DIR}/syntax) @@ -10,13 +11,14 @@ file(MAKE_DIRECTORY ${GENERATED_RUNTIME_DIR}/syntax/vim) add_custom_command(OUTPUT ${GENERATED_SYN_VIM} COMMAND ${LUA_PRG} ${SYN_VIM_GENERATOR} - ${PROJECT_SOURCE_DIR}/src/nvim ${GENERATED_SYN_VIM} + ${PROJECT_SOURCE_DIR}/src/nvim ${GENERATED_SYN_VIM} ${FUNCS_DATA} DEPENDS ${SYN_VIM_GENERATOR} ${PROJECT_SOURCE_DIR}/src/nvim/ex_cmds.lua ${PROJECT_SOURCE_DIR}/src/nvim/auevents.lua ${PROJECT_SOURCE_DIR}/src/nvim/options.lua ${PROJECT_SOURCE_DIR}/src/nvim/eval.c + ${FUNCS_DATA} ) if(POLICY CMP0054) diff --git a/runtime/autoload/health.vim b/runtime/autoload/health.vim index 0a698e6492..783c30cbf6 100644 --- a/runtime/autoload/health.vim +++ b/runtime/autoload/health.vim @@ -1,468 +1,153 @@ -function! s:trim(s) abort - return substitute(a:s, '^\_s*\|\_s*$', '', 'g') -endfunction +function! s:enhance_syntax() abort + syntax keyword healthError ERROR + highlight link healthError Error + syntax keyword healthWarning WARNING + highlight link healthWarning WarningMsg -" Simple version comparison. -function! s:version_cmp(a, b) abort - let a = split(a:a, '\.') - let b = split(a:b, '\.') + syntax keyword healthInfo INFO + highlight link healthInfo ModeMsg - for i in range(len(a)) - if a[i] > b[i] - return 1 - elseif a[i] < b[i] - return -1 - endif - endfor + syntax keyword healthSuccess SUCCESS + highlight link healthSuccess Function - return 0 + syntax keyword healthSuggestion SUGGESTIONS + highlight link healthSuggestion String endfunction +" Runs the specified healthchecks. +" Runs all discovered healthchecks if a:plugin_names is empty. +function! health#check(plugin_names) abort + let healthchecks = empty(a:plugin_names) + \ ? s:discover_health_checks() + \ : s:to_fn_names(a:plugin_names) -" Fetch the contents of a URL. -function! s:download(url) abort - let content = '' - if executable('curl') - let content = system('curl -sL "'.a:url.'"') - endif - - if empty(content) && executable('python') - let script = " - \try:\n - \ from urllib.request import urlopen\n - \except ImportError:\n - \ from urllib2 import urlopen\n - \\n - \try:\n - \ response = urlopen('".a:url."')\n - \ print(response.read().decode('utf8'))\n - \except Exception:\n - \ pass\n - \" - let content = system('python -c "'.script.'" 2>/dev/null') - endif - - return content -endfunction - - -" Get the latest Neovim Python client version from PyPI. The result is -" cached. -function! s:latest_pypi_version() - if exists('s:pypi_version') - return s:pypi_version - endif - - let s:pypi_version = 'unknown' - let pypi_info = s:download('https://pypi.python.org/pypi/neovim/json') - if !empty(pypi_info) - let pypi_data = json_decode(pypi_info) - let s:pypi_version = get(get(pypi_data, 'info', {}), 'version', 'unknown') - return s:pypi_version - endif -endfunction - + tabnew + setlocal filetype=markdown bufhidden=wipe + call s:enhance_syntax() -" Get version information using the specified interpreter. The interpreter is -" used directly in case breaking changes were introduced since the last time -" Neovim's Python client was updated. -function! s:version_info(python) abort - let pypi_version = s:latest_pypi_version() - let python_version = s:trim(system( - \ printf('"%s" -c "import sys; print(''.''.join(str(x) ' - \ . 'for x in sys.version_info[:3]))"', a:python))) - if empty(python_version) - let python_version = 'unknown' - endif - - let nvim_path = s:trim(system(printf('"%s" -c "import sys, neovim;' - \ . 'print(neovim.__file__)" 2>/dev/null', a:python))) - if empty(nvim_path) - return [python_version, 'not found', pypi_version, 'unknown'] - endif - - let nvim_version = 'unknown' - let base = fnamemodify(nvim_path, ':h') - for meta in glob(base.'-*/METADATA', 1, 1) + glob(base.'-*/PKG-INFO', 1, 1) - for meta_line in readfile(meta) - if meta_line =~# '^Version:' - let nvim_version = matchstr(meta_line, '^Version: \zs\S\+') - endif + if empty(healthchecks) + call setline(1, 'ERROR: No healthchecks found.') + else + redraw|echo 'Running healthchecks...' + for c in healthchecks + let output = '' + call append('$', split(printf("\n%s\n%s", c, repeat('=',80)), "\n")) + try + let output = "\n\n".execute('call '.c.'()') + catch + if v:exception =~# '^Vim\%((\a\+)\)\=:E117.*\V'.c + let output = execute( + \ 'call health#report_error(''No healthcheck found for "' + \ .s:to_plugin_name(c) + \ .'" plugin.'')') + else + let output = execute( + \ 'call health#report_error(''Failed to run healthcheck for "' + \ .s:to_plugin_name(c) + \ .'" plugin. Exception:''."\n".v:exception)') + endif + endtry + call append('$', split(output, "\n") + ['']) + redraw endfor - endfor - - let version_status = 'unknown' - if nvim_version != 'unknown' && pypi_version != 'unknown' - if s:version_cmp(nvim_version, pypi_version) == -1 - let version_status = 'outdated' - else - let version_status = 'up to date' - endif endif - return [python_version, nvim_version, pypi_version, version_status] + setlocal nomodified + redraw|echo '' endfunction - -" Check the Python interpreter's usability. -function! s:check_bin(bin, notes) abort - if !filereadable(a:bin) - call add(a:notes, printf('Error: "%s" was not found.', a:bin)) - return 0 - elseif executable(a:bin) != 1 - call add(a:notes, printf('Error: "%s" is not executable.', a:bin)) - return 0 - endif - return 1 +" Starts a new report. +function! health#report_start(name) abort + echo "\n## " . a:name endfunction - -" Text wrapping that returns a list of lines -function! s:textwrap(text, width) abort - let pattern = '.*\%(\s\+\|\_$\)\zs\%<'.a:width.'c' - return map(split(a:text, pattern), 's:trim(v:val)') -endfunction - - -" Echo wrapped notes -function! s:echo_notes(notes) abort - if empty(a:notes) - return +" Indents lines *except* line 1 of a string if it contains newlines. +function! s:indent_after_line1(s, columns) abort + let lines = split(a:s, "\n", 0) + if len(lines) < 2 " We do not indent line 1, so nothing to do. + return a:s endif - - echo ' Messages:' - for msg in a:notes - if msg =~# "\n" - let msg_lines = [] - for msgl in filter(split(msg, "\n"), 'v:val !~# ''^\s*$''') - call extend(msg_lines, s:textwrap(msgl, 74)) - endfor - else - let msg_lines = s:textwrap(msg, 74) - endif - - if !len(msg_lines) - continue - endif - echo ' *' msg_lines[0] - if len(msg_lines) > 1 - echo join(map(msg_lines[1:], '" ".v:val'), "\n") - endif - endfor -endfunction - - -" Load the remote plugin manifest file and check for unregistered plugins -function! s:diagnose_manifest() abort - echo 'Checking: Remote Plugins' - let existing_rplugins = {} - - for item in remote#host#PluginsForHost('python') - let existing_rplugins[item.path] = 'python' - endfor - - for item in remote#host#PluginsForHost('python3') - let existing_rplugins[item.path] = 'python3' - endfor - - let require_update = 0 - let notes = [] - - for path in map(split(&rtp, ','), 'resolve(v:val)') - let python_glob = glob(path.'/rplugin/python*', 1, 1) - if empty(python_glob) - continue - endif - - let python_dir = python_glob[0] - let python_version = fnamemodify(python_dir, ':t') - - for script in glob(python_dir.'/*.py', 1, 1) - \ + glob(python_dir.'/*/__init__.py', 1, 1) - let contents = join(readfile(script)) - if contents =~# '\<\%(from\|import\)\s\+neovim\>' - if script =~# '/__init__\.py$' - let script = fnamemodify(script, ':h') - endif - - if !has_key(existing_rplugins, script) - let msg = printf('"%s" is not registered.', fnamemodify(path, ':t')) - if python_version == 'pythonx' - if !has('python2') && !has('python3') - let msg .= ' (python2 and python3 not available)' - endif - elseif !has(python_version) - let msg .= printf(' (%s not available)', python_version) - else - let require_update = 1 - endif - - call add(notes, msg) - endif - - break - endif - endfor + for i in range(1, len(lines)-1) " Indent lines after the first. + let lines[i] = substitute(lines[i], '^\s*', repeat(' ', a:columns), 'g') endfor - - echo ' Status: ' - if require_update - echon 'Out of date' - call add(notes, 'Run :UpdateRemotePlugins') - else - echon 'Up to date' - endif - - call s:echo_notes(notes) + return join(lines, "\n") endfunction +" Format a message for a specific report item +function! s:format_report_message(status, msg, ...) abort " {{{ + let output = ' - ' . a:status . ': ' . s:indent_after_line1(a:msg, 4) + let suggestions = [] -function! s:diagnose_python(version) abort - let python_bin_name = 'python'.(a:version == 2 ? '' : '3') - let pyenv = resolve(exepath('pyenv')) - let pyenv_root = exists('$PYENV_ROOT') ? resolve($PYENV_ROOT) : '' - let venv = exists('$VIRTUAL_ENV') ? resolve($VIRTUAL_ENV) : '' - let host_prog_var = python_bin_name.'_host_prog' - let host_skip_var = python_bin_name.'_host_skip_check' - let python_bin = '' - let python_multiple = [] - let notes = [] - - if exists('g:'.host_prog_var) - call add(notes, printf('Using: g:%s = "%s"', host_prog_var, get(g:, host_prog_var))) - endif - - let [python_bin_name, pythonx_errs] = provider#pythonx#Detect(a:version) - if empty(python_bin_name) - call add(notes, 'Warning: No Python interpreter was found with the neovim ' - \ . 'module. Using the first available for diagnostics.') - if !empty(pythonx_errs) - call add(notes, pythonx_errs) - endif - let old_skip = get(g:, host_skip_var, 0) - let g:[host_skip_var] = 1 - let [python_bin_name, pythonx_errs] = provider#pythonx#Detect(a:version) - let g:[host_skip_var] = old_skip - endif - - if !empty(python_bin_name) - if exists('g:'.host_prog_var) - let python_bin = exepath(python_bin_name) + " Optional parameters + if a:0 > 0 + let suggestions = type(a:1) == type("") ? [a:1] : a:1 + if type(suggestions) != type([]) + echoerr "Expected String or List" endif - let python_bin_name = fnamemodify(python_bin_name, ':t') endif - if !empty(pythonx_errs) - call add(notes, pythonx_errs) + " Report each suggestion + if len(suggestions) > 0 + let output .= "\n - SUGGESTIONS:" endif + for suggestion in suggestions + let output .= "\n - " . s:indent_after_line1(suggestion, 10) + endfor - if !empty(python_bin_name) && empty(python_bin) && empty(pythonx_errs) - if !exists('g:'.host_prog_var) - call add(notes, printf('Warning: "g:%s" is not set. Searching for ' - \ . '%s in the environment.', host_prog_var, python_bin_name)) - endif - - if !empty(pyenv) - if empty(pyenv_root) - call add(notes, 'Warning: pyenv was found, but $PYENV_ROOT ' - \ . 'is not set. Did you follow the final install ' - \ . 'instructions?') - else - call add(notes, printf('Notice: pyenv found: "%s"', pyenv)) - endif - - let python_bin = s:trim(system( - \ printf('"%s" which %s 2>/dev/null', pyenv, python_bin_name))) - - if empty(python_bin) - call add(notes, printf('Warning: pyenv couldn''t find %s.', python_bin_name)) - endif - endif - - if empty(python_bin) - let python_bin = exepath(python_bin_name) - - if exists('$PATH') - for path in split($PATH, ':') - let path_bin = path.'/'.python_bin_name - if path_bin != python_bin && index(python_multiple, path_bin) == -1 - \ && executable(path_bin) - call add(python_multiple, path_bin) - endif - endfor - - if len(python_multiple) - " This is worth noting since the user may install something - " that changes $PATH, like homebrew. - call add(notes, printf('Suggestion: There are multiple %s executables found. ' - \ . 'Set "g:%s" to avoid surprises.', python_bin_name, host_prog_var)) - endif - - if python_bin =~# '\<shims\>' - call add(notes, printf('Warning: "%s" appears to be a pyenv shim. ' - \ . 'This could mean that a) the "pyenv" executable is not in ' - \ . '$PATH, b) your pyenv installation is broken. ' - \ . 'You should set "g:%s" to avoid surprises.', - \ python_bin, host_prog_var)) - endif - endif - endif - endif - - if !empty(python_bin) - if !empty(pyenv) && !exists('g:'.host_prog_var) && !empty(pyenv_root) - \ && resolve(python_bin) !~# '^'.pyenv_root.'/' - call add(notes, printf('Suggestion: Create a virtualenv specifically ' - \ . 'for Neovim using pyenv and use "g:%s". This will avoid ' - \ . 'the need to install Neovim''s Python client in each ' - \ . 'version/virtualenv.', host_prog_var)) - endif - - if !empty(venv) && exists('g:'.host_prog_var) - if !empty(pyenv_root) - let venv_root = pyenv_root - else - let venv_root = fnamemodify(venv, ':h') - endif - - if resolve(python_bin) !~# '^'.venv_root.'/' - call add(notes, printf('Suggestion: Create a virtualenv specifically ' - \ . 'for Neovim and use "g:%s". This will avoid ' - \ . 'the need to install Neovim''s Python client in each ' - \ . 'virtualenv.', host_prog_var)) - endif - endif - endif - - if empty(python_bin) && !empty(python_bin_name) - " An error message should have already printed. - call add(notes, printf('Error: "%s" was not found.', python_bin_name)) - elseif !empty(python_bin) && !s:check_bin(python_bin, notes) - let python_bin = '' - endif - - " Check if $VIRTUAL_ENV is active - let virtualenv_inactive = 0 - - if exists('$VIRTUAL_ENV') - if !empty(pyenv) - let pyenv_prefix = resolve(s:trim(system(printf('"%s" prefix', pyenv)))) - if $VIRTUAL_ENV != pyenv_prefix - let virtualenv_inactive = 1 - endif - elseif !empty(python_bin_name) && exepath(python_bin_name) !~# '^'.$VIRTUAL_ENV.'/' - let virtualenv_inactive = 1 - endif - endif - - if virtualenv_inactive - call add(notes, 'Warning: $VIRTUAL_ENV exists but appears to be ' - \ . 'inactive. This could lead to unexpected results. If you are ' - \ . 'using Zsh, see: http://vi.stackexchange.com/a/7654/5229') - endif - - " Diagnostic output - echo 'Checking: Python' a:version - echo ' Executable:' (empty(python_bin) ? 'Not found' : python_bin) - if len(python_multiple) - for path_bin in python_multiple - echo ' (other):' path_bin - endfor - endif - - if !empty(python_bin) - let [pyversion, current, latest, status] = s:version_info(python_bin) - if a:version != str2nr(pyversion) - call add(notes, 'Warning: Got an unexpected version of Python. ' - \ . 'This could lead to confusing error messages. Please ' - \ . 'consider this before reporting bugs to plugin developers.') - endif - if a:version == 3 && str2float(pyversion) < 3.3 - call add(notes, 'Warning: Python 3.3+ is recommended.') - endif - - echo ' Python Version:' pyversion - echo printf(' %s-neovim Version: %s', python_bin_name, current) + return output +endfunction " }}} - if current == 'not found' - call add(notes, 'Error: Neovim Python client is not installed.') - endif +" Use {msg} to report information in the current section +function! health#report_info(msg) abort " {{{ + echo s:format_report_message('INFO', a:msg) +endfunction " }}} - if latest == 'unknown' - call add(notes, 'Warning: Unable to fetch latest Neovim Python client version.') - endif +" Reports a successful healthcheck. +function! health#report_ok(msg) abort " {{{ + echo s:format_report_message('SUCCESS', a:msg) +endfunction " }}} - if status == 'outdated' - echon ' (latest: '.latest.')' - else - echon ' ('.status.')' - endif +" Reports a health warning. +function! health#report_warn(msg, ...) abort " {{{ + if a:0 > 0 + echo s:format_report_message('WARNING', a:msg, a:1) + else + echo s:format_report_message('WARNING', a:msg) endif +endfunction " }}} - call s:echo_notes(notes) -endfunction - - -function! s:diagnose_ruby() abort - echo 'Checking: Ruby' - let ruby_vers = systemlist('ruby -v')[0] - let ruby_prog = provider#ruby#Detect() - let notes = [] - - if empty(ruby_prog) - let ruby_prog = 'not found' - let prog_vers = 'not found' - call add(notes, 'Suggestion: Install the neovim RubyGem using ' . - \ '`gem install neovim`.') +" Reports a failed healthcheck. +function! health#report_error(msg, ...) abort " {{{ + if a:0 > 0 + echo s:format_report_message('ERROR', a:msg, a:1) else - silent let prog_vers = systemlist(ruby_prog . ' --version')[0] - - if v:shell_error - let prog_vers = 'outdated' - call add(notes, 'Suggestion: Install the latest neovim RubyGem using ' . - \ '`gem install neovim`.') - elseif s:version_cmp(prog_vers, "0.2.0") == -1 - let prog_vers .= ' (outdated)' - call add(notes, 'Suggestion: Install the latest neovim RubyGem using ' . - \ '`gem install neovim`.') - endif + echo s:format_report_message('ERROR', a:msg) endif +endfunction " }}} - echo ' Ruby Version: ' . ruby_vers - echo ' Host Executable: ' . ruby_prog - echo ' Host Version: ' . prog_vers - - call s:echo_notes(notes) +function! s:filepath_to_function(name) abort + return substitute(substitute(substitute(a:name, ".*autoload/", "", ""), + \ "\\.vim", "#check", ""), "/", "#", "g") endfunction +function! s:discover_health_checks() abort + let healthchecks = globpath(&runtimepath, 'autoload/health/*.vim', 1, 1) + let healthchecks = map(healthchecks, '<SID>filepath_to_function(v:val)') + return healthchecks +endfunction -function! health#check(bang) abort - redir => report - try - silent call s:diagnose_python(2) - silent echo '' - silent call s:diagnose_python(3) - silent echo '' - silent call s:diagnose_ruby() - silent echo '' - silent call s:diagnose_manifest() - silent echo '' - finally - redir END - endtry +" Translates a list of plugin names to healthcheck function names. +function! s:to_fn_names(plugin_names) abort + let healthchecks = [] + for p in a:plugin_names + call add(healthchecks, 'health#'.p.'#check') + endfor + return healthchecks +endfunction - if a:bang - new - setlocal bufhidden=wipe - call setline(1, split(report, "\n")) - setlocal nomodified - else - echo report - echo "\nTip: Use " - echohl Identifier - echon ":CheckHealth!" - echohl None - echon " to open this in a new buffer." - endif +" Extracts 'foo' from 'health#foo#check'. +function! s:to_plugin_name(fn_name) abort + return substitute(a:fn_name, + \ '\v.*health\#(.+)\#check.*', '\1', '') endfunction diff --git a/runtime/autoload/health/nvim.vim b/runtime/autoload/health/nvim.vim new file mode 100644 index 0000000000..d769525373 --- /dev/null +++ b/runtime/autoload/health/nvim.vim @@ -0,0 +1,62 @@ +" Load the remote plugin manifest file and check for unregistered plugins +function! s:check_manifest() abort + call health#report_start('Remote Plugins') + let existing_rplugins = {} + + for item in remote#host#PluginsForHost('python') + let existing_rplugins[item.path] = 'python' + endfor + + for item in remote#host#PluginsForHost('python3') + let existing_rplugins[item.path] = 'python3' + endfor + + let require_update = 0 + + for path in map(split(&runtimepath, ','), 'resolve(v:val)') + let python_glob = glob(path.'/rplugin/python*', 1, 1) + if empty(python_glob) + continue + endif + + let python_dir = python_glob[0] + let python_version = fnamemodify(python_dir, ':t') + + for script in glob(python_dir.'/*.py', 1, 1) + \ + glob(python_dir.'/*/__init__.py', 1, 1) + let contents = join(readfile(script)) + if contents =~# '\<\%(from\|import\)\s\+neovim\>' + if script =~# '/__init__\.py$' + let script = fnamemodify(script, ':h') + endif + + if !has_key(existing_rplugins, script) + let msg = printf('"%s" is not registered.', fnamemodify(path, ':t')) + if python_version ==# 'pythonx' + if !has('python2') && !has('python3') + let msg .= ' (python2 and python3 not available)' + endif + elseif !has(python_version) + let msg .= printf(' (%s not available)', python_version) + else + let require_update = 1 + endif + + call health#report_warn(msg) + endif + + break + endif + endfor + endfor + + if require_update + call health#report_warn('Out of date', ['Run `:UpdateRemotePlugins`']) + else + call health#report_ok('Up to date') + endif +endfunction + +function! health#nvim#check() abort + call s:check_manifest() +endfunction diff --git a/runtime/autoload/health/provider.vim b/runtime/autoload/health/provider.vim new file mode 100644 index 0000000000..8fa281e7e3 --- /dev/null +++ b/runtime/autoload/health/provider.vim @@ -0,0 +1,382 @@ +let s:bad_responses = [ + \ 'unable to parse python response', + \ 'unable to parse', + \ 'unable to get pypi response', + \ 'unable to get neovim executable', + \ 'unable to find neovim version' + \ ] + +function! s:is_bad_response(s) abort + return index(s:bad_responses, a:s) >= 0 +endfunction + +function! s:trim(s) abort + return substitute(a:s, '^\_s*\|\_s*$', '', 'g') +endfunction + +" Simple version comparison. +function! s:version_cmp(a, b) abort + let a = split(a:a, '\.') + let b = split(a:b, '\.') + + for i in range(len(a)) + if a[i] > b[i] + return 1 + elseif a[i] < b[i] + return -1 + endif + endfor + + return 0 +endfunction + +" Fetch the contents of a URL. +function! s:download(url) abort + let content = '' + if executable('curl') + let content = system(['curl', '-sL', "'", a:url, "'"]) + endif + + if empty(content) && executable('python') + let script = " + \try:\n + \ from urllib.request import urlopen\n + \except ImportError:\n + \ from urllib2 import urlopen\n + \\n + \try:\n + \ response = urlopen('".a:url."')\n + \ print(response.read().decode('utf8'))\n + \except Exception:\n + \ pass\n + \" + let content = system(['python', '-c', "'", script, "'", '2>/dev/null']) + endif + + return content +endfunction + + +" Get the latest Neovim Python client version from PyPI. Result is cached. +function! s:latest_pypi_version() abort + if exists('s:pypi_version') + return s:pypi_version + endif + + let s:pypi_version = 'unable to get pypi response' + let pypi_info = s:download('https://pypi.python.org/pypi/neovim/json') + if !empty(pypi_info) + let pypi_data = json_decode(pypi_info) + let s:pypi_version = get(get(pypi_data, 'info', {}), 'version', 'unable to parse') + return s:pypi_version + endif +endfunction + +" Get version information using the specified interpreter. The interpreter is +" used directly in case breaking changes were introduced since the last time +" Neovim's Python client was updated. +" +" Returns: [ +" {python executable version}, +" {current nvim version}, +" {current pypi nvim status}, +" {installed version status} +" ] +function! s:version_info(python) abort + let pypi_version = s:latest_pypi_version() + let python_version = s:trim(system([ + \ a:python, + \ '-c', + \ 'import sys; print(".".join(str(x) for x in sys.version_info[:3]))', + \ ])) + + if empty(python_version) + let python_version = 'unable to parse python response' + endif + + let nvim_path = s:trim(system([ + \ a:python, + \ '-c', + \ 'import neovim; print(neovim.__file__)', + \ '2>/dev/null'])) + + let nvim_path = s:trim(system([ + \ 'python3', + \ '-c', + \ 'import neovim; print(neovim.__file__)' + \ ])) + " \ '2>/dev/null'])) + + if empty(nvim_path) + return [python_version, 'unable to find neovim executable', pypi_version, 'unable to get neovim executable'] + endif + + let nvim_version = 'unable to find neovim version' + let base = fnamemodify(nvim_path, ':h') + for meta in glob(base.'-*/METADATA', 1, 1) + glob(base.'-*/PKG-INFO', 1, 1) + for meta_line in readfile(meta) + if meta_line =~# '^Version:' + let nvim_version = matchstr(meta_line, '^Version: \zs\S\+') + endif + endfor + endfor + + let version_status = 'unknown' + if !s:is_bad_response(nvim_version) && !s:is_bad_response(pypi_version) + if s:version_cmp(nvim_version, pypi_version) == -1 + let version_status = 'outdated' + else + let version_status = 'up to date' + endif + endif + + return [python_version, nvim_version, pypi_version, version_status] +endfunction + +" Check the Python interpreter's usability. +function! s:check_bin(bin) abort + if !filereadable(a:bin) + call health#report_error(printf('"%s" was not found.', a:bin)) + return 0 + elseif executable(a:bin) != 1 + call health#report_error(printf('"%s" is not executable.', a:bin)) + return 0 + endif + return 1 +endfunction + +function! s:check_python(version) abort + call health#report_start('Python ' . a:version . ' provider') + + let python_bin_name = 'python'.(a:version == 2 ? '2' : '3') + let pyenv = resolve(exepath('pyenv')) + let pyenv_root = exists('$PYENV_ROOT') ? resolve($PYENV_ROOT) : 'n' + let venv = exists('$VIRTUAL_ENV') ? resolve($VIRTUAL_ENV) : '' + let host_prog_var = python_bin_name.'_host_prog' + let host_skip_var = python_bin_name.'_host_skip_check' + let python_bin = '' + let python_multiple = [] + + if exists('g:'.host_prog_var) + call health#report_info(printf('Using: g:%s = "%s"', host_prog_var, get(g:, host_prog_var))) + endif + + let [python_bin_name, pythonx_errs] = provider#pythonx#Detect(a:version) + if empty(python_bin_name) + call health#report_warn('No Python interpreter was found with the neovim ' + \ . 'module. Using the first available for diagnostics.') + if !empty(pythonx_errs) + call health#report_warn(pythonx_errs) + endif + let old_skip = get(g:, host_skip_var, 0) + let g:[host_skip_var] = 1 + let [python_bin_name, pythonx_errs] = provider#pythonx#Detect(a:version) + let g:[host_skip_var] = old_skip + endif + + if !empty(python_bin_name) + if exists('g:'.host_prog_var) + let python_bin = exepath(python_bin_name) + endif + let python_bin_name = fnamemodify(python_bin_name, ':t') + endif + + if !empty(pythonx_errs) + call health#report_error('Python provider error', pythonx_errs) + endif + + if !empty(python_bin_name) && empty(python_bin) && empty(pythonx_errs) + if !exists('g:'.host_prog_var) + call health#report_info(printf('`g:%s` is not set. Searching for ' + \ . '%s in the environment.', host_prog_var, python_bin_name)) + endif + + if !empty(pyenv) + if empty(pyenv_root) + call health#report_warn( + \ 'pyenv was found, but $PYENV_ROOT is not set.', + \ ['Did you follow the final install instructions?'] + \ ) + else + call health#report_ok(printf('pyenv found: "%s"', pyenv)) + endif + + let python_bin = s:trim(system( + \ printf('"%s" which %s 2>/dev/null', pyenv, python_bin_name))) + + if empty(python_bin) + call health#report_warn(printf('pyenv couldn''t find %s.', python_bin_name)) + endif + endif + + if empty(python_bin) + let python_bin = exepath(python_bin_name) + + if exists('$PATH') + for path in split($PATH, ':') + let path_bin = path.'/'.python_bin_name + if path_bin != python_bin && index(python_multiple, path_bin) == -1 + \ && executable(path_bin) + call add(python_multiple, path_bin) + endif + endfor + + if len(python_multiple) + " This is worth noting since the user may install something + " that changes $PATH, like homebrew. + call health#report_info(printf('There are multiple %s executables found. ' + \ . 'Set "g:%s" to avoid surprises.', python_bin_name, host_prog_var)) + endif + + if python_bin =~# '\<shims\>' + call health#report_warn(printf('"%s" appears to be a pyenv shim.', python_bin), [ + \ 'The "pyenv" executable is not in $PATH,', + \ 'Your pyenv installation is broken. You should set ' + \ . '"g:'.host_prog_var.'" to avoid surprises.', + \ ]) + endif + endif + endif + endif + + if !empty(python_bin) + if empty(venv) && !empty(pyenv) && !exists('g:'.host_prog_var) + \ && !empty(pyenv_root) && resolve(python_bin) !~# '^'.pyenv_root.'/' + call health#report_warn('pyenv is not set up optimally.', [ + \ printf('Suggestion: Create a virtualenv specifically ' + \ . 'for Neovim using pyenv and use "g:%s". This will avoid ' + \ . 'the need to install Neovim''s Python client in each ' + \ . 'version/virtualenv.', host_prog_var) + \ ]) + elseif !empty(venv) && exists('g:'.host_prog_var) + if !empty(pyenv_root) + let venv_root = pyenv_root + else + let venv_root = fnamemodify(venv, ':h') + endif + + if resolve(python_bin) !~# '^'.venv_root.'/' + call health#report_warn('Your virtualenv is not set up optimally.', [ + \ printf('Suggestion: Create a virtualenv specifically ' + \ . 'for Neovim and use "g:%s". This will avoid ' + \ . 'the need to install Neovim''s Python client in each ' + \ . 'virtualenv.', host_prog_var) + \ ]) + endif + endif + endif + + if empty(python_bin) && !empty(python_bin_name) + " An error message should have already printed. + call health#report_error(printf('"%s" was not found.', python_bin_name)) + elseif !empty(python_bin) && !s:check_bin(python_bin) + let python_bin = '' + endif + + " Check if $VIRTUAL_ENV is active + let virtualenv_inactive = 0 + + if exists('$VIRTUAL_ENV') + if !empty(pyenv) + let pyenv_prefix = resolve(s:trim(system([pyenv, 'prefix']))) + if $VIRTUAL_ENV != pyenv_prefix + let virtualenv_inactive = 1 + endif + elseif !empty(python_bin_name) && exepath(python_bin_name) !~# '^'.$VIRTUAL_ENV.'/' + let virtualenv_inactive = 1 + endif + endif + + if virtualenv_inactive + let suggestions = [ + \ 'If you are using Zsh, see: http://vi.stackexchange.com/a/7654/5229', + \ ] + call health#report_warn( + \ '$VIRTUAL_ENV exists but appears to be inactive. ' + \ . 'This could lead to unexpected results.', + \ suggestions) + endif + + " Diagnostic output + call health#report_info('Executable: ' . (empty(python_bin) ? 'Not found' : python_bin)) + if len(python_multiple) + for path_bin in python_multiple + call health#report_info('Other python executable: ' . path_bin) + endfor + endif + + if !empty(python_bin) + let [pyversion, current, latest, status] = s:version_info(python_bin) + if a:version != str2nr(pyversion) + call health#report_warn('Got an unexpected version of Python.' . + \ ' This could lead to confusing error messages.') + endif + if a:version == 3 && str2float(pyversion) < 3.3 + call health#report_warn('Python 3.3+ is recommended.') + endif + + call health#report_info('Python'.a:version.' version: ' . pyversion) + call health#report_info(printf('%s-neovim Version: %s', python_bin_name, current)) + + if s:is_bad_response(current) + let suggestions = [ + \ 'Error found was: ' . current, + \ 'Use the command `$ pip' . a:version . ' install neovim`', + \ ] + call health#report_error( + \ 'Neovim Python client is not installed.', + \ suggestions) + endif + + if s:is_bad_response(latest) + call health#report_warn('Unable to fetch latest Neovim Python client version.') + endif + + if s:is_bad_response(status) + call health#report_warn('Latest Neovim Python client versions: ('.latest.')') + else + call health#report_ok('Latest Neovim Python client is installed: ('.status.')') + endif + endif + +endfunction + +function! s:check_ruby() abort + call health#report_start('Ruby provider') + let ruby_version = systemlist('ruby -v')[0] + let ruby_prog = provider#ruby#Detect() + let suggestions = + \ ['Install or upgrade the neovim RubyGem using `gem install neovim`.'] + + if empty(ruby_prog) + let ruby_prog = 'not found' + let prog_vers = 'not found' + call health#report_error('Missing Neovim RubyGem', suggestions) + else + silent let latest_gem = get(systemlist("gem list -ra '^neovim$' 2>/dev/null | " . + \ "awk -F'[()]' '{print $2}' | " . + \ 'cut -d, -f1'), 0, 'not found') + let latest_desc = ' (latest: ' . latest_gem . ')' + + silent let prog_vers = systemlist(ruby_prog . ' --version')[0] + if v:shell_error + let prog_vers = 'not found' . latest_desc + call health#report_warn('Neovim RubyGem is not up-to-date.', suggestions) + elseif s:version_cmp(prog_vers, latest_gem) == -1 + let prog_vers .= latest_desc + call health#report_warn('Neovim RubyGem is not up-to-date.', suggestions) + else + call health#report_ok('Found up-to-date neovim RubyGem') + endif + endif + + call health#report_info('Ruby Version: ' . ruby_version) + call health#report_info('Host Executable: ' . ruby_prog) + call health#report_info('Host Version: ' . prog_vers) +endfunction + +function! health#provider#check() abort + call s:check_python(2) + call s:check_python(3) + call s:check_ruby() +endfunction diff --git a/runtime/autoload/man.vim b/runtime/autoload/man.vim index 0dfcc424e2..bac88fc99e 100644 --- a/runtime/autoload/man.vim +++ b/runtime/autoload/man.vim @@ -1,137 +1,261 @@ -let s:man_tag_depth = 0 -let s:man_sect_arg = '' -let s:man_find_arg = '-w' +" Maintainer: Anmol Sethi <anmol@aubble.com> +if &shell =~# 'fish$' + let s:man_cmd = 'man ^/dev/null' +else + let s:man_cmd = 'man 2>/dev/null' +endif + +let s:man_find_arg = "-w" + +" TODO(nhooyr) Completion may work on SunOS; I'm not sure if `man -l` displays +" the list of searched directories. try - if !has('win32') && $OSTYPE !~? 'cygwin\|linux' && system('uname -s') =~? 'SunOS' && system('uname -r') =~? '^5' - let s:man_sect_arg = '-s' + if !has('win32') && $OSTYPE !~? 'cygwin\|linux' && system('uname -s') =~? 'SunOS' && system('uname -r') =~# '^5' let s:man_find_arg = '-l' endif catch /E145:/ " Ignore the error in restricted mode endtry -" Load man page {page} from {section} -" call man#get_page([{section}, ]{page}) -function man#get_page(...) abort - let invoked_from_man = (&filetype ==# 'man') - - if a:0 == 0 - echoerr 'argument required' +function! man#open_page(count, count1, mods, ...) abort + if a:0 > 2 + call s:error('too many arguments') return - elseif a:0 > 2 - echoerr 'too many arguments' + elseif a:0 == 0 + let ref = &filetype ==# 'man' ? expand('<cWORD>') : expand('<cword>') + if empty(ref) + call s:error('no identifier under cursor') + return + endif + elseif a:0 ==# 1 + let ref = a:1 + else + " Combine the name and sect into a manpage reference so that all + " verification/extraction can be kept in a single function. + " If a:2 is a reference as well, that is fine because it is the only + " reference that will match. + let ref = a:2.'('.a:1.')' + endif + try + let [sect, name] = man#extract_sect_and_name_ref(ref) + if a:count ==# a:count1 + " v:count defaults to 0 which is a valid section, and v:count1 defaults to + " 1, also a valid section. If they are equal, count explicitly set. + let sect = string(a:count) + endif + let [sect, name, path] = s:verify_exists(sect, name) + catch + call s:error(v:exception) return + endtry + call s:push_tag() + let bufname = 'man://'.name.(empty(sect)?'':'('.sect.')') + if a:mods !~# 'tab' && s:find_man() + noautocmd execute 'silent edit' bufname + else + noautocmd execute 'silent' a:mods 'split' bufname endif + let b:man_sect = sect + call s:read_page(path) +endfunction - let sect = get(a:000, 0) - let page = get(a:000, 1, sect) +function! man#read_page(ref) abort + try + let [sect, name] = man#extract_sect_and_name_ref(a:ref) + let [b:man_sect, name, path] = s:verify_exists(sect, name) + catch + " call to s:error() is unnecessary + return + endtry + call s:read_page(path) +endfunction - let [page, sect] = s:parse_page_and_section(sect, page) +function! s:read_page(path) abort + setlocal modifiable + setlocal noreadonly + silent keepjumps %delete _ + " Force MANPAGER=cat to ensure Vim is not recursively invoked (by man-db). + " http://comments.gmane.org/gmane.editors.vim.devel/29085 + " Respect $MANWIDTH, or default to window width. + let cmd = 'env MANPAGER=cat'.(empty($MANWIDTH) ? ' MANWIDTH='.winwidth(0) : '') + let cmd .= ' '.s:man_cmd.' '.shellescape(a:path) + silent put =system(cmd) + " remove all the backspaced text + execute 'silent keeppatterns keepjumps %substitute,.\b,,e'.(&gdefault?'':'g') + while getline(1) =~# '^\s*$' + silent keepjumps 1delete _ + endwhile + setlocal filetype=man +endfunction - if !empty(sect) && s:find_page(sect, page) == 0 - let sect = '' +" attempt to extract the name and sect out of 'name(sect)' +" otherwise just return the largest string of valid characters in ref +function! man#extract_sect_and_name_ref(ref) abort + if a:ref[0] ==# '-' " try ':Man -pandoc' with this disabled. + throw 'manpage name cannot start with ''-''' endif - - if s:find_page(sect, page) == 0 - echo 'No manual entry for '.page - return + let ref = matchstr(a:ref, '[^()]\+([^()]\+)') + if empty(ref) + let name = matchstr(a:ref, '[^()]\+') + if empty(name) + throw 'manpage reference cannot contain only parentheses' + endif + return [get(b:, 'man_default_sects', ''), name] endif + let left = split(ref, '(') + " see ':Man 3X curses' on why tolower. + " TODO(nhooyr) Not sure if this is portable across OSs + " but I have not seen a single uppercase section. + return [tolower(split(left[1], ')')[0]), left[0]] +endfunction - exec 'let s:man_tag_buf_'.s:man_tag_depth.' = '.bufnr('%') - exec 'let s:man_tag_lin_'.s:man_tag_depth.' = '.line('.') - exec 'let s:man_tag_col_'.s:man_tag_depth.' = '.col('.') - let s:man_tag_depth = s:man_tag_depth + 1 - - let editcmd = 'edit' - " Use an existing 'man' window, else open a new one. - if &filetype !=# 'man' - let thiswin = winnr() - wincmd b - if winnr() > 1 - exec thiswin . 'wincmd w' - while 1 - if &filetype ==# 'man' - break - endif - wincmd w - if thiswin == winnr() - break - endif - endwhile +function! s:get_path(sect, name) abort + if empty(a:sect) + let path = system(s:man_cmd.' '.s:man_find_arg.' '.shellescape(a:name)) + if path !~# '^\/' + throw 'no manual entry for '.a:name endif + return path + endif + " '-s' flag handles: + " - tokens like 'printf(echo)' + " - sections starting with '-' + " - 3pcap section (found on macOS) + " - commas between sections (for section priority) + return system(s:man_cmd.' '.s:man_find_arg.' -s '.shellescape(a:sect).' '.shellescape(a:name)) +endfunction - if &filetype !=# 'man' - let editcmd = 'tabnew' +function! s:verify_exists(sect, name) abort + let path = s:get_path(a:sect, a:name) + if path !~# '^\/' + let path = s:get_path(get(b:, 'man_default_sects', ''), a:name) + if path !~# '^\/' + let path = s:get_path('', a:name) endif endif + " We need to extract the section from the path because sometimes + " the actual section of the manpage is more specific than the section + " we provided to `man`. Try ':Man 3 App::CLI'. + " Also on linux, it seems that the name is case insensitive. So if one does + " ':Man PRIntf', we still want the name of the buffer to be 'printf' or + " whatever the correct capitilization is. + let path = path[:len(path)-2] + return s:extract_sect_and_name_path(path) + [path] +endfunction - silent exec editcmd.' man://'.page.(empty(sect)?'':'('.sect.')') - - setlocal modifiable - silent keepjumps norm! 1G"_dG - if empty($MANWIDTH) - let $MANWIDTH = winwidth(0) - endif - silent exec 'r!/usr/bin/man '.s:cmd(sect, page).' | col -b' - " Remove blank lines from top and bottom. - while getline(1) =~# '^\s*$' - silent keepjumps 1delete _ - endwhile - while getline('$') =~# '^\s*$' - silent keepjumps $delete _ - endwhile - setlocal nomodified - setlocal filetype=man +let s:tag_stack = [] - if invoked_from_man || editcmd ==# 'tabnew' - call s:set_window_local_options() - endif +function! s:push_tag() abort + let s:tag_stack += [{ + \ 'buf': bufnr('%'), + \ 'lnum': line('.'), + \ 'col': col('.'), + \ }] endfunction -function s:set_window_local_options() abort - setlocal colorcolumn=0 foldcolumn=0 nonumber - setlocal nolist norelativenumber nofoldenable +function! man#pop_tag() abort + if !empty(s:tag_stack) + let tag = remove(s:tag_stack, -1) + silent execute tag['buf'].'buffer' + call cursor(tag['lnum'], tag['col']) + endif endfunction -function man#pop_page() abort - if s:man_tag_depth > 0 - let s:man_tag_depth = s:man_tag_depth - 1 - exec "let s:man_tag_buf=s:man_tag_buf_".s:man_tag_depth - exec "let s:man_tag_lin=s:man_tag_lin_".s:man_tag_depth - exec "let s:man_tag_col=s:man_tag_col_".s:man_tag_depth - exec s:man_tag_buf."b" - exec s:man_tag_lin - exec "norm! ".s:man_tag_col."|" - exec "unlet s:man_tag_buf_".s:man_tag_depth - exec "unlet s:man_tag_lin_".s:man_tag_depth - exec "unlet s:man_tag_col_".s:man_tag_depth - unlet s:man_tag_buf s:man_tag_lin s:man_tag_col +" extracts the name and sect out of 'path/name.sect' +function! s:extract_sect_and_name_path(path) abort + let tail = fnamemodify(a:path, ':t') + if a:path =~# '\.\%([glx]z\|bz2\|lzma\|Z\)$' " valid extensions + let tail = fnamemodify(tail, ':r') endif + let sect = matchstr(tail, '\.\zs[^.]\+$') + let name = matchstr(tail, '^.\+\ze\.') + return [sect, name] endfunction -" Expects a string like 'access' or 'access(2)'. -function s:parse_page_and_section(sect, str) abort - try - let [page, sect] = matchlist(a:str, '\v\C([-.[:alnum:]_]+)%(\(([-.[:alnum:]_]+)\))?')[1:2] - if empty(sect) - let sect = a:sect +function! s:find_man() abort + if &filetype ==# 'man' + return 1 + elseif winnr('$') ==# 1 + return 0 + endif + let thiswin = winnr() + while 1 + wincmd w + if &filetype ==# 'man' + return 1 + elseif thiswin ==# winnr() + return 0 endif - catch - echoerr 'man.vim: failed to parse: "'.a:str.'"' - endtry + endwhile +endfunction - return [page, sect] +function! s:error(msg) abort + redraw + echohl ErrorMsg + echon 'man.vim: ' a:msg + echohl None endfunction -function s:cmd(sect, page) abort - if !empty(a:sect) - return s:man_sect_arg.' '.a:sect.' '.a:page +let s:mandirs = join(split(system(s:man_cmd.' '.s:man_find_arg), ':\|\n'), ',') + +" see man#extract_sect_and_name_ref on why tolower(sect) +function! man#complete(arg_lead, cmd_line, cursor_pos) abort + let args = split(a:cmd_line) + let l = len(args) + if l > 3 + return + elseif l ==# 1 + let name = '' + let sect = '' + elseif a:arg_lead =~# '^[^()]\+([^()]*$' + " cursor (|) is at ':Man printf(|' or ':Man 1 printf(|' + " The later is is allowed because of ':Man pri<TAB>'. + " It will offer 'priclass.d(1m)' even though section is specified as 1. + let tmp = split(a:arg_lead, '(') + let name = tmp[0] + let sect = tolower(get(tmp, 1, '')) + elseif args[1] !~# '^[^()]\+$' + " cursor (|) is at ':Man 3() |' or ':Man (3|' or ':Man 3() pri|' + " or ':Man 3() pri |' + return + elseif l ==# 2 + if empty(a:arg_lead) + " cursor (|) is at ':Man 1 |' + let name = '' + let sect = tolower(args[1]) + else + " cursor (|) is at ':Man pri|' + if a:arg_lead =~# '\/' + " if the name is a path, complete files + " TODO(nhooyr) why does this complete the last one automatically + return glob(a:arg_lead.'*', 0, 1) + endif + let name = a:arg_lead + let sect = '' + endif + elseif a:arg_lead !~# '^[^()]\+$' + " cursor (|) is at ':Man 3 printf |' or ':Man 3 (pr)i|' + return + else + " cursor (|) is at ':Man 3 pri|' + let name = a:arg_lead + let sect = tolower(args[1]) endif - return a:page + " We remove duplicates incase the same manpage in different languages was found. + return uniq(sort(map(globpath(s:mandirs,'man?/'.name.'*.'.sect.'*', 0, 1), 's:format_candidate(v:val, sect)'), 'i')) endfunction -function s:find_page(sect, page) abort - let where = system('/usr/bin/man '.s:man_find_arg.' '.s:cmd(a:sect, a:page)) - return (where =~# '^ */') +function! s:format_candidate(path, sect) abort + if a:path =~# '\.\%(pdf\|in\)$' " invalid extensions + return + endif + let [sect, name] = s:extract_sect_and_name_path(a:path) + if sect ==# a:sect + return name + elseif sect =~# a:sect.'.\+$' + " We include the section if the user provided section is a prefix + " of the actual section. + return name.'('.sect.')' + endif endfunction diff --git a/runtime/autoload/provider/pythonx.vim b/runtime/autoload/provider/pythonx.vim index 0ebf00112f..6d6b38978c 100644 --- a/runtime/autoload/provider/pythonx.vim +++ b/runtime/autoload/provider/pythonx.vim @@ -5,11 +5,24 @@ endif let s:loaded_pythonx_provider = 1 +let s:stderr = {} +let s:job_opts = {'rpc': v:true} + +" TODO(bfredl): this logic is common and should be builtin +function! s:job_opts.on_stderr(chan_id, data, event) + let stderr = get(s:stderr, a:chan_id, ['']) + let last = remove(stderr, -1) + let a:data[0] = last.a:data[0] + call extend(stderr, a:data) + let s:stderr[a:chan_id] = stderr +endfunction + function! provider#pythonx#Require(host) abort let ver = (a:host.orig_name ==# 'python') ? 2 : 3 " Python host arguments - let args = ['-c', 'import sys; sys.path.remove(""); import neovim; neovim.start_host()'] + let prog = (ver == '2' ? provider#python#Prog() : provider#python3#Prog()) + let args = [prog, '-c', 'import sys; sys.path.remove(""); import neovim; neovim.start_host()'] " Collect registered Python plugins into args let python_plugins = remote#host#PluginsForHost(a:host.name) @@ -18,14 +31,16 @@ function! provider#pythonx#Require(host) abort endfor try - let channel_id = rpcstart((ver ==# '2' ? - \ provider#python#Prog() : provider#python3#Prog()), args) + let channel_id = jobstart(args, s:job_opts) if rpcrequest(channel_id, 'poll') ==# 'ok' return channel_id endif catch echomsg v:throwpoint echomsg v:exception + for row in get(s:stderr, channel_id, []) + echomsg row + endfor endtry throw remote#host#LoadErrorForHost(a:host.orig_name, \ '$NVIM_PYTHON_LOG_FILE') diff --git a/runtime/autoload/provider/ruby.vim b/runtime/autoload/provider/ruby.vim index e9130b98c1..c8ede20a75 100644 --- a/runtime/autoload/provider/ruby.vim +++ b/runtime/autoload/provider/ruby.vim @@ -4,6 +4,17 @@ if exists('g:loaded_ruby_provider') endif let g:loaded_ruby_provider = 1 +let s:stderr = {} +let s:job_opts = {'rpc': v:true} + +function! s:job_opts.on_stderr(chan_id, data, event) + let stderr = get(s:stderr, a:chan_id, ['']) + let last = remove(stderr, -1) + let a:data[0] = last.a:data[0] + call extend(stderr, a:data) + let s:stderr[a:chan_id] = stderr +endfunction + function! provider#ruby#Detect() abort return exepath('neovim-ruby-host') endfunction @@ -13,7 +24,7 @@ function! provider#ruby#Prog() endfunction function! provider#ruby#Require(host) abort - let args = [] + let args = [provider#ruby#Prog()] let ruby_plugins = remote#host#PluginsForHost(a:host.name) for plugin in ruby_plugins @@ -21,13 +32,16 @@ function! provider#ruby#Require(host) abort endfor try - let channel_id = rpcstart(provider#ruby#Prog(), args) + let channel_id = jobstart(args, s:job_opts) if rpcrequest(channel_id, 'poll') ==# 'ok' return channel_id endif catch echomsg v:throwpoint echomsg v:exception + for row in get(s:stderr, channel_id, []) + echomsg row + endfor endtry throw remote#host#LoadErrorForHost(a:host.orig_name, '$NVIM_RUBY_LOG_FILE') endfunction diff --git a/runtime/autoload/remote/host.vim b/runtime/autoload/remote/host.vim index eb5e87d7e1..110f80297a 100644 --- a/runtime/autoload/remote/host.vim +++ b/runtime/autoload/remote/host.vim @@ -118,7 +118,32 @@ function! remote#host#RegisterPlugin(host, path, specs) abort endfunction -function! s:GetManifest() abort +" Get the path to the rplugin manifest file. +function! s:GetManifestPath() abort + let manifest_base = '' + + if exists('$NVIM_RPLUGIN_MANIFEST') + return fnamemodify($NVIM_RPLUGIN_MANIFEST, ':p') + endif + + let dest = has('win32') ? '$LOCALAPPDATA' : '$XDG_DATA_HOME' + if !exists(dest) + let dest = has('win32') ? '~/AppData/Local' : '~/.local/share' + endif + + let dest = fnamemodify(expand(dest), ':p') + if !empty(dest) && !filereadable(dest) + let dest .= ('/' ==# dest[-1:] ? '' : '/') . 'nvim' + call mkdir(dest, 'p', 0700) + let manifest_base = dest + endif + + return manifest_base.'/rplugin.vim' +endfunction + + +" Old manifest file based on known script locations. +function! s:GetOldManifestPath() abort let prefix = exists('$MYVIMRC') \ ? $MYVIMRC \ : matchstr(get(split(execute('scriptnames'), '\n'), 0, ''), '\f\+$') @@ -127,9 +152,25 @@ function! s:GetManifest() abort endfunction +function! s:GetManifest() abort + let manifest = s:GetManifestPath() + + if !filereadable(manifest) + " Check if an old manifest file exists and move it to the new location. + let old_manifest = s:GetOldManifestPath() + if filereadable(old_manifest) + call rename(old_manifest, manifest) + endif + endif + + return manifest +endfunction + + function! remote#host#LoadRemotePlugins() abort - if filereadable(s:GetManifest()) - exe 'source '.s:GetManifest() + let manifest = s:GetManifest() + if filereadable(manifest) + execute 'source' fnameescape(manifest) endif endfunction @@ -137,7 +178,9 @@ endfunction function! remote#host#LoadRemotePluginsEvent(event, pattern) abort autocmd! nvim-rplugin call remote#host#LoadRemotePlugins() - execute 'silent doautocmd <nomodeline>' a:event a:pattern + if exists('#'.a:event.'#'.a:pattern) " Avoid 'No matching autocommands'. + execute 'silent doautocmd <nomodeline>' a:event a:pattern + endif endfunction @@ -202,7 +245,7 @@ function! remote#host#UpdateRemotePlugins() abort endif endfor call writefile(commands, s:GetManifest()) - echomsg printf('remote/host: generated the manifest file in "%s"', + echomsg printf('remote/host: generated rplugin manifest: %s', \ s:GetManifest()) endfunction @@ -220,9 +263,8 @@ function! remote#host#LoadErrorForHost(host, log) abort \ 'You can try to see what happened '. \ 'by starting Neovim with the environment variable '. \ a:log . ' set to a file and opening the generated '. - \ 'log file. Also, the host stderr will be available '. - \ 'in Neovim log, so it may contain useful information. '. - \ 'See also ~/.nvimlog.' + \ 'log file. Also, the host stderr is available '. + \ 'in messages.' endfunction diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index bdeca367b1..c3d7fdb35b 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -14,13 +14,13 @@ C API for Nvim *API* *api* ============================================================================== 1. Introduction *api-intro* -Nvim exposes a public API for external code to interact with the Nvim core. In -the present version of Nvim the API is primarily used by external processes to -interact with Nvim using the msgpack-rpc protocol, see |msgpack-rpc|. The API -will also be used from vimscript to access new Nvim core features, but this is -not implemented yet. Later on, Nvim might be embeddable in C applications as -libnvim, and the application will then control the embedded instance by -calling the C API directly. +Nvim exposes a public API for external code to interact with the Nvim core. +The API is used by external processes to interact with Nvim using the +msgpack-rpc protocol, see |msgpack-rpc|. The API is used from vimscript to +access some new Nvim core features. See |eval-api| for how api functions are +called from vimscript. Later on, Nvim might be embeddable in C applications as +libnvim, and the application will then control the embedded instance by calling +the C API directly. ============================================================================== 2. API Types *api-types* @@ -73,10 +73,10 @@ Another use case are plugins that show output in an append-only buffer, and want to add highlights to the outputs. Highlight data cannot be preserved on writing and loading a buffer to file, nor in undo/redo cycles. -Highlights are registered using the |buffer_add_highlight| function, see the +Highlights are registered using the |nvim_buf_add_highlight| function, see the generated API documentation for details. If an external highlighter plugin is adding a large number of highlights in a batch, performance can be improved by -calling |buffer_add_highlight| as an asynchronous notification, after first +calling |nvim_buf_add_highlight| as an asynchronous notification, after first (synchronously) reqesting a source id. Here is an example using wrapper functions in the python client: > @@ -91,10 +91,19 @@ functions in the python client: buf.clear_highlight(src) < If the highlights don't need to be deleted or updated, just pass -1 as -src_id (this is the default in python). |buffer_clear_highlight| can be used -to clear highligts from a specific source, in a specific line range or the -entire buffer by passing in the line range 0, -1 (the later is the default +src_id (this is the default in python). |nvim_buf_clear_highlight| can be used +to clear highlights from a specific source, in a specific line range or the +entire buffer by passing in the line range 0, -1 (the latter is the default in python as used above). +An example of calling the api from vimscript: > + + call nvim_buf_set_lines(0, 0, 0, v:true, ["test text"]) + let src = nvim_buf_add_highlight(0, 0, "String", 1, 0, 4) + call nvim_buf_add_highlight(0, src, "Identifier", 0, 5, -1) + + " later + call nvim_buf_clear_highlight(0, src, 0, -1) +> ============================================================================== vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/develop.txt b/runtime/doc/develop.txt index 6ecbf9fb0d..ddec137079 100644 --- a/runtime/doc/develop.txt +++ b/runtime/doc/develop.txt @@ -124,13 +124,26 @@ include the kitchen sink... but you can use it for plumbing." ============================================================================== 2. Design decisions *design-decisions* -Jargon *dev-jargon* +JARGON *dev-jargon* + +API client ~ +All external UIs and remote plugins (as opposed to regular Vim plugins) are +"clients" in general; but we call something an "API client" if its purpose is +to abstract or wrap the RPC API for the convenience of other applications +(just like a REST client or SDK such as boto3 for AWS: you can speak AWS REST +using an HTTP client like curl, but boto3 wraps that in a convenient python +interface). For example, the Nvim lua-client is an API client: + https://github.com/neovim/lua-client Host ~ A plugin "host" is both a client (of the Nvim API) and a server (of an external platform, e.g. python). It is a remote plugin that hosts other plugins. +Remote plugin ~ +Arbitrary code registered via |:UpdateRemotePlugins|, that runs in a separate +process and communicates with Nvim via the |api|. + Window ~ The word "window" is commonly used for several things: A window on the screen, the xterm window, a window inside Vim to view a buffer. @@ -145,7 +158,7 @@ window View on a buffer. There can be several windows in Vim, together with the command line, menubar, toolbar, etc. they fit in the shell. -Providers *dev-provider* +PROVIDERS *dev-provider* A goal of Nvim is to allow extension of the editor without special knowledge in the core. But some Vim components are too tightly coupled; in those cases @@ -189,8 +202,35 @@ Python host isn't installed then the plugin will "think" it is running in a Vim compiled without the |+python| feature. -RPC API -API client -remote plugin +API *dev-api* + +Use this pattern to name new API functions: + nvim_{thing}_{action}_{arbitrary-qualifiers} + +If the function acts on an object then {thing} is the name of that object +(e.g. "buf" or "win"). If the function operates in a "global" context then +{thing} is usually omitted (but consider "namespacing" your global operations +with a {thing} that groups functions under a common concept). + +Use existing common {action} names if possible: + add append to, or insert into, a collection + get get a thing (or subset of things by some query) + set set a thing + del delete a thing (or group of things) + list get all things + +Use consistent names for {thing} in all API function. E.g. a buffer is called +"buf" everywhere, not "buffer" in some places and "buf" in others. + +Example: `nvim_get_current_line` acts on the global editor state; the common +{action} "get" is used but {thing} is omitted. + +Example: `nvim_buf_add_highlight` acts on a `Buffer` object (the first +parameter) and uses the common {action} "add". + +Example: `nvim_list_bufs` operates in a global context (first parameter is +_not_ a Buffer). The common {action} "list" indicates that it lists all +bufs (plural) in the global context. + vim:tw=78:ts=8:ft=help:norl: diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index de1ced160c..d97a1400ce 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -754,13 +754,23 @@ expressions are referring to the same |List| or |Dictionary| instance. A copy of a |List| is different from the original |List|. When using "is" without a |List| or a |Dictionary| it is equivalent to using "equal", using "isnot" equivalent to using "not equal". Except that a different type means the -values are different: "4 == '4'" is true, "4 is '4'" is false and "0 is []" is -false and not an error. "is#"/"isnot#" and "is?"/"isnot?" can be used to match -and ignore case. +values are different: > + echo 4 == '4' + 1 + echo 4 is '4' + 0 + echo 0 is [] + 0 +"is#"/"isnot#" and "is?"/"isnot?" can be used to match and ignore case. When comparing a String with a Number, the String is converted to a Number, -and the comparison is done on Numbers. This means that "0 == 'x'" is TRUE, -because 'x' converted to a Number is zero. +and the comparison is done on Numbers. This means that: > + echo 0 == 'x' + 1 +because 'x' converted to a Number is zero. However: > + echo 0 == 'x' + 0 +Inside a List or Dictionary this conversion is not used. When comparing two Strings, this is done with strcmp() or stricmp(). This results in the mathematical difference (comparing byte values), not @@ -1999,6 +2009,7 @@ msgpackdump({list}) List dump a list of objects to msgpack msgpackparse({list}) List parse msgpack to a list of objects nextnonblank({lnum}) Number line nr of non-blank line >= {lnum} nr2char({expr}[, {utf8}]) String single char with ASCII/UTF8 value {expr} +nvim_...({args}...) any call nvim |api| functions or({expr}, {expr}) Number bitwise OR pathshorten({expr}) String shorten directory names in a path pow({x}, {y}) Float {x} to the power of {y} @@ -2033,7 +2044,6 @@ rpcnotify({channel}, {event}[, {args}...]) Sends an |RPC| notification to {channel} rpcrequest({channel}, {method}[, {args}...]) Sends an |RPC| request to {channel} -rpcstart({prog}[, {argv}]) Spawns {prog} and opens an |RPC| channel rpcstop({channel}) Closes an |RPC| {channel} screenattr({row}, {col}) Number attribute at screen position screenchar({row}, {col}) Number character at screen position @@ -2138,6 +2148,11 @@ values({dict}) List values in {dict} virtcol({expr}) Number screen column of cursor or mark visualmode([expr]) String last visual mode used wildmenumode() Number whether 'wildmenu' mode is active +win_findbuf( {bufnr}) List find windows containing {bufnr} +win_getid( [{win} [, {tab}]]) Number get window ID for {win} in {tab} +win_gotoid( {expr}) Number go to window with ID {expr} +win_id2tabwin( {expr}) List get tab window nr from window ID +win_id2win( {expr}) Number get window nr from window ID winbufnr({nr}) Number buffer number of window {nr} wincol() Number window column of the cursor winheight({nr}) Number height of window {nr} @@ -2195,11 +2210,9 @@ and({expr}, {expr}) *and()* Example: > :let flag = and(bits, 0x80) - api_info() *api_info()* Returns Dictionary of |api-metadata|. - append({lnum}, {expr}) *append()* When {expr} is a |List|: Append each item of the |List| as a text line below line {lnum} in the current buffer. @@ -4381,8 +4394,10 @@ items({dict}) *items()* order. jobclose({job}[, {stream}]) {Nvim} *jobclose()* - Close {job}'s {stream}, which can be one "stdin", "stdout" or - "stderr". If {stream} is omitted, all streams are closed. + Close {job}'s {stream}, which can be one of "stdin", "stdout", + "stderr" or "rpc" (closes the rpc channel for a job started + with the "rpc" option.) If {stream} is omitted, all streams + are closed. jobpid({job}) {Nvim} *jobpid()* Return the pid (process id) of {job}. @@ -4404,6 +4419,10 @@ jobsend({job}, {data}) {Nvim} *jobsend()* :call jobsend(j, ["abc", "123\n456", ""]) < will send "abc<NL>123<NUL>456<NL>". + If the job was started with the rpc option this function + cannot be used, instead use |rpcnotify()| and |rpcrequest()| + to communicate with the job. + jobstart({cmd}[, {opts}]) {Nvim} *jobstart()* Spawns {cmd} as a job. If {cmd} is a |List| it is run directly. If {cmd} is a |String| it is processed like this: > @@ -4419,9 +4438,14 @@ jobstart({cmd}[, {opts}]) {Nvim} *jobstart()* on_exit : exit event handler (function name or |Funcref|) cwd : Working directory of the job; defaults to |current-directory|. + rpc : If set, |msgpack-rpc| will be used to communicate + with the job over stdin and stdout. "on_stdout" is + then ignored, but "on_stderr" can still be used. pty : If set, the job will be connected to a new pseudo - terminal, and the job streams are connected to - the master file descriptor. + terminal, and the job streams are connected to + the master file descriptor. "on_stderr" is ignored + as all output will be received on stdout. + width : (pty only) Width of the terminal screen height : (pty only) Height of the terminal screen TERM : (pty only) $TERM environment variable @@ -4433,10 +4457,12 @@ jobstart({cmd}[, {opts}]) {Nvim} *jobstart()* {opts} is passed as |self| to the callback; the caller may pass arbitrary data by setting other keys. Returns: - - job ID on success, used by |jobsend()| and |jobstop()| + - The job ID on success, which is used by |jobsend()| (or + |rpcnotify()| and |rpcrequest()| if "rpc" option was used) + and |jobstop()| - 0 on invalid arguments or if the job table is full - -1 if {cmd}[0] is not executable. - See |job-control| for more information. + See |job-control| and |msgpack-rpc| for more information. jobstop({job}) {Nvim} *jobstop()* Stop a job created with |jobstart()| by sending a `SIGTERM` @@ -5146,6 +5172,17 @@ nr2char({expr}[, {utf8}]) *nr2char()* characters. nr2char(0) is a real NUL and terminates the string, thus results in an empty string. +nvim_...({...}) *nvim_...()* *eval-api* + Call nvim |api| functions. The type checking of arguments will + be stricter than for most other builtins. For instance, + if Integer is expected, a |Number| must be passed in, a + |String| will not be autoconverted. + Buffer numbers, as returned by |bufnr()| could be used as + first argument to nvim_buf_... functions. All functions + expecting an object (buffer, window or tabpage) can + also take the numerical value 0 to indicate the current + (focused) object. + or({expr}, {expr}) *or()* Bitwise OR on the two arguments. The arguments are converted to a number. A List, Dict or Float argument causes an error. @@ -5444,14 +5481,20 @@ reltime([{start} [, {end}]]) *reltime()* the item depends on the system. It can be passed to |reltimestr()| to convert it to a string or |reltimefloat()| to convert to a float. - Without an argument it returns the current time. - With one argument is returns the time passed since the time + + Without an argument it returns the current "relative time", an + implementation-defined value meaningful only when used as an + argument to |reltime()|, |reltimestr()| and |reltimefloat()|. + + With one argument it returns the time passed since the time specified in the argument. With two arguments it returns the time passed between {start} and {end}. The {start} and {end} arguments must be values returned by reltime(). + Note: |localtime()| returns the current (non-relative) time. + reltimefloat({time}) *reltimefloat()* Return a Float that represents the time value of {time}. Unit of time is seconds. @@ -5635,19 +5678,19 @@ rpcrequest({channel}, {method}[, {args}...]) {Nvim} *rpcrequest()* :let result = rpcrequest(rpc_chan, "func", 1, 2, 3) rpcstart({prog}[, {argv}]) {Nvim} *rpcstart()* - Spawns {prog} as a job (optionally passing the list {argv}), - and opens an |RPC| channel with the spawned process's - stdin/stdout. Returns: - - channel id on success, which is used by |rpcrequest()|, - |rpcnotify()| and |rpcstop()| - - 0 on failure - Example: > - :let rpc_chan = rpcstart('prog', ['arg1', 'arg2']) + Deprecated. Replace > + :let id = rpcstart('prog', ['arg1', 'arg2']) +< with > + :let id = jobstart(['prog', 'arg1', 'arg2'], {'rpc': v:true}) rpcstop({channel}) {Nvim} *rpcstop()* - Closes an |RPC| {channel}, possibly created via - |rpcstart()|. Also closes channels created by connections to - |v:servername|. + Closes an |RPC| {channel}. If the channel is a job + started with |jobstart()| the job is killed. + It is better to use |jobstop()| in this case, or use + |jobclose|(id, "rpc") to only close the channel without + killing the job. + Closes the socket connection if the channel was opened by + connecting to |v:servername|. screenattr(row, col) *screenattr()* Like screenchar(), but return the attribute. This is a rather @@ -7192,6 +7235,33 @@ wildmenumode() *wildmenumode()* (Note, this needs the 'wildcharm' option set appropriately). +win_findbuf({bufnr}) *win_findbuf()* + Returns a list with window IDs for windows that contain buffer + {bufnr}. When there is none the list is empty. + +win_getid([{win} [, {tab}]]) *win_getid()* + Get the window ID for the specified window. + When {win} is missing use the current window. + With {win} this is the window number. The top window has + number 1. + Without {tab} use the current tab, otherwise the tab with + number {tab}. The first tab has number one. + Return zero if the window cannot be found. + +win_gotoid({expr}) *win_gotoid()* + Go to window with ID {expr}. This may also change the current + tabpage. + Return 1 if successful, 0 if the window cannot be found. + +win_id2tabwin({expr} *win_id2tabwin()* + Return a list with the tab number and window number of window + with ID {expr}: [tabnr, winnr]. + Return [0, 0] if the window cannot be found. + +win_id2win({expr}) *win_id2win()* + Return the window number of window with ID {expr}. + Return 0 if the window cannot be found in the current tabpage. + *winbufnr()* winbufnr({nr}) The result is a Number, which is the number of the buffer associated with window {nr}. When {nr} is zero, the number of diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt index 76aa3a50ce..df6b55cfe7 100644 --- a/runtime/doc/filetype.txt +++ b/runtime/doc/filetype.txt @@ -500,7 +500,7 @@ Options: avoid that a Subject line with "Vim:" in it will cause an error message. 'textwidth' is set to 72. This is often recommended for e-mail. -'formatoptions' is set to break text lines and to repeat the comment leader +'formatoptions' is set to break text lines and to repeat the comment leader in new lines, so that a leading ">" for quotes is repeated. You can also format quoted text with |gq|. @@ -512,37 +512,42 @@ Local mappings: MAN *ft-man-plugin* *:Man* *man.vim* -Displays a manual page in a nice way. Also see the user manual -|find-manpage|. +View manpages in Nvim. Supports highlighting, completion, locales, and +navigation. Also see |find-manpage|. -To start using the ":Man" command before any manual page was loaded, source -this script from your startup vimrc file: > +To use Nvim as a manpager: > + export MANPAGER="nvim -c 'set ft=man' -" - runtime ftplugin/man.vim - -Options: -'iskeyword' the '.' character is added to be able to use CTRL-] on the - manual page name. +man.vim will always attempt to reuse the closest man window (above/left) but +otherwise create a split. Commands: -Man {name} Display the manual page for {name} in a window. -Man {number} {name} - Display the manual page for {name} in a section {number}. - -Global mapping: -<Leader>K Displays the manual page for the word under the cursor. +Man {name} Display the manpage for {name}. +Man {sect} {name} Display the manpage for {name} and section {sect}. +Man {name}({sect}) Alternate syntax which completes the section. +Man {sect} {name}({sect}) Used during completion to show the real section of + when the provided section is a prefix, e.g. 1m vs 1. +Man {path} Open the manpage specified by path. Prepend "./" if + page is in the current directory. +Man Open the manpage for the <cWORD> (man buffers) + or <cword> (non-man buffers) under the cursor. + +|:Man| accepts command modifiers. For example, to use a vertical split: > + :vertical Man printf Local mappings: -CTRL-] Jump to the manual page for the word under the cursor. -CTRL-T Jump back to the previous manual page. -q Same as ":quit" - -To enable folding use this: > - let g:ft_man_folding_enable = 1 -If you do not like the default folding, use an autocommand to add your desired -folding style instead. For example: > - autocmd FileType man setlocal foldmethod=indent foldenable +K or CTRL-] Jump to the manpage for the <cWORD> under the + cursor. Takes a count for the section. +CTRL-T Jump back to the location that the manpage was + opened from. +q :quit if invoked as $MANPAGER, otherwise :close. +Variables: +*g:no_man_maps* Do not create mappings in manpage buffers. +*g:ft_man_folding_enable* Fold manpages with foldmethod=indent foldnestmax=1. +*b:man_default_sects* Comma-separated, ordered list of preferred sections. + For example in C one usually wants section 3 or 2: > + :let b:man_default_sections = '3,2' PDF *ft-pdf-plugin* diff --git a/runtime/doc/help.txt b/runtime/doc/help.txt index fc4816a6c8..a81d32831b 100644 --- a/runtime/doc/help.txt +++ b/runtime/doc/help.txt @@ -154,6 +154,7 @@ GUI ~ Interfaces ~ |if_cscop.txt| using Cscope with Vim |if_pyth.txt| Python interface +|if_ruby.txt| Ruby interface |debugger.txt| Interface with a debugger |sign.txt| debugging signs diff --git a/runtime/doc/if_cscop.txt b/runtime/doc/if_cscop.txt index 70f8d1c6f3..99d1fe42e1 100644 --- a/runtime/doc/if_cscop.txt +++ b/runtime/doc/if_cscop.txt @@ -128,6 +128,7 @@ The available subcommands are: 6 or e: Find this egrep pattern 7 or f: Find this file 8 or i: Find files #including this file + 9 or a: Find places where this symbol is assigned a value For all types, except 4 and 6, leading white space for {name} is removed. For 4 and 6 there is exactly one space between {querytype} @@ -254,13 +255,13 @@ started will have no effect! {not available when compiled without the |+quickfix| feature} 'cscopequickfix' specifies whether to use quickfix window to show cscope results. This is a list of comma-separated values. Each item consists of -|cscope-find| command (s, g, d, c, t, e, f or i) and flag (+, - or 0). +|cscope-find| command (s, g, d, c, t, e, f, i or a) and flag (+, - or 0). '+' indicates that results must be appended to quickfix window, '-' implies previous results clearance, '0' or command absence - don't use quickfix. Search is performed from start until first command occurrence. The default value is "" (don't use quickfix anyway). The following value seems to be useful: > - :set cscopequickfix=s-,c-,d-,i-,t-,e- + :set cscopequickfix=s-,c-,d-,i-,t-,e-,a- < *cscopetag* *cst* If 'cscopetag' is set, the commands ":tag" and CTRL-] as well as "vim -t" @@ -418,6 +419,7 @@ Cscope Home Page (http://cscope.sourceforge.net/): > nmap <C-_>f :cs find f <C-R>=expand("<cfile>")<CR><CR> nmap <C-_>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR> nmap <C-_>d :cs find d <C-R>=expand("<cword>")<CR><CR> + nmap <C-_>a :cs find a <C-R>=expand("<cword>")<CR><CR> " Using 'CTRL-spacebar' then a search type makes the vim window " split horizontally, with search result displayed in @@ -431,6 +433,7 @@ Cscope Home Page (http://cscope.sourceforge.net/): > nmap <C-Space>f :scs find f <C-R>=expand("<cfile>")<CR><CR> nmap <C-Space>i :scs find i ^<C-R>=expand("<cfile>")<CR>$<CR> nmap <C-Space>d :scs find d <C-R>=expand("<cword>")<CR><CR> + nmap <C-Space>a :scs find a <C-R>=expand("<cword>")<CR><CR> " Hitting CTRL-space *twice* before the search type does a vertical " split instead of a horizontal one @@ -449,6 +452,8 @@ Cscope Home Page (http://cscope.sourceforge.net/): > \:vert scs find i ^<C-R>=expand("<cfile>")<CR>$<CR> nmap <C-Space><C-Space>d \:vert scs find d <C-R>=expand("<cword>")<CR><CR> + nmap <C-Space><C-Space>a + \:vert scs find a <C-R>=expand("<cword>")<CR><CR> ============================================================================== 7. Cscope availability and information *cscope-info* diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt index c1eef398e2..4561020d22 100644 --- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -1406,6 +1406,27 @@ The valid escape sequences are <bang> (See the '-bang' attribute) Expands to a ! if the command was executed with a ! modifier, otherwise expands to nothing. + *<mods>* + <mods> The command modifiers, if specified. Otherwise, expands to + nothing. Supported modifiers are |aboveleft|, |belowright|, + |botright|, |browse|, |confirm|, |hide|, |keepalt|, + |keepjumps|, |keepmarks|, |keeppatterns|, |lockmarks|, + |noswapfile|, |silent|, |tab|, |topleft|, |verbose|, and + |vertical|. + Examples: > + command! -nargs=+ -complete=file MyEdit + \ for f in expand(<q-args>, 0, 1) | + \ exe '<mods> split ' . f | + \ endfor + + function! SpecialEdit(files, mods) + for f in expand(a:files, 0, 1) + exe a:mods . ' split ' . f + endfor + endfunction + command! -nargs=+ -complete=file Sedit + \ call SpecialEdit(<q-args>, <q-mods>) +< *<reg>* *<register>* <reg> (See the '-register' attribute) The optional register, if specified. Otherwise, expands to nothing. <register> diff --git a/runtime/doc/msgpack_rpc.txt b/runtime/doc/msgpack_rpc.txt index cfd9084cfc..b3fed9e756 100644 --- a/runtime/doc/msgpack_rpc.txt +++ b/runtime/doc/msgpack_rpc.txt @@ -11,7 +11,7 @@ RPC API for Nvim *RPC* *rpc* *msgpack-rpc* 3. Connecting |rpc-connecting| 4. Clients |rpc-api-client| 5. Types |rpc-types| -6. Vimscript functions |rpc-vim-functions| +6. Remote UIs |rpc-remote-ui| ============================================================================== 1. Introduction *rpc-intro* @@ -47,7 +47,7 @@ instance. There are three ways to obtain API metadata: - 1. Connect to a running Nvim instance and call `vim_get_api_info` via + 1. Connect to a running Nvim instance and call `nvim_get_api_info` via msgpack-rpc. This is best for clients written in dynamic languages which can define functions at runtime. @@ -66,12 +66,16 @@ To get a formatted dump of the API using python (requires the `pyyaml` and ============================================================================== 3. Connecting *rpc-connecting* -There are several ways to open a msgpack-rpc stream to an Nvim server: +There are several ways to open a msgpack-rpc channel to an Nvim instance: 1. Through stdin/stdout when `nvim` is started with `--embed`. This is how applications can embed Nvim. - 2. Through stdin/stdout of some other process spawned by |rpcstart()|. + 2. Through stdin/stdout of some other process spawned by |jobstart()|. + Set the "rpc" key to |v:true| in the options dict to use the job's stdin + and stdout as a single msgpack channel that is processed directly by + Nvim. Then it is not possible to process raw data to or from the + process's stdin and stdout. stderr can still be used, though. 3. Through the socket automatically created with each instance. The socket location is stored in |v:servername|. @@ -101,7 +105,7 @@ Nvim instance: require 'msgpack/rpc/transport/unix' nvim = MessagePack::RPC::Client.new(MessagePack::RPC::UNIXTransport.new, ENV['NVIM_LISTEN_ADDRESS']) - result = nvim.call(:vim_command, 'echo "hello world!"') + result = nvim.call(:nvim_command, 'echo "hello world!"') < A better way is to use the Python REPL with the `neovim` package, where API functions can be called interactively: @@ -110,26 +114,26 @@ functions can be called interactively: >>> nvim = attach('socket', path='[address]') >>> nvim.command('echo "hello world!"') < -You can also embed an Nvim instance via |rpcstart()| +You can also embed an Nvim instance via |jobstart()|, and communicate using +|rpcrequest()| and |rpcnotify()|: > - let vim = rpcstart('nvim', ['--embed']) - echo rpcrequest(vim, 'vim_eval', '"Hello " . "world!"') - call rpcstop(vim) + let nvim = jobstart(['nvim', '--embed'], {'rpc': v:true}) + echo rpcrequest(nvim, 'nvim_eval', '"Hello " . "world!"') + call jobstop(nvim) < ============================================================================== 4. Implementing API clients *rpc-api-client* *api-client* -All external UIs and remote plugins (as opposed to regular Vim plugins) are -"clients" in general; but we call something an "API client" if its purpose is -to abstract or wrap the RPC API for the convenience of other applications -(just like a REST client or SDK such as boto3 for AWS: you can speak AWS REST -using an HTTP client like curl, but boto3 wraps that in a convenient python -interface). For example, the lua-client is an API client: - https://github.com/neovim/lua-client - -The Python client (pip package "neovim") is the reference implementation of an -API client. It is always up-to-date with the Nvim API, so its source code and -test suite are an authoritative reference. +"API clients" wrap the Nvim API to provide idiomatic "SDKs" for their +respective platforms (see |dev-jargon|). You can build a new API client for +your favorite platform or programming language. + +Existing API clients are listed here: + https://github.com/neovim/neovim/wiki/Related-projects#api-clients + +The Python client is the reference implementation for API clients. It is +always up-to-date with the Nvim API, so its source code and test suite are +authoritative references. https://github.com/neovim/python-client API client implementation guidelines ~ @@ -172,15 +176,20 @@ contains information that makes this task easier (see also |rpc-types|): - Container types may be decorated with type/size constraints, e.g. ArrayOf(Buffer) or ArrayOf(Integer, 2). This can be useful to generate even more strongly-typed APIs. - - Methods that operate on instances of Nvim special types (msgpack EXT) are - prefixed with the type name in lower case, e.g. `buffer_get_line` - represents the `get_line` method of a Buffer instance. - - Global methods are prefixed with `vim`, e.g. `vim_get_buffers`. + - Functions that are considered to be methods that operate on instances of + Nvim special types (msgpack EXT) will have the `"method"` attribute set to + `true`. The reciever type is the type of the first argument. The method + names are prefixed with `nvim_` plus a shortened type name, e.g. + `nvim_buf_get_lines` represents the `get_lines` method of a Buffer instance. + - Global functions have `"method"` set to `false` and are prefixed with just + `nvim_`, e.g. `nvim_get_buffers`. So for an object-oriented language, an API client contains the classes representing Nvim special types, and the methods of each class could be -defined by inspecting the method name prefix. There could also be a singleton -Vim class with methods mapped to functions prefixed with `vim_`. +defined by stripping the prefix for the type as defined in the `types` metadata +(this will always be the first two "_"-separated parts of the function name). +There could also be a singleton Vim class with methods where the `nvim_` +prefix is stripped off. ============================================================================== 5. Types *rpc-types* @@ -214,18 +223,21 @@ an integer, but not a Window or Tabpage. The most reliable way of determining the type codes for the special Nvim types is to inspect the `types` key of metadata dictionary returned by the -`vim_get_api_info` method at runtime. Here's a sample JSON representation of +`nvim_get_api_info` method at runtime. Here's a sample JSON representation of the `types` object: > "types": { "Buffer": { - "id": 0 + "id": 0, + "prefix": "nvim_buf_" }, "Window": { - "id": 1 + "id": 1, + "prefix": "nvim_win_" }, "Tabpage": { - "id": 2 + "id": 2, + "prefix": "nvim_tabpage_" } } < @@ -234,22 +246,169 @@ the type codes, because a client may be built against one Nvim version but connect to another with different type codes. ============================================================================== -6. Vimscript functions *rpc-vim-functions* - -RPC functions are available in Vimscript: - - 1. |rpcstart()|: Similarly to |jobstart()|, this will spawn a co-process - with its standard handles connected to Nvim. The difference is that it's - not possible to process raw data to or from the process's stdin, stdout, - or stderr. This is because the job's stdin and stdout are used as - a single msgpack channel that is processed directly by Nvim. - 2. |rpcstop()|: Same as |jobstop()|, but operates on handles returned by - |rpcstart()|. - 3. |rpcrequest()|: Sends a msgpack-rpc request to the process. - 4. |rpcnotify()|: Sends a msgpack-rpc notification to the process. - -|rpcrequest()| and |rpcnotify()| can also be used with channels connected to -a nvim server. |v:servername| +6. Remote UIs *rpc-remote-ui* + +Nvim allows Graphical user interfaces to be implemented by separate processes +communicating with Nvim over the RPC API. Currently the ui model conists of a +terminal-like grid with one single, monospace font size, with a few elements +that could be drawn separately from the grid (for the momemnt only the popup +menu) + +After connecting to a nvim instance (typically a spawned, embedded instance) +use the |nvim_ui_attach|(width, height, options) API method to tell nvim that your +program wants to draw the nvim screen on a grid with "width" times +"height" cells. "options" should be a dictionary with the following (all +optional) keys: + `rgb`: Controls what color format to use. + Set to true (default) to use 24-bit rgb + colors. + Set to false to use terminal color codes (at + most 256 different colors). + `popupmenu_external`: Instead of drawing the completion popupmenu on + the grid, Nvim will send higher-level events to + the ui and let it draw the popupmenu. + Defaults to false. + +Nvim will then send msgpack-rpc notifications, with the method name "redraw" +and a single argument, an array of screen updates (described below). +These should be processed in order. Preferably the user should only be able to +see the screen state after all updates are processed (not any intermediate +state after processing only a part of the array). + +Screen updates are arrays. The first element a string describing the kind +of update. + +["resize", width, height] + The grid is resized to `width` and `height` cells. + +["clear"] + Clear the screen. + +["eol_clear"] + Clear from the cursor position to the end of the current line. + +["cursor_goto", row, col] + Move the cursor to position (row, col). Currently, the same cursor is + used to define the position for text insertion and the visible cursor. + However, only the last cursor position, after processing the entire + array in the "redraw" event, is intended to be a visible cursor + position. + +["update_fg", color] +["update_bg", color] +["update_sp", color] + Set the default foreground, background and special colors + respectively. + +["highlight_set", attrs] + Set the attributes that the next text put on the screen will have. + `attrs` is a dict with the keys below. Any absent key is reset + to its default value. Color defaults are set by the `update_fg` etc + updates. All boolean keys default to false. + + `foreground`: foreground color. + `background`: backround color. + `special`: color to use for underline and undercurl, when present. + `reverse`: reverse video. Foreground and background colors are + switched. + `italic`: italic text. + `bold`: bold text. + `underline`: underlined text. The line has `special` color. + `undercurl`: undercurled text. The curl has `special` color. + +["put", text] + The (utf-8 encoded) string `text` is put at the cursor position + (and the cursor is advanced), with the highlights as set by the + last `highlight_set` update. + +["set_scroll_region", top, bot, left, right] + Define the scroll region used by `scroll` below. + +["scroll", count] + Scroll the text in the scroll region. The diagrams below illustrate + what will happen, depending on the scroll direction. "=" is used to + represent the SR(scroll region) boundaries and "-" the moved rectangles. + Note that dst and src share a common region. + + If count is bigger than 0, move a rectangle in the SR up, this can + happen while scrolling down. +> + +-------------------------+ + | (clipped above SR) | ^ + |=========================| dst_top | + | dst (still in SR) | | + +-------------------------+ src_top | + | src (moved up) and dst | | + |-------------------------| dst_bot | + | src (cleared) | | + +=========================+ src_bot +< + If count is less than zero, move a rectangle in the SR down, this can + happen while scrolling up. +> + +=========================+ src_top + | src (cleared) | | + |------------------------ | dst_top | + | src (moved down) and dst| | + +-------------------------+ src_bot | + | dst (still in SR) | | + |=========================| dst_bot | + | (clipped below SR) | v + +-------------------------+ +< +["set_title", title] +["set_icon", icon] + Set the window title, and icon (minimized) window title, respectively. + In windowing systems not distinguishing between the two, "set_icon" + can be ignored. + +["mouse_on"] +["mouse_off"] + Tells the client whether mouse support, as determined by |'mouse'| + option, is considered to be active in the current mode. This is mostly + useful for a terminal frontend, or other situations where nvim mouse + would conflict with other usages of the mouse. It is safe for a client + to ignore this and always send mouse events. + +["busy_on"] +["busy_off"] + Nvim started or stopped being busy, and possibly not responsible to user + input. This could be indicated to the user by hiding the cursor. + +["suspend"] + |:suspend| command or |Ctrl-Z| mapping is used. A terminal client (or other + client where it makes sense) could suspend itself. Other clients can + safely ignore it. + +["bell"] +["visual_bell"] + Notify the user with an audible or visual bell, respectively. + +["update_menu"] + The menu mappings changed. + +["mode_change", mode] + The mode changed. Currently sent when "insert", "replace" and "normal" + modes are entered. A client could for instance change the cursor shape. + +["popupmenu_show", items, selected, row, col] + When `popupmenu_external` is set to true, nvim will not draw the + popupmenu on the grid, instead when the popupmenu is to be displayed + this update is sent. `items` is an array of the items to show, the + items are themselves arrays of the form [word, kind, menu, info] + as defined at |complete-items|, except that `word` is replaced by + `abbr` if present. `selected` is the initially selected item, either a + zero-based index into the array of items, or -1 if no item is + selected. `row` and `col` is the anchor position, where the first + character of the completed word will be. + +["popupmenu_select", selected] + An item in the currently displayed popupmenu is selected. `selected` + is either a zero-based index into the array of items from the last + `popupmenu_show` event, or -1 if no item is selected. + +["popupmenu_hide"] + The popupmenu is hidden. ============================================================================== vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index e00f27f9f0..60acfbf700 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -4399,9 +4399,8 @@ A jump table for the options with a short description can be found at |Q_op|. *'mousetime'* *'mouset'* 'mousetime' 'mouset' number (default 500) global - Only for GUI, Windows and Unix with xterm. Defines the maximum - time in msec between two mouse clicks for the second click to be - recognized as a multi click. + Defines the maximum time in msec between two mouse clicks for the + second click to be recognized as a multi click. *'nrformats'* *'nf'* 'nrformats' 'nf' string (default "bin,hex") diff --git a/runtime/doc/pi_health.txt b/runtime/doc/pi_health.txt new file mode 100644 index 0000000000..69833103d1 --- /dev/null +++ b/runtime/doc/pi_health.txt @@ -0,0 +1,127 @@ +*pi_health.txt* Healthcheck framework + +Author: TJ DeVries <devries.timothyj@gmail.com> + +============================================================================== +1. Introduction |health.vim-intro| +2. Commands and functions |health.vim-manual| +3. Create a healthcheck |health.vim-dev| + +============================================================================== +Introduction *healthcheck* *health.vim-intro* + +Troubleshooting user configuration problems is a time-consuming task that +developers want to minimize. health.vim provides a simple framework for plugin +authors to hook into, and for users to invoke, to check and report the user's +configuration and environment. Type this command to try it: > + + :CheckHealth +< +For example, some users have broken or unusual Python setups, which breaks the +|:python| command. |:CheckHealth| detects several common Python configuration +problems and reports them. If the Neovim Python module is not installed, it +shows a warning: > + + You have not installed the Neovim Python module + You might want to try `pip install Neovim` +< +Plugin authors are encouraged to add healthchecks, see |health.vim-dev|. + +============================================================================== +Commands and functions *health.vim-manual* + +Commands +------------------------------------------------------------------------------ + *:CheckHealth* +:CheckHealth Run all healthchecks and show the output in a new + tabpage. These healthchecks are included by default: + - python2 + - python3 + - ruby + - remote plugin + +:CheckHealth {plugins} + Run healthchecks for one or more plugins. E.g. to run + only the standard Nvim healthcheck: > + :CheckHealth nvim +< To run the healthchecks for the "foo" and "bar" plugins + (assuming these plugins are on your 'runtimepath' and + they have implemented health#foo#check() and + health#bar#check(), respectively): > + :CheckHealth foo bar +< +Functions +------------------------------------------------------------------------------ + +health.vim functions are for creating new healthchecks. They mostly just do +some layout and formatting, to give users a consistent presentation. + +health#report_start({name}) *health#report_start* + Starts a new report. Most plugins should call this only once, but if + you want different sections to appear in your report, call this once + per section. + +health#report_info({msg}) *health#report_info* + Displays an informational message. + +health#report_ok({msg}) *health#report_ok* + Displays a "success" message. + +health#report_warn({msg}, [{suggestions}]) *health#report_warn* + Displays a warning. {suggestions} is an optional List of suggestions. + +health#report_error({msg}, [{suggestions}]) *health#report_error* + Displays an error. {suggestions} is an optional List of suggestions. + +health#{plugin}#check() *health.user_checker* + This is the form of a healthcheck definition. Call the above functions + from this function, then |:CheckHealth| does the rest. Example: > + + function! health#my_plug#check() abort + silent call s:check_environment_vars() + silent call s:check_python_configuration() + endfunction +< + The function will be found and called automatically when the user + invokes |:CheckHealth|. + + All output will be captured from the healthcheck. Use the + health#report_* functions so that your healthcheck has a format + consistent with the standard healthchecks. + +============================================================================== +Create a healthcheck *health.vim-dev* + +Healthchecks are functions that check the health of the system. Neovim has +built-in checkers, found in $VIMRUNTIME/autoload/health/. + +To add a new checker for your own plugin, simply define a +health#{plugin}#check() function in autoload/health/{plugin}.vim. +|:CheckHealth| automatically finds and invokes such functions. + +If your plugin is named "jslint", then its healthcheck function must be > + + health#jslint#check() +< +defined in this file on 'runtimepath': > + + autoload/health/jslint.vim +< +Here's a sample to get started: > + + function! health#jslint#check() abort + call health#report_start('sanity checks') + " perform arbitrary checks + " ... + + if looks_good + call health#report_ok('found required dependencies') + else + call health#report_error('cannot find jslint', + \ ['npm install --save jslint']) + endif + endfunction +< +============================================================================== + +vim:tw=78:ts=8:ft=help:fdm=marker diff --git a/runtime/doc/provider.txt b/runtime/doc/provider.txt index 7380fb9346..63dbb00896 100644 --- a/runtime/doc/provider.txt +++ b/runtime/doc/provider.txt @@ -79,14 +79,6 @@ TROUBLESHOOTING *python-trouble* If you have trouble with a plugin that uses the `neovim` Python client, use the |:CheckHealth| command to diagnose your setup. - *:CheckHealth* -:CheckHealth[!] Check your setup for common problems that may be keeping a - plugin from functioning correctly. Include the output of - this command in bug reports to help reduce the amount of - time it takes to address your issue. With "!" the output - will be placed in a new buffer which can make it easier to - save to a file or copy to the clipboard. - ============================================================================== Ruby integration *provider-ruby* diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt index 3b54faf18e..e2a44541ae 100644 --- a/runtime/doc/quickfix.txt +++ b/runtime/doc/quickfix.txt @@ -1,4 +1,4 @@ -*quickfix.txt* For Vim version 7.4. Last change: 2016 Mar 19 +*quickfix.txt* For Vim version 7.4. Last change: 2016 Jul 01 VIM REFERENCE MANUAL by Bram Moolenaar @@ -259,9 +259,23 @@ location list command, it will be aborted. The 'switchbuf' settings are respected when jumping to a buffer. +:cl[ist] +{count} List the current and next {count} valid errors. This + is similar to ":clist from from+count", where "from" + is the current error position. + :cl[ist]! [from] [, [to]] List all errors. +:cl[ist]! +{count} List the current and next {count} error lines. This + is useful to see unrecognized lines after the current + one. For example, if ":clist" shows: + 8384 testje.java:252: error: cannot find symbol ~ + Then using ":cl! +3" shows the reason: + 8384 testje.java:252: error: cannot find symbol ~ + 8385: ZexitCode = Fmainx(); ~ + 8386: ^ ~ + 8387: symbol: method Fmainx() ~ + *:lli* *:llist* :lli[st] [from] [, [to]] Same as ":clist", except the location list for the @@ -306,7 +320,7 @@ EXECUTE A COMMAND IN ALL THE BUFFERS IN QUICKFIX OR LOCATION LIST: etc. < When the current file can't be |abandon|ed and the [!] is not present, the command fails. - When an error is detected excecution stops. + When an error is detected execution stops. The last buffer (or where an error occurred) becomes the current buffer. {cmd} can contain '|' to concatenate several commands. diff --git a/runtime/doc/remote_plugin.txt b/runtime/doc/remote_plugin.txt index d906096a86..dddc021d68 100644 --- a/runtime/doc/remote_plugin.txt +++ b/runtime/doc/remote_plugin.txt @@ -93,22 +93,22 @@ approach with |rpcnotify()|, meaning return values or exceptions raised in the handler function are ignored. To test the above plugin, it must be saved in "rplugin/python" in a -'runtimepath' directory (~/.config/nvim/rplugin/python/limit.py for example). -Then, the remote plugin manifest must be generated with -`:UpdateRemotePlugins`. +'runtimepath' directory (~/.config/nvim/rplugin/python/limit.py for example). +Then, the remote plugin manifest must be generated with +|:UpdateRemotePlugins|. ============================================================================== 4. Remote plugin manifest *remote-plugin-manifest* + *:UpdateRemotePlugins* Just installing remote plugins to "rplugin/{host}" isn't enough for them to be -automatically loaded when required. You must execute `:UpdateRemotePlugins` +automatically loaded when required. You must execute |:UpdateRemotePlugins| every time a remote plugin is installed, updated, or deleted. -`:UpdateRemotePlugins` generates the remote plugin manifest, a special +|:UpdateRemotePlugins| generates the remote plugin manifest, a special Vimscript file containing declarations for all Vimscript entities (commands/autocommands/functions) defined by all remote plugins, with each -entity associated with the host and plugin path. The manifest is a generated -extension to the user's vimrc (it even has the vimrc filename prepended). +entity associated with the host and plugin path. Manifest declarations are just calls to the `remote#host#RegisterPlugin` function, which takes care of bootstrapping the host as soon as the declared @@ -125,10 +125,20 @@ the example, say the Java plugin is a semantic completion engine for Java code. If it defines the autocommand "BufEnter *.java", then the Java host is spawned only when Nvim loads a buffer matching "*.java". -If the explicit call to `:UpdateRemotePlugins` seems incovenient, try to see it +If the explicit call to |:UpdateRemotePlugins| seems incovenient, try to see it like this: It's a way to provide IDE capabilities in Nvim while still keeping it fast and lightweight for general use. It's also analogous to the |:helptags| command. + *$NVIM_RPLUGIN_MANIFEST* +Unless $NVIM_RPLUGIN_MANIFEST is set the manifest will be written to a file +named `rplugin.vim` at: + + Unix ~ + $XDG_DATA_HOME/nvim/ or ~/.local/share/nvim/ + + Windows ~ + $LOCALAPPDATA/nvim/ or ~/AppData/Local/nvim/ + ============================================================================== vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index 8249f8e71f..c6f51d47b9 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -1200,11 +1200,10 @@ running) you have additional options: :wv[iminfo][!] [file] Deprecated alias to |:wshada| command. *:o* *:ol* *:oldfiles* -:o[ldfiles][!] List the files that have marks stored in the ShaDa +:o[ldfiles] List the files that have marks stored in the ShaDa file. This list is read on startup and only changes afterwards with ":rshada!". Also see |v:oldfiles|. The number can be used with |c_#<|. - Use ! to get a file selection prompt. :bro[wse] o[ldfiles][!] List file names as with |:oldfiles|, and then prompt diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 491e5801c8..d9440b6df8 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -4883,6 +4883,10 @@ PmenuSbar Popup menu: scrollbar. PmenuThumb Popup menu: Thumb of the scrollbar. *hl-Question* Question |hit-enter| prompt and yes/no questions + *hl-QuickFixLine* +QuickFixLine The selected |quickfix| item in the quickfix window. + |hl-CursorLine| is combined with this when the cursor is on + the currently selected quickfix item. *hl-Search* Search Last search pattern highlighting (see 'hlsearch'). Also used for highlighting the current line in the quickfix diff --git a/runtime/doc/usr_12.txt b/runtime/doc/usr_12.txt index 237abae55f..f64a230576 100644 --- a/runtime/doc/usr_12.txt +++ b/runtime/doc/usr_12.txt @@ -237,19 +237,8 @@ simple way: Move the cursor to the word you want to find help on and press > K -Vim will run the external "man" program on the word. If the man page is -found, it is displayed. This uses the normal pager to scroll through the text -(mostly the "more" program). When you get to the end pressing <Enter> will -get you back into Vim. - -A disadvantage is that you can't see the man page and the text you are working -on at the same time. There is a trick to make the man page appear in a Vim -window. First, load the man filetype plugin: > - - :runtime! ftplugin/man.vim - -Put this command in your vimrc file if you intend to do this often. Now you -can use the ":Man" command to open a window on a man page: > +Nvim will run |:Man| on the word. If the man page is found, it is displayed. +You can also use the |:Man| command to open a window on a man page: > :Man csh @@ -267,15 +256,14 @@ window. To display a man page for the word under the cursor, use this: > - \K + K -(If you redefined the <Leader>, use it instead of the backslash). For example, you want to know the return value of "strstr()" while editing this line: if ( strstr (input, "aap") == ) ~ -Move the cursor to somewhere on "strstr" and type "\K". A window will open +Move the cursor to somewhere on "strstr" and type "K". A window will open to display the man page for strstr(). ============================================================================== diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index 937ed9e8ba..dd4dbc1272 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -64,13 +64,13 @@ these differences. MAJOR FEATURES ~ Embedded terminal emulator |terminal-emulator| -Shared data |shada| RPC API |RPC| +Shared data |shada| +XDG base directories |xdg| Job control |job-control| Remote plugins |remote-plugin| Python plugins |provider-python| Clipboard integration |provider-clipboard| -XDG support OTHER FEATURES ~ @@ -96,6 +96,7 @@ Options: Commands: |:CheckHealth| + |:Man| is available by default, with many improvements such as completion Functions: |execute()| works with |:redir| @@ -106,9 +107,11 @@ Events: |TabClosed| |TermOpen| |TermClose| + |TextYankPost| Highlight groups: |hl-EndOfBuffer| + |hl-QuickFixLine| |hl-TermCursor| |hl-TermCursorNC| @@ -187,7 +190,6 @@ Additional differences: compatibility reasons. - |:wviminfo| was renamed to |:wshada|, |:rviminfo| to |:rshada|. Old commands are still kept. -- |:oldfiles| supports !. - When writing (|:wshada| without bang or at exit) it merges much more data, and does this according to the timestamp. Vim merges only marks. |shada-merging| diff --git a/runtime/ftplugin/c.vim b/runtime/ftplugin/c.vim index 487ce7a165..d1b2a4941e 100644 --- a/runtime/ftplugin/c.vim +++ b/runtime/ftplugin/c.vim @@ -55,5 +55,7 @@ if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") endif endif +let b:man_default_sects = '3,2' + let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/ftplugin/man.vim b/runtime/ftplugin/man.vim index 04ab539fb1..02d2b4e557 100644 --- a/runtime/ftplugin/man.vim +++ b/runtime/ftplugin/man.vim @@ -1,41 +1,63 @@ -" Vim filetype plugin file -" Language: man -" Maintainer: SungHyun Nam <goweol@gmail.com> +" Maintainer: Anmol Sethi <anmol@aubble.com> +" Previous Maintainer: SungHyun Nam <goweol@gmail.com> -if has('vim_starting') && &filetype !=# 'man' - finish -endif - -" Only do this when not done yet for this buffer -if exists('b:did_ftplugin') +if exists('b:did_ftplugin') || &filetype !=# 'man' finish endif let b:did_ftplugin = 1 -" Ensure Vim is not recursively invoked (man-db does this) -" when doing ctrl-[ on a man page reference. -if exists('$MANPAGER') - let $MANPAGER = '' -endif - -setlocal iskeyword+=\.,-,(,) - -setlocal buftype=nofile noswapfile -setlocal nomodifiable readonly bufhidden=hide nobuflisted tabstop=8 +let s:pager = 0 -if !exists("g:no_plugin_maps") && !exists("g:no_man_maps") - nnoremap <silent> <buffer> <C-]> :call man#get_page(v:count, expand('<cword>'))<CR> - nnoremap <silent> <buffer> <C-T> :call man#pop_page()<CR> - nnoremap <silent> <nowait><buffer> q <C-W>c - if &keywordprg !=# ':Man' - nnoremap <silent> <buffer> K :call man#get_page(v:count, expand('<cword>'))<CR> +if has('vim_starting') + let s:pager = 1 + " remove all those backspaces + silent execute 'keeppatterns keepjumps %substitute,.\b,,e'.(&gdefault?'':'g') + if getline(1) =~# '^\s*$' + silent keepjumps 1delete _ + else + keepjumps 1 endif + " This is not perfect. See `man glDrawArraysInstanced`. Since the title is + " all caps it is impossible to tell what the original capitilization was. + let ref = tolower(matchstr(getline(1), '^\S\+')) + let b:man_sect = man#extract_sect_and_name_ref(ref)[0] + execute 'file man://'.ref endif -if exists('g:ft_man_folding_enable') && (g:ft_man_folding_enable == 1) - setlocal foldmethod=indent foldnestmax=1 foldenable +setlocal buftype=nofile +setlocal noswapfile +setlocal bufhidden=hide +setlocal nomodified +setlocal readonly +setlocal nomodifiable +setlocal noexpandtab +setlocal tabstop=8 +setlocal softtabstop=8 +setlocal shiftwidth=8 + +setlocal nonumber +setlocal norelativenumber +setlocal foldcolumn=0 +setlocal colorcolumn=0 +setlocal nolist +setlocal nofoldenable + +if !exists('g:no_plugin_maps') && !exists('g:no_man_maps') + nmap <silent> <buffer> <C-]> :Man<CR> + nmap <silent> <buffer> K :Man<CR> + nnoremap <silent> <buffer> <C-T> :call man#pop_tag()<CR> + if s:pager + nnoremap <silent> <buffer> <nowait> q :q<CR> + else + nnoremap <silent> <buffer> <nowait> q <C-W>c + endif endif -let b:undo_ftplugin = 'setlocal iskeyword<' +if get(g:, 'ft_man_folding_enable', 0) + setlocal foldenable + setlocal foldmethod=indent + setlocal foldnestmax=1 +endif +let b:undo_ftplugin = '' " vim: set sw=2: diff --git a/runtime/plugin/health.vim b/runtime/plugin/health.vim index db094a03a4..3c8e509acd 100644 --- a/runtime/plugin/health.vim +++ b/runtime/plugin/health.vim @@ -1 +1 @@ -command! -bang CheckHealth call health#check(<bang>0) +command! -nargs=* CheckHealth call health#check([<f-args>]) diff --git a/runtime/plugin/man.vim b/runtime/plugin/man.vim index 8e5062a209..63faa15213 100644 --- a/runtime/plugin/man.vim +++ b/runtime/plugin/man.vim @@ -1,6 +1,13 @@ -if get(g:, 'loaded_man', 0) +" Maintainer: Anmol Sethi <anmol@aubble.com> + +if exists('g:loaded_man') finish endif let g:loaded_man = 1 -command! -count=0 -nargs=+ Man call man#get_page(<count>, <f-args>) +command! -range=0 -complete=customlist,man#complete -nargs=* Man call man#open_page(v:count, v:count1, <q-mods>, <f-args>) + +augroup man + autocmd! + autocmd BufReadCmd man://* call man#read_page(matchstr(expand('<amatch>'), 'man://\zs.*')) +augroup END diff --git a/runtime/syntax/man.vim b/runtime/syntax/man.vim index fbc1847e6e..4a527dd350 100644 --- a/runtime/syntax/man.vim +++ b/runtime/syntax/man.vim @@ -1,67 +1,37 @@ -" Vim syntax file -" Language: Man page -" Maintainer: SungHyun Nam <goweol@gmail.com> -" Previous Maintainer: Gautam H. Mudunuri <gmudunur@informatica.com> -" Version Info: -" Last Change: 2015 Nov 24 +" Maintainer: Anmol Sethi <anmol@aubble.com> +" Previous Maintainer: SungHyun Nam <goweol@gmail.com> -" Additional highlighting by Johannes Tanzler <johannes.tanzler@aon.at>: -" * manSubHeading -" * manSynopsis (only for sections 2 and 3) - -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +if exists('b:current_syntax') finish endif -" Get the CTRL-H syntax to handle backspaced text -if version >= 600 - runtime! syntax/ctrlh.vim -else - source <sfile>:p:h/ctrlh.vim -endif - -syn case ignore -syn match manReference "\f\+([1-9][a-z]\=)" -syn match manTitle "^\f\+([0-9]\+[a-z]\=).*" -syn match manSectionHeading "^[a-z][a-z -]*[a-z]$" -syn match manSubHeading "^\s\{3\}[a-z][a-z -]*[a-z]$" -syn match manOptionDesc "^\s*[+-][a-z0-9]\S*" -syn match manLongOptionDesc "^\s*--[a-z0-9-]\S*" -" syn match manHistory "^[a-z].*last change.*$" - -if getline(1) =~ '^[a-zA-Z_]\+([23])' - syntax include @cCode <sfile>:p:h/c.vim - syn match manCFuncDefinition display "\<\h\w*\>\s*("me=e-1 contained - syn region manSynopsis start="^SYNOPSIS"hs=s+8 end="^\u\+\s*$"me=e-12 keepend contains=manSectionHeading,@cCode,manCFuncDefinition -endif - - -" Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_man_syn_inits") - if version < 508 - let did_man_syn_inits = 1 - command -nargs=+ HiLink hi link <args> - else - command -nargs=+ HiLink hi def link <args> - endif - - HiLink manTitle Title - HiLink manSectionHeading Statement - HiLink manOptionDesc Constant - HiLink manLongOptionDesc Constant - HiLink manReference PreProc - HiLink manSubHeading Function - HiLink manCFuncDefinition Function - - delcommand HiLink +syntax case ignore +syntax match manReference display '[^()[:space:]]\+([0-9nx][a-z]*)' +syntax match manSectionHeading display '^\S.*$' +syntax match manTitle display '^\%1l.*$' +syntax match manSubHeading display '^ \{3\}\S.*$' +syntax match manOptionDesc display '^\s\+\%(+\|-\)\S\+' + +highlight default link manTitle Title +highlight default link manSectionHeading Statement +highlight default link manOptionDesc Constant +highlight default link manReference PreProc +highlight default link manSubHeading Function + +if b:man_sect =~# '^[23]' + syntax include @c $VIMRUNTIME/syntax/c.vim + syntax match manCFuncDefinition display '\<\h\w*\>\ze\(\s\|\n\)*(' contained + syntax region manSynopsis start='^\%( + \SYNOPSIS\| + \SYNTAX\| + \SINTASSI\| + \SKÅADNIA\| + \СИÐТÐКСИС\| + \書å¼\)$' end='^\%(\S.*\)\=\S$' keepend contains=manSectionHeading,@c,manCFuncDefinition + highlight default link manCFuncDefinition Function endif -let b:current_syntax = "man" +" Prevent everything else from matching the last line +execute 'syntax match manFooter display "^\%'.line('$').'l.*$"' -" vim:ts=8 sts=2 sw=2: +let b:current_syntax = 'man' diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index cf51830b68..c855267137 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -53,7 +53,7 @@ syn keyword vimGroup contained Comment Constant String Character Number Boolean syn keyword vimHLGroup contained ColorColumn Cursor CursorColumn CursorIM CursorLine CursorLineNr DiffAdd DiffChange DiffDelete DiffText Directory ErrorMsg FoldColumn Folded IncSearch LineNr MatchParen Menu ModeMsg MoreMsg NonText Normal Pmenu PmenuSbar PmenuSel PmenuThumb Question Scrollbar Search SignColumn SpecialKey SpellBad SpellCap SpellLocal SpellRare StatusLine StatusLineNC TabLine TabLineFill TabLineSel Title Tooltip VertSplit Visual WarningMsg WildMenu syn match vimHLGroup contained "Conceal" syn keyword vimOnlyHLGroup contained VisualNOS -syn keyword nvimHLGroup contained EndOfBuffer TermCursor TermCursorNC +syn keyword nvimHLGroup contained EndOfBuffer TermCursor TermCursorNC QuickFixLine "}}}2 syn case match " Special Vim Highlighting (not automatic) {{{1 diff --git a/scripts/msgpack-gen.lua b/scripts/gendispatch.lua index 2da3c174f9..40507d0afe 100644 --- a/scripts/msgpack-gen.lua +++ b/scripts/gendispatch.lua @@ -37,22 +37,31 @@ c_proto = Ct( Cg(Cc(false), 'async') * (fill * Cg((P('FUNC_API_ASYNC') * Cc(true)), 'async') ^ -1) * (fill * Cg((P('FUNC_API_NOEXPORT') * Cc(true)), 'noexport') ^ -1) * + (fill * Cg((P('FUNC_API_NOEVAL') * Cc(true)), 'noeval') ^ -1) * fill * P(';') ) grammar = Ct((c_proto + c_comment + c_preproc + ws) ^ 1) --- we need at least 2 arguments since the last one is the output file -assert(#arg >= 1) +-- we need at least 4 arguments since the last two are output files +assert(#arg >= 3) functions = {} +local nvimsrcdir = arg[1] +package.path = nvimsrcdir .. '/?.lua;' .. package.path + -- names of all headers relative to the source root (for inclusion in the -- generated file) headers = {} --- output file(dispatch function + metadata serialized with msgpack) -outputf = arg[#arg] +-- output c file(dispatch function + metadata serialized with msgpack) +outputf = arg[#arg-1] +-- output mpack file (metadata) +mpack_outputf = arg[#arg] + +-- set of function names, used to detect duplicates +function_names = {} -- read each input file, parse and append to the api metadata -for i = 1, #arg - 1 do +for i = 2, #arg - 2 do local full_path = arg[i] local parts = {} for part in string.gmatch(full_path, '[^/]+') do @@ -66,6 +75,7 @@ for i = 1, #arg - 1 do local fn = tmp[i] if not fn.noexport then functions[#functions + 1] = tmp[i] + function_names[fn.name] = true if #fn.parameters ~= 0 and fn.parameters[1][2] == 'channel_id' then -- this function should receive the channel id fn.receives_channel_id = true @@ -84,6 +94,52 @@ for i = 1, #arg - 1 do input:close() end +local function shallowcopy(orig) + local copy = {} + for orig_key, orig_value in pairs(orig) do + copy[orig_key] = orig_value + end + return copy +end + +local function startswith(String,Start) + return string.sub(String,1,string.len(Start))==Start +end + +-- Export functions under older deprecated names. +-- These will be removed eventually. +local deprecated_aliases = require("api.dispatch_deprecated") +for i,f in ipairs(shallowcopy(functions)) do + local ismethod = false + if startswith(f.name, "nvim_buf_") then + ismethod = true + elseif startswith(f.name, "nvim_win_") then + ismethod = true + elseif startswith(f.name, "nvim_tabpage_") then + ismethod = true + elseif not startswith(f.name, "nvim_") then + f.noeval = true + f.deprecated_since = 1 + end + f.method = ismethod + local newname = deprecated_aliases[f.name] + if newname ~= nil then + if function_names[newname] then + -- duplicate + print("Function "..f.name.." has deprecated alias\n" + ..newname.." which has a separate implementation.\n".. + "Please remove it from src/nvim/api/dispatch_deprecated.lua") + os.exit(1) + end + local newf = shallowcopy(f) + newf.name = newname + newf.impl_name = f.name + newf.noeval = true + newf.deprecated_since = 1 + functions[#functions+1] = newf + end +end + -- start building the output output = io.open(outputf, 'wb') @@ -99,7 +155,7 @@ output:write([[ #include "nvim/log.h" #include "nvim/vim.h" #include "nvim/msgpack_rpc/helpers.h" -#include "nvim/msgpack_rpc/defs.h" +#include "nvim/api/private/dispatch.h" #include "nvim/api/private/helpers.h" #include "nvim/api/private/defs.h" ]]) @@ -163,99 +219,95 @@ end -- the real API. for i = 1, #functions do local fn = functions[i] - local args = {} - - output:write('static Object handle_'..fn.name..'(uint64_t channel_id, uint64_t request_id, Array args, Error *error)') - output:write('\n{') - output:write('\n Object ret = NIL;') - -- Declare/initialize variables that will hold converted arguments - for j = 1, #fn.parameters do - local param = fn.parameters[j] - local converted = 'arg_'..j - output:write('\n '..param[1]..' '..converted..' api_init_'..string.lower(real_type(param[1]))..';') - end - output:write('\n') - output:write('\n if (args.size != '..#fn.parameters..') {') - output:write('\n snprintf(error->msg, sizeof(error->msg), "Wrong number of arguments: expecting '..#fn.parameters..' but got %zu", args.size);') - output:write('\n error->set = true;') - output:write('\n goto cleanup;') - output:write('\n }\n') - - -- Validation/conversion for each argument - for j = 1, #fn.parameters do - local converted, convert_arg, param, arg - param = fn.parameters[j] - converted = 'arg_'..j - local rt = real_type(param[1]) - if rt ~= 'Object' then - output:write('\n if (args.items['..(j - 1)..'].type == kObjectType'..rt..') {') - output:write('\n '..converted..' = args.items['..(j - 1)..'].data.'..rt:lower()..';') - if rt:match('^Buffer$') or rt:match('^Window$') or rt:match('^Tabpage$') or rt:match('^Boolean$') then - -- accept positive integers for Buffers, Windows and Tabpages - output:write('\n } else if (args.items['..(j - 1)..'].type == kObjectTypeInteger && args.items['..(j - 1)..'].data.integer > 0) {') - output:write('\n '..converted..' = (unsigned)args.items['..(j - 1)..'].data.integer;') - end - output:write('\n } else {') - output:write('\n snprintf(error->msg, sizeof(error->msg), "Wrong type for argument '..j..', expecting '..param[1]..'");') - output:write('\n error->set = true;') - output:write('\n goto cleanup;') - output:write('\n }\n') - else - output:write('\n '..converted..' = args.items['..(j - 1)..'];\n') + if fn.impl_name == nil then + local args = {} + + output:write('Object handle_'..fn.name..'(uint64_t channel_id, uint64_t request_id, Array args, Error *error)') + output:write('\n{') + output:write('\n Object ret = NIL;') + -- Declare/initialize variables that will hold converted arguments + for j = 1, #fn.parameters do + local param = fn.parameters[j] + local converted = 'arg_'..j + output:write('\n '..param[1]..' '..converted..';') end + output:write('\n') + output:write('\n if (args.size != '..#fn.parameters..') {') + output:write('\n snprintf(error->msg, sizeof(error->msg), "Wrong number of arguments: expecting '..#fn.parameters..' but got %zu", args.size);') + output:write('\n error->set = true;') + output:write('\n goto cleanup;') + output:write('\n }\n') - args[#args + 1] = converted - end + -- Validation/conversion for each argument + for j = 1, #fn.parameters do + local converted, convert_arg, param, arg + param = fn.parameters[j] + converted = 'arg_'..j + local rt = real_type(param[1]) + if rt ~= 'Object' then + output:write('\n if (args.items['..(j - 1)..'].type == kObjectType'..rt..') {') + output:write('\n '..converted..' = args.items['..(j - 1)..'].data.'..rt:lower()..';') + if rt:match('^Buffer$') or rt:match('^Window$') or rt:match('^Tabpage$') or rt:match('^Boolean$') then + -- accept nonnegative integers for Booleans, Buffers, Windows and Tabpages + output:write('\n } else if (args.items['..(j - 1)..'].type == kObjectTypeInteger && args.items['..(j - 1)..'].data.integer >= 0) {') + output:write('\n '..converted..' = (handle_T)args.items['..(j - 1)..'].data.integer;') + end + output:write('\n } else {') + output:write('\n snprintf(error->msg, sizeof(error->msg), "Wrong type for argument '..j..', expecting '..param[1]..'");') + output:write('\n error->set = true;') + output:write('\n goto cleanup;') + output:write('\n }\n') + else + output:write('\n '..converted..' = args.items['..(j - 1)..'];\n') + end - -- function call - local call_args = table.concat(args, ', ') - output:write('\n ') - if fn.return_type ~= 'void' then - -- has a return value, prefix the call with a declaration - output:write(fn.return_type..' rv = ') - end + args[#args + 1] = converted + end - -- write the function name and the opening parenthesis - output:write(fn.name..'(') + -- function call + local call_args = table.concat(args, ', ') + output:write('\n ') + if fn.return_type ~= 'void' then + -- has a return value, prefix the call with a declaration + output:write(fn.return_type..' rv = ') + end + + -- write the function name and the opening parenthesis + output:write(fn.name..'(') - if fn.receives_channel_id then - -- if the function receives the channel id, pass it as first argument - if #args > 0 or fn.can_fail then - output:write('channel_id, '..call_args) + if fn.receives_channel_id then + -- if the function receives the channel id, pass it as first argument + if #args > 0 or fn.can_fail then + output:write('channel_id, '..call_args) + else + output:write('channel_id') + end else - output:write('channel_id') + output:write(call_args) end - else - output:write(call_args) - end - if fn.can_fail then - -- if the function can fail, also pass a pointer to the local error object - if #args > 0 then - output:write(', error);\n') + if fn.can_fail then + -- if the function can fail, also pass a pointer to the local error object + if #args > 0 then + output:write(', error);\n') + else + output:write('error);\n') + end + -- and check for the error + output:write('\n if (error->set) {') + output:write('\n goto cleanup;') + output:write('\n }\n') else - output:write('error);\n') + output:write(');\n') end - -- and check for the error - output:write('\n if (error->set) {') - output:write('\n goto cleanup;') - output:write('\n }\n') - else - output:write(');\n') - end - if fn.return_type ~= 'void' then - output:write('\n ret = '..string.upper(real_type(fn.return_type))..'_OBJ(rv);') - end - -- Now generate the cleanup label for freeing memory allocated for the - -- arguments - output:write('\n\ncleanup:'); + if fn.return_type ~= 'void' then + output:write('\n ret = '..string.upper(real_type(fn.return_type))..'_OBJ(rv);') + end + output:write('\n\ncleanup:'); - for j = 1, #fn.parameters do - local param = fn.parameters[j] - output:write('\n api_free_'..string.lower(real_type(param[1]))..'(arg_'..j..');') + output:write('\n return ret;\n}\n\n'); end - output:write('\n return ret;\n}\n\n'); end -- Generate a function that initializes method names with handler functions @@ -281,7 +333,7 @@ for i = 1, #functions do output:write(' msgpack_rpc_add_method_handler('.. '(String) {.data = "'..fn.name..'", '.. '.size = sizeof("'..fn.name..'") - 1}, '.. - '(MsgpackRpcRequestHandler) {.fn = handle_'.. fn.name.. + '(MsgpackRpcRequestHandler) {.fn = handle_'.. (fn.impl_name or fn.name).. ', .async = '..tostring(fn.async)..'});\n') if #fn.name > max_fname_len then @@ -311,3 +363,7 @@ MsgpackRpcRequestHandler msgpack_rpc_get_handler_for(const char *name, ]]) output:close() + +mpack_output = io.open(mpack_outputf, 'wb') +mpack_output:write(packed) +mpack_output:close() diff --git a/scripts/geneval.lua b/scripts/geneval.lua new file mode 100644 index 0000000000..b1ba76296c --- /dev/null +++ b/scripts/geneval.lua @@ -0,0 +1,66 @@ +mpack = require('mpack') + +local nvimsrcdir = arg[1] +local autodir = arg[2] +local metadata_file = arg[3] +local funcs_file = arg[4] + +if nvimsrcdir == '--help' then + print([[ +Usage: + lua geneval.lua src/nvim build/src/nvim/auto + +Will generate build/src/nvim/auto/funcs.generated.h with definition of functions +static const array. +]]) + os.exit(0) +end + +package.path = nvimsrcdir .. '/?.lua;' .. package.path + +local funcsfname = autodir .. '/funcs.generated.h' + +local gperfpipe = io.open(funcsfname .. '.gperf', 'wb') + +local funcs = require('eval').funcs +local metadata = mpack.unpack(io.open(arg[3], 'rb'):read("*all")) +for i,fun in ipairs(metadata) do + if not fun.noeval then + funcs[fun.name] = { + args=#fun.parameters, + func='api_wrapper', + data='&handle_'..fun.name, + } + end +end + +local funcsdata = io.open(funcs_file, 'w') +funcsdata:write(mpack.pack(funcs)) +funcsdata:close() + +gperfpipe:write([[ +%language=ANSI-C +%global-table +%define initializer-suffix ,0,0,NULL,NULL +%define word-array-name functions +%define hash-function-name hash_internal_func_gperf +%define lookup-function-name find_internal_func_gperf +%omit-struct-type +%struct-type +VimLFuncDef; +%% +]]) + +for name, def in pairs(funcs) do + args = def.args or 0 + if type(args) == 'number' then + args = {args, args} + elseif #args == 1 then + args[2] = 'MAX_FUNC_ARGS' + end + func = def.func or ('f_' .. name) + data = def.data or "NULL" + gperfpipe:write(('%s, %s, %s, &%s, (FunPtr)%s\n') + :format(name, args[1], args[2], func, data)) +end +gperfpipe:close() diff --git a/scripts/genoptions.lua b/scripts/genoptions.lua index da53d010bd..9f7d94969d 100644 --- a/scripts/genoptions.lua +++ b/scripts/genoptions.lua @@ -57,9 +57,14 @@ local get_flags = function(o) add_flag(redraw_flags[r_flag]) end end + if o.expand then + add_flag('P_EXPAND') + if o.expand == 'nodefault' then + add_flag('P_NO_DEF_EXP') + end + end for _, flag_desc in ipairs({ {'alloced'}, - {'expand'}, {'nodefault'}, {'no_mkrc'}, {'vi_def'}, diff --git a/scripts/genvimvim.lua b/scripts/genvimvim.lua index 2a82181841..24c147b811 100644 --- a/scripts/genvimvim.lua +++ b/scripts/genvimvim.lua @@ -1,10 +1,13 @@ +mpack = require('mpack') + if arg[1] == '--help' then - print('Usage: genoptions.lua src/nvim runtime/syntax/vim/generated.vim') + print('Usage: lua genvimvim.lua src/nvim runtime/syntax/vim/generated.vim') os.exit(0) end local nvimsrcdir = arg[1] local syntax_file = arg[2] +local funcs_file = arg[3] package.path = nvimsrcdir .. '/?.lua;' .. package.path @@ -111,28 +114,16 @@ end w('\n\nsyn case match') local vimfun_start = 'syn keyword vimFuncName contained ' w('\n\n' .. vimfun_start) -eval_fd = io.open(nvimsrcdir .. '/eval.c', 'r') +funcs = mpack.unpack(io.open(funcs_file):read("*all")) local started = 0 -for line in eval_fd:lines() do - if line == '} functions[] =' then - started = 1 - elseif started == 1 then - assert (line == '{') - started = 2 - elseif started == 2 then - if line == '};' then - break - end - local func_name = line:match('^ { "([%w_]+)",') - if func_name then - if lld.line_length > 850 then - w('\n' .. vimfun_start) - end - w(' ' .. func_name) +for name, def in pairs(funcs) do + if name then + if lld.line_length > 850 then + w('\n' .. vimfun_start) end + w(' ' .. name) end end -eval_fd:close() w('\n') syn_fd:close() diff --git a/scripts/git-log-pretty-since.sh b/scripts/git-log-pretty-since.sh index d8e3282fb3..6281127542 100755 --- a/scripts/git-log-pretty-since.sh +++ b/scripts/git-log-pretty-since.sh @@ -19,7 +19,7 @@ is_merge_commit() { git log $1^2 >/dev/null 2>&1 && return 0 || return 1 } -for commit in $(git log --format='%H' --first-parent --since $__SINCE); do +for commit in $(git log --format='%H' --first-parent "$__SINCE"..HEAD); do if is_merge_commit ${commit} ; then if [ -z "$__INVMATCH" ] || ! git log --oneline ${commit}^1..${commit}^2 \ | grep -E "$__INVMATCH" >/dev/null 2>&1 ; then diff --git a/scripts/release.sh b/scripts/release.sh index 67738ccc96..5a5b5a6498 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash # Performs steps to tag a release. # @@ -17,16 +17,18 @@ set -e set -u set -o pipefail +__sed=$( [ "$(uname)" = Darwin ] && echo 'sed -E' || echo 'sed -r' ) + cd "$(git rev-parse --show-toplevel)" __LAST_TAG=$(git describe --abbrev=0) [ -z "$__LAST_TAG" ] && { echo 'ERROR: no tag found'; exit 1; } __VERSION_MAJOR=$(grep 'set(NVIM_VERSION_MAJOR' CMakeLists.txt\ - |sed -r 's/.*NVIM_VERSION_MAJOR ([[:digit:]]).*/\1/') + |$__sed 's/.*NVIM_VERSION_MAJOR ([[:digit:]]).*/\1/') __VERSION_MINOR=$(grep 'set(NVIM_VERSION_MINOR' CMakeLists.txt\ - |sed -r 's/.*NVIM_VERSION_MINOR ([[:digit:]]).*/\1/') + |$__sed 's/.*NVIM_VERSION_MINOR ([[:digit:]]).*/\1/') __VERSION_PATCH=$(grep 'set(NVIM_VERSION_PATCH' CMakeLists.txt\ - |sed -r 's/.*NVIM_VERSION_PATCH ([[:digit:]]).*/\1/') + |$__sed 's/.*NVIM_VERSION_PATCH ([[:digit:]]).*/\1/') __VERSION="${__VERSION_MAJOR}.${__VERSION_MINOR}.${__VERSION_PATCH}" { [ -z "$__VERSION_MAJOR" ] || [ -z "$__VERSION_MINOR" ] || [ -z "$__VERSION_PATCH" ]; } \ && { echo "ERROR: version parse failed: '${__VERSION}'"; exit 1; } @@ -43,16 +45,19 @@ __BUMP_MSG="version bump" echo "Most recent tag: ${__LAST_TAG}" echo "Release version: ${__VERSION}" -sed -i -r 's/(NVIM_VERSION_PRERELEASE) "-dev"/\1 ""/' CMakeLists.txt +$__sed -i.bk 's/(NVIM_VERSION_PRERELEASE) "-dev"/\1 ""/' CMakeLists.txt echo "Building changelog since ${__LAST_TAG}..." __CHANGELOG="$(./scripts/git-log-pretty-since.sh "$__LAST_TAG" 'vim-patch:\S')" git add CMakeLists.txt git commit --edit -m "${__RELEASE_MSG} ${__CHANGELOG}" -git tag -a v"${__VERSION}" -m "NVIM v${__VERSION}" +git tag --sign -a v"${__VERSION}" -m "NVIM v${__VERSION}" + +$__sed -i.bk 's/(NVIM_VERSION_PRERELEASE) ""/\1 "-dev"/' CMakeLists.txt +$__sed -i.bk 's/set\((NVIM_VERSION_PATCH) [[:digit:]]/set(\1 ?/' CMakeLists.txt +nvim +'/NVIM_VERSION' +10new +'exe "norm! iUpdate version numbers!!!\<CR>"' \ + +'norm! 10.' CMakeLists.txt -sed -i -r 's/(NVIM_VERSION_PRERELEASE) ""/\1 "-dev"/' CMakeLists.txt -nvim -c '/NVIM_VERSION' -c 'echo "Update version numbers"' CMakeLists.txt git add CMakeLists.txt git commit -m "$__BUMP_MSG" diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh index 3997bd52b1..a2750105c3 100755 --- a/scripts/vim-patch.sh +++ b/scripts/vim-patch.sh @@ -3,9 +3,11 @@ set -e set -u set -o pipefail +# Use privileged mode, which e.g. skips using CDPATH. +set -p -readonly NEOVIM_SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" -readonly VIM_SOURCE_DIR_DEFAULT="${NEOVIM_SOURCE_DIR}/.vim-src" +readonly NVIM_SOURCE_DIR="${NVIM_SOURCE_DIR:-$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)}" +readonly VIM_SOURCE_DIR_DEFAULT="${NVIM_SOURCE_DIR}/.vim-src" readonly VIM_SOURCE_DIR="${VIM_SOURCE_DIR:-${VIM_SOURCE_DIR_DEFAULT}}" readonly BASENAME="$(basename "${0}")" readonly BRANCH_PREFIX="vim-" @@ -122,6 +124,28 @@ assign_commit_details() { patch_file="vim-${vim_version}.patch" } +# Patch surgery: +preprocess_patch() { + local file="$1" + local nvim="nvim -u NORC -i NONE --headless" + + # Remove *.proto, Make*, gui_*, some if_* + local na_src='proto\|Make*\|gui_*' + na_src="$na_src"'\|if_lua\|if_mzsch\|if_olepp\|if_ole\|if_perl\|if_py\|if_ruby\|if_tcl\|if_xcmdsrv' + 2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/src/\S*\<'${na_src}'@norm! d/\v(^diff)|%$
' +w +q "$file" + + # Remove todo.txt, version*.txt, tags + local na_doc='todo\.txt\|version\d\.txt\|tags' + 2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/runtime/doc/'${na_doc}'@norm! d/\v(^diff)|%$
' +w +q "$file" + + # Remove some testdir/Make_*.mak files + local na_src_testdir='Make_amiga.mak\|Make_dos.mak\|Make_ming.mak\|Make_vms.mms' + 2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/src/testdir/'${na_src_testdir}'@norm! d/\v(^diff)|%$
' +w +q "$file" + + # Rename src/ paths to src/nvim/ + LC_ALL=C sed -e 's/\( [ab]\/src\)/\1\/nvim/g' "$file" > "$file".tmp && mv "$file".tmp "$file" +} + get_vim_patch() { get_vim_sources @@ -131,17 +155,13 @@ get_vim_patch() { >&2 echo "✘ Couldn't find Vim revision '${vim_commit}'." exit 3 } - echo echo "✔ Found Vim revision '${vim_commit}'." - # Patch surgery: preprocess the patch. - # - transform src/ paths to src/nvim/ - local vim_full - vim_full="$(git --no-pager show --color=never -1 --pretty=medium "${vim_commit}" \ - | LC_ALL=C sed -e 's/\( [ab]\/src\)/\1\/nvim/g')" - local neovim_branch="${BRANCH_PREFIX}${vim_version}" + local patch_content + patch_content="$(git --no-pager show --color=never -1 --pretty=medium "${vim_commit}")" + local nvim_branch="${BRANCH_PREFIX}${vim_version}" - cd "${NEOVIM_SOURCE_DIR}" + cd "${NVIM_SOURCE_DIR}" local git_remote git_remote="$(find_git_remote)" local checked_out_branch @@ -151,51 +171,48 @@ get_vim_patch() { echo "✔ Current branch '${checked_out_branch}' seems to be a vim-patch" echo " branch; not creating a new branch." else - echo - echo "Fetching '${git_remote}/master'." + printf "\nFetching '${git_remote}/master'.\n" output="$(git fetch "${git_remote}" master 2>&1)" && echo "✔ ${output}" || (echo "✘ ${output}"; false) echo - echo "Creating new branch '${neovim_branch}' based on '${git_remote}/master'." - cd "${NEOVIM_SOURCE_DIR}" - output="$(git checkout -b "${neovim_branch}" "${git_remote}/master" 2>&1)" && + echo "Creating new branch '${nvim_branch}' based on '${git_remote}/master'." + cd "${NVIM_SOURCE_DIR}" + output="$(git checkout -b "${nvim_branch}" "${git_remote}/master" 2>&1)" && echo "✔ ${output}" || (echo "✘ ${output}"; false) fi - echo - echo "Creating empty commit with correct commit message." + printf "\nCreating empty commit with correct commit message.\n" output="$(commit_message | git commit --allow-empty --file 2>&1 -)" && echo "✔ ${output}" || (echo "✘ ${output}"; false) - echo - echo "Creating files." - echo "${vim_full}" > "${NEOVIM_SOURCE_DIR}/${patch_file}" - echo "✔ Saved full commit details to '${NEOVIM_SOURCE_DIR}/${patch_file}'." + printf "Creating patch...\n" + echo "$patch_content" > "${NVIM_SOURCE_DIR}/${patch_file}" - echo - echo "Instructions:" - echo - echo " Proceed to port the patch." - echo " You might want to try 'patch -p1 < ${patch_file}' first." - echo - echo " If the patch contains a new test, consider porting it to Lua." - echo " You might want to try 'scripts/legacy2luatest.pl'." - echo - echo " Stage your changes ('git add ...') and use 'git commit --amend' to commit." - echo - echo " To port additional patches related to ${vim_version} and add them to the current" - echo " branch, call '${BASENAME} -p' again. Please use this only if it wouldn't make" - echo " sense to send in each patch individually, as it will increase the size of the" - echo " pull request and make it harder to review." - echo - echo " When you are finished, use '${BASENAME} -s' to submit a pull request." - echo - echo " See https://github.com/neovim/neovim/wiki/Merging-patches-from-upstream-vim" - echo " for more information." + printf "Pre-processing patch...\n" + preprocess_patch "${NVIM_SOURCE_DIR}/${patch_file}" + + printf "✔ Saved patch to '${NVIM_SOURCE_DIR}/${patch_file}'.\n" + + printf "\nInstructions: + Proceed to port the patch. This may help: + patch -p1 < ${patch_file} + + Stage your changes ('git add ...') and use 'git commit --amend' to commit. + + To port additional patches related to ${vim_version} and add them to the + current branch, call '${BASENAME} -p' again. + * Do this only for _related_ patches (otherwise it increases the + size of the pull request, making it harder to review) + + When you're done, try '${BASENAME} -s' to create the pull request. + + See the wiki for more information: + * https://github.com/neovim/neovim/wiki/Merging-patches-from-upstream-vim + " } hub_pr() { @@ -221,7 +238,7 @@ submit_pr() { exit 1 fi - cd "${NEOVIM_SOURCE_DIR}" + cd "${NVIM_SOURCE_DIR}" local checked_out_branch checked_out_branch="$(git rev-parse --abbrev-ref HEAD)" if [[ "${checked_out_branch}" != ${BRANCH_PREFIX}* ]]; then @@ -261,11 +278,11 @@ submit_pr() { local patch_file for patch_file in "${patches[@]}"; do patch_file="vim-${patch_file}.patch" - if [[ ! -f "${NEOVIM_SOURCE_DIR}/${patch_file}" ]]; then + if [[ ! -f "${NVIM_SOURCE_DIR}/${patch_file}" ]]; then continue fi - rm -- "${NEOVIM_SOURCE_DIR}/${patch_file}" - echo "✔ Removed '${NEOVIM_SOURCE_DIR}/${patch_file}'." + rm -- "${NVIM_SOURCE_DIR}/${patch_file}" + echo "✔ Removed '${NVIM_SOURCE_DIR}/${patch_file}'." done } @@ -287,7 +304,7 @@ list_vim_patches() { if [[ -n "${vim_tag}" ]]; then local patch_number="${vim_tag:5}" # Remove prefix like "v7.4." # Tagged Vim patch, check version.c: - is_missing="$(sed -n '/static int included_patches/,/}/p' "${NEOVIM_SOURCE_DIR}/src/nvim/version.c" | + is_missing="$(sed -n '/static int included_patches/,/}/p' "${NVIM_SOURCE_DIR}/src/nvim/version.c" | grep -x -e "[[:space:]]*//[[:space:]]${patch_number} NA.*" -e "[[:space:]]*${patch_number}," >/dev/null && echo "false" || echo "true")" vim_commit="${vim_tag#v}" if (cd "${VIM_SOURCE_DIR}" && git --no-pager show --color=never --name-only "v${vim_commit}" 2>/dev/null) | grep -q ^runtime; then @@ -295,7 +312,7 @@ list_vim_patches() { fi else # Untagged Vim patch (e.g. runtime updates), check the Neovim git log: - is_missing="$(cd "${NEOVIM_SOURCE_DIR}" && + is_missing="$(cd "${NVIM_SOURCE_DIR}" && git log -1 --no-merges --grep="vim\-patch:${vim_commit:0:7}" --pretty=format:false)" fi @@ -319,14 +336,14 @@ list_vim_patches() { } review_commit() { - local neovim_commit_url="${1}" - local neovim_patch_url="${neovim_commit_url}.patch" + local nvim_commit_url="${1}" + local nvim_patch_url="${nvim_commit_url}.patch" local git_patch_prefix='Subject: \[PATCH\] ' - local neovim_patch - neovim_patch="$(curl -Ssf "${neovim_patch_url}")" + local nvim_patch + nvim_patch="$(curl -Ssf "${nvim_patch_url}")" local vim_version - vim_version="$(head -n 4 <<< "${neovim_patch}" | sed -n "s/${git_patch_prefix}vim-patch:\([a-z0-9.]*\)$/\1/p")" + vim_version="$(head -n 4 <<< "${nvim_patch}" | sed -n "s/${git_patch_prefix}vim-patch:\([a-z0-9.]*\)$/\1/p")" echo if [[ -n "${vim_version}" ]]; then @@ -347,7 +364,7 @@ review_commit() { local message_length message_length="$(wc -l <<< "${expected_commit_message}")" local commit_message - commit_message="$(tail -n +4 <<< "${neovim_patch}" | head -n "${message_length}")" + commit_message="$(tail -n +4 <<< "${nvim_patch}" | head -n "${message_length}")" if [[ "${commit_message#${git_patch_prefix}}" == "${expected_commit_message}" ]]; then echo "✔ Found expected commit message." else @@ -360,18 +377,18 @@ review_commit() { echo echo "Creating files." - echo "${neovim_patch}" > "${NEOVIM_SOURCE_DIR}/n${patch_file}" - echo "✔ Saved pull request diff to '${NEOVIM_SOURCE_DIR}/n${patch_file}'." - CREATED_FILES+=("${NEOVIM_SOURCE_DIR}/n${patch_file}") + echo "${nvim_patch}" > "${NVIM_SOURCE_DIR}/n${patch_file}" + echo "✔ Saved pull request diff to '${NVIM_SOURCE_DIR}/n${patch_file}'." + CREATED_FILES+=("${NVIM_SOURCE_DIR}/n${patch_file}") - curl -Ssfo "${NEOVIM_SOURCE_DIR}/${patch_file}" "${vim_patch_url}" - echo "✔ Saved Vim diff to '${NEOVIM_SOURCE_DIR}/${patch_file}'." - CREATED_FILES+=("${NEOVIM_SOURCE_DIR}/${patch_file}") + curl -Ssfo "${NVIM_SOURCE_DIR}/${patch_file}" "${vim_patch_url}" + echo "✔ Saved Vim diff to '${NVIM_SOURCE_DIR}/${patch_file}'." + CREATED_FILES+=("${NVIM_SOURCE_DIR}/${patch_file}") echo echo "Launching nvim." - nvim -c "cd ${NEOVIM_SOURCE_DIR}" \ - -O "${NEOVIM_SOURCE_DIR}/${patch_file}" "${NEOVIM_SOURCE_DIR}/n${patch_file}" + nvim -c "cd ${NVIM_SOURCE_DIR}" \ + -O "${NVIM_SOURCE_DIR}/${patch_file}" "${NVIM_SOURCE_DIR}/n${patch_file}" } review_pr() { diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt index d80add2835..7c2c2feebc 100644 --- a/src/nvim/CMakeLists.txt +++ b/src/nvim/CMakeLists.txt @@ -11,22 +11,28 @@ endif() endif() set(GENERATED_DIR ${PROJECT_BINARY_DIR}/src/nvim/auto) -set(DISPATCH_GENERATOR ${PROJECT_SOURCE_DIR}/scripts/msgpack-gen.lua) +set(DISPATCH_GENERATOR ${PROJECT_SOURCE_DIR}/scripts/gendispatch.lua) file(GLOB API_HEADERS api/*.h) file(GLOB MSGPACK_RPC_HEADERS msgpack_rpc/*.h) -set(MSGPACK_DISPATCH ${GENERATED_DIR}/msgpack_dispatch.c) +set(API_METADATA ${PROJECT_BINARY_DIR}/api_metadata.mpack) +set(FUNCS_DATA ${PROJECT_BINARY_DIR}/funcs_data.mpack) set(HEADER_GENERATOR ${PROJECT_SOURCE_DIR}/scripts/gendeclarations.lua) set(GENERATED_INCLUDES_DIR ${PROJECT_BINARY_DIR}/include) +set(GENERATED_API_DISPATCH ${GENERATED_DIR}/api/private/dispatch.c) set(GENERATED_EX_CMDS_ENUM ${GENERATED_INCLUDES_DIR}/ex_cmds_enum.generated.h) set(GENERATED_EX_CMDS_DEFS ${GENERATED_DIR}/ex_cmds_defs.generated.h) +set(GENERATED_FUNCS_HASH_INPUT ${GENERATED_DIR}/funcs.generated.h.gperf) +set(GENERATED_FUNCS ${GENERATED_DIR}/funcs.generated.h) set(GENERATED_EVENTS_ENUM ${GENERATED_INCLUDES_DIR}/auevents_enum.generated.h) set(GENERATED_EVENTS_NAMES_MAP ${GENERATED_DIR}/auevents_name_map.generated.h) set(GENERATED_OPTIONS ${GENERATED_DIR}/options.generated.h) set(EX_CMDS_GENERATOR ${PROJECT_SOURCE_DIR}/scripts/genex_cmds.lua) +set(FUNCS_GENERATOR ${PROJECT_SOURCE_DIR}/scripts/geneval.lua) set(EVENTS_GENERATOR ${PROJECT_SOURCE_DIR}/scripts/gen_events.lua) set(OPTIONS_GENERATOR ${PROJECT_SOURCE_DIR}/scripts/genoptions.lua) set(EVENTS_LIST_FILE ${PROJECT_SOURCE_DIR}/src/nvim/auevents.lua) set(EX_CMDS_DEFS_FILE ${PROJECT_SOURCE_DIR}/src/nvim/ex_cmds.lua) +set(EVAL_DEFS_FILE ${PROJECT_SOURCE_DIR}/src/nvim/eval.lua) set(OPTIONS_LIST_FILE ${PROJECT_SOURCE_DIR}/src/nvim/options.lua) set(UNICODE_TABLES_GENERATOR ${PROJECT_SOURCE_DIR}/scripts/genunicodetables.lua) set(UNICODE_DIR ${PROJECT_SOURCE_DIR}/unicode) @@ -36,6 +42,7 @@ set(EASTASIANWIDTH_FILE ${UNICODE_DIR}/EastAsianWidth.txt) set(GENERATED_UNICODE_TABLES ${GENERATED_DIR}/unicode_tables.generated.h) include_directories(${GENERATED_DIR}) +include_directories(${CACHED_GENERATED_DIR}) include_directories(${GENERATED_INCLUDES_DIR}) file(MAKE_DIRECTORY ${GENERATED_DIR}) @@ -82,7 +89,7 @@ endforeach() list(REMOVE_ITEM NEOVIM_SOURCES ${to_remove}) -# Handle legacy files that don't yet pass -Wconversion. +# Legacy files that do not yet pass -Wconversion. set(CONV_SOURCES buffer.c diff.c @@ -112,6 +119,15 @@ endforeach() if(NOT MSVC) set_source_files_properties( ${CONV_SOURCES} PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -Wno-conversion") + # gperf generates ANSI-C with incorrect linkage, ignore it. + check_c_compiler_flag(-Wno-static-in-inline HAS_WNO_STATIC_IN_INLINE_FLAG) + if(HAS_WNO_STATIC_IN_INLINE_FLAG) + set_source_files_properties( + eval.c PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -Wno-static-in-inline -Wno-conversion") + else() + set_source_files_properties( + eval.c PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -Wno-conversion") + endif() endif() if(DEFINED MIN_LOG_LEVEL) @@ -138,9 +154,13 @@ separate_arguments(C_FLAGS_${build_type}_ARRAY UNIX_COMMAND ${CMAKE_C_FLAGS_${bu set(gen_cflags ${gen_cflags} ${C_FLAGS_${build_type}_ARRAY} ${C_FLAGS_ARRAY}) foreach(sfile ${NEOVIM_SOURCES} - "${PROJECT_SOURCE_DIR}/src/nvim/regexp_nfa.c") + "${PROJECT_SOURCE_DIR}/src/nvim/regexp_nfa.c" + ${GENERATED_API_DISPATCH}) get_filename_component(full_d ${sfile} PATH) file(RELATIVE_PATH d "${PROJECT_SOURCE_DIR}/src/nvim" "${full_d}") + if(${d} MATCHES "^[.][.]") + file(RELATIVE_PATH d "${GENERATED_DIR}" "${full_d}") + endif() get_filename_component(f ${sfile} NAME) get_filename_component(r ${sfile} NAME_WE) if(NOT ${d} EQUAL ".") @@ -183,17 +203,18 @@ add_custom_command(OUTPUT ${GENERATED_UNICODE_TABLES} ${EASTASIANWIDTH_FILE} ) -add_custom_command(OUTPUT ${MSGPACK_DISPATCH} - COMMAND ${LUA_PRG} ${DISPATCH_GENERATOR} ${API_HEADERS} ${MSGPACK_DISPATCH} +add_custom_command(OUTPUT ${GENERATED_API_DISPATCH} ${API_METADATA} + COMMAND ${LUA_PRG} ${DISPATCH_GENERATOR} ${CMAKE_CURRENT_LIST_DIR} ${API_HEADERS} ${GENERATED_API_DISPATCH} ${API_METADATA} DEPENDS ${API_HEADERS} ${MSGPACK_RPC_HEADERS} ${DISPATCH_GENERATOR} + ${CMAKE_CURRENT_LIST_DIR}/api/dispatch_deprecated.lua ) list(APPEND NEOVIM_GENERATED_SOURCES "${PROJECT_BINARY_DIR}/config/auto/pathdef.c" - "${MSGPACK_DISPATCH}" + "${GENERATED_API_DISPATCH}" "${GENERATED_EX_CMDS_ENUM}" "${GENERATED_EX_CMDS_DEFS}" "${GENERATED_EVENTS_ENUM}" @@ -208,6 +229,19 @@ add_custom_command(OUTPUT ${GENERATED_EX_CMDS_ENUM} ${GENERATED_EX_CMDS_DEFS} DEPENDS ${EX_CMDS_GENERATOR} ${EX_CMDS_DEFS_FILE} ) +if(NOT GPERF_PRG) + message(FATAL_ERROR "gperf was not found.") +endif() +add_custom_command(OUTPUT ${GENERATED_FUNCS} ${FUNCS_DATA} + COMMAND ${LUA_PRG} ${FUNCS_GENERATOR} + ${PROJECT_SOURCE_DIR}/src/nvim ${GENERATED_DIR} ${API_METADATA} ${FUNCS_DATA} + COMMAND ${GPERF_PRG} + ${GENERATED_FUNCS_HASH_INPUT} --output-file=${GENERATED_FUNCS} + DEPENDS ${FUNCS_GENERATOR} ${EVAL_DEFS_FILE} ${API_METADATA} +) +list(APPEND NEOVIM_GENERATED_SOURCES + "${GENERATED_FUNCS}") + add_custom_command(OUTPUT ${GENERATED_EVENTS_ENUM} ${GENERATED_EVENTS_NAMES_MAP} COMMAND ${LUA_PRG} ${EVENTS_GENERATOR} ${PROJECT_SOURCE_DIR}/src/nvim ${GENERATED_EVENTS_ENUM} ${GENERATED_EVENTS_NAMES_MAP} @@ -259,6 +293,21 @@ add_executable(nvim ${NEOVIM_GENERATED_SOURCES} ${NEOVIM_SOURCES} target_link_libraries(nvim ${NVIM_EXEC_LINK_LIBRARIES}) install_helper(TARGETS nvim) +if(WIN32) + # Copy DLLs to bin/ and install them along with nvim + add_custom_target(nvim_dll_deps ALL DEPENDS nvim + COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/windows_runtime_deps + COMMAND ${CMAKE_COMMAND} + "-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}" + -DBINARY="${PROJECT_BINARY_DIR}/bin/nvim${CMAKE_EXECUTABLE_SUFFIX}" + -DDST=${PROJECT_BINARY_DIR}/windows_runtime_deps + -P ${PROJECT_SOURCE_DIR}/cmake/WindowsDllCopy.cmake + COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJECT_BINARY_DIR}/windows_runtime_deps/ + ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) + install(DIRECTORY ${PROJECT_BINARY_DIR}/windows_runtime_deps/ + DESTINATION ${CMAKE_INSTALL_BINDIR}) +endif() + if(CLANG_ASAN_UBSAN) message(STATUS "Enabling Clang address sanitizer and undefined behavior sanitizer for nvim.") check_c_compiler_flag(-fno-sanitize-recover=all SANITIZE_RECOVER_ALL) diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c index 55b535c78c..c4415ddf94 100644 --- a/src/nvim/api/buffer.c +++ b/src/nvim/api/buffer.c @@ -14,7 +14,6 @@ #include "nvim/memline.h" #include "nvim/memory.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" #include "nvim/ex_cmds.h" #include "nvim/mark.h" #include "nvim/fileio.h" @@ -32,7 +31,7 @@ /// @param buffer The buffer handle /// @param[out] err Details of an error that may have occurred /// @return The line count -Integer buffer_line_count(Buffer buffer, Error *err) +Integer nvim_buf_line_count(Buffer buffer, Error *err) { buf_T *buf = find_buffer_by_handle(buffer, err); @@ -45,11 +44,11 @@ Integer buffer_line_count(Buffer buffer, Error *err) /// Gets a buffer line /// -/// @deprecated use buffer_get_lines instead. +/// @deprecated use nvim_buf_get_lines instead. /// for positive indices (including 0) use -/// "buffer_get_lines(buffer, index, index+1, true)" +/// "nvim_buf_get_lines(buffer, index, index+1, true)" /// for negative indices use -/// "buffer_get_lines(buffer, index-1, index, true)" +/// "nvim_buf_get_lines(buffer, index-1, index, true)" /// /// @param buffer The buffer handle /// @param index The line index @@ -60,7 +59,7 @@ String buffer_get_line(Buffer buffer, Integer index, Error *err) String rv = { .size = 0 }; index = convert_index(index); - Array slice = buffer_get_lines(buffer, index, index+1, true, err); + Array slice = nvim_buf_get_lines(0, buffer, index, index+1, true, err); if (!err->set && slice.size) { rv = slice.items[0].data.string; @@ -73,11 +72,11 @@ String buffer_get_line(Buffer buffer, Integer index, Error *err) /// Sets a buffer line /// -/// @deprecated use buffer_set_lines instead. +/// @deprecated use nvim_buf_set_lines instead. /// for positive indices use -/// "buffer_set_lines(buffer, index, index+1, true, [line])" +/// "nvim_buf_set_lines(buffer, index, index+1, true, [line])" /// for negative indices use -/// "buffer_set_lines(buffer, index-1, index, true, [line])" +/// "nvim_buf_set_lines(buffer, index-1, index, true, [line])" /// /// @param buffer The buffer handle /// @param index The line index @@ -88,16 +87,16 @@ void buffer_set_line(Buffer buffer, Integer index, String line, Error *err) Object l = STRING_OBJ(line); Array array = { .items = &l, .size = 1 }; index = convert_index(index); - buffer_set_lines(buffer, index, index+1, true, array, err); + nvim_buf_set_lines(0, buffer, index, index+1, true, array, err); } /// Deletes a buffer line /// -/// @deprecated use buffer_set_lines instead. +/// @deprecated use nvim_buf_set_lines instead. /// for positive indices use -/// "buffer_set_lines(buffer, index, index+1, true, [])" +/// "nvim_buf_set_lines(buffer, index, index+1, true, [])" /// for negative indices use -/// "buffer_set_lines(buffer, index-1, index, true, [])" +/// "nvim_buf_set_lines(buffer, index-1, index, true, [])" /// @param buffer The buffer handle /// @param index The line index /// @param[out] err Details of an error that may have occurred @@ -105,12 +104,12 @@ void buffer_del_line(Buffer buffer, Integer index, Error *err) { Array array = ARRAY_DICT_INIT; index = convert_index(index); - buffer_set_lines(buffer, index, index+1, true, array, err); + nvim_buf_set_lines(0, buffer, index, index+1, true, array, err); } /// Retrieves a line range from the buffer /// -/// @deprecated use buffer_get_lines(buffer, newstart, newend, false) +/// @deprecated use nvim_buf_get_lines(buffer, newstart, newend, false) /// where newstart = start + int(not include_start) - int(start < 0) /// newend = end + int(include_end) - int(end < 0) /// int(bool) = 1 if bool is true else 0 @@ -122,15 +121,15 @@ void buffer_del_line(Buffer buffer, Integer index, Error *err) /// @param[out] err Details of an error that may have occurred /// @return An array of lines ArrayOf(String) buffer_get_line_slice(Buffer buffer, - Integer start, - Integer end, - Boolean include_start, - Boolean include_end, - Error *err) + Integer start, + Integer end, + Boolean include_start, + Boolean include_end, + Error *err) { start = convert_index(start) + !include_start; end = convert_index(end) + include_end; - return buffer_get_lines(buffer, start , end, false, err); + return nvim_buf_get_lines(0, buffer, start , end, false, err); } @@ -149,11 +148,12 @@ ArrayOf(String) buffer_get_line_slice(Buffer buffer, /// @param strict_indexing whether out-of-bounds should be an error. /// @param[out] err Details of an error that may have occurred /// @return An array of lines -ArrayOf(String) buffer_get_lines(Buffer buffer, - Integer start, - Integer end, - Boolean strict_indexing, - Error *err) +ArrayOf(String) nvim_buf_get_lines(uint64_t channel_id, + Buffer buffer, + Integer start, + Integer end, + Boolean strict_indexing, + Error *err) { Array rv = ARRAY_DICT_INIT; buf_T *buf = find_buffer_by_handle(buffer, err); @@ -191,7 +191,9 @@ ArrayOf(String) buffer_get_lines(Buffer buffer, Object str = STRING_OBJ(cstr_to_string(bufstr)); // Vim represents NULs as NLs, but this may confuse clients. - strchrsub(str.data.string.data, '\n', '\0'); + if (channel_id != INVALID_CHANNEL) { + strchrsub(str.data.string.data, '\n', '\0'); + } rv.items[i] = str; } @@ -212,7 +214,7 @@ end: /// Replaces a line range on the buffer /// -/// @deprecated use buffer_set_lines(buffer, newstart, newend, false, lines) +/// @deprecated use nvim_buf_set_lines(buffer, newstart, newend, false, lines) /// where newstart = start + int(not include_start) + int(start < 0) /// newend = end + int(include_end) + int(end < 0) /// int(bool) = 1 if bool is true else 0 @@ -226,16 +228,16 @@ end: // array will simply delete the line range) /// @param[out] err Details of an error that may have occurred void buffer_set_line_slice(Buffer buffer, - Integer start, - Integer end, - Boolean include_start, - Boolean include_end, - ArrayOf(String) replacement, - Error *err) + Integer start, + Integer end, + Boolean include_start, + Boolean include_end, + ArrayOf(String) replacement, // NOLINT + Error *err) { start = convert_index(start) + !include_start; end = convert_index(end) + include_end; - buffer_set_lines(buffer, start, end, false, replacement, err); + nvim_buf_set_lines(0, buffer, start, end, false, replacement, err); } @@ -257,12 +259,13 @@ void buffer_set_line_slice(Buffer buffer, /// @param strict_indexing whether out-of-bounds should be an error. /// @param replacement An array of lines to use as replacement /// @param[out] err Details of an error that may have occurred -void buffer_set_lines(Buffer buffer, - Integer start, - Integer end, - Boolean strict_indexing, - ArrayOf(String) replacement, - Error *err) +void nvim_buf_set_lines(uint64_t channel_id, + Buffer buffer, + Integer start, + Integer end, + Boolean strict_indexing, + ArrayOf(String) replacement, // NOLINT + Error *err) { buf_T *buf = find_buffer_by_handle(buffer, err); @@ -309,7 +312,7 @@ void buffer_set_lines(Buffer buffer, // line and convert NULs to newlines to avoid truncation. lines[i] = xmallocz(l.size); for (size_t j = 0; j < l.size; j++) { - if (l.data[j] == '\n') { + if (l.data[j] == '\n' && channel_id != INVALID_CHANNEL) { api_set_error(err, Exception, _("string cannot contain newlines")); new_len = i + 1; goto end; @@ -412,7 +415,7 @@ end: /// @param name The variable name /// @param[out] err Details of an error that may have occurred /// @return The variable value -Object buffer_get_var(Buffer buffer, String name, Error *err) +Object nvim_buf_get_var(Buffer buffer, String name, Error *err) { buf_T *buf = find_buffer_by_handle(buffer, err); @@ -429,6 +432,41 @@ Object buffer_get_var(Buffer buffer, String name, Error *err) /// @param name The variable name /// @param value The variable value /// @param[out] err Details of an error that may have occurred +void nvim_buf_set_var(Buffer buffer, String name, Object value, Error *err) +{ + buf_T *buf = find_buffer_by_handle(buffer, err); + + if (!buf) { + return; + } + + dict_set_value(buf->b_vars, name, value, false, false, err); +} + +/// Removes a buffer-scoped (b:) variable +/// +/// @param buffer The buffer handle +/// @param name The variable name +/// @param[out] err Details of an error that may have occurred +void nvim_buf_del_var(Buffer buffer, String name, Error *err) +{ + buf_T *buf = find_buffer_by_handle(buffer, err); + + if (!buf) { + return; + } + + dict_set_value(buf->b_vars, name, NIL, true, false, err); +} + +/// Sets a buffer-scoped (b:) variable +/// +/// @deprecated +/// +/// @param buffer The buffer handle +/// @param name The variable name +/// @param value The variable value +/// @param[out] err Details of an error that may have occurred /// @return The old value or nil if there was no previous value. /// /// @warning It may return nil if there was no previous value @@ -441,18 +479,17 @@ Object buffer_set_var(Buffer buffer, String name, Object value, Error *err) return (Object) OBJECT_INIT; } - return dict_set_value(buf->b_vars, name, value, false, err); + return dict_set_value(buf->b_vars, name, value, false, true, err); } /// Removes a buffer-scoped (b:) variable /// +/// @deprecated +/// /// @param buffer The buffer handle /// @param name The variable name /// @param[out] err Details of an error that may have occurred -/// @return The old value or nil if there was no previous value. -/// -/// @warning It may return nil if there was no previous value -/// or if previous value was `v:null`. +/// @return The old value Object buffer_del_var(Buffer buffer, String name, Error *err) { buf_T *buf = find_buffer_by_handle(buffer, err); @@ -461,16 +498,17 @@ Object buffer_del_var(Buffer buffer, String name, Error *err) return (Object) OBJECT_INIT; } - return dict_set_value(buf->b_vars, name, NIL, true, err); + return dict_set_value(buf->b_vars, name, NIL, true, true, err); } + /// Gets a buffer option value /// /// @param buffer The buffer handle /// @param name The option name /// @param[out] err Details of an error that may have occurred /// @return The option value -Object buffer_get_option(Buffer buffer, String name, Error *err) +Object nvim_buf_get_option(Buffer buffer, String name, Error *err) { buf_T *buf = find_buffer_by_handle(buffer, err); @@ -488,7 +526,7 @@ Object buffer_get_option(Buffer buffer, String name, Error *err) /// @param name The option name /// @param value The option value /// @param[out] err Details of an error that may have occurred -void buffer_set_option(Buffer buffer, String name, Object value, Error *err) +void nvim_buf_set_option(Buffer buffer, String name, Object value, Error *err) { buf_T *buf = find_buffer_by_handle(buffer, err); @@ -504,7 +542,7 @@ void buffer_set_option(Buffer buffer, String name, Object value, Error *err) /// @param buffer The buffer handle /// @param[out] err Details of an error that may have occurred /// @return The buffer number -Integer buffer_get_number(Buffer buffer, Error *err) +Integer nvim_buf_get_number(Buffer buffer, Error *err) { Integer rv = 0; buf_T *buf = find_buffer_by_handle(buffer, err); @@ -521,7 +559,7 @@ Integer buffer_get_number(Buffer buffer, Error *err) /// @param buffer The buffer handle /// @param[out] err Details of an error that may have occurred /// @return The buffer name -String buffer_get_name(Buffer buffer, Error *err) +String nvim_buf_get_name(Buffer buffer, Error *err) { String rv = STRING_INIT; buf_T *buf = find_buffer_by_handle(buffer, err); @@ -538,7 +576,7 @@ String buffer_get_name(Buffer buffer, Error *err) /// @param buffer The buffer handle /// @param name The buffer name /// @param[out] err Details of an error that may have occurred -void buffer_set_name(Buffer buffer, String name, Error *err) +void nvim_buf_set_name(Buffer buffer, String name, Error *err) { buf_T *buf = find_buffer_by_handle(buffer, err); @@ -567,7 +605,7 @@ void buffer_set_name(Buffer buffer, String name, Error *err) /// /// @param buffer The buffer handle /// @return true if the buffer is valid, false otherwise -Boolean buffer_is_valid(Buffer buffer) +Boolean nvim_buf_is_valid(Buffer buffer) { Error stub = ERROR_INIT; return find_buffer_by_handle(buffer, &stub) != NULL; @@ -575,7 +613,7 @@ Boolean buffer_is_valid(Buffer buffer) /// Inserts a sequence of lines to a buffer at a certain index /// -/// @deprecated use buffer_set_lines(buffer, lnum, lnum, true, lines) +/// @deprecated use nvim_buf_set_lines(buffer, lnum, lnum, true, lines) /// /// @param buffer The buffer handle /// @param lnum Insert the lines after `lnum`. If negative, it will append @@ -589,7 +627,7 @@ void buffer_insert(Buffer buffer, { // "lnum" will be the index of the line after inserting, // no matter if it is negative or not - buffer_set_lines(buffer, lnum, lnum, true, lines, err); + nvim_buf_set_lines(0, buffer, lnum, lnum, true, lines, err); } /// Return a tuple (row,col) representing the position of the named mark @@ -598,7 +636,7 @@ void buffer_insert(Buffer buffer, /// @param name The mark's name /// @param[out] err Details of an error that may have occurred /// @return The (row, col) tuple -ArrayOf(Integer, 2) buffer_get_mark(Buffer buffer, String name, Error *err) +ArrayOf(Integer, 2) nvim_buf_get_mark(Buffer buffer, String name, Error *err) { Array rv = ARRAY_DICT_INIT; buf_T *buf = find_buffer_by_handle(buffer, err); @@ -648,7 +686,7 @@ ArrayOf(Integer, 2) buffer_get_mark(Buffer buffer, String name, Error *err) /// called with src_id = 0, an unique source id is generated and returned. /// Succesive calls can pass in it as "src_id" to add new highlights to the same /// source group. All highlights in the same group can then be cleared with -/// buffer_clear_highlight. If the highlight never will be manually deleted +/// nvim_buf_clear_highlight. If the highlight never will be manually deleted /// pass in -1 for "src_id". /// /// If "hl_group" is the empty string no highlight is added, but a new src_id @@ -666,13 +704,13 @@ ArrayOf(Integer, 2) buffer_get_mark(Buffer buffer, String name, Error *err) /// or -1 to highlight to end of line /// @param[out] err Details of an error that may have occurred /// @return The src_id that was used -Integer buffer_add_highlight(Buffer buffer, - Integer src_id, - String hl_group, - Integer line, - Integer col_start, - Integer col_end, - Error *err) +Integer nvim_buf_add_highlight(Buffer buffer, + Integer src_id, + String hl_group, + Integer line, + Integer col_start, + Integer col_end, + Error *err) { buf_T *buf = find_buffer_by_handle(buffer, err); if (!buf) { @@ -691,7 +729,7 @@ Integer buffer_add_highlight(Buffer buffer, col_end = MAXCOL; } - int hlg_id = syn_name2id((char_u*)hl_group.data); + int hlg_id = syn_name2id((char_u *)(hl_group.data ? hl_group.data : "")); src_id = bufhl_add_hl(buf, (int)src_id, hlg_id, (linenr_T)line+1, (colnr_T)col_start+1, (colnr_T)col_end); return src_id; @@ -708,11 +746,11 @@ Integer buffer_add_highlight(Buffer buffer, /// @param line_end End of range of lines to clear (exclusive) /// or -1 to clear to end of file. /// @param[out] err Details of an error that may have occurred -void buffer_clear_highlight(Buffer buffer, - Integer src_id, - Integer line_start, - Integer line_end, - Error *err) +void nvim_buf_clear_highlight(Buffer buffer, + Integer src_id, + Integer line_start, + Integer line_end, + Error *err) { buf_T *buf = find_buffer_by_handle(buffer, err); if (!buf) { diff --git a/src/nvim/api/dispatch_deprecated.lua b/src/nvim/api/dispatch_deprecated.lua new file mode 100644 index 0000000000..5650a77ac0 --- /dev/null +++ b/src/nvim/api/dispatch_deprecated.lua @@ -0,0 +1,69 @@ +local deprecated_aliases = { + nvim_buf_add_highlight="buffer_add_highlight", + nvim_buf_clear_highlight="buffer_clear_highlight", + nvim_buf_get_lines="buffer_get_lines", + nvim_buf_get_mark="buffer_get_mark", + nvim_buf_get_name="buffer_get_name", + nvim_buf_get_number="buffer_get_number", + nvim_buf_get_option="buffer_get_option", + nvim_buf_get_var="buffer_get_var", + nvim_buf_is_valid="buffer_is_valid", + nvim_buf_line_count="buffer_line_count", + nvim_buf_set_lines="buffer_set_lines", + nvim_buf_set_name="buffer_set_name", + nvim_buf_set_option="buffer_set_option", + nvim_call_function="vim_call_function", + nvim_command="vim_command", + nvim_command_output="vim_command_output", + nvim_del_current_line="vim_del_current_line", + nvim_err_write="vim_err_write", + nvim_err_writeln="vim_report_error", + nvim_eval="vim_eval", + nvim_feedkeys="vim_feedkeys", + nvim_get_api_info="vim_get_api_info", + nvim_get_color_by_name="vim_name_to_color", + nvim_get_color_map="vim_get_color_map", + nvim_get_current_buf="vim_get_current_buffer", + nvim_get_current_line="vim_get_current_line", + nvim_get_current_tabpage="vim_get_current_tabpage", + nvim_get_current_win="vim_get_current_window", + nvim_get_option="vim_get_option", + nvim_get_var="vim_get_var", + nvim_get_vvar="vim_get_vvar", + nvim_input="vim_input", + nvim_list_bufs="vim_get_buffers", + nvim_list_runtime_paths="vim_list_runtime_paths", + nvim_list_tabpages="vim_get_tabpages", + nvim_list_wins="vim_get_windows", + nvim_out_write="vim_out_write", + nvim_replace_termcodes="vim_replace_termcodes", + nvim_set_current_buf="vim_set_current_buffer", + nvim_set_current_dir="vim_change_directory", + nvim_set_current_line="vim_set_current_line", + nvim_set_current_tabpage="vim_set_current_tabpage", + nvim_set_current_win="vim_set_current_window", + nvim_set_option="vim_set_option", + nvim_strwidth="vim_strwidth", + nvim_subscribe="vim_subscribe", + nvim_tabpage_get_var="tabpage_get_var", + nvim_tabpage_get_win="tabpage_get_window", + nvim_tabpage_is_valid="tabpage_is_valid", + nvim_tabpage_list_wins="tabpage_get_windows", + nvim_ui_detach="ui_detach", + nvim_ui_try_resize="ui_try_resize", + nvim_unsubscribe="vim_unsubscribe", + nvim_win_get_buf="window_get_buffer", + nvim_win_get_cursor="window_get_cursor", + nvim_win_get_height="window_get_height", + nvim_win_get_option="window_get_option", + nvim_win_get_position="window_get_position", + nvim_win_get_tabpage="window_get_tabpage", + nvim_win_get_var="window_get_var", + nvim_win_get_width="window_get_width", + nvim_win_is_valid="window_is_valid", + nvim_win_set_cursor="window_set_cursor", + nvim_win_set_height="window_set_height", + nvim_win_set_option="window_set_option", + nvim_win_set_width="window_set_width", +} +return deprecated_aliases diff --git a/src/nvim/api/private/defs.h b/src/nvim/api/private/defs.h index 5fb95a163f..a6710193ff 100644 --- a/src/nvim/api/private/defs.h +++ b/src/nvim/api/private/defs.h @@ -9,13 +9,15 @@ #define STRING_INIT {.data = NULL, .size = 0} #define OBJECT_INIT { .type = kObjectTypeNil } #define ERROR_INIT { .set = false } -#define REMOTE_TYPE(type) typedef uint64_t type +#define REMOTE_TYPE(type) typedef handle_T type #ifdef INCLUDE_GENERATED_DECLARATIONS # define ArrayOf(...) Array # define DictionaryOf(...) Dictionary #endif +typedef int handle_T; + // Basic types typedef enum { kErrorTypeException, @@ -31,6 +33,9 @@ typedef enum { /// Used as the message ID of notifications. #define NO_RESPONSE UINT64_MAX +/// Used as channel_id when the call is local +#define INVALID_CHANNEL UINT64_MAX + typedef struct { ErrorType type; char msg[1024]; diff --git a/src/nvim/api/private/dispatch.h b/src/nvim/api/private/dispatch.h new file mode 100644 index 0000000000..d91456c306 --- /dev/null +++ b/src/nvim/api/private/dispatch.h @@ -0,0 +1,23 @@ +#ifndef NVIM_API_PRIVATE_DISPATCH_H +#define NVIM_API_PRIVATE_DISPATCH_H + +#include "nvim/api/private/defs.h" + +typedef Object (*ApiDispatchWrapper)(uint64_t channel_id, + uint64_t request_id, + Array args, + Error *error); + +/// The rpc_method_handlers table, used in msgpack_rpc_dispatch(), stores +/// functions of this type. +typedef struct { + ApiDispatchWrapper fn; + bool async; // function is always safe to run immediately instead of being + // put in a request queue for handling when nvim waits for input. +} MsgpackRpcRequestHandler; + +#ifdef INCLUDE_GENERATED_DECLARATIONS +# include "api/private/dispatch.h.generated.h" +#endif + +#endif // NVIM_API_PRIVATE_DISPATCH_H diff --git a/src/nvim/api/private/handle.c b/src/nvim/api/private/handle.c index 69df7294ad..acb0fb332a 100644 --- a/src/nvim/api/private/handle.c +++ b/src/nvim/api/private/handle.c @@ -5,30 +5,26 @@ #include "nvim/map.h" #include "nvim/api/private/handle.h" -#define HANDLE_INIT(name) name##_handles = pmap_new(uint64_t)() +#define HANDLE_INIT(name) name##_handles = pmap_new(handle_T)() #define HANDLE_IMPL(type, name) \ - static PMap(uint64_t) *name##_handles = NULL; \ + static PMap(handle_T) *name##_handles = NULL; /* NOLINT */ \ \ - type *handle_get_##name(uint64_t handle) \ + type *handle_get_##name(handle_T handle) \ { \ - return pmap_get(uint64_t)(name##_handles, handle); \ + return pmap_get(handle_T)(name##_handles, handle); \ } \ \ void handle_register_##name(type *name) \ { \ - assert(!name->handle); \ - name->handle = next_handle++; \ - pmap_put(uint64_t)(name##_handles, name->handle, name); \ + pmap_put(handle_T)(name##_handles, name->handle, name); \ } \ \ void handle_unregister_##name(type *name) \ { \ - pmap_del(uint64_t)(name##_handles, name->handle); \ + pmap_del(handle_T)(name##_handles, name->handle); \ } -static uint64_t next_handle = 1; - HANDLE_IMPL(buf_T, buffer) HANDLE_IMPL(win_T, window) HANDLE_IMPL(tabpage_T, tabpage) diff --git a/src/nvim/api/private/handle.h b/src/nvim/api/private/handle.h index 804e266dc3..30bbfbee1b 100644 --- a/src/nvim/api/private/handle.h +++ b/src/nvim/api/private/handle.h @@ -3,9 +3,10 @@ #include "nvim/vim.h" #include "nvim/buffer_defs.h" +#include "nvim/api/private/defs.h" #define HANDLE_DECLS(type, name) \ - type *handle_get_##name(uint64_t handle); \ + type *handle_get_##name(handle_T handle); \ void handle_register_##name(type *name); \ void handle_unregister_##name(type *name); diff --git a/src/nvim/api/private/helpers.c b/src/nvim/api/private/helpers.c index c88bf2127a..fc114bae16 100644 --- a/src/nvim/api/private/helpers.c +++ b/src/nvim/api/private/helpers.c @@ -104,10 +104,11 @@ Object dict_get_value(dict_T *dict, String key, Error *err) /// @param value The new value /// @param del Delete key in place of setting it. Argument `value` is ignored in /// this case. +/// @param retval If true the old value will be converted and returned. /// @param[out] err Details of an error that may have occurred -/// @return the old value, if any +/// @return The old value if `retval` is true and the key was present, else NIL Object dict_set_value(dict_T *dict, String key, Object value, bool del, - Error *err) + bool retval, Error *err) { Object rv = OBJECT_INIT; @@ -135,7 +136,9 @@ Object dict_set_value(dict_T *dict, String key, Object value, bool del, api_set_error(err, Validation, _("Key \"%s\" doesn't exist"), key.data); } else { // Return the old value - rv = vim_to_object(&di->di_tv); + if (retval) { + rv = vim_to_object(&di->di_tv); + } // Delete the entry hashitem_T *hi = hash_find(&dict->dv_hashtab, di->di_key); hash_remove(&dict->dv_hashtab, hi); @@ -156,7 +159,9 @@ Object dict_set_value(dict_T *dict, String key, Object value, bool del, dict_add(dict, di); } else { // Return the old value - rv = vim_to_object(&di->di_tv); + if (retval) { + rv = vim_to_object(&di->di_tv); + } clear_tv(&di->di_tv); } @@ -507,6 +512,10 @@ Object vim_to_object(typval_T *obj) buf_T *find_buffer_by_handle(Buffer buffer, Error *err) { + if (buffer == 0) { + return curbuf; + } + buf_T *rv = handle_get_buffer(buffer); if (!rv) { @@ -518,6 +527,10 @@ buf_T *find_buffer_by_handle(Buffer buffer, Error *err) win_T * find_window_by_handle(Window window, Error *err) { + if (window == 0) { + return curwin; + } + win_T *rv = handle_get_window(window); if (!rv) { @@ -529,6 +542,10 @@ win_T * find_window_by_handle(Window window, Error *err) tabpage_T * find_tab_by_handle(Tabpage tabpage, Error *err) { + if (tabpage == 0) { + return curtab; + } + tabpage_T *rv = handle_get_tabpage(tabpage); if (!rv) { @@ -572,10 +589,16 @@ String cstr_as_string(char *str) FUNC_ATTR_PURE return (String) {.data = str, .size = strlen(str)}; } +/// Converts from type Object to a VimL value. +/// +/// @param obj Object to convert from. +/// @param tv Conversion result is placed here. On failure member v_type is +/// set to VAR_UNKNOWN (no allocation was made for this variable). +/// returns true if conversion is successful, otherwise false. bool object_to_vim(Object obj, typval_T *tv, Error *err) { tv->v_type = VAR_UNKNOWN; - tv->v_lock = 0; + tv->v_lock = VAR_UNLOCKED; switch (obj.type) { case kObjectTypeNil: @@ -616,9 +639,8 @@ bool object_to_vim(Object obj, typval_T *tv, Error *err) } break; - case kObjectTypeArray: - tv->v_type = VAR_LIST; - tv->vval.v_list = list_alloc(); + case kObjectTypeArray: { + list_T *list = list_alloc(); for (uint32_t i = 0; i < obj.data.array.size; i++) { Object item = obj.data.array.items[i]; @@ -627,45 +649,51 @@ bool object_to_vim(Object obj, typval_T *tv, Error *err) if (!object_to_vim(item, &li->li_tv, err)) { // cleanup listitem_free(li); - list_free(tv->vval.v_list, true); + list_free(list, true); return false; } - list_append(tv->vval.v_list, li); + list_append(list, li); } - tv->vval.v_list->lv_refcount++; + list->lv_refcount++; + + tv->v_type = VAR_LIST; + tv->vval.v_list = list; break; + } - case kObjectTypeDictionary: - tv->v_type = VAR_DICT; - tv->vval.v_dict = dict_alloc(); + case kObjectTypeDictionary: { + dict_T *dict = dict_alloc(); for (uint32_t i = 0; i < obj.data.dictionary.size; i++) { KeyValuePair item = obj.data.dictionary.items[i]; String key = item.key; if (key.size == 0) { - api_set_error(err, - Validation, + api_set_error(err, Validation, _("Empty dictionary keys aren't allowed")); // cleanup - dict_free(tv->vval.v_dict, true); + dict_free(dict, true); return false; } - dictitem_T *di = dictitem_alloc((uint8_t *) key.data); + dictitem_T *di = dictitem_alloc((uint8_t *)key.data); if (!object_to_vim(item.value, &di->di_tv, err)) { // cleanup dictitem_free(di); - dict_free(tv->vval.v_dict, true); + dict_free(dict, true); return false; } - dict_add(tv->vval.v_dict, di); + dict_add(dict, di); } - tv->vval.v_dict->dv_refcount++; + dict->dv_refcount++; + + tv->v_type = VAR_DICT; + tv->vval.v_dict = dict; break; + } default: abort(); } @@ -764,12 +792,15 @@ static void init_type_metadata(Dictionary *metadata) Dictionary buffer_metadata = ARRAY_DICT_INIT; PUT(buffer_metadata, "id", INTEGER_OBJ(kObjectTypeBuffer)); + PUT(buffer_metadata, "prefix", STRING_OBJ(cstr_to_string("nvim_buf_"))); Dictionary window_metadata = ARRAY_DICT_INIT; PUT(window_metadata, "id", INTEGER_OBJ(kObjectTypeWindow)); + PUT(window_metadata, "prefix", STRING_OBJ(cstr_to_string("nvim_win_"))); Dictionary tabpage_metadata = ARRAY_DICT_INIT; PUT(tabpage_metadata, "id", INTEGER_OBJ(kObjectTypeTabpage)); + PUT(tabpage_metadata, "prefix", STRING_OBJ(cstr_to_string("nvim_tabpage_"))); PUT(types, "Buffer", DICTIONARY_OBJ(buffer_metadata)); PUT(types, "Window", DICTIONARY_OBJ(window_metadata)); diff --git a/src/nvim/api/tabpage.c b/src/nvim/api/tabpage.c index c8311b0aa0..8b1fb041e2 100644 --- a/src/nvim/api/tabpage.c +++ b/src/nvim/api/tabpage.c @@ -14,7 +14,7 @@ /// @param tabpage The tabpage /// @param[out] err Details of an error that may have occurred /// @return The windows in `tabpage` -ArrayOf(Window) tabpage_get_windows(Tabpage tabpage, Error *err) +ArrayOf(Window) nvim_tabpage_list_wins(Tabpage tabpage, Error *err) { Array rv = ARRAY_DICT_INIT; tabpage_T *tab = find_tab_by_handle(tabpage, err); @@ -43,7 +43,7 @@ ArrayOf(Window) tabpage_get_windows(Tabpage tabpage, Error *err) /// @param name The variable name /// @param[out] err Details of an error that may have occurred /// @return The variable value -Object tabpage_get_var(Tabpage tabpage, String name, Error *err) +Object nvim_tabpage_get_var(Tabpage tabpage, String name, Error *err) { tabpage_T *tab = find_tab_by_handle(tabpage, err); @@ -60,6 +60,44 @@ Object tabpage_get_var(Tabpage tabpage, String name, Error *err) /// @param name The variable name /// @param value The variable value /// @param[out] err Details of an error that may have occurred +void nvim_tabpage_set_var(Tabpage tabpage, + String name, + Object value, + Error *err) +{ + tabpage_T *tab = find_tab_by_handle(tabpage, err); + + if (!tab) { + return; + } + + dict_set_value(tab->tp_vars, name, value, false, false, err); +} + +/// Removes a tab-scoped (t:) variable +/// +/// @param tabpage handle +/// @param name The variable name +/// @param[out] err Details of an error that may have occurred +void nvim_tabpage_del_var(Tabpage tabpage, String name, Error *err) +{ + tabpage_T *tab = find_tab_by_handle(tabpage, err); + + if (!tab) { + return; + } + + dict_set_value(tab->tp_vars, name, NIL, true, false, err); +} + +/// Sets a tab-scoped (t:) variable +/// +/// @deprecated +/// +/// @param tabpage handle +/// @param name The variable name +/// @param value The variable value +/// @param[out] err Details of an error that may have occurred /// @return The old value or nil if there was no previous value. /// /// @warning It may return nil if there was no previous value @@ -72,18 +110,17 @@ Object tabpage_set_var(Tabpage tabpage, String name, Object value, Error *err) return (Object) OBJECT_INIT; } - return dict_set_value(tab->tp_vars, name, value, false, err); + return dict_set_value(tab->tp_vars, name, value, false, true, err); } /// Removes a tab-scoped (t:) variable /// +/// @deprecated +/// /// @param tabpage handle /// @param name The variable name /// @param[out] err Details of an error that may have occurred -/// @return The old value or nil if there was no previous value. -/// -/// @warning It may return nil if there was no previous value -/// or if previous value was `v:null`. +/// @return The old value Object tabpage_del_var(Tabpage tabpage, String name, Error *err) { tabpage_T *tab = find_tab_by_handle(tabpage, err); @@ -92,7 +129,7 @@ Object tabpage_del_var(Tabpage tabpage, String name, Error *err) return (Object) OBJECT_INIT; } - return dict_set_value(tab->tp_vars, name, NIL, true, err); + return dict_set_value(tab->tp_vars, name, NIL, true, true, err); } /// Gets the current window in a tab page @@ -100,7 +137,7 @@ Object tabpage_del_var(Tabpage tabpage, String name, Error *err) /// @param tabpage The tab page handle /// @param[out] err Details of an error that may have occurred /// @return The Window handle -Window tabpage_get_window(Tabpage tabpage, Error *err) +Window nvim_tabpage_get_win(Tabpage tabpage, Error *err) { Window rv = 0; tabpage_T *tab = find_tab_by_handle(tabpage, err); @@ -110,7 +147,7 @@ Window tabpage_get_window(Tabpage tabpage, Error *err) } if (tab == curtab) { - return vim_get_current_window(); + return nvim_get_current_win(); } else { FOR_ALL_WINDOWS_IN_TAB(wp, tab) { if (wp == tab->tp_curwin) { @@ -126,7 +163,7 @@ Window tabpage_get_window(Tabpage tabpage, Error *err) /// /// @param tabpage The tab page handle /// @return true if the tab page is valid, false otherwise -Boolean tabpage_is_valid(Tabpage tabpage) +Boolean nvim_tabpage_is_valid(Tabpage tabpage) { Error stub = ERROR_INIT; return find_tab_by_handle(tabpage, &stub) != NULL; diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c index 1703d49296..56b41f1eea 100644 --- a/src/nvim/api/ui.c +++ b/src/nvim/api/ui.c @@ -8,8 +8,10 @@ #include "nvim/memory.h" #include "nvim/map.h" #include "nvim/msgpack_rpc/channel.h" +#include "nvim/api/ui.h" #include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" +#include "nvim/popupmnu.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "api/ui.c.generated.h" @@ -44,8 +46,9 @@ void remote_ui_disconnect(uint64_t channel_id) xfree(ui); } -void ui_attach(uint64_t channel_id, Integer width, Integer height, - Boolean enable_rgb, Error *err) +void nvim_ui_attach(uint64_t channel_id, Integer width, Integer height, + Dictionary options, Error *err) + FUNC_API_NOEVAL { if (pmap_has(uint64_t)(connected_uis, channel_id)) { api_set_error(err, Exception, _("UI already attached for channel")); @@ -57,14 +60,11 @@ void ui_attach(uint64_t channel_id, Integer width, Integer height, _("Expected width > 0 and height > 0")); return; } - UIData *data = xmalloc(sizeof(UIData)); - data->channel_id = channel_id; - data->buffer = (Array)ARRAY_DICT_INIT; UI *ui = xcalloc(1, sizeof(UI)); ui->width = (int)width; ui->height = (int)height; - ui->rgb = enable_rgb; - ui->data = data; + ui->rgb = true; + ui->pum_external = false; ui->resize = remote_ui_resize; ui->clear = remote_ui_clear; ui->eol_clear = remote_ui_eol_clear; @@ -88,37 +88,100 @@ void ui_attach(uint64_t channel_id, Integer width, Integer height, ui->suspend = remote_ui_suspend; ui->set_title = remote_ui_set_title; ui->set_icon = remote_ui_set_icon; + ui->event = remote_ui_event; + + for (size_t i = 0; i < options.size; i++) { + ui_set_option(ui, options.items[i].key, options.items[i].value, err); + if (err->set) { + xfree(ui); + return; + } + } + + UIData *data = xmalloc(sizeof(UIData)); + data->channel_id = channel_id; + data->buffer = (Array)ARRAY_DICT_INIT; + ui->data = data; + pmap_put(uint64_t)(connected_uis, channel_id, ui); ui_attach_impl(ui); - return; } -void ui_detach(uint64_t channel_id, Error *err) +/// @deprecated +void ui_attach(uint64_t channel_id, Integer width, Integer height, + Boolean enable_rgb, Error *err) +{ + Dictionary opts = ARRAY_DICT_INIT; + PUT(opts, "rgb", BOOLEAN_OBJ(enable_rgb)); + nvim_ui_attach(channel_id, width, height, opts, err); + api_free_dictionary(opts); +} + +void nvim_ui_detach(uint64_t channel_id, Error *err) + FUNC_API_NOEVAL { if (!pmap_has(uint64_t)(connected_uis, channel_id)) { api_set_error(err, Exception, _("UI is not attached for channel")); + return; } remote_ui_disconnect(channel_id); } -Object ui_try_resize(uint64_t channel_id, Integer width, - Integer height, Error *err) + +void nvim_ui_try_resize(uint64_t channel_id, Integer width, + Integer height, Error *err) + FUNC_API_NOEVAL { if (!pmap_has(uint64_t)(connected_uis, channel_id)) { api_set_error(err, Exception, _("UI is not attached for channel")); + return; } if (width <= 0 || height <= 0) { api_set_error(err, Validation, _("Expected width > 0 and height > 0")); - return NIL; + return; } UI *ui = pmap_get(uint64_t)(connected_uis, channel_id); ui->width = (int)width; ui->height = (int)height; ui_refresh(); - return NIL; +} + +void nvim_ui_set_option(uint64_t channel_id, String name, + Object value, Error *error) + FUNC_API_NOEVAL +{ + if (!pmap_has(uint64_t)(connected_uis, channel_id)) { + api_set_error(error, Exception, _("UI is not attached for channel")); + return; + } + UI *ui = pmap_get(uint64_t)(connected_uis, channel_id); + + ui_set_option(ui, name, value, error); + if (!error->set) { + ui_refresh(); + } +} + +static void ui_set_option(UI *ui, String name, Object value, Error *error) { + if (strcmp(name.data, "rgb") == 0) { + if (value.type != kObjectTypeBoolean) { + api_set_error(error, Validation, _("rgb must be a Boolean")); + return; + } + ui->rgb = value.data.boolean; + } else if (strcmp(name.data, "popupmenu_external") == 0) { + if (value.type != kObjectTypeBoolean) { + api_set_error(error, Validation, + _("popupmenu_external must be a Boolean")); + return; + } + ui->pum_external = value.data.boolean; + } else { + api_set_error(error, Validation, _("No such ui option")); + } } static void push_call(UI *ui, char *name, Array args) @@ -341,3 +404,19 @@ static void remote_ui_set_icon(UI *ui, char *icon) ADD(args, STRING_OBJ(cstr_to_string(icon))); push_call(ui, "set_icon", args); } + +static void remote_ui_event(UI *ui, char *name, Array args, bool *args_consumed) +{ + Array my_args = ARRAY_DICT_INIT; + // Objects are currently single-reference + // make a copy, but only if necessary + if (*args_consumed) { + for (size_t i = 0; i < args.size; i++) { + ADD(my_args, copy_object(args.items[i])); + } + } else { + my_args = args; + *args_consumed = true; + } + push_call(ui, name, my_args); +} diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index ac7cc65ee4..d8cdad961b 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -14,6 +14,7 @@ #include "nvim/msgpack_rpc/channel.h" #include "nvim/vim.h" #include "nvim/buffer.h" +#include "nvim/file_search.h" #include "nvim/window.h" #include "nvim/types.h" #include "nvim/ex_docmd.h" @@ -21,7 +22,7 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/eval.h" -#include "nvim/misc2.h" +#include "nvim/option.h" #include "nvim/syntax.h" #include "nvim/getchar.h" #include "nvim/os/input.h" @@ -36,7 +37,7 @@ /// /// @param str The command str /// @param[out] err Details of an error that may have occurred -void vim_command(String str, Error *err) +void nvim_command(String str, Error *err) { // Run the command try_start(); @@ -52,17 +53,13 @@ void vim_command(String str, Error *err) /// @param escape_csi the string needs escaping for K_SPECIAL/CSI bytes /// @see feedkeys() /// @see vim_strsave_escape_csi -void vim_feedkeys(String keys, String mode, Boolean escape_csi) +void nvim_feedkeys(String keys, String mode, Boolean escape_csi) { bool remap = true; bool insert = false; bool typed = false; bool execute = false; - if (keys.size == 0) { - return; - } - for (size_t i = 0; i < mode.size; ++i) { switch (mode.data[i]) { case 'n': remap = false; break; @@ -73,6 +70,10 @@ void vim_feedkeys(String keys, String mode, Boolean escape_csi) } } + if (keys.size == 0 && !execute) { + return; + } + char *keys_esc; if (escape_csi) { // Need to escape K_SPECIAL and CSI before putting the string in the @@ -92,18 +93,23 @@ void vim_feedkeys(String keys, String mode, Boolean escape_csi) typebuf_was_filled = true; } if (execute) { + int save_msg_scroll = msg_scroll; + + /* Avoid a 1 second delay when the keys start Insert mode. */ + msg_scroll = false; exec_normal(true); + msg_scroll |= save_msg_scroll; } } -/// Passes input keys to Neovim. Unlike `vim_feedkeys`, this will use a +/// Passes input keys to Neovim. Unlike `nvim_feedkeys`, this will use a /// lower-level input buffer and the call is not deferred. /// This is the most reliable way to emulate real user input. /// /// @param keys to be typed /// @return The number of bytes actually written, which can be lower than /// requested if the buffer becomes full. -Integer vim_input(String keys) +Integer nvim_input(String keys) FUNC_API_ASYNC { return (Integer)input_enqueue(keys); @@ -113,7 +119,7 @@ Integer vim_input(String keys) /// /// @see replace_termcodes /// @see cpoptions -String vim_replace_termcodes(String str, Boolean from_part, Boolean do_lt, +String nvim_replace_termcodes(String str, Boolean from_part, Boolean do_lt, Boolean special) { if (str.size == 0) { @@ -133,10 +139,10 @@ String vim_replace_termcodes(String str, Boolean from_part, Boolean do_lt, return cstr_as_string(ptr); } -String vim_command_output(String str, Error *err) +String nvim_command_output(String str, Error *err) { do_cmdline_cmd("redir => v:command_output"); - vim_command(str, err); + nvim_command(str, err); do_cmdline_cmd("redir END"); if (err->set) { @@ -153,7 +159,7 @@ String vim_command_output(String str, Error *err) /// @param str The expression str /// @param[out] err Details of an error that may have occurred /// @return The expanded object -Object vim_eval(String str, Error *err) +Object nvim_eval(String str, Error *err) { Object rv = OBJECT_INIT; // Evaluate the expression @@ -180,7 +186,7 @@ Object vim_eval(String str, Error *err) /// @param args Functions arguments packed in an Array /// @param[out] err Details of an error that may have occurred /// @return Result of the function call -Object vim_call_function(String fname, Array args, Error *err) +Object nvim_call_function(String fname, Array args, Error *err) { Object rv = OBJECT_INIT; if (args.size > MAX_FUNC_ARGS) { @@ -229,7 +235,7 @@ free_vim_args: /// @param str Some text /// @param[out] err Details of an error that may have occurred /// @return The number of cells -Integer vim_strwidth(String str, Error *err) +Integer nvim_strwidth(String str, Error *err) { if (str.size > INT_MAX) { api_set_error(err, Validation, _("String length is too high")); @@ -242,7 +248,7 @@ Integer vim_strwidth(String str, Error *err) /// Gets a list of paths contained in 'runtimepath' /// /// @return The list of paths -ArrayOf(String) vim_list_runtime_paths(void) +ArrayOf(String) nvim_list_runtime_paths(void) { Array rv = ARRAY_DICT_INIT; uint8_t *rtp = p_rtp; @@ -283,7 +289,7 @@ ArrayOf(String) vim_list_runtime_paths(void) /// /// @param dir The new working directory /// @param[out] err Details of an error that may have occurred -void vim_change_directory(String dir, Error *err) +void nvim_set_current_dir(String dir, Error *err) { if (dir.size >= MAXPATHL) { api_set_error(err, Validation, _("Directory string is too long")); @@ -311,7 +317,7 @@ void vim_change_directory(String dir, Error *err) /// /// @param[out] err Details of an error that may have occurred /// @return The current line string -String vim_get_current_line(Error *err) +String nvim_get_current_line(Error *err) { return buffer_get_line(curbuf->handle, curwin->w_cursor.lnum - 1, err); } @@ -320,7 +326,7 @@ String vim_get_current_line(Error *err) /// /// @param line The line contents /// @param[out] err Details of an error that may have occurred -void vim_set_current_line(String line, Error *err) +void nvim_set_current_line(String line, Error *err) { buffer_set_line(curbuf->handle, curwin->w_cursor.lnum - 1, line, err); } @@ -328,7 +334,7 @@ void vim_set_current_line(String line, Error *err) /// Deletes the current line /// /// @param[out] err Details of an error that may have occurred -void vim_del_current_line(Error *err) +void nvim_del_current_line(Error *err) { buffer_del_line(curbuf->handle, curwin->w_cursor.lnum - 1, err); } @@ -338,7 +344,7 @@ void vim_del_current_line(Error *err) /// @param name The variable name /// @param[out] err Details of an error that may have occurred /// @return The variable value -Object vim_get_var(String name, Error *err) +Object nvim_get_var(String name, Error *err) { return dict_get_value(&globvardict, name, err); } @@ -348,26 +354,46 @@ Object vim_get_var(String name, Error *err) /// @param name The variable name /// @param value The variable value /// @param[out] err Details of an error that may have occurred +void nvim_set_var(String name, Object value, Error *err) +{ + dict_set_value(&globvardict, name, value, false, false, err); +} + +/// Removes a global variable +/// +/// @param name The variable name +/// @param[out] err Details of an error that may have occurred +void nvim_del_var(String name, Error *err) +{ + dict_set_value(&globvardict, name, NIL, true, false, err); +} + +/// Sets a global variable +/// +/// @deprecated +/// +/// @param name The variable name +/// @param value The variable value +/// @param[out] err Details of an error that may have occurred /// @return The old value or nil if there was no previous value. /// /// @warning It may return nil if there was no previous value /// or if previous value was `v:null`. Object vim_set_var(String name, Object value, Error *err) { - return dict_set_value(&globvardict, name, value, false, err); + return dict_set_value(&globvardict, name, value, false, true, err); } /// Removes a global variable /// +/// @deprecated +/// /// @param name The variable name /// @param[out] err Details of an error that may have occurred -/// @return The old value or nil if there was no previous value. -/// -/// @warning It may return nil if there was no previous value -/// or if previous value was `v:null`. +/// @return The old value Object vim_del_var(String name, Error *err) { - return dict_set_value(&globvardict, name, NIL, true, err); + return dict_set_value(&globvardict, name, NIL, true, true, err); } /// Gets a vim variable @@ -375,7 +401,7 @@ Object vim_del_var(String name, Error *err) /// @param name The variable name /// @param[out] err Details of an error that may have occurred /// @return The variable value -Object vim_get_vvar(String name, Error *err) +Object nvim_get_vvar(String name, Error *err) { return dict_get_value(&vimvardict, name, err); } @@ -385,7 +411,7 @@ Object vim_get_vvar(String name, Error *err) /// @param name The option name /// @param[out] err Details of an error that may have occurred /// @return The option value -Object vim_get_option(String name, Error *err) +Object nvim_get_option(String name, Error *err) { return get_option_from(NULL, SREQ_GLOBAL, name, err); } @@ -395,7 +421,7 @@ Object vim_get_option(String name, Error *err) /// @param name The option name /// @param value The new option value /// @param[out] err Details of an error that may have occurred -void vim_set_option(String name, Object value, Error *err) +void nvim_set_option(String name, Object value, Error *err) { set_option_to(NULL, SREQ_GLOBAL, name, value, err); } @@ -403,7 +429,7 @@ void vim_set_option(String name, Object value, Error *err) /// Writes a message to vim output buffer /// /// @param str The message -void vim_out_write(String str) +void nvim_out_write(String str) { write_msg(str, false); } @@ -411,25 +437,25 @@ void vim_out_write(String str) /// Writes a message to vim error buffer /// /// @param str The message -void vim_err_write(String str) +void nvim_err_write(String str) { write_msg(str, true); } /// Higher level error reporting function that ensures all str contents -/// are written by sending a trailing linefeed to `vim_err_write` +/// are written by sending a trailing linefeed to `nvim_err_write` /// /// @param str The message -void vim_report_error(String str) +void nvim_err_writeln(String str) { - vim_err_write(str); - vim_err_write((String) {.data = "\n", .size = 1}); + nvim_err_write(str); + nvim_err_write((String) { .data = "\n", .size = 1 }); } /// Gets the current list of buffer handles /// /// @return The number of buffers -ArrayOf(Buffer) vim_get_buffers(void) +ArrayOf(Buffer) nvim_list_bufs(void) { Array rv = ARRAY_DICT_INIT; @@ -450,7 +476,7 @@ ArrayOf(Buffer) vim_get_buffers(void) /// Gets the current buffer /// /// @reqturn The buffer handle -Buffer vim_get_current_buffer(void) +Buffer nvim_get_current_buf(void) { return curbuf->handle; } @@ -459,7 +485,7 @@ Buffer vim_get_current_buffer(void) /// /// @param id The buffer handle /// @param[out] err Details of an error that may have occurred -void vim_set_current_buffer(Buffer buffer, Error *err) +void nvim_set_current_buf(Buffer buffer, Error *err) { buf_T *buf = find_buffer_by_handle(buffer, err); @@ -472,7 +498,7 @@ void vim_set_current_buffer(Buffer buffer, Error *err) if (!try_end(err) && result == FAIL) { api_set_error(err, Exception, - _("Failed to switch to buffer %" PRIu64), + _("Failed to switch to buffer %d"), buffer); } } @@ -480,7 +506,7 @@ void vim_set_current_buffer(Buffer buffer, Error *err) /// Gets the current list of window handles /// /// @return The number of windows -ArrayOf(Window) vim_get_windows(void) +ArrayOf(Window) nvim_list_wins(void) { Array rv = ARRAY_DICT_INIT; @@ -501,7 +527,7 @@ ArrayOf(Window) vim_get_windows(void) /// Gets the current window /// /// @return The window handle -Window vim_get_current_window(void) +Window nvim_get_current_win(void) { return curwin->handle; } @@ -509,7 +535,7 @@ Window vim_get_current_window(void) /// Sets the current window /// /// @param handle The window handle -void vim_set_current_window(Window window, Error *err) +void nvim_set_current_win(Window window, Error *err) { win_T *win = find_window_by_handle(window, err); @@ -522,7 +548,7 @@ void vim_set_current_window(Window window, Error *err) if (!try_end(err) && win != curwin) { api_set_error(err, Exception, - _("Failed to switch to window %" PRIu64), + _("Failed to switch to window %d"), window); } } @@ -530,7 +556,7 @@ void vim_set_current_window(Window window, Error *err) /// Gets the current list of tabpage handles /// /// @return The number of tab pages -ArrayOf(Tabpage) vim_get_tabpages(void) +ArrayOf(Tabpage) nvim_list_tabpages(void) { Array rv = ARRAY_DICT_INIT; @@ -551,7 +577,7 @@ ArrayOf(Tabpage) vim_get_tabpages(void) /// Gets the current tab page /// /// @return The tab page handle -Tabpage vim_get_current_tabpage(void) +Tabpage nvim_get_current_tabpage(void) { return curtab->handle; } @@ -560,7 +586,7 @@ Tabpage vim_get_current_tabpage(void) /// /// @param handle The tab page handle /// @param[out] err Details of an error that may have occurred -void vim_set_current_tabpage(Tabpage tabpage, Error *err) +void nvim_set_current_tabpage(Tabpage tabpage, Error *err) { tabpage_T *tp = find_tab_by_handle(tabpage, err); @@ -573,7 +599,7 @@ void vim_set_current_tabpage(Tabpage tabpage, Error *err) if (!try_end(err) && tp != curtab) { api_set_error(err, Exception, - _("Failed to switch to tabpage %" PRIu64), + _("Failed to switch to tabpage %d"), tabpage); } } @@ -582,7 +608,8 @@ void vim_set_current_tabpage(Tabpage tabpage, Error *err) /// /// @param channel_id The channel id (passed automatically by the dispatcher) /// @param event The event type string -void vim_subscribe(uint64_t channel_id, String event) +void nvim_subscribe(uint64_t channel_id, String event) + FUNC_API_NOEVAL { size_t length = (event.size < METHOD_MAXLEN ? event.size : METHOD_MAXLEN); char e[METHOD_MAXLEN + 1]; @@ -595,7 +622,8 @@ void vim_subscribe(uint64_t channel_id, String event) /// /// @param channel_id The channel id (passed automatically by the dispatcher) /// @param event The event type string -void vim_unsubscribe(uint64_t channel_id, String event) +void nvim_unsubscribe(uint64_t channel_id, String event) + FUNC_API_NOEVAL { size_t length = (event.size < METHOD_MAXLEN ? event.size : @@ -606,12 +634,12 @@ void vim_unsubscribe(uint64_t channel_id, String event) channel_unsubscribe(channel_id, e); } -Integer vim_name_to_color(String name) +Integer nvim_get_color_by_name(String name) { return name_to_color((uint8_t *)name.data); } -Dictionary vim_get_color_map(void) +Dictionary nvim_get_color_map(void) { Dictionary colors = ARRAY_DICT_INIT; @@ -623,8 +651,8 @@ Dictionary vim_get_color_map(void) } -Array vim_get_api_info(uint64_t channel_id) - FUNC_API_ASYNC +Array nvim_get_api_info(uint64_t channel_id) + FUNC_API_ASYNC FUNC_API_NOEVAL { Array rv = ARRAY_DICT_INIT; diff --git a/src/nvim/api/window.c b/src/nvim/api/window.c index f644453358..166e43f698 100644 --- a/src/nvim/api/window.c +++ b/src/nvim/api/window.c @@ -11,7 +11,6 @@ #include "nvim/window.h" #include "nvim/screen.h" #include "nvim/move.h" -#include "nvim/misc2.h" /// Gets the current buffer in a window @@ -19,7 +18,7 @@ /// @param window The window handle /// @param[out] err Details of an error that may have occurred /// @return The buffer handle -Buffer window_get_buffer(Window window, Error *err) +Buffer nvim_win_get_buf(Window window, Error *err) { win_T *win = find_window_by_handle(window, err); @@ -35,7 +34,7 @@ Buffer window_get_buffer(Window window, Error *err) /// @param window The window handle /// @param[out] err Details of an error that may have occurred /// @return the (row, col) tuple -ArrayOf(Integer, 2) window_get_cursor(Window window, Error *err) +ArrayOf(Integer, 2) nvim_win_get_cursor(Window window, Error *err) { Array rv = ARRAY_DICT_INIT; win_T *win = find_window_by_handle(window, err); @@ -53,7 +52,7 @@ ArrayOf(Integer, 2) window_get_cursor(Window window, Error *err) /// @param window The window handle /// @param pos the (row, col) tuple representing the new position /// @param[out] err Details of an error that may have occurred -void window_set_cursor(Window window, ArrayOf(Integer, 2) pos, Error *err) +void nvim_win_set_cursor(Window window, ArrayOf(Integer, 2) pos, Error *err) { win_T *win = find_window_by_handle(window, err); @@ -99,7 +98,7 @@ void window_set_cursor(Window window, ArrayOf(Integer, 2) pos, Error *err) /// @param window The window handle /// @param[out] err Details of an error that may have occurred /// @return the height in rows -Integer window_get_height(Window window, Error *err) +Integer nvim_win_get_height(Window window, Error *err) { win_T *win = find_window_by_handle(window, err); @@ -116,7 +115,7 @@ Integer window_get_height(Window window, Error *err) /// @param window The window handle /// @param height the new height in rows /// @param[out] err Details of an error that may have occurred -void window_set_height(Window window, Integer height, Error *err) +void nvim_win_set_height(Window window, Integer height, Error *err) { win_T *win = find_window_by_handle(window, err); @@ -142,7 +141,7 @@ void window_set_height(Window window, Integer height, Error *err) /// @param window The window handle /// @param[out] err Details of an error that may have occurred /// @return the width in columns -Integer window_get_width(Window window, Error *err) +Integer nvim_win_get_width(Window window, Error *err) { win_T *win = find_window_by_handle(window, err); @@ -159,7 +158,7 @@ Integer window_get_width(Window window, Error *err) /// @param window The window handle /// @param width the new width in columns /// @param[out] err Details of an error that may have occurred -void window_set_width(Window window, Integer width, Error *err) +void nvim_win_set_width(Window window, Integer width, Error *err) { win_T *win = find_window_by_handle(window, err); @@ -186,7 +185,7 @@ void window_set_width(Window window, Integer width, Error *err) /// @param name The variable name /// @param[out] err Details of an error that may have occurred /// @return The variable value -Object window_get_var(Window window, String name, Error *err) +Object nvim_win_get_var(Window window, String name, Error *err) { win_T *win = find_window_by_handle(window, err); @@ -203,6 +202,41 @@ Object window_get_var(Window window, String name, Error *err) /// @param name The variable name /// @param value The variable value /// @param[out] err Details of an error that may have occurred +void nvim_win_set_var(Window window, String name, Object value, Error *err) +{ + win_T *win = find_window_by_handle(window, err); + + if (!win) { + return; + } + + dict_set_value(win->w_vars, name, value, false, false, err); +} + +/// Removes a window-scoped (w:) variable +/// +/// @param window The window handle +/// @param name The variable name +/// @param[out] err Details of an error that may have occurred +void nvim_win_del_var(Window window, String name, Error *err) +{ + win_T *win = find_window_by_handle(window, err); + + if (!win) { + return; + } + + dict_set_value(win->w_vars, name, NIL, true, false, err); +} + +/// Sets a window-scoped (w:) variable +/// +/// @deprecated +/// +/// @param window The window handle +/// @param name The variable name +/// @param value The variable value +/// @param[out] err Details of an error that may have occurred /// @return The old value or nil if there was no previous value. /// /// @warning It may return nil if there was no previous value @@ -215,18 +249,17 @@ Object window_set_var(Window window, String name, Object value, Error *err) return (Object) OBJECT_INIT; } - return dict_set_value(win->w_vars, name, value, false, err); + return dict_set_value(win->w_vars, name, value, false, true, err); } /// Removes a window-scoped (w:) variable /// +/// @deprecated +/// /// @param window The window handle /// @param name The variable name /// @param[out] err Details of an error that may have occurred -/// @return The old value or nil if there was no previous value. -/// -/// @warning It may return nil if there was no previous value -/// or if previous value was `v:null`. +/// @return The old value Object window_del_var(Window window, String name, Error *err) { win_T *win = find_window_by_handle(window, err); @@ -235,7 +268,7 @@ Object window_del_var(Window window, String name, Error *err) return (Object) OBJECT_INIT; } - return dict_set_value(win->w_vars, name, NIL, true, err); + return dict_set_value(win->w_vars, name, NIL, true, true, err); } /// Gets a window option value @@ -244,7 +277,7 @@ Object window_del_var(Window window, String name, Error *err) /// @param name The option name /// @param[out] err Details of an error that may have occurred /// @return The option value -Object window_get_option(Window window, String name, Error *err) +Object nvim_win_get_option(Window window, String name, Error *err) { win_T *win = find_window_by_handle(window, err); @@ -262,7 +295,7 @@ Object window_get_option(Window window, String name, Error *err) /// @param name The option name /// @param value The option value /// @param[out] err Details of an error that may have occurred -void window_set_option(Window window, String name, Object value, Error *err) +void nvim_win_set_option(Window window, String name, Object value, Error *err) { win_T *win = find_window_by_handle(window, err); @@ -278,7 +311,7 @@ void window_set_option(Window window, String name, Object value, Error *err) /// @param window The window handle /// @param[out] err Details of an error that may have occurred /// @return The (row, col) tuple with the window position -ArrayOf(Integer, 2) window_get_position(Window window, Error *err) +ArrayOf(Integer, 2) nvim_win_get_position(Window window, Error *err) { Array rv = ARRAY_DICT_INIT; win_T *win = find_window_by_handle(window, err); @@ -296,7 +329,7 @@ ArrayOf(Integer, 2) window_get_position(Window window, Error *err) /// @param window The window handle /// @param[out] err Details of an error that may have occurred /// @return The tab page that contains the window -Tabpage window_get_tabpage(Window window, Error *err) +Tabpage nvim_win_get_tabpage(Window window, Error *err) { Tabpage rv = 0; win_T *win = find_window_by_handle(window, err); @@ -312,7 +345,7 @@ Tabpage window_get_tabpage(Window window, Error *err) /// /// @param window The window handle /// @return true if the window is valid, false otherwise -Boolean window_is_valid(Window window) +Boolean nvim_win_is_valid(Window window) { Error stub = ERROR_INIT; return find_window_by_handle(window, &stub) != NULL; diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index c934d44e70..b42ad1c18a 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -36,6 +36,7 @@ #include "nvim/ex_eval.h" #include "nvim/ex_getln.h" #include "nvim/fileio.h" +#include "nvim/file_search.h" #include "nvim/fold.h" #include "nvim/getchar.h" #include "nvim/hashtab.h" @@ -48,7 +49,6 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" #include "nvim/garray.h" #include "nvim/move.h" #include "nvim/option.h" @@ -1397,8 +1397,7 @@ buflist_new ( } if (buf != curbuf || curbuf == NULL) { buf = xcalloc(1, sizeof(buf_T)); - handle_register_buffer(buf); - /* init b: variables */ + // init b: variables buf->b_vars = dict_alloc(); init_var_dict(buf->b_vars, &buf->b_bufvar, VAR_SCOPE); } @@ -1451,11 +1450,12 @@ buflist_new ( lastbuf = buf; buf->b_fnum = top_file_num++; - if (top_file_num < 0) { /* wrap around (may cause duplicates) */ + handle_register_buffer(buf); + if (top_file_num < 0) { // wrap around (may cause duplicates) EMSG(_("W14: Warning: List of file names overflow")); if (emsg_silent == 0) { ui_flush(); - os_delay(3000L, true); /* make sure it is noticed */ + os_delay(3000L, true); // make sure it is noticed } top_file_num = 1; } @@ -5231,12 +5231,12 @@ wipe_buffer ( int aucmd /* When TRUE trigger autocommands. */ ) { - if (buf->b_fnum == top_file_num - 1) - --top_file_num; - - if (!aucmd) /* Don't trigger BufDelete autocommands here. */ + if (!aucmd) { + // Don't trigger BufDelete autocommands here. block_autocmds(); - close_buffer(NULL, buf, DOBUF_WIPE, FALSE); - if (!aucmd) + } + close_buffer(NULL, buf, DOBUF_WIPE, false); + if (!aucmd) { unblock_autocmds(); + } } diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h index b515c4e1e4..ab5987612c 100644 --- a/src/nvim/buffer_defs.h +++ b/src/nvim/buffer_defs.h @@ -461,9 +461,10 @@ typedef struct { */ struct file_buffer { - uint64_t handle; // unique identifier for the buffer - memline_T b_ml; /* associated memline (also contains line - count) */ + handle_T handle; // unique id for the buffer (buffer number) +#define b_fnum handle + + memline_T b_ml; // associated memline (also contains line count buf_T *b_next; /* links in list of buffers */ buf_T *b_prev; @@ -487,8 +488,6 @@ struct file_buffer { bool file_id_valid; FileID file_id; - int b_fnum; /* buffer number for this file. */ - bool b_changed; /* 'modified': Set to true if something in the file has been changed and not written out. */ int b_changedtick; /* incremented for each change, also for undo */ @@ -799,28 +798,27 @@ struct diffblock_S { # define SNAP_AUCMD_IDX 1 # define SNAP_COUNT 2 -/* - * Tab pages point to the top frame of each tab page. - * Note: Most values are NOT valid for the current tab page! Use "curwin", - * "firstwin", etc. for that. "tp_topframe" is always valid and can be - * compared against "topframe" to find the current tab page. - */ +/// Tab pages point to the top frame of each tab page. +/// Note: Most values are NOT valid for the current tab page! Use "curwin", +/// "firstwin", etc. for that. "tp_topframe" is always valid and can be +/// compared against "topframe" to find the current tab page. typedef struct tabpage_S tabpage_T; struct tabpage_S { - uint64_t handle; - tabpage_T *tp_next; /* next tabpage or NULL */ - frame_T *tp_topframe; /* topframe for the windows */ - win_T *tp_curwin; /* current window in this Tab page */ - win_T *tp_prevwin; /* previous window in this Tab page */ - win_T *tp_firstwin; /* first window in this Tab page */ - win_T *tp_lastwin; /* last window in this Tab page */ - long tp_old_Rows; /* Rows when Tab page was left */ - long tp_old_Columns; /* Columns when Tab page was left */ - long tp_ch_used; /* value of 'cmdheight' when frame size - was set */ + handle_T handle; + tabpage_T *tp_next; ///< next tabpage or NULL + frame_T *tp_topframe; ///< topframe for the windows + win_T *tp_curwin; ///< current window in this Tab page + win_T *tp_prevwin; ///< previous window in this Tab page + win_T *tp_firstwin; ///< first window in this Tab page + win_T *tp_lastwin; ///< last window in this Tab page + long tp_old_Rows; ///< Rows when Tab page was left + long tp_old_Columns; ///< Columns when Tab page was left + long tp_ch_used; ///< value of 'cmdheight' when frame size + ///< was set + diff_T *tp_first_diff; buf_T *(tp_diffbuf[DB_COUNT]); - int tp_diff_invalid; ///< list of diffs is outdated */ + int tp_diff_invalid; ///< list of diffs is outdated frame_T *(tp_snapshot[SNAP_COUNT]); ///< window layout snapshots dictitem_T tp_winvar; ///< variable for "t:" Dictionary dict_T *tp_vars; ///< internal variables, local to tab page @@ -936,9 +934,10 @@ struct matchitem { * All row numbers are relative to the start of the window, except w_winrow. */ struct window_S { - uint64_t handle; - buf_T *w_buffer; /* buffer we are a window into (used - often, keep it the first item!) */ + handle_T handle; ///< unique identifier for the window + + buf_T *w_buffer; ///< buffer we are a window into (used + ///< often, keep it the first item!) synblock_T *w_s; /* for :ownsyntax */ diff --git a/src/nvim/charset.c b/src/nvim/charset.c index 22ca0fb0cc..78f5d96fc7 100644 --- a/src/nvim/charset.c +++ b/src/nvim/charset.c @@ -19,10 +19,11 @@ #include "nvim/memline.h" #include "nvim/memory.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" #include "nvim/garray.h" #include "nvim/move.h" +#include "nvim/option.h" #include "nvim/os_unix.h" +#include "nvim/state.h" #include "nvim/strings.h" #include "nvim/path.h" @@ -1739,8 +1740,11 @@ char_u* skiptowhite_esc(char_u *p) { /// @return Number read from the string. intmax_t getdigits(char_u **pp) { + errno = 0; intmax_t number = strtoimax((char *)*pp, (char **)pp, 10); - assert(errno != ERANGE); + if (number == INTMAX_MAX || number == INTMAX_MIN) { + assert(errno != ERANGE); + } return number; } diff --git a/src/nvim/cursor.c b/src/nvim/cursor.c index afaa6022c9..3ba9da34f2 100644 --- a/src/nvim/cursor.c +++ b/src/nvim/cursor.c @@ -9,6 +9,7 @@ #include "nvim/misc1.h" #include "nvim/move.h" #include "nvim/screen.h" +#include "nvim/state.h" #include "nvim/vim.h" #include "nvim/ascii.h" diff --git a/src/nvim/cursor.h b/src/nvim/cursor.h index 09cc5a813c..1cbe8a609e 100644 --- a/src/nvim/cursor.h +++ b/src/nvim/cursor.h @@ -4,7 +4,6 @@ #include <stdbool.h> #include "nvim/vim.h" -#include "nvim/misc2.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "cursor.h.generated.h" diff --git a/src/nvim/cursor_shape.c b/src/nvim/cursor_shape.c index 87425ca567..b50462664c 100644 --- a/src/nvim/cursor_shape.c +++ b/src/nvim/cursor_shape.c @@ -3,7 +3,6 @@ #include "nvim/vim.h" #include "nvim/ascii.h" #include "nvim/cursor_shape.h" -#include "nvim/misc2.h" #include "nvim/ex_getln.h" #include "nvim/charset.h" #include "nvim/strings.h" diff --git a/src/nvim/diff.c b/src/nvim/diff.c index 4826e70727..ef5acf4845 100644 --- a/src/nvim/diff.c +++ b/src/nvim/diff.c @@ -21,7 +21,6 @@ #include "nvim/memline.h" #include "nvim/message.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" #include "nvim/memory.h" #include "nvim/move.h" #include "nvim/normal.h" diff --git a/src/nvim/digraph.c b/src/nvim/digraph.c index aad145b3e5..6ba6e659a6 100644 --- a/src/nvim/digraph.c +++ b/src/nvim/digraph.c @@ -17,7 +17,6 @@ #include "nvim/getchar.h" #include "nvim/mbyte.h" #include "nvim/message.h" -#include "nvim/misc2.h" #include "nvim/memory.h" #include "nvim/garray.h" #include "nvim/normal.h" @@ -1691,8 +1690,11 @@ static void printdigraph(digr_T *dp) msg_putchar('\n'); } - if (msg_col) { - while (msg_col % list_width != 0) { + + // Make msg_col a multiple of list_width by using spaces. + if (msg_col % list_width != 0) { + int spaces = (msg_col / list_width + 1) * list_width - msg_col; + while (spaces--) { msg_putchar(' '); } } diff --git a/src/nvim/edit.c b/src/nvim/edit.c index 98ec9ae280..18d5ea533d 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -29,7 +29,6 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" #include "nvim/keymap.h" #include "nvim/move.h" #include "nvim/normal.h" @@ -463,6 +462,8 @@ static void insert_enter(InsertState *s) o_lnum = curwin->w_cursor.lnum; } + foldUpdateAll(curwin); + foldOpenCursor(); if (s->cmdchar != 'r' && s->cmdchar != 'v') { apply_autocmds(EVENT_INSERTLEAVE, NULL, NULL, false, curbuf); } @@ -2472,6 +2473,7 @@ void ins_compl_show_pum(void) int cur = -1; colnr_T col; int lead_len = 0; + bool array_changed = false; if (!pum_wanted() || !pum_enough_matches()) return; @@ -2483,7 +2485,8 @@ void ins_compl_show_pum(void) update_screen(0); if (compl_match_array == NULL) { - /* Need to build the popup menu list. */ + array_changed = true; + // Need to build the popup menu list. compl_match_arraysize = 0; compl = compl_first_match; /* @@ -2586,7 +2589,7 @@ void ins_compl_show_pum(void) // Use the cursor to get all wrapping and other settings right. col = curwin->w_cursor.col; curwin->w_cursor.col = compl_col; - pum_display(compl_match_array, compl_match_arraysize, cur); + pum_display(compl_match_array, compl_match_arraysize, cur, array_changed); curwin->w_cursor.col = col; } @@ -3530,21 +3533,15 @@ int ins_compl_add_tv(typval_T *tv, int dir) char_u *(cptext[CPT_COUNT]); if (tv->v_type == VAR_DICT && tv->vval.v_dict != NULL) { - word = get_dict_string(tv->vval.v_dict, (char_u *)"word", FALSE); - cptext[CPT_ABBR] = get_dict_string(tv->vval.v_dict, - (char_u *)"abbr", FALSE); - cptext[CPT_MENU] = get_dict_string(tv->vval.v_dict, - (char_u *)"menu", FALSE); - cptext[CPT_KIND] = get_dict_string(tv->vval.v_dict, - (char_u *)"kind", FALSE); - cptext[CPT_INFO] = get_dict_string(tv->vval.v_dict, - (char_u *)"info", FALSE); - if (get_dict_string(tv->vval.v_dict, (char_u *)"icase", FALSE) != NULL) - icase = get_dict_number(tv->vval.v_dict, (char_u *)"icase"); - if (get_dict_string(tv->vval.v_dict, (char_u *)"dup", FALSE) != NULL) - adup = get_dict_number(tv->vval.v_dict, (char_u *)"dup"); - if (get_dict_string(tv->vval.v_dict, (char_u *)"empty", FALSE) != NULL) - aempty = get_dict_number(tv->vval.v_dict, (char_u *)"empty"); + word = get_dict_string(tv->vval.v_dict, "word", false); + cptext[CPT_ABBR] = get_dict_string(tv->vval.v_dict, "abbr", false); + cptext[CPT_MENU] = get_dict_string(tv->vval.v_dict, "menu", false); + cptext[CPT_KIND] = get_dict_string(tv->vval.v_dict, "kind", false); + cptext[CPT_INFO] = get_dict_string(tv->vval.v_dict, "info", false); + + icase = get_dict_number(tv->vval.v_dict, "icase"); + adup = get_dict_number(tv->vval.v_dict, "dup"); + aempty = get_dict_number(tv->vval.v_dict, "empty"); } else { word = get_tv_string_chk(tv); memset(cptext, 0, sizeof(cptext)); diff --git a/src/nvim/eval.c b/src/nvim/eval.c index a5333d74be..c762ce9fff 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -44,7 +44,6 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" #include "nvim/keymap.h" #include "nvim/map.h" #include "nvim/file_search.h" @@ -63,6 +62,7 @@ #include "nvim/search.h" #include "nvim/sha256.h" #include "nvim/spell.h" +#include "nvim/state.h" #include "nvim/strings.h" #include "nvim/syntax.h" #include "nvim/tag.h" @@ -90,6 +90,8 @@ #include "nvim/os/dl.h" #include "nvim/os/input.h" #include "nvim/event/loop.h" +#include "nvim/lib/kvec.h" +#include "nvim/lib/khash.h" #include "nvim/lib/queue.h" #include "nvim/eval/typval_encode.h" @@ -408,6 +410,7 @@ typedef struct { Terminal *term; bool stopped; bool exited; + bool rpc; int refcount; ufunc_T *on_stdout, *on_stderr, *on_exit; dict_T *self; @@ -435,11 +438,28 @@ typedef struct { TimeWatcher tw; int timer_id; int repeat_count; + int refcount; long timeout; bool stopped; ufunc_T *callback; } timer_T; +typedef void (*FunPtr)(void); + +/// Prototype of C function that implements VimL function +typedef void (*VimLFunc)(typval_T *args, typval_T *rvar, FunPtr data); + +/// Structure holding VimL function definition +typedef struct fst { + char *name; ///< Name of the function. + uint8_t min_argc; ///< Minimal number of arguments. + uint8_t max_argc; ///< Maximal number of arguments. + VimLFunc func; ///< Function implementation. + FunPtr data; ///< Userdata for function implementation. +} VimLFuncDef; + +KHASH_MAP_INIT_STR(functions, VimLFuncDef) + #ifdef INCLUDE_GENERATED_DECLARATIONS # include "eval.c.generated.h" #endif @@ -447,8 +467,7 @@ typedef struct { #define FNE_INCL_BR 1 /* find_name_end(): include [] in name */ #define FNE_CHECK_START 2 /* find_name_end(): check name starts with valid character */ -static uint64_t current_job_id = 1; -static PMap(uint64_t) *jobs = NULL; +static PMap(uint64_t) *jobs = NULL; static uint64_t last_timer_id = 0; static PMap(uint64_t) *timers = NULL; @@ -6481,19 +6500,20 @@ static ufunc_T *find_ufunc(uint8_t *name) return rv; } -/* - * Get a string item from a dictionary. - * When "save" is TRUE allocate memory for it. - * Returns NULL if the entry doesn't exist. - */ -char_u *get_dict_string(dict_T *d, char_u *key, int save) +/// Get a string item from a dictionary. +/// +/// @param save whether memory should be allocated for the return value +/// +/// @return the entry or NULL if the entry doesn't exist. +char_u *get_dict_string(dict_T *d, char *key, bool save) { dictitem_T *di; char_u *s; - di = dict_find(d, key, -1); - if (di == NULL) + di = dict_find(d, (char_u *)key, -1); + if (di == NULL) { return NULL; + } s = get_tv_string(&di->di_tv); if (save) { s = vim_strsave(s); @@ -6501,15 +6521,15 @@ char_u *get_dict_string(dict_T *d, char_u *key, int save) return s; } -/* - * Get a number item from a dictionary. - * Returns 0 if the entry doesn't exist. - */ -long get_dict_number(dict_T *d, char_u *key) +/// Get a number item from a dictionary. +/// +/// @return the entry or 0 if the entry doesn't exist. +long get_dict_number(dict_T *d, char *key) { - dictitem_T *di = dict_find(d, key, -1); - if (di == NULL) + dictitem_T *di = dict_find(d, (char_u *)key, -1); + if (di == NULL) { return 0; + } return get_tv_number(&di->di_tv); } @@ -6679,327 +6699,9 @@ static int get_env_tv(char_u **arg, typval_T *rettv, int evaluate) return OK; } -/* - * Array with names and number of arguments of all internal functions - * MUST BE KEPT SORTED IN strcmp() ORDER FOR BINARY SEARCH! - */ -static struct fst { - char *f_name; /* function name */ - char f_min_argc; /* minimal number of arguments */ - char f_max_argc; /* maximal number of arguments */ - void (*f_func)(typval_T *args, typval_T *rvar); - /* implementation of function */ -} functions[] = -{ - { "abs", 1, 1, f_abs }, - { "acos", 1, 1, f_acos }, // WJMc - { "add", 2, 2, f_add }, - { "and", 2, 2, f_and }, - { "api_info", 0, 0, f_api_info }, - { "append", 2, 2, f_append }, - { "argc", 0, 0, f_argc }, - { "argidx", 0, 0, f_argidx }, - { "arglistid", 0, 2, f_arglistid }, - { "argv", 0, 1, f_argv }, - { "asin", 1, 1, f_asin }, // WJMc - { "assert_equal", 2, 3, f_assert_equal }, - { "assert_exception", 1, 2, f_assert_exception }, - { "assert_fails", 1, 2, f_assert_fails }, - { "assert_false", 1, 2, f_assert_false }, - { "assert_match", 2, 3, f_assert_match }, - { "assert_notequal", 2, 3, f_assert_notequal }, - { "assert_notmatch", 2, 3, f_assert_notmatch }, - { "assert_true", 1, 2, f_assert_true }, - { "atan", 1, 1, f_atan }, - { "atan2", 2, 2, f_atan2 }, - { "browse", 4, 4, f_browse }, - { "browsedir", 2, 2, f_browsedir }, - { "bufexists", 1, 1, f_bufexists }, - { "buffer_exists", 1, 1, f_bufexists }, // obsolete - { "buffer_name", 1, 1, f_bufname }, // obsolete - { "buffer_number", 1, 1, f_bufnr }, // obsolete - { "buflisted", 1, 1, f_buflisted }, - { "bufloaded", 1, 1, f_bufloaded }, - { "bufname", 1, 1, f_bufname }, - { "bufnr", 1, 2, f_bufnr }, - { "bufwinnr", 1, 1, f_bufwinnr }, - { "byte2line", 1, 1, f_byte2line }, - { "byteidx", 2, 2, f_byteidx }, - { "byteidxcomp", 2, 2, f_byteidxcomp }, - { "call", 2, 3, f_call }, - { "ceil", 1, 1, f_ceil }, - { "changenr", 0, 0, f_changenr }, - { "char2nr", 1, 2, f_char2nr }, - { "cindent", 1, 1, f_cindent }, - { "clearmatches", 0, 0, f_clearmatches }, - { "col", 1, 1, f_col }, - { "complete", 2, 2, f_complete }, - { "complete_add", 1, 1, f_complete_add }, - { "complete_check", 0, 0, f_complete_check }, - { "confirm", 1, 4, f_confirm }, - { "copy", 1, 1, f_copy }, - { "cos", 1, 1, f_cos }, - { "cosh", 1, 1, f_cosh }, - { "count", 2, 4, f_count }, - { "cscope_connection", 0, 3, f_cscope_connection }, - { "cursor", 1, 3, f_cursor }, - { "deepcopy", 1, 2, f_deepcopy }, - { "delete", 1, 2, f_delete }, - { "dictwatcheradd", 3, 3, f_dictwatcheradd }, - { "dictwatcherdel", 3, 3, f_dictwatcherdel }, - { "did_filetype", 0, 0, f_did_filetype }, - { "diff_filler", 1, 1, f_diff_filler }, - { "diff_hlID", 2, 2, f_diff_hlID }, - { "empty", 1, 1, f_empty }, - { "escape", 2, 2, f_escape }, - { "eval", 1, 1, f_eval }, - { "eventhandler", 0, 0, f_eventhandler }, - { "executable", 1, 1, f_executable }, - { "execute", 1, 1, f_execute }, - { "exepath", 1, 1, f_exepath }, - { "exists", 1, 1, f_exists }, - { "exp", 1, 1, f_exp }, - { "expand", 1, 3, f_expand }, - { "extend", 2, 3, f_extend }, - { "feedkeys", 1, 2, f_feedkeys }, - { "file_readable", 1, 1, f_filereadable }, // obsolete - { "filereadable", 1, 1, f_filereadable }, - { "filewritable", 1, 1, f_filewritable }, - { "filter", 2, 2, f_filter }, - { "finddir", 1, 3, f_finddir }, - { "findfile", 1, 3, f_findfile }, - { "float2nr", 1, 1, f_float2nr }, - { "floor", 1, 1, f_floor }, - { "fmod", 2, 2, f_fmod }, - { "fnameescape", 1, 1, f_fnameescape }, - { "fnamemodify", 2, 2, f_fnamemodify }, - { "foldclosed", 1, 1, f_foldclosed }, - { "foldclosedend", 1, 1, f_foldclosedend }, - { "foldlevel", 1, 1, f_foldlevel }, - { "foldtext", 0, 0, f_foldtext }, - { "foldtextresult", 1, 1, f_foldtextresult }, - { "foreground", 0, 0, f_foreground }, - { "function", 1, 1, f_function }, - { "garbagecollect", 0, 1, f_garbagecollect }, - { "get", 2, 3, f_get }, - { "getbufline", 2, 3, f_getbufline }, - { "getbufvar", 2, 3, f_getbufvar }, - { "getchar", 0, 1, f_getchar }, - { "getcharmod", 0, 0, f_getcharmod }, - { "getcharsearch", 0, 0, f_getcharsearch }, - { "getcmdline", 0, 0, f_getcmdline }, - { "getcmdpos", 0, 0, f_getcmdpos }, - { "getcmdtype", 0, 0, f_getcmdtype }, - { "getcmdwintype", 0, 0, f_getcmdwintype }, - { "getcompletion", 2, 2, f_getcompletion }, - { "getcurpos", 0, 0, f_getcurpos }, - { "getcwd", 0, 2, f_getcwd }, - { "getfontname", 0, 1, f_getfontname }, - { "getfperm", 1, 1, f_getfperm }, - { "getfsize", 1, 1, f_getfsize }, - { "getftime", 1, 1, f_getftime }, - { "getftype", 1, 1, f_getftype }, - { "getline", 1, 2, f_getline }, - { "getloclist", 1, 1, f_getqflist }, - { "getmatches", 0, 0, f_getmatches }, - { "getpid", 0, 0, f_getpid }, - { "getpos", 1, 1, f_getpos }, - { "getqflist", 0, 0, f_getqflist }, - { "getreg", 0, 3, f_getreg }, - { "getregtype", 0, 1, f_getregtype }, - { "gettabvar", 2, 3, f_gettabvar }, - { "gettabwinvar", 3, 4, f_gettabwinvar }, - { "getwinposx", 0, 0, f_getwinposx }, - { "getwinposy", 0, 0, f_getwinposy }, - { "getwinvar", 2, 3, f_getwinvar }, - { "glob", 1, 4, f_glob }, - { "glob2regpat", 1, 1, f_glob2regpat }, - { "globpath", 2, 5, f_globpath }, - { "has", 1, 1, f_has }, - { "has_key", 2, 2, f_has_key }, - { "haslocaldir", 0, 2, f_haslocaldir }, - { "hasmapto", 1, 3, f_hasmapto }, - { "highlightID", 1, 1, f_hlID }, // obsolete - { "highlight_exists", 1, 1, f_hlexists }, // obsolete - { "histadd", 2, 2, f_histadd }, - { "histdel", 1, 2, f_histdel }, - { "histget", 1, 2, f_histget }, - { "histnr", 1, 1, f_histnr }, - { "hlID", 1, 1, f_hlID }, - { "hlexists", 1, 1, f_hlexists }, - { "hostname", 0, 0, f_hostname }, - { "iconv", 3, 3, f_iconv }, - { "indent", 1, 1, f_indent }, - { "index", 2, 4, f_index }, - { "input", 1, 3, f_input }, - { "inputdialog", 1, 3, f_inputdialog }, - { "inputlist", 1, 1, f_inputlist }, - { "inputrestore", 0, 0, f_inputrestore }, - { "inputsave", 0, 0, f_inputsave }, - { "inputsecret", 1, 2, f_inputsecret }, - { "insert", 2, 3, f_insert }, - { "invert", 1, 1, f_invert }, - { "isdirectory", 1, 1, f_isdirectory }, - { "islocked", 1, 1, f_islocked }, - { "items", 1, 1, f_items }, - { "jobclose", 1, 2, f_jobclose }, - { "jobpid", 1, 1, f_jobpid }, - { "jobresize", 3, 3, f_jobresize }, - { "jobsend", 2, 2, f_jobsend }, - { "jobstart", 1, 2, f_jobstart }, - { "jobstop", 1, 1, f_jobstop }, - { "jobwait", 1, 2, f_jobwait }, - { "join", 1, 2, f_join }, - { "json_decode", 1, 1, f_json_decode }, - { "json_encode", 1, 1, f_json_encode }, - { "keys", 1, 1, f_keys }, - { "last_buffer_nr", 0, 0, f_last_buffer_nr }, // obsolete - { "len", 1, 1, f_len }, - { "libcall", 3, 3, f_libcall }, - { "libcallnr", 3, 3, f_libcallnr }, - { "line", 1, 1, f_line }, - { "line2byte", 1, 1, f_line2byte }, - { "lispindent", 1, 1, f_lispindent }, - { "localtime", 0, 0, f_localtime }, - { "log", 1, 1, f_log }, - { "log10", 1, 1, f_log10 }, - { "map", 2, 2, f_map }, - { "maparg", 1, 4, f_maparg }, - { "mapcheck", 1, 3, f_mapcheck }, - { "match", 2, 4, f_match }, - { "matchadd", 2, 5, f_matchadd }, - { "matchaddpos", 2, 5, f_matchaddpos }, - { "matcharg", 1, 1, f_matcharg }, - { "matchdelete", 1, 1, f_matchdelete }, - { "matchend", 2, 4, f_matchend }, - { "matchlist", 2, 4, f_matchlist }, - { "matchstr", 2, 4, f_matchstr }, - { "max", 1, 1, f_max }, - { "min", 1, 1, f_min }, - { "mkdir", 1, 3, f_mkdir }, - { "mode", 0, 1, f_mode }, - { "msgpackdump", 1, 1, f_msgpackdump }, - { "msgpackparse", 1, 1, f_msgpackparse }, - { "nextnonblank", 1, 1, f_nextnonblank }, - { "nr2char", 1, 2, f_nr2char }, - { "or", 2, 2, f_or }, - { "pathshorten", 1, 1, f_pathshorten }, - { "pow", 2, 2, f_pow }, - { "prevnonblank", 1, 1, f_prevnonblank }, - { "printf", 2, MAX_FUNC_ARGS, f_printf }, - { "pumvisible", 0, 0, f_pumvisible }, - { "py3eval", 1, 1, f_py3eval }, - { "pyeval", 1, 1, f_pyeval }, - { "range", 1, 3, f_range }, - { "readfile", 1, 3, f_readfile }, - { "reltime", 0, 2, f_reltime }, - { "reltimefloat", 1, 1, f_reltimefloat }, - { "reltimestr", 1, 1, f_reltimestr }, - { "remove", 2, 3, f_remove }, - { "rename", 2, 2, f_rename }, - { "repeat", 2, 2, f_repeat }, - { "resolve", 1, 1, f_resolve }, - { "reverse", 1, 1, f_reverse }, - { "round", 1, 1, f_round }, - { "rpcnotify", 2, MAX_FUNC_ARGS, f_rpcnotify }, - { "rpcrequest", 2, MAX_FUNC_ARGS, f_rpcrequest }, - { "rpcstart", 1, 2, f_rpcstart }, - { "rpcstop", 1, 1, f_rpcstop }, - { "screenattr", 2, 2, f_screenattr }, - { "screenchar", 2, 2, f_screenchar }, - { "screencol", 0, 0, f_screencol }, - { "screenrow", 0, 0, f_screenrow }, - { "search", 1, 4, f_search }, - { "searchdecl", 1, 3, f_searchdecl }, - { "searchpair", 3, 7, f_searchpair }, - { "searchpairpos", 3, 7, f_searchpairpos }, - { "searchpos", 1, 4, f_searchpos }, - { "serverlist", 0, 0, f_serverlist }, - { "serverstart", 0, 1, f_serverstart }, - { "serverstop", 1, 1, f_serverstop }, - { "setbufvar", 3, 3, f_setbufvar }, - { "setcharsearch", 1, 1, f_setcharsearch }, - { "setcmdpos", 1, 1, f_setcmdpos }, - { "setfperm", 2, 2, f_setfperm }, - { "setline", 2, 2, f_setline }, - { "setloclist", 2, 4, f_setloclist }, - { "setmatches", 1, 1, f_setmatches }, - { "setpos", 2, 2, f_setpos }, - { "setqflist", 1, 3, f_setqflist }, - { "setreg", 2, 3, f_setreg }, - { "settabvar", 3, 3, f_settabvar }, - { "settabwinvar", 4, 4, f_settabwinvar }, - { "setwinvar", 3, 3, f_setwinvar }, - { "sha256", 1, 1, f_sha256 }, - { "shellescape", 1, 2, f_shellescape }, - { "shiftwidth", 0, 0, f_shiftwidth }, - { "simplify", 1, 1, f_simplify }, - { "sin", 1, 1, f_sin }, - { "sinh", 1, 1, f_sinh }, - { "sort", 1, 3, f_sort }, - { "soundfold", 1, 1, f_soundfold }, - { "spellbadword", 0, 1, f_spellbadword }, - { "spellsuggest", 1, 3, f_spellsuggest }, - { "split", 1, 3, f_split }, - { "sqrt", 1, 1, f_sqrt }, - { "str2float", 1, 1, f_str2float }, - { "str2nr", 1, 2, f_str2nr }, - { "strchars", 1, 2, f_strchars }, - { "strdisplaywidth", 1, 2, f_strdisplaywidth }, - { "strftime", 1, 2, f_strftime }, - { "stridx", 2, 3, f_stridx }, - { "string", 1, 1, f_string }, - { "strlen", 1, 1, f_strlen }, - { "strpart", 2, 3, f_strpart }, - { "strridx", 2, 3, f_strridx }, - { "strtrans", 1, 1, f_strtrans }, - { "strwidth", 1, 1, f_strwidth }, - { "submatch", 1, 2, f_submatch }, - { "substitute", 4, 4, f_substitute }, - { "synID", 3, 3, f_synID }, - { "synIDattr", 2, 3, f_synIDattr }, - { "synIDtrans", 1, 1, f_synIDtrans }, - { "synconcealed", 2, 2, f_synconcealed }, - { "synstack", 2, 2, f_synstack }, - { "system", 1, 2, f_system }, - { "systemlist", 1, 3, f_systemlist }, - { "tabpagebuflist", 0, 1, f_tabpagebuflist }, - { "tabpagenr", 0, 1, f_tabpagenr }, - { "tabpagewinnr", 1, 2, f_tabpagewinnr }, - { "tagfiles", 0, 0, f_tagfiles }, - { "taglist", 1, 1, f_taglist }, - { "tan", 1, 1, f_tan }, - { "tanh", 1, 1, f_tanh }, - { "tempname", 0, 0, f_tempname }, - { "termopen", 1, 2, f_termopen }, - { "test", 1, 1, f_test }, - { "timer_start", 2, 3, f_timer_start }, - { "timer_stop", 1, 1, f_timer_stop }, - { "tolower", 1, 1, f_tolower }, - { "toupper", 1, 1, f_toupper }, - { "tr", 3, 3, f_tr }, - { "trunc", 1, 1, f_trunc }, - { "type", 1, 1, f_type }, - { "undofile", 1, 1, f_undofile }, - { "undotree", 0, 0, f_undotree }, - { "uniq", 1, 3, f_uniq }, - { "values", 1, 1, f_values }, - { "virtcol", 1, 1, f_virtcol }, - { "visualmode", 0, 1, f_visualmode }, - { "wildmenumode", 0, 0, f_wildmenumode }, - { "winbufnr", 1, 1, f_winbufnr }, - { "wincol", 0, 0, f_wincol }, - { "winheight", 1, 1, f_winheight }, - { "winline", 0, 0, f_winline }, - { "winnr", 0, 1, f_winnr }, - { "winrestcmd", 0, 0, f_winrestcmd }, - { "winrestview", 1, 1, f_winrestview }, - { "winsaveview", 0, 0, f_winsaveview }, - { "winwidth", 1, 1, f_winwidth }, - { "wordcount", 0, 0, f_wordcount }, - { "writefile", 2, 3, f_writefile }, - { "xor", 2, 2, f_xor }, -}; +#ifdef INCLUDE_GENERATED_DECLARATIONS +# include "funcs.generated.h" +#endif /* @@ -7018,15 +6720,25 @@ char_u *get_function_name(expand_T *xp, int idx) if (name != NULL) return name; } - if (++intidx < (int)ARRAY_SIZE(functions)) { - STRCPY(IObuff, functions[intidx].f_name); - STRCAT(IObuff, "("); - if (functions[intidx].f_max_argc == 0) - STRCAT(IObuff, ")"); - return IObuff; + while ( (size_t)++intidx < ARRAY_SIZE(functions) + && functions[intidx].name[0] == '\0') { } - return NULL; + if ((size_t)intidx >= ARRAY_SIZE(functions)) { + return NULL; + } + + const char *const key = functions[intidx].name; + const size_t key_len = strlen(key); + memcpy(IObuff, key, key_len); + IObuff[key_len] = '('; + if (functions[intidx].max_argc == 0) { + IObuff[key_len + 1] = ')'; + IObuff[key_len + 2] = NUL; + } else { + IObuff[key_len + 1] = NUL; + } + return IObuff; } /* @@ -7051,32 +6763,16 @@ char_u *get_expr_name(expand_T *xp, int idx) -/* - * Find internal function in table above. - * Return index, or -1 if not found - */ -static int -find_internal_func ( - char_u *name /* name of the function */ -) +/// Find internal function in hash functions +/// +/// @param[in] name Name of the function. +/// +/// Returns pointer to the function definition or NULL if not found. +static VimLFuncDef *find_internal_func(const char *const name) + FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_PURE FUNC_ATTR_NONNULL_ALL { - int first = 0; - int last = (int)ARRAY_SIZE(functions) - 1; - - /* - * Find the function name in the table. Binary search. - */ - while (first <= last) { - int x = first + ((unsigned)(last - first)) / 2; - int cmp = STRCMP(name, functions[x].f_name); - if (cmp < 0) - last = x - 1; - else if (cmp > 0) - first = x + 1; - else - return x; - } - return -1; + size_t len = strlen(name); + return find_internal_func_gperf(name, len); } /* @@ -7194,7 +6890,6 @@ call_func ( #define ERROR_NONE 5 #define ERROR_OTHER 6 int error = ERROR_NONE; - int i; int llen; ufunc_T *fp; #define FLEN_FIXED 40 @@ -7216,12 +6911,13 @@ call_func ( fname_buf[0] = K_SPECIAL; fname_buf[1] = KS_EXTRA; fname_buf[2] = (int)KE_SNR; - i = 3; - if (eval_fname_sid(name)) { /* "<SID>" or "s:" */ - if (current_SID <= 0) + int i = 3; + if (eval_fname_sid(name)) { // "<SID>" or "s:" + if (current_SID <= 0) { error = ERROR_SCRIPT; - else { - sprintf((char *)fname_buf + 3, "%" PRId64 "_", (int64_t)current_SID); + } else { + vim_snprintf((char *)fname_buf + 3, ARRAY_SIZE(fname_buf) - 3, + "%" PRId64 "_", (int64_t)current_SID); i = (int)STRLEN(fname_buf); } } @@ -7288,18 +6984,16 @@ call_func ( } } } else { - /* - * Find the function name in the table, call its implementation. - */ - i = find_internal_func(fname); - if (i >= 0) { - if (argcount < functions[i].f_min_argc) + // Find the function name in the table, call its implementation. + VimLFuncDef *const fdef = find_internal_func((char *)fname); + if (fdef != NULL) { + if (argcount < fdef->min_argc) { error = ERROR_TOOFEW; - else if (argcount > functions[i].f_max_argc) + } else if (argcount > fdef->max_argc) { error = ERROR_TOOMANY; - else { + } else { argvars[argcount].v_type = VAR_UNKNOWN; - functions[i].f_func(argvars, rettv); + fdef->func(argvars, rettv, fdef->data); error = ERROR_NONE; } } @@ -7410,13 +7104,10 @@ static inline int get_float_arg(typval_T *argvars, float_T *f) // Some versions of glibc on i386 have an optimization that makes it harder to // call math functions indirectly from inside an inlined function, causing // compile-time errors. Avoid `inline` in that case. #3072 -#ifndef ARCH_32 -inline -#endif -static void float_op_wrapper(typval_T *argvars, typval_T *rettv, - float_T (*function)(float_T)) +static void float_op_wrapper(typval_T *argvars, typval_T *rettv, FunPtr fptr) { float_T f; + float_T (*function)(float_T) = (float_T (*)(float_T))fptr; rettv->v_type = VAR_FLOAT; if (get_float_arg(argvars, &f) == OK) { @@ -7426,13 +7117,40 @@ static void float_op_wrapper(typval_T *argvars, typval_T *rettv, } } +static void api_wrapper(typval_T *argvars, typval_T *rettv, FunPtr fptr) +{ + ApiDispatchWrapper fn = (ApiDispatchWrapper)fptr; + + Array args = ARRAY_DICT_INIT; + + for (typval_T *tv = argvars; tv->v_type != VAR_UNKNOWN; tv++) { + ADD(args, vim_to_object(tv)); + } + + Error err = ERROR_INIT; + Object result = fn(INVALID_CHANNEL, NO_RESPONSE, args, &err); + + if (err.set) { + nvim_err_writeln(cstr_as_string(err.msg)); + goto end; + } + + if (!object_to_vim(result, rettv, &err)) { + EMSG2(_("Error converting the call result: %s"), err.msg); + } + +end: + api_free_array(args); + api_free_object(result); +} + /* * "abs(expr)" function */ -static void f_abs(typval_T *argvars, typval_T *rettv) +static void f_abs(typval_T *argvars, typval_T *rettv, FunPtr fptr) { if (argvars[0].v_type == VAR_FLOAT) { - float_op_wrapper(argvars, rettv, &fabs); + float_op_wrapper(argvars, rettv, (FunPtr)&fabs); } else { varnumber_T n; int error = FALSE; @@ -7448,17 +7166,9 @@ static void f_abs(typval_T *argvars, typval_T *rettv) } /* - * "acos()" function - */ -static void f_acos(typval_T *argvars, typval_T *rettv) -{ - float_op_wrapper(argvars, rettv, &acos); -} - -/* * "add(list, item)" function */ -static void f_add(typval_T *argvars, typval_T *rettv) +static void f_add(typval_T *argvars, typval_T *rettv, FunPtr fptr) { list_T *l; @@ -7477,7 +7187,7 @@ static void f_add(typval_T *argvars, typval_T *rettv) /* * "and(expr, expr)" function */ -static void f_and(typval_T *argvars, typval_T *rettv) +static void f_and(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->vval.v_number = get_tv_number_chk(&argvars[0], NULL) & get_tv_number_chk(&argvars[1], NULL); @@ -7485,7 +7195,7 @@ static void f_and(typval_T *argvars, typval_T *rettv) /// "api_info()" function -static void f_api_info(typval_T *argvars, typval_T *rettv) +static void f_api_info(typval_T *argvars, typval_T *rettv, FunPtr fptr) { Dictionary metadata = api_metadata(); (void)object_to_vim(DICTIONARY_OBJ(metadata), rettv, NULL); @@ -7495,7 +7205,7 @@ static void f_api_info(typval_T *argvars, typval_T *rettv) /* * "append(lnum, string/list)" function */ -static void f_append(typval_T *argvars, typval_T *rettv) +static void f_append(typval_T *argvars, typval_T *rettv, FunPtr fptr) { long lnum; char_u *line; @@ -7550,7 +7260,7 @@ static void f_append(typval_T *argvars, typval_T *rettv) /* * "argc()" function */ -static void f_argc(typval_T *argvars, typval_T *rettv) +static void f_argc(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->vval.v_number = ARGCOUNT; } @@ -7558,13 +7268,13 @@ static void f_argc(typval_T *argvars, typval_T *rettv) /* * "argidx()" function */ -static void f_argidx(typval_T *argvars, typval_T *rettv) +static void f_argidx(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->vval.v_number = curwin->w_arg_idx; } /// "arglistid" function -static void f_arglistid(typval_T *argvars, typval_T *rettv) +static void f_arglistid(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->vval.v_number = -1; win_T *wp = find_tabwin(&argvars[0], &argvars[1]); @@ -7576,7 +7286,7 @@ static void f_arglistid(typval_T *argvars, typval_T *rettv) /* * "argv(nr)" function */ -static void f_argv(typval_T *argvars, typval_T *rettv) +static void f_argv(typval_T *argvars, typval_T *rettv, FunPtr fptr) { int idx; @@ -7683,19 +7393,19 @@ static void assert_equal_common(typval_T *argvars, assert_type_T atype) } // "assert_equal(expected, actual[, msg])" function -static void f_assert_equal(typval_T *argvars, typval_T *rettv) +static void f_assert_equal(typval_T *argvars, typval_T *rettv, FunPtr fptr) { assert_equal_common(argvars, ASSERT_EQUAL); } // "assert_notequal(expected, actual[, msg])" function -static void f_assert_notequal(typval_T *argvars, typval_T *rettv) +static void f_assert_notequal(typval_T *argvars, typval_T *rettv, FunPtr fptr) { assert_equal_common(argvars, ASSERT_NOTEQUAL); } /// "assert_exception(string[, msg])" function -static void f_assert_exception(typval_T *argvars, typval_T *rettv) +static void f_assert_exception(typval_T *argvars, typval_T *rettv, FunPtr fptr) { garray_T ga; @@ -7716,7 +7426,7 @@ static void f_assert_exception(typval_T *argvars, typval_T *rettv) } /// "assert_fails(cmd [, error])" function -static void f_assert_fails(typval_T *argvars, typval_T *rettv) +static void f_assert_fails(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *cmd = get_tv_string_chk(&argvars[0]); garray_T ga; @@ -7776,7 +7486,7 @@ static void assert_bool(typval_T *argvars, bool is_true) } // "assert_false(actual[, msg])" function -static void f_assert_false(typval_T *argvars, typval_T *rettv) +static void f_assert_false(typval_T *argvars, typval_T *rettv, FunPtr fptr) { assert_bool(argvars, false); } @@ -7800,43 +7510,27 @@ static void assert_match_common(typval_T *argvars, assert_type_T atype) } /// "assert_match(pattern, actual[, msg])" function -static void f_assert_match(typval_T *argvars, typval_T *rettv) +static void f_assert_match(typval_T *argvars, typval_T *rettv, FunPtr fptr) { assert_match_common(argvars, ASSERT_MATCH); } /// "assert_notmatch(pattern, actual[, msg])" function -static void f_assert_notmatch(typval_T *argvars, typval_T *rettv) +static void f_assert_notmatch(typval_T *argvars, typval_T *rettv, FunPtr fptr) { assert_match_common(argvars, ASSERT_NOTMATCH); } // "assert_true(actual[, msg])" function -static void f_assert_true(typval_T *argvars, typval_T *rettv) +static void f_assert_true(typval_T *argvars, typval_T *rettv, FunPtr fptr) { assert_bool(argvars, true); } /* - * "asin()" function - */ -static void f_asin(typval_T *argvars, typval_T *rettv) -{ - float_op_wrapper(argvars, rettv, &asin); -} - -/* - * "atan()" function - */ -static void f_atan(typval_T *argvars, typval_T *rettv) -{ - float_op_wrapper(argvars, rettv, &atan); -} - -/* * "atan2()" function */ -static void f_atan2(typval_T *argvars, typval_T *rettv) +static void f_atan2(typval_T *argvars, typval_T *rettv, FunPtr fptr) { float_T fx, fy; @@ -7851,7 +7545,7 @@ static void f_atan2(typval_T *argvars, typval_T *rettv) /* * "browse(save, title, initdir, default)" function */ -static void f_browse(typval_T *argvars, typval_T *rettv) +static void f_browse(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->vval.v_string = NULL; rettv->v_type = VAR_STRING; @@ -7860,9 +7554,9 @@ static void f_browse(typval_T *argvars, typval_T *rettv) /* * "browsedir(title, initdir)" function */ -static void f_browsedir(typval_T *argvars, typval_T *rettv) +static void f_browsedir(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - f_browse(argvars, rettv); + f_browse(argvars, rettv, NULL); } @@ -7898,7 +7592,7 @@ static buf_T *find_buffer(typval_T *avar) /* * "bufexists(expr)" function */ -static void f_bufexists(typval_T *argvars, typval_T *rettv) +static void f_bufexists(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->vval.v_number = (find_buffer(&argvars[0]) != NULL); } @@ -7906,7 +7600,7 @@ static void f_bufexists(typval_T *argvars, typval_T *rettv) /* * "buflisted(expr)" function */ -static void f_buflisted(typval_T *argvars, typval_T *rettv) +static void f_buflisted(typval_T *argvars, typval_T *rettv, FunPtr fptr) { buf_T *buf; @@ -7917,7 +7611,7 @@ static void f_buflisted(typval_T *argvars, typval_T *rettv) /* * "bufloaded(expr)" function */ -static void f_bufloaded(typval_T *argvars, typval_T *rettv) +static void f_bufloaded(typval_T *argvars, typval_T *rettv, FunPtr fptr) { buf_T *buf; @@ -7967,7 +7661,7 @@ static buf_T *get_buf_tv(typval_T *tv, int curtab_only) /* * "bufname(expr)" function */ -static void f_bufname(typval_T *argvars, typval_T *rettv) +static void f_bufname(typval_T *argvars, typval_T *rettv, FunPtr fptr) { buf_T *buf; @@ -7985,7 +7679,7 @@ static void f_bufname(typval_T *argvars, typval_T *rettv) /* * "bufnr(expr)" function */ -static void f_bufnr(typval_T *argvars, typval_T *rettv) +static void f_bufnr(typval_T *argvars, typval_T *rettv, FunPtr fptr) { buf_T *buf; int error = FALSE; @@ -8015,7 +7709,7 @@ static void f_bufnr(typval_T *argvars, typval_T *rettv) /* * "bufwinnr(nr)" function */ -static void f_bufwinnr(typval_T *argvars, typval_T *rettv) +static void f_bufwinnr(typval_T *argvars, typval_T *rettv, FunPtr fptr) { (void)get_tv_number(&argvars[0]); /* issue errmsg if type error */ ++emsg_off; @@ -8037,7 +7731,7 @@ static void f_bufwinnr(typval_T *argvars, typval_T *rettv) /* * "byte2line(byte)" function */ -static void f_byte2line(typval_T *argvars, typval_T *rettv) +static void f_byte2line(typval_T *argvars, typval_T *rettv, FunPtr fptr) { long boff = 0; @@ -8076,7 +7770,7 @@ static void byteidx(typval_T *argvars, typval_T *rettv, int comp) /* * "byteidx()" function */ -static void f_byteidx(typval_T *argvars, typval_T *rettv) +static void f_byteidx(typval_T *argvars, typval_T *rettv, FunPtr fptr) { byteidx(argvars, rettv, FALSE); } @@ -8084,7 +7778,7 @@ static void f_byteidx(typval_T *argvars, typval_T *rettv) /* * "byteidxcomp()" function */ -static void f_byteidxcomp(typval_T *argvars, typval_T *rettv) +static void f_byteidxcomp(typval_T *argvars, typval_T *rettv, FunPtr fptr) { byteidx(argvars, rettv, TRUE); } @@ -8124,7 +7818,7 @@ int func_call(char_u *name, typval_T *args, dict_T *selfdict, typval_T *rettv) /* * "call(func, arglist)" function */ -static void f_call(typval_T *argvars, typval_T *rettv) +static void f_call(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *func; dict_T *selfdict = NULL; @@ -8155,17 +7849,9 @@ static void f_call(typval_T *argvars, typval_T *rettv) } /* - * "ceil({float})" function - */ -static void f_ceil(typval_T *argvars, typval_T *rettv) -{ - float_op_wrapper(argvars, rettv, &ceil); -} - -/* * "changenr()" function */ -static void f_changenr(typval_T *argvars, typval_T *rettv) +static void f_changenr(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->vval.v_number = curbuf->b_u_seq_cur; } @@ -8173,7 +7859,7 @@ static void f_changenr(typval_T *argvars, typval_T *rettv) /* * "char2nr(string)" function */ -static void f_char2nr(typval_T *argvars, typval_T *rettv) +static void f_char2nr(typval_T *argvars, typval_T *rettv, FunPtr fptr) { if (has_mbyte) { int utf8 = 0; @@ -8192,7 +7878,7 @@ static void f_char2nr(typval_T *argvars, typval_T *rettv) /* * "cindent(lnum)" function */ -static void f_cindent(typval_T *argvars, typval_T *rettv) +static void f_cindent(typval_T *argvars, typval_T *rettv, FunPtr fptr) { pos_T pos; linenr_T lnum; @@ -8210,7 +7896,7 @@ static void f_cindent(typval_T *argvars, typval_T *rettv) /* * "clearmatches()" function */ -static void f_clearmatches(typval_T *argvars, typval_T *rettv) +static void f_clearmatches(typval_T *argvars, typval_T *rettv, FunPtr fptr) { clear_matches(curwin); } @@ -8218,7 +7904,7 @@ static void f_clearmatches(typval_T *argvars, typval_T *rettv) /* * "col(string)" function */ -static void f_col(typval_T *argvars, typval_T *rettv) +static void f_col(typval_T *argvars, typval_T *rettv, FunPtr fptr) { colnr_T col = 0; pos_T *fp; @@ -8255,7 +7941,7 @@ static void f_col(typval_T *argvars, typval_T *rettv) /* * "complete()" function */ -static void f_complete(typval_T *argvars, typval_T *rettv) +static void f_complete(typval_T *argvars, typval_T *rettv, FunPtr fptr) { int startcol; @@ -8284,7 +7970,7 @@ static void f_complete(typval_T *argvars, typval_T *rettv) /* * "complete_add()" function */ -static void f_complete_add(typval_T *argvars, typval_T *rettv) +static void f_complete_add(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->vval.v_number = ins_compl_add_tv(&argvars[0], 0); } @@ -8292,7 +7978,7 @@ static void f_complete_add(typval_T *argvars, typval_T *rettv) /* * "complete_check()" function */ -static void f_complete_check(typval_T *argvars, typval_T *rettv) +static void f_complete_check(typval_T *argvars, typval_T *rettv, FunPtr fptr) { int saved = RedrawingDisabled; @@ -8305,7 +7991,7 @@ static void f_complete_check(typval_T *argvars, typval_T *rettv) /* * "confirm(message, buttons[, default [, type]])" function */ -static void f_confirm(typval_T *argvars, typval_T *rettv) +static void f_confirm(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *message; char_u *buttons = NULL; @@ -8353,31 +8039,15 @@ static void f_confirm(typval_T *argvars, typval_T *rettv) /* * "copy()" function */ -static void f_copy(typval_T *argvars, typval_T *rettv) +static void f_copy(typval_T *argvars, typval_T *rettv, FunPtr fptr) { var_item_copy(NULL, &argvars[0], rettv, false, 0); } /* - * "cos()" function - */ -static void f_cos(typval_T *argvars, typval_T *rettv) -{ - float_op_wrapper(argvars, rettv, &cos); -} - -/* - * "cosh()" function - */ -static void f_cosh(typval_T *argvars, typval_T *rettv) -{ - float_op_wrapper(argvars, rettv, &cosh); -} - -/* * "count()" function */ -static void f_count(typval_T *argvars, typval_T *rettv) +static void f_count(typval_T *argvars, typval_T *rettv, FunPtr fptr) { long n = 0; int ic = FALSE; @@ -8442,7 +8112,7 @@ static void f_count(typval_T *argvars, typval_T *rettv) * * Checks the existence of a cscope connection. */ -static void f_cscope_connection(typval_T *argvars, typval_T *rettv) +static void f_cscope_connection(typval_T *argvars, typval_T *rettv, FunPtr fptr) { int num = 0; char_u *dbpath = NULL; @@ -8466,7 +8136,7 @@ static void f_cscope_connection(typval_T *argvars, typval_T *rettv) /// Moves the cursor to the specified line and column. /// /// @returns 0 when the position could be set, -1 otherwise. -static void f_cursor(typval_T *argvars, typval_T *rettv) +static void f_cursor(typval_T *argvars, typval_T *rettv, FunPtr fptr) { long line, col; long coladd = 0; @@ -8522,7 +8192,7 @@ static void f_cursor(typval_T *argvars, typval_T *rettv) /* * "deepcopy()" function */ -static void f_deepcopy(typval_T *argvars, typval_T *rettv) +static void f_deepcopy(typval_T *argvars, typval_T *rettv, FunPtr fptr) { int noref = 0; @@ -8538,7 +8208,7 @@ static void f_deepcopy(typval_T *argvars, typval_T *rettv) } // "delete()" function -static void f_delete(typval_T *argvars, typval_T *rettv) +static void f_delete(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u nbuf[NUMBUFLEN]; char_u *name; @@ -8576,7 +8246,7 @@ static void f_delete(typval_T *argvars, typval_T *rettv) } // dictwatcheradd(dict, key, funcref) function -static void f_dictwatcheradd(typval_T *argvars, typval_T *rettv) +static void f_dictwatcheradd(typval_T *argvars, typval_T *rettv, FunPtr fptr) { if (check_restricted() || check_secure()) { return; @@ -8621,7 +8291,7 @@ static void f_dictwatcheradd(typval_T *argvars, typval_T *rettv) } // dictwatcherdel(dict, key, funcref) function -static void f_dictwatcherdel(typval_T *argvars, typval_T *rettv) +static void f_dictwatcherdel(typval_T *argvars, typval_T *rettv, FunPtr fptr) { if (check_restricted() || check_secure()) { return; @@ -8682,7 +8352,7 @@ static void f_dictwatcherdel(typval_T *argvars, typval_T *rettv) /* * "did_filetype()" function */ -static void f_did_filetype(typval_T *argvars, typval_T *rettv) +static void f_did_filetype(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->vval.v_number = did_filetype; } @@ -8690,7 +8360,7 @@ static void f_did_filetype(typval_T *argvars, typval_T *rettv) /* * "diff_filler()" function */ -static void f_diff_filler(typval_T *argvars, typval_T *rettv) +static void f_diff_filler(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->vval.v_number = diff_check_fill(curwin, get_tv_lnum(argvars)); } @@ -8698,7 +8368,7 @@ static void f_diff_filler(typval_T *argvars, typval_T *rettv) /* * "diff_hlID()" function */ -static void f_diff_hlID(typval_T *argvars, typval_T *rettv) +static void f_diff_hlID(typval_T *argvars, typval_T *rettv, FunPtr fptr) { linenr_T lnum = get_tv_lnum(argvars); static linenr_T prev_lnum = 0; @@ -8747,7 +8417,7 @@ static void f_diff_hlID(typval_T *argvars, typval_T *rettv) /* * "empty({expr})" function */ -static void f_empty(typval_T *argvars, typval_T *rettv) +static void f_empty(typval_T *argvars, typval_T *rettv, FunPtr fptr) { bool n = true; @@ -8785,7 +8455,7 @@ static void f_empty(typval_T *argvars, typval_T *rettv) /* * "escape({string}, {chars})" function */ -static void f_escape(typval_T *argvars, typval_T *rettv) +static void f_escape(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u buf[NUMBUFLEN]; @@ -8797,7 +8467,7 @@ static void f_escape(typval_T *argvars, typval_T *rettv) /* * "eval()" function */ -static void f_eval(typval_T *argvars, typval_T *rettv) +static void f_eval(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *s; @@ -8821,7 +8491,7 @@ static void f_eval(typval_T *argvars, typval_T *rettv) /* * "eventhandler()" function */ -static void f_eventhandler(typval_T *argvars, typval_T *rettv) +static void f_eventhandler(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->vval.v_number = vgetc_busy; } @@ -8829,7 +8499,7 @@ static void f_eventhandler(typval_T *argvars, typval_T *rettv) /* * "executable()" function */ -static void f_executable(typval_T *argvars, typval_T *rettv) +static void f_executable(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *name = get_tv_string(&argvars[0]); @@ -8839,7 +8509,7 @@ static void f_executable(typval_T *argvars, typval_T *rettv) } // "execute(command)" function -static void f_execute(typval_T *argvars, typval_T *rettv) +static void f_execute(typval_T *argvars, typval_T *rettv, FunPtr fptr) { int save_msg_silent = msg_silent; garray_T *save_capture_ga = capture_ga; @@ -8871,7 +8541,7 @@ static void f_execute(typval_T *argvars, typval_T *rettv) } /// "exepath()" function -static void f_exepath(typval_T *argvars, typval_T *rettv) +static void f_exepath(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *arg = get_tv_string(&argvars[0]); char_u *path = NULL; @@ -8885,7 +8555,7 @@ static void f_exepath(typval_T *argvars, typval_T *rettv) /* * "exists()" function */ -static void f_exists(typval_T *argvars, typval_T *rettv) +static void f_exists(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *p; char_u *name; @@ -8946,17 +8616,9 @@ static void f_exists(typval_T *argvars, typval_T *rettv) } /* - * "exp()" function - */ -static void f_exp(typval_T *argvars, typval_T *rettv) -{ - float_op_wrapper(argvars, rettv, &exp); -} - -/* * "expand()" function */ -static void f_expand(typval_T *argvars, typval_T *rettv) +static void f_expand(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *s; size_t len; @@ -9085,7 +8747,7 @@ void dict_extend(dict_T *d1, dict_T *d2, char_u *action) * "extend(list, list [, idx])" function * "extend(dict, dict [, action])" function */ -static void f_extend(typval_T *argvars, typval_T *rettv) +static void f_extend(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *arg_errmsg = (char_u *)N_("extend() argument"); @@ -9157,7 +8819,7 @@ static void f_extend(typval_T *argvars, typval_T *rettv) /* * "feedkeys()" function */ -static void f_feedkeys(typval_T *argvars, typval_T *rettv) +static void f_feedkeys(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *keys, *flags = NULL; char_u nbuf[NUMBUFLEN]; @@ -9169,18 +8831,17 @@ static void f_feedkeys(typval_T *argvars, typval_T *rettv) return; keys = get_tv_string(&argvars[0]); - if (*keys != NUL) { - if (argvars[1].v_type != VAR_UNKNOWN) { - flags = get_tv_string_buf(&argvars[1], nbuf); - } - vim_feedkeys(cstr_as_string((char *)keys), - cstr_as_string((char *)flags), true); + if (argvars[1].v_type != VAR_UNKNOWN) { + flags = get_tv_string_buf(&argvars[1], nbuf); } + + nvim_feedkeys(cstr_as_string((char *)keys), + cstr_as_string((char *)flags), true); } /// "filereadable()" function -static void f_filereadable(typval_T *argvars, typval_T *rettv) +static void f_filereadable(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *p = get_tv_string(&argvars[0]); rettv->vval.v_number = @@ -9191,7 +8852,7 @@ static void f_filereadable(typval_T *argvars, typval_T *rettv) * Return 0 for not writable, 1 for writable file, 2 for a dir which we have * rights to write into. */ -static void f_filewritable(typval_T *argvars, typval_T *rettv) +static void f_filewritable(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char *filename = (char *)get_tv_string(&argvars[0]); rettv->vval.v_number = os_file_is_writable(filename); @@ -9406,7 +9067,7 @@ theend: /* * "filter()" function */ -static void f_filter(typval_T *argvars, typval_T *rettv) +static void f_filter(typval_T *argvars, typval_T *rettv, FunPtr fptr) { filter_map(argvars, rettv, FALSE); } @@ -9414,7 +9075,7 @@ static void f_filter(typval_T *argvars, typval_T *rettv) /* * "finddir({fname}[, {path}[, {count}]])" function */ -static void f_finddir(typval_T *argvars, typval_T *rettv) +static void f_finddir(typval_T *argvars, typval_T *rettv, FunPtr fptr) { findfilendir(argvars, rettv, FINDFILE_DIR); } @@ -9422,7 +9083,7 @@ static void f_finddir(typval_T *argvars, typval_T *rettv) /* * "findfile({fname}[, {path}[, {count}]])" function */ -static void f_findfile(typval_T *argvars, typval_T *rettv) +static void f_findfile(typval_T *argvars, typval_T *rettv, FunPtr fptr) { findfilendir(argvars, rettv, FINDFILE_FILE); } @@ -9430,7 +9091,7 @@ static void f_findfile(typval_T *argvars, typval_T *rettv) /* * "float2nr({float})" function */ -static void f_float2nr(typval_T *argvars, typval_T *rettv) +static void f_float2nr(typval_T *argvars, typval_T *rettv, FunPtr fptr) { float_T f; @@ -9445,17 +9106,9 @@ static void f_float2nr(typval_T *argvars, typval_T *rettv) } /* - * "floor({float})" function - */ -static void f_floor(typval_T *argvars, typval_T *rettv) -{ - float_op_wrapper(argvars, rettv, &floor); -} - -/* * "fmod()" function */ -static void f_fmod(typval_T *argvars, typval_T *rettv) +static void f_fmod(typval_T *argvars, typval_T *rettv, FunPtr fptr) { float_T fx, fy; @@ -9470,7 +9123,7 @@ static void f_fmod(typval_T *argvars, typval_T *rettv) /* * "fnameescape({string})" function */ -static void f_fnameescape(typval_T *argvars, typval_T *rettv) +static void f_fnameescape(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->vval.v_string = vim_strsave_fnameescape( get_tv_string(&argvars[0]), FALSE); @@ -9480,7 +9133,7 @@ static void f_fnameescape(typval_T *argvars, typval_T *rettv) /* * "fnamemodify({fname}, {mods})" function */ -static void f_fnamemodify(typval_T *argvars, typval_T *rettv) +static void f_fnamemodify(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *fname; char_u *mods; @@ -9531,7 +9184,7 @@ static void foldclosed_both(typval_T *argvars, typval_T *rettv, int end) /* * "foldclosed()" function */ -static void f_foldclosed(typval_T *argvars, typval_T *rettv) +static void f_foldclosed(typval_T *argvars, typval_T *rettv, FunPtr fptr) { foldclosed_both(argvars, rettv, FALSE); } @@ -9539,7 +9192,7 @@ static void f_foldclosed(typval_T *argvars, typval_T *rettv) /* * "foldclosedend()" function */ -static void f_foldclosedend(typval_T *argvars, typval_T *rettv) +static void f_foldclosedend(typval_T *argvars, typval_T *rettv, FunPtr fptr) { foldclosed_both(argvars, rettv, TRUE); } @@ -9547,7 +9200,7 @@ static void f_foldclosedend(typval_T *argvars, typval_T *rettv) /* * "foldlevel()" function */ -static void f_foldlevel(typval_T *argvars, typval_T *rettv) +static void f_foldlevel(typval_T *argvars, typval_T *rettv, FunPtr fptr) { linenr_T lnum; @@ -9559,7 +9212,7 @@ static void f_foldlevel(typval_T *argvars, typval_T *rettv) /* * "foldtext()" function */ -static void f_foldtext(typval_T *argvars, typval_T *rettv) +static void f_foldtext(typval_T *argvars, typval_T *rettv, FunPtr fptr) { linenr_T lnum; char_u *s; @@ -9612,7 +9265,7 @@ static void f_foldtext(typval_T *argvars, typval_T *rettv) /* * "foldtextresult(lnum)" function */ -static void f_foldtextresult(typval_T *argvars, typval_T *rettv) +static void f_foldtextresult(typval_T *argvars, typval_T *rettv, FunPtr fptr) { linenr_T lnum; char_u *text; @@ -9639,14 +9292,14 @@ static void f_foldtextresult(typval_T *argvars, typval_T *rettv) /* * "foreground()" function */ -static void f_foreground(typval_T *argvars, typval_T *rettv) +static void f_foreground(typval_T *argvars, typval_T *rettv, FunPtr fptr) { } /* * "function()" function */ -static void f_function(typval_T *argvars, typval_T *rettv) +static void f_function(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *s; @@ -9678,7 +9331,7 @@ static void f_function(typval_T *argvars, typval_T *rettv) /* * "garbagecollect()" function */ -static void f_garbagecollect(typval_T *argvars, typval_T *rettv) +static void f_garbagecollect(typval_T *argvars, typval_T *rettv, FunPtr fptr) { /* This is postponed until we are back at the toplevel, because we may be * using Lists and Dicts internally. E.g.: ":echo [garbagecollect()]". */ @@ -9691,7 +9344,7 @@ static void f_garbagecollect(typval_T *argvars, typval_T *rettv) /* * "get()" function */ -static void f_get(typval_T *argvars, typval_T *rettv) +static void f_get(typval_T *argvars, typval_T *rettv, FunPtr fptr) { listitem_T *li; list_T *l; @@ -9767,7 +9420,7 @@ static void get_buffer_lines(buf_T *buf, linenr_T start, linenr_T end, int retli /* * "getbufline()" function */ -static void f_getbufline(typval_T *argvars, typval_T *rettv) +static void f_getbufline(typval_T *argvars, typval_T *rettv, FunPtr fptr) { linenr_T lnum; linenr_T end; @@ -9790,7 +9443,7 @@ static void f_getbufline(typval_T *argvars, typval_T *rettv) /* * "getbufvar()" function */ -static void f_getbufvar(typval_T *argvars, typval_T *rettv) +static void f_getbufvar(typval_T *argvars, typval_T *rettv, FunPtr fptr) { buf_T *buf; buf_T *save_curbuf; @@ -9843,7 +9496,7 @@ static void f_getbufvar(typval_T *argvars, typval_T *rettv) /* * "getchar()" function */ -static void f_getchar(typval_T *argvars, typval_T *rettv) +static void f_getchar(typval_T *argvars, typval_T *rettv, FunPtr fptr) { varnumber_T n; int error = FALSE; @@ -9927,7 +9580,7 @@ static void f_getchar(typval_T *argvars, typval_T *rettv) /* * "getcharmod()" function */ -static void f_getcharmod(typval_T *argvars, typval_T *rettv) +static void f_getcharmod(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->vval.v_number = mod_mask; } @@ -9935,7 +9588,7 @@ static void f_getcharmod(typval_T *argvars, typval_T *rettv) /* * "getcharsearch()" function */ -static void f_getcharsearch(typval_T *argvars, typval_T *rettv) +static void f_getcharsearch(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv_dict_alloc(rettv); @@ -9949,7 +9602,7 @@ static void f_getcharsearch(typval_T *argvars, typval_T *rettv) /* * "getcmdline()" function */ -static void f_getcmdline(typval_T *argvars, typval_T *rettv) +static void f_getcmdline(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->v_type = VAR_STRING; rettv->vval.v_string = get_cmdline_str(); @@ -9958,7 +9611,7 @@ static void f_getcmdline(typval_T *argvars, typval_T *rettv) /* * "getcmdpos()" function */ -static void f_getcmdpos(typval_T *argvars, typval_T *rettv) +static void f_getcmdpos(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->vval.v_number = get_cmdline_pos() + 1; } @@ -9966,7 +9619,7 @@ static void f_getcmdpos(typval_T *argvars, typval_T *rettv) /* * "getcmdtype()" function */ -static void f_getcmdtype(typval_T *argvars, typval_T *rettv) +static void f_getcmdtype(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->v_type = VAR_STRING; rettv->vval.v_string = xmallocz(1); @@ -9976,7 +9629,7 @@ static void f_getcmdtype(typval_T *argvars, typval_T *rettv) /* * "getcmdwintype()" function */ -static void f_getcmdwintype(typval_T *argvars, typval_T *rettv) +static void f_getcmdwintype(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; @@ -9985,12 +9638,12 @@ static void f_getcmdwintype(typval_T *argvars, typval_T *rettv) } // "getcompletion()" function -static void f_getcompletion(typval_T *argvars, typval_T *rettv) +static void f_getcompletion(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *pat; expand_T xpc; - int options = WILD_KEEP_ALL | WILD_SILENT | WILD_USE_NL - | WILD_LIST_NOTFOUND | WILD_NO_BEEP; + int options = WILD_SILENT | WILD_USE_NL | WILD_ADD_SLASH + | WILD_NO_BEEP; if (p_wic) { options |= WILD_ICASE; @@ -10015,12 +9668,11 @@ static void f_getcompletion(typval_T *argvars, typval_T *rettv) } pat = addstar(xpc.xp_pattern, xpc.xp_pattern_len, xpc.xp_context); - if ((rettv_list_alloc(rettv) != FAIL) && (pat != NULL)) { - int i; - + rettv_list_alloc(rettv); + if (pat != NULL) { ExpandOne(&xpc, pat, NULL, options, WILD_ALL_KEEP); - for (i = 0; i < xpc.xp_numfiles; i++) { + for (int i = 0; i < xpc.xp_numfiles; i++) { list_append_string(rettv->vval.v_list, xpc.xp_files[i], -1); } } @@ -10037,7 +9689,7 @@ static void f_getcompletion(typval_T *argvars, typval_T *rettv) /// @pre An argument may not be -1 if preceding arguments are not all -1. /// /// @post The return value will be a string. -static void f_getcwd(typval_T *argvars, typval_T *rettv) +static void f_getcwd(typval_T *argvars, typval_T *rettv, FunPtr fptr) { // Possible scope of working directory to return. CdScope scope = kCdScopeInvalid; @@ -10122,26 +9774,20 @@ static void f_getcwd(typval_T *argvars, typval_T *rettv) if (from) { break; } - case kCdScopeTab: // FALLTHROUGH + case kCdScopeTab: // FALLTHROUGH assert(tp); from = tp->localdir; if (from) { break; } - case kCdScopeGlobal: // FALLTHROUGH - // The `globaldir` variable is not always set. - if (globaldir) { + case kCdScopeGlobal: // FALLTHROUGH + if (globaldir) { // `globaldir` is not always set. from = globaldir; - } else { - // We have to copy the OS path directly into output string. - if (os_dirname(cwd, MAXPATHL) == FAIL) { - EMSG(_("E41: Could not display path.")); - goto end; - } + } else if (os_dirname(cwd, MAXPATHL) == FAIL) { // Get the OS CWD. + from = (char_u *)""; // Return empty string on failure. } break; - case kCdScopeInvalid: - // We should never get here + case kCdScopeInvalid: // We should never get here assert(false); } @@ -10153,14 +9799,14 @@ static void f_getcwd(typval_T *argvars, typval_T *rettv) #ifdef BACKSLASH_IN_FILENAME slash_adjust(rettv->vval.v_string); #endif -end: + xfree(cwd); } /* * "getfontname()" function */ -static void f_getfontname(typval_T *argvars, typval_T *rettv) +static void f_getfontname(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; @@ -10169,7 +9815,7 @@ static void f_getfontname(typval_T *argvars, typval_T *rettv) /* * "getfperm({fname})" function */ -static void f_getfperm(typval_T *argvars, typval_T *rettv) +static void f_getfperm(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *perm = NULL; char_u flags[] = "rwx"; @@ -10190,7 +9836,7 @@ static void f_getfperm(typval_T *argvars, typval_T *rettv) /* * "getfsize({fname})" function */ -static void f_getfsize(typval_T *argvars, typval_T *rettv) +static void f_getfsize(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char *fname = (char *)get_tv_string(&argvars[0]); @@ -10217,7 +9863,7 @@ static void f_getfsize(typval_T *argvars, typval_T *rettv) /* * "getftime({fname})" function */ -static void f_getftime(typval_T *argvars, typval_T *rettv) +static void f_getftime(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char *fname = (char *)get_tv_string(&argvars[0]); @@ -10232,7 +9878,7 @@ static void f_getftime(typval_T *argvars, typval_T *rettv) /* * "getftype({fname})" function */ -static void f_getftype(typval_T *argvars, typval_T *rettv) +static void f_getftype(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *fname; char_u *type = NULL; @@ -10308,7 +9954,7 @@ static void f_getftype(typval_T *argvars, typval_T *rettv) /* * "getline(lnum, [end])" function */ -static void f_getline(typval_T *argvars, typval_T *rettv) +static void f_getline(typval_T *argvars, typval_T *rettv, FunPtr fptr) { linenr_T lnum; linenr_T end; @@ -10329,7 +9975,7 @@ static void f_getline(typval_T *argvars, typval_T *rettv) /* * "getmatches()" function */ -static void f_getmatches(typval_T *argvars, typval_T *rettv) +static void f_getmatches(typval_T *argvars, typval_T *rettv, FunPtr fptr) { matchitem_T *cur = curwin->w_match_head; int i; @@ -10378,7 +10024,7 @@ static void f_getmatches(typval_T *argvars, typval_T *rettv) /* * "getpid()" function */ -static void f_getpid(typval_T *argvars, typval_T *rettv) +static void f_getpid(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->vval.v_number = os_get_pid(); } @@ -10414,7 +10060,7 @@ static void getpos_both(typval_T *argvars, typval_T *rettv, bool getcurpos) /* * "getcurpos(string)" function */ -static void f_getcurpos(typval_T *argvars, typval_T *rettv) +static void f_getcurpos(typval_T *argvars, typval_T *rettv, FunPtr fptr) { getpos_both(argvars, rettv, true); } @@ -10422,7 +10068,7 @@ static void f_getcurpos(typval_T *argvars, typval_T *rettv) /* * "getpos(string)" function */ -static void f_getpos(typval_T *argvars, typval_T *rettv) +static void f_getpos(typval_T *argvars, typval_T *rettv, FunPtr fptr) { getpos_both(argvars, rettv, false); } @@ -10430,7 +10076,7 @@ static void f_getpos(typval_T *argvars, typval_T *rettv) /* * "getqflist()" and "getloclist()" functions */ -static void f_getqflist(typval_T *argvars, typval_T *rettv) +static void f_getqflist(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv_list_alloc(rettv); win_T *wp = NULL; @@ -10444,7 +10090,7 @@ static void f_getqflist(typval_T *argvars, typval_T *rettv) } /// "getreg()" function -static void f_getreg(typval_T *argvars, typval_T *rettv) +static void f_getreg(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *strregname; int regname; @@ -10490,7 +10136,7 @@ static void f_getreg(typval_T *argvars, typval_T *rettv) /* * "getregtype()" function */ -static void f_getregtype(typval_T *argvars, typval_T *rettv) +static void f_getregtype(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *strregname; int regname; @@ -10522,7 +10168,7 @@ static void f_getregtype(typval_T *argvars, typval_T *rettv) /* * "gettabvar()" function */ -static void f_gettabvar(typval_T *argvars, typval_T *rettv) +static void f_gettabvar(typval_T *argvars, typval_T *rettv, FunPtr fptr) { win_T *oldcurwin; tabpage_T *tp, *oldtabpage; @@ -10561,7 +10207,7 @@ static void f_gettabvar(typval_T *argvars, typval_T *rettv) /* * "gettabwinvar()" function */ -static void f_gettabwinvar(typval_T *argvars, typval_T *rettv) +static void f_gettabwinvar(typval_T *argvars, typval_T *rettv, FunPtr fptr) { getwinvar(argvars, rettv, 1); } @@ -10569,7 +10215,7 @@ static void f_gettabwinvar(typval_T *argvars, typval_T *rettv) /* * "getwinposx()" function */ -static void f_getwinposx(typval_T *argvars, typval_T *rettv) +static void f_getwinposx(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->vval.v_number = -1; } @@ -10577,7 +10223,7 @@ static void f_getwinposx(typval_T *argvars, typval_T *rettv) /* * "getwinposy()" function */ -static void f_getwinposy(typval_T *argvars, typval_T *rettv) +static void f_getwinposy(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->vval.v_number = -1; } @@ -10641,7 +10287,7 @@ static win_T *find_tabwin(typval_T *wvp, typval_T *tvp) } /// "getwinvar()" function -static void f_getwinvar(typval_T *argvars, typval_T *rettv) +static void f_getwinvar(typval_T *argvars, typval_T *rettv, FunPtr fptr) { getwinvar(argvars, rettv, 0); } @@ -10712,7 +10358,7 @@ getwinvar ( /* * "glob()" function */ -static void f_glob(typval_T *argvars, typval_T *rettv) +static void f_glob(typval_T *argvars, typval_T *rettv, FunPtr fptr) { int options = WILD_SILENT|WILD_USE_NL; expand_T xpc; @@ -10756,7 +10402,7 @@ static void f_glob(typval_T *argvars, typval_T *rettv) } /// "globpath()" function -static void f_globpath(typval_T *argvars, typval_T *rettv) +static void f_globpath(typval_T *argvars, typval_T *rettv, FunPtr fptr) { int flags = 0; // Flags for globpath. int error = false; @@ -10807,7 +10453,7 @@ static void f_globpath(typval_T *argvars, typval_T *rettv) } // "glob2regpat()" function -static void f_glob2regpat(typval_T *argvars, typval_T *rettv) +static void f_glob2regpat(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *pat = get_tv_string_chk(&argvars[0]); // NULL on type error @@ -10820,7 +10466,7 @@ static void f_glob2regpat(typval_T *argvars, typval_T *rettv) /* * "has()" function */ -static void f_has(typval_T *argvars, typval_T *rettv) +static void f_has(typval_T *argvars, typval_T *rettv, FunPtr fptr) { int i; char_u *name; @@ -10988,7 +10634,7 @@ static void f_has(typval_T *argvars, typval_T *rettv) /* * "has_key()" function */ -static void f_has_key(typval_T *argvars, typval_T *rettv) +static void f_has_key(typval_T *argvars, typval_T *rettv, FunPtr fptr) { if (argvars[0].v_type != VAR_DICT) { EMSG(_(e_dictreq)); @@ -11012,7 +10658,7 @@ static void f_has_key(typval_T *argvars, typval_T *rettv) /// @pre An argument may not be -1 if preceding arguments are not all -1. /// /// @post The return value will be either the number `1` or `0`. -static void f_haslocaldir(typval_T *argvars, typval_T *rettv) +static void f_haslocaldir(typval_T *argvars, typval_T *rettv, FunPtr fptr) { // Possible scope of working directory to return. CdScope scope = kCdScopeInvalid; @@ -11105,7 +10751,7 @@ static void f_haslocaldir(typval_T *argvars, typval_T *rettv) /* * "hasmapto()" function */ -static void f_hasmapto(typval_T *argvars, typval_T *rettv) +static void f_hasmapto(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *name; char_u *mode; @@ -11130,7 +10776,7 @@ static void f_hasmapto(typval_T *argvars, typval_T *rettv) /* * "histadd()" function */ -static void f_histadd(typval_T *argvars, typval_T *rettv) +static void f_histadd(typval_T *argvars, typval_T *rettv, FunPtr fptr) { HistoryType histype; char_u *str; @@ -11156,7 +10802,7 @@ static void f_histadd(typval_T *argvars, typval_T *rettv) /* * "histdel()" function */ -static void f_histdel(typval_T *argvars, typval_T *rettv) +static void f_histdel(typval_T *argvars, typval_T *rettv, FunPtr fptr) { int n; char_u buf[NUMBUFLEN]; @@ -11183,7 +10829,7 @@ static void f_histdel(typval_T *argvars, typval_T *rettv) /* * "histget()" function */ -static void f_histget(typval_T *argvars, typval_T *rettv) +static void f_histget(typval_T *argvars, typval_T *rettv, FunPtr fptr) { HistoryType type; int idx; @@ -11208,7 +10854,7 @@ static void f_histget(typval_T *argvars, typval_T *rettv) /* * "histnr()" function */ -static void f_histnr(typval_T *argvars, typval_T *rettv) +static void f_histnr(typval_T *argvars, typval_T *rettv, FunPtr fptr) { int i; @@ -11227,7 +10873,7 @@ static void f_histnr(typval_T *argvars, typval_T *rettv) /* * "highlightID(name)" function */ -static void f_hlID(typval_T *argvars, typval_T *rettv) +static void f_hlID(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->vval.v_number = syn_name2id(get_tv_string(&argvars[0])); } @@ -11235,7 +10881,7 @@ static void f_hlID(typval_T *argvars, typval_T *rettv) /* * "highlight_exists()" function */ -static void f_hlexists(typval_T *argvars, typval_T *rettv) +static void f_hlexists(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->vval.v_number = highlight_exists(get_tv_string(&argvars[0])); } @@ -11243,7 +10889,7 @@ static void f_hlexists(typval_T *argvars, typval_T *rettv) /* * "hostname()" function */ -static void f_hostname(typval_T *argvars, typval_T *rettv) +static void f_hostname(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char hostname[256]; @@ -11255,7 +10901,7 @@ static void f_hostname(typval_T *argvars, typval_T *rettv) /* * iconv() function */ -static void f_iconv(typval_T *argvars, typval_T *rettv) +static void f_iconv(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u buf1[NUMBUFLEN]; char_u buf2[NUMBUFLEN]; @@ -11285,7 +10931,7 @@ static void f_iconv(typval_T *argvars, typval_T *rettv) /* * "indent()" function */ -static void f_indent(typval_T *argvars, typval_T *rettv) +static void f_indent(typval_T *argvars, typval_T *rettv, FunPtr fptr) { linenr_T lnum; @@ -11299,7 +10945,7 @@ static void f_indent(typval_T *argvars, typval_T *rettv) /* * "index()" function */ -static void f_index(typval_T *argvars, typval_T *rettv) +static void f_index(typval_T *argvars, typval_T *rettv, FunPtr fptr) { list_T *l; listitem_T *item; @@ -11430,7 +11076,7 @@ static void get_user_input(typval_T *argvars, typval_T *rettv, int inputdialog) * "input()" function * Also handles inputsecret() when inputsecret is set. */ -static void f_input(typval_T *argvars, typval_T *rettv) +static void f_input(typval_T *argvars, typval_T *rettv, FunPtr fptr) { get_user_input(argvars, rettv, FALSE); } @@ -11438,7 +11084,7 @@ static void f_input(typval_T *argvars, typval_T *rettv) /* * "inputdialog()" function */ -static void f_inputdialog(typval_T *argvars, typval_T *rettv) +static void f_inputdialog(typval_T *argvars, typval_T *rettv, FunPtr fptr) { get_user_input(argvars, rettv, TRUE); } @@ -11446,7 +11092,7 @@ static void f_inputdialog(typval_T *argvars, typval_T *rettv) /* * "inputlist()" function */ -static void f_inputlist(typval_T *argvars, typval_T *rettv) +static void f_inputlist(typval_T *argvars, typval_T *rettv, FunPtr fptr) { listitem_T *li; int selected; @@ -11482,7 +11128,7 @@ static garray_T ga_userinput = {0, 0, sizeof(tasave_T), 4, NULL}; /* * "inputrestore()" function */ -static void f_inputrestore(typval_T *argvars, typval_T *rettv) +static void f_inputrestore(typval_T *argvars, typval_T *rettv, FunPtr fptr) { if (!GA_EMPTY(&ga_userinput)) { --ga_userinput.ga_len; @@ -11498,7 +11144,7 @@ static void f_inputrestore(typval_T *argvars, typval_T *rettv) /* * "inputsave()" function */ -static void f_inputsave(typval_T *argvars, typval_T *rettv) +static void f_inputsave(typval_T *argvars, typval_T *rettv, FunPtr fptr) { // Add an entry to the stack of typeahead storage. tasave_T *p = GA_APPEND_VIA_PTR(tasave_T, &ga_userinput); @@ -11508,19 +11154,19 @@ static void f_inputsave(typval_T *argvars, typval_T *rettv) /* * "inputsecret()" function */ -static void f_inputsecret(typval_T *argvars, typval_T *rettv) +static void f_inputsecret(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - ++cmdline_star; - ++inputsecret_flag; - f_input(argvars, rettv); - --cmdline_star; - --inputsecret_flag; + cmdline_star++; + inputsecret_flag++; + f_input(argvars, rettv, NULL); + cmdline_star--; + inputsecret_flag--; } /* * "insert()" function */ -static void f_insert(typval_T *argvars, typval_T *rettv) +static void f_insert(typval_T *argvars, typval_T *rettv, FunPtr fptr) { long before = 0; listitem_T *item; @@ -11559,7 +11205,7 @@ static void f_insert(typval_T *argvars, typval_T *rettv) /* * "invert(expr)" function */ -static void f_invert(typval_T *argvars, typval_T *rettv) +static void f_invert(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->vval.v_number = ~get_tv_number_chk(&argvars[0], NULL); } @@ -11567,7 +11213,7 @@ static void f_invert(typval_T *argvars, typval_T *rettv) /* * "isdirectory()" function */ -static void f_isdirectory(typval_T *argvars, typval_T *rettv) +static void f_isdirectory(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->vval.v_number = os_isdir(get_tv_string(&argvars[0])); } @@ -11575,7 +11221,7 @@ static void f_isdirectory(typval_T *argvars, typval_T *rettv) /* * "islocked()" function */ -static void f_islocked(typval_T *argvars, typval_T *rettv) +static void f_islocked(typval_T *argvars, typval_T *rettv, FunPtr fptr) { lval_T lv; char_u *end; @@ -11687,13 +11333,13 @@ static void dict_list(typval_T *argvars, typval_T *rettv, int what) /* * "items(dict)" function */ -static void f_items(typval_T *argvars, typval_T *rettv) +static void f_items(typval_T *argvars, typval_T *rettv, FunPtr fptr) { dict_list(argvars, rettv, 2); } // "jobclose(id[, stream])" function -static void f_jobclose(typval_T *argvars, typval_T *rettv) +static void f_jobclose(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->v_type = VAR_NUMBER; rettv->vval.v_number = 0; @@ -11719,21 +11365,40 @@ static void f_jobclose(typval_T *argvars, typval_T *rettv) if (argvars[1].v_type == VAR_STRING) { char *stream = (char *)argvars[1].vval.v_string; if (!strcmp(stream, "stdin")) { - process_close_in(proc); + if (data->rpc) { + EMSG(_("Invalid stream on rpc job, use jobclose(id, 'rpc')")); + } else { + process_close_in(proc); + } } else if (!strcmp(stream, "stdout")) { - process_close_out(proc); + if (data->rpc) { + EMSG(_("Invalid stream on rpc job, use jobclose(id, 'rpc')")); + } else { + process_close_out(proc); + } } else if (!strcmp(stream, "stderr")) { process_close_err(proc); + } else if (!strcmp(stream, "rpc")) { + if (data->rpc) { + channel_close(data->id); + } else { + EMSG(_("Invalid job stream: Not an rpc job")); + } } else { EMSG2(_("Invalid job stream \"%s\""), stream); } } else { - process_close_streams(proc); + if (data->rpc) { + channel_close(data->id); + process_close_err(proc); + } else { + process_close_streams(proc); + } } } // "jobpid(id)" function -static void f_jobpid(typval_T *argvars, typval_T *rettv) +static void f_jobpid(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->v_type = VAR_NUMBER; rettv->vval.v_number = 0; @@ -11758,7 +11423,7 @@ static void f_jobpid(typval_T *argvars, typval_T *rettv) } // "jobsend()" function -static void f_jobsend(typval_T *argvars, typval_T *rettv) +static void f_jobsend(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->v_type = VAR_NUMBER; rettv->vval.v_number = 0; @@ -11785,6 +11450,11 @@ static void f_jobsend(typval_T *argvars, typval_T *rettv) return; } + if (data->rpc) { + EMSG(_("Can't send raw data to rpc channel")); + return; + } + ssize_t input_len; char *input = (char *) save_tv_as_string(&argvars[1], &input_len, false); if (!input) { @@ -11798,7 +11468,7 @@ static void f_jobsend(typval_T *argvars, typval_T *rettv) } // "jobresize(job, width, height)" function -static void f_jobresize(typval_T *argvars, typval_T *rettv) +static void f_jobresize(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->v_type = VAR_NUMBER; rettv->vval.v_number = 0; @@ -11885,7 +11555,7 @@ static char **tv_to_argv(typval_T *cmd_tv, char **cmd) } // "jobstart()" function -static void f_jobstart(typval_T *argvars, typval_T *rettv) +static void f_jobstart(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->v_type = VAR_NUMBER; rettv->vval.v_number = 0; @@ -11906,13 +11576,24 @@ static void f_jobstart(typval_T *argvars, typval_T *rettv) return; } + dict_T *job_opts = NULL; + bool detach = false, rpc = false, pty = false; ufunc_T *on_stdout = NULL, *on_stderr = NULL, *on_exit = NULL; char *cwd = NULL; if (argvars[1].v_type == VAR_DICT) { job_opts = argvars[1].vval.v_dict; - char *new_cwd = (char *)get_dict_string(job_opts, (char_u *)"cwd", false); + detach = get_dict_number(job_opts, "detach") != 0; + rpc = get_dict_number(job_opts, "rpc") != 0; + pty = get_dict_number(job_opts, "pty") != 0; + if (pty && rpc) { + EMSG2(_(e_invarg2), "job cannot have both 'pty' and 'rpc' options set"); + shell_free_argv(argv); + return; + } + + char *new_cwd = (char *)get_dict_string(job_opts, "cwd", false); if (new_cwd && strlen(new_cwd) > 0) { cwd = new_cwd; // The new cwd must be a directory. @@ -11929,28 +11610,26 @@ static void f_jobstart(typval_T *argvars, typval_T *rettv) } } - bool pty = job_opts && get_dict_number(job_opts, (uint8_t *)"pty") != 0; - bool detach = job_opts && get_dict_number(job_opts, (uint8_t *)"detach") != 0; TerminalJobData *data = common_job_init(argv, on_stdout, on_stderr, on_exit, - job_opts, pty, detach, cwd); + job_opts, pty, rpc, detach, cwd); Process *proc = (Process *)&data->proc; if (pty) { - uint16_t width = get_dict_number(job_opts, (uint8_t *)"width"); + uint16_t width = get_dict_number(job_opts, "width"); if (width > 0) { data->proc.pty.width = width; } - uint16_t height = get_dict_number(job_opts, (uint8_t *)"height"); + uint16_t height = get_dict_number(job_opts, "height"); if (height > 0) { data->proc.pty.height = height; } - char *term = (char *)get_dict_string(job_opts, (uint8_t *)"TERM", true); + char *term = (char *)get_dict_string(job_opts, "TERM", true); if (term) { data->proc.pty.term_name = term; } } - if (!on_stdout) { + if (!rpc && !on_stdout) { proc->out = NULL; } if (!on_stderr) { @@ -11960,7 +11639,7 @@ static void f_jobstart(typval_T *argvars, typval_T *rettv) } // "jobstop()" function -static void f_jobstop(typval_T *argvars, typval_T *rettv) +static void f_jobstop(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->v_type = VAR_NUMBER; rettv->vval.v_number = 0; @@ -11988,7 +11667,7 @@ static void f_jobstop(typval_T *argvars, typval_T *rettv) } // "jobwait(ids[, timeout])" function -static void f_jobwait(typval_T *argvars, typval_T *rettv) +static void f_jobwait(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->v_type = VAR_NUMBER; rettv->vval.v_number = 0; @@ -12098,7 +11777,7 @@ static void f_jobwait(typval_T *argvars, typval_T *rettv) /* * "join()" function */ -static void f_join(typval_T *argvars, typval_T *rettv) +static void f_join(typval_T *argvars, typval_T *rettv, FunPtr fptr) { garray_T ga; char_u *sep; @@ -12126,7 +11805,7 @@ static void f_join(typval_T *argvars, typval_T *rettv) } /// json_decode() function -static void f_json_decode(typval_T *argvars, typval_T *rettv) +static void f_json_decode(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char numbuf[NUMBUFLEN]; char *s = NULL; @@ -12160,7 +11839,7 @@ static void f_json_decode(typval_T *argvars, typval_T *rettv) } /// json_encode() function -static void f_json_encode(typval_T *argvars, typval_T *rettv) +static void f_json_encode(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->v_type = VAR_STRING; rettv->vval.v_string = (char_u *) encode_tv2json(&argvars[0], NULL); @@ -12169,7 +11848,7 @@ static void f_json_encode(typval_T *argvars, typval_T *rettv) /* * "keys()" function */ -static void f_keys(typval_T *argvars, typval_T *rettv) +static void f_keys(typval_T *argvars, typval_T *rettv, FunPtr fptr) { dict_list(argvars, rettv, 0); } @@ -12177,7 +11856,7 @@ static void f_keys(typval_T *argvars, typval_T *rettv) /* * "last_buffer_nr()" function. */ -static void f_last_buffer_nr(typval_T *argvars, typval_T *rettv) +static void f_last_buffer_nr(typval_T *argvars, typval_T *rettv, FunPtr fptr) { int n = 0; @@ -12193,7 +11872,7 @@ static void f_last_buffer_nr(typval_T *argvars, typval_T *rettv) /* * "len()" function */ -static void f_len(typval_T *argvars, typval_T *rettv) +static void f_len(typval_T *argvars, typval_T *rettv, FunPtr fptr) { switch (argvars[0].v_type) { case VAR_STRING: @@ -12264,7 +11943,7 @@ static void libcall_common(typval_T *argvars, typval_T *rettv, int out_type) /* * "libcall()" function */ -static void f_libcall(typval_T *argvars, typval_T *rettv) +static void f_libcall(typval_T *argvars, typval_T *rettv, FunPtr fptr) { libcall_common(argvars, rettv, VAR_STRING); } @@ -12272,7 +11951,7 @@ static void f_libcall(typval_T *argvars, typval_T *rettv) /* * "libcallnr()" function */ -static void f_libcallnr(typval_T *argvars, typval_T *rettv) +static void f_libcallnr(typval_T *argvars, typval_T *rettv, FunPtr fptr) { libcall_common(argvars, rettv, VAR_NUMBER); } @@ -12280,7 +11959,7 @@ static void f_libcallnr(typval_T *argvars, typval_T *rettv) /* * "line(string)" function */ -static void f_line(typval_T *argvars, typval_T *rettv) +static void f_line(typval_T *argvars, typval_T *rettv, FunPtr fptr) { linenr_T lnum = 0; pos_T *fp; @@ -12295,7 +11974,7 @@ static void f_line(typval_T *argvars, typval_T *rettv) /* * "line2byte(lnum)" function */ -static void f_line2byte(typval_T *argvars, typval_T *rettv) +static void f_line2byte(typval_T *argvars, typval_T *rettv, FunPtr fptr) { linenr_T lnum; @@ -12311,7 +11990,7 @@ static void f_line2byte(typval_T *argvars, typval_T *rettv) /* * "lispindent(lnum)" function */ -static void f_lispindent(typval_T *argvars, typval_T *rettv) +static void f_lispindent(typval_T *argvars, typval_T *rettv, FunPtr fptr) { pos_T pos; linenr_T lnum; @@ -12329,7 +12008,7 @@ static void f_lispindent(typval_T *argvars, typval_T *rettv) /* * "localtime()" function */ -static void f_localtime(typval_T *argvars, typval_T *rettv) +static void f_localtime(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->vval.v_number = (varnumber_T)time(NULL); } @@ -12405,26 +12084,9 @@ static void get_maparg(typval_T *argvars, typval_T *rettv, int exact) } /* - * "log()" function - */ -static void f_log(typval_T *argvars, typval_T *rettv) -{ - float_op_wrapper(argvars, rettv, &log); -} - -/* - * "log10()" function - */ -static void f_log10(typval_T *argvars, typval_T *rettv) -{ - float_op_wrapper(argvars, rettv, &log10); -} - - -/* * "map()" function */ -static void f_map(typval_T *argvars, typval_T *rettv) +static void f_map(typval_T *argvars, typval_T *rettv, FunPtr fptr) { filter_map(argvars, rettv, TRUE); } @@ -12432,7 +12094,7 @@ static void f_map(typval_T *argvars, typval_T *rettv) /* * "maparg()" function */ -static void f_maparg(typval_T *argvars, typval_T *rettv) +static void f_maparg(typval_T *argvars, typval_T *rettv, FunPtr fptr) { get_maparg(argvars, rettv, TRUE); } @@ -12440,7 +12102,7 @@ static void f_maparg(typval_T *argvars, typval_T *rettv) /* * "mapcheck()" function */ -static void f_mapcheck(typval_T *argvars, typval_T *rettv) +static void f_mapcheck(typval_T *argvars, typval_T *rettv, FunPtr fptr) { get_maparg(argvars, rettv, FALSE); } @@ -12605,7 +12267,7 @@ theend: /* * "match()" function */ -static void f_match(typval_T *argvars, typval_T *rettv) +static void f_match(typval_T *argvars, typval_T *rettv, FunPtr fptr) { find_some_match(argvars, rettv, 1); } @@ -12613,7 +12275,7 @@ static void f_match(typval_T *argvars, typval_T *rettv) /* * "matchadd()" function */ -static void f_matchadd(typval_T *argvars, typval_T *rettv) +static void f_matchadd(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u buf[NUMBUFLEN]; char_u *grp = get_tv_string_buf_chk(&argvars[0], buf); /* group */ @@ -12639,7 +12301,7 @@ static void f_matchadd(typval_T *argvars, typval_T *rettv) if (dict_find(argvars[4].vval.v_dict, (char_u *)"conceal", -1) != NULL) { conceal_char = get_dict_string(argvars[4].vval.v_dict, - (char_u *)"conceal", false); + "conceal", false); } } } @@ -12656,7 +12318,7 @@ static void f_matchadd(typval_T *argvars, typval_T *rettv) conceal_char); } -static void f_matchaddpos(typval_T *argvars, typval_T *rettv) FUNC_ATTR_NONNULL_ALL +static void f_matchaddpos(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->vval.v_number = -1; @@ -12695,7 +12357,7 @@ static void f_matchaddpos(typval_T *argvars, typval_T *rettv) FUNC_ATTR_NONNULL_ if (dict_find(argvars[4].vval.v_dict, (char_u *)"conceal", -1) != NULL) { conceal_char = get_dict_string(argvars[4].vval.v_dict, - (char_u *)"conceal", false); + "conceal", false); } } } @@ -12717,7 +12379,7 @@ static void f_matchaddpos(typval_T *argvars, typval_T *rettv) FUNC_ATTR_NONNULL_ /* * "matcharg()" function */ -static void f_matcharg(typval_T *argvars, typval_T *rettv) +static void f_matcharg(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv_list_alloc(rettv); @@ -12739,7 +12401,7 @@ static void f_matcharg(typval_T *argvars, typval_T *rettv) /* * "matchdelete()" function */ -static void f_matchdelete(typval_T *argvars, typval_T *rettv) +static void f_matchdelete(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->vval.v_number = match_delete(curwin, (int)get_tv_number(&argvars[0]), TRUE); @@ -12748,7 +12410,7 @@ static void f_matchdelete(typval_T *argvars, typval_T *rettv) /* * "matchend()" function */ -static void f_matchend(typval_T *argvars, typval_T *rettv) +static void f_matchend(typval_T *argvars, typval_T *rettv, FunPtr fptr) { find_some_match(argvars, rettv, 0); } @@ -12756,7 +12418,7 @@ static void f_matchend(typval_T *argvars, typval_T *rettv) /* * "matchlist()" function */ -static void f_matchlist(typval_T *argvars, typval_T *rettv) +static void f_matchlist(typval_T *argvars, typval_T *rettv, FunPtr fptr) { find_some_match(argvars, rettv, 3); } @@ -12764,7 +12426,7 @@ static void f_matchlist(typval_T *argvars, typval_T *rettv) /* * "matchstr()" function */ -static void f_matchstr(typval_T *argvars, typval_T *rettv) +static void f_matchstr(typval_T *argvars, typval_T *rettv, FunPtr fptr) { find_some_match(argvars, rettv, 2); } @@ -12824,7 +12486,7 @@ static void max_min(typval_T *argvars, typval_T *rettv, int domax) /* * "max()" function */ -static void f_max(typval_T *argvars, typval_T *rettv) +static void f_max(typval_T *argvars, typval_T *rettv, FunPtr fptr) { max_min(argvars, rettv, TRUE); } @@ -12832,7 +12494,7 @@ static void f_max(typval_T *argvars, typval_T *rettv) /* * "min()" function */ -static void f_min(typval_T *argvars, typval_T *rettv) +static void f_min(typval_T *argvars, typval_T *rettv, FunPtr fptr) { max_min(argvars, rettv, FALSE); } @@ -12840,7 +12502,7 @@ static void f_min(typval_T *argvars, typval_T *rettv) /* * "mkdir()" function */ -static void f_mkdir(typval_T *argvars, typval_T *rettv) +static void f_mkdir(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *dir; char_u buf[NUMBUFLEN]; @@ -12882,7 +12544,7 @@ static void f_mkdir(typval_T *argvars, typval_T *rettv) /* * "mode()" function */ -static void f_mode(typval_T *argvars, typval_T *rettv) +static void f_mode(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u buf[3]; @@ -12936,7 +12598,7 @@ static void f_mode(typval_T *argvars, typval_T *rettv) } /// "msgpackdump()" function -static void f_msgpackdump(typval_T *argvars, typval_T *rettv) +static void f_msgpackdump(typval_T *argvars, typval_T *rettv, FunPtr fptr) FUNC_ATTR_NONNULL_ALL { if (argvars[0].v_type != VAR_LIST) { @@ -12964,7 +12626,7 @@ static void f_msgpackdump(typval_T *argvars, typval_T *rettv) } /// "msgpackparse" function -static void f_msgpackparse(typval_T *argvars, typval_T *rettv) +static void f_msgpackparse(typval_T *argvars, typval_T *rettv, FunPtr fptr) FUNC_ATTR_NONNULL_ALL { if (argvars[0].v_type != VAR_LIST) { @@ -13045,7 +12707,7 @@ f_msgpackparse_exit: /* * "nextnonblank()" function */ -static void f_nextnonblank(typval_T *argvars, typval_T *rettv) +static void f_nextnonblank(typval_T *argvars, typval_T *rettv, FunPtr fptr) { linenr_T lnum; @@ -13063,7 +12725,7 @@ static void f_nextnonblank(typval_T *argvars, typval_T *rettv) /* * "nr2char()" function */ -static void f_nr2char(typval_T *argvars, typval_T *rettv) +static void f_nr2char(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u buf[NUMBUFLEN]; @@ -13087,7 +12749,7 @@ static void f_nr2char(typval_T *argvars, typval_T *rettv) /* * "or(expr, expr)" function */ -static void f_or(typval_T *argvars, typval_T *rettv) +static void f_or(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->vval.v_number = get_tv_number_chk(&argvars[0], NULL) | get_tv_number_chk(&argvars[1], NULL); @@ -13096,7 +12758,7 @@ static void f_or(typval_T *argvars, typval_T *rettv) /* * "pathshorten()" function */ -static void f_pathshorten(typval_T *argvars, typval_T *rettv) +static void f_pathshorten(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->v_type = VAR_STRING; rettv->vval.v_string = get_tv_string_chk(&argvars[0]); @@ -13109,7 +12771,7 @@ static void f_pathshorten(typval_T *argvars, typval_T *rettv) /* * "pow()" function */ -static void f_pow(typval_T *argvars, typval_T *rettv) +static void f_pow(typval_T *argvars, typval_T *rettv, FunPtr fptr) { float_T fx, fy; @@ -13124,7 +12786,7 @@ static void f_pow(typval_T *argvars, typval_T *rettv) /* * "prevnonblank()" function */ -static void f_prevnonblank(typval_T *argvars, typval_T *rettv) +static void f_prevnonblank(typval_T *argvars, typval_T *rettv, FunPtr fptr) { linenr_T lnum; @@ -13146,7 +12808,7 @@ static va_list ap; /* * "printf()" function */ -static void f_printf(typval_T *argvars, typval_T *rettv) +static void f_printf(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; @@ -13172,7 +12834,7 @@ static void f_printf(typval_T *argvars, typval_T *rettv) /* * "pumvisible()" function */ -static void f_pumvisible(typval_T *argvars, typval_T *rettv) +static void f_pumvisible(typval_T *argvars, typval_T *rettv, FunPtr fptr) { if (pum_visible()) rettv->vval.v_number = 1; @@ -13181,7 +12843,7 @@ static void f_pumvisible(typval_T *argvars, typval_T *rettv) /* * "pyeval()" function */ -static void f_pyeval(typval_T *argvars, typval_T *rettv) +static void f_pyeval(typval_T *argvars, typval_T *rettv, FunPtr fptr) { script_host_eval("python", argvars, rettv); } @@ -13189,7 +12851,7 @@ static void f_pyeval(typval_T *argvars, typval_T *rettv) /* * "py3eval()" function */ -static void f_py3eval(typval_T *argvars, typval_T *rettv) +static void f_py3eval(typval_T *argvars, typval_T *rettv, FunPtr fptr) { script_host_eval("python3", argvars, rettv); } @@ -13197,7 +12859,7 @@ static void f_py3eval(typval_T *argvars, typval_T *rettv) /* * "range()" function */ -static void f_range(typval_T *argvars, typval_T *rettv) +static void f_range(typval_T *argvars, typval_T *rettv, FunPtr fptr) { long start; long end; @@ -13232,7 +12894,7 @@ static void f_range(typval_T *argvars, typval_T *rettv) /* * "readfile()" function */ -static void f_readfile(typval_T *argvars, typval_T *rettv) +static void f_readfile(typval_T *argvars, typval_T *rettv, FunPtr fptr) { int binary = FALSE; char_u *fname; @@ -13431,7 +13093,7 @@ static int list2proftime(typval_T *arg, proftime_T *tm) FUNC_ATTR_NONNULL_ALL /// one argument it returns the time passed since the argument. /// With two arguments it returns the time passed between /// the two arguments. -static void f_reltime(typval_T *argvars, typval_T *rettv) FUNC_ATTR_NONNULL_ALL +static void f_reltime(typval_T *argvars, typval_T *rettv, FunPtr fptr) { proftime_T res; proftime_T start; @@ -13477,7 +13139,7 @@ static void f_reltime(typval_T *argvars, typval_T *rettv) FUNC_ATTR_NONNULL_ALL /// @return The string representation of the argument, the format is the /// number of seconds followed by a dot, followed by the number /// of microseconds. -static void f_reltimestr(typval_T *argvars, typval_T *rettv) +static void f_reltimestr(typval_T *argvars, typval_T *rettv, FunPtr fptr) FUNC_ATTR_NONNULL_ALL { proftime_T tm; @@ -13492,7 +13154,7 @@ static void f_reltimestr(typval_T *argvars, typval_T *rettv) /* * "remove()" function */ -static void f_remove(typval_T *argvars, typval_T *rettv) +static void f_remove(typval_T *argvars, typval_T *rettv, FunPtr fptr) { list_T *l; listitem_T *item, *item2; @@ -13577,7 +13239,7 @@ static void f_remove(typval_T *argvars, typval_T *rettv) /* * "rename({from}, {to})" function */ -static void f_rename(typval_T *argvars, typval_T *rettv) +static void f_rename(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u buf[NUMBUFLEN]; @@ -13591,7 +13253,7 @@ static void f_rename(typval_T *argvars, typval_T *rettv) /* * "repeat()" function */ -static void f_repeat(typval_T *argvars, typval_T *rettv) +static void f_repeat(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *p; int n; @@ -13625,7 +13287,7 @@ static void f_repeat(typval_T *argvars, typval_T *rettv) /* * "resolve()" function */ -static void f_resolve(typval_T *argvars, typval_T *rettv) +static void f_resolve(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *p; #ifdef HAVE_READLINK @@ -13799,7 +13461,7 @@ fail: /* * "reverse({list})" function */ -static void f_reverse(typval_T *argvars, typval_T *rettv) +static void f_reverse(typval_T *argvars, typval_T *rettv, FunPtr fptr) { list_T *l; listitem_T *li, *ni; @@ -13970,16 +13632,8 @@ theend: return retval; } -/* - * "round({float})" function - */ -static void f_round(typval_T *argvars, typval_T *rettv) -{ - float_op_wrapper(argvars, rettv, &round); -} - // "rpcnotify()" function -static void f_rpcnotify(typval_T *argvars, typval_T *rettv) +static void f_rpcnotify(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->v_type = VAR_NUMBER; rettv->vval.v_number = 0; @@ -14015,7 +13669,7 @@ static void f_rpcnotify(typval_T *argvars, typval_T *rettv) } // "rpcrequest()" function -static void f_rpcrequest(typval_T *argvars, typval_T *rettv) +static void f_rpcrequest(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->v_type = VAR_NUMBER; rettv->vval.v_number = 0; @@ -14088,7 +13742,7 @@ static void f_rpcrequest(typval_T *argvars, typval_T *rettv) } if (err.set) { - vim_report_error(cstr_as_string(err.msg)); + nvim_err_writeln(cstr_as_string(err.msg)); goto end; } @@ -14100,8 +13754,8 @@ end: api_free_object(result); } -// "rpcstart()" function -static void f_rpcstart(typval_T *argvars, typval_T *rettv) +// "rpcstart()" function (DEPRECATED) +static void f_rpcstart(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->v_type = VAR_NUMBER; rettv->vval.v_number = 0; @@ -14153,17 +13807,14 @@ static void f_rpcstart(typval_T *argvars, typval_T *rettv) // The last item of argv must be NULL argv[i] = NULL; - uint64_t channel_id = channel_from_process(argv); - - if (!channel_id) { - EMSG(_(e_api_spawn_failed)); - } - rettv->vval.v_number = (varnumber_T)channel_id; + TerminalJobData *data = common_job_init(argv, NULL, NULL, NULL, + NULL, false, true, false, NULL); + common_job_start(data, rettv); } // "rpcstop()" function -static void f_rpcstop(typval_T *argvars, typval_T *rettv) +static void f_rpcstop(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->v_type = VAR_NUMBER; rettv->vval.v_number = 0; @@ -14178,13 +13829,18 @@ static void f_rpcstop(typval_T *argvars, typval_T *rettv) return; } - rettv->vval.v_number = channel_close(argvars[0].vval.v_number); + // if called with a job, stop it, else closes the channel + if (pmap_get(uint64_t)(jobs, argvars[0].vval.v_number)) { + f_jobstop(argvars, rettv, NULL); + } else { + rettv->vval.v_number = channel_close(argvars[0].vval.v_number); + } } /* * "screenattr()" function */ -static void f_screenattr(typval_T *argvars, typval_T *rettv) +static void f_screenattr(typval_T *argvars, typval_T *rettv, FunPtr fptr) { int row; int col; @@ -14203,7 +13859,7 @@ static void f_screenattr(typval_T *argvars, typval_T *rettv) /* * "screenchar()" function */ -static void f_screenchar(typval_T *argvars, typval_T *rettv) +static void f_screenchar(typval_T *argvars, typval_T *rettv, FunPtr fptr) { int row; int col; @@ -14230,7 +13886,7 @@ static void f_screenchar(typval_T *argvars, typval_T *rettv) * * First column is 1 to be consistent with virtcol(). */ -static void f_screencol(typval_T *argvars, typval_T *rettv) +static void f_screencol(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->vval.v_number = ui_current_col() + 1; } @@ -14238,7 +13894,7 @@ static void f_screencol(typval_T *argvars, typval_T *rettv) /* * "screenrow()" function */ -static void f_screenrow(typval_T *argvars, typval_T *rettv) +static void f_screenrow(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->vval.v_number = ui_current_row() + 1; } @@ -14246,7 +13902,7 @@ static void f_screenrow(typval_T *argvars, typval_T *rettv) /* * "search()" function */ -static void f_search(typval_T *argvars, typval_T *rettv) +static void f_search(typval_T *argvars, typval_T *rettv, FunPtr fptr) { int flags = 0; @@ -14256,7 +13912,7 @@ static void f_search(typval_T *argvars, typval_T *rettv) /* * "searchdecl()" function */ -static void f_searchdecl(typval_T *argvars, typval_T *rettv) +static void f_searchdecl(typval_T *argvars, typval_T *rettv, FunPtr fptr) { int locally = 1; int thisblock = 0; @@ -14349,7 +14005,7 @@ theend: /* * "searchpair()" function */ -static void f_searchpair(typval_T *argvars, typval_T *rettv) +static void f_searchpair(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->vval.v_number = searchpair_cmn(argvars, NULL); } @@ -14357,7 +14013,7 @@ static void f_searchpair(typval_T *argvars, typval_T *rettv) /* * "searchpairpos()" function */ -static void f_searchpairpos(typval_T *argvars, typval_T *rettv) +static void f_searchpairpos(typval_T *argvars, typval_T *rettv, FunPtr fptr) { pos_T match_pos; int lnum = 0; @@ -14522,7 +14178,7 @@ do_searchpair ( /* * "searchpos()" function */ -static void f_searchpos(typval_T *argvars, typval_T *rettv) +static void f_searchpos(typval_T *argvars, typval_T *rettv, FunPtr fptr) { pos_T match_pos; int lnum = 0; @@ -14545,7 +14201,7 @@ static void f_searchpos(typval_T *argvars, typval_T *rettv) } /// "serverlist()" function -static void f_serverlist(typval_T *argvars, typval_T *rettv) +static void f_serverlist(typval_T *argvars, typval_T *rettv, FunPtr fptr) { size_t n; char **addrs = server_address_list(&n); @@ -14563,7 +14219,7 @@ static void f_serverlist(typval_T *argvars, typval_T *rettv) } /// "serverstart()" function -static void f_serverstart(typval_T *argvars, typval_T *rettv) +static void f_serverstart(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; // Address of the new server @@ -14591,7 +14247,7 @@ static void f_serverstart(typval_T *argvars, typval_T *rettv) } /// "serverstop()" function -static void f_serverstop(typval_T *argvars, typval_T *rettv) +static void f_serverstop(typval_T *argvars, typval_T *rettv, FunPtr fptr) { if (check_restricted() || check_secure()) { return; @@ -14610,7 +14266,7 @@ static void f_serverstop(typval_T *argvars, typval_T *rettv) /* * "setbufvar()" function */ -static void f_setbufvar(typval_T *argvars, typval_T *rettv) +static void f_setbufvar(typval_T *argvars, typval_T *rettv, FunPtr fptr) { buf_T *buf; aco_save_T aco; @@ -14652,7 +14308,7 @@ static void f_setbufvar(typval_T *argvars, typval_T *rettv) } } -static void f_setcharsearch(typval_T *argvars, typval_T *rettv) +static void f_setcharsearch(typval_T *argvars, typval_T *rettv, FunPtr fptr) { dict_T *d; dictitem_T *di; @@ -14664,7 +14320,7 @@ static void f_setcharsearch(typval_T *argvars, typval_T *rettv) } if ((d = argvars[0].vval.v_dict) != NULL) { - csearch = get_dict_string(d, (char_u *)"char", FALSE); + csearch = get_dict_string(d, "char", false); if (csearch != NULL) { if (enc_utf8) { int pcc[MAX_MCO]; @@ -14689,7 +14345,7 @@ static void f_setcharsearch(typval_T *argvars, typval_T *rettv) /* * "setcmdpos()" function */ -static void f_setcmdpos(typval_T *argvars, typval_T *rettv) +static void f_setcmdpos(typval_T *argvars, typval_T *rettv, FunPtr fptr) { int pos = (int)get_tv_number(&argvars[0]) - 1; @@ -14699,7 +14355,7 @@ static void f_setcmdpos(typval_T *argvars, typval_T *rettv) /// "setfperm({fname}, {mode})" function -static void f_setfperm(typval_T *argvars, typval_T *rettv) +static void f_setfperm(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->vval.v_number = 0; @@ -14732,7 +14388,7 @@ static void f_setfperm(typval_T *argvars, typval_T *rettv) /* * "setline()" function */ -static void f_setline(typval_T *argvars, typval_T *rettv) +static void f_setline(typval_T *argvars, typval_T *rettv, FunPtr fptr) { linenr_T lnum; char_u *line = NULL; @@ -14857,7 +14513,7 @@ skip_args: /* * "setloclist()" function */ -static void f_setloclist(typval_T *argvars, typval_T *rettv) +static void f_setloclist(typval_T *argvars, typval_T *rettv, FunPtr fptr) { win_T *win; @@ -14872,7 +14528,7 @@ static void f_setloclist(typval_T *argvars, typval_T *rettv) /* * "setmatches()" function */ -static void f_setmatches(typval_T *argvars, typval_T *rettv) +static void f_setmatches(typval_T *argvars, typval_T *rettv, FunPtr fptr) { list_T *l; listitem_T *li; @@ -14938,16 +14594,16 @@ static void f_setmatches(typval_T *argvars, typval_T *rettv) } } - char_u *group = get_dict_string(d, (char_u *)"group", false); - int priority = get_dict_number(d, (char_u *)"priority"); - int id = get_dict_number(d, (char_u *)"id"); + char_u *group = get_dict_string(d, "group", false); + int priority = get_dict_number(d, "priority"); + int id = get_dict_number(d, "id"); char_u *conceal = dict_find(d, (char_u *)"conceal", -1) != NULL - ? get_dict_string(d, (char_u *)"conceal", + ? get_dict_string(d, "conceal", false) : NULL; if (i == 0) { match_add(curwin, group, - get_dict_string(d, (char_u *)"pattern", false), + get_dict_string(d, "pattern", false), priority, id, NULL, conceal); } else { match_add(curwin, group, NULL, priority, id, s, conceal); @@ -14963,7 +14619,7 @@ static void f_setmatches(typval_T *argvars, typval_T *rettv) /* * "setpos()" function */ -static void f_setpos(typval_T *argvars, typval_T *rettv) +static void f_setpos(typval_T *argvars, typval_T *rettv, FunPtr fptr) { pos_T pos; int fnum; @@ -15005,7 +14661,7 @@ static void f_setpos(typval_T *argvars, typval_T *rettv) /* * "setqflist()" function */ -static void f_setqflist(typval_T *argvars, typval_T *rettv) +static void f_setqflist(typval_T *argvars, typval_T *rettv, FunPtr fptr) { set_qf_ll_list(NULL, argvars, rettv); } @@ -15013,7 +14669,7 @@ static void f_setqflist(typval_T *argvars, typval_T *rettv) /* * "setreg()" function */ -static void f_setreg(typval_T *argvars, typval_T *rettv) +static void f_setreg(typval_T *argvars, typval_T *rettv, FunPtr fptr) { int regname; char_u *strregname; @@ -15108,7 +14764,7 @@ free_lstval: /* * "settabvar()" function */ -static void f_settabvar(typval_T *argvars, typval_T *rettv) +static void f_settabvar(typval_T *argvars, typval_T *rettv, FunPtr fptr) { tabpage_T *save_curtab; tabpage_T *tp; @@ -15145,7 +14801,7 @@ static void f_settabvar(typval_T *argvars, typval_T *rettv) /* * "settabwinvar()" function */ -static void f_settabwinvar(typval_T *argvars, typval_T *rettv) +static void f_settabwinvar(typval_T *argvars, typval_T *rettv, FunPtr fptr) { setwinvar(argvars, rettv, 1); } @@ -15153,7 +14809,7 @@ static void f_settabwinvar(typval_T *argvars, typval_T *rettv) /* * "setwinvar()" function */ -static void f_setwinvar(typval_T *argvars, typval_T *rettv) +static void f_setwinvar(typval_T *argvars, typval_T *rettv, FunPtr fptr) { setwinvar(argvars, rettv, 0); } @@ -15213,7 +14869,7 @@ static void setwinvar(typval_T *argvars, typval_T *rettv, int off) } /// f_sha256 - sha256({string}) function -static void f_sha256(typval_T *argvars, typval_T *rettv) +static void f_sha256(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *p = get_tv_string(&argvars[0]); const char_u *hash = sha256_bytes(p, (int) STRLEN(p) , NULL, 0); @@ -15226,7 +14882,7 @@ static void f_sha256(typval_T *argvars, typval_T *rettv) /* * "shellescape({string})" function */ -static void f_shellescape(typval_T *argvars, typval_T *rettv) +static void f_shellescape(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->vval.v_string = vim_strsave_shellescape( get_tv_string(&argvars[0]), non_zero_arg(&argvars[1]), true); @@ -15236,7 +14892,7 @@ static void f_shellescape(typval_T *argvars, typval_T *rettv) /* * shiftwidth() function */ -static void f_shiftwidth(typval_T *argvars, typval_T *rettv) +static void f_shiftwidth(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->vval.v_number = get_sw_value(curbuf); } @@ -15244,7 +14900,7 @@ static void f_shiftwidth(typval_T *argvars, typval_T *rettv) /* * "simplify()" function */ -static void f_simplify(typval_T *argvars, typval_T *rettv) +static void f_simplify(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *p; @@ -15254,22 +14910,6 @@ static void f_simplify(typval_T *argvars, typval_T *rettv) rettv->v_type = VAR_STRING; } -/* - * "sin()" function - */ -static void f_sin(typval_T *argvars, typval_T *rettv) -{ - float_op_wrapper(argvars, rettv, &sin); -} - -/* - * "sinh()" function - */ -static void f_sinh(typval_T *argvars, typval_T *rettv) -{ - float_op_wrapper(argvars, rettv, &sinh); -} - /// struct used in the array that's given to qsort() typedef struct { listitem_T *item; @@ -15617,13 +15257,13 @@ theend: } /// "sort"({list})" function -static void f_sort(typval_T *argvars, typval_T *rettv) +static void f_sort(typval_T *argvars, typval_T *rettv, FunPtr fptr) { do_sort_uniq(argvars, rettv, true); } /// "uniq({list})" function -static void f_uniq(typval_T *argvars, typval_T *rettv) +static void f_uniq(typval_T *argvars, typval_T *rettv, FunPtr fptr) { do_sort_uniq(argvars, rettv, false); } @@ -15631,7 +15271,7 @@ static void f_uniq(typval_T *argvars, typval_T *rettv) // // "reltimefloat()" function // -static void f_reltimefloat(typval_T *argvars , typval_T *rettv) +static void f_reltimefloat(typval_T *argvars , typval_T *rettv, FunPtr fptr) FUNC_ATTR_NONNULL_ALL { proftime_T tm; @@ -15646,7 +15286,7 @@ static void f_reltimefloat(typval_T *argvars , typval_T *rettv) /* * "soundfold({word})" function */ -static void f_soundfold(typval_T *argvars, typval_T *rettv) +static void f_soundfold(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *s; @@ -15658,7 +15298,7 @@ static void f_soundfold(typval_T *argvars, typval_T *rettv) /* * "spellbadword()" function */ -static void f_spellbadword(typval_T *argvars, typval_T *rettv) +static void f_spellbadword(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *word = (char_u *)""; hlf_T attr = HLF_COUNT; @@ -15702,7 +15342,7 @@ static void f_spellbadword(typval_T *argvars, typval_T *rettv) /* * "spellsuggest()" function */ -static void f_spellsuggest(typval_T *argvars, typval_T *rettv) +static void f_spellsuggest(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *str; int typeerr = FALSE; @@ -15742,7 +15382,7 @@ static void f_spellsuggest(typval_T *argvars, typval_T *rettv) } } -static void f_split(typval_T *argvars, typval_T *rettv) +static void f_split(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *str; char_u *end; @@ -15811,17 +15451,9 @@ static void f_split(typval_T *argvars, typval_T *rettv) } /* - * "sqrt()" function - */ -static void f_sqrt(typval_T *argvars, typval_T *rettv) -{ - float_op_wrapper(argvars, rettv, &sqrt); -} - -/* * "str2float()" function */ -static void f_str2float(typval_T *argvars, typval_T *rettv) +static void f_str2float(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *p = skipwhite(get_tv_string(&argvars[0])); @@ -15832,7 +15464,7 @@ static void f_str2float(typval_T *argvars, typval_T *rettv) } // "str2nr()" function -static void f_str2nr(typval_T *argvars, typval_T *rettv) +static void f_str2nr(typval_T *argvars, typval_T *rettv, FunPtr fptr) { int base = 10; char_u *p; @@ -15871,7 +15503,7 @@ static void f_str2nr(typval_T *argvars, typval_T *rettv) /* * "strftime({format}[, {time}])" function */ -static void f_strftime(typval_T *argvars, typval_T *rettv) +static void f_strftime(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u result_buf[256]; time_t seconds; @@ -15922,7 +15554,7 @@ static void f_strftime(typval_T *argvars, typval_T *rettv) /* * "stridx()" function */ -static void f_stridx(typval_T *argvars, typval_T *rettv) +static void f_stridx(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u buf[NUMBUFLEN]; char_u *needle; @@ -15955,7 +15587,7 @@ static void f_stridx(typval_T *argvars, typval_T *rettv) /* * "string()" function */ -static void f_string(typval_T *argvars, typval_T *rettv) +static void f_string(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->v_type = VAR_STRING; rettv->vval.v_string = (char_u *) encode_tv2string(&argvars[0], NULL); @@ -15964,7 +15596,7 @@ static void f_string(typval_T *argvars, typval_T *rettv) /* * "strlen()" function */ -static void f_strlen(typval_T *argvars, typval_T *rettv) +static void f_strlen(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->vval.v_number = (varnumber_T)(STRLEN( get_tv_string(&argvars[0]))); @@ -15973,7 +15605,7 @@ static void f_strlen(typval_T *argvars, typval_T *rettv) /* * "strchars()" function */ -static void f_strchars(typval_T *argvars, typval_T *rettv) +static void f_strchars(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *s = get_tv_string(&argvars[0]); int skipcc = 0; @@ -15998,7 +15630,7 @@ static void f_strchars(typval_T *argvars, typval_T *rettv) /* * "strdisplaywidth()" function */ -static void f_strdisplaywidth(typval_T *argvars, typval_T *rettv) +static void f_strdisplaywidth(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *s = get_tv_string(&argvars[0]); int col = 0; @@ -16012,7 +15644,7 @@ static void f_strdisplaywidth(typval_T *argvars, typval_T *rettv) /* * "strwidth()" function */ -static void f_strwidth(typval_T *argvars, typval_T *rettv) +static void f_strwidth(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *s = get_tv_string(&argvars[0]); @@ -16022,7 +15654,7 @@ static void f_strwidth(typval_T *argvars, typval_T *rettv) /* * "strpart()" function */ -static void f_strpart(typval_T *argvars, typval_T *rettv) +static void f_strpart(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *p; int n; @@ -16062,7 +15694,7 @@ static void f_strpart(typval_T *argvars, typval_T *rettv) /* * "strridx()" function */ -static void f_strridx(typval_T *argvars, typval_T *rettv) +static void f_strridx(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u buf[NUMBUFLEN]; char_u *needle; @@ -16108,7 +15740,7 @@ static void f_strridx(typval_T *argvars, typval_T *rettv) /* * "strtrans()" function */ -static void f_strtrans(typval_T *argvars, typval_T *rettv) +static void f_strtrans(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->v_type = VAR_STRING; rettv->vval.v_string = transstr(get_tv_string(&argvars[0])); @@ -16117,7 +15749,7 @@ static void f_strtrans(typval_T *argvars, typval_T *rettv) /* * "submatch()" function */ -static void f_submatch(typval_T *argvars, typval_T *rettv) +static void f_submatch(typval_T *argvars, typval_T *rettv, FunPtr fptr) { int error = FALSE; int no = (int)get_tv_number_chk(&argvars[0], &error); @@ -16146,7 +15778,7 @@ static void f_submatch(typval_T *argvars, typval_T *rettv) /* * "substitute()" function */ -static void f_substitute(typval_T *argvars, typval_T *rettv) +static void f_substitute(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u patbuf[NUMBUFLEN]; char_u subbuf[NUMBUFLEN]; @@ -16167,7 +15799,7 @@ static void f_substitute(typval_T *argvars, typval_T *rettv) /* * "synID(lnum, col, trans)" function */ -static void f_synID(typval_T *argvars, typval_T *rettv) +static void f_synID(typval_T *argvars, typval_T *rettv, FunPtr fptr) { int id = 0; long lnum; @@ -16189,7 +15821,7 @@ static void f_synID(typval_T *argvars, typval_T *rettv) /* * "synIDattr(id, what [, mode])" function */ -static void f_synIDattr(typval_T *argvars, typval_T *rettv) +static void f_synIDattr(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *p = NULL; int id; @@ -16265,7 +15897,7 @@ static void f_synIDattr(typval_T *argvars, typval_T *rettv) /* * "synIDtrans(id)" function */ -static void f_synIDtrans(typval_T *argvars, typval_T *rettv) +static void f_synIDtrans(typval_T *argvars, typval_T *rettv, FunPtr fptr) { int id; @@ -16282,7 +15914,7 @@ static void f_synIDtrans(typval_T *argvars, typval_T *rettv) /* * "synconcealed(lnum, col)" function */ -static void f_synconcealed(typval_T *argvars, typval_T *rettv) +static void f_synconcealed(typval_T *argvars, typval_T *rettv, FunPtr fptr) { long lnum; long col; @@ -16329,7 +15961,7 @@ static void f_synconcealed(typval_T *argvars, typval_T *rettv) /* * "synstack(lnum, col)" function */ -static void f_synstack(typval_T *argvars, typval_T *rettv) +static void f_synstack(typval_T *argvars, typval_T *rettv, FunPtr fptr) { long lnum; long col; @@ -16460,12 +16092,12 @@ static void get_system_output_as_rettv(typval_T *argvars, typval_T *rettv, } /// f_system - the VimL system() function -static void f_system(typval_T *argvars, typval_T *rettv) +static void f_system(typval_T *argvars, typval_T *rettv, FunPtr fptr) { get_system_output_as_rettv(argvars, rettv, false); } -static void f_systemlist(typval_T *argvars, typval_T *rettv) +static void f_systemlist(typval_T *argvars, typval_T *rettv, FunPtr fptr) { get_system_output_as_rettv(argvars, rettv, true); } @@ -16474,7 +16106,7 @@ static void f_systemlist(typval_T *argvars, typval_T *rettv) /* * "tabpagebuflist()" function */ -static void f_tabpagebuflist(typval_T *argvars, typval_T *rettv) +static void f_tabpagebuflist(typval_T *argvars, typval_T *rettv, FunPtr fptr) { tabpage_T *tp; win_T *wp = NULL; @@ -16499,7 +16131,7 @@ static void f_tabpagebuflist(typval_T *argvars, typval_T *rettv) /* * "tabpagenr()" function */ -static void f_tabpagenr(typval_T *argvars, typval_T *rettv) +static void f_tabpagenr(typval_T *argvars, typval_T *rettv, FunPtr fptr) { int nr = 1; char_u *arg; @@ -16563,7 +16195,7 @@ static int get_winnr(tabpage_T *tp, typval_T *argvar) /* * "tabpagewinnr()" function */ -static void f_tabpagewinnr(typval_T *argvars, typval_T *rettv) +static void f_tabpagewinnr(typval_T *argvars, typval_T *rettv, FunPtr fptr) { int nr = 1; tabpage_T *tp; @@ -16580,7 +16212,7 @@ static void f_tabpagewinnr(typval_T *argvars, typval_T *rettv) /* * "tagfiles()" function */ -static void f_tagfiles(typval_T *argvars, typval_T *rettv) +static void f_tagfiles(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *fname; tagname_T tn; @@ -16601,7 +16233,7 @@ static void f_tagfiles(typval_T *argvars, typval_T *rettv) /* * "taglist()" function */ -static void f_taglist(typval_T *argvars, typval_T *rettv) +static void f_taglist(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *tag_pattern; @@ -16617,14 +16249,14 @@ static void f_taglist(typval_T *argvars, typval_T *rettv) /* * "tempname()" function */ -static void f_tempname(typval_T *argvars, typval_T *rettv) +static void f_tempname(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->v_type = VAR_STRING; rettv->vval.v_string = vim_tempname(); } // "termopen(cmd[, cwd])" function -static void f_termopen(typval_T *argvars, typval_T *rettv) +static void f_termopen(typval_T *argvars, typval_T *rettv, FunPtr fptr) { if (check_restricted() || check_secure()) { return; @@ -16654,7 +16286,7 @@ static void f_termopen(typval_T *argvars, typval_T *rettv) if (argvars[1].v_type == VAR_DICT) { job_opts = argvars[1].vval.v_dict; - char *new_cwd = (char *)get_dict_string(job_opts, (char_u *)"cwd", false); + char *new_cwd = (char *)get_dict_string(job_opts, "cwd", false); if (new_cwd && strlen(new_cwd) > 0) { cwd = new_cwd; // The new cwd must be a directory. @@ -16672,7 +16304,7 @@ static void f_termopen(typval_T *argvars, typval_T *rettv) } TerminalJobData *data = common_job_init(argv, on_stdout, on_stderr, on_exit, - job_opts, true, false, cwd); + job_opts, true, false, false, cwd); data->proc.pty.width = curwin->w_width; data->proc.pty.height = curwin->w_height; data->proc.pty.term_name = xstrdup("xterm-256color"); @@ -16699,9 +16331,9 @@ static void f_termopen(typval_T *argvars, typval_T *rettv) // Save the job id and pid in b:terminal_job_{id,pid} Error err; dict_set_value(curbuf->b_vars, cstr_as_string("terminal_job_id"), - INTEGER_OBJ(rettv->vval.v_number), false, &err); + INTEGER_OBJ(rettv->vval.v_number), false, false, &err); dict_set_value(curbuf->b_vars, cstr_as_string("terminal_job_pid"), - INTEGER_OBJ(pid), false, &err); + INTEGER_OBJ(pid), false, false, &err); Terminal *term = terminal_open(topts); data->term = term; @@ -16713,30 +16345,13 @@ static void f_termopen(typval_T *argvars, typval_T *rettv) /* * "test(list)" function: Just checking the walls... */ -static void f_test(typval_T *argvars, typval_T *rettv) +static void f_test(typval_T *argvars, typval_T *rettv, FunPtr fptr) { /* Used for unit testing. Change the code below to your liking. */ } -/* - * "tan()" function - */ -static void f_tan(typval_T *argvars, typval_T *rettv) -{ - float_op_wrapper(argvars, rettv, &tan); -} - -/* - * "tanh()" function - */ -static void f_tanh(typval_T *argvars, typval_T *rettv) -{ - float_op_wrapper(argvars, rettv, &tanh); -} - - /// "timer_start(timeout, callback, opts)" function -static void f_timer_start(typval_T *argvars, typval_T *rettv) +static void f_timer_start(typval_T *argvars, typval_T *rettv, FunPtr fptr) { long timeout = get_tv_number(&argvars[0]); timer_T *timer; @@ -16752,7 +16367,7 @@ static void f_timer_start(typval_T *argvars, typval_T *rettv) return; } if (dict_find(dict, (char_u *)"repeat", -1) != NULL) { - repeat = get_dict_number(dict, (char_u *)"repeat"); + repeat = get_dict_number(dict, "repeat"); if (repeat == 0) { repeat = 1; } @@ -16771,6 +16386,7 @@ static void f_timer_start(typval_T *argvars, typval_T *rettv) func->uf_refcount++; timer = xmalloc(sizeof *timer); + timer->refcount = 1; timer->stopped = false; timer->repeat_count = repeat; timer->timeout = timeout; @@ -16790,7 +16406,7 @@ static void f_timer_start(typval_T *argvars, typval_T *rettv) // "timer_stop(timerid)" function -static void f_timer_stop(typval_T *argvars, typval_T *rettv) +static void f_timer_stop(typval_T *argvars, typval_T *rettv, FunPtr fptr) { if (argvars[0].v_type != VAR_NUMBER) { EMSG(_(e_number_exp)); @@ -16813,6 +16429,7 @@ static void timer_due_cb(TimeWatcher *tw, void *data) if (timer->stopped) { return; } + timer->refcount++; // if repeat was negative repeat forever if (timer->repeat_count >= 0 && --timer->repeat_count == 0) { timer_stop(timer); @@ -16836,6 +16453,7 @@ static void timer_due_cb(TimeWatcher *tw, void *data) // when the main loop is blocked. time_watcher_start(&timer->tw, timer_due_cb, 0, 0); } + timer_decref(timer); } static void timer_stop(timer_T *timer) @@ -16846,17 +16464,24 @@ static void timer_stop(timer_T *timer) } timer->stopped = true; time_watcher_stop(&timer->tw); - time_watcher_close(&timer->tw, timer_free_cb); + time_watcher_close(&timer->tw, timer_close_cb); } // invoked on next event loop tick, so queue is empty -static void timer_free_cb(TimeWatcher *tw, void *data) +static void timer_close_cb(TimeWatcher *tw, void *data) { timer_T *timer = (timer_T *)data; queue_free(timer->tw.events); user_func_unref(timer->callback); pmap_del(uint64_t)(timers, timer->timer_id); - xfree(timer); + timer_decref(timer); +} + +static void timer_decref(timer_T *timer) +{ + if (--timer->refcount == 0) { + xfree(timer); + } } void timer_teardown(void) @@ -16870,7 +16495,7 @@ void timer_teardown(void) /* * "tolower(string)" function */ -static void f_tolower(typval_T *argvars, typval_T *rettv) +static void f_tolower(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *p = vim_strsave(get_tv_string(&argvars[0])); rettv->v_type = VAR_STRING; @@ -16901,7 +16526,7 @@ static void f_tolower(typval_T *argvars, typval_T *rettv) /* * "toupper(string)" function */ -static void f_toupper(typval_T *argvars, typval_T *rettv) +static void f_toupper(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->v_type = VAR_STRING; rettv->vval.v_string = strup_save(get_tv_string(&argvars[0])); @@ -16910,7 +16535,7 @@ static void f_toupper(typval_T *argvars, typval_T *rettv) /* * "tr(string, fromstr, tostr)" function */ -static void f_tr(typval_T *argvars, typval_T *rettv) +static void f_tr(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *in_str; char_u *fromstr; @@ -17008,17 +16633,9 @@ error: } /* - * "trunc({float})" function - */ -static void f_trunc(typval_T *argvars, typval_T *rettv) -{ - float_op_wrapper(argvars, rettv, &trunc); -} - -/* * "type(expr)" function */ -static void f_type(typval_T *argvars, typval_T *rettv) +static void f_type(typval_T *argvars, typval_T *rettv, FunPtr fptr) { int n = -1; @@ -17054,7 +16671,7 @@ static void f_type(typval_T *argvars, typval_T *rettv) /* * "undofile(name)" function */ -static void f_undofile(typval_T *argvars, typval_T *rettv) +static void f_undofile(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->v_type = VAR_STRING; { @@ -17077,7 +16694,7 @@ static void f_undofile(typval_T *argvars, typval_T *rettv) /* * "undotree()" function */ -static void f_undotree(typval_T *argvars, typval_T *rettv) +static void f_undotree(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv_dict_alloc(rettv); @@ -17100,7 +16717,7 @@ static void f_undotree(typval_T *argvars, typval_T *rettv) /* * "values(dict)" function */ -static void f_values(typval_T *argvars, typval_T *rettv) +static void f_values(typval_T *argvars, typval_T *rettv, FunPtr fptr) { dict_list(argvars, rettv, 1); } @@ -17108,7 +16725,7 @@ static void f_values(typval_T *argvars, typval_T *rettv) /* * "virtcol(string)" function */ -static void f_virtcol(typval_T *argvars, typval_T *rettv) +static void f_virtcol(typval_T *argvars, typval_T *rettv, FunPtr fptr) { colnr_T vcol = 0; pos_T *fp; @@ -17127,7 +16744,7 @@ static void f_virtcol(typval_T *argvars, typval_T *rettv) /* * "visualmode()" function */ -static void f_visualmode(typval_T *argvars, typval_T *rettv) +static void f_visualmode(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u str[2]; @@ -17144,16 +16761,48 @@ static void f_visualmode(typval_T *argvars, typval_T *rettv) /* * "wildmenumode()" function */ -static void f_wildmenumode(typval_T *argvars, typval_T *rettv) +static void f_wildmenumode(typval_T *argvars, typval_T *rettv, FunPtr fptr) { if (wild_menu_showing) rettv->vval.v_number = 1; } +/// "win_findbuf()" function +static void f_win_findbuf(typval_T *argvars, typval_T *rettv, FunPtr fptr) +{ + rettv_list_alloc(rettv); + win_findbuf(argvars, rettv->vval.v_list); +} + +/// "win_getid()" function +static void f_win_getid(typval_T *argvars, typval_T *rettv, FunPtr fptr) +{ + rettv->vval.v_number = win_getid(argvars); +} + +/// "win_gotoid()" function +static void f_win_gotoid(typval_T *argvars, typval_T *rettv, FunPtr fptr) +{ + rettv->vval.v_number = win_gotoid(argvars); +} + +/// "win_id2tabwin()" function +static void f_win_id2tabwin(typval_T *argvars, typval_T *rettv, FunPtr fptr) +{ + rettv_list_alloc(rettv); + win_id2tabwin(argvars, rettv->vval.v_list); +} + +/// "win_id2win()" function +static void f_win_id2win(typval_T *argvars, typval_T *rettv, FunPtr fptr) +{ + rettv->vval.v_number = win_id2win(argvars); +} + /* * "winbufnr(nr)" function */ -static void f_winbufnr(typval_T *argvars, typval_T *rettv) +static void f_winbufnr(typval_T *argvars, typval_T *rettv, FunPtr fptr) { win_T *wp; @@ -17167,7 +16816,7 @@ static void f_winbufnr(typval_T *argvars, typval_T *rettv) /* * "wincol()" function */ -static void f_wincol(typval_T *argvars, typval_T *rettv) +static void f_wincol(typval_T *argvars, typval_T *rettv, FunPtr fptr) { validate_cursor(); rettv->vval.v_number = curwin->w_wcol + 1; @@ -17176,7 +16825,7 @@ static void f_wincol(typval_T *argvars, typval_T *rettv) /* * "winheight(nr)" function */ -static void f_winheight(typval_T *argvars, typval_T *rettv) +static void f_winheight(typval_T *argvars, typval_T *rettv, FunPtr fptr) { win_T *wp; @@ -17190,7 +16839,7 @@ static void f_winheight(typval_T *argvars, typval_T *rettv) /* * "winline()" function */ -static void f_winline(typval_T *argvars, typval_T *rettv) +static void f_winline(typval_T *argvars, typval_T *rettv, FunPtr fptr) { validate_cursor(); rettv->vval.v_number = curwin->w_wrow + 1; @@ -17199,7 +16848,7 @@ static void f_winline(typval_T *argvars, typval_T *rettv) /* * "winnr()" function */ -static void f_winnr(typval_T *argvars, typval_T *rettv) +static void f_winnr(typval_T *argvars, typval_T *rettv, FunPtr fptr) { int nr = 1; @@ -17210,7 +16859,7 @@ static void f_winnr(typval_T *argvars, typval_T *rettv) /* * "winrestcmd()" function */ -static void f_winrestcmd(typval_T *argvars, typval_T *rettv) +static void f_winrestcmd(typval_T *argvars, typval_T *rettv, FunPtr fptr) { int winnr = 1; garray_T ga; @@ -17233,7 +16882,7 @@ static void f_winrestcmd(typval_T *argvars, typval_T *rettv) /* * "winrestview()" function */ -static void f_winrestview(typval_T *argvars, typval_T *rettv) +static void f_winrestview(typval_T *argvars, typval_T *rettv, FunPtr fptr) { dict_T *dict; @@ -17242,29 +16891,29 @@ static void f_winrestview(typval_T *argvars, typval_T *rettv) EMSG(_(e_invarg)); else { if (dict_find(dict, (char_u *)"lnum", -1) != NULL) { - curwin->w_cursor.lnum = get_dict_number(dict, (char_u *)"lnum"); + curwin->w_cursor.lnum = get_dict_number(dict, "lnum"); } if (dict_find(dict, (char_u *)"col", -1) != NULL) { - curwin->w_cursor.col = get_dict_number(dict, (char_u *)"col"); + curwin->w_cursor.col = get_dict_number(dict, "col"); } if (dict_find(dict, (char_u *)"coladd", -1) != NULL) { - curwin->w_cursor.coladd = get_dict_number(dict, (char_u *)"coladd"); + curwin->w_cursor.coladd = get_dict_number(dict, "coladd"); } if (dict_find(dict, (char_u *)"curswant", -1) != NULL) { - curwin->w_curswant = get_dict_number(dict, (char_u *)"curswant"); - curwin->w_set_curswant = FALSE; + curwin->w_curswant = get_dict_number(dict, "curswant"); + curwin->w_set_curswant = false; } if (dict_find(dict, (char_u *)"topline", -1) != NULL) { - set_topline(curwin, get_dict_number(dict, (char_u *)"topline")); + set_topline(curwin, get_dict_number(dict, "topline")); } if (dict_find(dict, (char_u *)"topfill", -1) != NULL) { - curwin->w_topfill = get_dict_number(dict, (char_u *)"topfill"); + curwin->w_topfill = get_dict_number(dict, "topfill"); } if (dict_find(dict, (char_u *)"leftcol", -1) != NULL) { - curwin->w_leftcol = get_dict_number(dict, (char_u *)"leftcol"); + curwin->w_leftcol = get_dict_number(dict, "leftcol"); } if (dict_find(dict, (char_u *)"skipcol", -1) != NULL) { - curwin->w_skipcol = get_dict_number(dict, (char_u *)"skipcol"); + curwin->w_skipcol = get_dict_number(dict, "skipcol"); } check_cursor(); @@ -17283,7 +16932,7 @@ static void f_winrestview(typval_T *argvars, typval_T *rettv) /* * "winsaveview()" function */ -static void f_winsaveview(typval_T *argvars, typval_T *rettv) +static void f_winsaveview(typval_T *argvars, typval_T *rettv, FunPtr fptr) { dict_T *dict; @@ -17387,7 +17036,7 @@ static char_u *save_tv_as_string(typval_T *tv, ssize_t *len, bool endnl) /* * "winwidth(nr)" function */ -static void f_winwidth(typval_T *argvars, typval_T *rettv) +static void f_winwidth(typval_T *argvars, typval_T *rettv, FunPtr fptr) { win_T *wp; @@ -17399,14 +17048,14 @@ static void f_winwidth(typval_T *argvars, typval_T *rettv) } /// "wordcount()" function -static void f_wordcount(typval_T *argvars, typval_T *rettv) +static void f_wordcount(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv_dict_alloc(rettv); cursor_pos_info(rettv->vval.v_dict); } /// "writefile()" function -static void f_writefile(typval_T *argvars, typval_T *rettv) +static void f_writefile(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->vval.v_number = 0; // Assuming success. @@ -17451,7 +17100,7 @@ static void f_writefile(typval_T *argvars, typval_T *rettv) /* * "xor(expr, expr)" function */ -static void f_xor(typval_T *argvars, typval_T *rettv) +static void f_xor(typval_T *argvars, typval_T *rettv, FunPtr fptr) { rettv->vval.v_number = get_tv_number_chk(&argvars[0], NULL) ^ get_tv_number_chk(&argvars[1], NULL); @@ -18437,7 +18086,7 @@ static void init_tv(typval_T *varp) * caller of incompatible types: it sets *denote to TRUE if "denote" * is not NULL or returns -1 otherwise. */ -static long get_tv_number(typval_T *varp) +long get_tv_number(typval_T *varp) { int error = FALSE; @@ -18533,7 +18182,7 @@ static linenr_T get_tv_lnum(typval_T *argvars) lnum = get_tv_number_chk(&argvars[0], NULL); if (lnum == 0) { /* no valid number, try using line() */ rettv.v_type = VAR_NUMBER; - f_line(argvars, &rettv); + f_line(argvars, &rettv, NULL); lnum = rettv.vval.v_number; clear_tv(&rettv); } @@ -20361,7 +20010,7 @@ void free_all_functions(void) int translated_function_exists(char_u *name) { if (builtin_function(name, -1)) { - return find_internal_func(name) >= 0; + return find_internal_func((char *)name) != NULL; } return find_func(name) != NULL; } @@ -21681,8 +21330,8 @@ void ex_oldfiles(exarg_T *eap) /* Assume "got_int" was set to truncate the listing. */ got_int = FALSE; - // File selection prompt on ":oldfiles!" - if (eap->forceit) { + // File selection prompt on ":browse oldfiles" + if (cmdmod.browse) { quit_more = false; nr = prompt_for_number(false); msg_starthere(); @@ -22060,6 +21709,7 @@ static inline TerminalJobData *common_job_init(char **argv, ufunc_T *on_exit, dict_T *self, bool pty, + bool rpc, bool detach, char *cwd) { @@ -22070,6 +21720,7 @@ static inline TerminalJobData *common_job_init(char **argv, data->on_exit = on_exit; data->self = self; data->events = queue_new_child(main_loop.events); + data->rpc = rpc; if (pty) { data->proc.pty = pty_process_init(&main_loop, data); } else { @@ -22089,7 +21740,9 @@ static inline TerminalJobData *common_job_init(char **argv, return data; } -/// Return true/false on success/failure. +/// common code for getting job callbacks for jobstart, termopen and rpcstart +/// +/// @return true/false on success/failure. static inline bool common_job_callbacks(dict_T *vopts, ufunc_T **on_stdout, ufunc_T **on_stderr, ufunc_T **on_exit) { @@ -22116,9 +21769,15 @@ static inline bool common_job_start(TerminalJobData *data, typval_T *rettv) Process *proc = (Process *)&data->proc; if (proc->type == kProcessTypePty && proc->detach) { EMSG2(_(e_invarg2), "terminal/pty job cannot be detached"); + xfree(data->proc.pty.term_name); + shell_free_argv(proc->argv); + free_term_job_data_event((void **)&data); return false; } + data->id = next_chan_id++; + pmap_put(uint64_t)(jobs, data->id, data); + data->refcount++; char *cmd = xstrdup(proc->argv[0]); if (!process_spawn(proc)) { @@ -22133,17 +21792,22 @@ static inline bool common_job_start(TerminalJobData *data, typval_T *rettv) } xfree(cmd); - data->id = current_job_id++; - wstream_init(proc->in, 0); - if (proc->out) { - rstream_init(proc->out, 0); - rstream_start(proc->out, on_job_stdout); + + if (data->rpc) { + // the rpc channel takes over the in and out streams + channel_from_process(proc, data->id); + } else { + wstream_init(proc->in, 0); + if (proc->out) { + rstream_init(proc->out, 0); + rstream_start(proc->out, on_job_stdout, data); + } } + if (proc->err) { rstream_init(proc->err, 0); - rstream_start(proc->err, on_job_stderr); + rstream_start(proc->err, on_job_stderr, data); } - pmap_put(uint64_t)(jobs, data->id, data); rettv->vval.v_number = data->id; return true; } @@ -22165,6 +21829,7 @@ static inline void free_term_job_data_event(void **argv) dict_unref(data->self); } queue_free(data->events); + pmap_del(uint64_t)(jobs, data->id); xfree(data); } @@ -22261,12 +21926,17 @@ static void on_process_exit(Process *proc, int status, void *d) snprintf(msg, sizeof msg, "\r\n[Process exited %d]", proc->status); terminal_close(data->term, msg); } + if (data->rpc) { + channel_process_exit(data->id, status); + } if (data->status_ptr) { *data->status_ptr = status; } process_job_event(data, data->on_exit, "exit", NULL, 0, status); + + term_job_data_decref(data); } static void term_write(char *buf, size_t size, void *d) @@ -22314,7 +21984,7 @@ static void term_job_data_decref(TerminalJobData *data) static void on_job_event(JobEvent *ev) { if (!ev->callback) { - goto end; + return; } typval_T argv[3]; @@ -22350,13 +22020,6 @@ static void on_job_event(JobEvent *ev) call_user_func(ev->callback, argc, argv, &rettv, curwin->w_cursor.lnum, curwin->w_cursor.lnum, ev->data->self); clear_tv(&rettv); - -end: - if (!ev->received) { - // exit event, safe to free job data now - pmap_del(uint64_t)(jobs, ev->data->id); - term_job_data_decref(ev->data); - } } static TerminalJobData *find_job(uint64_t id) diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua new file mode 100644 index 0000000000..3c371fc264 --- /dev/null +++ b/src/nvim/eval.lua @@ -0,0 +1,331 @@ +-- File containing table with all functions. +-- +-- Keys: +-- +-- args Number of arguments, list with maximum and minimum number of arguments +-- or list with a minimum number of arguments only. Defaults to zero +-- arguments. +-- func Name of the C function which implements the VimL function. Defaults to +-- `f_{funcname}`. + +local varargs = function(nr) + return {nr} +end + +return { + funcs={ + abs={args=1}, + acos={args=1, func="float_op_wrapper", data="&acos"}, -- WJMc + add={args=2}, + ['and']={args=2}, + api_info={}, + append={args=2}, + argc={}, + argidx={}, + arglistid={args={0, 2}}, + argv={args={0, 1}}, + asin={args=1, func="float_op_wrapper", data="&asin"}, -- WJMc + assert_equal={args={2, 3}}, + assert_exception={args={1, 2}}, + assert_fails={args={1, 2}}, + assert_false={args={1, 2}}, + assert_match={args={2, 3}}, + assert_notequal={args={2, 3}}, + assert_notmatch={args={2, 3}}, + assert_true={args={1, 2}}, + atan={args=1, func="float_op_wrapper", data="&atan"}, + atan2={args=2}, + browse={args=4}, + browsedir={args=2}, + bufexists={args=1}, + buffer_exists={args=1, func='f_bufexists'}, -- obsolete + buffer_name={args=1, func='f_bufname'}, -- obsolete + buffer_number={args=1, func='f_bufnr'}, -- obsolete + buflisted={args=1}, + bufloaded={args=1}, + bufname={args=1}, + bufnr={args={1, 2}}, + bufwinnr={args=1}, + byte2line={args=1}, + byteidx={args=2}, + byteidxcomp={args=2}, + call={args={2, 3}}, + ceil={args=1, func="float_op_wrapper", data="&ceil"}, + changenr={}, + char2nr={args={1, 2}}, + cindent={args=1}, + clearmatches={}, + col={args=1}, + complete={args=2}, + complete_add={args=1}, + complete_check={}, + confirm={args={1, 4}}, + copy={args=1}, + cos={args=1, func="float_op_wrapper", data="&cos"}, + cosh={args=1, func="float_op_wrapper", data="&cosh"}, + count={args={2, 4}}, + cscope_connection={args={0, 3}}, + cursor={args={1, 3}}, + deepcopy={args={1, 2}}, + delete={args={1,2}}, + dictwatcheradd={args=3}, + dictwatcherdel={args=3}, + did_filetype={}, + diff_filler={args=1}, + diff_hlID={args=2}, + empty={args=1}, + escape={args=2}, + eval={args=1}, + eventhandler={}, + executable={args=1}, + execute={args=1}, + exepath={args=1}, + exists={args=1}, + exp={args=1, func="float_op_wrapper", data="&exp"}, + expand={args={1, 3}}, + extend={args={2, 3}}, + feedkeys={args={1, 2}}, + file_readable={args=1, func='f_filereadable'}, -- obsolete + filereadable={args=1}, + filewritable={args=1}, + filter={args=2}, + finddir={args={1, 3}}, + findfile={args={1, 3}}, + float2nr={args=1}, + floor={args=1, func="float_op_wrapper", data="&floor"}, + fmod={args=2}, + fnameescape={args=1}, + fnamemodify={args=2}, + foldclosed={args=1}, + foldclosedend={args=1}, + foldlevel={args=1}, + foldtext={}, + foldtextresult={args=1}, + foreground={}, + ['function']={args=1}, + garbagecollect={args={0, 1}}, + get={args={2, 3}}, + getbufline={args={2, 3}}, + getbufvar={args={2, 3}}, + getchar={args={0, 1}}, + getcharmod={}, + getcharsearch={}, + getcmdline={}, + getcmdpos={}, + getcmdtype={}, + getcmdwintype={}, + getcompletion={args=2}, + getcurpos={}, + getcwd={args={0,2}}, + getfontname={args={0, 1}}, + getfperm={args=1}, + getfsize={args=1}, + getftime={args=1}, + getftype={args=1}, + getline={args={1, 2}}, + getloclist={args=1, func='f_getqflist'}, + getmatches={}, + getpid={}, + getpos={args=1}, + getqflist={}, + getreg={args={0, 3}}, + getregtype={args={0, 1}}, + gettabvar={args={2, 3}}, + gettabwinvar={args={3, 4}}, + getwinposx={}, + getwinposy={}, + getwinvar={args={2, 3}}, + glob={args={1, 4}}, + glob2regpat={args=1}, + globpath={args={2, 5}}, + has={args=1}, + has_key={args=2}, + haslocaldir={args={0,2}}, + hasmapto={args={1, 3}}, + highlightID={args=1, func='f_hlID'}, -- obsolete + highlight_exists={args=1, func='f_hlexists'}, -- obsolete + histadd={args=2}, + histdel={args={1, 2}}, + histget={args={1, 2}}, + histnr={args=1}, + hlID={args=1}, + hlexists={args=1}, + hostname={}, + iconv={args=3}, + indent={args=1}, + index={args={2, 4}}, + input={args={1, 3}}, + inputdialog={args={1, 3}}, + inputlist={args=1}, + inputrestore={}, + inputsave={}, + inputsecret={args={1, 2}}, + insert={args={2, 3}}, + invert={args=1}, + isdirectory={args=1}, + islocked={args=1}, + items={args=1}, + jobclose={args={1, 2}}, + jobpid={args=1}, + jobresize={args=3}, + jobsend={args=2}, + jobstart={args={1, 2}}, + jobstop={args=1}, + jobwait={args={1, 2}}, + join={args={1, 2}}, + json_decode={args=1}, + json_encode={args=1}, + keys={args=1}, + last_buffer_nr={}, -- obsolete + len={args=1}, + libcall={args=3}, + libcallnr={args=3}, + line={args=1}, + line2byte={args=1}, + lispindent={args=1}, + localtime={}, + log={args=1, func="float_op_wrapper", data="&log"}, + log10={args=1, func="float_op_wrapper", data="&log10"}, + map={args=2}, + maparg={args={1, 4}}, + mapcheck={args={1, 3}}, + match={args={2, 4}}, + matchadd={args={2, 5}}, + matchaddpos={args={2, 5}}, + matcharg={args=1}, + matchdelete={args=1}, + matchend={args={2, 4}}, + matchlist={args={2, 4}}, + matchstr={args={2, 4}}, + max={args=1}, + min={args=1}, + mkdir={args={1, 3}}, + mode={args={0, 1}}, + msgpackdump={args=1}, + msgpackparse={args=1}, + nextnonblank={args=1}, + nr2char={args={1, 2}}, + ['or']={args=2}, + pathshorten={args=1}, + pow={args=2}, + prevnonblank={args=1}, + printf={args=varargs(2)}, + pumvisible={}, + py3eval={args=1}, + pyeval={args=1}, + range={args={1, 3}}, + readfile={args={1, 3}}, + reltime={args={0, 2}}, + reltimefloat={args=1}, + reltimestr={args=1}, + remove={args={2, 3}}, + rename={args=2}, + ['repeat']={args=2}, + resolve={args=1}, + reverse={args=1}, + round={args=1, func="float_op_wrapper", data="&round"}, + rpcnotify={args=varargs(2)}, + rpcrequest={args=varargs(2)}, + rpcstart={args={1, 2}}, + rpcstop={args=1}, + screenattr={args=2}, + screenchar={args=2}, + screencol={}, + screenrow={}, + search={args={1, 4}}, + searchdecl={args={1, 3}}, + searchpair={args={3, 7}}, + searchpairpos={args={3, 7}}, + searchpos={args={1, 4}}, + serverlist={}, + serverstart={args={0, 1}}, + serverstop={args=1}, + setbufvar={args=3}, + setcharsearch={args=1}, + setcmdpos={args=1}, + setfperm={args=2}, + setline={args=2}, + setloclist={args={2, 4}}, + setmatches={args=1}, + setpos={args=2}, + setqflist={args={1, 3}}, + setreg={args={2, 3}}, + settabvar={args=3}, + settabwinvar={args=4}, + setwinvar={args=3}, + sha256={args=1}, + shellescape={args={1, 2}}, + shiftwidth={}, + simplify={args=1}, + sin={args=1, func="float_op_wrapper", data="&sin"}, + sinh={args=1, func="float_op_wrapper", data="&sinh"}, + sort={args={1, 3}}, + soundfold={args=1}, + spellbadword={args={0, 1}}, + spellsuggest={args={1, 3}}, + split={args={1, 3}}, + sqrt={args=1, func="float_op_wrapper", data="&sqrt"}, + str2float={args=1}, + str2nr={args={1, 2}}, + strchars={args={1,2}}, + strdisplaywidth={args={1, 2}}, + strftime={args={1, 2}}, + stridx={args={2, 3}}, + string={args=1}, + strlen={args=1}, + strpart={args={2, 3}}, + strridx={args={2, 3}}, + strtrans={args=1}, + strwidth={args=1}, + submatch={args={1, 2}}, + substitute={args=4}, + synID={args=3}, + synIDattr={args={2, 3}}, + synIDtrans={args=1}, + synconcealed={args=2}, + synstack={args=2}, + system={args={1, 2}}, + systemlist={args={1, 3}}, + tabpagebuflist={args={0, 1}}, + tabpagenr={args={0, 1}}, + tabpagewinnr={args={1, 2}}, + tagfiles={}, + taglist={args=1}, + tan={args=1, func="float_op_wrapper", data="&tan"}, + tanh={args=1, func="float_op_wrapper", data="&tanh"}, + tempname={}, + termopen={args={1, 2}}, + test={args=1}, + timer_start={args={2,3}}, + timer_stop={args=1}, + tolower={args=1}, + toupper={args=1}, + tr={args=3}, + trunc={args=1, func="float_op_wrapper", data="&trunc"}, + type={args=1}, + undofile={args=1}, + undotree={}, + uniq={args={1, 3}}, + values={args=1}, + virtcol={args=1}, + visualmode={args={0, 1}}, + wildmenumode={}, + win_findbuf={args=1}, + win_getid={args={0,2}}, + win_gotoid={args=1}, + win_id2tabwin={args=1}, + win_id2win={args=1}, + winbufnr={args=1}, + wincol={}, + winheight={args=1}, + winline={}, + winnr={args={0, 1}}, + winrestcmd={}, + winrestview={args=1}, + winsaveview={}, + winwidth={args=1}, + wordcount={}, + writefile={args={2, 3}}, + xor={args=2}, + }, +} diff --git a/src/nvim/event/process.c b/src/nvim/event/process.c index 317e40e43a..51f20b7eac 100644 --- a/src/nvim/event/process.c +++ b/src/nvim/event/process.c @@ -17,15 +17,14 @@ # include "event/process.c.generated.h" #endif -// {SIGNAL}_TIMEOUT is the time (in nanoseconds) that a process has to cleanly -// exit before we send SIGNAL to it +// Time (ns) for a process to exit cleanly before we send TERM/KILL. #define TERM_TIMEOUT 1000000000 #define KILL_TIMEOUT (TERM_TIMEOUT * 2) #define CLOSE_PROC_STREAM(proc, stream) \ do { \ if (proc->stream && !proc->stream->closed) { \ - stream_close(proc->stream, NULL); \ + stream_close(proc->stream, NULL, NULL); \ } \ } while (0) @@ -78,10 +77,8 @@ bool process_spawn(Process *proc) FUNC_ATTR_NONNULL_ALL return false; } - void *data = proc->data; - if (proc->in) { - stream_init(NULL, proc->in, -1, (uv_stream_t *)&proc->in->uv.pipe, data); + stream_init(NULL, proc->in, -1, (uv_stream_t *)&proc->in->uv.pipe); proc->in->events = proc->events; proc->in->internal_data = proc; proc->in->internal_close_cb = on_process_stream_close; @@ -89,7 +86,7 @@ bool process_spawn(Process *proc) FUNC_ATTR_NONNULL_ALL } if (proc->out) { - stream_init(NULL, proc->out, -1, (uv_stream_t *)&proc->out->uv.pipe, data); + stream_init(NULL, proc->out, -1, (uv_stream_t *)&proc->out->uv.pipe); proc->out->events = proc->events; proc->out->internal_data = proc; proc->out->internal_close_cb = on_process_stream_close; @@ -97,7 +94,7 @@ bool process_spawn(Process *proc) FUNC_ATTR_NONNULL_ALL } if (proc->err) { - stream_init(NULL, proc->err, -1, (uv_stream_t *)&proc->err->uv.pipe, data); + stream_init(NULL, proc->err, -1, (uv_stream_t *)&proc->err->uv.pipe); proc->err->events = proc->events; proc->err->internal_data = proc; proc->err->internal_close_cb = on_process_stream_close; @@ -373,7 +370,7 @@ static void flush_stream(Process *proc, Stream *stream) if (stream->read_cb) { // Stream callback could miss EOF handling if a child keeps the stream // open. - stream->read_cb(stream, stream->buffer, 0, stream->data, true); + stream->read_cb(stream, stream->buffer, 0, stream->cb_data, true); } break; } diff --git a/src/nvim/event/rstream.c b/src/nvim/event/rstream.c index a520143064..5126dfd84e 100644 --- a/src/nvim/event/rstream.c +++ b/src/nvim/event/rstream.c @@ -17,21 +17,19 @@ # include "event/rstream.c.generated.h" #endif -void rstream_init_fd(Loop *loop, Stream *stream, int fd, size_t bufsize, - void *data) +void rstream_init_fd(Loop *loop, Stream *stream, int fd, size_t bufsize) FUNC_ATTR_NONNULL_ARG(1) FUNC_ATTR_NONNULL_ARG(2) { - stream_init(loop, stream, fd, NULL, data); + stream_init(loop, stream, fd, NULL); rstream_init(stream, bufsize); } -void rstream_init_stream(Stream *stream, uv_stream_t *uvstream, size_t bufsize, - void *data) +void rstream_init_stream(Stream *stream, uv_stream_t *uvstream, size_t bufsize) FUNC_ATTR_NONNULL_ARG(1) FUNC_ATTR_NONNULL_ARG(2) { - stream_init(NULL, stream, -1, uvstream, data); + stream_init(NULL, stream, -1, uvstream); rstream_init(stream, bufsize); } @@ -48,10 +46,11 @@ void rstream_init(Stream *stream, size_t bufsize) /// Starts watching for events from a `Stream` instance. /// /// @param stream The `Stream` instance -void rstream_start(Stream *stream, stream_read_cb cb) +void rstream_start(Stream *stream, stream_read_cb cb, void *data) FUNC_ATTR_NONNULL_ARG(1) { stream->read_cb = cb; + stream->cb_data = data; if (stream->uvstream) { uv_read_start(stream->uvstream, alloc_cb, read_cb); } else { @@ -81,7 +80,7 @@ static void on_rbuffer_nonfull(RBuffer *buf, void *data) { Stream *stream = data; assert(stream->read_cb); - rstream_start(stream, stream->read_cb); + rstream_start(stream, stream->read_cb, stream->cb_data); } // Callbacks used by libuv @@ -179,7 +178,7 @@ static void read_event(void **argv) if (stream->read_cb) { size_t count = (uintptr_t)argv[1]; bool eof = (uintptr_t)argv[2]; - stream->read_cb(stream, stream->buffer, count, stream->data, eof); + stream->read_cb(stream, stream->buffer, count, stream->cb_data, eof); } stream->pending_reqs--; if (stream->closed && !stream->pending_reqs) { diff --git a/src/nvim/event/socket.c b/src/nvim/event/socket.c index cdaf40849b..8f9327f3d4 100644 --- a/src/nvim/event/socket.c +++ b/src/nvim/event/socket.c @@ -113,7 +113,7 @@ int socket_watcher_start(SocketWatcher *watcher, int backlog, socket_cb cb) return 0; } -int socket_watcher_accept(SocketWatcher *watcher, Stream *stream, void *data) +int socket_watcher_accept(SocketWatcher *watcher, Stream *stream) FUNC_ATTR_NONNULL_ARG(1) FUNC_ATTR_NONNULL_ARG(2) { uv_stream_t *client; @@ -133,7 +133,7 @@ int socket_watcher_accept(SocketWatcher *watcher, Stream *stream, void *data) return result; } - stream_init(NULL, stream, -1, client, data); + stream_init(NULL, stream, -1, client); return 0; } diff --git a/src/nvim/event/stream.c b/src/nvim/event/stream.c index 33404158cf..26083c20f4 100644 --- a/src/nvim/event/stream.c +++ b/src/nvim/event/stream.c @@ -30,8 +30,7 @@ int stream_set_blocking(int fd, bool blocking) return retval; } -void stream_init(Loop *loop, Stream *stream, int fd, uv_stream_t *uvstream, - void *data) +void stream_init(Loop *loop, Stream *stream, int fd, uv_stream_t *uvstream) FUNC_ATTR_NONNULL_ARG(2) { stream->uvstream = uvstream; @@ -58,7 +57,6 @@ void stream_init(Loop *loop, Stream *stream, int fd, uv_stream_t *uvstream, stream->uvstream->data = stream; } - stream->data = data; stream->internal_data = NULL; stream->fpos = 0; stream->curmem = 0; @@ -74,12 +72,13 @@ void stream_init(Loop *loop, Stream *stream, int fd, uv_stream_t *uvstream, stream->num_bytes = 0; } -void stream_close(Stream *stream, stream_close_cb on_stream_close) +void stream_close(Stream *stream, stream_close_cb on_stream_close, void *data) FUNC_ATTR_NONNULL_ARG(1) { assert(!stream->closed); stream->closed = true; stream->close_cb = on_stream_close; + stream->close_cb_data = data; if (!stream->pending_reqs) { stream_close_handle(stream); @@ -103,7 +102,7 @@ static void close_cb(uv_handle_t *handle) rbuffer_free(stream->buffer); } if (stream->close_cb) { - stream->close_cb(stream, stream->data); + stream->close_cb(stream, stream->close_cb_data); } if (stream->internal_close_cb) { stream->internal_close_cb(stream, stream->internal_data); diff --git a/src/nvim/event/stream.h b/src/nvim/event/stream.h index ad4e24775b..a176fac1c0 100644 --- a/src/nvim/event/stream.h +++ b/src/nvim/event/stream.h @@ -44,13 +44,14 @@ struct stream { uv_file fd; stream_read_cb read_cb; stream_write_cb write_cb; + void *cb_data; stream_close_cb close_cb, internal_close_cb; + void *close_cb_data, *internal_data; size_t fpos; size_t curmem; size_t maxmem; size_t pending_reqs; size_t num_bytes; - void *data, *internal_data; bool closed; Queue *events; }; diff --git a/src/nvim/event/wstream.c b/src/nvim/event/wstream.c index 8028e35e6b..fc7aad8eb9 100644 --- a/src/nvim/event/wstream.c +++ b/src/nvim/event/wstream.c @@ -22,19 +22,17 @@ typedef struct { # include "event/wstream.c.generated.h" #endif -void wstream_init_fd(Loop *loop, Stream *stream, int fd, size_t maxmem, - void *data) +void wstream_init_fd(Loop *loop, Stream *stream, int fd, size_t maxmem) FUNC_ATTR_NONNULL_ARG(1) FUNC_ATTR_NONNULL_ARG(2) { - stream_init(loop, stream, fd, NULL, data); + stream_init(loop, stream, fd, NULL); wstream_init(stream, maxmem); } -void wstream_init_stream(Stream *stream, uv_stream_t *uvstream, size_t maxmem, - void *data) +void wstream_init_stream(Stream *stream, uv_stream_t *uvstream, size_t maxmem) FUNC_ATTR_NONNULL_ARG(1) FUNC_ATTR_NONNULL_ARG(2) { - stream_init(NULL, stream, -1, uvstream, data); + stream_init(NULL, stream, -1, uvstream); wstream_init(stream, maxmem); } @@ -54,10 +52,11 @@ void wstream_init(Stream *stream, size_t maxmem) /// /// @param stream The `Stream` instance /// @param cb The callback -void wstream_set_write_cb(Stream *stream, stream_write_cb cb) - FUNC_ATTR_NONNULL_ALL +void wstream_set_write_cb(Stream *stream, stream_write_cb cb, void *data) + FUNC_ATTR_NONNULL_ARG(1, 2) { stream->write_cb = cb; + stream->cb_data = data; } /// Queues data for writing to the backing file descriptor of a `Stream` @@ -138,7 +137,7 @@ static void write_cb(uv_write_t *req, int status) wstream_release_wbuffer(data->buffer); if (data->stream->write_cb) { - data->stream->write_cb(data->stream, data->stream->data, status); + data->stream->write_cb(data->stream, data->stream->cb_data, status); } data->stream->pending_reqs--; diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 5de9ac0523..c36c3a7b0e 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -64,6 +64,24 @@ */ typedef struct sign sign_T; +/// Case matching style to use for :substitute +typedef enum { + kSubHonorOptions = 0, ///< Honor the user's 'ignorecase'/'smartcase' options + kSubIgnoreCase, ///< Ignore case of the search + kSubMatchCase, ///< Match case of the search +} SubIgnoreType; + +/// Flags kept between calls to :substitute. +typedef struct { + bool do_all; ///< do multiple substitutions per line + bool do_ask; ///< ask for confirmation + bool do_count; ///< count only + bool do_error; ///< if false, ignore errors + bool do_print; ///< print last line with subs + bool do_list; ///< list last line with subs + bool do_number; ///< list last line with line nr + SubIgnoreType do_ic; ///< ignore case flag +} subflags_T; #ifdef INCLUDE_GENERATED_DECLARATIONS # include "ex_cmds.c.generated.h" @@ -1693,11 +1711,11 @@ int do_write(exarg_T *eap) goto theend; } - /* If 'filetype' was empty try detecting it now. */ + // If 'filetype' was empty try detecting it now. if (*curbuf->b_p_ft == NUL) { - if (au_has_group((char_u *)"filetypedetect")) - (void)do_doautocmd((char_u *)"filetypedetect BufRead", - TRUE); + if (au_has_group((char_u *)"filetypedetect")) { + (void)do_doautocmd((char_u *)"filetypedetect BufRead", true, NULL); + } do_modelines(0); } @@ -2064,6 +2082,7 @@ do_ecmd ( char_u *command = NULL; int did_get_winopts = FALSE; int readfile_flags = 0; + bool did_inc_redrawing_disabled = false; if (eap != NULL) command = eap->do_ecmd_cmd; @@ -2300,6 +2319,11 @@ do_ecmd ( oldbuf = (flags & ECMD_OLDBUF); } + // Don't redraw until the cursor is in the right line, otherwise + // autocommands may cause ml_get errors. + RedrawingDisabled++; + did_inc_redrawing_disabled = true; + buf = curbuf; if ((flags & ECMD_SET_HELP) || keep_help_flag) { prepare_help_buffer(); @@ -2376,8 +2400,6 @@ do_ecmd ( /* * If we get here we are sure to start editing */ - /* don't redraw until the cursor is in the right line */ - ++RedrawingDisabled; /* Assume success now */ retval = OK; @@ -2529,7 +2551,8 @@ do_ecmd ( if (curbuf->b_kmap_state & KEYMAP_INIT) (void)keymap_init(); - --RedrawingDisabled; + RedrawingDisabled--; + did_inc_redrawing_disabled = false; if (!skip_redraw) { n = p_so; if (topline == 0 && command == NULL) @@ -2548,8 +2571,12 @@ do_ecmd ( theend: - if (did_set_swapcommand) + if (did_inc_redrawing_disabled) { + RedrawingDisabled--; + } + if (did_set_swapcommand) { set_vim_var_string(VV_SWAPCOMMAND, NULL, -1); + } xfree(free_fname); return retval; } @@ -2901,6 +2928,159 @@ void sub_set_replacement(SubReplacementString sub) old_sub = sub; } +/// Recognize ":%s/\n//" and turn it into a join command, which is much +/// more efficient. +/// +/// @param[in] eap Ex arguments +/// @param[in] pat Search pattern +/// @param[in] sub Replacement string +/// @param[in] cmd Command from :s_flags +/// +/// @returns true if :substitute can be replaced with a join command +static bool sub_joining_lines(exarg_T *eap, char_u *pat, + char_u *sub, char_u *cmd) + FUNC_ATTR_NONNULL_ARG(1, 3, 4) +{ + // TODO(vim): find a generic solution to make line-joining operations more + // efficient, avoid allocating a string that grows in size. + if (pat != NULL + && strcmp((const char *)pat, "\\n") == 0 + && *sub == NUL + && (*cmd == NUL || (cmd[1] == NUL + && (*cmd == 'g' + || *cmd == 'l' + || *cmd == 'p' + || *cmd == '#')))) { + curwin->w_cursor.lnum = eap->line1; + if (*cmd == 'l') { + eap->flags = EXFLAG_LIST; + } else if (*cmd == '#') { + eap->flags = EXFLAG_NR; + } else if (*cmd == 'p') { + eap->flags = EXFLAG_PRINT; + } + + // The number of lines joined is the number of lines in the range + linenr_T joined_lines_count = eap->line2 - eap->line1 + 1 + // plus one extra line if not at the end of file. + + (eap->line2 < curbuf->b_ml.ml_line_count ? 1 : 0); + if (joined_lines_count > 1) { + do_join(joined_lines_count, FALSE, TRUE, FALSE, true); + sub_nsubs = joined_lines_count - 1; + sub_nlines = 1; + do_sub_msg(false); + ex_may_print(eap); + } + + if (!cmdmod.keeppatterns) { + save_re_pat(RE_SUBST, pat, p_magic); + } + add_to_history(HIST_SEARCH, pat, TRUE, NUL); + + return true; + } + + return false; +} + +/// Allocate memory to store the replacement text for :substitute. +/// +/// Slightly more memory that is strictly necessary is allocated to reduce the +/// frequency of memory (re)allocation. +/// +/// @param[in,out] new_start pointer to the memory for the replacement text +/// @param[in] needed_len amount of memory needed +/// +/// @returns pointer to the end of the allocated memory +static char_u *sub_grow_buf(char_u **new_start, int needed_len) + FUNC_ATTR_NONNULL_ARG(1) FUNC_ATTR_NONNULL_RET +{ + int new_start_len = 0; + char_u *new_end; + if (*new_start == NULL) { + // Get some space for a temporary buffer to do the + // substitution into (and some extra space to avoid + // too many calls to xmalloc()/free()). + new_start_len = needed_len + 50; + *new_start = xmalloc(new_start_len); + **new_start = NUL; + new_end = *new_start; + } else { + // Check if the temporary buffer is long enough to do the + // substitution into. If not, make it larger (with a bit + // extra to avoid too many calls to xmalloc()/free()). + size_t len = STRLEN(*new_start); + needed_len += len; + if (needed_len > new_start_len) { + new_start_len = needed_len + 50; + *new_start = xrealloc(*new_start, new_start_len); + } + new_end = *new_start + len; + } + + return new_end; +} + +/// Parse cmd string for :substitute's {flags} and update subflags accordingly +/// +/// @param[in] cmd command string +/// @param[in,out] subflags current flags defined for the :substitute command +/// @param[in,out] which_pat pattern type from which to get default search +/// +/// @returns pointer to the end of the flags, which may be the end of the string +static char_u *sub_parse_flags(char_u *cmd, subflags_T *subflags, + int *which_pat) + FUNC_ATTR_NONNULL_ALL FUNC_ATTR_NONNULL_RET +{ + // Find trailing options. When '&' is used, keep old options. + if (*cmd == '&') { + cmd++; + } else { + subflags->do_all = p_gd; + subflags->do_ask = false; + subflags->do_error = true; + subflags->do_print = false; + subflags->do_count = false; + subflags->do_number = false; + subflags->do_ic = kSubHonorOptions; + } + while (*cmd) { + // Note that 'g' and 'c' are always inverted. + // 'r' is never inverted. + if (*cmd == 'g') { + subflags->do_all = !subflags->do_all; + } else if (*cmd == 'c') { + subflags->do_ask = !subflags->do_ask; + } else if (*cmd == 'n') { + subflags->do_count = true; + } else if (*cmd == 'e') { + subflags->do_error = !subflags->do_error; + } else if (*cmd == 'r') { // use last used regexp + *which_pat = RE_LAST; + } else if (*cmd == 'p') { + subflags->do_print = true; + } else if (*cmd == '#') { + subflags->do_print = true; + subflags->do_number = true; + } else if (*cmd == 'l') { + subflags->do_print = true; + subflags->do_list = true; + } else if (*cmd == 'i') { // ignore case + subflags->do_ic = kSubIgnoreCase; + } else if (*cmd == 'I') { // don't ignore case + subflags->do_ic = kSubMatchCase; + } else { + break; + } + cmd++; + } + if (subflags->do_count) { + subflags->do_ask = false; + } + + return cmd; +} + /* do_sub() * * Perform a substitution from line eap->line1 to line eap->line2 using the @@ -2912,41 +3092,35 @@ void sub_set_replacement(SubReplacementString sub) */ void do_sub(exarg_T *eap) { - linenr_T lnum; long i = 0; regmmatch_T regmatch; - static int do_all = FALSE; /* do multiple substitutions per line */ - static int do_ask = FALSE; /* ask for confirmation */ - static bool do_count = false; /* count only */ - static int do_error = TRUE; /* if false, ignore errors */ - static int do_print = FALSE; /* print last line with subs. */ - static int do_list = FALSE; /* list last line with subs. */ - static int do_number = FALSE; /* list last line with line nr*/ - static int do_ic = 0; /* ignore case flag */ - int save_do_all; // remember user specified 'g' flag - int save_do_ask; // remember user specified 'c' flag - char_u *pat = NULL, *sub = NULL; /* init for GCC */ + static subflags_T subflags = { + .do_all = false, + .do_ask = false, + .do_count = false, + .do_error = true, + .do_print = false, + .do_list = false, + .do_number = false, + .do_ic = kSubHonorOptions + }; + char_u *pat = NULL, *sub = NULL; // init for GCC int delimiter; int sublen; - int got_quit = FALSE; - int got_match = FALSE; - int temp; + int got_quit = false; + int got_match = false; int which_pat; - char_u *cmd; - int save_State; - linenr_T first_line = 0; /* first changed line */ - linenr_T last_line= 0; /* below last changed line AFTER the - * change */ + char_u *cmd = eap->arg; + linenr_T first_line = 0; // first changed line + linenr_T last_line= 0; // below last changed line AFTER the + // change linenr_T old_line_count = curbuf->b_ml.ml_line_count; - linenr_T line2; - long nmatch; /* number of lines in match */ - char_u *sub_firstline; /* allocated copy of first sub line */ - int endcolumn = FALSE; /* cursor in last column when done */ + char_u *sub_firstline; // allocated copy of first sub line + bool endcolumn = false; // cursor in last column when done pos_T old_cursor = curwin->w_cursor; int start_nsubs; int save_ma = 0; - cmd = eap->arg; if (!global_busy) { sub_nsubs = 0; sub_nlines = 0; @@ -3028,104 +3202,20 @@ void do_sub(exarg_T *eap) endcolumn = (curwin->w_curswant == MAXCOL); } - // Recognize ":%s/\n//" and turn it into a join command, which is much - // more efficient. - // TODO: find a generic solution to make line-joining operations more - // efficient, avoid allocating a string that grows in size. - if (pat != NULL - && strcmp((const char *)pat, "\\n") == 0 - && *sub == NUL - && (*cmd == NUL || (cmd[1] == NUL - && (*cmd == 'g' - || *cmd == 'l' - || *cmd == 'p' - || *cmd == '#')))) { - curwin->w_cursor.lnum = eap->line1; - if (*cmd == 'l') { - eap->flags = EXFLAG_LIST; - } else if (*cmd == '#') { - eap->flags = EXFLAG_NR; - } else if (*cmd == 'p') { - eap->flags = EXFLAG_PRINT; - } - - // The number of lines joined is the number of lines in the range - linenr_T joined_lines_count = eap->line2 - eap->line1 + 1 - // plus one extra line if not at the end of file. - + (eap->line2 < curbuf->b_ml.ml_line_count ? 1 : 0); - if (joined_lines_count > 1) { - do_join(joined_lines_count, FALSE, TRUE, FALSE, true); - sub_nsubs = joined_lines_count - 1; - sub_nlines = 1; - do_sub_msg(false); - ex_may_print(eap); - } - - if (!cmdmod.keeppatterns) { - save_re_pat(RE_SUBST, pat, p_magic); - } - add_to_history(HIST_SEARCH, pat, TRUE, NUL); - + if (sub_joining_lines(eap, pat, sub, cmd)) { return; } - /* - * Find trailing options. When '&' is used, keep old options. - */ - if (*cmd == '&') { - ++cmd; - } else { - // default is global on - do_all = p_gd ? TRUE : FALSE; - - do_ask = FALSE; - do_error = TRUE; - do_print = FALSE; - do_count = false; - do_number = FALSE; - do_ic = 0; - } - while (*cmd) { - // Note that 'g' and 'c' are always inverted. - // 'r' is never inverted. - if (*cmd == 'g') - do_all = !do_all; - else if (*cmd == 'c') - do_ask = !do_ask; - else if (*cmd == 'n') - do_count = true; - else if (*cmd == 'e') - do_error = !do_error; - else if (*cmd == 'r') /* use last used regexp */ - which_pat = RE_LAST; - else if (*cmd == 'p') - do_print = TRUE; - else if (*cmd == '#') { - do_print = TRUE; - do_number = TRUE; - } else if (*cmd == 'l') { - do_print = TRUE; - do_list = TRUE; - } else if (*cmd == 'i') /* ignore case */ - do_ic = 'i'; - else if (*cmd == 'I') /* don't ignore case */ - do_ic = 'I'; - else - break; - ++cmd; - } - if (do_count) { - do_ask = FALSE; - } + cmd = sub_parse_flags(cmd, &subflags, &which_pat); - save_do_all = do_all; - save_do_ask = do_ask; + bool save_do_all = subflags.do_all; // remember user specified 'g' flag + bool save_do_ask = subflags.do_ask; // remember user specified 'c' flag // check for a trailing count cmd = skipwhite(cmd); if (ascii_isdigit(*cmd)) { i = getdigits_long(&cmd); - if (i <= 0 && !eap->skip && do_error) { + if (i <= 0 && !eap->skip && subflags.do_error) { EMSG(_(e_zerocount)); return; } @@ -3150,24 +3240,25 @@ void do_sub(exarg_T *eap) if (eap->skip) /* not executing commands, only parsing */ return; - if (!do_count && !MODIFIABLE(curbuf)) { - /* Substitution is not allowed in non-'modifiable' buffer */ + if (!subflags.do_count && !MODIFIABLE(curbuf)) { + // Substitution is not allowed in non-'modifiable' buffer EMSG(_(e_modifiable)); return; } - if (search_regcomp(pat, RE_SUBST, which_pat, SEARCH_HIS, - ®match) == FAIL) { - if (do_error) + if (search_regcomp(pat, RE_SUBST, which_pat, SEARCH_HIS, ®match) == FAIL) { + if (subflags.do_error) { EMSG(_(e_invcmd)); + } return; } - /* the 'i' or 'I' flag overrules 'ignorecase' and 'smartcase' */ - if (do_ic == 'i') - regmatch.rmm_ic = TRUE; - else if (do_ic == 'I') - regmatch.rmm_ic = FALSE; + // the 'i' or 'I' flag overrules 'ignorecase' and 'smartcase' + if (subflags.do_ic == kSubIgnoreCase) { + regmatch.rmm_ic = true; + } else if (subflags.do_ic == kSubMatchCase) { + regmatch.rmm_ic = false; + } sub_firstline = NULL; @@ -3179,29 +3270,25 @@ void do_sub(exarg_T *eap) if (!(sub[0] == '\\' && sub[1] == '=')) sub = regtilde(sub, p_magic); - /* - * Check for a match on each line. - */ - line2 = eap->line2; - for (lnum = eap->line1; lnum <= line2 && !(got_quit - || aborting() - ); ++lnum) { - nmatch = vim_regexec_multi(®match, curwin, curbuf, lnum, - (colnr_T)0, NULL); + // Check for a match on each line. + linenr_T line2 = eap->line2; + for (linenr_T lnum = eap->line1; + lnum <= line2 && !(got_quit || aborting()); + lnum++) { + long nmatch = vim_regexec_multi(®match, curwin, curbuf, lnum, + (colnr_T)0, NULL); if (nmatch) { colnr_T copycol; colnr_T matchcol; colnr_T prev_matchcol = MAXCOL; char_u *new_end, *new_start = NULL; - unsigned new_start_len = 0; char_u *p1; int did_sub = FALSE; int lastone; - int len, copy_len, needed_len; - long nmatch_tl = 0; /* nr of lines matched below lnum */ - int do_again; /* do it again after joining lines */ - int skip_match = FALSE; - linenr_T sub_firstlnum; /* nr of first sub line */ + long nmatch_tl = 0; // nr of lines matched below lnum + int do_again; // do it again after joining lines + int skip_match = false; + linenr_T sub_firstlnum; // nr of first sub line /* * The new text is build up step by step, to avoid too much @@ -3241,8 +3328,7 @@ void do_sub(exarg_T *eap) * accordingly. * * The new text is built up in new_start[]. It has some extra - * room to avoid using xmalloc()/free() too often. new_start_len is - * the length of the allocated memory at new_start. + * room to avoid using xmalloc()/free() too often. * * Make a copy of the old line, so it won't be taken away when * updating the screen or handling a multi-line match. The "old_" @@ -3261,9 +3347,9 @@ void do_sub(exarg_T *eap) /* * Loop until nothing more to replace in this line. * 1. Handle match with empty string. - * 2. If do_ask is set, ask for confirmation. + * 2. If subflags.do_ask is set, ask for confirmation. * 3. substitute the string. - * 4. if do_all is set, find next match + * 4. if subflags.do_all is set, find next match * 5. break if there isn't another match in this line */ for (;; ) { @@ -3314,15 +3400,13 @@ void do_sub(exarg_T *eap) matchcol = regmatch.endpos[0].col; prev_matchcol = matchcol; - /* - * 2. If do_count is set only increase the counter. - * If do_ask is set, ask for confirmation. - */ - if (do_count) { - /* For a multi-line match, put matchcol at the NUL at - * the end of the line and set nmatch to one, so that - * we continue looking for a match on the next line. - * Avoids that ":s/\nB\@=//gc" get stuck. */ + // 2. If subflags.do_count is set only increase the counter. + // If do_ask is set, ask for confirmation. + if (subflags.do_count) { + // For a multi-line match, put matchcol at the NUL at + // the end of the line and set nmatch to one, so that + // we continue looking for a match on the next line. + // Avoids that ":s/\nB\@=//gc" get stuck. if (nmatch > 1) { matchcol = (colnr_T)STRLEN(sub_firstline); nmatch = 1; @@ -3336,12 +3420,12 @@ void do_sub(exarg_T *eap) goto skip; } - if (do_ask) { + if (subflags.do_ask) { int typed = 0; /* change State to CONFIRM, so that the mouse works * properly */ - save_State = State; + int save_State = State; State = CONFIRM; setmouse(); /* disable mouse in xterm */ curwin->w_cursor.col = regmatch.startpos[0].col; @@ -3354,17 +3438,17 @@ void do_sub(exarg_T *eap) /* * Loop until 'y', 'n', 'q', CTRL-E or CTRL-Y typed. */ - while (do_ask) { + while (subflags.do_ask) { if (exmode_active) { char_u *resp; colnr_T sc, ec; - print_line_no_prefix(lnum, do_number, do_list); + print_line_no_prefix(lnum, subflags.do_number, subflags.do_list); getvcol(curwin, &curwin->w_cursor, &sc, NULL, NULL); curwin->w_cursor.col = regmatch.endpos[0].col - 1; getvcol(curwin, &curwin->w_cursor, NULL, NULL, &ec); - if (do_number || curwin->w_p_nu) { + if (subflags.do_number || curwin->w_p_nu) { int numw = number_width(curwin) + 1; sc += numw; ec += numw; @@ -3388,7 +3472,7 @@ void do_sub(exarg_T *eap) curwin->w_p_fen = FALSE; /* Invert the matched string. * Remove the inversion afterwards. */ - temp = RedrawingDisabled; + int temp = RedrawingDisabled; RedrawingDisabled = 0; if (new_start != NULL) { @@ -3468,13 +3552,13 @@ void do_sub(exarg_T *eap) if (typed == 'y') break; if (typed == 'l') { - /* last: replace and then stop */ - do_all = FALSE; + // last: replace and then stop + subflags.do_all = false; line2 = lnum; break; } if (typed == 'a') { - do_ask = FALSE; + subflags.do_ask = false; break; } if (typed == Ctrl_E) @@ -3510,19 +3594,26 @@ void do_sub(exarg_T *eap) /* * 3. substitute the string. */ - if (do_count) { - /* prevent accidentally changing the buffer by a function */ + if (subflags.do_count) { + // prevent accidentally changing the buffer by a function save_ma = curbuf->b_p_ma; - curbuf->b_p_ma = FALSE; + curbuf->b_p_ma = false; sandbox++; } - /* get length of substitution part */ + // Save flags for recursion. They can change for e.g. + // :s/^/\=execute("s#^##gn") + subflags_T subflags_save = subflags; + // get length of substitution part sublen = vim_regsub_multi(®match, - sub_firstlnum - regmatch.startpos[0].lnum, - sub, sub_firstline, FALSE, p_magic, TRUE); - if (do_count) { + sub_firstlnum - regmatch.startpos[0].lnum, + sub, sub_firstline, false, p_magic, true); + // Don't keep flags set by a recursive call + subflags = subflags_save; + if (subflags.do_count) { curbuf->b_p_ma = save_ma; - sandbox--; + if (sandbox > 0) { + sandbox--; + } goto skip; } @@ -3545,33 +3636,10 @@ void do_sub(exarg_T *eap) p1 = ml_get(sub_firstlnum + nmatch - 1); nmatch_tl += nmatch - 1; } - copy_len = regmatch.startpos[0].col - copycol; - needed_len = copy_len + ((unsigned)STRLEN(p1) - - regmatch.endpos[0].col) + sublen + 1; - if (new_start == NULL) { - /* - * Get some space for a temporary buffer to do the - * substitution into (and some extra space to avoid - * too many calls to xmalloc()/free()). - */ - new_start_len = needed_len + 50; - new_start = xmalloc(new_start_len); - *new_start = NUL; - new_end = new_start; - } else { - /* - * Check if the temporary buffer is long enough to do the - * substitution into. If not, make it larger (with a bit - * extra to avoid too many calls to xmalloc()/free()). - */ - len = (unsigned)STRLEN(new_start); - needed_len += len; - if (needed_len > (int)new_start_len) { - new_start_len = needed_len + 50; - new_start = xrealloc(new_start, new_start_len); - } - new_end = new_start + len; - } + size_t copy_len = regmatch.startpos[0].col - copycol; + new_end = sub_grow_buf(&new_start, + copy_len + (STRLEN(p1) - regmatch.endpos[0].col) + + sublen + 1); /* * copy the text up to the part that matched @@ -3595,11 +3663,12 @@ void do_sub(exarg_T *eap) sub_firstlnum += nmatch - 1; xfree(sub_firstline); sub_firstline = vim_strsave(ml_get(sub_firstlnum)); - /* When going beyond the last line, stop substituting. */ - if (sub_firstlnum <= line2) - do_again = TRUE; - else - do_all = FALSE; + // When going beyond the last line, stop substituting. + if (sub_firstlnum <= line2) { + do_again = true; + } else { + subflags.do_all = false; + } } /* Remember next character to be copied. */ @@ -3630,11 +3699,12 @@ void do_sub(exarg_T *eap) ml_append(lnum - 1, new_start, (colnr_T)(p1 - new_start + 1), FALSE); mark_adjust(lnum + 1, (linenr_T)MAXLNUM, 1L, 0L); - if (do_ask) + if (subflags.do_ask) { appended_lines(lnum - 1, 1L); - else { - if (first_line == 0) + } else { + if (first_line == 0) { first_line = lnum; + } last_line = lnum + 1; } /* All line numbers increase. */ @@ -3651,12 +3721,10 @@ void do_sub(exarg_T *eap) p1 += (*mb_ptr2len)(p1) - 1; } - /* - * 4. If do_all is set, find next match. - * Prevent endless loop with patterns that match empty - * strings, e.g. :s/$/pat/g or :s/[a-z]* /(&)/g. - * But ":s/\n/#/" is OK. - */ + // 4. If subflags.do_all is set, find next match. + // Prevent endless loop with patterns that match empty + // strings, e.g. :s/$/pat/g or :s/[a-z]* /(&)/g. + // But ":s/\n/#/" is OK. skip: /* We already know that we did the last subst when we are at * the end of the line, except that a pattern like @@ -3667,7 +3735,7 @@ skip: || got_int || got_quit || lnum > line2 - || !(do_all || do_again) + || !(subflags.do_all || do_again) || (sub_firstline[matchcol] == NUL && nmatch <= 1 && !re_multiline(regmatch.regprog))); nmatch = -1; @@ -3717,21 +3785,23 @@ skip: for (i = 0; i < nmatch_tl; ++i) ml_delete(lnum, (int)FALSE); mark_adjust(lnum, lnum + nmatch_tl - 1, - (long)MAXLNUM, -nmatch_tl); - if (do_ask) + (long)MAXLNUM, -nmatch_tl); + if (subflags.do_ask) { deleted_lines(lnum, nmatch_tl); - --lnum; - line2 -= nmatch_tl; /* nr of lines decreases */ + } + lnum--; + line2 -= nmatch_tl; // nr of lines decreases nmatch_tl = 0; } /* When asking, undo is saved each time, must also set * changed flag each time. */ - if (do_ask) + if (subflags.do_ask) { changed_bytes(lnum, 0); - else { - if (first_line == 0) + } else { + if (first_line == 0) { first_line = lnum; + } last_line = lnum + 1; } @@ -3784,9 +3854,10 @@ skip: xfree(sub_firstline); /* may have to free allocated copy of the line */ - /* ":s/pat//n" doesn't move the cursor */ - if (do_count) + // ":s/pat//n" doesn't move the cursor + if (subflags.do_count) { curwin->w_cursor = old_cursor; + } if (sub_nsubs > start_nsubs) { /* Set the '[ and '] marks. */ @@ -3795,28 +3866,37 @@ skip: curbuf->b_op_start.col = curbuf->b_op_end.col = 0; if (!global_busy) { - if (!do_ask) { /* when interactive leave cursor on the match */ - if (endcolumn) + // when interactive leave cursor on the match + if (!subflags.do_ask) { + if (endcolumn) { coladvance((colnr_T)MAXCOL); - else + } else { beginline(BL_WHITE | BL_FIX); + } } - if (!do_sub_msg(do_count) && do_ask) + if (!do_sub_msg(subflags.do_count) && subflags.do_ask) { MSG(""); - } else - global_need_beginline = TRUE; - if (do_print) - print_line(curwin->w_cursor.lnum, do_number, do_list); + } + } else { + global_need_beginline = true; + } + if (subflags.do_print) { + print_line(curwin->w_cursor.lnum, subflags.do_number, subflags.do_list); + } } else if (!global_busy) { - if (got_int) /* interrupted */ + if (got_int) { + // interrupted EMSG(_(e_interr)); - else if (got_match) /* did find something but nothing substituted */ + } else if (got_match) { + // did find something but nothing substituted MSG(""); - else if (do_error) /* nothing found */ + } else if (subflags.do_error) { + // nothing found EMSG2(_(e_patnotf2), get_search_pat()); + } } - if (do_ask && hasAnyFolding(curwin)) { + if (subflags.do_ask && hasAnyFolding(curwin)) { // Cursor position may require updating changed_window_setting(); } @@ -3824,9 +3904,9 @@ skip: vim_regfree(regmatch.regprog); // Restore the flag values, they can be used for ":&&". - do_all = save_do_all; - do_ask = save_do_ask; -} + subflags.do_all = save_do_all; + subflags.do_ask = save_do_ask; +} // NOLINT(readability/fn_size) /* * Give message for number of substitutions. @@ -3982,9 +4062,7 @@ void ex_global(exarg_T *eap) smsg(_("Pattern not found: %s"), pat); } } else { - start_global_changes(); global_exe(cmd); - end_global_changes(); } ml_clearmarked(); /* clear rest of the marks */ vim_regfree(regmatch.regprog); @@ -4494,12 +4572,15 @@ int find_help_tags(char_u *arg, int *num_matches, char_u ***matches, int keep_la break; } - /* - * If tag starts with ', toss everything after a second '. Fixes - * CTRL-] on 'option'. (would include the trailing '.'). - */ - if (*s == '\'' && s > arg && *arg == '\'') + // If tag starts with ', toss everything after a second '. Fixes + // CTRL-] on 'option'. (would include the trailing '.'). + if (*s == '\'' && s > arg && *arg == '\'') { break; + } + // Also '{' and '}'. Fixes CTRL-] on '{address}'. + if (*s == '}' && s > arg && *arg == '{') { + break; + } } *d = NUL; diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c index 6d24ba91f2..f68663c60c 100644 --- a/src/nvim/ex_cmds2.c +++ b/src/nvim/ex_cmds2.c @@ -27,7 +27,6 @@ #include "nvim/mbyte.h" #include "nvim/message.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" #include "nvim/garray.h" #include "nvim/memory.h" #include "nvim/move.h" @@ -1983,8 +1982,6 @@ void ex_listdo(exarg_T *eap) save_ei = au_event_disable(",Syntax"); } - start_global_changes(); - if (eap->cmdidx == CMD_windo || eap->cmdidx == CMD_tabdo || P_HID(curbuf) @@ -2181,7 +2178,6 @@ void ex_listdo(exarg_T *eap) apply_autocmds(EVENT_SYNTAX, curbuf->b_p_syn, curbuf->b_fname, true, curbuf); } - end_global_changes(); } /// Add files[count] to the arglist of the current window after arg "after". diff --git a/src/nvim/ex_cmds_defs.h b/src/nvim/ex_cmds_defs.h index f46d1e6d47..8148eb5cee 100644 --- a/src/nvim/ex_cmds_defs.h +++ b/src/nvim/ex_cmds_defs.h @@ -126,57 +126,53 @@ struct exarg { struct condstack *cstack; ///< condition stack for ":if" etc. }; -#define FORCE_BIN 1 /* ":edit ++bin file" */ -#define FORCE_NOBIN 2 /* ":edit ++nobin file" */ - -/* Values for "flags" */ -#define EXFLAG_LIST 0x01 /* 'l': list */ -#define EXFLAG_NR 0x02 /* '#': number */ -#define EXFLAG_PRINT 0x04 /* 'p': print */ - -/* - * used for completion on the command line - */ -typedef struct expand { - int xp_context; /* type of expansion */ - char_u *xp_pattern; /* start of item to expand */ - int xp_pattern_len; /* bytes in xp_pattern before cursor */ - char_u *xp_arg; /* completion function */ - int xp_scriptID; /* SID for completion function */ - int xp_backslash; /* one of the XP_BS_ values */ +#define FORCE_BIN 1 // ":edit ++bin file" +#define FORCE_NOBIN 2 // ":edit ++nobin file" + +// Values for "flags" +#define EXFLAG_LIST 0x01 // 'l': list +#define EXFLAG_NR 0x02 // '#': number +#define EXFLAG_PRINT 0x04 // 'p': print + +// used for completion on the command line +struct expand { + int xp_context; // type of expansion + char_u *xp_pattern; // start of item to expand + int xp_pattern_len; // bytes in xp_pattern before cursor + char_u *xp_arg; // completion function + int xp_scriptID; // SID for completion function + int xp_backslash; // one of the XP_BS_ values #ifndef BACKSLASH_IN_FILENAME - int xp_shell; /* TRUE for a shell command, more - characters need to be escaped */ + int xp_shell; // TRUE for a shell command, more + // characters need to be escaped #endif - int xp_numfiles; /* number of files found by - file name completion */ - char_u **xp_files; /* list of files */ - char_u *xp_line; /* text being completed */ - int xp_col; /* cursor position in line */ -} expand_T; - -/* values for xp_backslash */ -#define XP_BS_NONE 0 /* nothing special for backslashes */ -#define XP_BS_ONE 1 /* uses one backslash before a space */ -#define XP_BS_THREE 2 /* uses three backslashes before a space */ + int xp_numfiles; // number of files found by file name completion + char_u **xp_files; // list of files + char_u *xp_line; // text being completed + int xp_col; // cursor position in line +}; -/* - * Command modifiers ":vertical", ":browse", ":confirm" and ":hide" set a flag. - * This needs to be saved for recursive commands, put them in a structure for - * easy manipulation. - */ +// values for xp_backslash +#define XP_BS_NONE 0 // nothing special for backslashes +#define XP_BS_ONE 1 // uses one backslash before a space +#define XP_BS_THREE 2 // uses three backslashes before a space + +/// Command modifiers ":vertical", ":browse", ":confirm", ":hide", etc. set a +/// flag. This needs to be saved for recursive commands, put them in a +/// structure for easy manipulation. typedef struct { - int hide; /* TRUE when ":hide" was used */ - int split; /* flags for win_split() */ - int tab; /* > 0 when ":tab" was used */ - int confirm; /* TRUE to invoke yes/no dialog */ - int keepalt; /* TRUE when ":keepalt" was used */ - int keepmarks; /* TRUE when ":keepmarks" was used */ - int keepjumps; /* TRUE when ":keepjumps" was used */ - int lockmarks; /* TRUE when ":lockmarks" was used */ - int keeppatterns; /* TRUE when ":keeppatterns" was used */ - bool noswapfile; /* true when ":noswapfile" was used */ - char_u *save_ei; /* saved value of 'eventignore' */ + int split; ///< flags for win_split() + int tab; ///< > 0 when ":tab" was used + bool browse; ///< true to invoke file dialog + bool confirm; ///< true to invoke yes/no dialog + bool hide; ///< true when ":hide" was used + bool keepalt; ///< true when ":keepalt" was used + bool keepjumps; ///< true when ":keepjumps" was used + bool keepmarks; ///< true when ":keepmarks" was used + bool keeppatterns; ///< true when ":keeppatterns" was used + bool lockmarks; ///< true when ":lockmarks" was used + bool noswapfile; ///< true when ":noswapfile" was used + char_u *save_ei; ///< saved value of 'eventignore' } cmdmod_T; #endif // NVIM_EX_CMDS_DEFS_H diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 8bae817211..45407b7f12 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -36,7 +36,6 @@ #include "nvim/menu.h" #include "nvim/message.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" #include "nvim/keymap.h" #include "nvim/file_search.h" #include "nvim/garray.h" @@ -345,7 +344,8 @@ int do_cmdline(char_u *cmdline, LineGetter fgetline, msg_list = saved_msg_list; return FAIL; } - ++call_depth; + call_depth++; + start_batch_changes(); cstack.cs_idx = -1; cstack.cs_looplevel = 0; @@ -952,7 +952,8 @@ int do_cmdline(char_u *cmdline, LineGetter fgetline, did_endif = FALSE; /* in case do_cmdline used recursively */ - --call_depth; + call_depth--; + end_batch_changes(); return retval; } @@ -1313,8 +1314,9 @@ static char_u * do_one_cmd(char_u **cmdlinep, case 'b': if (checkforcmd(&ea.cmd, "belowright", 3)) { cmdmod.split |= WSP_BELOW; continue; - } + } if (checkforcmd(&ea.cmd, "browse", 3)) { + cmdmod.browse = true; continue; } if (!checkforcmd(&ea.cmd, "botright", 2)) @@ -1324,24 +1326,24 @@ static char_u * do_one_cmd(char_u **cmdlinep, case 'c': if (!checkforcmd(&ea.cmd, "confirm", 4)) break; - cmdmod.confirm = TRUE; + cmdmod.confirm = true; continue; case 'k': if (checkforcmd(&ea.cmd, "keepmarks", 3)) { - cmdmod.keepmarks = TRUE; + cmdmod.keepmarks = true; continue; } if (checkforcmd(&ea.cmd, "keepalt", 5)) { - cmdmod.keepalt = TRUE; + cmdmod.keepalt = true; continue; } if (checkforcmd(&ea.cmd, "keeppatterns", 5)) { - cmdmod.keeppatterns = TRUE; + cmdmod.keeppatterns = true; continue; } if (!checkforcmd(&ea.cmd, "keepjumps", 5)) break; - cmdmod.keepjumps = TRUE; + cmdmod.keepjumps = true; continue; /* ":hide" and ":hide | cmd" are not modifiers */ @@ -1349,11 +1351,11 @@ static char_u * do_one_cmd(char_u **cmdlinep, || *p == NUL || ends_excmd(*p)) break; ea.cmd = p; - cmdmod.hide = TRUE; + cmdmod.hide = true; continue; case 'l': if (checkforcmd(&ea.cmd, "lockmarks", 3)) { - cmdmod.lockmarks = TRUE; + cmdmod.lockmarks = true; continue; } @@ -4361,12 +4363,15 @@ static void ex_autocmd(exarg_T *eap) */ static void ex_doautocmd(exarg_T *eap) { - char_u *arg = eap->arg; + char_u *arg = eap->arg; int call_do_modelines = check_nomodeline(&arg); + bool did_aucmd; - (void)do_doautocmd(arg, TRUE); - if (call_do_modelines) /* Only when there is no <nomodeline>. */ + (void)do_doautocmd(arg, true, &did_aucmd); + // Only when there is no <nomodeline>. + if (call_do_modelines && did_aucmd) { do_modelines(0); + } } /* @@ -5153,6 +5158,24 @@ static char_u *uc_split_args(char_u *arg, size_t *lenp) return buf; } +static size_t add_cmd_modifier(char_u *buf, char *mod_str, bool *multi_mods) +{ + size_t result = STRLEN(mod_str); + if (*multi_mods) { + result++; + } + + if (buf != NULL) { + if (*multi_mods) { + STRCAT(buf, " "); + } + STRCAT(buf, mod_str); + } + + *multi_mods = true; + return result; +} + /* * Check for a <> code in a user command. * "code" points to the '<'. "len" the length of the <> (inclusive). @@ -5177,8 +5200,8 @@ uc_check_code ( char_u *p = code + 1; size_t l = len - 2; int quote = 0; - enum { ct_ARGS, ct_BANG, ct_COUNT, ct_LINE1, ct_LINE2, ct_REGISTER, - ct_LT, ct_NONE } type = ct_NONE; + enum { ct_ARGS, ct_BANG, ct_COUNT, ct_LINE1, ct_LINE2, ct_MODS, + ct_REGISTER, ct_LT, ct_NONE } type = ct_NONE; if ((vim_strchr((char_u *)"qQfF", *p) != NULL) && p[1] == '-') { quote = (*p == 'q' || *p == 'Q') ? 1 : 2; @@ -5186,23 +5209,26 @@ uc_check_code ( l -= 2; } - ++l; - if (l <= 1) + l++; + if (l <= 1) { type = ct_NONE; - else if (STRNICMP(p, "args>", l) == 0) + } else if (STRNICMP(p, "args>", l) == 0) { type = ct_ARGS; - else if (STRNICMP(p, "bang>", l) == 0) + } else if (STRNICMP(p, "bang>", l) == 0) { type = ct_BANG; - else if (STRNICMP(p, "count>", l) == 0) + } else if (STRNICMP(p, "count>", l) == 0) { type = ct_COUNT; - else if (STRNICMP(p, "line1>", l) == 0) + } else if (STRNICMP(p, "line1>", l) == 0) { type = ct_LINE1; - else if (STRNICMP(p, "line2>", l) == 0) + } else if (STRNICMP(p, "line2>", l) == 0) { type = ct_LINE2; - else if (STRNICMP(p, "lt>", l) == 0) + } else if (STRNICMP(p, "lt>", l) == 0) { type = ct_LT; - else if (STRNICMP(p, "reg>", l) == 0 || STRNICMP(p, "register>", l) == 0) + } else if (STRNICMP(p, "reg>", l) == 0 || STRNICMP(p, "register>", l) == 0) { type = ct_REGISTER; + } else if (STRNICMP(p, "mods>", l) == 0) { + type = ct_MODS; + } switch (type) { case ct_ARGS: @@ -5310,6 +5336,87 @@ uc_check_code ( break; } + case ct_MODS: + { + result = quote ? 2 : 0; + if (buf != NULL) { + if (quote) { + *buf++ = '"'; + } + *buf = '\0'; + } + + bool multi_mods = false; + + // :aboveleft and :leftabove + if (cmdmod.split & WSP_ABOVE) { + result += add_cmd_modifier(buf, "aboveleft", &multi_mods); + } + // :belowright and :rightbelow + if (cmdmod.split & WSP_BELOW) { + result += add_cmd_modifier(buf, "belowright", &multi_mods); + } + // :botright + if (cmdmod.split & WSP_BOT) { + result += add_cmd_modifier(buf, "botright", &multi_mods); + } + + typedef struct { + bool *set; + char *name; + } mod_entry_T; + static mod_entry_T mod_entries[] = { + { &cmdmod.browse, "browse" }, + { &cmdmod.confirm, "confirm" }, + { &cmdmod.hide, "hide" }, + { &cmdmod.keepalt, "keepalt" }, + { &cmdmod.keepjumps, "keepjumps" }, + { &cmdmod.keepmarks, "keepmarks" }, + { &cmdmod.keeppatterns, "keeppatterns" }, + { &cmdmod.lockmarks, "lockmarks" }, + { &cmdmod.noswapfile, "noswapfile" } + }; + // the modifiers that are simple flags + for (size_t i = 0; i < ARRAY_SIZE(mod_entries); i++) { + if (*mod_entries[i].set) { + result += add_cmd_modifier(buf, mod_entries[i].name, &multi_mods); + } + } + + // TODO(vim): How to support :noautocmd? + // TODO(vim): How to support :sandbox? + + // :silent + if (msg_silent > 0) { + result += add_cmd_modifier(buf, emsg_silent > 0 ? "silent!" : "silent", + &multi_mods); + } + // :tab + if (cmdmod.tab > 0) { + result += add_cmd_modifier(buf, "tab", &multi_mods); + } + // :topleft + if (cmdmod.split & WSP_TOP) { + result += add_cmd_modifier(buf, "topleft", &multi_mods); + } + + // TODO(vim): How to support :unsilent? + + // :verbose + if (p_verbose > 0) { + result += add_cmd_modifier(buf, "verbose", &multi_mods); + } + // :vertical + if (cmdmod.split & WSP_VERT) { + result += add_cmd_modifier(buf, "vertical", &multi_mods); + } + if (quote && buf != NULL) { + buf += result - 2; + *buf = '"'; + } + break; + } + case ct_REGISTER: result = eap->regname ? 1 : 0; if (quote) @@ -9359,7 +9466,7 @@ static void ex_filetype(exarg_T *eap) } } if (*arg == 'd') { - (void)do_doautocmd((char_u *)"filetypedetect BufRead", TRUE); + (void)do_doautocmd((char_u *)"filetypedetect BufRead", true, NULL); do_modelines(0); } } else if (STRCMP(arg, "off") == 0) { @@ -9510,20 +9617,15 @@ static void ex_foldopen(exarg_T *eap) static void ex_folddo(exarg_T *eap) { - linenr_T lnum; - - start_global_changes(); - - /* First set the marks for all lines closed/open. */ - for (lnum = eap->line1; lnum <= eap->line2; ++lnum) - if (hasFolding(lnum, NULL, NULL) == (eap->cmdidx == CMD_folddoclosed)) + // First set the marks for all lines closed/open. + for (linenr_T lnum = eap->line1; lnum <= eap->line2; ++lnum) { + if (hasFolding(lnum, NULL, NULL) == (eap->cmdidx == CMD_folddoclosed)) { ml_setmarked(lnum); + } + } - /* Execute the command on the marked lines. */ - global_exe(eap->arg); - ml_clearmarked(); /* clear rest of the marks */ - - end_global_changes(); + global_exe(eap->arg); // Execute the command on the marked lines. + ml_clearmarked(); // clear rest of the marks } static void ex_terminal(exarg_T *eap) diff --git a/src/nvim/ex_eval.c b/src/nvim/ex_eval.c index 82d4c2b2d5..f518fa0d66 100644 --- a/src/nvim/ex_eval.c +++ b/src/nvim/ex_eval.c @@ -15,7 +15,6 @@ #include "nvim/ex_cmds2.h" #include "nvim/ex_docmd.h" #include "nvim/message.h" -#include "nvim/misc2.h" #include "nvim/memory.h" #include "nvim/regexp.h" #include "nvim/strings.h" diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index cd28554970..1a97dc3d6f 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -34,7 +34,6 @@ #include "nvim/menu.h" #include "nvim/message.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" #include "nvim/memory.h" #include "nvim/cursor_shape.h" #include "nvim/keymap.h" diff --git a/src/nvim/farsi.c b/src/nvim/farsi.c index 61e17128ea..eb22ad1428 100644 --- a/src/nvim/farsi.c +++ b/src/nvim/farsi.c @@ -15,7 +15,6 @@ #include "nvim/memline.h" #include "nvim/message.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" #include "nvim/screen.h" #include "nvim/strings.h" #include "nvim/vim.h" diff --git a/src/nvim/file_search.c b/src/nvim/file_search.c index 78b224f04c..c6cfba8142 100644 --- a/src/nvim/file_search.c +++ b/src/nvim/file_search.c @@ -1,48 +1,44 @@ -/* TODO: make some #ifdef for this */ -/*--------[ file searching ]-------------------------------------------------*/ -/* - * File searching functions for 'path', 'tags' and 'cdpath' options. - * External visible functions: - * vim_findfile_init() creates/initialises the search context - * vim_findfile_free_visited() free list of visited files/dirs of search - * context - * vim_findfile() find a file in the search context - * vim_findfile_cleanup() cleanup/free search context created by - * vim_findfile_init() - * - * All static functions and variables start with 'ff_' - * - * In general it works like this: - * First you create yourself a search context by calling vim_findfile_init(). - * It is possible to give a search context from a previous call to - * vim_findfile_init(), so it can be reused. After this you call vim_findfile() - * until you are satisfied with the result or it returns NULL. On every call it - * returns the next file which matches the conditions given to - * vim_findfile_init(). If it doesn't find a next file it returns NULL. - * - * It is possible to call vim_findfile_init() again to reinitialise your search - * with some new parameters. Don't forget to pass your old search context to - * it, so it can reuse it and especially reuse the list of already visited - * directories. If you want to delete the list of already visited directories - * simply call vim_findfile_free_visited(). - * - * When you are done call vim_findfile_cleanup() to free the search context. - * - * The function vim_findfile_init() has a long comment, which describes the - * needed parameters. - * - * - * - * ATTENTION: - * ========== - * Also we use an allocated search context here, this functions are NOT - * thread-safe!!!!! - * - * To minimize parameter passing (or because I'm to lazy), only the - * external visible functions get a search context as a parameter. This is - * then assigned to a static global, which is used throughout the local - * functions. - */ +// File searching functions for 'path', 'tags' and 'cdpath' options. +// +// External visible functions: +// vim_findfile_init() creates/initialises the search context +// vim_findfile_free_visited() free list of visited files/dirs of search +// context +// vim_findfile() find a file in the search context +// vim_findfile_cleanup() cleanup/free search context created by +// vim_findfile_init() +// +// All static functions and variables start with 'ff_' +// +// In general it works like this: +// First you create yourself a search context by calling vim_findfile_init(). +// It is possible to give a search context from a previous call to +// vim_findfile_init(), so it can be reused. After this you call vim_findfile() +// until you are satisfied with the result or it returns NULL. On every call it +// returns the next file which matches the conditions given to +// vim_findfile_init(). If it doesn't find a next file it returns NULL. +// +// It is possible to call vim_findfile_init() again to reinitialise your search +// with some new parameters. Don't forget to pass your old search context to +// it, so it can reuse it and especially reuse the list of already visited +// directories. If you want to delete the list of already visited directories +// simply call vim_findfile_free_visited(). +// +// When you are done call vim_findfile_cleanup() to free the search context. +// +// The function vim_findfile_init() has a long comment, which describes the +// needed parameters. +// +// +// +// ATTENTION: +// ========== +// We use an allocated search context, these functions are NOT thread-safe!!!!! +// +// To minimize parameter passing (or because I'm too lazy), only the +// external visible functions get a search context as a parameter. This is +// then assigned to a static global, which is used throughout the local +// functions. #include <assert.h> #include <string.h> @@ -59,7 +55,7 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" +#include "nvim/option.h" #include "nvim/os_unix.h" #include "nvim/path.h" #include "nvim/strings.h" @@ -1526,3 +1522,28 @@ theend: return file_name; } +/// Change to a file's directory. +/// Caller must call shorten_fnames()! +/// @return OK or FAIL +int vim_chdirfile(char_u *fname) +{ + char_u dir[MAXPATHL]; + + STRLCPY(dir, fname, MAXPATHL); + *path_tail_with_sep(dir) = NUL; + return os_chdir((char *)dir) == 0 ? OK : FAIL; +} + +/// Change directory to "new_dir". Search 'cdpath' for relative directory names. +int vim_chdir(char_u *new_dir) +{ + char_u *dir_name = find_directory_in_path(new_dir, STRLEN(new_dir), + FNAME_MESS, curbuf->b_ffname); + if (dir_name == NULL) { + return -1; + } + int r = os_chdir((char *)dir_name); + xfree(dir_name); + return r; +} + diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index 154558b332..c0d4a71b35 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -32,7 +32,6 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" #include "nvim/garray.h" #include "nvim/move.h" #include "nvim/normal.h" @@ -44,6 +43,7 @@ #include "nvim/screen.h" #include "nvim/search.h" #include "nvim/sha256.h" +#include "nvim/state.h" #include "nvim/strings.h" #include "nvim/ui.h" #include "nvim/types.h" @@ -282,11 +282,9 @@ readfile ( int error = FALSE; /* errors encountered */ int ff_error = EOL_UNKNOWN; /* file format with errors */ long linerest = 0; /* remaining chars in line */ -#ifdef UNIX int perm = 0; +#ifdef UNIX int swap_mode = -1; /* protection bits for swap file */ -#else - int perm; #endif int fileformat = 0; /* end-of-line format */ int keep_fileformat = FALSE; @@ -418,23 +416,21 @@ readfile ( } } - if (!read_stdin && !read_buffer) { -#ifdef UNIX - /* - * On Unix it is possible to read a directory, so we have to - * check for it before os_open(). - */ + if (!read_buffer && !read_stdin) { perm = os_getperm(fname); - if (perm >= 0 && !S_ISREG(perm) /* not a regular file ... */ +#ifdef UNIX + // On Unix it is possible to read a directory, so we have to + // check for it before os_open(). + if (perm >= 0 && !S_ISREG(perm) // not a regular file ... # ifdef S_ISFIFO - && !S_ISFIFO(perm) /* ... or fifo */ + && !S_ISFIFO(perm) // ... or fifo # endif # ifdef S_ISSOCK - && !S_ISSOCK(perm) /* ... or socket */ + && !S_ISSOCK(perm) // ... or socket # endif # ifdef OPEN_CHR_FILES && !(S_ISCHR(perm) && is_dev_fd_file(fname)) - /* ... or a character special file named /dev/fd/<n> */ + // ... or a character special file named /dev/fd/<n> # endif ) { if (S_ISDIR(perm)) @@ -493,44 +489,31 @@ readfile ( curbuf->b_flags &= ~(BF_NEW | BF_NEW_W); } - /* - * Check readonly by trying to open the file for writing. - * If this fails, we know that the file is readonly. - */ - file_readonly = FALSE; + // Check readonly. + file_readonly = false; if (!read_buffer && !read_stdin) { - if (!newfile || readonlymode) { - file_readonly = TRUE; - } else if ((fd = os_open((char *)fname, O_RDWR, 0)) < 0) { - // opening in readwrite mode failed => file is readonly - file_readonly = TRUE; - } - if (file_readonly == TRUE) { - // try to open readonly - fd = os_open((char *)fname, O_RDONLY, 0); + if (!newfile || readonlymode || !(perm & 0222) + || !os_file_is_writable((char *)fname)) { + file_readonly = true; } + fd = os_open((char *)fname, O_RDONLY, 0); } - if (fd < 0) { /* cannot open at all */ + if (fd < 0) { // cannot open at all msg_scroll = msg_save; #ifndef UNIX - /* - * On non-unix systems we can't open a directory, check here. - */ - perm = os_getperm(fname); /* check if the file exists */ + // On non-unix systems we can't open a directory, check here. if (os_isdir(fname)) { filemess(curbuf, sfname, (char_u *)_("is a directory"), 0); - curbuf->b_p_ro = TRUE; /* must use "w!" now */ - } else + curbuf->b_p_ro = true; // must use "w!" now + } else { #endif if (!newfile) { return FAIL; } - if (perm == UV_ENOENT) { - /* - * Set the 'new-file' flag, so that when the file has - * been created by someone else, a ":w" will complain. - */ + if (perm == UV_ENOENT) { // check if the file exists + // Set the 'new-file' flag, so that when the file has + // been created by someone else, a ":w" will complain. curbuf->b_flags |= BF_NEW; /* Create a swap file now, so that other Vims are warned @@ -581,6 +564,9 @@ readfile ( return FAIL; } +#ifndef UNIX + } +#endif /* * Only set the 'ro' flag for readonly files the first time they are @@ -3787,8 +3773,9 @@ static int set_rw_fname(char_u *fname, char_u *sfname) /* Do filetype detection now if 'filetype' is empty. */ if (*curbuf->b_p_ft == NUL) { - if (au_has_group((char_u *)"filetypedetect")) - (void)do_doautocmd((char_u *)"filetypedetect BufRead", FALSE); + if (au_has_group((char_u *)"filetypedetect")) { + (void)do_doautocmd((char_u *)"filetypedetect BufRead", false, NULL); + } do_modelines(0); } @@ -4460,11 +4447,95 @@ bool vim_fgets(char_u *buf, int size, FILE *fp) FUNC_ATTR_NONNULL_ALL return eof == NULL; } -/* - * os_rename() only works if both files are on the same file system, this - * function will (attempts to?) copy the file across if rename fails -- webb - * Return -1 for failure, 0 for success. - */ +/// Read 2 bytes from "fd" and turn them into an int, MSB first. +int get2c(FILE *fd) +{ + int n; + + n = getc(fd); + n = (n << 8) + getc(fd); + return n; +} + +/// Read 3 bytes from "fd" and turn them into an int, MSB first. +int get3c(FILE *fd) +{ + int n; + + n = getc(fd); + n = (n << 8) + getc(fd); + n = (n << 8) + getc(fd); + return n; +} + +/// Read 4 bytes from "fd" and turn them into an int, MSB first. +int get4c(FILE *fd) +{ + // Use unsigned rather than int otherwise result is undefined + // when left-shift sets the MSB. + unsigned n; + + n = (unsigned)getc(fd); + n = (n << 8) + (unsigned)getc(fd); + n = (n << 8) + (unsigned)getc(fd); + n = (n << 8) + (unsigned)getc(fd); + return (int)n; +} + +/// Read 8 bytes from `fd` and turn them into a time_t, MSB first. +time_t get8ctime(FILE *fd) +{ + time_t n = 0; + int i; + + for (i = 0; i < 8; i++) { + n = (n << 8) + getc(fd); + } + return n; +} + +/// Reads a string of length "cnt" from "fd" into allocated memory. +/// @return pointer to the string or NULL when unable to read that many bytes. +char *read_string(FILE *fd, size_t cnt) +{ + char *str = xmallocz(cnt); + for (size_t i = 0; i < cnt; i++) { + int c = getc(fd); + if (c == EOF) { + xfree(str); + return NULL; + } + str[i] = (char)c; + } + return str; +} + +/// Writes a number to file "fd", most significant bit first, in "len" bytes. +/// @returns false in case of an error. +bool put_bytes(FILE *fd, uintmax_t number, size_t len) +{ + assert(len > 0); + for (size_t i = len - 1; i < len; i--) { + if (putc((int)(number >> (i * 8)), fd) == EOF) { + return false; + } + } + return true; +} + +/// Writes time_t to file "fd" in 8 bytes. +/// @returns FAIL when the write failed. +int put_time(FILE *fd, time_t time_) +{ + uint8_t buf[8]; + time_to_bytes(time_, buf); + return fwrite(buf, sizeof(uint8_t), ARRAY_SIZE(buf), fd) == 1 ? OK : FAIL; +} + +/// os_rename() only works if both files are on the same file system, this +/// function will (attempts to?) copy the file across if rename fails -- webb +// +/// @return -1 for failure, 0 for success int vim_rename(char_u *from, char_u *to) { int fd_in; @@ -6072,13 +6143,18 @@ static int do_autocmd_event(event_T event, char_u *pat, int nested, char_u *cmd, int do_doautocmd ( char_u *arg, - int do_msg /* give message for no matching autocmds? */ + int do_msg, // give message for no matching autocmds? + bool *did_something ) { char_u *fname; int nothing_done = TRUE; int group; + if (did_something != NULL) { + *did_something = false; + } + /* * Check for a legal group name. If not, use AUGROUP_ALL. */ @@ -6107,8 +6183,12 @@ do_doautocmd ( fname, NULL, TRUE, group, curbuf, NULL)) nothing_done = FALSE; - if (nothing_done && do_msg) + if (nothing_done && do_msg) { MSG(_("No matching autocommands")); + } + if (did_something != NULL) { + *did_something = !nothing_done; + } return aborting() ? FAIL : OK; } @@ -6137,13 +6217,14 @@ void ex_doautoall(exarg_T *eap) /* find a window for this buffer and save some values */ aucmd_prepbuf(&aco, buf); - /* execute the autocommands for this buffer */ - retval = do_doautocmd(arg, FALSE); + bool did_aucmd; + // execute the autocommands for this buffer + retval = do_doautocmd(arg, false, &did_aucmd); - if (call_do_modelines) { - /* Execute the modeline settings, but don't set window-local - * options if we are using the current window for another - * buffer. */ + if (call_do_modelines && did_aucmd) { + // Execute the modeline settings, but don't set window-local + // options if we are using the current window for another + // buffer. do_modelines(curwin == aucmd_win ? OPT_NOWIN : 0); } diff --git a/src/nvim/fileio.h b/src/nvim/fileio.h index d93f3f3eb3..ceb101167d 100644 --- a/src/nvim/fileio.h +++ b/src/nvim/fileio.h @@ -12,6 +12,8 @@ #define READ_DUMMY 0x10 /* reading into a dummy buffer */ #define READ_KEEP_UNDO 0x20 /* keep undo info*/ +#define READ_STRING(x, y) (char_u *)read_string((x), (size_t)(y)) + /* * Struct to save values in before executing autocommands for a buffer that is * not the current buffer. diff --git a/src/nvim/fold.c b/src/nvim/fold.c index ac3cf959c8..70030b8525 100644 --- a/src/nvim/fold.c +++ b/src/nvim/fold.c @@ -22,7 +22,6 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" #include "nvim/garray.h" #include "nvim/move.h" #include "nvim/option.h" @@ -762,16 +761,12 @@ void clearFolding(win_T *win) */ void foldUpdate(win_T *wp, linenr_T top, linenr_T bot) { - if (compl_busy) { - return; - } - - fold_T *fp; - if (wp->w_buffer->terminal) { + if (compl_busy || State & INSERT) { return; } // Mark all folds from top to bot as maybe-small. + fold_T *fp; (void)foldFind(&wp->w_folds, top, &fp); while (fp < (fold_T *)wp->w_folds.ga_data + wp->w_folds.ga_len && fp->fd_top < bot) { diff --git a/src/nvim/func_attr.h b/src/nvim/func_attr.h index ea017ab0c8..d98fe5b22b 100644 --- a/src/nvim/func_attr.h +++ b/src/nvim/func_attr.h @@ -185,6 +185,7 @@ #ifdef DEFINE_FUNC_ATTRIBUTES # define FUNC_API_ASYNC # define FUNC_API_NOEXPORT +# define FUNC_API_NOEVAL # define FUNC_ATTR_MALLOC REAL_FATTR_MALLOC # define FUNC_ATTR_ALLOC_SIZE(x) REAL_FATTR_ALLOC_SIZE(x) # define FUNC_ATTR_ALLOC_SIZE_PROD(x, y) REAL_FATTR_ALLOC_SIZE_PROD(x, y) diff --git a/src/nvim/garray.c b/src/nvim/garray.c index 98cec69b54..9ed3b901ef 100644 --- a/src/nvim/garray.c +++ b/src/nvim/garray.c @@ -8,7 +8,6 @@ #include "nvim/vim.h" #include "nvim/ascii.h" #include "nvim/log.h" -#include "nvim/misc2.h" #include "nvim/memory.h" #include "nvim/path.h" #include "nvim/garray.h" diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index ae1857f318..dad0ac33cd 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -29,7 +29,6 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" #include "nvim/keymap.h" #include "nvim/garray.h" #include "nvim/move.h" @@ -38,6 +37,7 @@ #include "nvim/option.h" #include "nvim/regexp.h" #include "nvim/screen.h" +#include "nvim/state.h" #include "nvim/strings.h" #include "nvim/ui.h" #include "nvim/undo.h" diff --git a/src/nvim/globals.h b/src/nvim/globals.h index 950ceb4c74..57d12d396e 100644 --- a/src/nvim/globals.h +++ b/src/nvim/globals.h @@ -442,59 +442,60 @@ EXTERN int no_check_timestamps INIT(= 0); /* Don't check timestamps */ typedef enum { HLF_8 = 0 /* Meta & special keys listed with ":map", text that is displayed different from what it is */ - , HLF_EOB //< after the last line in the buffer - , HLF_TERM //< terminal cursor focused - , HLF_TERMNC //< terminal cursor unfocused - , HLF_AT /* @ characters at end of screen, characters that - don't really exist in the text */ - , HLF_D /* directories in CTRL-D listing */ - , HLF_E /* error messages */ - , HLF_I /* incremental search */ - , HLF_L /* last search string */ - , HLF_M /* "--More--" message */ - , HLF_CM /* Mode (e.g., "-- INSERT --") */ - , HLF_N /* line number for ":number" and ":#" commands */ - , HLF_CLN /* current line number */ - , HLF_R /* return to continue message and yes/no questions */ - , HLF_S /* status lines */ - , HLF_SNC /* status lines of not-current windows */ - , HLF_C /* column to separate vertically split windows */ - , HLF_T /* Titles for output from ":set all", ":autocmd" etc. */ - , HLF_V /* Visual mode */ - , HLF_VNC /* Visual mode, autoselecting and not clipboard owner */ - , HLF_W /* warning messages */ - , HLF_WM /* Wildmenu highlight */ - , HLF_FL /* Folded line */ - , HLF_FC /* Fold column */ - , HLF_ADD /* Added diff line */ - , HLF_CHD /* Changed diff line */ - , HLF_DED /* Deleted diff line */ - , HLF_TXD /* Text Changed in diff line */ - , HLF_CONCEAL /* Concealed text */ - , HLF_SC /* Sign column */ - , HLF_SPB /* SpellBad */ - , HLF_SPC /* SpellCap */ - , HLF_SPR /* SpellRare */ - , HLF_SPL /* SpellLocal */ - , HLF_PNI /* popup menu normal item */ - , HLF_PSI /* popup menu selected item */ - , HLF_PSB /* popup menu scrollbar */ - , HLF_PST /* popup menu scrollbar thumb */ - , HLF_TP /* tabpage line */ - , HLF_TPS /* tabpage line selected */ - , HLF_TPF /* tabpage line filler */ - , HLF_CUC /* 'cursurcolumn' */ - , HLF_CUL /* 'cursurline' */ - , HLF_MC /* 'colorcolumn' */ - , HLF_COUNT /* MUST be the last one */ + , HLF_EOB // after the last line in the buffer + , HLF_TERM // terminal cursor focused + , HLF_TERMNC // terminal cursor unfocused + , HLF_AT // @ characters at end of screen, characters that + // don't really exist in the text + , HLF_D // directories in CTRL-D listing + , HLF_E // error messages + , HLF_I // incremental search + , HLF_L // last search string + , HLF_M // "--More--" message + , HLF_CM // Mode (e.g., "-- INSERT --") + , HLF_N // line number for ":number" and ":#" commands + , HLF_CLN // current line number + , HLF_R // return to continue message and yes/no questions + , HLF_S // status lines + , HLF_SNC // status lines of not-current windows + , HLF_C // column to separate vertically split windows + , HLF_T // Titles for output from ":set all", ":autocmd" etc. + , HLF_V // Visual mode + , HLF_VNC // Visual mode, autoselecting and not clipboard owner + , HLF_W // warning messages + , HLF_WM // Wildmenu highlight + , HLF_FL // Folded line + , HLF_FC // Fold column + , HLF_ADD // Added diff line + , HLF_CHD // Changed diff line + , HLF_DED // Deleted diff line + , HLF_TXD // Text Changed in diff line + , HLF_CONCEAL // Concealed text + , HLF_SC // Sign column + , HLF_SPB // SpellBad + , HLF_SPC // SpellCap + , HLF_SPR // SpellRare + , HLF_SPL // SpellLocal + , HLF_PNI // popup menu normal item + , HLF_PSI // popup menu selected item + , HLF_PSB // popup menu scrollbar + , HLF_PST // popup menu scrollbar thumb + , HLF_TP // tabpage line + , HLF_TPS // tabpage line selected + , HLF_TPF // tabpage line filler + , HLF_CUC // 'cursurcolumn' + , HLF_CUL // 'cursurline' + , HLF_MC // 'colorcolumn' + , HLF_QFL // selected quickfix line + , HLF_COUNT // MUST be the last one } hlf_T; /* The HL_FLAGS must be in the same order as the HLF_ enums! * When changing this also adjust the default for 'highlight'. */ -#define HL_FLAGS {'8', '~', 'z', 'Z', '@', 'd', 'e', 'i', 'l', 'm', 'M', 'n', \ - 'N', 'r', 's', 'S', 'c', 't', 'v', 'V', 'w', 'W', 'f', 'F', \ - 'A', 'C', 'D', 'T', '-', '>', 'B', 'P', 'R', 'L', '+', '=', \ - 'x', 'X', '*', '#', '_', '!', '.', 'o'} +#define HL_FLAGS { '8', '~', 'z', 'Z', '@', 'd', 'e', 'i', 'l', 'm', 'M', 'n', \ + 'N', 'r', 's', 'S', 'c', 't', 'v', 'V', 'w', 'W', 'f', 'F', \ + 'A', 'C', 'D', 'T', '-', '>', 'B', 'P', 'R', 'L', '+', '=', \ + 'x', 'X', '*', '#', '_', '!', '.', 'o', 'q' } EXTERN int highlight_attr[HLF_COUNT]; /* Highl. attr for each context. */ EXTERN int highlight_user[9]; /* User[1-9] attributes */ @@ -1244,6 +1245,9 @@ EXTERN char *ignoredp; // If a msgpack-rpc channel should be started over stdin/stdout EXTERN bool embedded_mode INIT(= false); +/// next free id for a job or rpc channel +EXTERN uint64_t next_chan_id INIT(= 1); + /// Used to track the status of external functions. /// Currently only used for iconv(). typedef enum { diff --git a/src/nvim/hardcopy.c b/src/nvim/hardcopy.c index 1c9b8e18ef..7d4bfd0290 100644 --- a/src/nvim/hardcopy.c +++ b/src/nvim/hardcopy.c @@ -23,7 +23,6 @@ #include "nvim/memline.h" #include "nvim/memory.h" #include "nvim/message.h" -#include "nvim/misc2.h" #include "nvim/garray.h" #include "nvim/option.h" #include "nvim/path.h" diff --git a/src/nvim/hashtab.c b/src/nvim/hashtab.c index 2da937633e..7d4ae61fc4 100644 --- a/src/nvim/hashtab.c +++ b/src/nvim/hashtab.c @@ -28,7 +28,6 @@ #include "nvim/hashtab.h" #include "nvim/message.h" #include "nvim/memory.h" -#include "nvim/misc2.h" // Magic value for algorithm that walks through the array. #define PERTURB_SHIFT 5 diff --git a/src/nvim/iconv.h b/src/nvim/iconv.h index 4ac0d3fdd4..bf29b15247 100644 --- a/src/nvim/iconv.h +++ b/src/nvim/iconv.h @@ -24,10 +24,10 @@ // defined, we provide a type shim (pull in errno.h and define iconv_t). // This enables us to still load and use iconv dynamically at runtime. #ifdef USE_ICONV +# include <errno.h> # ifdef HAVE_ICONV_H # include <iconv.h> # else -# include <errno.h> typedef void *iconv_t; # endif #endif diff --git a/src/nvim/if_cscope.c b/src/nvim/if_cscope.c index f2432dd71d..3ed85677fc 100644 --- a/src/nvim/if_cscope.c +++ b/src/nvim/if_cscope.c @@ -20,7 +20,6 @@ #include "nvim/eval.h" #include "nvim/fileio.h" #include "nvim/message.h" -#include "nvim/misc2.h" #include "nvim/memory.h" #include "nvim/os/time.h" #include "nvim/path.h" @@ -52,7 +51,7 @@ static cscmd_T cs_cmds[] = { "add", cs_add, N_("Add a new database"), "add file|dir [pre-path] [flags]", 0 }, { "find", cs_find, - N_("Query for a pattern"), "find c|d|e|f|g|i|s|t name", 1 }, + N_("Query for a pattern"), "find a|c|d|e|f|g|i|s|t name", 1 }, { "help", cs_help, N_("Show this message"), "help", 0 }, { "kill", cs_kill, @@ -105,13 +104,13 @@ char_u *get_cscope_name(expand_T *xp, int idx) { const char *query_type[] = { - "c", "d", "e", "f", "g", "i", "s", "t", NULL + "a", "c", "d", "e", "f", "g", "i", "s", "t", NULL }; - /* Complete with query type of ":cscope find {query_type}". - * {query_type} can be letters (c, d, ... t) or numbers (0, 1, - * ..., 8) but only complete with letters, since numbers are - * redundant. */ + // Complete with query type of ":cscope find {query_type}". + // {query_type} can be letters (c, d, ... a) or numbers (0, 1, + // ..., 9) but only complete with letters, since numbers are + // redundant. return (char_u *)query_type[idx]; } case EXP_CSCOPE_KILL: @@ -674,6 +673,9 @@ static char *cs_create_cmd(char *csoption, char *pattern) case '8': case 'i': search = 8; break; + case '9': case 'a': + search = 9; + break; default: (void)EMSG(_("E561: unknown cscope search type")); cs_usage_msg(Find); @@ -970,6 +972,9 @@ static int cs_find_common(char *opt, char *pat, int forceit, int verbose, case '8': cmdletter = 'i'; break; + case '9': + cmdletter = 'a'; + break; default: cmdletter = opt[0]; } @@ -1126,14 +1131,15 @@ static int cs_help(exarg_T *eap) cmdp->usage); if (strcmp(cmdp->name, "find") == 0) MSG_PUTS(_("\n" - " c: Find functions calling this function\n" - " d: Find functions called by this function\n" - " e: Find this egrep pattern\n" - " f: Find this file\n" - " g: Find this definition\n" - " i: Find files #including this file\n" - " s: Find this C symbol\n" - " t: Find this text string\n")); + " a: Find assignments to this symbol\n" + " c: Find functions calling this function\n" + " d: Find functions called by this function\n" + " e: Find this egrep pattern\n" + " f: Find this file\n" + " g: Find this definition\n" + " i: Find files #including this file\n" + " s: Find this C symbol\n" + " t: Find this text string\n")); cmdp++; } diff --git a/src/nvim/if_cscope_defs.h b/src/nvim/if_cscope_defs.h index 8cd74c74e6..f9d06eaea3 100644 --- a/src/nvim/if_cscope_defs.h +++ b/src/nvim/if_cscope_defs.h @@ -25,18 +25,7 @@ #define CSCOPE_DBFILE "cscope.out" #define CSCOPE_PROMPT ">> " -/* - * s 0name Find this C symbol - * g 1name Find this definition - * d 2name Find functions called by this function - * c 3name Find functions calling this function - * t 4string find text string (cscope 12.9) - * t 4name Find assignments to (cscope 13.3) - * 5pattern change pattern -- NOT USED - * e 6pattern Find this egrep pattern - * f 7name Find this file - * i 8name Find files #including this file - */ +// See ":help cscope-find" for the possible queries. typedef struct { char * name; diff --git a/src/nvim/indent.c b/src/nvim/indent.c index f197669a97..7f31bb8c5c 100644 --- a/src/nvim/indent.c +++ b/src/nvim/indent.c @@ -10,7 +10,6 @@ #include "nvim/memline.h" #include "nvim/memory.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" #include "nvim/move.h" #include "nvim/option.h" #include "nvim/regexp.h" diff --git a/src/nvim/indent_c.c b/src/nvim/indent_c.c index efe8e73a3c..6f03cf6037 100644 --- a/src/nvim/indent_c.c +++ b/src/nvim/indent_c.c @@ -12,7 +12,6 @@ #include "nvim/indent_c.h" #include "nvim/memline.h" #include "nvim/memory.h" -#include "nvim/misc2.h" #include "nvim/option.h" #include "nvim/search.h" #include "nvim/strings.h" diff --git a/src/nvim/main.c b/src/nvim/main.c index e052d0d315..a153931d8a 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -30,7 +30,6 @@ #include "nvim/memline.h" #include "nvim/message.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" #include "nvim/garray.h" #include "nvim/log.h" #include "nvim/memory.h" @@ -58,13 +57,13 @@ #include "nvim/event/loop.h" #include "nvim/os/signal.h" #include "nvim/event/process.h" -#include "nvim/msgpack_rpc/defs.h" #include "nvim/msgpack_rpc/helpers.h" #include "nvim/msgpack_rpc/server.h" #include "nvim/msgpack_rpc/channel.h" #include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" #include "nvim/api/private/handle.h" +#include "nvim/api/private/dispatch.h" /* Maximum number of commands from + or -c arguments. */ #define MAX_ARG_CMDS 10 @@ -251,8 +250,9 @@ int main(int argc, char **argv) */ command_line_scan(¶ms); - if (GARGCOUNT > 0) - fname = get_fname(¶ms); + if (GARGCOUNT > 0) { + fname = get_fname(¶ms, cwd); + } TIME_MSG("expanding arguments"); @@ -1196,7 +1196,7 @@ static void check_and_set_isatty(mparm_T *paramp) /* * Get filename from command line, given that there is one. */ -static char_u *get_fname(mparm_T *parmp) +static char_u *get_fname(mparm_T *parmp, char_u *cwd) { #if !defined(UNIX) /* diff --git a/src/nvim/map.c b/src/nvim/map.c index 398e74268f..73af487f90 100644 --- a/src/nvim/map.c +++ b/src/nvim/map.c @@ -6,7 +6,7 @@ #include "nvim/map_defs.h" #include "nvim/vim.h" #include "nvim/memory.h" -#include "nvim/msgpack_rpc/defs.h" +#include "nvim/api/private/dispatch.h" #include "nvim/lib/khash.h" @@ -20,6 +20,8 @@ #define int_eq kh_int_hash_equal #define linenr_T_hash kh_int_hash_func #define linenr_T_eq kh_int_hash_equal +#define handle_T_hash kh_int_hash_func +#define handle_T_eq kh_int_hash_equal #if defined(ARCH_64) @@ -141,7 +143,8 @@ MAP_IMPL(cstr_t, uint64_t, DEFAULT_INITIALIZER) MAP_IMPL(cstr_t, ptr_t, DEFAULT_INITIALIZER) MAP_IMPL(ptr_t, ptr_t, DEFAULT_INITIALIZER) MAP_IMPL(uint64_t, ptr_t, DEFAULT_INITIALIZER) -#define MSGPACK_HANDLER_INITIALIZER {.fn = NULL, .async = false} +MAP_IMPL(handle_T, ptr_t, DEFAULT_INITIALIZER) +#define MSGPACK_HANDLER_INITIALIZER { .fn = NULL, .async = false } MAP_IMPL(String, MsgpackRpcRequestHandler, MSGPACK_HANDLER_INITIALIZER) #define KVEC_INITIALIZER { .size = 0, .capacity = 0, .items = NULL } MAP_IMPL(linenr_T, bufhl_vec_T, KVEC_INITIALIZER) diff --git a/src/nvim/map.h b/src/nvim/map.h index c7d9894bd1..ba3e84cb31 100644 --- a/src/nvim/map.h +++ b/src/nvim/map.h @@ -5,7 +5,7 @@ #include "nvim/map_defs.h" #include "nvim/api/private/defs.h" -#include "nvim/msgpack_rpc/defs.h" +#include "nvim/api/private/dispatch.h" #include "nvim/bufhl_defs.h" #define MAP_DECLS(T, U) \ @@ -29,6 +29,7 @@ MAP_DECLS(cstr_t, uint64_t) MAP_DECLS(cstr_t, ptr_t) MAP_DECLS(ptr_t, ptr_t) MAP_DECLS(uint64_t, ptr_t) +MAP_DECLS(handle_T, ptr_t) MAP_DECLS(String, MsgpackRpcRequestHandler) MAP_DECLS(linenr_T, bufhl_vec_T) diff --git a/src/nvim/mark.c b/src/nvim/mark.c index fe802e48ba..2a65cf396b 100644 --- a/src/nvim/mark.c +++ b/src/nvim/mark.c @@ -21,7 +21,6 @@ #include "nvim/memline.h" #include "nvim/memory.h" #include "nvim/message.h" -#include "nvim/misc2.h" #include "nvim/normal.h" #include "nvim/option.h" #include "nvim/path.h" diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c index 26d94aa6fa..f577fd847e 100644 --- a/src/nvim/mbyte.c +++ b/src/nvim/mbyte.c @@ -84,7 +84,6 @@ #include "nvim/memline.h" #include "nvim/message.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" #include "nvim/memory.h" #include "nvim/option.h" #include "nvim/screen.h" diff --git a/src/nvim/memfile.c b/src/nvim/memfile.c index 9fb03c4ac7..43412e3916 100644 --- a/src/nvim/memfile.c +++ b/src/nvim/memfile.c @@ -48,7 +48,6 @@ #include "nvim/fileio.h" #include "nvim/memline.h" #include "nvim/message.h" -#include "nvim/misc2.h" #include "nvim/memory.h" #include "nvim/os_unix.h" #include "nvim/path.h" diff --git a/src/nvim/memline.c b/src/nvim/memline.c index 08e82071d7..5505335769 100644 --- a/src/nvim/memline.c +++ b/src/nvim/memline.c @@ -55,7 +55,6 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" #include "nvim/option.h" #include "nvim/os_unix.h" #include "nvim/path.h" @@ -3964,20 +3963,19 @@ long ml_find_line_or_offset(buf_T *buf, linenr_T lnum, long *offp) return size; } -/* - * Goto byte in buffer with offset 'cnt'. - */ +/// Goto byte in buffer with offset 'cnt'. void goto_byte(long cnt) { long boff = cnt; linenr_T lnum; - ml_flush_line(curbuf); /* cached line may be dirty */ + ml_flush_line(curbuf); // cached line may be dirty setpcmark(); - if (boff) - --boff; + if (boff) { + boff--; + } lnum = ml_find_line_or_offset(curbuf, (linenr_T)0, &boff); - if (lnum < 1) { /* past the end */ + if (lnum < 1) { // past the end curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count; curwin->w_curswant = MAXCOL; coladvance((colnr_T)MAXCOL); @@ -3989,7 +3987,84 @@ void goto_byte(long cnt) } check_cursor(); - /* Make sure the cursor is on the first byte of a multi-byte char. */ - if (has_mbyte) + // Make sure the cursor is on the first byte of a multi-byte char. + if (has_mbyte) { mb_adjust_cursor(); + } +} + +/// Increment the line pointer "lp" crossing line boundaries as necessary. +/// Return 1 when going to the next line. +/// Return 2 when moving forward onto a NUL at the end of the line). +/// Return -1 when at the end of file. +/// Return 0 otherwise. +int inc(pos_T *lp) +{ + char_u *p = ml_get_pos(lp); + + if (*p != NUL) { // still within line, move to next char (may be NUL) + if (has_mbyte) { + int l = (*mb_ptr2len)(p); + + lp->col += l; + return (p[l] != NUL) ? 0 : 2; + } + lp->col++; + lp->coladd = 0; + return (p[1] != NUL) ? 0 : 2; + } + if (lp->lnum != curbuf->b_ml.ml_line_count) { // there is a next line + lp->col = 0; + lp->lnum++; + lp->coladd = 0; + return 1; + } + return -1; +} + +/// Same as inc(), but skip NUL at the end of non-empty lines. +int incl(pos_T *lp) +{ + int r; + + if ((r = inc(lp)) >= 1 && lp->col) { + r = inc(lp); + } + return r; +} + +int dec(pos_T *lp) +{ + char_u *p; + + lp->coladd = 0; + if (lp->col > 0) { // still within line + lp->col--; + if (has_mbyte) { + p = ml_get(lp->lnum); + lp->col -= (*mb_head_off)(p, p + lp->col); + } + return 0; + } + if (lp->lnum > 1) { // there is a prior line + lp->lnum--; + p = ml_get(lp->lnum); + lp->col = (colnr_T)STRLEN(p); + if (has_mbyte) { + lp->col -= (*mb_head_off)(p, p + lp->col); + } + return 1; + } + return -1; // at start of file +} + +/// Same as dec(), but skip NUL at the end of non-empty lines. +int decl(pos_T *lp) +{ + int r; + + if ((r = dec(lp)) == 1 && lp->col) { + r = dec(lp); + } + return r; } diff --git a/src/nvim/memory.c b/src/nvim/memory.c index 8db47b79c1..3e041be4d3 100644 --- a/src/nvim/memory.c +++ b/src/nvim/memory.c @@ -440,6 +440,16 @@ void do_outofmem_msg(size_t size) } } +/// Writes time_t to "buf[8]". +void time_to_bytes(time_t time_, uint8_t buf[8]) +{ + // time_t can be up to 8 bytes in size, more than uintmax_t in 32 bits + // systems, thus we can't use put_bytes() here. + for (size_t i = 7, bufi = 0; bufi < 8; i--, bufi++) { + buf[bufi] = (uint8_t)((uint64_t)time_ >> (i * 8)); + } +} + #if defined(EXITFREE) #include "nvim/file_search.h" diff --git a/src/nvim/memory.h b/src/nvim/memory.h index 7b477da2f5..62cc78360c 100644 --- a/src/nvim/memory.h +++ b/src/nvim/memory.h @@ -3,6 +3,7 @@ #include <stdint.h> // for uint8_t #include <stddef.h> // for size_t +#include <time.h> // for time_t #ifdef INCLUDE_GENERATED_DECLARATIONS # include "memory.h.generated.h" diff --git a/src/nvim/menu.c b/src/nvim/menu.c index 3c2394d579..7c0eee64dd 100644 --- a/src/nvim/menu.c +++ b/src/nvim/menu.c @@ -18,9 +18,9 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" #include "nvim/keymap.h" #include "nvim/garray.h" +#include "nvim/state.h" #include "nvim/strings.h" #include "nvim/ui.h" diff --git a/src/nvim/message.c b/src/nvim/message.c index 3c310ed309..1de2347b12 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -22,7 +22,6 @@ #include "nvim/mbyte.h" #include "nvim/memory.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" #include "nvim/keymap.h" #include "nvim/garray.h" #include "nvim/ops.h" @@ -702,16 +701,9 @@ int delete_first_msg(void) void ex_messages(exarg_T *eap) { struct msg_hist *p; - const char *s; msg_hist_off = TRUE; - s = os_getenv("LANG"); - if (s) - msg_attr((char_u *) - _("Messages maintainer: Bram Moolenaar <Bram@vim.org>"), - hl_attr(HLF_T)); - for (p = first_msg_hist; p != NULL && !got_int; p = p->next) if (p->msg != NULL) msg_attr(p->msg, p->attr); diff --git a/src/nvim/misc1.c b/src/nvim/misc1.c index d72d8e8513..4ab059c923 100644 --- a/src/nvim/misc1.c +++ b/src/nvim/misc1.c @@ -31,7 +31,6 @@ #include "nvim/memline.h" #include "nvim/memory.h" #include "nvim/message.h" -#include "nvim/misc2.h" #include "nvim/garray.h" #include "nvim/move.h" #include "nvim/mouse.h" @@ -41,6 +40,7 @@ #include "nvim/regexp.h" #include "nvim/screen.h" #include "nvim/search.h" +#include "nvim/state.h" #include "nvim/strings.h" #include "nvim/tag.h" #include "nvim/ui.h" @@ -742,10 +742,14 @@ open_line ( if (ml_append(curwin->w_cursor.lnum, p_extra, (colnr_T)0, FALSE) == FAIL) goto theend; - /* Postpone calling changed_lines(), because it would mess up folding - * with markers. */ - mark_adjust(curwin->w_cursor.lnum + 1, (linenr_T)MAXLNUM, 1L, 0L); - did_append = TRUE; + // Postpone calling changed_lines(), because it would mess up folding + // with markers. + // Skip mark_adjust when adding a line after the last one, there can't + // be marks there. + if (curwin->w_cursor.lnum + 1 < curbuf->b_ml.ml_line_count) { + mark_adjust(curwin->w_cursor.lnum + 1, (linenr_T)MAXLNUM, 1L, 0L); + } + did_append = true; } else { /* * In VREPLACE mode we are starting to replace the next line. @@ -1742,18 +1746,6 @@ int gchar_pos(pos_T *pos) } /* - * Skip to next part of an option argument: Skip space and comma. - */ -char_u *skip_to_option_part(char_u *p) -{ - if (*p == ',') - ++p; - while (*p == ' ') - ++p; - return p; -} - -/* * Call this function when something in the current buffer is changed. * * Most often called through changed_bytes() and changed_lines(), which also @@ -1871,7 +1863,11 @@ void appended_lines(linenr_T lnum, long count) */ void appended_lines_mark(linenr_T lnum, long count) { - mark_adjust(lnum + 1, (linenr_T)MAXLNUM, count, 0L); + // Skip mark_adjust when adding a line after the last one, there can't + // be marks there. + if (lnum + count < curbuf->b_ml.ml_line_count) { + mark_adjust(lnum + 1, (linenr_T)MAXLNUM, count, 0L); + } changed_lines(lnum + 1, 0, lnum + 1, count); } @@ -2683,6 +2679,42 @@ void fast_breakcheck(void) } } +// Call shell. Calls os_call_shell, with 'shellxquote' added. +int call_shell(char_u *cmd, ShellOpts opts, char_u *extra_shell_arg) +{ + int retval; + proftime_T wait_time; + + if (p_verbose > 3) { + verbose_enter(); + smsg(_("Calling shell to execute: \"%s\""), + cmd == NULL ? p_sh : cmd); + ui_putc('\n'); + verbose_leave(); + } + + if (do_profiling == PROF_YES) { + prof_child_enter(&wait_time); + } + + if (*p_sh == NUL) { + EMSG(_(e_shellempty)); + retval = -1; + } else { + // The external command may update a tags file, clear cached tags. + tag_freematch(); + + retval = os_call_shell(cmd, opts, extra_shell_arg); + } + + set_vim_var_nr(VV_SHELL_ERROR, (varnumber_T)retval); + if (do_profiling == PROF_YES) { + prof_child_exit(&wait_time); + } + + return retval; +} + /// Get the stdout of an external command. /// If "ret_len" is NULL replace NUL characters with NL. When "ret_len" is not /// NULL store the length there. diff --git a/src/nvim/misc2.c b/src/nvim/misc2.c deleted file mode 100644 index 368f83cfb5..0000000000 --- a/src/nvim/misc2.c +++ /dev/null @@ -1,486 +0,0 @@ -/* - * misc2.c: Various functions. - */ -#include <assert.h> -#include <inttypes.h> -#include <string.h> - -#include "nvim/vim.h" -#include "nvim/ascii.h" -#include "nvim/misc2.h" -#include "nvim/file_search.h" -#include "nvim/buffer.h" -#include "nvim/charset.h" -#include "nvim/cursor.h" -#include "nvim/diff.h" -#include "nvim/edit.h" -#include "nvim/eval.h" -#include "nvim/ex_cmds.h" -#include "nvim/ex_docmd.h" -#include "nvim/ex_getln.h" -#include "nvim/fileio.h" -#include "nvim/fold.h" -#include "nvim/getchar.h" -#include "nvim/macros.h" -#include "nvim/mark.h" -#include "nvim/mbyte.h" -#include "nvim/memfile.h" -#include "nvim/memline.h" -#include "nvim/memory.h" -#include "nvim/message.h" -#include "nvim/misc1.h" -#include "nvim/move.h" -#include "nvim/option.h" -#include "nvim/ops.h" -#include "nvim/os_unix.h" -#include "nvim/path.h" -#include "nvim/quickfix.h" -#include "nvim/regexp.h" -#include "nvim/screen.h" -#include "nvim/search.h" -#include "nvim/spell.h" -#include "nvim/strings.h" -#include "nvim/syntax.h" -#include "nvim/tag.h" -#include "nvim/ui.h" -#include "nvim/window.h" -#include "nvim/os/os.h" -#include "nvim/os/shell.h" - - -#ifdef INCLUDE_GENERATED_DECLARATIONS -# include "misc2.c.generated.h" -#endif -/* - * Return TRUE if in the current mode we need to use virtual. - */ -int virtual_active(void) -{ - /* While an operator is being executed we return "virtual_op", because - * VIsual_active has already been reset, thus we can't check for "block" - * being used. */ - if (virtual_op != MAYBE) - return virtual_op; - return ve_flags == VE_ALL - || ((ve_flags & VE_BLOCK) && VIsual_active && VIsual_mode == Ctrl_V) - || ((ve_flags & VE_INSERT) && (State & INSERT)); -} - -/* - * Increment the line pointer "lp" crossing line boundaries as necessary. - * Return 1 when going to the next line. - * Return 2 when moving forward onto a NUL at the end of the line). - * Return -1 when at the end of file. - * Return 0 otherwise. - */ -int inc(pos_T *lp) -{ - char_u *p = ml_get_pos(lp); - - if (*p != NUL) { /* still within line, move to next char (may be NUL) */ - if (has_mbyte) { - int l = (*mb_ptr2len)(p); - - lp->col += l; - return (p[l] != NUL) ? 0 : 2; - } - lp->col++; - lp->coladd = 0; - return (p[1] != NUL) ? 0 : 2; - } - if (lp->lnum != curbuf->b_ml.ml_line_count) { /* there is a next line */ - lp->col = 0; - lp->lnum++; - lp->coladd = 0; - return 1; - } - return -1; -} - -/* - * incl(lp): same as inc(), but skip the NUL at the end of non-empty lines - */ -int incl(pos_T *lp) -{ - int r; - - if ((r = inc(lp)) >= 1 && lp->col) - r = inc(lp); - return r; -} - -int dec(pos_T *lp) -{ - char_u *p; - - lp->coladd = 0; - if (lp->col > 0) { /* still within line */ - lp->col--; - if (has_mbyte) { - p = ml_get(lp->lnum); - lp->col -= (*mb_head_off)(p, p + lp->col); - } - return 0; - } - if (lp->lnum > 1) { /* there is a prior line */ - lp->lnum--; - p = ml_get(lp->lnum); - lp->col = (colnr_T)STRLEN(p); - if (has_mbyte) - lp->col -= (*mb_head_off)(p, p + lp->col); - return 1; - } - return -1; /* at start of file */ -} - -/* - * decl(lp): same as dec(), but skip the NUL at the end of non-empty lines - */ -int decl(pos_T *lp) -{ - int r; - - if ((r = dec(lp)) == 1 && lp->col) - r = dec(lp); - return r; -} - -/* - * Return TRUE when 'shell' has "csh" in the tail. - */ -int csh_like_shell(void) -{ - return strstr((char *)path_tail(p_sh), "csh") != NULL; -} - -/* - * Isolate one part of a string option where parts are separated with - * "sep_chars". - * The part is copied into "buf[maxlen]". - * "*option" is advanced to the next part. - * The length is returned. - */ -size_t copy_option_part(char_u **option, char_u *buf, size_t maxlen, char *sep_chars) -{ - size_t len = 0; - char_u *p = *option; - - /* skip '.' at start of option part, for 'suffixes' */ - if (*p == '.') - buf[len++] = *p++; - while (*p != NUL && vim_strchr((char_u *)sep_chars, *p) == NULL) { - /* - * Skip backslash before a separator character and space. - */ - if (p[0] == '\\' && vim_strchr((char_u *)sep_chars, p[1]) != NULL) - ++p; - if (len < maxlen - 1) - buf[len++] = *p; - ++p; - } - buf[len] = NUL; - - if (*p != NUL && *p != ',') /* skip non-standard separator */ - ++p; - p = skip_to_option_part(p); /* p points to next file name */ - - *option = p; - return len; -} - -/* - * Return the current end-of-line type: EOL_DOS, EOL_UNIX or EOL_MAC. - */ -int get_fileformat(buf_T *buf) -{ - int c = *buf->b_p_ff; - - if (buf->b_p_bin || c == 'u') - return EOL_UNIX; - if (c == 'm') - return EOL_MAC; - return EOL_DOS; -} - -/* - * Like get_fileformat(), but override 'fileformat' with "p" for "++opt=val" - * argument. - */ -int -get_fileformat_force ( - buf_T *buf, - exarg_T *eap /* can be NULL! */ -) -{ - int c; - - if (eap != NULL && eap->force_ff != 0) - c = eap->cmd[eap->force_ff]; - else { - if ((eap != NULL && eap->force_bin != 0) - ? (eap->force_bin == FORCE_BIN) : buf->b_p_bin) - return EOL_UNIX; - c = *buf->b_p_ff; - } - if (c == 'u') - return EOL_UNIX; - if (c == 'm') - return EOL_MAC; - return EOL_DOS; -} - -/// Set the current end-of-line type to EOL_UNIX, EOL_MAC, or EOL_DOS. -/// -/// Sets 'fileformat'. -/// -/// @param eol_style End-of-line style. -/// @param opt_flags OPT_LOCAL and/or OPT_GLOBAL -void set_fileformat(int eol_style, int opt_flags) -{ - char *p = NULL; - - switch (eol_style) { - case EOL_UNIX: - p = FF_UNIX; - break; - case EOL_MAC: - p = FF_MAC; - break; - case EOL_DOS: - p = FF_DOS; - break; - } - - // p is NULL if "eol_style" is EOL_UNKNOWN. - if (p != NULL) { - set_string_option_direct((char_u *)"ff", - -1, - (char_u *)p, - OPT_FREE | opt_flags, - 0); - } - - // This may cause the buffer to become (un)modified. - check_status(curbuf); - redraw_tabline = TRUE; - need_maketitle = TRUE; // Set window title later. -} - -/* - * Return the default fileformat from 'fileformats'. - */ -int default_fileformat(void) -{ - switch (*p_ffs) { - case 'm': return EOL_MAC; - case 'd': return EOL_DOS; - } - return EOL_UNIX; -} - -// Call shell. Calls os_call_shell, with 'shellxquote' added. -int call_shell(char_u *cmd, ShellOpts opts, char_u *extra_shell_arg) -{ - char_u *ncmd; - int retval; - proftime_T wait_time; - - if (p_verbose > 3) { - verbose_enter(); - smsg(_("Calling shell to execute: \"%s\""), - cmd == NULL ? p_sh : cmd); - ui_putc('\n'); - verbose_leave(); - } - - if (do_profiling == PROF_YES) - prof_child_enter(&wait_time); - - if (*p_sh == NUL) { - EMSG(_(e_shellempty)); - retval = -1; - } else { - /* The external command may update a tags file, clear cached tags. */ - tag_freematch(); - - if (cmd == NULL || *p_sxq == NUL) - retval = os_call_shell(cmd, opts, extra_shell_arg); - else { - char_u *ecmd = cmd; - - if (*p_sxe != NUL && STRCMP(p_sxq, "(") == 0) { - ecmd = vim_strsave_escaped_ext(cmd, p_sxe, '^', FALSE); - } - ncmd = xmalloc(STRLEN(ecmd) + STRLEN(p_sxq) * 2 + 1); - STRCPY(ncmd, p_sxq); - STRCAT(ncmd, ecmd); - /* When 'shellxquote' is ( append ). - * When 'shellxquote' is "( append )". */ - STRCAT(ncmd, STRCMP(p_sxq, "(") == 0 ? (char_u *)")" - : STRCMP(p_sxq, "\"(") == 0 ? (char_u *)")\"" - : p_sxq); - retval = os_call_shell(ncmd, opts, extra_shell_arg); - xfree(ncmd); - - if (ecmd != cmd) - xfree(ecmd); - } - } - - set_vim_var_nr(VV_SHELL_ERROR, (varnumber_T) retval); - if (do_profiling == PROF_YES) { - prof_child_exit(&wait_time); - } - - return retval; -} - -/* - * VISUAL, SELECTMODE and OP_PENDING State are never set, they are equal to - * NORMAL State with a condition. This function returns the real State. - */ -int get_real_state(void) -{ - if (State & NORMAL) { - if (VIsual_active) { - if (VIsual_select) - return SELECTMODE; - return VISUAL; - } else if (finish_op) - return OP_PENDING; - } - return State; -} - -/* - * Change to a file's directory. - * Caller must call shorten_fnames()! - * Return OK or FAIL. - */ -int vim_chdirfile(char_u *fname) -{ - char_u dir[MAXPATHL]; - - STRLCPY(dir, fname, MAXPATHL); - *path_tail_with_sep(dir) = NUL; - return os_chdir((char *)dir) == 0 ? OK : FAIL; -} - -/* - * Change directory to "new_dir". Search 'cdpath' for relative directory names. - */ -int vim_chdir(char_u *new_dir) -{ - char_u *dir_name; - int r; - - dir_name = find_directory_in_path(new_dir, STRLEN(new_dir), - FNAME_MESS, curbuf->b_ffname); - if (dir_name == NULL) - return -1; - r = os_chdir((char *)dir_name); - xfree(dir_name); - return r; -} - -/* - * Read 2 bytes from "fd" and turn them into an int, MSB first. - */ -int get2c(FILE *fd) -{ - int n; - - n = getc(fd); - n = (n << 8) + getc(fd); - return n; -} - -/* - * Read 3 bytes from "fd" and turn them into an int, MSB first. - */ -int get3c(FILE *fd) -{ - int n; - - n = getc(fd); - n = (n << 8) + getc(fd); - n = (n << 8) + getc(fd); - return n; -} - -/* - * Read 4 bytes from "fd" and turn them into an int, MSB first. - */ -int get4c(FILE *fd) -{ - /* Use unsigned rather than int otherwise result is undefined - * when left-shift sets the MSB. */ - unsigned n; - - n = (unsigned)getc(fd); - n = (n << 8) + (unsigned)getc(fd); - n = (n << 8) + (unsigned)getc(fd); - n = (n << 8) + (unsigned)getc(fd); - return (int)n; -} - -/* - * Read 8 bytes from "fd" and turn them into a time_t, MSB first. - */ -time_t get8ctime(FILE *fd) -{ - time_t n = 0; - int i; - - for (i = 0; i < 8; ++i) - n = (n << 8) + getc(fd); - return n; -} - -/// Reads a string of length "cnt" from "fd" into allocated memory. -/// @return pointer to the string or NULL when unable to read that many bytes. -char *read_string(FILE *fd, size_t cnt) -{ - uint8_t *str = xmallocz(cnt); - for (size_t i = 0; i < cnt; i++) { - int c = getc(fd); - if (c == EOF) { - xfree(str); - return NULL; - } - str[i] = (uint8_t)c; - } - return (char *)str; -} - -/// Writes a number to file "fd", most significant bit first, in "len" bytes. -/// @returns false in case of an error. -bool put_bytes(FILE *fd, uintmax_t number, size_t len) -{ - assert(len > 0); - for (size_t i = len - 1; i < len; i--) { - if (putc((int)(number >> (i * 8)), fd) == EOF) { - return false; - } - } - return true; -} - -/// Writes time_t to file "fd" in 8 bytes. -/// @returns FAIL when the write failed. -int put_time(FILE *fd, time_t time_) -{ - uint8_t buf[8]; - time_to_bytes(time_, buf); - return fwrite(buf, sizeof(uint8_t), ARRAY_SIZE(buf), fd) == 1 ? OK : FAIL; -} - -/// Writes time_t to "buf[8]". -void time_to_bytes(time_t time_, uint8_t buf[8]) -{ - // time_t can be up to 8 bytes in size, more than uintmax_t in 32 bits - // systems, thus we can't use put_bytes() here. - for (size_t i = 7, bufi = 0; bufi < 8; i--, bufi++) { - buf[bufi] = (uint8_t)((uint64_t)time_ >> (i * 8)); - } -} diff --git a/src/nvim/misc2.h b/src/nvim/misc2.h deleted file mode 100644 index 28b5b775d2..0000000000 --- a/src/nvim/misc2.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef NVIM_MISC2_H -#define NVIM_MISC2_H - -#include "nvim/os/shell.h" - -#define READ_STRING(x, y) (char_u *)read_string((x), (size_t)(y)) - -#ifdef INCLUDE_GENERATED_DECLARATIONS -# include "misc2.h.generated.h" -#endif - -#endif // NVIM_MISC2_H diff --git a/src/nvim/mouse.c b/src/nvim/mouse.c index 5efac2623c..2ebe199f47 100644 --- a/src/nvim/mouse.c +++ b/src/nvim/mouse.c @@ -4,6 +4,7 @@ #include "nvim/vim.h" #include "nvim/ascii.h" #include "nvim/window.h" +#include "nvim/state.h" #include "nvim/strings.h" #include "nvim/screen.h" #include "nvim/syntax.h" diff --git a/src/nvim/move.c b/src/nvim/move.c index b129c5cb7a..4c814f3ae0 100644 --- a/src/nvim/move.c +++ b/src/nvim/move.c @@ -24,7 +24,6 @@ #include "nvim/mbyte.h" #include "nvim/memline.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" #include "nvim/popupmnu.h" #include "nvim/screen.h" #include "nvim/strings.h" diff --git a/src/nvim/msgpack_rpc/channel.c b/src/nvim/msgpack_rpc/channel.c index 5b249ee1c7..cd12f258b6 100644 --- a/src/nvim/msgpack_rpc/channel.c +++ b/src/nvim/msgpack_rpc/channel.c @@ -19,6 +19,7 @@ #include "nvim/main.h" #include "nvim/ascii.h" #include "nvim/memory.h" +#include "nvim/eval.h" #include "nvim/os_unix.h" #include "nvim/message.h" #include "nvim/map.h" @@ -55,12 +56,7 @@ typedef struct { msgpack_unpacker *unpacker; union { Stream stream; - struct { - LibuvProcess uvproc; - Stream in; - Stream out; - Stream err; - } process; + Process *proc; struct { Stream in; Stream out; @@ -79,7 +75,6 @@ typedef struct { uint64_t request_id; } RequestEvent; -static uint64_t next_id = 1; static PMap(uint64_t) *channels = NULL; static PMap(cstr_t) *event_strings = NULL; static msgpack_sbuffer out_buffer; @@ -112,33 +107,20 @@ void channel_teardown(void) } /// Creates an API channel by starting a process and connecting to its -/// stdin/stdout. stderr is forwarded to the editor error stream. +/// stdin/stdout. stderr is handled by the job infrastructure. /// /// @param argv The argument vector for the process. [consumed] /// @return The channel id (> 0), on success. /// 0, on error. -uint64_t channel_from_process(char **argv) -{ - Channel *channel = register_channel(kChannelTypeProc); - channel->data.process.uvproc = libuv_process_init(&main_loop, channel); - Process *proc = &channel->data.process.uvproc.process; - proc->argv = argv; - proc->in = &channel->data.process.in; - proc->out = &channel->data.process.out; - proc->err = &channel->data.process.err; - proc->cb = process_exit; - if (!process_spawn(proc)) { - loop_poll_events(&main_loop, 0); - decref(channel); - return 0; - } - +uint64_t channel_from_process(Process *proc, uint64_t id) +{ + Channel *channel = register_channel(kChannelTypeProc, id, proc->events); incref(channel); // process channels are only closed by the exit_cb + channel->data.proc = proc; + wstream_init(proc->in, 0); rstream_init(proc->out, 0); - rstream_start(proc->out, parse_msgpack); - rstream_init(proc->err, 0); - rstream_start(proc->err, forward_stderr); + rstream_start(proc->out, parse_msgpack, channel); return channel->id; } @@ -148,14 +130,14 @@ uint64_t channel_from_process(char **argv) /// @param watcher The SocketWatcher ready to accept the connection void channel_from_connection(SocketWatcher *watcher) { - Channel *channel = register_channel(kChannelTypeSocket); - socket_watcher_accept(watcher, &channel->data.stream, channel); + Channel *channel = register_channel(kChannelTypeSocket, 0, NULL); + socket_watcher_accept(watcher, &channel->data.stream); incref(channel); // close channel only after the stream is closed channel->data.stream.internal_close_cb = close_cb; channel->data.stream.internal_data = channel; wstream_init(&channel->data.stream, 0); rstream_init(&channel->data.stream, CHANNEL_BUFFER_SIZE); - rstream_start(&channel->data.stream, parse_msgpack); + rstream_start(&channel->data.stream, parse_msgpack, channel); } /// Sends event/arguments to channel @@ -314,30 +296,21 @@ bool channel_close(uint64_t id) /// Neovim void channel_from_stdio(void) { - Channel *channel = register_channel(kChannelTypeStdio); + Channel *channel = register_channel(kChannelTypeStdio, 0, NULL); incref(channel); // stdio channels are only closed on exit // read stream - rstream_init_fd(&main_loop, &channel->data.std.in, 0, CHANNEL_BUFFER_SIZE, - channel); - rstream_start(&channel->data.std.in, parse_msgpack); + rstream_init_fd(&main_loop, &channel->data.std.in, 0, CHANNEL_BUFFER_SIZE); + rstream_start(&channel->data.std.in, parse_msgpack, channel); // write stream - wstream_init_fd(&main_loop, &channel->data.std.out, 1, 0, NULL); + wstream_init_fd(&main_loop, &channel->data.std.out, 1, 0); } -static void forward_stderr(Stream *stream, RBuffer *rbuf, size_t count, - void *data, bool eof) +void channel_process_exit(uint64_t id, int status) { - while (rbuffer_size(rbuf)) { - char buf[256]; - size_t read = rbuffer_read(rbuf, buf, sizeof(buf) - 1); - buf[read] = NUL; - ELOG("Channel %" PRIu64 " stderr: %s", ((Channel *)data)->id, buf); - } -} + Channel *channel = pmap_get(uint64_t)(channels, id); -static void process_exit(Process *proc, int status, void *data) -{ - decref(data); + channel->closed = true; + decref(channel); } static void parse_msgpack(Stream *stream, RBuffer *rbuf, size_t c, void *data, @@ -492,8 +465,7 @@ static void on_request_event(void **argv) } else { api_free_object(result); } - // All arguments were freed already, but we still need to free the array - xfree(args.items); + api_free_array(args); decref(channel); xfree(e); } @@ -512,7 +484,7 @@ static bool channel_write(Channel *channel, WBuffer *buffer) success = wstream_write(&channel->data.stream, buffer); break; case kChannelTypeProc: - success = wstream_write(&channel->data.process.in, buffer); + success = wstream_write(channel->data.proc->in, buffer); break; case kChannelTypeStdio: success = wstream_write(&channel->data.std.out, buffer); @@ -637,16 +609,17 @@ static void close_channel(Channel *channel) switch (channel->type) { case kChannelTypeSocket: - stream_close(&channel->data.stream, NULL); + stream_close(&channel->data.stream, NULL, NULL); break; case kChannelTypeProc: - if (!channel->data.process.uvproc.process.closed) { - process_stop(&channel->data.process.uvproc.process); - } + // Only close the rpc channel part, + // there could be an error message on the stderr stream + process_close_in(channel->data.proc); + process_close_out(channel->data.proc); break; case kChannelTypeStdio: - stream_close(&channel->data.std.in, NULL); - stream_close(&channel->data.std.out, NULL); + stream_close(&channel->data.std.in, NULL, NULL); + stream_close(&channel->data.std.out, NULL, NULL); queue_put(main_loop.fast_events, exit_event, 1, channel); return; default: @@ -680,7 +653,9 @@ static void free_channel(Channel *channel) pmap_free(cstr_t)(channel->subscribed_events); kv_destroy(channel->call_stack); kv_destroy(channel->delayed_notifications); - queue_free(channel->events); + if (channel->type != kChannelTypeProc) { + queue_free(channel->events); + } xfree(channel); } @@ -689,15 +664,15 @@ static void close_cb(Stream *stream, void *data) decref(data); } -static Channel *register_channel(ChannelType type) +static Channel *register_channel(ChannelType type, uint64_t id, Queue *events) { Channel *rv = xmalloc(sizeof(Channel)); - rv->events = queue_new_child(main_loop.events); + rv->events = events ? events : queue_new_child(main_loop.events); rv->type = type; rv->refcount = 1; rv->closed = false; rv->unpacker = msgpack_unpacker_new(MSGPACK_UNPACKER_INIT_BUFFER_SIZE); - rv->id = next_id++; + rv->id = id > 0 ? id : next_chan_id++; rv->pending_requests = 0; rv->subscribed_events = pmap_new(cstr_t)(); rv->next_request_id = 1; diff --git a/src/nvim/msgpack_rpc/channel.h b/src/nvim/msgpack_rpc/channel.h index 104547a7b8..0d92976d02 100644 --- a/src/nvim/msgpack_rpc/channel.h +++ b/src/nvim/msgpack_rpc/channel.h @@ -6,6 +6,7 @@ #include "nvim/api/private/defs.h" #include "nvim/event/socket.h" +#include "nvim/event/process.h" #include "nvim/vim.h" #define METHOD_MAXLEN 512 diff --git a/src/nvim/msgpack_rpc/defs.h b/src/nvim/msgpack_rpc/defs.h deleted file mode 100644 index 5611636d4f..0000000000 --- a/src/nvim/msgpack_rpc/defs.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef NVIM_MSGPACK_RPC_DEFS_H -#define NVIM_MSGPACK_RPC_DEFS_H - - -/// The rpc_method_handlers table, used in msgpack_rpc_dispatch(), stores -/// functions of this type. -typedef struct { - Object (*fn)(uint64_t channel_id, - uint64_t request_id, - Array args, - Error *error); - bool async; // function is always safe to run immediately instead of being - // put in a request queue for handling when nvim waits for input. -} MsgpackRpcRequestHandler; - -/// Initializes the msgpack-rpc method table -void msgpack_rpc_init_method_table(void); - -// Add a handler to the method table -void msgpack_rpc_add_method_handler(String method, - MsgpackRpcRequestHandler handler); - -void msgpack_rpc_init_function_metadata(Dictionary *metadata); - -MsgpackRpcRequestHandler msgpack_rpc_get_handler_for(const char *name, - size_t name_len) - FUNC_ATTR_NONNULL_ARG(1); -#endif // NVIM_MSGPACK_RPC_DEFS_H diff --git a/src/nvim/msgpack_rpc/helpers.c b/src/nvim/msgpack_rpc/helpers.c index 9195b10614..33e9bb1c07 100644 --- a/src/nvim/msgpack_rpc/helpers.c +++ b/src/nvim/msgpack_rpc/helpers.c @@ -4,9 +4,9 @@ #include <msgpack.h> +#include "nvim/api/private/dispatch.h" #include "nvim/api/private/helpers.h" #include "nvim/msgpack_rpc/helpers.h" -#include "nvim/msgpack_rpc/defs.h" #include "nvim/lib/kvec.h" #include "nvim/vim.h" #include "nvim/log.h" @@ -40,7 +40,7 @@ static msgpack_sbuffer sbuffer; return false; \ } \ \ - *arg = data.via.u64; \ + *arg = (handle_T)data.via.i64; \ return true; \ } \ \ @@ -49,7 +49,7 @@ static msgpack_sbuffer sbuffer; { \ msgpack_packer pac; \ msgpack_packer_init(&pac, &sbuffer, msgpack_sbuffer_write); \ - msgpack_pack_uint64(&pac, o); \ + msgpack_pack_int64(&pac, o); \ msgpack_pack_ext(res, sbuffer.size, kObjectType##t); \ msgpack_pack_ext_body(res, sbuffer.data, sbuffer.size); \ msgpack_sbuffer_clear(&sbuffer); \ diff --git a/src/nvim/normal.c b/src/nvim/normal.c index c95e5e1a15..d0a9d3aca7 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -36,7 +36,6 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" #include "nvim/keymap.h" #include "nvim/move.h" #include "nvim/mouse.h" @@ -2110,6 +2109,20 @@ static void op_function(oparg_T *oap) } } +// Move the current tab to tab in same column as mouse or to end of the +// tabline if there is no tab there. +static void move_tab_to_mouse(void) +{ + int tabnr = tab_page_click_defs[mouse_col].tabnr; + if (tabnr <= 0) { + tabpage_move(9999); + } else if (tabnr < tabpage_index(curtab)) { + tabpage_move(tabnr - 1); + } else { + tabpage_move(tabnr); + } +} + /* * Do the appropriate action for the current mouse click in the current mode. * Not used for Command-line mode. @@ -2346,12 +2359,7 @@ do_mouse ( if (mouse_row == 0 && firstwin->w_winrow > 0) { if (is_drag) { if (in_tab_line) { - if (tab_page_click_defs[mouse_col].type == kStlClickTabClose) { - tabpage_move(9999); - } else { - int tabnr = tab_page_click_defs[mouse_col].tabnr; - tabpage_move(tabnr < tabpage_index(curtab) ? tabnr - 1 : tabnr); - } + move_tab_to_mouse(); } return false; } @@ -2466,10 +2474,7 @@ do_mouse ( } return true; } else if (is_drag && in_tab_line) { - tabpage_move(tab_page_click_defs[mouse_col].type == kStlClickTabClose - ? 9999 - : tab_page_click_defs[mouse_col].tabnr - 1); - in_tab_line = false; + move_tab_to_mouse(); return false; } @@ -5919,6 +5924,9 @@ static void nv_replace(cmdarg_T *cap) curwin->w_set_curswant = true; set_last_insert(cap->nchar); } + + foldUpdateAll(curwin); + foldOpenCursor(); } /* diff --git a/src/nvim/ops.c b/src/nvim/ops.c index e8a79fa820..388a72adce 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -30,13 +30,13 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" #include "nvim/move.h" #include "nvim/normal.h" #include "nvim/option.h" #include "nvim/path.h" #include "nvim/screen.h" #include "nvim/search.h" +#include "nvim/state.h" #include "nvim/strings.h" #include "nvim/terminal.h" #include "nvim/ui.h" @@ -51,10 +51,10 @@ static yankreg_T *y_previous = NULL; /* ptr to last written yankreg */ static bool clipboard_didwarn_unnamed = false; -// for behavior between start_global_changes() and end_global_changes()) +// for behavior between start_batch_changes() and end_batch_changes()) static bool clipboard_delay_update = false; // delay clipboard update -static int global_change_count = 0; // if set, inside global changes -static bool clipboard_needs_update = false; // the clipboard was updated +static int batch_change_count = 0; // inside a script +static bool clipboard_needs_update = false; // clipboard was updated /* * structure used by block_prep, op_delete and op_yank for blockwise operators @@ -3110,8 +3110,13 @@ error: if (dir == FORWARD) curbuf->b_op_start.lnum++; } - mark_adjust(curbuf->b_op_start.lnum + (y_type == kMTCharWise), - (linenr_T)MAXLNUM, nr_lines, 0L); + // Skip mark_adjust when adding lines after the last one, there + // can't be marks there. + if (curbuf->b_op_start.lnum + (y_type == kMTCharWise) - 1 + nr_lines + < curbuf->b_ml.ml_line_count) { + mark_adjust(curbuf->b_op_start.lnum + (y_type == kMTCharWise), + (linenr_T)MAXLNUM, nr_lines, 0L); + } // note changed text for displaying and folding if (y_type == kMTCharWise) { @@ -5630,20 +5635,20 @@ static void set_clipboard(int name, yankreg_T *reg) (void)eval_call_provider("clipboard", "set", args); } -/// Avoid clipboard (slow) during batch operations (:global). -void start_global_changes(void) +/// Avoid clipboard (slow) during batch operations (i.e., a script). +void start_batch_changes(void) { - if (++global_change_count > 1) { + if (++batch_change_count > 1) { return; } clipboard_delay_update = true; clipboard_needs_update = false; } -/// Update the clipboard after :global changes finished. -void end_global_changes(void) +/// Update the clipboard after batch changes finished. +void end_batch_changes(void) { - if (--global_change_count > 0) { + if (--batch_change_count > 0) { // recursive return; } diff --git a/src/nvim/option.c b/src/nvim/option.c index de53b0b1f4..d8908cca90 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -236,6 +236,7 @@ typedef struct vimoption { #define P_NO_ML 0x2000000U ///< not allowed in modeline #define P_CURSWANT 0x4000000U ///< update curswant required; not needed ///< when there is a redraw flag +#define P_NO_DEF_EXP 0x8000000U ///< Do not expand default value. #define HIGHLIGHT_INIT \ "8:SpecialKey,~:EndOfBuffer,z:TermCursor,Z:TermCursorNC,@:NonText," \ @@ -245,7 +246,7 @@ typedef struct vimoption { "A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,-:Conceal," \ "B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel," \ "x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill," \ - "!:CursorColumn,.:CursorLine,o:ColorColumn" + "!:CursorColumn,.:CursorLine,o:ColorColumn,q:QuickFixLine" /* * options[] is initialized here. @@ -520,6 +521,8 @@ static void set_runtimepath_default(void) #undef SITE_SIZE #undef AFTER_SIZE set_string_default("runtimepath", rtp, true); + // Make a copy of 'rtp' for 'packpath' + set_string_default("packpath", rtp, false); xfree(data_dirs); xfree(config_dirs); xfree(data_home); @@ -676,15 +679,18 @@ void set_init_1(void) #endif false); - char *backupdir = stdpaths_user_data_subpath("backup", 0); + char *backupdir = stdpaths_user_data_subpath("backup", 0, true); const size_t backupdir_len = strlen(backupdir); backupdir = xrealloc(backupdir, backupdir_len + 3); memmove(backupdir + 2, backupdir, backupdir_len + 1); memmove(backupdir, ".,", 2); - set_string_default("viewdir", stdpaths_user_data_subpath("view", 0), true); + set_string_default("viewdir", stdpaths_user_data_subpath("view", 0, true), + true); set_string_default("backupdir", backupdir, true); - set_string_default("directory", stdpaths_user_data_subpath("swap", 2), true); - set_string_default("undodir", stdpaths_user_data_subpath("undo", 0), true); + set_string_default("directory", stdpaths_user_data_subpath("swap", 2, true), + true); + set_string_default("undodir", stdpaths_user_data_subpath("undo", 0, true), + true); // Set default for &runtimepath. All necessary expansions are performed in // this function. set_runtimepath_default(); @@ -726,6 +732,9 @@ void set_init_1(void) * default. */ for (opt_idx = 0; options[opt_idx].fullname; opt_idx++) { + if (options[opt_idx].flags & P_NO_DEF_EXP) { + continue; + } char *p; if ((options[opt_idx].flags & P_GETTEXT) && options[opt_idx].var != NULL) { @@ -1473,16 +1482,19 @@ do_set ( * default value was already expanded, only * required when an environment variable was set * later */ - if (newval == NULL) + new_value_alloced = true; + if (newval == NULL) { newval = empty_option; - else { + } else if (!(options[opt_idx].flags | P_NO_DEF_EXP)) { s = option_expand(opt_idx, newval); - if (s == NULL) + if (s == NULL) { s = newval; + } newval = vim_strsave(s); + } else { + newval = (char_u *)xstrdup((char *)newval); } - new_value_alloced = TRUE; - } else if (nextchar == '<') { /* set to global val */ + } else if (nextchar == '<') { // set to global val newval = vim_strsave(*(char_u **)get_varp_scope( &(options[opt_idx]), OPT_GLOBAL)); new_value_alloced = TRUE; @@ -2020,13 +2032,15 @@ static char_u *option_expand(int opt_idx, char_u *val) if (!(options[opt_idx].flags & P_EXPAND) || options[opt_idx].var == NULL) return NULL; - /* If val is longer than MAXPATHL no meaningful expansion can be done, - * expand_env() would truncate the string. */ - if (val != NULL && STRLEN(val) > MAXPATHL) - return NULL; - - if (val == NULL) + if (val == NULL) { val = *(char_u **)options[opt_idx].var; + } + + // If val is longer than MAXPATHL no meaningful expansion can be done, + // expand_env() would truncate the string. + if (val == NULL || STRLEN(val) > MAXPATHL) { + return NULL; + } /* * Expanding this with NameBuff, expand_env() must not be passed IObuff. @@ -6571,10 +6585,8 @@ int get_sw_value(buf_T *buf) return (int)result; } -/* - * Return the effective softtabstop value for the current buffer, using the - * 'tabstop' value when 'softtabstop' is negative. - */ +// Return the effective softtabstop value for the current buffer, +// using the effective shiftwidth value when 'softtabstop' is negative. int get_sts_value(void) { long result = curbuf->b_p_sts < 0 ? get_sw_value(curbuf) : curbuf->b_p_sts; @@ -6700,3 +6712,148 @@ unsigned int get_bkc_value(buf_T *buf) { return buf->b_bkc_flags ? buf->b_bkc_flags : bkc_flags; } + +/// Return the current end-of-line type: EOL_DOS, EOL_UNIX or EOL_MAC. +int get_fileformat(buf_T *buf) +{ + int c = *buf->b_p_ff; + + if (buf->b_p_bin || c == 'u') { + return EOL_UNIX; + } + if (c == 'm') { + return EOL_MAC; + } + return EOL_DOS; +} + +/// Like get_fileformat(), but override 'fileformat' with "p" for "++opt=val" +/// argument. +/// +/// @param eap can be NULL! +int get_fileformat_force(buf_T *buf, exarg_T *eap) +{ + int c; + + if (eap != NULL && eap->force_ff != 0) { + c = eap->cmd[eap->force_ff]; + } else { + if ((eap != NULL && eap->force_bin != 0) + ? (eap->force_bin == FORCE_BIN) : buf->b_p_bin) { + return EOL_UNIX; + } + c = *buf->b_p_ff; + } + if (c == 'u') { + return EOL_UNIX; + } + if (c == 'm') { + return EOL_MAC; + } + return EOL_DOS; +} + +/// Return the default fileformat from 'fileformats'. +int default_fileformat(void) +{ + switch (*p_ffs) { + case 'm': return EOL_MAC; + case 'd': return EOL_DOS; + } + return EOL_UNIX; +} + +/// Set the current end-of-line type to EOL_UNIX, EOL_MAC, or EOL_DOS. +/// +/// Sets 'fileformat'. +/// +/// @param eol_style End-of-line style. +/// @param opt_flags OPT_LOCAL and/or OPT_GLOBAL +void set_fileformat(int eol_style, int opt_flags) +{ + char *p = NULL; + + switch (eol_style) { + case EOL_UNIX: + p = FF_UNIX; + break; + case EOL_MAC: + p = FF_MAC; + break; + case EOL_DOS: + p = FF_DOS; + break; + } + + // p is NULL if "eol_style" is EOL_UNKNOWN. + if (p != NULL) { + set_string_option_direct((char_u *)"ff", + -1, + (char_u *)p, + OPT_FREE | opt_flags, + 0); + } + + // This may cause the buffer to become (un)modified. + check_status(curbuf); + redraw_tabline = true; + need_maketitle = true; // Set window title later. +} + +/// Skip to next part of an option argument: Skip space and comma. +char_u *skip_to_option_part(char_u *p) +{ + if (*p == ',') { + p++; + } + while (*p == ' ') { + p++; + } + return p; +} + +/// Isolate one part of a string option separated by `sep_chars`. +/// +/// @param[in,out] option advanced to the next part +/// @param[in,out] buf copy of the isolated part +/// @param[in] maxlen length of `buf` +/// @param[in] sep_chars chars that separate the option parts +/// +/// @return length of `*option` +size_t copy_option_part(char_u **option, char_u *buf, size_t maxlen, + char *sep_chars) +{ + size_t len = 0; + char_u *p = *option; + + // skip '.' at start of option part, for 'suffixes' + if (*p == '.') { + buf[len++] = *p++; + } + while (*p != NUL && vim_strchr((char_u *)sep_chars, *p) == NULL) { + // Skip backslash before a separator character and space. + if (p[0] == '\\' && vim_strchr((char_u *)sep_chars, p[1]) != NULL) { + p++; + } + if (len < maxlen - 1) { + buf[len++] = *p; + } + p++; + } + buf[len] = NUL; + + if (*p != NUL && *p != ',') { // skip non-standard separator + p++; + } + p = skip_to_option_part(p); // p points to next file name + + *option = p; + return len; +} + +/// Return TRUE when 'shell' has "csh" in the tail. +int csh_like_shell(void) +{ + return strstr((char *)path_tail(p_sh), "csh") != NULL; +} + diff --git a/src/nvim/option.h b/src/nvim/option.h index 5c2b2662b5..cf167cdd2c 100644 --- a/src/nvim/option.h +++ b/src/nvim/option.h @@ -1,22 +1,25 @@ #ifndef NVIM_OPTION_H #define NVIM_OPTION_H +#include "nvim/ex_cmds_defs.h" // for exarg_T + /* flags for buf_copy_options() */ #define BCO_ENTER 1 /* going to enter the buffer */ #define BCO_ALWAYS 2 /* always copy the options */ #define BCO_NOHELP 4 /* don't touch the help related options */ -/* - * "flags" values for option-setting functions. - * When OPT_GLOBAL and OPT_LOCAL are both missing, set both local and global - * values, get local value. - */ -#define OPT_FREE 1 /* free old value if it was allocated */ -#define OPT_GLOBAL 2 /* use global value */ -#define OPT_LOCAL 4 /* use local value */ -#define OPT_MODELINE 8 /* option in modeline */ -#define OPT_WINONLY 16 /* only set window-local options */ -#define OPT_NOWIN 32 /* don't set window-local options */ +/// Flags for option-setting functions +/// +/// When OPT_GLOBAL and OPT_LOCAL are both missing, set both local and global +/// values, get local value. +typedef enum { + OPT_FREE = 1, ///< Free old value if it was allocated. + OPT_GLOBAL = 2, ///< Use global value. + OPT_LOCAL = 4, ///< Use local value. + OPT_MODELINE = 8, ///< Option in modeline. + OPT_WINONLY = 16, ///< Only set window-local options. + OPT_NOWIN = 32, ///< Don’t set window-local options. +} OptionFlags; #ifdef INCLUDE_GENERATED_DECLARATIONS # include "option.h.generated.h" diff --git a/src/nvim/option_defs.h b/src/nvim/option_defs.h index 8d6f42e088..e36cceaaf4 100644 --- a/src/nvim/option_defs.h +++ b/src/nvim/option_defs.h @@ -370,17 +370,17 @@ static char *(p_cb_values[]) = {"unnamed", "unnamedplus", NULL}; # define CB_UNNAMED 0x001 # define CB_UNNAMEDPLUS 0x002 # define CB_UNNAMEDMASK (CB_UNNAMED | CB_UNNAMEDPLUS) -EXTERN long p_cwh; /* 'cmdwinheight' */ -EXTERN long p_ch; /* 'cmdheight' */ -EXTERN int p_confirm; /* 'confirm' */ -EXTERN int p_cp; /* 'compatible' */ -EXTERN char_u *p_cot; /* 'completeopt' */ -EXTERN long p_ph; /* 'pumheight' */ -EXTERN char_u *p_cpo; /* 'cpoptions' */ -EXTERN char_u *p_csprg; /* 'cscopeprg' */ -EXTERN int p_csre; /* 'cscoperelative' */ -EXTERN char_u *p_csqf; /* 'cscopequickfix' */ -# define CSQF_CMDS "sgdctefi" +EXTERN long p_cwh; // 'cmdwinheight' +EXTERN long p_ch; // 'cmdheight' +EXTERN int p_confirm; // 'confirm' +EXTERN int p_cp; // 'compatible' +EXTERN char_u *p_cot; // 'completeopt' +EXTERN long p_ph; // 'pumheight' +EXTERN char_u *p_cpo; // 'cpoptions' +EXTERN char_u *p_csprg; // 'cscopeprg' +EXTERN int p_csre; // 'cscoperelative' +EXTERN char_u *p_csqf; // 'cscopequickfix' +# define CSQF_CMDS "sgdctefia" # define CSQF_FLAGS "+-0" EXTERN int p_cst; /* 'cscopetag' */ EXTERN long p_csto; /* 'cscopetagorder' */ diff --git a/src/nvim/options.lua b/src/nvim/options.lua index d19af4f73f..060ec8c1e1 100644 --- a/src/nvim/options.lua +++ b/src/nvim/options.lua @@ -165,7 +165,7 @@ return { deny_duplicates=true, secure=true, vi_def=true, - expand=true, + expand='nodefault', varname='p_bdir', defaults={if_true={vi=''}} }, @@ -616,7 +616,7 @@ return { deny_duplicates=true, secure=true, vi_def=true, - expand=true, + expand='nodefault', varname='p_dir', defaults={if_true={vi=''}} }, @@ -1891,7 +1891,7 @@ return { deny_duplicates=true, secure=true, vi_def=true, - expand=true, + expand='nodefault', varname='p_rtp', defaults={if_true={vi=''}} }, @@ -2507,7 +2507,7 @@ return { deny_duplicates=true, secure=true, vi_def=true, - expand=true, + expand='nodefault', varname='p_udir', defaults={if_true={vi=''}} }, @@ -2568,7 +2568,7 @@ return { type='string', scope={'global'}, secure=true, vi_def=true, - expand=true, + expand='nodefault', varname='p_vdir', defaults={if_true={vi=''}} }, diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c index edc430410c..83a0262545 100644 --- a/src/nvim/os/env.c +++ b/src/nvim/os/env.c @@ -12,7 +12,6 @@ #include "nvim/os/os.h" #include "nvim/memory.h" #include "nvim/message.h" -#include "nvim/misc2.h" #include "nvim/path.h" #include "nvim/strings.h" #include "nvim/eval.h" diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c index cd943c4843..008952fa97 100644 --- a/src/nvim/os/fs.c +++ b/src/nvim/os/fs.c @@ -21,7 +21,6 @@ #include "nvim/message.h" #include "nvim/assert.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" #include "nvim/path.h" #include "nvim/strings.h" @@ -399,14 +398,7 @@ ptrdiff_t os_read(const int fd, bool *ret_eof, char *const ret_buf, assert(read_bytes <= size); } if (cur_read_bytes < 0) { -#ifdef HAVE_UV_TRANSLATE_SYS_ERROR - const int error = uv_translate_sys_error(errno); -#else - const int error = -errno; - STATIC_ASSERT(-EINTR == UV_EINTR, "Need to translate error codes"); - STATIC_ASSERT(-EAGAIN == UV_EAGAIN, "Need to translate error codes"); - STATIC_ASSERT(-ENOMEM == UV_ENOMEM, "Need to translate error codes"); -#endif + const int error = os_translate_sys_error(errno); errno = 0; if (error == UV_EINTR || error == UV_EAGAIN) { continue; @@ -469,14 +461,7 @@ ptrdiff_t os_readv(int fd, bool *ret_eof, struct iovec *iov, size_t iov_size) } } } else if (cur_read_bytes < 0) { -#ifdef HAVE_UV_TRANSLATE_SYS_ERROR - const int error = uv_translate_sys_error(errno); -#else - const int error = -errno; - STATIC_ASSERT(-EINTR == UV_EINTR, "Need to translate error codes"); - STATIC_ASSERT(-EAGAIN == UV_EAGAIN, "Need to translate error codes"); - STATIC_ASSERT(-ENOMEM == UV_ENOMEM, "Need to translate error codes"); -#endif + const int error = os_translate_sys_error(errno); errno = 0; if (error == UV_EINTR || error == UV_EAGAIN) { continue; @@ -515,15 +500,7 @@ ptrdiff_t os_write(const int fd, const char *const buf, const size_t size) written_bytes += (size_t)cur_written_bytes; } if (cur_written_bytes < 0) { -#ifdef HAVE_UV_TRANSLATE_SYS_ERROR - const int error = uv_translate_sys_error(errno); -#else - const int error = -errno; - STATIC_ASSERT(-EINTR == UV_EINTR, "Need to translate error codes"); - STATIC_ASSERT(-EAGAIN == UV_EAGAIN, "Need to translate error codes"); - // According to the man page open() may fail with ENOMEM, but write() - // can’t. -#endif + const int error = os_translate_sys_error(errno); errno = 0; if (error == UV_EINTR || error == UV_EAGAIN) { continue; @@ -1023,3 +1000,126 @@ shortcut_end: } #endif + +int os_translate_sys_error(int sys_errno) { +#ifdef HAVE_UV_TRANSLATE_SYS_ERROR + return uv_translate_sys_error(sys_errno); +#elif WIN32 + // TODO(equalsraf): libuv does not yet expose uv_translate_sys_error() + // in its public API, include a version here until it can be used. + // See https://github.com/libuv/libuv/issues/79 +# ifndef ERROR_SYMLINK_NOT_SUPPORTED +# define ERROR_SYMLINK_NOT_SUPPORTED 1464 +# endif + + if (sys_errno <= 0) { + return sys_errno; // If < 0 then it's already a libuv error + } + + switch (sys_errno) { + case ERROR_NOACCESS: return UV_EACCES; + case WSAEACCES: return UV_EACCES; + case ERROR_ADDRESS_ALREADY_ASSOCIATED: return UV_EADDRINUSE; + case WSAEADDRINUSE: return UV_EADDRINUSE; + case WSAEADDRNOTAVAIL: return UV_EADDRNOTAVAIL; + case WSAEAFNOSUPPORT: return UV_EAFNOSUPPORT; + case WSAEWOULDBLOCK: return UV_EAGAIN; + case WSAEALREADY: return UV_EALREADY; + case ERROR_INVALID_FLAGS: return UV_EBADF; + case ERROR_INVALID_HANDLE: return UV_EBADF; + case ERROR_LOCK_VIOLATION: return UV_EBUSY; + case ERROR_PIPE_BUSY: return UV_EBUSY; + case ERROR_SHARING_VIOLATION: return UV_EBUSY; + case ERROR_OPERATION_ABORTED: return UV_ECANCELED; + case WSAEINTR: return UV_ECANCELED; + case ERROR_NO_UNICODE_TRANSLATION: return UV_ECHARSET; + case ERROR_CONNECTION_ABORTED: return UV_ECONNABORTED; + case WSAECONNABORTED: return UV_ECONNABORTED; + case ERROR_CONNECTION_REFUSED: return UV_ECONNREFUSED; + case WSAECONNREFUSED: return UV_ECONNREFUSED; + case ERROR_NETNAME_DELETED: return UV_ECONNRESET; + case WSAECONNRESET: return UV_ECONNRESET; + case ERROR_ALREADY_EXISTS: return UV_EEXIST; + case ERROR_FILE_EXISTS: return UV_EEXIST; + case ERROR_BUFFER_OVERFLOW: return UV_EFAULT; + case WSAEFAULT: return UV_EFAULT; + case ERROR_HOST_UNREACHABLE: return UV_EHOSTUNREACH; + case WSAEHOSTUNREACH: return UV_EHOSTUNREACH; + case ERROR_INSUFFICIENT_BUFFER: return UV_EINVAL; + case ERROR_INVALID_DATA: return UV_EINVAL; + case ERROR_INVALID_PARAMETER: return UV_EINVAL; + case ERROR_SYMLINK_NOT_SUPPORTED: return UV_EINVAL; + case WSAEINVAL: return UV_EINVAL; + case WSAEPFNOSUPPORT: return UV_EINVAL; + case WSAESOCKTNOSUPPORT: return UV_EINVAL; + case ERROR_BEGINNING_OF_MEDIA: return UV_EIO; + case ERROR_BUS_RESET: return UV_EIO; + case ERROR_CRC: return UV_EIO; + case ERROR_DEVICE_DOOR_OPEN: return UV_EIO; + case ERROR_DEVICE_REQUIRES_CLEANING: return UV_EIO; + case ERROR_DISK_CORRUPT: return UV_EIO; + case ERROR_EOM_OVERFLOW: return UV_EIO; + case ERROR_FILEMARK_DETECTED: return UV_EIO; + case ERROR_GEN_FAILURE: return UV_EIO; + case ERROR_INVALID_BLOCK_LENGTH: return UV_EIO; + case ERROR_IO_DEVICE: return UV_EIO; + case ERROR_NO_DATA_DETECTED: return UV_EIO; + case ERROR_NO_SIGNAL_SENT: return UV_EIO; + case ERROR_OPEN_FAILED: return UV_EIO; + case ERROR_SETMARK_DETECTED: return UV_EIO; + case ERROR_SIGNAL_REFUSED: return UV_EIO; + case WSAEISCONN: return UV_EISCONN; + case ERROR_CANT_RESOLVE_FILENAME: return UV_ELOOP; + case ERROR_TOO_MANY_OPEN_FILES: return UV_EMFILE; + case WSAEMFILE: return UV_EMFILE; + case WSAEMSGSIZE: return UV_EMSGSIZE; + case ERROR_FILENAME_EXCED_RANGE: return UV_ENAMETOOLONG; + case ERROR_NETWORK_UNREACHABLE: return UV_ENETUNREACH; + case WSAENETUNREACH: return UV_ENETUNREACH; + case WSAENOBUFS: return UV_ENOBUFS; + case ERROR_BAD_PATHNAME: return UV_ENOENT; + case ERROR_DIRECTORY: return UV_ENOENT; + case ERROR_FILE_NOT_FOUND: return UV_ENOENT; + case ERROR_INVALID_NAME: return UV_ENOENT; + case ERROR_INVALID_DRIVE: return UV_ENOENT; + case ERROR_INVALID_REPARSE_DATA: return UV_ENOENT; + case ERROR_MOD_NOT_FOUND: return UV_ENOENT; + case ERROR_PATH_NOT_FOUND: return UV_ENOENT; + case WSAHOST_NOT_FOUND: return UV_ENOENT; + case WSANO_DATA: return UV_ENOENT; + case ERROR_NOT_ENOUGH_MEMORY: return UV_ENOMEM; + case ERROR_OUTOFMEMORY: return UV_ENOMEM; + case ERROR_CANNOT_MAKE: return UV_ENOSPC; + case ERROR_DISK_FULL: return UV_ENOSPC; + case ERROR_EA_TABLE_FULL: return UV_ENOSPC; + case ERROR_END_OF_MEDIA: return UV_ENOSPC; + case ERROR_HANDLE_DISK_FULL: return UV_ENOSPC; + case ERROR_NOT_CONNECTED: return UV_ENOTCONN; + case WSAENOTCONN: return UV_ENOTCONN; + case ERROR_DIR_NOT_EMPTY: return UV_ENOTEMPTY; + case WSAENOTSOCK: return UV_ENOTSOCK; + case ERROR_NOT_SUPPORTED: return UV_ENOTSUP; + case ERROR_BROKEN_PIPE: return UV_EOF; + case ERROR_ACCESS_DENIED: return UV_EPERM; + case ERROR_PRIVILEGE_NOT_HELD: return UV_EPERM; + case ERROR_BAD_PIPE: return UV_EPIPE; + case ERROR_NO_DATA: return UV_EPIPE; + case ERROR_PIPE_NOT_CONNECTED: return UV_EPIPE; + case WSAESHUTDOWN: return UV_EPIPE; + case WSAEPROTONOSUPPORT: return UV_EPROTONOSUPPORT; + case ERROR_WRITE_PROTECT: return UV_EROFS; + case ERROR_SEM_TIMEOUT: return UV_ETIMEDOUT; + case WSAETIMEDOUT: return UV_ETIMEDOUT; + case ERROR_NOT_SAME_DEVICE: return UV_EXDEV; + case ERROR_INVALID_FUNCTION: return UV_EISDIR; + case ERROR_META_EXPANSION_TOO_LONG: return UV_E2BIG; + default: return UV_UNKNOWN; + } +#else + const int error = -errno; + STATIC_ASSERT(-EINTR == UV_EINTR, "Need to translate error codes"); + STATIC_ASSERT(-EAGAIN == UV_EAGAIN, "Need to translate error codes"); + STATIC_ASSERT(-ENOMEM == UV_ENOMEM, "Need to translate error codes"); + return error; +#endif +} diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c index 0c46dc96ee..6873e32f34 100644 --- a/src/nvim/os/input.c +++ b/src/nvim/os/input.c @@ -19,7 +19,7 @@ #include "nvim/getchar.h" #include "nvim/main.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" +#include "nvim/state.h" #define READ_BUFFER_SIZE 0xfff #define INPUT_BUFFER_SIZE (READ_BUFFER_SIZE * 4) @@ -60,8 +60,8 @@ void input_start(int fd) } global_fd = fd; - rstream_init_fd(&main_loop, &read_stream, fd, READ_BUFFER_SIZE, NULL); - rstream_start(&read_stream, read_cb); + rstream_init_fd(&main_loop, &read_stream, fd, READ_BUFFER_SIZE); + rstream_start(&read_stream, read_cb, NULL); } void input_stop(void) @@ -71,7 +71,7 @@ void input_stop(void) } rstream_stop(&read_stream); - stream_close(&read_stream, NULL); + stream_close(&read_stream, NULL, NULL); } static void cursorhold_event(void **argv) @@ -266,29 +266,32 @@ static unsigned int handle_mouse_event(char **ptr, uint8_t *buf, } static int orig_num_clicks = 0; - static int orig_mouse_code = 0; - static int orig_mouse_col = 0; - static int orig_mouse_row = 0; - static uint64_t orig_mouse_time = 0; // time of previous mouse click - uint64_t mouse_time = os_hrtime(); // time of current mouse click - - // compute the time elapsed since the previous mouse click and - // convert p_mouse from ms to ns - uint64_t timediff = mouse_time - orig_mouse_time; - uint64_t mouset = (uint64_t)p_mouset * 1000000; - if (mouse_code == orig_mouse_code - && timediff < mouset - && orig_num_clicks != 4 - && orig_mouse_col == mouse_col - && orig_mouse_row == mouse_row) { - orig_num_clicks++; - } else { - orig_num_clicks = 1; + if (mouse_code != KE_LEFTRELEASE && mouse_code != KE_RIGHTRELEASE + && mouse_code != KE_MIDDLERELEASE) { + static int orig_mouse_code = 0; + static int orig_mouse_col = 0; + static int orig_mouse_row = 0; + static uint64_t orig_mouse_time = 0; // time of previous mouse click + uint64_t mouse_time = os_hrtime(); // time of current mouse click (ns) + + // compute the time elapsed since the previous mouse click and + // convert p_mouse from ms to ns + uint64_t timediff = mouse_time - orig_mouse_time; + uint64_t mouset = (uint64_t)p_mouset * 1000000; + if (mouse_code == orig_mouse_code + && timediff < mouset + && orig_num_clicks != 4 + && orig_mouse_col == mouse_col + && orig_mouse_row == mouse_row) { + orig_num_clicks++; + } else { + orig_num_clicks = 1; + } + orig_mouse_code = mouse_code; + orig_mouse_col = mouse_col; + orig_mouse_row = mouse_row; + orig_mouse_time = mouse_time; } - orig_mouse_code = mouse_code; - orig_mouse_col = mouse_col; - orig_mouse_row = mouse_row; - orig_mouse_time = mouse_time; uint8_t modifiers = 0; if (orig_num_clicks == 2) { diff --git a/src/nvim/os/shell.c b/src/nvim/os/shell.c index 64c673930a..661b12accc 100644 --- a/src/nvim/os/shell.c +++ b/src/nvim/os/shell.c @@ -19,7 +19,6 @@ #include "nvim/message.h" #include "nvim/memory.h" #include "nvim/ui.h" -#include "nvim/misc2.h" #include "nvim/screen.h" #include "nvim/memline.h" #include "nvim/option_defs.h" @@ -54,12 +53,12 @@ char **shell_build_argv(const char *cmd, const char *extra_args) size_t i = tokenize(p_sh, rv); if (extra_args) { - rv[i++] = xstrdup(extra_args); // Push a copy of `extra_args` + rv[i++] = xstrdup(extra_args); // Push a copy of `extra_args` } if (cmd) { - i += tokenize(p_shcf, rv + i); // Split 'shellcmdflag' - rv[i++] = xstrdup(cmd); // Push a copy of the command. + i += tokenize(p_shcf, rv + i); // Split 'shellcmdflag' + rv[i++] = shell_xescape_xquote(cmd); // Copy (and escape) `cmd`. } rv[i] = NULL; @@ -236,10 +235,10 @@ static int do_os_system(char **argv, } proc->out->events = NULL; rstream_init(proc->out, 0); - rstream_start(proc->out, data_cb); + rstream_start(proc->out, data_cb, &buf); proc->err->events = NULL; rstream_init(proc->err, 0); - rstream_start(proc->err, data_cb); + rstream_start(proc->err, data_cb, &buf); // write the input, if any if (input) { @@ -251,7 +250,7 @@ static int do_os_system(char **argv, return -1; } // close the input stream after everything is written - wstream_set_write_cb(&in, shell_write_cb); + wstream_set_write_cb(&in, shell_write_cb, NULL); } // invoke busy_start here so event_poll_until wont change the busy state for @@ -546,5 +545,41 @@ static size_t write_output(char *output, size_t remaining, bool to_buffer, static void shell_write_cb(Stream *stream, void *data, int status) { - stream_close(stream, NULL); + stream_close(stream, NULL, NULL); } + +/// Applies 'shellxescape' (p_sxe) and 'shellxquote' (p_sxq) to a command. +/// +/// @param cmd Command string +/// @return Escaped/quoted command string (allocated). +static char *shell_xescape_xquote(const char *cmd) + FUNC_ATTR_NONNULL_ALL FUNC_ATTR_MALLOC FUNC_ATTR_WARN_UNUSED_RESULT +{ + if (*p_sxq == NUL) { + return xstrdup(cmd); + } + + const char *ecmd = cmd; + if (*p_sxe != NUL && STRCMP(p_sxq, "(") == 0) { + ecmd = (char *)vim_strsave_escaped_ext((char_u *)cmd, p_sxe, '^', false); + } + size_t ncmd_size = strlen(ecmd) + STRLEN(p_sxq) * 2 + 1; + char *ncmd = xmalloc(ncmd_size); + + // When 'shellxquote' is ( append ). + // When 'shellxquote' is "( append )". + if (STRCMP(p_sxq, "(") == 0) { + vim_snprintf(ncmd, ncmd_size, "(%s)", ecmd); + } else if (STRCMP(p_sxq, "\"(") == 0) { + vim_snprintf(ncmd, ncmd_size, "\"(%s)\"", ecmd); + } else { + vim_snprintf(ncmd, ncmd_size, "%s%s%s", p_sxq, ecmd, p_sxq); + } + + if (ecmd != cmd) { + xfree((void *)ecmd); + } + + return ncmd; +} + diff --git a/src/nvim/os/signal.c b/src/nvim/os/signal.c index 4abc9cfc36..1ac6d3f5e1 100644 --- a/src/nvim/os/signal.c +++ b/src/nvim/os/signal.c @@ -2,6 +2,9 @@ #include <stdbool.h> #include <uv.h> +#ifndef WIN32 +# include <signal.h> // for sigset_t +#endif #include "nvim/ascii.h" #include "nvim/vim.h" @@ -11,7 +14,6 @@ #include "nvim/main.h" #include "nvim/memory.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" #include "nvim/event/signal.h" #include "nvim/os/signal.h" #include "nvim/event/loop.h" @@ -29,6 +31,16 @@ static bool rejecting_deadly; void signal_init(void) { +#ifndef WIN32 + // Ensure a clean slate by unblocking all signals. For example, if SIGCHLD is + // blocked, libuv may hang after spawning a subprocess on Linux. #5230 + sigset_t mask; + sigemptyset(&mask); + if (pthread_sigmask(SIG_SETMASK, &mask, NULL) != 0) { + ELOG("Could not unblock signals, nvim might behave strangely."); + } +#endif + signal_watcher_init(&main_loop, &spipe, NULL); signal_watcher_init(&main_loop, &shup, NULL); signal_watcher_init(&main_loop, &squit, NULL); diff --git a/src/nvim/os/stdpaths.c b/src/nvim/os/stdpaths.c index 81ceb919c4..10b3f4c091 100644 --- a/src/nvim/os/stdpaths.c +++ b/src/nvim/os/stdpaths.c @@ -100,18 +100,30 @@ char *stdpaths_user_conf_subpath(const char *fname) /// /// @param[in] fname New component of the path. /// @param[in] trailing_pathseps Amount of trailing path separators to add. +/// @param[in] escape_commas If true, all commas will be escaped. /// -/// @return [allocated] `$XDG_DATA_HOME/nvim/{fname}` +/// @return [allocated] `$XDG_DATA_HOME/nvim/{fname}`. char *stdpaths_user_data_subpath(const char *fname, - const size_t trailing_pathseps) + const size_t trailing_pathseps, + const bool escape_commas) FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL FUNC_ATTR_NONNULL_RET { char *ret = concat_fnames_realloc(get_xdg_home(kXDGDataHome), fname, true); - if (trailing_pathseps) { - const size_t len = strlen(ret); - ret = xrealloc(ret, len + trailing_pathseps + 1); - memset(ret + len, PATHSEP, trailing_pathseps); - ret[len + trailing_pathseps] = NUL; + const size_t len = strlen(ret); + const size_t numcommas = (escape_commas ? memcnt(ret, ',', len) : 0); + if (numcommas || trailing_pathseps) { + ret = xrealloc(ret, len + trailing_pathseps + numcommas + 1); + for (size_t i = 0 ; i < len + numcommas ; i++) { + if (ret[i] == ',') { + memmove(ret + i + 1, ret + i, len - i + numcommas); + ret[i] = '\\'; + i++; + } + } + if (trailing_pathseps) { + memset(ret + len + numcommas, PATHSEP, trailing_pathseps); + } + ret[len + trailing_pathseps + numcommas] = NUL; } return ret; } diff --git a/src/nvim/os/users.c b/src/nvim/os/users.c index 8ebb7562ef..1c94ef0067 100644 --- a/src/nvim/os/users.c +++ b/src/nvim/os/users.c @@ -6,7 +6,6 @@ #include "nvim/os/os.h" #include "nvim/garray.h" #include "nvim/memory.h" -#include "nvim/misc2.h" #include "nvim/strings.h" #ifdef HAVE_PWD_H # include <pwd.h> diff --git a/src/nvim/os_unix.c b/src/nvim/os_unix.c index def7e3b0e5..08294fa6a0 100644 --- a/src/nvim/os_unix.c +++ b/src/nvim/os_unix.c @@ -27,7 +27,6 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" #include "nvim/mouse.h" #include "nvim/garray.h" #include "nvim/path.h" diff --git a/src/nvim/path.c b/src/nvim/path.c index 57499429ec..a79b7139f1 100644 --- a/src/nvim/path.c +++ b/src/nvim/path.c @@ -18,7 +18,6 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" #include "nvim/option.h" #include "nvim/os/os.h" #include "nvim/os/shell.h" @@ -172,19 +171,23 @@ char_u *path_next_component(char_u *fname) return fname; } -/* - * Get a pointer to one character past the head of a path name. - * Unix: after "/"; DOS: after "c:\"; Mac: no head. - * If there is no head, path is returned. - */ +/// Get a pointer to one character past the head of a path name. +/// Unix: after "/"; Win: after "c:\" +/// If there is no head, path is returned. char_u *get_past_head(char_u *path) { - char_u *retval; + char_u *retval = path; - retval = path; +#ifdef WIN32 + // May skip "c:" + if (isalpha(path[0]) && path[1] == ':') { + retval = path + 2; + } +#endif - while (vim_ispathsep(*retval)) + while (vim_ispathsep(*retval)) { ++retval; + } return retval; } @@ -562,11 +565,12 @@ static size_t do_path_expand(garray_T *gap, const char_u *path, while (*path_end != NUL) { /* May ignore a wildcard that has a backslash before it; it will * be removed by rem_backslash() or file_pat_to_reg_pat() below. */ - if (path_end >= path + wildoff && rem_backslash(path_end)) + if (path_end >= path + wildoff && rem_backslash(path_end)) { *p++ = *path_end++; - else if (*path_end == '/') { - if (e != NULL) + } else if (vim_ispathsep_nocolon(*path_end)) { + if (e != NULL) { break; + } s = p + 1; } else if (path_end >= path + wildoff && (vim_strchr((char_u *)"*?[{~$", *path_end) != NULL @@ -2099,7 +2103,6 @@ int path_full_dir_name(char *directory, char *buffer, size_t len) } // Append to_append to path with a slash in between. -// Append to_append to path with a slash in between. int append_path(char *path, const char *to_append, size_t max_len) { size_t current_length = strlen(path); @@ -2116,7 +2119,7 @@ int append_path(char *path, const char *to_append, size_t max_len) } // Glue both paths with a slash. - if (current_length > 0 && path[current_length-1] != '/') { + if (current_length > 0 && !vim_ispathsep_nocolon(path[current_length-1])) { current_length += 1; // Count the trailing slash. // +1 for the NUL at the end. @@ -2124,7 +2127,7 @@ int append_path(char *path, const char *to_append, size_t max_len) return FAIL; } - STRCAT(path, "/"); + STRCAT(path, PATHSEPSTR); } // +1 for the NUL at the end. @@ -2182,9 +2185,16 @@ static int path_get_absolute_path(const char_u *fname, char_u *buf, /// Check if the given file is absolute. /// -/// This just checks if the file name starts with '/' or '~'. /// @return `TRUE` if "fname" is absolute. int path_is_absolute_path(const char_u *fname) { +#ifdef WIN32 + // A name like "d:/foo" and "//server/share" is absolute + return ((isalpha(fname[0]) && fname[1] == ':' + && vim_ispathsep_nocolon(fname[2])) + || (vim_ispathsep_nocolon(fname[0]) && fname[0] == fname[1])); +#else + // UNIX: This just checks if the file name starts with '/' or '~'. return *fname == '/' || *fname == '~'; +#endif } diff --git a/src/nvim/po/af.po b/src/nvim/po/af.po index 6bb93b9e02..8f06ed178c 100644 --- a/src/nvim/po/af.po +++ b/src/nvim/po/af.po @@ -4305,10 +4305,6 @@ msgstr "reël %4ld:" msgid "E354: Invalid register name: '%s'" msgstr "E354: Ongeldige registernaam: '%s'" -#: ../message.c:745 -msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>" -msgstr "Boodskappe onderhouers: Danie Roux en Jean Jordaan <droux@tuks.co.za>" - #: ../message.c:986 msgid "Interrupt: " msgstr "Onderbreek: " diff --git a/src/nvim/po/ca.po b/src/nvim/po/ca.po index 79434cfdcd..2b0d7611d0 100644 --- a/src/nvim/po/ca.po +++ b/src/nvim/po/ca.po @@ -4293,10 +4293,6 @@ msgstr "línia %4ld:" msgid "E354: Invalid register name: '%s'" msgstr "E354: El nom de registre no és vàlid: '%s'" -#: ../message.c:745 -msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>" -msgstr "Traducció dels missatges: Ernest Adrogué <eadrogue@gmx.net>" - #: ../message.c:986 msgid "Interrupt: " msgstr "Interrupció: " diff --git a/src/nvim/po/cs.cp1250.po b/src/nvim/po/cs.cp1250.po index 1e62034317..339dfe6ae5 100644 --- a/src/nvim/po/cs.cp1250.po +++ b/src/nvim/po/cs.cp1250.po @@ -4378,10 +4378,6 @@ msgstr "øádek %4ld:" msgid "E354: Invalid register name: '%s'" msgstr "E354: '%s' není pøípustné jméno registru" -#: ../message.c:745 -msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>" -msgstr "Správce zpráv: Bram Moolenaar <Bram@vim.org>" - #: ../message.c:986 msgid "Interrupt: " msgstr "Pøerušení: " diff --git a/src/nvim/po/cs.po b/src/nvim/po/cs.po index dd7016fedb..5c19eecf32 100644 --- a/src/nvim/po/cs.po +++ b/src/nvim/po/cs.po @@ -4378,10 +4378,6 @@ msgstr "øádek %4ld:" msgid "E354: Invalid register name: '%s'" msgstr "E354: '%s' není pøípustné jméno registru" -#: ../message.c:745 -msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>" -msgstr "Správce zpráv: Bram Moolenaar <Bram@vim.org>" - #: ../message.c:986 msgid "Interrupt: " msgstr "Pøeru¹ení: " diff --git a/src/nvim/po/en_GB.po b/src/nvim/po/en_GB.po index b4b38e11e3..41e4cd895d 100644 --- a/src/nvim/po/en_GB.po +++ b/src/nvim/po/en_GB.po @@ -4128,10 +4128,6 @@ msgstr "" msgid "E354: Invalid register name: '%s'" msgstr "" -#: ../message.c:745 -msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>" -msgstr "Messages maintainer: Mike Williams <mrw@eandem.co.uk>" - #: ../message.c:986 msgid "Interrupt: " msgstr "" diff --git a/src/nvim/po/eo.po b/src/nvim/po/eo.po index 6bc76506ae..153eacc7b8 100644 --- a/src/nvim/po/eo.po +++ b/src/nvim/po/eo.po @@ -4295,10 +4295,6 @@ msgstr "linio %4ld:" msgid "E354: Invalid register name: '%s'" msgstr "E354: Nevalida nomo de reÄistro: '%s'" -#: ../message.c:745 -msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>" -msgstr "Flegado de mesaÄoj: Dominique PELLÉ <dominique.pelle@gmail.com>" - #: ../message.c:986 msgid "Interrupt: " msgstr "Interrompo: " diff --git a/src/nvim/po/es.po b/src/nvim/po/es.po index 8a9c86e88d..9a3bfa6894 100644 --- a/src/nvim/po/es.po +++ b/src/nvim/po/es.po @@ -4377,12 +4377,6 @@ msgstr "lÃnea %4ld" msgid "E354: Invalid register name: '%s'" msgstr "E354: Nombre de registro no válido: '%s'" -#: ../message.c:745 -msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>" -msgstr "" -"Traducción: Proyecto vim-doc-es <http://www.assembla.com/wiki/show/vim-doc-" -"es>" - #: ../message.c:986 msgid "Interrupt: " msgstr "Interrupción: " diff --git a/src/nvim/po/fi.po b/src/nvim/po/fi.po index d4082135aa..6dfaa78a77 100644 --- a/src/nvim/po/fi.po +++ b/src/nvim/po/fi.po @@ -4275,10 +4275,6 @@ msgstr "rivi %4ld:" msgid "E354: Invalid register name: '%s'" msgstr "E354: Virheellinen rekisterin nimi: %s" -#: ../message.c:745 -msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>" -msgstr "Käännöksen ylläpitäjä: Flammie Pirinen <flammie@iki.fi>" - #: ../message.c:986 msgid "Interrupt: " msgstr "Keskeytys: " diff --git a/src/nvim/po/fr.po b/src/nvim/po/fr.po index 41efd5c5e3..a16a939117 100644 --- a/src/nvim/po/fr.po +++ b/src/nvim/po/fr.po @@ -4479,10 +4479,6 @@ msgid "E354: Invalid register name: '%s'" msgstr "E354: Nom de registre invalide : '%s'" # DB - todo : mettre à jour ? -#: ../message.c:745 -msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>" -msgstr "Maintenance des messages : Dominique Pellé <dominique.pelle@gmail.com>" - #: ../message.c:986 msgid "Interrupt: " msgstr "Interruption : " diff --git a/src/nvim/po/ga.po b/src/nvim/po/ga.po index f7117c6e86..d94b788449 100644 --- a/src/nvim/po/ga.po +++ b/src/nvim/po/ga.po @@ -4286,11 +4286,6 @@ msgstr "líne %4ld:" msgid "E354: Invalid register name: '%s'" msgstr "E354: Ainm neamhbhailí tabhaill: '%s'" -#: ../message.c:745 -msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>" -msgstr "" -"Cothaitheoir na dteachtaireachtaí: Kevin P. Scannell <scannell@slu.edu>" - #: ../message.c:986 msgid "Interrupt: " msgstr "Idirbhriseadh: " diff --git a/src/nvim/po/it.po b/src/nvim/po/it.po index 084102da60..119a8f02ff 100644 --- a/src/nvim/po/it.po +++ b/src/nvim/po/it.po @@ -4294,10 +4294,6 @@ msgstr "riga %4ld:" msgid "E354: Invalid register name: '%s'" msgstr "E354: Nome registro non valido: '%s'" -#: ../message.c:745 -msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>" -msgstr "Manutentore messaggi: Vlad Sandrini <marco@sandrini.biz>" - #: ../message.c:986 msgid "Interrupt: " msgstr "Interruzione: " diff --git a/src/nvim/po/ja.euc-jp.po b/src/nvim/po/ja.euc-jp.po index 85042e3506..e8d60d4438 100644 --- a/src/nvim/po/ja.euc-jp.po +++ b/src/nvim/po/ja.euc-jp.po @@ -4258,10 +4258,6 @@ msgstr "¹Ô %4ld:" msgid "E354: Invalid register name: '%s'" msgstr "E354: ̵¸ú¤Ê¥ì¥¸¥¹¥¿Ì¾: '%s'" -#: ../message.c:745 -msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>" -msgstr "ÆüËܸì¥á¥Ã¥»¡¼¥¸ËÝÌõ/´Æ½¤: ¼²¬ ÂÀϺ <koron.kaoriya@gmail.com>" - #: ../message.c:986 msgid "Interrupt: " msgstr "³ä¹þ¤ß: " diff --git a/src/nvim/po/ja.po b/src/nvim/po/ja.po index 0326f33bb5..fd3690f9bf 100644 --- a/src/nvim/po/ja.po +++ b/src/nvim/po/ja.po @@ -4257,10 +4257,6 @@ msgstr "行 %4ld:" msgid "E354: Invalid register name: '%s'" msgstr "E354: 無効ãªãƒ¬ã‚¸ã‚¹ã‚¿å: '%s'" -#: ../message.c:745 -msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>" -msgstr "日本語メッセージ翻訳/監修: æ‘岡 太郎 <koron.kaoriya@gmail.com>" - #: ../message.c:986 msgid "Interrupt: " msgstr "割込ã¿: " diff --git a/src/nvim/po/ja.sjis.po b/src/nvim/po/ja.sjis.po index 16a5d2ce36..c9fd35292c 100644 --- a/src/nvim/po/ja.sjis.po +++ b/src/nvim/po/ja.sjis.po @@ -4261,10 +4261,6 @@ msgstr "s %4ld:" msgid "E354: Invalid register name: '%s'" msgstr "E354: –³Œø‚ȃŒƒWƒXƒ^–¼: '%s'" -#: ../message.c:745 -msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>" -msgstr "“ú–{ŒêƒƒbƒZ[ƒW–|–ó/ŠÄC: ‘º‰ª ‘¾˜Y <koron.kaoriya@gmail.com>" - #: ../message.c:986 msgid "Interrupt: " msgstr "Š„ž‚Ý: " diff --git a/src/nvim/po/ko.UTF-8.po b/src/nvim/po/ko.UTF-8.po index 149286eda8..3ed659208b 100644 --- a/src/nvim/po/ko.UTF-8.po +++ b/src/nvim/po/ko.UTF-8.po @@ -4224,10 +4224,6 @@ msgstr "%4ld 줄:" msgid "E354: Invalid register name: '%s'" msgstr "E354: ìž˜ëª»ëœ ë ˆì§€ìŠ¤í„° ì´ë¦„: '%s'" -#: ../message.c:745 -msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>" -msgstr "메시지 관리ìž: Bram Moolenaar <Bram@vim.org>" - #: ../message.c:986 msgid "Interrupt: " msgstr "중단: " diff --git a/src/nvim/po/ko.po b/src/nvim/po/ko.po index b6aaf37bbb..e97e90642c 100644 --- a/src/nvim/po/ko.po +++ b/src/nvim/po/ko.po @@ -4224,10 +4224,6 @@ msgstr "%4ld ÁÙ:" msgid "E354: Invalid register name: '%s'" msgstr "E354: À߸øµÈ ·¹Áö½ºÅÍ À̸§: '%s'" -#: ../message.c:745 -msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>" -msgstr "¸Þ½ÃÁö °ü¸®ÀÚ: Bram Moolenaar <Bram@vim.org>" - #: ../message.c:986 msgid "Interrupt: " msgstr "Áß´Ü: " diff --git a/src/nvim/po/nb.po b/src/nvim/po/nb.po index ce635e098c..76e42ddcd6 100644 --- a/src/nvim/po/nb.po +++ b/src/nvim/po/nb.po @@ -4275,11 +4275,6 @@ msgstr "linje %4ld:" msgid "E354: Invalid register name: '%s'" msgstr "E354: Ugyldig registernavn: '%s'" -#: ../message.c:745 -msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>" -msgstr "" -"Vedlikeholder for norsk oversettelse: Øyvind A. Holm <sunny@sunbase.org>" - #: ../message.c:986 msgid "Interrupt: " msgstr "Avbryt: " diff --git a/src/nvim/po/nl.po b/src/nvim/po/nl.po index ea609c0f69..6013b847cb 100644 --- a/src/nvim/po/nl.po +++ b/src/nvim/po/nl.po @@ -4282,10 +4282,6 @@ msgstr "regel %4ld:" msgid "E354: Invalid register name: '%s'" msgstr "" -#: ../message.c:745 -msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>" -msgstr "Vertaald door: Erwin Poeze <erwin.poeze@gmail.com>" - #: ../message.c:986 msgid "Interrupt: " msgstr "" diff --git a/src/nvim/po/no.po b/src/nvim/po/no.po index ce635e098c..76e42ddcd6 100644 --- a/src/nvim/po/no.po +++ b/src/nvim/po/no.po @@ -4275,11 +4275,6 @@ msgstr "linje %4ld:" msgid "E354: Invalid register name: '%s'" msgstr "E354: Ugyldig registernavn: '%s'" -#: ../message.c:745 -msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>" -msgstr "" -"Vedlikeholder for norsk oversettelse: Øyvind A. Holm <sunny@sunbase.org>" - #: ../message.c:986 msgid "Interrupt: " msgstr "Avbryt: " diff --git a/src/nvim/po/pl.UTF-8.po b/src/nvim/po/pl.UTF-8.po index 68cb9e72d5..2536efb422 100644 --- a/src/nvim/po/pl.UTF-8.po +++ b/src/nvim/po/pl.UTF-8.po @@ -4243,10 +4243,6 @@ msgstr "wiersz %4ld:" msgid "E354: Invalid register name: '%s'" msgstr "E354: NiewÅ‚aÅ›ciwa nazwa rejestru: '%s'" -#: ../message.c:745 -msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>" -msgstr "Opiekun komunikatów: MikoÅ‚aj Machowski <mikmach@wp.pl>" - #: ../message.c:986 msgid "Interrupt: " msgstr "Przerwanie: " diff --git a/src/nvim/po/pl.cp1250.po b/src/nvim/po/pl.cp1250.po index 3fcdbfb87d..30835637d0 100644 --- a/src/nvim/po/pl.cp1250.po +++ b/src/nvim/po/pl.cp1250.po @@ -4243,10 +4243,6 @@ msgstr "wiersz %4ld:" msgid "E354: Invalid register name: '%s'" msgstr "E354: Niew³aœciwa nazwa rejestru: '%s'" -#: ../message.c:745 -msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>" -msgstr "Opiekun komunikatów: Miko³aj Machowski <mikmach@wp.pl>" - #: ../message.c:986 msgid "Interrupt: " msgstr "Przerwanie: " diff --git a/src/nvim/po/pl.po b/src/nvim/po/pl.po index 2a2d12daac..c5734f0c49 100644 --- a/src/nvim/po/pl.po +++ b/src/nvim/po/pl.po @@ -4243,10 +4243,6 @@ msgstr "wiersz %4ld:" msgid "E354: Invalid register name: '%s'" msgstr "E354: Niew³a¶ciwa nazwa rejestru: '%s'" -#: ../message.c:745 -msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>" -msgstr "Opiekun komunikatów: Miko³aj Machowski <mikmach@wp.pl>" - #: ../message.c:986 msgid "Interrupt: " msgstr "Przerwanie: " diff --git a/src/nvim/po/ru.cp1251.po b/src/nvim/po/ru.cp1251.po index 29e8c83ee6..b1005bd0e6 100644 --- a/src/nvim/po/ru.cp1251.po +++ b/src/nvim/po/ru.cp1251.po @@ -4283,12 +4283,6 @@ msgstr "ñòðîêà %4ld:" msgid "E354: Invalid register name: '%s'" msgstr "E354: Íåäîïóñòèìîå èìÿ ðåãèñòðà: '%s'" -#: ../message.c:745 -msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>" -msgstr "" -"Ïåðåâîä ñîîáùåíèé íà ðóññêèé ÿçûê: Âàñèëèé Ðàãîçèí <vrr@users.sourceforge." -"net>, Ñåðãåé Àë¸øèí <alyoshin.s@gmail.com>" - #: ../message.c:986 msgid "Interrupt: " msgstr "Ïðåðûâàíèå: " diff --git a/src/nvim/po/ru.po b/src/nvim/po/ru.po index c8146e8c47..2511ef2c46 100644 --- a/src/nvim/po/ru.po +++ b/src/nvim/po/ru.po @@ -4281,12 +4281,6 @@ msgstr "Ñтрока %4ld:" msgid "E354: Invalid register name: '%s'" msgstr "E354: ÐедопуÑтимое Ð¸Ð¼Ñ Ñ€ÐµÐ³Ð¸Ñтра: '%s'" -#: ../message.c:745 -msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>" -msgstr "" -"Перевод Ñообщений на руÑÑкий Ñзык: ВаÑилий Рагозин <vrr@users.sourceforge." -"net>, Сергей Ðлёшин <alyoshin.s@gmail.com>" - #: ../message.c:986 msgid "Interrupt: " msgstr "Прерывание: " diff --git a/src/nvim/po/sk.cp1250.po b/src/nvim/po/sk.cp1250.po index e3b7508cdc..b1b0bb6ade 100644 --- a/src/nvim/po/sk.cp1250.po +++ b/src/nvim/po/sk.cp1250.po @@ -4273,10 +4273,6 @@ msgstr "riadok %4ld:" msgid "E354: Invalid register name: '%s'" msgstr "E354: '%s' nie je prístupné meno registru" -#: ../message.c:745 -msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>" -msgstr "Správca prekladu: Lubomir Host <rajo@platon.sk>" - #: ../message.c:986 msgid "Interrupt: " msgstr "Prerušenie: " diff --git a/src/nvim/po/sk.po b/src/nvim/po/sk.po index 53f8a7b911..206e3e3ef6 100644 --- a/src/nvim/po/sk.po +++ b/src/nvim/po/sk.po @@ -4273,10 +4273,6 @@ msgstr "riadok %4ld:" msgid "E354: Invalid register name: '%s'" msgstr "E354: '%s' nie je prístupné meno registru" -#: ../message.c:745 -msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>" -msgstr "Správca prekladu: Lubomir Host <rajo@platon.sk>" - #: ../message.c:986 msgid "Interrupt: " msgstr "Preru¹enie: " diff --git a/src/nvim/po/uk.cp1251.po b/src/nvim/po/uk.cp1251.po index 2c6f3423ae..99d1763262 100644 --- a/src/nvim/po/uk.cp1251.po +++ b/src/nvim/po/uk.cp1251.po @@ -21,204 +21,157 @@ msgstr "" "Content-Type: text/plain; charset=cp1251\n" "Content-Transfer-Encoding: 8bit\n" -#: ../api/private/helpers.c:201 -#, fuzzy msgid "Unable to get option value" -msgstr "íå âäàëîñÿ îòðèìàòè çíà÷åííÿ îïö³¿" +msgstr "Íå âäàëîñÿ îòðèìàòè çíà÷åííÿ îïö³¿" -#: ../api/private/helpers.c:204 msgid "internal error: unknown option type" msgstr "âíóòð³øíÿ ïîìèëêà: íåâ³äîìèé òèï îïö³¿" -#: ../buffer.c:92 msgid "[Location List]" msgstr "[Ñïèñîê ì³ñöü]" -#: ../buffer.c:93 msgid "[Quickfix List]" msgstr "[Ñïèñîê âèïðàâëåíü]" -#: ../buffer.c:94 msgid "E855: Autocommands caused command to abort" msgstr "E855: Àâòîêîìàíäè ïðèçâåëè äî ñêàñóâàííÿ êîìàíäè" -#: ../buffer.c:135 msgid "E82: Cannot allocate any buffer, exiting..." msgstr "E82: Íåìຠìîæëèâîñò³ ðîçì³ñòèòè õî÷ îäèí áóôåð, çàâåðøåííÿ ðîáîòè..." -#: ../buffer.c:138 msgid "E83: Cannot allocate buffer, using other one..." msgstr "E83: Íåìຠìîæëèâîñò³ ðîçì³ñòèòè áóôåð, áóäå âèêîðèñòàíî ³íøèé..." -#: ../buffer.c:763 msgid "E515: No buffers were unloaded" msgstr "E515: Æîäåí ç áóôåð³â íå áóâ âèâàíòàæåíèé" -#: ../buffer.c:765 msgid "E516: No buffers were deleted" msgstr "E516: Æîäåí ç áóôåð³â íå çíèùåíî" -#: ../buffer.c:767 msgid "E517: No buffers were wiped out" msgstr "E517: Æîäåí ç áóôåð³â íå âèòåðòî" -#: ../buffer.c:772 msgid "1 buffer unloaded" msgstr "Âèâàíòàæåíî îäèí áóôåð" -#: ../buffer.c:774 #, c-format msgid "%d buffers unloaded" msgstr "Âèâàíòàæåíî %d áóôåðè(³â)" -#: ../buffer.c:777 msgid "1 buffer deleted" msgstr "Çíèùåíî îäèí áóôåð" -#: ../buffer.c:779 #, c-format msgid "%d buffers deleted" msgstr "Çíèùåíî %d áóôåðè(³â)" -#: ../buffer.c:782 msgid "1 buffer wiped out" msgstr "Âèòåðòî îäèí áóôåð" -#: ../buffer.c:784 #, c-format msgid "%d buffers wiped out" msgstr "Âèòåðòî %d áóôåðè(³â)" -#: ../buffer.c:806 msgid "E90: Cannot unload last buffer" msgstr "E90: Íå ìîæó âèâàíòàæèòè îñòàíí³é áóôåð" -#: ../buffer.c:874 msgid "E84: No modified buffer found" msgstr "E84: Æîäåí áóôåð íå çì³íåíî" #. back where we started, didn't find anything. -#: ../buffer.c:903 msgid "E85: There is no listed buffer" msgstr "E85: Ó ñïèñêó íåìຠáóôåð³â" -#: ../buffer.c:913 #, c-format msgid "E86: Buffer %<PRId64> does not exist" msgstr "E86: Áóôåðà %<PRId64> íåìàº" -#: ../buffer.c:915 msgid "E87: Cannot go beyond last buffer" msgstr "E87: Öå âæå îñòàíí³é áóôåð" -#: ../buffer.c:917 msgid "E88: Cannot go before first buffer" msgstr "E88: Öå âæå íàéïåðøèé áóôåð" -#: ../buffer.c:945 #, c-format msgid "" "E89: No write since last change for buffer %<PRId64> (add ! to override)" msgstr "E89: Áóôåð %<PRId64> ìຠçì³íè (! ùîá íå çâàæàòè)" #. wrap around (may cause duplicates) -#: ../buffer.c:1423 msgid "W14: Warning: List of file names overflow" msgstr "W14: Îáåðåæíî: Ñïèñîê íàçâ ôàéë³â ïåðåïîâíåíî" -#: ../buffer.c:1555 ../quickfix.c:3361 #, c-format msgid "E92: Buffer %<PRId64> not found" msgstr "E92: Áóôåð %<PRId64> íå çíàéäåíî" -#: ../buffer.c:1798 #, c-format msgid "E93: More than one match for %s" msgstr "E93: Çíàéäåíî ê³ëüêà çá³ã³â ç %s" -#: ../buffer.c:1800 #, c-format msgid "E94: No matching buffer for %s" msgstr "E94: Íå çíàéäåíî áóôåð, ñõîæèé íà %s" -#: ../buffer.c:2161 #, c-format msgid "line %<PRId64>" msgstr "ðÿäîê %<PRId64>" -#: ../buffer.c:2233 msgid "E95: Buffer with this name already exists" msgstr "E95: Áóôåð ç òàêîþ íàçâîþ âæå ³ñíóº" -#: ../buffer.c:2498 msgid " [Modified]" msgstr " [Çì³íåíî]" -#: ../buffer.c:2501 msgid "[Not edited]" msgstr "[Íå ðåäàãîâàíî]" -#: ../buffer.c:2504 msgid "[New file]" msgstr "[Íîâèé ôàéë]" -#: ../buffer.c:2505 msgid "[Read errors]" msgstr "[Ïîìèëêè ÷èòàííÿ]" -#: ../buffer.c:2506 ../buffer.c:3217 ../fileio.c:1807 ../screen.c:4895 msgid "[RO]" msgstr "[RO]" -#: ../buffer.c:2507 ../fileio.c:1807 msgid "[readonly]" msgstr "[ëèøå ÷èòàòè]" -#: ../buffer.c:2524 #, c-format msgid "1 line --%d%%--" msgstr "îäèí ðÿäîê --%d%%--" -#: ../buffer.c:2526 #, c-format msgid "%<PRId64> lines --%d%%--" msgstr "%<PRId64> ðÿäêè(³â) --%d%%--" -#: ../buffer.c:2530 #, c-format msgid "line %<PRId64> of %<PRId64> --%d%%-- col " msgstr "ðÿäîê %<PRId64> ç %<PRId64> --%d%%-- êîëîíêà " -#: ../buffer.c:2632 ../buffer.c:4292 ../memline.c:1554 msgid "[No Name]" msgstr "[Áåç íàçâè]" #. must be a help buffer -#: ../buffer.c:2667 msgid "help" msgstr "äîïîìîãà" -#: ../buffer.c:3225 ../screen.c:4883 msgid "[Help]" msgstr "[Äîïîìîãà]" -#: ../buffer.c:3254 ../screen.c:4887 msgid "[Preview]" msgstr "[Ïåðåãëÿä]" -#: ../buffer.c:3528 msgid "All" msgstr "Óñå" -#: ../buffer.c:3528 msgid "Bot" msgstr "Çíèçó" -#: ../buffer.c:3531 msgid "Top" msgstr "Âãîð³" -#: ../buffer.c:4244 msgid "" "\n" "# Buffer list:\n" @@ -226,11 +179,9 @@ msgstr "" "\n" "# Ñïèñîê áóôåð³â:\n" -#: ../buffer.c:4289 msgid "[Scratch]" msgstr "[Ç íóëÿ]" -#: ../buffer.c:4529 msgid "" "\n" "--- Signs ---" @@ -238,202 +189,155 @@ msgstr "" "\n" "--- Ïîçíà÷êè ---" -#: ../buffer.c:4538 #, c-format msgid "Signs for %s:" msgstr "Ïîçíà÷êè äëÿ %s:" -#: ../buffer.c:4543 #, c-format msgid " line=%<PRId64> id=%d name=%s" msgstr " ðÿäîê=%<PRId64> id=%d íàçâà=%s" -#: ../cursor_shape.c:68 msgid "E545: Missing colon" msgstr "E545: Ïðîïóùåíî äâîêðàïêó" -#: ../cursor_shape.c:70 ../cursor_shape.c:94 msgid "E546: Illegal mode" msgstr "E546: Íåïðàâèëüíèé ðåæèì" -#: ../cursor_shape.c:134 msgid "E548: digit expected" msgstr "E548: Ïîòð³áíà öèôðà" -#: ../cursor_shape.c:138 msgid "E549: Illegal percentage" msgstr "E549: Íåïðàâèëüíèé â³äñîòîê" -#: ../diff.c:146 #, c-format msgid "E96: Can not diff more than %<PRId64> buffers" msgstr "E96: Íå ìîæíà ïîð³âíþâàòè ïîíàä %<PRId64> áóôåðè(³â)" -#: ../diff.c:753 msgid "E810: Cannot read or write temp files" msgstr "E810: Íå ìîæíà ÷èòàòè ÷è çàïèñóâàòè òèì÷àñîâ³ ôàéëè" -#: ../diff.c:755 msgid "E97: Cannot create diffs" msgstr "E97: Íå âäàëîñÿ ñòâîðèòè ïîð³âíÿííÿ" -#: ../diff.c:966 msgid "E816: Cannot read patch output" msgstr "E816: Íå âäàëîñÿ ïðî÷èòàòè ðåçóëüòàò patch" -#: ../diff.c:1220 msgid "E98: Cannot read diff output" msgstr "E98: Íå âäàëîñÿ ïðî÷èòàòè ðåçóëüòàò diff" -#: ../diff.c:2081 msgid "E99: Current buffer is not in diff mode" msgstr "E99: Öåé áóôåð íå â ðåæèì³ ïîð³âíÿííÿ" -#: ../diff.c:2100 msgid "E793: No other buffer in diff mode is modifiable" msgstr "E793: Íåìຠá³ëüøå ìîäèô³êîâíèõ áóôåð³â â ðåæèì³ ïîð³âíÿííÿ" -#: ../diff.c:2102 msgid "E100: No other buffer in diff mode" msgstr "E100: Íåìຠ³íøèõ áóôåð³â â ðåæèì³ ïîð³âíÿííÿ" -#: ../diff.c:2112 msgid "E101: More than two buffers in diff mode, don't know which one to use" msgstr "" "E101: Ïîíàä äâà áóôåðè ó ðåæèì³ ïîð³âíÿííÿ, íå çðîçóì³ëî, êîòðèé ³ç íèõ " "âèêîðèñòàòè" -#: ../diff.c:2141 #, c-format msgid "E102: Can't find buffer \"%s\"" msgstr "E102: Íå âäàëîñÿ çíàéòè áóôåð «%s»" -#: ../diff.c:2152 #, c-format msgid "E103: Buffer \"%s\" is not in diff mode" msgstr "E103: Áóôåð «%s» íå â ðåæèì³ ïîð³âíÿííÿ" -#: ../diff.c:2193 msgid "E787: Buffer changed unexpectedly" msgstr "E787: Áóôåð íåñïîä³âàíî çì³íèâñÿ" -#: ../digraph.c:1598 msgid "E104: Escape not allowed in digraph" msgstr "E104: Ó äèãðàôàõ íå ìîæå ì³ñòèòèñÿ escape" -#: ../digraph.c:1760 msgid "E544: Keymap file not found" msgstr "E544: Íå çíàéäåíî ôàéë ðîçêëàäêè" -#: ../digraph.c:1785 msgid "E105: Using :loadkeymap not in a sourced file" msgstr "E105: :loadkeymap âèêîðèñòàíî íå ó ôàéë³ êîìàíä" -#: ../digraph.c:1821 msgid "E791: Empty keymap entry" msgstr "E791: Åëåìåíò ðîçêëàäêè ïîðîæí³é" -#: ../edit.c:82 msgid " Keyword completion (^N^P)" msgstr " Äîïîâíåííÿ êëþ÷îâèõ ñë³â (^N^P)" #. ctrl_x_mode == 0, ^P/^N compl. -#: ../edit.c:83 msgid " ^X mode (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y)" msgstr " Ðåæèì ^X (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y)" -#: ../edit.c:85 msgid " Whole line completion (^L^N^P)" msgstr " Äîïîâíåííÿ óñüîãî ðÿäêà (^L^N^P)" -#: ../edit.c:86 msgid " File name completion (^F^N^P)" msgstr " Äîïîâíåííÿ íàçâè ôàéëó (^F^N^P)" -#: ../edit.c:87 msgid " Tag completion (^]^N^P)" msgstr " Äîïîâíåííÿ òå´³â (^]^N^P)" -#: ../edit.c:88 msgid " Path pattern completion (^N^P)" msgstr " Äîïîâíåííÿ øëÿõó çà çðàçêîì (^N^P)" -#: ../edit.c:89 msgid " Definition completion (^D^N^P)" msgstr " Äîïîâíåííÿ âèçíà÷åííÿ (^D^N^P)" -#: ../edit.c:91 msgid " Dictionary completion (^K^N^P)" msgstr " Äîïîâíåííÿ ç³ ñëîâíèêà (^K^N^P)" -#: ../edit.c:92 msgid " Thesaurus completion (^T^N^P)" msgstr " Äîïîâíåííÿ ç òåçàóðóñó (^T^N^P)" -#: ../edit.c:93 msgid " Command-line completion (^V^N^P)" msgstr " Äîïîâíåííÿ êîìàíä (^V^N^P)" -#: ../edit.c:94 msgid " User defined completion (^U^N^P)" msgstr " Êîðèñòóâàöüêå äîïîâíåííÿ (^U^N^P)" -#: ../edit.c:95 msgid " Omni completion (^O^N^P)" msgstr " Êì³òëèâå äîïîâíåííÿ (^O^N^P)" -#: ../edit.c:96 msgid " Spelling suggestion (s^N^P)" msgstr " Îðôîãðàô³÷íà ï³äêàçêà (s^N^P)" -#: ../edit.c:97 msgid " Keyword Local completion (^N^P)" msgstr " Äîïîâíåííÿ ì³ñöåâèõ êëþ÷îâèõ ñë³â (^N^P)" -#: ../edit.c:100 msgid "Hit end of paragraph" msgstr "Òðàïèâñÿ ê³íåöü ïàðàãðàôà" # msgstr "E443: " -#: ../edit.c:101 msgid "E839: Completion function changed window" msgstr "E839: Ôóíêö³ÿ äîïîâíåííÿ çì³íèëà â³êíî" -#: ../edit.c:102 msgid "E840: Completion function deleted text" msgstr "E840: Ôóíêö³ÿ äîïîâíåííÿ çíèùèëà òåêñò" -#: ../edit.c:1847 msgid "'dictionary' option is empty" msgstr "Îïö³ÿ 'dictionary' ïîðîæíÿ" -#: ../edit.c:1848 msgid "'thesaurus' option is empty" msgstr "Îïö³ÿ 'thesaurus' ïîðîæíÿ" -#: ../edit.c:2655 #, c-format msgid "Scanning dictionary: %s" msgstr "Ñêàíóºòüñÿ ñëîâíèê: %s" -#: ../edit.c:3079 msgid " (insert) Scroll (^E/^Y)" msgstr " (âñòàâêà) Ïðîãîðíóòè (^E/^Y)" -#: ../edit.c:3081 msgid " (replace) Scroll (^E/^Y)" msgstr " (çàì³íà) Ïðîãîðíóòè (^E/^Y)" -#: ../edit.c:3587 #, c-format msgid "Scanning: %s" msgstr "Ïîøóê ó: %s" -#: ../edit.c:3614 msgid "Scanning tags." msgstr "Ïîøóê ñåðåä òå´³â." -#: ../edit.c:4519 msgid " Adding" msgstr " Äîäàºòüñÿ" @@ -441,598 +345,468 @@ msgstr " Äîäàºòüñÿ" #. * be called before line = ml_get(), or when this address is no #. * longer needed. -- Acevedo. #. -#: ../edit.c:4562 msgid "-- Searching..." msgstr "-- Ïîøóê..." -#: ../edit.c:4618 msgid "Back at original" msgstr "Ïî÷àòêîâèé âàð³àíò" -#: ../edit.c:4621 msgid "Word from other line" msgstr "Ñëîâî ç ³íøîãî ðÿäêà" -#: ../edit.c:4624 msgid "The only match" msgstr "ªäèíèé çá³ã" -#: ../edit.c:4680 #, c-format msgid "match %d of %d" msgstr "çá³ã %d ç %d" -#: ../edit.c:4684 #, c-format msgid "match %d" msgstr "çá³ã %d" # msgstr "E17: " -#: ../eval.c:137 msgid "E18: Unexpected characters in :let" msgstr "E18: Íåî÷³êóâàí³ ñèìâîëè ó :let" -#: ../eval.c:138 #, c-format msgid "E684: list index out of range: %<PRId64>" msgstr "E684: ²íäåêñ ñïèñêó ïîçà ìåæàìè: %<PRId64>" -#: ../eval.c:139 #, c-format msgid "E121: Undefined variable: %s" msgstr "E121: Íåâèçíà÷åíà çì³ííà: %s" -#: ../eval.c:140 msgid "E111: Missing ']'" msgstr "E111: Áðàêóº ']'" -#: ../eval.c:141 #, c-format msgid "E686: Argument of %s must be a List" msgstr "E686: Àðãóìåíò ó %s ìຠáóòè ñïèñêîì" -#: ../eval.c:143 #, c-format msgid "E712: Argument of %s must be a List or Dictionary" msgstr "E712: Àðãóìåíò ó %s ìຠáóòè ñïèñêîì ÷è ñëîâíèêîì" -#: ../eval.c:144 msgid "E713: Cannot use empty key for Dictionary" msgstr "E713: Êëþ÷ ñëîâíèêà íå ìîæå áóòè ïîðîæí³ì" # msgstr "E396: " -#: ../eval.c:145 msgid "E714: List required" msgstr "E714: Ïîòð³áåí ñïèñîê" -#: ../eval.c:146 msgid "E715: Dictionary required" msgstr "E715: Ïîòð³áåí ñëîâíèê" -#: ../eval.c:147 #, c-format msgid "E118: Too many arguments for function: %s" msgstr "E118: Çàáàãàòî àðãóìåíò³â äëÿ ôóíêö³¿: %s" -#: ../eval.c:148 #, c-format msgid "E716: Key not present in Dictionary: %s" msgstr "E716: Íåìຠòàêîãî êëþ÷à ó ñëîâíèêó: %s" -#: ../eval.c:150 #, c-format msgid "E122: Function %s already exists, add ! to replace it" msgstr "E122: Ôóíêö³ÿ %s óæå ³ñíóº, ! ùîá çàì³íèòè" -#: ../eval.c:151 msgid "E717: Dictionary entry already exists" msgstr "E717: Çàïèñ ó ñëîâíèêó âæå ³ñíóº" -#: ../eval.c:152 msgid "E718: Funcref required" msgstr "E718: Òðåáà ïîñèëàííÿ íà ôóíêö³þ" -#: ../eval.c:153 msgid "E719: Cannot use [:] with a Dictionary" msgstr "E719: Íå ìîæíà âèêîðèñòàòè [:] ç³ ñëîâíèêîì" -#: ../eval.c:154 #, c-format msgid "E734: Wrong variable type for %s=" msgstr "E734: Íåïðàâèëüíèé òèï çì³ííî¿ äëÿ %s=" -#: ../eval.c:155 #, c-format msgid "E130: Unknown function: %s" msgstr "E130: Íåâ³äîìà ôóíêö³ÿ: %s" -#: ../eval.c:156 #, c-format msgid "E461: Illegal variable name: %s" msgstr "E461: Íåïðèïóñòèìà íàçâà çì³ííî¿: %s" # msgstr "E373: " -#: ../eval.c:157 msgid "E806: using Float as a String" msgstr "E806: Float âæèòî ÿê String" -#: ../eval.c:1830 msgid "E687: Less targets than List items" msgstr "E687: Ö³ëåé ìåíøå, í³æ åëåìåíò³â ñïèñêó" -#: ../eval.c:1834 msgid "E688: More targets than List items" msgstr "E688: Ö³ëåé á³ëüøå, í³æ åëåìåíò³â ñïèñêó" -#: ../eval.c:1906 msgid "Double ; in list of variables" msgstr "Äðóãà ; ó ñïèñêó çì³ííèõ" # msgstr "E235: " -#: ../eval.c:2078 #, c-format msgid "E738: Can't list variables for %s" msgstr "E738: Íå ìîæíà ïåðåðàõóâàòè çì³íí³ ó %s" -#: ../eval.c:2391 msgid "E689: Can only index a List or Dictionary" msgstr "E689: ²íäåêñíèé äîñòóï ìîæå áóòè ò³ëüêè äî ñïèñêó ÷è ñëîâíèêà" -#: ../eval.c:2396 msgid "E708: [:] must come last" msgstr "E708: [:] ìຠáóòè îñòàííüîþ" -#: ../eval.c:2439 msgid "E709: [:] requires a List value" msgstr "E709: [:] âèìàãຠñïèñîê" -#: ../eval.c:2674 msgid "E710: List value has more items than target" msgstr "E710: Ñïèñîê ìຠá³ëüøå åëåìåíò³â, í³æ ö³ëü" -#: ../eval.c:2678 msgid "E711: List value has not enough items" msgstr "E711: Ñïèñîê ìຠíåäîñòàòíüî åëåìåíò³â" -#: ../eval.c:2867 msgid "E690: Missing \"in\" after :for" msgstr "E690: Ïðîïóùåíî «in» ï³ñëÿ :for" -#: ../eval.c:3063 #, c-format msgid "E107: Missing parentheses: %s" msgstr "E107: Ïðîïóùåíî äóæêè: %s" -#: ../eval.c:3263 #, c-format msgid "E108: No such variable: \"%s\"" msgstr "E108: Çì³ííî¿ íåìàº: «%s»" -#: ../eval.c:3333 msgid "E743: variable nested too deep for (un)lock" msgstr "E743: Çì³ííà ìຠçàáàãàòî âêëàäåíü ùîá áóòè çà-/â³äêðèòîþ." -#: ../eval.c:3630 msgid "E109: Missing ':' after '?'" msgstr "E109: Áðàêóº ':' ï³ñëÿ '?'" -#: ../eval.c:3893 msgid "E691: Can only compare List with List" msgstr "E691: Ñïèñîê ìîæíà ïîð³âíÿòè ò³ëüêè ç³ ñïèñêîì" -#: ../eval.c:3895 msgid "E692: Invalid operation for Lists" msgstr "E692: Íåêîðåêòíà îïåðàö³ÿ íàä ñïèñêîì" -#: ../eval.c:3915 msgid "E735: Can only compare Dictionary with Dictionary" msgstr "E735: Ñëîâíèê ìîæíà ïîð³âíÿòè ò³ëüêè ³ç ñëîâíèêîì" -#: ../eval.c:3917 msgid "E736: Invalid operation for Dictionary" msgstr "E736: Íåêîðåêòíà îïåðàö³ÿ íàä ñëîâíèêîì" -#: ../eval.c:3932 msgid "E693: Can only compare Funcref with Funcref" msgstr "E693: Ôóíêö³þ ìîæíà ïîð³âíÿòè ò³ëüêè ç ôóíêö³ºþ" -#: ../eval.c:3934 msgid "E694: Invalid operation for Funcrefs" msgstr "E694: Íåêîðåêòíà îïåðàö³ÿ íàä ôóíêö³ºþ" -#: ../eval.c:4277 msgid "E804: Cannot use '%' with Float" msgstr "E804: Íå ìîæíà âèêîíàòè '%' íàä Float" -#: ../eval.c:4478 msgid "E110: Missing ')'" msgstr "E110: Ïðîïóùåíî ')'" -#: ../eval.c:4609 msgid "E695: Cannot index a Funcref" msgstr "E695: Ôóíêö³ÿ íå ìຠ³íäåêñàö³¿" -#: ../eval.c:4839 #, c-format msgid "E112: Option name missing: %s" msgstr "E112: Áðàêóº íàçâè îïö³¿: %s" -#: ../eval.c:4855 #, c-format msgid "E113: Unknown option: %s" msgstr "E113: Íåâ³äîìà îïö³ÿ: %s" -#: ../eval.c:4904 #, c-format msgid "E114: Missing quote: %s" msgstr "E114: Áðàêóº ëàïêè: %s" -#: ../eval.c:5020 #, c-format msgid "E115: Missing quote: %s" msgstr "E115: Áðàêóº ëàïêè: %s" # msgstr "E404: " -#: ../eval.c:5084 #, c-format msgid "E696: Missing comma in List: %s" msgstr "E696: Áðàêóº êîìè ó ñïèñêó: %s" -#: ../eval.c:5091 #, c-format msgid "E697: Missing end of List ']': %s" msgstr "E697: Íåìຠê³íö³âêè ñïèñêó ']': %s" # msgstr "E235: " -#: ../eval.c:6475 #, c-format msgid "E720: Missing colon in Dictionary: %s" msgstr "E720: Áðàêóº äâîêðàïêè ó ñëîâíèêó: %s" -#: ../eval.c:6499 #, c-format msgid "E721: Duplicate key in Dictionary: \"%s\"" msgstr "E721: Ïîâòîðåííÿ êëþ÷à â ñëîâíèêó: «%s»" # msgstr "E235: " -#: ../eval.c:6517 #, c-format msgid "E722: Missing comma in Dictionary: %s" msgstr "E722: Áðàêóº êîìè ó ñëîâíèêó: %s" -#: ../eval.c:6524 #, c-format msgid "E723: Missing end of Dictionary '}': %s" msgstr "E723: Íåìຠê³íö³âêè ñëîâíèêà '}': %s" # msgstr "E21: " -#: ../eval.c:6555 msgid "E724: variable nested too deep for displaying" msgstr "E724: Ó çì³íí³é çàáàãàòî âêëàäåíü ùîá ¿¿ ïîêàçàòè" -#: ../eval.c:7188 #, c-format msgid "E740: Too many arguments for function %s" msgstr "E740: Çàáàãàòî àðãóìåíò³â äëÿ ôóíêö³¿ %s" -#: ../eval.c:7190 #, c-format msgid "E116: Invalid arguments for function %s" msgstr "E116: Íåïðàâèëüí³ àðãóìåíòè ôóíêö³¿ %s" -#: ../eval.c:7377 #, c-format msgid "E117: Unknown function: %s" msgstr "E117: Íåâ³äîìà ôóíêö³ÿ: %s" -#: ../eval.c:7383 #, c-format msgid "E119: Not enough arguments for function: %s" msgstr "E119: Çàìàëî àðãóìåíò³â äëÿ ôóíêö³¿ %s" -#: ../eval.c:7387 #, c-format msgid "E120: Using <SID> not in a script context: %s" msgstr "E120: <SID> âèêîðèñòîâóºòüñÿ íå ó êîíòåêñò³ ñêðèïòó: %s" -#: ../eval.c:7391 #, c-format msgid "E725: Calling dict function without Dictionary: %s" msgstr "E725: Âèêëèê dict-ôóíêö³¿ áåç ñëîâíèêà: %s" -#: ../eval.c:7453 msgid "E808: Number or Float required" msgstr "E808: Òðåáà âêàçàòè Number ÷è Float" # msgstr "E14: " -#: ../eval.c:7503 msgid "add() argument" msgstr "àðãóìåíò add()" -#: ../eval.c:7907 msgid "E699: Too many arguments" msgstr "E699: Çàáàãàòî àðãóìåíò³â" # msgstr "E327: " -#: ../eval.c:8073 msgid "E785: complete() can only be used in Insert mode" msgstr "E785: complete() ìîæíà âæèâàòè ò³ëüêè â ðåæèì³ âñòàâêè" -#: ../eval.c:8156 msgid "&Ok" msgstr "&O:Ãàðàçä" # msgstr "E226: " -#: ../eval.c:8676 #, c-format msgid "E737: Key already exists: %s" msgstr "E737: Êëþ÷ âæå ³ñíóº: %s" # msgstr "E14: " -#: ../eval.c:8692 msgid "extend() argument" msgstr "àðãóìåíò extend()" # msgstr "E14: " -#: ../eval.c:8915 msgid "map() argument" msgstr "àðãóìåíò map()" # msgstr "E14: " -#: ../eval.c:8916 msgid "filter() argument" msgstr "àðãóìåíò filter()" -#: ../eval.c:9229 #, c-format msgid "+-%s%3ld lines: " msgstr "+-%s%3ld ðÿäê³â: " -#: ../eval.c:9291 #, c-format msgid "E700: Unknown function: %s" msgstr "E700: Íåâ³äîìà ôóíêö³ÿ: %s" -#: ../eval.c:10729 msgid "called inputrestore() more often than inputsave()" msgstr "Âèêëèêè äî inputrestore() ÷àñò³øå, í³æ äî inputsave()" # msgstr "E14: " -#: ../eval.c:10771 msgid "insert() argument" msgstr "àðãóìåíò insert()" # msgstr "E406: " -#: ../eval.c:10841 msgid "E786: Range not allowed" msgstr "E786: ²íòåðâàë íå äîçâîëåíî" # msgstr "E177: " -#: ../eval.c:11140 msgid "E701: Invalid type for len()" msgstr "E701: Íåêîðåêòíèé òèï äëÿ len()" -#: ../eval.c:11980 msgid "E726: Stride is zero" msgstr "E726: Êðîê íóëüîâèé" -#: ../eval.c:11982 msgid "E727: Start past end" msgstr "E727: Ïî÷àòîê çà ê³íöåì" -#: ../eval.c:12024 ../eval.c:15297 msgid "<empty>" msgstr "<í³÷îãî>" # msgstr "E14: " -#: ../eval.c:12282 msgid "remove() argument" msgstr "àðãóìåíò remove()" -#: ../eval.c:12466 msgid "E655: Too many symbolic links (cycle?)" msgstr "E655: Çàáàãàòî ñèìâîëüíèõ ïîñèëàíü (öèêë?)" # msgstr "E14: " -#: ../eval.c:12593 msgid "reverse() argument" msgstr "àðãóìåíò reverse()" # msgstr "E14: " -#: ../eval.c:13721 msgid "sort() argument" msgstr "àðãóìåíò sort()" # msgstr "E14: " -#: ../eval.c:13721 -#, fuzzy msgid "uniq() argument" -msgstr "àðãóìåíò add()" +msgstr "àðãóìåíò uniq()" # msgstr "E364: " -#: ../eval.c:13776 msgid "E702: Sort compare function failed" msgstr "E702: Ïîìèëêà ó ôóíêö³¿ ïîð³âíÿííÿ" # msgstr "E364: " -#: ../eval.c:13806 -#, fuzzy msgid "E882: Uniq compare function failed" -msgstr "E702: Ïîìèëêà ó ôóíêö³¿ ïîð³âíÿííÿ" +msgstr "E882: Ïîìèëêà ó ôóíêö³¿ ïîð³âíÿííÿ uniq" -#: ../eval.c:14085 msgid "(Invalid)" msgstr "(Íåìîæëèâî)" -#: ../eval.c:14590 msgid "E677: Error writing temp file" msgstr "E677: Íå âäàëîñÿ çàïèñàòè òèì÷àñîâèé ôàéë" -#: ../eval.c:16159 msgid "E805: Using a Float as a Number" msgstr "E805: Float âæèòî ÿê Number" -#: ../eval.c:16162 msgid "E703: Using a Funcref as a Number" msgstr "E703: Funcref âæèòî ÿê Number" -#: ../eval.c:16170 msgid "E745: Using a List as a Number" msgstr "E745: List âæèòî ÿê Number" -#: ../eval.c:16173 msgid "E728: Using a Dictionary as a Number" msgstr "E728: Dictionary âæèòî ÿê Number" -#: ../eval.c:16259 msgid "E729: using Funcref as a String" msgstr "E729: Funcref âæèòî ÿê String" # msgstr "E373: " -#: ../eval.c:16262 msgid "E730: using List as a String" msgstr "E730: List âæèòî ÿê String" -#: ../eval.c:16265 msgid "E731: using Dictionary as a String" msgstr "E731: Dictionary âæèòî ÿê String" -#: ../eval.c:16619 #, c-format msgid "E706: Variable type mismatch for: %s" msgstr "E706: Íåïðàâèëüíèé òèï çì³ííî¿: %s" -#: ../eval.c:16705 #, c-format msgid "E795: Cannot delete variable %s" msgstr "E795: Íå ìîæíà çíèùèòè çì³ííó %s" -#: ../eval.c:16724 #, c-format msgid "E704: Funcref variable name must start with a capital: %s" msgstr "E704: Íàçâà çì³ííî¿ Funcref ìຠïî÷èíàòèñÿ ç âåëèêî¿ ë³òåðè: %s" -#: ../eval.c:16732 #, c-format msgid "E705: Variable name conflicts with existing function: %s" msgstr "E705: Íàçâà çì³ííî¿ ñï³âïàäàº ç ³ñíóþ÷îþ ôóíêö³ºþ: %s" -#: ../eval.c:16763 #, c-format msgid "E741: Value is locked: %s" msgstr "E741: Çíà÷åííÿ çàõèùåíå: %s" -#: ../eval.c:16764 ../eval.c:16769 ../message.c:1839 msgid "Unknown" msgstr "Íåâ³äîìî" -#: ../eval.c:16768 #, c-format msgid "E742: Cannot change value of %s" msgstr "E742: Íå ìîæíà çì³íèòè çíà÷åííÿ %s" -#: ../eval.c:16838 msgid "E698: variable nested too deep for making a copy" msgstr "E698: Çì³ííà âêëàäåíà çàíàäòî ãëèáîêî ùîá çðîáèòè ¿¿ êîï³þ" -#: ../eval.c:17249 #, c-format msgid "E123: Undefined function: %s" msgstr "E123: Íåâèçíà÷åíà ôóíêö³ÿ: %s" -#: ../eval.c:17260 #, c-format msgid "E124: Missing '(': %s" msgstr "E124: Áðàêóº '(': %s" -#: ../eval.c:17293 msgid "E862: Cannot use g: here" msgstr "E862: Òóò íå ìîæíà âèêîðèñòàòè g:" -#: ../eval.c:17312 #, c-format msgid "E125: Illegal argument: %s" msgstr "E125: Íåäîçâîëåíèé àðãóìåíò: %s" -#: ../eval.c:17323 #, c-format msgid "E853: Duplicate argument name: %s" msgstr "E853: Íàçâà àðãóìåíòó ïîâòîðþºòüñÿ: %s" -#: ../eval.c:17416 msgid "E126: Missing :endfunction" msgstr "E126: Áðàêóº :endfunction" -#: ../eval.c:17537 #, c-format msgid "E707: Function name conflicts with variable: %s" msgstr "E707: Íàçâà ôóíêö³¿ ñï³âïàäàº ç³ çì³ííîþ: %s" -#: ../eval.c:17549 #, c-format msgid "E127: Cannot redefine function %s: It is in use" msgstr "E127: Íå âäàëîñÿ ïåðåâèçíà÷èòè ôóíêö³þ %s: âîíà âèêîðèñòîâóºòüñÿ" -#: ../eval.c:17604 #, c-format msgid "E746: Function name does not match script file name: %s" msgstr "E746: Íàçâà ôóíêö³¿ íå çá³ãàºòüñÿ ç íàçâîþ ôàéëó ñêðèïòó: %s" -#: ../eval.c:17716 msgid "E129: Function name required" msgstr "E129: Íå âêàçàíî íàçâó ôóíêö³¿" -#: ../eval.c:17824 -#, fuzzy, c-format +#, c-format msgid "E128: Function name must start with a capital or \"s:\": %s" msgstr "" -"E128: Íàçâà ôóíêö³¿ ìຠïî÷èíàòèñÿ ç âåëèêî¿ ë³òåðè àáî ì³ñòèòè äâîêðàïêó: %s" +"E128: Íàçâà ôóíêö³¿ ìຠïî÷èíàòèñÿ ç âåëèêî¿ ë³òåðè àáî \"s:\": %s" -#: ../eval.c:17833 -#, fuzzy, c-format +#, c-format msgid "E884: Function name cannot contain a colon: %s" msgstr "" -"E128: Íàçâà ôóíêö³¿ ìຠïî÷èíàòèñÿ ç âåëèêî¿ ë³òåðè àáî ì³ñòèòè äâîêðàïêó: %s" +"E884: Íàçâà ôóíêö³¿ íå ìîæå ì³ñòèòè äâîêðàïêó: %s" -#: ../eval.c:18336 #, c-format msgid "E131: Cannot delete function %s: It is in use" msgstr "E131: Íå âäàëîñÿ çíèùèòè ôóíêö³þ %s: Âîíà âèêîðèñòîâóºòüñÿ" -#: ../eval.c:18441 msgid "E132: Function call depth is higher than 'maxfuncdepth'" msgstr "E132: Ãëèáèíà âèêëèê³â ôóíêö³¿ ïåðåâèùóº 'maxfuncdepth'" -#: ../eval.c:18568 #, c-format msgid "calling %s" msgstr "âèêëèêàºòüñÿ %s" -#: ../eval.c:18651 #, c-format msgid "%s aborted" msgstr "%s ïðèïèíåíî" -#: ../eval.c:18653 #, c-format msgid "%s returning #%<PRId64>" msgstr "%s ïîâåðòຠ#%<PRId64>" -#: ../eval.c:18670 #, c-format msgid "%s returning %s" msgstr "%s ïîâåðòຠ%s" -#: ../eval.c:18691 ../ex_cmds2.c:2695 #, c-format msgid "continuing in %s" msgstr "ïðîäîâæåííÿ â %s" -#: ../eval.c:18795 msgid "E133: :return not inside a function" msgstr "E133: :return ïîçà ìåæàìè ôóíêö³¿" -#: ../eval.c:19159 msgid "" "\n" "# global variables:\n" @@ -1040,7 +814,6 @@ msgstr "" "\n" "# ãëîáàëüí³ çì³íí³:\n" -#: ../eval.c:19254 msgid "" "\n" "\tLast set from " @@ -1048,104 +821,82 @@ msgstr "" "\n" "\tÂîñòàííº çì³íåíà ó " -#: ../eval.c:19272 msgid "No old files" msgstr "Æîäíîãî ñòàðîãî ôàéëó" -#: ../ex_cmds.c:122 #, c-format msgid "<%s>%s%s %d, Hex %02x, Octal %03o" msgstr "<%s>%s%s %d, ø³ñò %02x, â³ñ %03o" -#: ../ex_cmds.c:145 #, c-format msgid "> %d, Hex %04x, Octal %o" msgstr "> %d, ø³ñò %04x, â³ñ %o" -#: ../ex_cmds.c:146 #, c-format msgid "> %d, Hex %08x, Octal %o" msgstr "> %d, ø³ñò %08x, â³ñ %o" -#: ../ex_cmds.c:684 msgid "E134: Move lines into themselves" msgstr "E134: Íåìîæëèâî ïåðåì³ñòèòè ðÿäêè ñàì³ â ñåáå" -#: ../ex_cmds.c:747 msgid "1 line moved" msgstr "Ïåðåì³ùåíî îäèí ðÿäîê" -#: ../ex_cmds.c:749 #, c-format msgid "%<PRId64> lines moved" msgstr "Ïåðåì³ùåíî %<PRId64> ðÿäêè(³â)" -#: ../ex_cmds.c:1175 #, c-format msgid "%<PRId64> lines filtered" msgstr "³äô³ëüòðîâàíî %<PRId64> ðÿäêè(³â)" -#: ../ex_cmds.c:1194 msgid "E135: *Filter* Autocommands must not change current buffer" msgstr "E135: Àâòîêîìàíäè *Filter* íå ïîâèíí³ çì³íþâàòè ïîòî÷íèé áóôåð" -#: ../ex_cmds.c:1244 msgid "[No write since last change]\n" msgstr "[Çì³íè íå çàïèñàíî]\n" -#: ../ex_cmds.c:1424 #, c-format msgid "%sviminfo: %s in line: " msgstr "%sviminfo: %s â ðÿäêó: " -#: ../ex_cmds.c:1431 msgid "E136: viminfo: Too many errors, skipping rest of file" msgstr "E136: viminfo: Çàáàãàòî ïîìèëîê, ðåøòà ôàéëó áóäå ïðîïóùåíî" -#: ../ex_cmds.c:1458 #, c-format msgid "Reading viminfo file \"%s\"%s%s%s" msgstr "Ç÷èòóºòüñÿ ôàéë viminfo: «%s»%s%s%s" -#: ../ex_cmds.c:1460 msgid " info" msgstr " ³íôîðìàö³ÿ" -#: ../ex_cmds.c:1461 msgid " marks" msgstr " ïîçíà÷êè" -#: ../ex_cmds.c:1462 msgid " oldfiles" msgstr " ñòàð³ ôàéëè" -#: ../ex_cmds.c:1463 msgid " FAILED" msgstr " ÍÅ ÂÄÀËÎÑß" #. avoid a wait_return for this message, it's annoying -#: ../ex_cmds.c:1541 #, c-format msgid "E137: Viminfo file is not writable: %s" msgstr "E137: Íå äîçâîëåíî çàïèñ ó ôàéë viminfo: %s" -#: ../ex_cmds.c:1626 #, c-format msgid "E138: Can't write viminfo file %s!" msgstr "E138: Íå âäàëîñÿ çàïèñàòè ôàéë viminfo %s!" -#: ../ex_cmds.c:1635 #, c-format msgid "Writing viminfo file \"%s\"" msgstr "Çàïèñóºòüñÿ ôàéë viminfo «%s»" #. Write the info: -#: ../ex_cmds.c:1720 #, c-format msgid "# This viminfo file was generated by Vim %s.\n" msgstr "# Öåé ôàéë àâòîìàòè÷íî ñòâîðåíèé Vim %s.\n" -#: ../ex_cmds.c:1722 msgid "" "# You may edit it if you're careful!\n" "\n" @@ -1153,47 +904,37 @@ msgstr "" "# Ìîæåòå ðåäàãóâàòè, àëå ÎÁÅÐÅÆÍÎ!\n" "\n" -#: ../ex_cmds.c:1723 msgid "# Value of 'encoding' when this file was written\n" msgstr "# Çíà÷åííÿ 'encoding' ï³ä ÷àñ ñòâîðåííÿ öüîãî ôàéëó\n" -#: ../ex_cmds.c:1800 msgid "Illegal starting char" msgstr "Íåäîçâîëåíèé ñèìâîë íà ïî÷àòêó ðÿäêà" -#: ../ex_cmds.c:2162 msgid "Write partial file?" msgstr "Çàïèñàòè ÷àñòèíó ôàéëó?" -#: ../ex_cmds.c:2166 msgid "E140: Use ! to write partial buffer" msgstr "E140: Âèêîðèñòàéòå ! äëÿ çàïèñó ÷àñòèíè áóôåðà" -#: ../ex_cmds.c:2281 #, c-format msgid "Overwrite existing file \"%s\"?" msgstr "Ïåðåïèñàòè ³ñíóþ÷èé ôàéë «%s»?" -#: ../ex_cmds.c:2317 #, c-format msgid "Swap file \"%s\" exists, overwrite anyway?" msgstr "Ôàéë îáì³íó «%s» ³ñíóº, ïåðåçàïèñàòè?" -#: ../ex_cmds.c:2326 #, c-format msgid "E768: Swap file exists: %s (:silent! overrides)" msgstr "E768: Ôàéë îáì³íó ³ñíóº: %s (:silent! ïåðåâàæóº)" -#: ../ex_cmds.c:2381 #, c-format msgid "E141: No file name for buffer %<PRId64>" msgstr "E141: Íåìຠâõ³äíîãî ôàéëó äëÿ áóôåðà %<PRId64>" -#: ../ex_cmds.c:2412 msgid "E142: File not written: Writing is disabled by 'write' option" msgstr "E142: Ôàéë íå çàïèñàíî: çàïèñ çàáîðîíåíî îïö³ºþ 'write'" -#: ../ex_cmds.c:2434 #, c-format msgid "" "'readonly' option is set for \"%s\".\n" @@ -1202,7 +943,6 @@ msgstr "" "Äëÿ «%s» âñòàíîâëåíî 'readonly'.\n" "Áàæàºòå âñå îäíî ïðîäîâæèòè çàïèñ?" -#: ../ex_cmds.c:2439 #, c-format msgid "" "File permissions of \"%s\" are read-only.\n" @@ -1213,84 +953,66 @@ msgstr "" "Ïðîòå, ìîæëèâî, éîãî ìîæíà çàïèñàòè.\n" "Õî÷åòå ñïðîáóâàòè?" -#: ../ex_cmds.c:2451 #, c-format msgid "E505: \"%s\" is read-only (add ! to override)" msgstr "E505: «%s» ò³ëüêè äëÿ ÷èòàííÿ (! ùîá íå çâàæàòè)" -#: ../ex_cmds.c:3120 #, c-format msgid "E143: Autocommands unexpectedly deleted new buffer %s" msgstr "E143: Àâòîêîìàíäè íåñïîä³âàíî çíèùèëè íîâèé áóôåð %s" -#: ../ex_cmds.c:3313 msgid "E144: non-numeric argument to :z" msgstr "E144: íå÷èñëîâèé àðãóìåíò äëÿ :z" -#: ../ex_cmds.c:3404 msgid "E145: Shell commands not allowed in rvim" msgstr "E145: Ó rvim íå äîçâîëåí³ êîìàíäè îáîëîíêè" -#: ../ex_cmds.c:3498 msgid "E146: Regular expressions can't be delimited by letters" msgstr "E146: Ðåãóëÿðí³ âèðàçè íå ìîæíà ðîçä³ëÿòè ë³òåðàìè" -#: ../ex_cmds.c:3964 #, c-format msgid "replace with %s (y/n/a/q/l/^E/^Y)?" msgstr "Çàì³íèòè íà %s (y/n/a/q/l/^E/^Y)?" -#: ../ex_cmds.c:4379 msgid "(Interrupted) " msgstr "(Ïåðåðâàíî) " # msgstr "E31: " -#: ../ex_cmds.c:4384 msgid "1 match" msgstr "Îäèí çá³ã" -#: ../ex_cmds.c:4384 msgid "1 substitution" msgstr "Îäíà çàì³íà" -#: ../ex_cmds.c:4387 #, c-format msgid "%<PRId64> matches" msgstr "%<PRId64> çá³ãè(³â)" -#: ../ex_cmds.c:4388 #, c-format msgid "%<PRId64> substitutions" msgstr "%<PRId64> çàì³í(è)" -#: ../ex_cmds.c:4392 msgid " on 1 line" msgstr " â îäíîìó ðÿäêó" -#: ../ex_cmds.c:4395 #, c-format msgid " on %<PRId64> lines" msgstr " â %<PRId64> ðÿäêàõ" -#: ../ex_cmds.c:4438 msgid "E147: Cannot do :global recursive" msgstr "E147: :global íå ìîæíà âæèâàòè ðåêóðñèâíî" -#: ../ex_cmds.c:4467 msgid "E148: Regular expression missing from global" msgstr "E148: Ó global áðàêóº çðàçêà" -#: ../ex_cmds.c:4508 #, c-format msgid "Pattern found in every line: %s" msgstr "Çðàçîê çíàéäåíî ó êîæíîìó ðÿäêó: %s" -#: ../ex_cmds.c:4510 #, c-format msgid "Pattern not found: %s" msgstr "Çðàçîê íå çíàéäåíî: %s" -#: ../ex_cmds.c:4587 msgid "" "\n" "# Last Substitute String:\n" @@ -1300,338 +1022,265 @@ msgstr "" "# Îñòàííÿ çàì³íà:\n" "$" -#: ../ex_cmds.c:4679 msgid "E478: Don't panic!" msgstr "E478: Áåç ïàí³êè!" -#: ../ex_cmds.c:4717 #, c-format msgid "E661: Sorry, no '%s' help for %s" msgstr "E661: Âèáà÷òå, íåìຠäîïîìîãè '%s' äëÿ %s" -#: ../ex_cmds.c:4719 #, c-format msgid "E149: Sorry, no help for %s" msgstr "E149: Âèáà÷òå, íåìຠäîïîìîãè äëÿ %s" -#: ../ex_cmds.c:4751 #, c-format msgid "Sorry, help file \"%s\" not found" msgstr "Âèáà÷òå, ôàéë äîïîìîãè «%s» íå çíàéäåíî" -#: ../ex_cmds.c:5323 #, c-format msgid "E150: Not a directory: %s" msgstr "E150: Íå º êàòàëîãîì: %s" -#: ../ex_cmds.c:5446 #, c-format msgid "E152: Cannot open %s for writing" msgstr "E152: Íå âäàëîñÿ â³äêðèòè %s äëÿ çàïèñó" -#: ../ex_cmds.c:5471 #, c-format msgid "E153: Unable to open %s for reading" msgstr "E153: Íå âäàëîñÿ â³äêðèòè %s äëÿ ÷èòàííÿ" -#: ../ex_cmds.c:5500 #, c-format msgid "E670: Mix of help file encodings within a language: %s" msgstr "E670: ̳øàíèíà êîäóâàíü ôàéëó äîïîìîãè äëÿ ìîâè %s" -#: ../ex_cmds.c:5565 #, c-format msgid "E154: Duplicate tag \"%s\" in file %s/%s" msgstr "E154: Ïîâòîðåííÿ òå´ó «%s» ó ôàéë³ %s/%s" -#: ../ex_cmds.c:5687 #, c-format msgid "E160: Unknown sign command: %s" msgstr "E160: Íåâ³äîìà êîìàíäà íàäïèñó: %s" -#: ../ex_cmds.c:5704 msgid "E156: Missing sign name" msgstr "E156: Ïðîïóùåíî íàçâó íàäïèñó" -#: ../ex_cmds.c:5746 msgid "E612: Too many signs defined" msgstr "E612: Âèçíà÷åíî çàáàãàòî íàäïèñ³â" -#: ../ex_cmds.c:5813 #, c-format msgid "E239: Invalid sign text: %s" msgstr "E239: Íåêîðåêòíèé íàäïèñ: %s" -#: ../ex_cmds.c:5844 ../ex_cmds.c:6035 #, c-format msgid "E155: Unknown sign: %s" msgstr "E155: Íåâ³äîìèé íàäïèñ: %s" -#: ../ex_cmds.c:5877 msgid "E159: Missing sign number" msgstr "E159: Ïðîïóùåíî íîìåð íàäïèñó" -#: ../ex_cmds.c:5971 #, c-format msgid "E158: Invalid buffer name: %s" msgstr "E158: Íåêîðåêòíà íàçâà áóôåðà: %s" -#: ../ex_cmds.c:6008 #, c-format msgid "E157: Invalid sign ID: %<PRId64>" msgstr "E157: Íåïðàâèëüíèé ID íàäïèñó: %<PRId64>" -#: ../ex_cmds.c:6066 msgid " (not supported)" msgstr " (íå ï³äòðèìóºòüñÿ)" -#: ../ex_cmds.c:6169 msgid "[Deleted]" msgstr "[Çíèùåíî]" -#: ../ex_cmds2.c:139 msgid "Entering Debug mode. Type \"cont\" to continue." msgstr "Ðåæèì íàëàãîäæåííÿ. Ùîá ïðîäîâæèòè ââåä³òü «cont»." -#: ../ex_cmds2.c:143 ../ex_docmd.c:759 #, c-format msgid "line %<PRId64>: %s" msgstr "ðÿäîê %<PRId64>: %s" -#: ../ex_cmds2.c:145 #, c-format msgid "cmd: %s" msgstr "êîìàíäà: %s" -#: ../ex_cmds2.c:322 #, c-format msgid "Breakpoint in \"%s%s\" line %<PRId64>" msgstr "Òî÷êà çóïèíêè â «%s%s» ðÿäîê %<PRId64>" -#: ../ex_cmds2.c:581 #, c-format msgid "E161: Breakpoint not found: %s" msgstr "E161: Òî÷êó çóïèíêè íå çíàéäåíî: %s" -#: ../ex_cmds2.c:611 msgid "No breakpoints defined" msgstr "Íå âèçíà÷åíî æîäíî¿ òî÷êè çóïèíêè" -#: ../ex_cmds2.c:617 #, c-format msgid "%3d %s %s line %<PRId64>" msgstr "%3d %s %s ðÿäîê %<PRId64>" -#: ../ex_cmds2.c:942 msgid "E750: First use \":profile start {fname}\"" msgstr "E750: Ñïî÷àòêó çðîá³òü «:profile start {ôàéë}»" -#: ../ex_cmds2.c:1269 #, c-format msgid "Save changes to \"%s\"?" msgstr "Çáåðåãòè çì³íè â «%s»?" -#: ../ex_cmds2.c:1271 ../ex_docmd.c:8851 msgid "Untitled" msgstr "Íåíàçâàíèé" -#: ../ex_cmds2.c:1421 #, c-format msgid "E162: No write since last change for buffer \"%s\"" msgstr "E162: Áóôåð «%s» ìຠíåçáåðåæåí³ çì³íè" -#: ../ex_cmds2.c:1480 msgid "Warning: Entered other buffer unexpectedly (check autocommands)" msgstr "" "Îáåðåæíî: Íåñïîä³âàíî îïèíèëèñÿ ó ³íøîìó áóôåð³ (ïåðåâ³ðòå àâòîêîìàíäè)" -#: ../ex_cmds2.c:1826 msgid "E163: There is only one file to edit" msgstr "E163: Ðåäàãóºòüñÿ ëèøå îäèí ôàéë" -#: ../ex_cmds2.c:1828 msgid "E164: Cannot go before first file" msgstr "E164: Öå âæå íàéïåðøèé ôàéë" -#: ../ex_cmds2.c:1830 msgid "E165: Cannot go beyond last file" msgstr "E165: Öå âæå îñòàíí³é ôàéë" -#: ../ex_cmds2.c:2175 #, c-format msgid "E666: compiler not supported: %s" msgstr "E666: Êîìï³ëÿòîð íå ï³äòðèìóºòüñÿ: %s" # msgstr "E195: " -#: ../ex_cmds2.c:2257 #, c-format msgid "Searching for \"%s\" in \"%s\"" msgstr "Ïîøóê «%s» â «%s»" -#: ../ex_cmds2.c:2284 #, c-format msgid "Searching for \"%s\"" msgstr "Ïîøóê «%s»" -#: ../ex_cmds2.c:2307 #, c-format msgid "not found in 'runtimepath': \"%s\"" msgstr " 'runtimepath' íå çíàéäåíî «%s»" -#: ../ex_cmds2.c:2472 #, c-format msgid "Cannot source a directory: \"%s\"" msgstr "Íå âäàëîñÿ ïðî÷èòàòè êàòàëîã: «%s»" -#: ../ex_cmds2.c:2518 #, c-format msgid "could not source \"%s\"" msgstr "Íå âäàëîñÿ âèêîíàòè «%s»" -#: ../ex_cmds2.c:2520 #, c-format msgid "line %<PRId64>: could not source \"%s\"" msgstr "ðÿäîê %<PRId64>: íå âäàëîñÿ âèêîíàòè «%s»" -#: ../ex_cmds2.c:2535 #, c-format msgid "sourcing \"%s\"" msgstr "âèêîíóºòüñÿ «%s»" -#: ../ex_cmds2.c:2537 #, c-format msgid "line %<PRId64>: sourcing \"%s\"" msgstr "ðÿäîê %<PRId64>: âèêîíóºòüñÿ «%s»" -#: ../ex_cmds2.c:2693 #, c-format msgid "finished sourcing %s" msgstr "çàê³í÷åíî âèêîíàííÿ %s" -#: ../ex_cmds2.c:2765 msgid "modeline" msgstr "modeline" # msgstr "E14: " -#: ../ex_cmds2.c:2767 msgid "--cmd argument" msgstr "--cmd àðãóìåíò" # msgstr "E14: " -#: ../ex_cmds2.c:2769 msgid "-c argument" msgstr "-c àðãóìåíò" -#: ../ex_cmds2.c:2771 msgid "environment variable" msgstr "çì³ííà îòî÷åííÿ" -#: ../ex_cmds2.c:2773 msgid "error handler" msgstr "îáðîáíèê ïîìèëêè" -#: ../ex_cmds2.c:3020 msgid "W15: Warning: Wrong line separator, ^M may be missing" msgstr "W15: Çàñòåðåæåííÿ: Íåïðàâèëüíèé ðîçä³ëüíèê ðÿäê³â, ìîæëèâî, áðàêóº ^M" -#: ../ex_cmds2.c:3139 msgid "E167: :scriptencoding used outside of a sourced file" msgstr "E167: :scriptencoding âèêîðèñòàíî ïîçà âèêîíóâàíèì ôàéëîì" -#: ../ex_cmds2.c:3166 msgid "E168: :finish used outside of a sourced file" msgstr "E168: :finish âèêîðèñòàíî ïîçà âèêîíóâàíèì ôàéëîì" -#: ../ex_cmds2.c:3389 #, c-format msgid "Current %slanguage: \"%s\"" msgstr "Ìîâà (%s): «%s»" -#: ../ex_cmds2.c:3404 #, c-format msgid "E197: Cannot set language to \"%s\"" msgstr "E197: Íå âäàëîñÿ âñòàíîâèòè ìîâó «%s»" #. don't redisplay the window #. don't wait for return -#: ../ex_docmd.c:387 msgid "Entering Ex mode. Type \"visual\" to go to Normal mode." msgstr "Ðåæèì Ex. Äëÿ ïîâåðíåííÿ äî íîðìàëüíîãî ðåæèìó âèêîíàéòå «visual»" -#: ../ex_docmd.c:428 msgid "E501: At end-of-file" msgstr "E501: ʳíåöü ôàéëó" -#: ../ex_docmd.c:513 msgid "E169: Command too recursive" msgstr "E169: Êîìàíäà çàíàäòî ðåêóðñèâíà" -#: ../ex_docmd.c:1006 #, c-format msgid "E605: Exception not caught: %s" msgstr "E605: Âèíÿòêîâà ñèòóàö³ÿ íå îáðîáëåíà: %s" -#: ../ex_docmd.c:1085 msgid "End of sourced file" msgstr "ʳíåöü âèêîíóâàíîãî ôàéëó" -#: ../ex_docmd.c:1086 msgid "End of function" msgstr "ʳíåöü ôóíêö³¿" -#: ../ex_docmd.c:1628 msgid "E464: Ambiguous use of user-defined command" msgstr "E464: Íåîäíîçíà÷íèé âæèòîê êîìàíäè êîðèñòóâà÷à" -#: ../ex_docmd.c:1638 msgid "E492: Not an editor command" msgstr "E492: Öå íå êîìàíäà ðåäàêòîðà" -#: ../ex_docmd.c:1729 msgid "E493: Backwards range given" msgstr "E493: ²íòåðâàë çàäàíî íàâèâîð³ò" -#: ../ex_docmd.c:1733 msgid "Backwards range given, OK to swap" msgstr "²íòåðâàë çàäàíî íàâèâîð³ò, ùîá ïîì³íÿòè ì³ñöÿìè — ÃÀÐÀÇÄ" #. append #. typed wrong -#: ../ex_docmd.c:1787 msgid "E494: Use w or w>>" msgstr "E494: Ñïðîáóéòå w àáî w>>" -#: ../ex_docmd.c:3454 msgid "E319: The command is not available in this version" msgstr "E319: Âèáà÷òå, ö³º¿ êîìàíäè íåìຠó ö³é âåðñ³¿" -#: ../ex_docmd.c:3752 msgid "E172: Only one file name allowed" msgstr "E172: Äîçâîëåíî ò³ëüêè îäíó íàçâó ôàéëó" -#: ../ex_docmd.c:4238 msgid "1 more file to edit. Quit anyway?" msgstr "Çàëèøèëîñÿ â³äðåäàãóâàòè ùå îäèí ôàéë. Âñå îäíî âèéòè?" -#: ../ex_docmd.c:4242 #, c-format msgid "%d more files to edit. Quit anyway?" msgstr "Ùå º %d íå ðåäàãîâàíèõ ôàéë³â. Âñå îäíî âèéòè?" -#: ../ex_docmd.c:4248 msgid "E173: 1 more file to edit" msgstr "E173: Çàëèøèëîñÿ â³äðåäàãóâàòè ùå îäèí ôàéë" -#: ../ex_docmd.c:4250 #, c-format msgid "E173: %<PRId64> more files to edit" msgstr "E173: Çàëèøèëîñÿ %<PRId64> íå ðåäàãîâàíèõ ôàéë³â" -#: ../ex_docmd.c:4320 msgid "E174: Command already exists: add ! to replace it" msgstr "E174: Êîìàíäà âæå ³ñíóº, ! ùîá çàì³íèòè ¿¿" -#: ../ex_docmd.c:4432 msgid "" "\n" " Name Args Range Complete Definition" @@ -1639,353 +1288,276 @@ msgstr "" "\n" " Íàçâà Àðã. Ìåæà Äîïîâíåííÿ Âèçíà÷åííÿ" -#: ../ex_docmd.c:4516 msgid "No user-defined commands found" msgstr "Íå çíàéäåíî êîìàíä êîðèñòóâà÷à" -#: ../ex_docmd.c:4538 msgid "E175: No attribute specified" msgstr "E175: Íå âêàçàíî àòðèáóò³â" -#: ../ex_docmd.c:4583 msgid "E176: Invalid number of arguments" msgstr "E176: Íåïðàâèëüíà ê³ëüê³ñòü àðãóìåíò³â" -#: ../ex_docmd.c:4594 msgid "E177: Count cannot be specified twice" msgstr "E177: ˳÷èëüíèê íå ìîæå áóòè âêàçàíî äâ³÷³" # msgstr "E177: " -#: ../ex_docmd.c:4603 msgid "E178: Invalid default value for count" msgstr "E178: Íåïðàâèëüíå ïî÷àòêîâå çíà÷åííÿ ë³÷èëüíèêà" # msgstr "E178: " -#: ../ex_docmd.c:4625 msgid "E179: argument required for -complete" msgstr "E179: äëÿ -complete ïîòð³áíèé àðãóìåíò" # msgstr "E180: " -#: ../ex_docmd.c:4635 #, c-format msgid "E181: Invalid attribute: %s" msgstr "E181: Íåïðàâèëüíèé àòðèáóò: %s" # msgstr "E181: " -#: ../ex_docmd.c:4678 msgid "E182: Invalid command name" msgstr "E182: Íåïðàâèëüíà íàçâà êîìàíäè" # msgstr "E182: " -#: ../ex_docmd.c:4691 msgid "E183: User defined commands must start with an uppercase letter" msgstr "E183: Êîìàíäè êîðèñòóâà÷à ïîâèíí³ ïî÷èíàòèñÿ ç âåëèêî¿ ë³òåðè" -#: ../ex_docmd.c:4696 msgid "E841: Reserved name, cannot be used for user defined command" msgstr "" "E841: Çàðåçåðâîâàíà íàçâà, íå ìîæíà âèêîðèñòàòè äëÿ êîðèñòóâàöüêî¿ êîìàíäè" # msgstr "E183: " -#: ../ex_docmd.c:4751 #, c-format msgid "E184: No such user-defined command: %s" msgstr "E184: Êîìàíäó êîðèñòóâà÷à íå çíàéäåíî: %s" # msgstr "E179: " -#: ../ex_docmd.c:5219 #, c-format msgid "E180: Invalid complete value: %s" msgstr "E180: Íåïðàâèëüíå äîïîâíåííÿ: %s" -#: ../ex_docmd.c:5225 msgid "E468: Completion argument only allowed for custom completion" msgstr "E468: Àðãóìåíò äîçâîëåíèé ò³ëüêè äëÿ êîðèñòóâàöüêîãî äîïîâíåííÿ" -#: ../ex_docmd.c:5231 msgid "E467: Custom completion requires a function argument" msgstr "E467: Êîðèñòóâàöüêå äîïîâíåííÿ âèìàãຠàðãóìåíò-ôóíêö³þ" # msgstr "E184: " -#: ../ex_docmd.c:5257 #, c-format msgid "E185: Cannot find color scheme '%s'" msgstr "E185: Íå âäàëîñÿ çíàéòè ñõåìó êîëüîð³â «%s»" -#: ../ex_docmd.c:5263 msgid "Greetings, Vim user!" msgstr "³òàííÿ, êîðèñòóâà÷ó Vim!" # msgstr "E443: " -#: ../ex_docmd.c:5431 msgid "E784: Cannot close last tab page" msgstr "E784: Íå ìîæíà çàêðèòè îñòàííþ âêëàäêó" # msgstr "E444: " -#: ../ex_docmd.c:5462 msgid "Already only one tab page" msgstr "Âæå é òàê ëèøå îäíà âêëàäêà" -#: ../ex_docmd.c:6004 #, c-format msgid "Tab page %d" msgstr "Âêëàäêà %d" -#: ../ex_docmd.c:6295 msgid "No swap file" msgstr "Íåìຠôàéëó îáì³íó" -#: ../ex_docmd.c:6478 msgid "E747: Cannot change directory, buffer is modified (add ! to override)" msgstr "E747: Íå âäàëîñÿ çì³íèòè êàòàëîã, áóôåð ìຠçì³íè (! ùîá íå çâàæàòè)" -#: ../ex_docmd.c:6485 msgid "E186: No previous directory" msgstr "E186: Öå âæå íàéïåðøèé êàòàëîã" # msgstr "E186: " -#: ../ex_docmd.c:6530 msgid "E187: Unknown" msgstr "E187: Íåâ³äîìî" -#: ../ex_docmd.c:6610 msgid "E465: :winsize requires two number arguments" msgstr "E465: :winsize âèìàãຠäâà ÷èñëîâèõ àðãóìåíòè" -#: ../ex_docmd.c:6655 msgid "E188: Obtaining window position not implemented for this platform" msgstr "E188: Íå ìîæíà îòðèìàòè ïîçèö³þ â³êíà íà ö³é ïëàòôîðì³" -#: ../ex_docmd.c:6662 msgid "E466: :winpos requires two number arguments" msgstr "E466: :winpos âèìàãຠäâà ÷èñëîâèõ àðãóìåíòè" -#: ../ex_docmd.c:7241 #, c-format msgid "E739: Cannot create directory: %s" msgstr "E739: Íå âäàëîñÿ ñòâîðèòè êàòàëîã: %s" -#: ../ex_docmd.c:7268 #, c-format msgid "E189: \"%s\" exists (add ! to override)" msgstr "E189: Ôàéë «%s» ³ñíóº (! ùîá íå çâàæàòè)" # msgstr "E189: " -#: ../ex_docmd.c:7273 #, c-format msgid "E190: Cannot open \"%s\" for writing" msgstr "E190: Íå âäàëîñÿ â³äêðèòè «%s» äëÿ çàïèñó" # msgstr "E190: " #. set mark -#: ../ex_docmd.c:7294 msgid "E191: Argument must be a letter or forward/backward quote" msgstr "E191: Àðãóìåíò ìຠáóòè ë³òåðîþ, ` àáî '" # msgstr "E191: " -#: ../ex_docmd.c:7333 msgid "E192: Recursive use of :normal too deep" msgstr "E192: Çàáàãàòî âêëàäåíèõ :normal" # msgstr "E193: " -#: ../ex_docmd.c:7807 msgid "E194: No alternate file name to substitute for '#'" msgstr "E194: Íåìຠíàçâè âòîðèííîãî ôàéëó äëÿ çàì³íè '#'" -#: ../ex_docmd.c:7841 msgid "E495: no autocommand file name to substitute for \"<afile>\"" msgstr "E495: Íåìຠíàçâè ôàéëó àâòîêîìàíäè äëÿ çàì³íè «<afile>»" -#: ../ex_docmd.c:7850 msgid "E496: no autocommand buffer number to substitute for \"<abuf>\"" msgstr "E496: Íåìຠíîìåðà áóôåðà àâòîêîìàíäè äëÿ çàì³íè «<abuf>»" -#: ../ex_docmd.c:7861 msgid "E497: no autocommand match name to substitute for \"<amatch>\"" msgstr "E497: Íåìຠíàçâè çá³ãó àâòîêîìàíäè äëÿ çàì³íè «<amatch>»" -#: ../ex_docmd.c:7870 msgid "E498: no :source file name to substitute for \"<sfile>\"" msgstr "E498: Íåìຠíàçâè ôàéëó :source äëÿ çàì³íè «<sfile>»" -#: ../ex_docmd.c:7876 msgid "E842: no line number to use for \"<slnum>\"" msgstr "E842: íåìຠíîìåðà ðÿäêà, ùîá âèêîðèñòàòè ç «<sfile>»" -#: ../ex_docmd.c:7903 -#, fuzzy, c-format +#, c-format msgid "E499: Empty file name for '%' or '#', only works with \":p:h\"" msgstr "E499: Íàçâà ôàéëó äëÿ '%' ÷è '#' ïîðîæíÿ, ïðàöþº ëèøå ç «:p:h»" -#: ../ex_docmd.c:7905 msgid "E500: Evaluates to an empty string" msgstr "E500: Ðåçóëüòàò — ïîðîæí³é ðÿäîê" -#: ../ex_docmd.c:8838 msgid "E195: Cannot open viminfo file for reading" msgstr "E195: Íå âäàëîñÿ ïðî÷èòàòè ôàéë viminfo" -#: ../ex_eval.c:464 msgid "E608: Cannot :throw exceptions with 'Vim' prefix" msgstr "E608: Íå ìîæíà âèêèäàòè (:throw) âèíÿòêè ç ïðåô³êñîì 'Vim'" #. always scroll up, don't overwrite -#: ../ex_eval.c:496 #, c-format msgid "Exception thrown: %s" msgstr "Âèíÿòêîâà ñèòóàö³ÿ: %s" -#: ../ex_eval.c:545 #, c-format msgid "Exception finished: %s" msgstr "Âèíÿòîê çàê³í÷åíî: %s" -#: ../ex_eval.c:546 #, c-format msgid "Exception discarded: %s" msgstr "Âèíÿòîê ñêèíóòî: %s" -#: ../ex_eval.c:588 ../ex_eval.c:634 #, c-format msgid "%s, line %<PRId64>" msgstr "%s, ðÿäîê %<PRId64>" #. always scroll up, don't overwrite -#: ../ex_eval.c:608 #, c-format msgid "Exception caught: %s" msgstr "Ñï³éìàíî âèíÿòêîâó ñèòóàö³þ: %s" -#: ../ex_eval.c:676 #, c-format msgid "%s made pending" msgstr "Î÷³êóºòüñÿ %s" -#: ../ex_eval.c:679 #, c-format msgid "%s resumed" msgstr "³äíîâëåíî %s" -#: ../ex_eval.c:683 #, c-format msgid "%s discarded" msgstr "Ñêèíóòî %s" -#: ../ex_eval.c:708 msgid "Exception" msgstr "Âèíÿòîê" -#: ../ex_eval.c:713 msgid "Error and interrupt" msgstr "Ïîìèëêà, ïåðåðâàíî" # msgstr "E231: " -#: ../ex_eval.c:715 msgid "Error" msgstr "Ïîìèëêà" #. if (pending & CSTP_INTERRUPT) -#: ../ex_eval.c:717 msgid "Interrupt" msgstr "Ïåðåðâàíî" -#: ../ex_eval.c:795 msgid "E579: :if nesting too deep" msgstr "E579: Çàíàäòî áàãàòî âêëàäåíèõ :if" -#: ../ex_eval.c:830 msgid "E580: :endif without :if" msgstr "E580: :endif áåç :if" -#: ../ex_eval.c:873 msgid "E581: :else without :if" msgstr "E581: :else áåç :if" -#: ../ex_eval.c:876 msgid "E582: :elseif without :if" msgstr "E582: :elseif áåç :if" -#: ../ex_eval.c:880 msgid "E583: multiple :else" msgstr "E583: Íå îäíå :else" -#: ../ex_eval.c:883 msgid "E584: :elseif after :else" msgstr "E584: :elseif ï³ñëÿ :else" -#: ../ex_eval.c:941 msgid "E585: :while/:for nesting too deep" msgstr "E585: Çàáàãàòî âêëàäåíèõ :while/:for" -#: ../ex_eval.c:1028 msgid "E586: :continue without :while or :for" msgstr "E586: :continue áåç :while ÷è :for" -#: ../ex_eval.c:1061 msgid "E587: :break without :while or :for" msgstr "E587: :break áåç :while ÷è :for" -#: ../ex_eval.c:1102 msgid "E732: Using :endfor with :while" msgstr "E732: Âæèòî :endfor ³ç :while" -#: ../ex_eval.c:1104 msgid "E733: Using :endwhile with :for" msgstr "E733: Âæèòî :endwhile ³ç :for" -#: ../ex_eval.c:1247 msgid "E601: :try nesting too deep" msgstr "E601: Çàáàãàòî âêëàäåíèõ :try" -#: ../ex_eval.c:1317 msgid "E603: :catch without :try" msgstr "E603: :catch áåç :try" #. Give up for a ":catch" after ":finally" and ignore it. #. * Just parse. -#: ../ex_eval.c:1332 msgid "E604: :catch after :finally" msgstr "E604: :catch ï³ñëÿ :finally" -#: ../ex_eval.c:1451 msgid "E606: :finally without :try" msgstr "E606: :finally áåç :try" #. Give up for a multiple ":finally" and ignore it. -#: ../ex_eval.c:1467 msgid "E607: multiple :finally" msgstr "E607: Íå îäíå :finally" -#: ../ex_eval.c:1571 msgid "E602: :endtry without :try" msgstr "E602: :entry áåç :try" -#: ../ex_eval.c:2026 msgid "E193: :endfunction not inside a function" msgstr "E193: :endfunction ïîçà ìåæàìè ôóíêö³¿" -#: ../ex_getln.c:1643 msgid "E788: Not allowed to edit another buffer now" msgstr "E788: Çàðàç íå ìîæíà ðåäàãóâàòè ³íøèé áóôåð" -#: ../ex_getln.c:1656 msgid "E811: Not allowed to change buffer information now" msgstr "E811: Çàðàç íå ìîæíà çì³íþâàòè ³íôîðìàö³þ áóôåðà" # msgstr "E197: " -#: ../ex_getln.c:3178 msgid "tagname" msgstr "íàçâà òå´ó" -#: ../ex_getln.c:3181 msgid " kind file\n" msgstr " òèï ôàéëó\n" -#: ../ex_getln.c:4799 msgid "'history' option is zero" msgstr "Îïö³ÿ 'history' ïîðîæíÿ" -#: ../ex_getln.c:5046 #, c-format msgid "" "\n" @@ -1994,35 +1566,27 @@ msgstr "" "\n" "# Ïîïåðåäí³ %s (â³ä íàéíîâ³øèõ):\n" -#: ../ex_getln.c:5047 msgid "Command Line" msgstr "êîìàíäè" -#: ../ex_getln.c:5048 msgid "Search String" msgstr "øóêàí³ ðÿäêè" -#: ../ex_getln.c:5049 msgid "Expression" msgstr "âèðàçè" -#: ../ex_getln.c:5050 msgid "Input Line" msgstr "ââåäåí³ ðÿäêè" -#: ../ex_getln.c:5117 msgid "E198: cmd_pchar beyond the command length" msgstr "E198: cmd_pchar ïîçà ìåæàìè êîìàíäè" -#: ../ex_getln.c:5279 msgid "E199: Active window or buffer deleted" msgstr "E199: Àêòèâíå â³êíî àáî áóôåð áóëî çíèùåíî" -#: ../file_search.c:203 msgid "E854: path too long for completion" msgstr "E854: øëÿõ çàíàäòî äîâãèé äëÿ äîïîâíåííÿ" -#: ../file_search.c:446 #, c-format msgid "" "E343: Invalid path: '**[number]' must be at the end of the path or be " @@ -2032,217 +1596,169 @@ msgstr "" "'%s'." # msgstr "E343: " -#: ../file_search.c:1505 #, c-format msgid "E344: Can't find directory \"%s\" in cdpath" msgstr "E344: Íå âäàëîñÿ çíàéòè êàòàëîã «%s» ó cdpath" # msgstr "E344: " -#: ../file_search.c:1508 #, c-format msgid "E345: Can't find file \"%s\" in path" msgstr "E345: Íå âäàëîñÿ çíàéòè ôàéë «%s» ó path" # msgstr "E345: " -#: ../file_search.c:1512 #, c-format msgid "E346: No more directory \"%s\" found in cdpath" msgstr "E346: Ó cdpath íåìຠá³ëüøå êàòàëîãó «%s»" # msgstr "E346: " -#: ../file_search.c:1515 #, c-format msgid "E347: No more file \"%s\" found in path" msgstr "E347: Ó øëÿõó ïîøóêó á³ëüøå íåìຠôàéë³â «%s»" -#: ../fileio.c:137 msgid "E812: Autocommands changed buffer or buffer name" msgstr "E812: Àâòîêîìàíäè çì³íèëè áóôåð ÷è éîãî íàçâó" # msgstr "E199: " -#: ../fileio.c:368 msgid "Illegal file name" msgstr "Íåäîçâîëåíà íàçâà ôàéëó" -#: ../fileio.c:395 ../fileio.c:476 ../fileio.c:2543 ../fileio.c:2578 msgid "is a directory" msgstr "êàòàëîã" -#: ../fileio.c:397 msgid "is not a file" msgstr "íå ôàéë" -#: ../fileio.c:508 ../fileio.c:3522 msgid "[New File]" msgstr "[Íîâèé ôàéë]" -#: ../fileio.c:511 msgid "[New DIRECTORY]" msgstr "[Íîâèé êàòàëîã]" -#: ../fileio.c:529 ../fileio.c:532 msgid "[File too big]" msgstr "[Ôàéë çàâåëèêèé]" -#: ../fileio.c:534 msgid "[Permission Denied]" msgstr "[³äìîâëåíî]" -#: ../fileio.c:653 msgid "E200: *ReadPre autocommands made the file unreadable" msgstr "E200: Àâòîêîìàíäè *ReadPre óíåìîæëèâèëè ÷èòàííÿ ôàéëó" # msgstr "E200: " -#: ../fileio.c:655 msgid "E201: *ReadPre autocommands must not change current buffer" msgstr "E201: Àâòîêîìàíäè *ReadPre íå ïîâèíí³ çì³íþâàòè öåé áóôåð" # msgstr "E201: " -#: ../fileio.c:672 msgid "Nvim: Reading from stdin...\n" msgstr "Vim: ×èòàºòüñÿ ç stdin...\n" #. Re-opening the original file failed! -#: ../fileio.c:909 msgid "E202: Conversion made file unreadable!" msgstr "E202: Êîíâåðòàö³ÿ óíåìîæëèâèëà ÷èòàííÿ ôàéëó!" # msgstr "E202: " #. fifo or socket -#: ../fileio.c:1782 msgid "[fifo/socket]" msgstr "[êàíàë/ñîêåò]" #. fifo -#: ../fileio.c:1788 msgid "[fifo]" msgstr "[êàíàë]" #. or socket -#: ../fileio.c:1794 msgid "[socket]" msgstr "[ñîêåò]" #. or character special -#: ../fileio.c:1801 msgid "[character special]" msgstr "[ñïåö. ñèìâîëüíèé]" -#: ../fileio.c:1815 msgid "[CR missing]" msgstr "[Áðàêóº CR]" -#: ../fileio.c:1819 msgid "[long lines split]" msgstr "[Ðîçáèòî äîâã³ ðÿäêè]" -#: ../fileio.c:1823 ../fileio.c:3512 msgid "[NOT converted]" msgstr "[ÍÅ êîíâåðòîâàíî]" -#: ../fileio.c:1826 ../fileio.c:3515 msgid "[converted]" msgstr "[êîíâåðòîâàíî]" -#: ../fileio.c:1831 #, c-format msgid "[CONVERSION ERROR in line %<PRId64>]" msgstr "[ÏÎÌÈËÊÀ ÊÎÍÂÅÐÒÀÖ²¯ ó ðÿäêó %<PRId64>]" -#: ../fileio.c:1835 #, c-format msgid "[ILLEGAL BYTE in line %<PRId64>]" msgstr "[ÍÅÊÎÐÅÊÒÍÈÉ ÁÀÉÒ ó ðÿäêó %<PRId64>]" -#: ../fileio.c:1838 msgid "[READ ERRORS]" msgstr "[ÏÎÌÈËÊÀ ×ÈÒÀÍÍß]" -#: ../fileio.c:2104 msgid "Can't find temp file for conversion" msgstr "Íå âäàëîñÿ ï³äøóêàòè òèì÷àñîâèé ôàéë äëÿ êîíâåðòàö³¿" -#: ../fileio.c:2110 msgid "Conversion with 'charconvert' failed" msgstr "Êîíâåðòàö³ÿ ç 'charconvert' íå âäàëàñÿ" -#: ../fileio.c:2113 msgid "can't read output of 'charconvert'" msgstr "íå âäàëîñÿ ïðî÷èòàòè âèâ³ä 'charconvert'" # msgstr "E217: " -#: ../fileio.c:2437 msgid "E676: No matching autocommands for acwrite buffer" msgstr "E676: Íåìຠâ³äïîâ³äíèõ àâòîêîìàíä" -#: ../fileio.c:2466 msgid "E203: Autocommands deleted or unloaded buffer to be written" msgstr "E203: Àâòîêîìàíäà çíèùèëà àáî âèâàíòàæèëà áóôåð, ùî ìàâ áóòè çàïèñàíèé" -#: ../fileio.c:2486 msgid "E204: Autocommand changed number of lines in unexpected way" msgstr "E204: Àâòîêîìàíäà íåñïîä³âàíèì ÷èíîì çì³íèëà ê³ëüê³ñòü ðÿäê³â" -#: ../fileio.c:2548 ../fileio.c:2565 msgid "is not a file or writable device" msgstr "Íå ïðèäàòíèé äëÿ çàïèñó" -#: ../fileio.c:2601 msgid "is read-only (add ! to override)" msgstr "ëèøå äëÿ ÷èòàííÿ (! ùîá íå çâàæàòè)" -#: ../fileio.c:2886 msgid "E506: Can't write to backup file (add ! to override)" msgstr "E506: Íå âäàëîñÿ çàïèñàòè ðåçåðâíèé ôàéë (! ùîá íå çâàæàòè)" -#: ../fileio.c:2898 msgid "E507: Close error for backup file (add ! to override)" msgstr "E507: Ïîìèëêà çàêðèòòÿ ðåçåðâíîãî ôàéëó (! ùîá íå çâàæàòè)" -#: ../fileio.c:2901 msgid "E508: Can't read file for backup (add ! to override)" msgstr "" "E508: Íå âäàëîñÿ ïðî÷èòàòè ôàéë ùîá ñòâîðèòè ðåçåðâíó êîï³þ (! ùîá íå " "çâàæàòè)" -#: ../fileio.c:2923 msgid "E509: Cannot create backup file (add ! to override)" msgstr "E509: Íå âäàëîñÿ ñòâîðèòè ðåçåðâíó êîï³þ (! ùîá íå çâàæàòè)" -#: ../fileio.c:3008 msgid "E510: Can't make backup file (add ! to override)" msgstr "E510: Íå âäàëîñÿ çðîáèòè ðåçåðâíó êîï³þ (! ùîá íå çâàæàòè)" #. Can't write without a tempfile! -#: ../fileio.c:3121 msgid "E214: Can't find temp file for writing" msgstr "E214: Íå âäàëîñÿ ï³äøóêàòè òèì÷àñîâèé ôàéë äëÿ çàïèñó" -#: ../fileio.c:3134 msgid "E213: Cannot convert (add ! to write without conversion)" msgstr "E213: Íå âäàëîñÿ ïåðåòâîðèòè (! ùîá çàïèñàòè áåç êîíâåðòàö³¿)" -#: ../fileio.c:3169 msgid "E166: Can't open linked file for writing" msgstr "E166: Íå âäàëîñÿ â³äêðèòè äëÿ çàïèñó çâ'ÿçàíèé ôàéë" -#: ../fileio.c:3173 msgid "E212: Can't open file for writing" msgstr "E212: Íå âäàëîñÿ â³äêðèòè ôàéë äëÿ çàïèñó" -#: ../fileio.c:3363 msgid "E667: Fsync failed" msgstr "E667: Íå âäàëîñÿ âèêîíàòè fsync" -#: ../fileio.c:3398 msgid "E512: Close failed" msgstr "E512: Íå âäàëîñÿ çàêðèòè" -#: ../fileio.c:3436 msgid "E513: write error, conversion failed (make 'fenc' empty to override)" msgstr "E513: Ïîìèëêà çàïèñó, êîíâåðòàö³ÿ íå âäàëàñÿ (ñêèíüòå 'fenc')" -#: ../fileio.c:3441 #, c-format msgid "" "E513: write error, conversion failed in line %<PRId64> (make 'fenc' empty to " @@ -2251,56 +1767,43 @@ msgstr "" "E513: Ïîìèëêà çàïèñó, êîíâåðòàö³ÿ íå âäàëàñÿ ó ðÿäêó %<PRId64> (ñêèíüòå " "'fenc')" -#: ../fileio.c:3448 msgid "E514: write error (file system full?)" msgstr "E514: Ïîìèëêà çàïèñó (ñê³í÷èëîñü â³ëüíå ì³ñöå?)" -#: ../fileio.c:3506 msgid " CONVERSION ERROR" msgstr " ÏÎÌÈËÊÀ ÊÎÍÂÅÐÒÀÖ²¯" -#: ../fileio.c:3509 #, c-format msgid " in line %<PRId64>;" msgstr " ó ðÿäêó %<PRId64>;" -#: ../fileio.c:3519 msgid "[Device]" msgstr "[Ïðèñòð³é]" -#: ../fileio.c:3522 msgid "[New]" msgstr "[Íîâèé]" -#: ../fileio.c:3535 msgid " [a]" msgstr "[ä]" -#: ../fileio.c:3535 msgid " appended" msgstr " äîïèñàíèé" -#: ../fileio.c:3537 msgid " [w]" msgstr "[ç]" -#: ../fileio.c:3537 msgid " written" msgstr " çàïèñàíèé" -#: ../fileio.c:3579 msgid "E205: Patchmode: can't save original file" msgstr "E205: Ëàòàííÿ: íå âäàëîñÿ çáåðåãòè îðèã³íàë" -#: ../fileio.c:3602 msgid "E206: patchmode: can't touch empty original file" msgstr "E206: Ëàòàííÿ: íå âäàëîñÿ ñòâîðèòè îðèã³íàë" -#: ../fileio.c:3616 msgid "E207: Can't delete backup file" msgstr "E207: Íå âäàëîñÿ çíèùèòè ðåçåðâíèé ôàéë" -#: ../fileio.c:3672 msgid "" "\n" "WARNING: Original file may be lost or damaged\n" @@ -2308,134 +1811,105 @@ msgstr "" "\n" "ÇÀÑÒÅÐÅÆÅÍÍß: Îðèã³íàë, ìàáóòü, âòðà÷åíèé ÷è ïîøêîäæåíèé\n" -#: ../fileio.c:3675 msgid "don't quit the editor until the file is successfully written!" msgstr "Íå âèõîäüòå ç ðåäàêòîðà, äîêè ôàéë íå çàïèñàíî!" -#: ../fileio.c:3795 msgid "[dos]" msgstr "[dos]" -#: ../fileio.c:3795 msgid "[dos format]" msgstr "[ôîðìàò dos]" -#: ../fileio.c:3801 msgid "[mac]" msgstr "[mac]" -#: ../fileio.c:3801 msgid "[mac format]" msgstr "[ôîðìàò mac]" -#: ../fileio.c:3807 msgid "[unix]" msgstr "[unix]" -#: ../fileio.c:3807 msgid "[unix format]" msgstr "[ôîðìàò unix]" -#: ../fileio.c:3831 msgid "1 line, " msgstr "îäèí ðÿäîê, " -#: ../fileio.c:3833 #, c-format msgid "%<PRId64> lines, " msgstr "%<PRId64> ðÿäê³â, " -#: ../fileio.c:3836 msgid "1 character" msgstr "îäèí ñèìâîë" -#: ../fileio.c:3838 #, c-format msgid "%<PRId64> characters" msgstr "%<PRId64> ñèìâîë³â" -#: ../fileio.c:3849 msgid "[noeol]" msgstr "[noeol]" -#: ../fileio.c:3849 msgid "[Incomplete last line]" msgstr "[Íåïîâíèé îñòàíí³é ðÿäîê]" #. don't overwrite messages here #. must give this prompt #. don't use emsg() here, don't want to flush the buffers -#: ../fileio.c:3865 msgid "WARNING: The file has been changed since reading it!!!" msgstr "ÇÀÑÒÅÐÅÆÅÍÍß: Ôàéë çì³íèâñÿ ç ÷àñó îñòàííüîãî ÷èòàííÿ!!!" -#: ../fileio.c:3867 msgid "Do you really want to write to it" msgstr "Âè ñïðàâä³ õî÷åòå éîãî ïåðåïèñàòè??" -#: ../fileio.c:4648 #, c-format msgid "E208: Error writing to \"%s\"" msgstr "E208: Ïîìèëêà çàïèñó ó «%s»" -#: ../fileio.c:4655 #, c-format msgid "E209: Error closing \"%s\"" msgstr "E209: Ïîìèëêà çàêðèòòÿ «%s»" -#: ../fileio.c:4657 #, c-format msgid "E210: Error reading \"%s\"" msgstr "E210: Ïîìèëêà ÷èòàííÿ «%s»" -#: ../fileio.c:4883 msgid "E246: FileChangedShell autocommand deleted buffer" msgstr "E246: Àâòîêîìàíäà FileChangedShell çíèùèëà áóôåð" -#: ../fileio.c:4894 #, c-format msgid "E211: File \"%s\" no longer available" msgstr "E211: Ôàéë «%s» á³ëüøå íå äîñÿæíèé" -#: ../fileio.c:4906 #, c-format msgid "" "W12: Warning: File \"%s\" has changed and the buffer was changed in Vim as " "well" msgstr "W12: Çàñòåðåæåííÿ: Ôàéë «%s» çì³íèâñÿ, àëå é áóôåð ó Vim òàêîæ" -#: ../fileio.c:4907 msgid "See \":help W12\" for more info." msgstr "Äèâ. «:help W12» äëÿ óòî÷íåííÿ." -#: ../fileio.c:4910 #, c-format msgid "W11: Warning: File \"%s\" has changed since editing started" msgstr "W11: Çàñòåðåæåííÿ: Ôàéë «%s» çì³íèâñÿ ï³ñëÿ ïî÷àòêó ðåäàãóâàííÿ" -#: ../fileio.c:4911 msgid "See \":help W11\" for more info." msgstr "Äèâ. «:help W11» äëÿ óòî÷íåííÿ." -#: ../fileio.c:4914 #, c-format msgid "W16: Warning: Mode of file \"%s\" has changed since editing started" msgstr "W16: Çàñòåðåæåííÿ: Ðåæèì ôàéëó «%s» çì³íèâñÿ ï³ñëÿ ïî÷àòêó ðåäàãóâàííÿ" -#: ../fileio.c:4915 msgid "See \":help W16\" for more info." msgstr "Äèâ. «:help W16» äëÿ óòî÷íåííÿ." -#: ../fileio.c:4927 #, c-format msgid "W13: Warning: File \"%s\" has been created after editing started" msgstr "W13: Çàñòåðåæåííÿ: Ôàéë «%s» áóëî ñòâîðåíî ï³ñëÿ ïî÷àòêó ðåäàãóâàííÿ" -#: ../fileio.c:4947 msgid "Warning" msgstr "Çàñòåðåæåííÿ" -#: ../fileio.c:4948 msgid "" "&OK\n" "&Load File" @@ -2443,51 +1917,42 @@ msgstr "" "&O:Ãàðàçä\n" "&L:Çàâàíòàæèòè" -#: ../fileio.c:5065 #, c-format msgid "E462: Could not prepare for reloading \"%s\"" msgstr "E462: Íå âäàëîñÿ ï³äãîòóâàòè «%s», ùîá ïåðå÷èòàòè" -#: ../fileio.c:5078 #, c-format msgid "E321: Could not reload \"%s\"" msgstr "E321: Íå âäàëîñÿ ïåðå÷èòàòè «%s»" -#: ../fileio.c:5601 msgid "--Deleted--" msgstr "--Çíèùåíî--" -#: ../fileio.c:5732 #, c-format msgid "auto-removing autocommand: %s <buffer=%d>" msgstr "Àâòîìàòè÷íå çíèùåííÿ àâòîêîìàíäè: %s <áóôåð=%d>" #. the group doesn't exist -#: ../fileio.c:5772 #, c-format msgid "E367: No such group: \"%s\"" msgstr "E367: Íåìຠòàêî¿ ãðóïè: «%s»" -#: ../fileio.c:5897 #, c-format msgid "E215: Illegal character after *: %s" msgstr "E215: Íåäîçâîëåíèé ñèìâîë ï³ñëÿ *: %s" # msgstr "E215: " -#: ../fileio.c:5905 #, c-format msgid "E216: No such event: %s" msgstr "E216: Íåìຠòàêî¿ ïî䳿: %s" # msgstr "E215: " -#: ../fileio.c:5907 #, c-format msgid "E216: No such group or event: %s" msgstr "E216: Íåìຠòàêî¿ ãðóïè ÷è ïî䳿: %s" # msgstr "E216: " #. Highlight title -#: ../fileio.c:6090 msgid "" "\n" "--- Auto-Commands ---" @@ -2495,111 +1960,89 @@ msgstr "" "\n" "--- Àâòîêîìàíäè ---" -#: ../fileio.c:6293 #, c-format msgid "E680: <buffer=%d>: invalid buffer number " msgstr "E680: <áóôåð=%d>: íåêîðåêòíèé íîìåð áóôåðà " -#: ../fileio.c:6370 msgid "E217: Can't execute autocommands for ALL events" msgstr "E217: Íå ìîæó âèêîíóâàòè àâòîêîìàíäè äëÿ ÓÑ²Õ ïîä³é" # msgstr "E217: " -#: ../fileio.c:6393 msgid "No matching autocommands" msgstr "Íåìຠâ³äïîâ³äíèõ àâòîêîìàíä" -#: ../fileio.c:6831 msgid "E218: autocommand nesting too deep" msgstr "E218: Çàáàãàòî âêëàäåíèõ àâòîêîìàíä" # msgstr "E218: " -#: ../fileio.c:7143 #, c-format msgid "%s Auto commands for \"%s\"" msgstr "Àâòîêîìàíäè %s äëÿ «%s»" -#: ../fileio.c:7149 #, c-format msgid "Executing %s" msgstr "Âèêîíóºòüñÿ %s" -#: ../fileio.c:7211 #, c-format msgid "autocommand %s" msgstr "àâòîêîìàíäà %s" -#: ../fileio.c:7795 msgid "E219: Missing {." msgstr "E219: Áðàêóº {." # msgstr "E219: " -#: ../fileio.c:7797 msgid "E220: Missing }." msgstr "E220: Áðàêóº }." # msgstr "E220: " -#: ../fold.c:93 msgid "E490: No fold found" msgstr "E490: Çãîðòîê íå çíàéäåíî" # msgstr "E349: " -#: ../fold.c:544 msgid "E350: Cannot create fold with current 'foldmethod'" msgstr "E350: Íå âäàëîñÿ ñòâîðèòè çãîðòêó ìåòîäîì 'foldmethod'" -#: ../fold.c:546 msgid "E351: Cannot delete fold with current 'foldmethod'" msgstr "E351: Íå âäàëîñÿ çíèùèòè çãîðòêó ìåòîäîì 'foldmethod'" -#: ../fold.c:1784 #, c-format msgid "+--%3ld lines folded " msgstr "+-- çãîðíóòî %3ld ðÿäê³â " #. buffer has already been read -#: ../getchar.c:273 msgid "E222: Add to read buffer" msgstr "E222: Äîäàòè äî áóôåðà ÷èòàííÿ" -#: ../getchar.c:2040 msgid "E223: recursive mapping" msgstr "E223: Çàì³íà ðåêóðñèâíà" # msgstr "E223: " -#: ../getchar.c:2849 #, c-format msgid "E224: global abbreviation already exists for %s" msgstr "E224: Çàãàëüíå ñêîðî÷åííÿ äëÿ %s âæå ³ñíóº" # msgstr "E224: " -#: ../getchar.c:2852 #, c-format msgid "E225: global mapping already exists for %s" msgstr "E225: Çàãàëüíà çàì³íà äëÿ %s âæå ³ñíóº" # msgstr "E225: " -#: ../getchar.c:2952 #, c-format msgid "E226: abbreviation already exists for %s" msgstr "E226: Âæå º ñêîðî÷åííÿ äëÿ %s" # msgstr "E226: " -#: ../getchar.c:2955 #, c-format msgid "E227: mapping already exists for %s" msgstr "E227: Âæå º çàì³íà äëÿ %s" # msgstr "E227: " -#: ../getchar.c:3008 msgid "No abbreviation found" msgstr "Ñêîðî÷åííÿ íå çíàéäåíî" -#: ../getchar.c:3010 msgid "No mapping found" msgstr "Çàì³íè íå çíàéäåíî" -#: ../getchar.c:3974 msgid "E228: makemap: Illegal mode" msgstr "E228: makemap: Íåïðèïóñòèìèé ðåæèì" @@ -2607,7 +2050,6 @@ msgstr "E228: makemap: Íåïðèïóñòèìèé ðåæèì" #. key value of 'cedit' option #. type of cmdline window or 0 #. result of cmdline window or 0 -#: ../globals.h:924 msgid "--No lines in buffer--" msgstr "--Æîäíîãî ðÿäêà--" @@ -2615,680 +2057,526 @@ msgstr "--Æîäíîãî ðÿäêà--" #. * The error messages that can be shared are included here. #. * Excluded are errors that are only used once and debugging messages. #. -#: ../globals.h:996 msgid "E470: Command aborted" msgstr "E470: Êîìàíäó ïåðåðâàíî" -#: ../globals.h:997 msgid "E471: Argument required" msgstr "E471: Íåîáõ³äíî âêàçàòè àðãóìåíò" -#: ../globals.h:998 msgid "E10: \\ should be followed by /, ? or &" msgstr "E10: Çà \\ ìຠéòè /, ? àáî &" # msgstr "E10: " -#: ../globals.h:1000 msgid "E11: Invalid in command-line window; <CR> executes, CTRL-C quits" msgstr "E11: Íåïðèïóñòèìî ó â³êí³ êîìàíä, <CR> âèêîíóº, CTRL-C âèõîäèòü" -#: ../globals.h:1002 msgid "E12: Command not allowed from exrc/vimrc in current dir or tag search" msgstr "" "E12: Êîìàíäà íå äîçâîëåíà ó exrc/vimrc ó ïîøóêó ïîòî÷íîãî êàòàëîãó ÷è òå´ó" -#: ../globals.h:1003 msgid "E171: Missing :endif" msgstr "E171: Áðàêóº :endif" -#: ../globals.h:1004 msgid "E600: Missing :endtry" msgstr "E600: Áðàêóº :endtry" -#: ../globals.h:1005 msgid "E170: Missing :endwhile" msgstr "E170: Áðàêóº :endwhile" -#: ../globals.h:1006 msgid "E170: Missing :endfor" msgstr "E170: Áðàêóº :endfor" -#: ../globals.h:1007 msgid "E588: :endwhile without :while" msgstr "E588: :endwhile áåç :while" -#: ../globals.h:1008 msgid "E588: :endfor without :for" msgstr "E588: :endfor áåç :for" -#: ../globals.h:1009 msgid "E13: File exists (add ! to override)" msgstr "E13: Ôàéë ³ñíóº (! ùîá íå çâàæàòè)" -#: ../globals.h:1010 msgid "E472: Command failed" msgstr "E472: Êîìàíäà íà âäàëàñü" -#: ../globals.h:1011 msgid "E473: Internal error" msgstr "E473: Âíóòð³øíÿ ïîìèëêà" -#: ../globals.h:1012 msgid "Interrupted" msgstr "Ïåðåðâàíî" -#: ../globals.h:1013 msgid "E14: Invalid address" msgstr "E14: Íåïðàâèëüíà àäðåñà" # msgstr "E14: " -#: ../globals.h:1014 msgid "E474: Invalid argument" msgstr "E474: Íåêîðåêòíèé àðãóìåíò" -#: ../globals.h:1015 #, c-format msgid "E475: Invalid argument: %s" msgstr "E475: Íåêîðåêòíèé àðãóìåíò: %s" -#: ../globals.h:1016 #, c-format msgid "E15: Invalid expression: %s" msgstr "E15: Íåïðàâèëüíèé âèðàç: %s" # msgstr "E15: " -#: ../globals.h:1017 msgid "E16: Invalid range" msgstr "E16: Íåïðàâèëüí³ ìåæ³" # msgstr "E16: " -#: ../globals.h:1018 msgid "E476: Invalid command" msgstr "E476: Íåêîðåêòíà êîìàíäà" -#: ../globals.h:1019 #, c-format msgid "E17: \"%s\" is a directory" msgstr "E17: «%s» — öå êàòàëîã" -#: ../globals.h:1020 -#, fuzzy msgid "E900: Invalid job id" -msgstr "E49: Íåêîðåêòíèé ðîçì³ð çñóâó" +msgstr "E900: Íåêîðåêòíèé ³ä. çàâäàííÿ" -#: ../globals.h:1021 msgid "E901: Job table is full" -msgstr "" +msgstr "E901: Òàáëèöÿ çàâäàíü çàïîâíåíà" -#: ../globals.h:1022 #, c-format msgid "E902: \"%s\" is not an executable" -msgstr "" +msgstr "E902: \"%s\" íå ìîæíà âèêîíàòè" -#: ../globals.h:1024 #, c-format msgid "E364: Library call failed for \"%s()\"" msgstr "E364: Á³áë³îòå÷íèé âèêëèê äî «%s()» íå âäàâñÿ" # msgstr "E18: " -#: ../globals.h:1026 msgid "E19: Mark has invalid line number" msgstr "E19: Ó ïîì³òêè íåêîðåêòíèé íîìåð ðÿäêà" # msgstr "E19: " -#: ../globals.h:1027 msgid "E20: Mark not set" msgstr "E20: Ïîì³òêó íå âñòàíîâëåíî" # msgstr "E20: " -#: ../globals.h:1029 msgid "E21: Cannot make changes, 'modifiable' is off" msgstr "E21: Çì³íè íå äîçâîëåí³: âèìêíåíî 'modifiable'" # msgstr "E21: " -#: ../globals.h:1030 msgid "E22: Scripts nested too deep" msgstr "E22: Çàáàãàòî âêëàäåíèõ ñêðèïò³â" # msgstr "E22: " -#: ../globals.h:1031 msgid "E23: No alternate file" msgstr "E23: Íåìຠâòîðèííîãî ôàéëó" # msgstr "E23: " -#: ../globals.h:1032 msgid "E24: No such abbreviation" msgstr "E24: Òàêîãî ñêîðî÷åííÿ íåìàº" # msgstr "E24: " -#: ../globals.h:1033 msgid "E477: No ! allowed" msgstr "E477: ! íå äîçâîëåíî" -#: ../globals.h:1035 msgid "E25: Nvim does not have a built-in GUI" msgstr "E25: Íå ìîæíà âèêîðèñòàòè GUI: Íå ââ³ìêíåíî ï³ä ÷àñ êîìï³ëÿö³¿" # msgstr "E25: " -#: ../globals.h:1036 #, c-format msgid "E28: No such highlight group name: %s" msgstr "E28: Íåìຠòàêî¿ ãðóïè ï³äñâ³÷óâàííÿ: %s" # msgstr "E28: " -#: ../globals.h:1037 msgid "E29: No inserted text yet" msgstr "E29: Òåêñò ùå íå áóëî äîäàíî" # msgstr "E29: " -#: ../globals.h:1038 msgid "E30: No previous command line" msgstr "E30: Ùå íå áóëî êîìàíä" # msgstr "E30: " -#: ../globals.h:1039 msgid "E31: No such mapping" msgstr "E31: Íåìຠòàêî¿ çàì³íè" # msgstr "E31: " -#: ../globals.h:1040 msgid "E479: No match" msgstr "E479: Æîäíîãî çá³ãó" -#: ../globals.h:1041 #, c-format msgid "E480: No match: %s" msgstr "E480: Æîäíîãî çá³ãó: %s" -#: ../globals.h:1042 msgid "E32: No file name" msgstr "E32: Áðàêóº íàçâè ôàéëó" # msgstr "E32: " -#: ../globals.h:1044 msgid "E33: No previous substitute regular expression" msgstr "E33: Çàì³íà çðàçê³â ùå íå âèêîðèñòîâóâàëàñü" # msgstr "E33: " -#: ../globals.h:1045 msgid "E34: No previous command" msgstr "E34: Êîìàíä ùå íå áóëî" # msgstr "E34: " -#: ../globals.h:1046 msgid "E35: No previous regular expression" msgstr "E35: Çðàçê³â ïîøóêó ùå íå áóëî" # msgstr "E35: " -#: ../globals.h:1047 msgid "E481: No range allowed" msgstr "E481: Íå äîçâîëåíî âêàçóâàòè ìåæ³" -#: ../globals.h:1048 msgid "E36: Not enough room" msgstr "E36: ̳ñöÿ íå âèñòà÷èòü" # msgstr "E36: " -#: ../globals.h:1049 #, c-format msgid "E482: Can't create file %s" msgstr "E482: Íå âäàëîñÿ ñòâîðèòè ôàéë %s" -#: ../globals.h:1050 msgid "E483: Can't get temp file name" msgstr "E483: Íå âäàëîñÿ ñôîðìóâàòè íàçâó òèì÷àñîâîãî ôàéëó" -#: ../globals.h:1051 #, c-format msgid "E484: Can't open file %s" msgstr "E484: Íå âäàëîñÿ â³äêðèòè ôàéë %s" -#: ../globals.h:1052 #, c-format msgid "E485: Can't read file %s" msgstr "E485: Íå âäàëîñÿ ïðî÷èòàòè ôàéë %s" -#: ../globals.h:1054 msgid "E37: No write since last change (add ! to override)" msgstr "E37: Çì³íè íå áóëî çàïèñàíî (! ùîá íå çâàæàòè)" -#: ../globals.h:1055 -#, fuzzy msgid "E37: No write since last change" -msgstr "[Çì³íè íå çàïèñàíî]\n" +msgstr "E37: Íå çàïèñàíî ï³ñëÿ îñòàíí³õ çì³í" -#: ../globals.h:1056 msgid "E38: Null argument" msgstr "E38: ³äñóòí³é àðãóìåíò" -#: ../globals.h:1057 msgid "E39: Number expected" msgstr "E39: Î÷³êóºòüñÿ ÷èñëî" -#: ../globals.h:1058 #, c-format msgid "E40: Can't open errorfile %s" msgstr "E40: Íå âäàëîñÿ â³äêðèòè ôàéë ïîìèëîê %s" -#: ../globals.h:1059 msgid "E41: Out of memory!" msgstr "E41: Çàáðàêëî ïàì'ÿò³!" -#: ../globals.h:1060 msgid "Pattern not found" msgstr "Çðàçîê íå çíàéäåíî" -#: ../globals.h:1061 #, c-format msgid "E486: Pattern not found: %s" msgstr "E486: Çðàçîê íå çíàéäåíî: %s" -#: ../globals.h:1062 msgid "E487: Argument must be positive" msgstr "E487: Àðãóìåíò ìຠáóòè äîäàòíèé" -#: ../globals.h:1064 msgid "E459: Cannot go back to previous directory" msgstr "E459: Íå âäàëîñÿ ïåðåéòè äî ïîïåðåäíüîãî êàòàëîãó" -#: ../globals.h:1066 msgid "E42: No Errors" msgstr "E42: Æîäíî¿ ïîìèëêè" -#: ../globals.h:1067 msgid "E776: No location list" msgstr "E776: Íåìຠñïèñêó ì³ñöü" -#: ../globals.h:1068 msgid "E43: Damaged match string" msgstr "E43: Òåêñò çá³ãó ïîøêîäæåíî" -#: ../globals.h:1069 msgid "E44: Corrupted regexp program" msgstr "E44: dzïñîâàíà ïðîãðàìà ðåãóëÿðíèõ âèðàç³â" -#: ../globals.h:1071 msgid "E45: 'readonly' option is set (add ! to override)" msgstr "E45: Âñòàíîâëåíî îïö³þ 'readonly' (! ùîá íå çâàæàòè)" -#: ../globals.h:1073 #, c-format msgid "E46: Cannot change read-only variable \"%s\"" msgstr "E46: Çì³ííà ò³ëüêè äëÿ ÷èòàííÿ: «%s»" -#: ../globals.h:1075 #, c-format msgid "E794: Cannot set variable in the sandbox: \"%s\"" msgstr "E794: Íå ìîæíà âñòàíîâèòè çì³ííó ó ï³ñî÷íèö³: «%s»" -#: ../globals.h:1076 msgid "E47: Error while reading errorfile" msgstr "E47: Ïîìèëêà ÷èòàííÿ ôàéëó ïîìèëîê" -#: ../globals.h:1078 msgid "E48: Not allowed in sandbox" msgstr "E48: Íà äîçâîëåíî ó ï³ñî÷íèö³" -#: ../globals.h:1080 msgid "E523: Not allowed here" msgstr "E523: Íå äîçâîëåíî òóò" -#: ../globals.h:1082 msgid "E359: Screen mode setting not supported" msgstr "E359: Ðåæèì åêðàíó íå ï³äòðèìóºòüñÿ" -#: ../globals.h:1083 msgid "E49: Invalid scroll size" msgstr "E49: Íåêîðåêòíèé ðîçì³ð çñóâó" -#: ../globals.h:1084 msgid "E91: 'shell' option is empty" msgstr "E91: Îïö³ÿ 'shell' ïîðîæíÿ" # msgstr "E254: " -#: ../globals.h:1085 msgid "E255: Couldn't read in sign data!" msgstr "E255: Íå ìîæíà ç÷èòàòè äàí³ íàïèñó!" -#: ../globals.h:1086 msgid "E72: Close error on swap file" msgstr "E72: Ïîìèëêà ï³ä ÷àñ çàêðèòòÿ ôàéëó îáì³íó" -#: ../globals.h:1087 msgid "E73: tag stack empty" msgstr "E73: Ñòåê òå´³â ïîðîæí³é" -#: ../globals.h:1088 msgid "E74: Command too complex" msgstr "E74: Çàíàäòî ñêëàäíà êîìàíäà" -#: ../globals.h:1089 msgid "E75: Name too long" msgstr "E75: Çàäîâãå ³ì'ÿ" -#: ../globals.h:1090 msgid "E76: Too many [" msgstr "E76: Çàáàãàòî '['" -#: ../globals.h:1091 msgid "E77: Too many file names" msgstr "E77: Çàáàãàòî íàçâ ôàéë³â" -#: ../globals.h:1092 msgid "E488: Trailing characters" msgstr "E488: Íàäëèøêîâ³ ñèìâîëè" -#: ../globals.h:1093 msgid "E78: Unknown mark" msgstr "E78: Íåâ³äîìà ïîì³òêà" -#: ../globals.h:1094 msgid "E79: Cannot expand wildcards" msgstr "E79: Íå âäàëîñÿ ðîçêðèòè øàáëîí" -#: ../globals.h:1096 msgid "E591: 'winheight' cannot be smaller than 'winminheight'" msgstr "E591: 'winheight' íå ìîæå áóòè ìåíøèì çà 'winminheight'" -#: ../globals.h:1098 msgid "E592: 'winwidth' cannot be smaller than 'winminwidth'" msgstr "E592: 'winwidth' íå ìîæå áóòè ìåíøèì çà 'winminwidth'" # msgstr "E79: " -#: ../globals.h:1099 msgid "E80: Error while writing" msgstr "E80: Ïîìèëêà ï³ä ÷àñ çàïèñó" -#: ../globals.h:1100 msgid "Zero count" msgstr "Íóëüîâà ê³ëüê³ñòü" -#: ../globals.h:1101 msgid "E81: Using <SID> not in a script context" msgstr "E81: <SID> âèêîðèñòîâóºòüñÿ íå â êîíòåêñò³ ñêðèïòó" -#: ../globals.h:1102 #, c-format msgid "E685: Internal error: %s" msgstr "E685: Âíóòð³øíÿ ïîìèëêà: %s" -#: ../globals.h:1104 msgid "E363: pattern uses more memory than 'maxmempattern'" msgstr "E363: Çðàçîê âèêîðèñòîâóº á³ëüøå, í³æ 'maxmempattern', ïàì'ÿò³" -#: ../globals.h:1105 msgid "E749: empty buffer" msgstr "E749: Ïîðîæí³é áóôåð" -#: ../globals.h:1108 msgid "E682: Invalid search pattern or delimiter" msgstr "E682: Íåêîðåêòíèé çðàçîê äëÿ ïîøóêó ÷è ðîçä³ëüíèê" -#: ../globals.h:1109 msgid "E139: File is loaded in another buffer" msgstr "E139: Ôàéë óæå çàâàíòàæåíî â ³íøèé áóôåð" # msgstr "E235: " -#: ../globals.h:1110 #, c-format msgid "E764: Option '%s' is not set" msgstr "E764: Îïö³ÿ '%s' íå âñòàíîâëåíà" -#: ../globals.h:1111 msgid "E850: Invalid register name" msgstr "E850: Íåïðàâèëüíà íàçâà ðåã³ñòðó" -#: ../globals.h:1114 msgid "search hit TOP, continuing at BOTTOM" msgstr "Ïîøóê ä³éøîâ äî ÏÎ×ÀÒÊÓ, ïðîäîâæóºòüñÿ ç ʲÍÖß" -#: ../globals.h:1115 msgid "search hit BOTTOM, continuing at TOP" msgstr "Ïîøóê ä³éøîâ äî ʲÍÖß, ïðîäîâæóºòüñÿ ç ÏÎ×ÀÒÊÓ" -#: ../hardcopy.c:240 msgid "E550: Missing colon" msgstr "E550: Ïðîïóùåíî äâîêðàïêó" # msgstr "E347: " -#: ../hardcopy.c:252 msgid "E551: Illegal component" msgstr "E551: Íåêîðåêòíèé êîìïîíåíò" -#: ../hardcopy.c:259 msgid "E552: digit expected" msgstr "E552: î÷³êóºòüñÿ öèôðà" -#: ../hardcopy.c:473 #, c-format msgid "Page %d" msgstr "Ñòîð³íêà %d" -#: ../hardcopy.c:597 msgid "No text to be printed" msgstr "ͳ÷îãî äðóêóâàòè" -#: ../hardcopy.c:668 #, c-format msgid "Printing page %d (%d%%)" msgstr "Äðóêóºòüñÿ ñòîð³íêà %d (%d%%)" -#: ../hardcopy.c:680 #, c-format msgid " Copy %d of %d" msgstr " Êîï³ÿ %d ç %d" -#: ../hardcopy.c:733 #, c-format msgid "Printed: %s" msgstr "Íàäðóêîâàíî: %s" -#: ../hardcopy.c:740 msgid "Printing aborted" msgstr "Äðóê ïåðåðâàíî" -#: ../hardcopy.c:1365 msgid "E455: Error writing to PostScript output file" msgstr "E455: Íå âäàëîñÿ çàïèñàòè âèõ³äíèé ôàéë PostScript" -#: ../hardcopy.c:1747 #, c-format msgid "E624: Can't open file \"%s\"" msgstr "E624: Íå âäàëîñÿ â³äêðèòè ôàéë «%s»" -#: ../hardcopy.c:1756 ../hardcopy.c:2470 #, c-format msgid "E457: Can't read PostScript resource file \"%s\"" msgstr "E457: Íå âäàëîñÿ ïðî÷èòàòè ôàéë ðåñóðñ³â PostScript «%s»" -#: ../hardcopy.c:1772 #, c-format msgid "E618: file \"%s\" is not a PostScript resource file" msgstr "E618: «%s» íå º ôàéëîì ðåñóðñ³â PostScript" -#: ../hardcopy.c:1788 ../hardcopy.c:1805 ../hardcopy.c:1844 #, c-format msgid "E619: file \"%s\" is not a supported PostScript resource file" msgstr "E619: «%s» íå º ï³äòðèìóâàíèì ôàéëîì ðåñóðñ³â PostScript" -#: ../hardcopy.c:1856 #, c-format msgid "E621: \"%s\" resource file has wrong version" msgstr "E621: Íåïðàâèëüíà âåðñ³ÿ ôàéëó ðåñóðñ³â «%s»" -#: ../hardcopy.c:2225 msgid "E673: Incompatible multi-byte encoding and character set." msgstr "E673: Íåñóì³ñí³ áàãàòîáàéòîâå êîäóâàííÿ é íàá³ð ñèìâîë³â." -#: ../hardcopy.c:2238 msgid "E674: printmbcharset cannot be empty with multi-byte encoding." msgstr "" "E674: printmbcharset íå ìîæå áóòè ïîðîæí³ì ç áàãàòîáàéòîâèì êîäóâàííÿì." -#: ../hardcopy.c:2254 msgid "E675: No default font specified for multi-byte printing." msgstr "E675: Íå çàçíà÷åíî øðèôò äëÿ áàãàòîáàéòîâîãî äðóêó." -#: ../hardcopy.c:2426 msgid "E324: Can't open PostScript output file" msgstr "E324: Íå âäàëîñÿ â³äêðèòè ôàéë PostScript äëÿ âèâîäó" -#: ../hardcopy.c:2458 #, c-format msgid "E456: Can't open file \"%s\"" msgstr "E456: Íå âäàëîñÿ â³äêðèòè ôàéë «%s»" -#: ../hardcopy.c:2583 msgid "E456: Can't find PostScript resource file \"prolog.ps\"" msgstr "E456: Íå âäàëîñÿ çíàéòè ôàéë ðåñóðñ³â PostScript «prolog.ps»" -#: ../hardcopy.c:2593 msgid "E456: Can't find PostScript resource file \"cidfont.ps\"" msgstr "E456: Íå âäàëîñÿ çíàéòè ôàéë ðåñóðñ³â PostScript «cidfont.ps»" -#: ../hardcopy.c:2622 ../hardcopy.c:2639 ../hardcopy.c:2665 #, c-format msgid "E456: Can't find PostScript resource file \"%s.ps\"" msgstr "E456: Íå âäàëîñÿ çíàéòè ôàéë ðåñóðñ³â PostScript «%s.ps»" -#: ../hardcopy.c:2654 #, c-format msgid "E620: Unable to convert to print encoding \"%s\"" msgstr "E620: Íå âäàëîñÿ ïåðåòâîðèòè äî êîäóâàííÿ äðóêó «%s»" -#: ../hardcopy.c:2877 msgid "Sending to printer..." msgstr "³äñèëàºòüñÿ íà ïðèíòåð..." -#: ../hardcopy.c:2881 msgid "E365: Failed to print PostScript file" msgstr "E365: Íå âäàëîñÿ íàäðóêóâàòè ôàéë PostScript" -#: ../hardcopy.c:2883 msgid "Print job sent." msgstr "Çàâäàííÿ äðóêó â³ä³ñëàíî." # msgstr "E255: " -#: ../if_cscope.c:85 msgid "Add a new database" msgstr "Äîäàòè íîâó áàçó äàíèõ" -#: ../if_cscope.c:87 msgid "Query for a pattern" msgstr "Çàïèò çà çðàçêîì" -#: ../if_cscope.c:89 msgid "Show this message" msgstr "Ïîêàçàòè öå ïîâ³äîìëåííÿ" -#: ../if_cscope.c:91 msgid "Kill a connection" msgstr "Çíèùèòè ç'ºäíàííÿ" -#: ../if_cscope.c:93 msgid "Reinit all connections" msgstr "Ïåðåçàïóñòèòè óñ³ ç'ºäíàííÿ" -#: ../if_cscope.c:95 msgid "Show connections" msgstr "Ïîêàçàòè ç'ºäíàííÿ" -#: ../if_cscope.c:101 #, c-format msgid "E560: Usage: cs[cope] %s" msgstr "E560: Âèêîðèñòàííÿ: cs[cope] %s" -#: ../if_cscope.c:225 msgid "This cscope command does not support splitting the window.\n" msgstr "Öÿ êîìàíäà cscope íå â쳺 ä³ëèòè â³êíî.\n" -#: ../if_cscope.c:266 msgid "E562: Usage: cstag <ident>" msgstr "E562: Âèêîðèñòàííÿ: cstag <³äåíòèô-îð>" -#: ../if_cscope.c:313 msgid "E257: cstag: tag not found" msgstr "E257: cstag: òå´ íå çíàéäåíî" # msgstr "E257: " -#: ../if_cscope.c:461 #, c-format msgid "E563: stat(%s) error: %d" msgstr "E563: stat(%s) ïîìèëêà: %d" -#: ../if_cscope.c:551 #, c-format msgid "E564: %s is not a directory or a valid cscope database" msgstr "E564: %s íå º í³ êàòàëîãîì, í³ áàçîþ äàíèõ cscope" -#: ../if_cscope.c:566 #, c-format msgid "Added cscope database %s" msgstr "Äîäàíî áàçó äàíèõ cscope %s" -#: ../if_cscope.c:616 #, c-format msgid "E262: error reading cscope connection %<PRId64>" msgstr "E262: Ïîìèëêà ÷èòàííÿ ç³ ç'ºäíàííÿ cscope %<PRId64>" -#: ../if_cscope.c:711 msgid "E561: unknown cscope search type" msgstr "E561: Íåâ³äîìèé òèï ïîøóêó cscope" -#: ../if_cscope.c:752 ../if_cscope.c:789 msgid "E566: Could not create cscope pipes" msgstr "E566: Íå âäàëîñÿ ñòâîðèòè êàíàëè äî cscope" -#: ../if_cscope.c:767 msgid "E622: Could not fork for cscope" msgstr "E622: Íå âäàëîñÿ ðîçä³ëèòè ïðîöåñ äëÿ cscope" -#: ../if_cscope.c:849 msgid "cs_create_connection setpgid failed" msgstr "cs_create_connection: ïîìèëêà setpgid" -#: ../if_cscope.c:853 ../if_cscope.c:889 msgid "cs_create_connection exec failed" msgstr "cs_create_connection: ïîìèëêà ï³ä ÷àñ âèêîíàííÿ" -#: ../if_cscope.c:863 ../if_cscope.c:902 msgid "cs_create_connection: fdopen for to_fp failed" msgstr "cs_create_connection: fdopen äëÿ to_fp íå âäàâñÿ" -#: ../if_cscope.c:865 ../if_cscope.c:906 msgid "cs_create_connection: fdopen for fr_fp failed" msgstr "cs_create_connection: fdopen äëÿ fr_fp íå âäàâñÿ" -#: ../if_cscope.c:890 msgid "E623: Could not spawn cscope process" msgstr "E623: Íå âäàëîñÿ ñòâîðèòè ïðîöåñ cscope" -#: ../if_cscope.c:932 msgid "E567: no cscope connections" msgstr "E567: æîäíîãî ç'ºäíàííÿ ³ç cscope" -#: ../if_cscope.c:1009 #, c-format msgid "E469: invalid cscopequickfix flag %c for %c" msgstr "E469: Íåêîðåêòíèé ïðàïîðåöü cscopequickfix %c äëÿ %c" # msgstr "E258: " -#: ../if_cscope.c:1058 #, c-format msgid "E259: no matches found for cscope query %s of %s" msgstr "E259: Äëÿ çàïèòó cscope %s ç %s í³÷îãî íå çíàéäåíî" # msgstr "E259: " -#: ../if_cscope.c:1142 msgid "cscope commands:\n" msgstr "Êîìàíäè cscope:\n" -#: ../if_cscope.c:1150 #, c-format msgid "%-5s: %s%*s (Usage: %s)" msgstr "%-5s: %s%*s (Âèêîðèñòàííÿ: %s)" -#: ../if_cscope.c:1155 msgid "" "\n" " c: Find functions calling this function\n" @@ -3310,32 +2598,26 @@ msgstr "" " s: Çíàéòè öåé ñèìâîë C\n" " t: Çíàéòè öåé òåêñò\n" -#: ../if_cscope.c:1226 msgid "E568: duplicate cscope database not added" msgstr "E568: Ïîâòîðíà áàçà äàíèõ cscope íå äîäàíà" # msgstr "E260: " -#: ../if_cscope.c:1335 #, c-format msgid "E261: cscope connection %s not found" msgstr "E261: Ç'ºäíàííÿ ç cscope %s íå çíàéäåíî" -#: ../if_cscope.c:1364 #, c-format msgid "cscope connection %s closed" msgstr "Ç'ºäíàííÿ ç cscope %s çàê³í÷åíî" #. should not reach here -#: ../if_cscope.c:1486 msgid "E570: fatal error in cs_manage_matches" msgstr "E570: Ôàòàëüíà ïîìèëêà â cs_manage_matches" -#: ../if_cscope.c:1693 #, c-format msgid "Cscope tag: %s" msgstr "Òå´ cscope: %s" -#: ../if_cscope.c:1711 msgid "" "\n" " # line" @@ -3343,89 +2625,69 @@ msgstr "" "\n" " # ðÿäîê" -#: ../if_cscope.c:1713 msgid "filename / context / line\n" msgstr "ôàéë / êîíòåêñò / ðÿäîê\n" -#: ../if_cscope.c:1809 #, c-format msgid "E609: Cscope error: %s" msgstr "E609: Ïîìèëêà cscope: %s" -#: ../if_cscope.c:2053 msgid "All cscope databases reset" msgstr "Óñ³ áàçè äàíèõ cscope ïåðåçàâàíòàæåíî" -#: ../if_cscope.c:2123 msgid "no cscope connections\n" msgstr "Æîäíîãî ç'ºäíàííÿ ç cscope\n" -#: ../if_cscope.c:2126 msgid " # pid database name prepend path\n" msgstr " # pid íàçâà áàçè äàíèõ øëÿõ\n" -#: ../main.c:144 msgid "Unknown option argument" msgstr "Íåâ³äîìèé àðãóìåíò îïö³¿" -#: ../main.c:146 msgid "Too many edit arguments" msgstr "Çàáàãàòî àðãóìåíò³â" -#: ../main.c:148 msgid "Argument missing after" msgstr "Ïðîïóùåíî àðãóìåíò ï³ñëÿ" -#: ../main.c:150 msgid "Garbage after option argument" msgstr "Ñì³òòÿ ï³ñëÿ àðãóìåíòó îïö³¿" -#: ../main.c:152 msgid "Too many \"+command\", \"-c command\" or \"--cmd command\" arguments" msgstr "Çàáàãàòî àðãóìåíò³â ó «+êîìàíäà», «-c êîìàíäà» àáî «--cmd êîìàíäà»" # msgstr "E14: " -#: ../main.c:154 msgid "Invalid argument for" msgstr "Íåïðàâèëüíèé àðãóìåíò ó" -#: ../main.c:294 #, c-format msgid "%d files to edit\n" msgstr "%d ôàéëè(³â)\n" -#: ../main.c:1342 msgid "Attempt to open script file again: \"" msgstr "Ñïðîáà ïîâòîðíî â³äêðèòè ñêðèïò: \"" -#: ../main.c:1350 msgid "Cannot open for reading: \"" msgstr "Íå âäàëîñÿ ïðî÷èòàòè: \"" -#: ../main.c:1393 msgid "Cannot open for script output: \"" msgstr "Íå âäàëîñÿ â³äêðèòè ÿê âèõ³äíèé ôàéë: \"" -#: ../main.c:1622 msgid "Vim: Warning: Output is not to a terminal\n" msgstr "Vim: Çàñòåðåæåííÿ: Âèâ³ä íå ó òåðì³íàë\n" -#: ../main.c:1624 msgid "Vim: Warning: Input is not from a terminal\n" msgstr "Vim: Çàñòåðåæåííÿ: Óâåäåííÿ íå ç òåðì³íàëó\n" #. just in case.. -#: ../main.c:1891 msgid "pre-vimrc command line" msgstr "êîìàíäè ïåðåä vimrc" -#: ../main.c:1964 #, c-format msgid "E282: Cannot read from \"%s\"" msgstr "E282: Íå âäàëîñÿ ïðî÷èòàòè ç «%s»" # msgstr "E282: " -#: ../main.c:2149 msgid "" "\n" "More info with: \"vim -h\"\n" @@ -3433,23 +2695,18 @@ msgstr "" "\n" "ijçíàéòåñÿ á³ëüøå: «vim -h»\n" -#: ../main.c:2178 msgid "[file ..] edit specified file(s)" msgstr "[ôàéë ..] ðåäàãóâàòè âêàçàí³ ôàéëè" -#: ../main.c:2179 msgid "- read text from stdin" msgstr "- ÷èòàòè òåêñò ç stdin" -#: ../main.c:2180 msgid "-t tag edit file where tag is defined" msgstr "-t ïîì³òêà ïåðåéòè äî òå´ó" -#: ../main.c:2181 msgid "-q [errorfile] edit file with first error" msgstr "-q [ôàéë] ïåðåéòè äî ïåðøî¿ ïîìèëêè" -#: ../main.c:2187 msgid "" "\n" "\n" @@ -3459,11 +2716,9 @@ msgstr "" "\n" "Âæèòîê:" -#: ../main.c:2189 msgid " vim [arguments] " msgstr " vim [àðãóìåíòè] " -#: ../main.c:2193 msgid "" "\n" " or:" @@ -3471,7 +2726,6 @@ msgstr "" "\n" " àáî:" -#: ../main.c:2196 msgid "" "\n" "\n" @@ -3481,192 +2735,146 @@ msgstr "" "\n" "Àðãóìåíòè:\n" -#: ../main.c:2197 msgid "--\t\t\tOnly file names after this" msgstr "--\t\t\tËèøå íàçâè ôàéë³â ï³ñëÿ öüîãî" -#: ../main.c:2199 msgid "--literal\t\tDon't expand wildcards" msgstr "--literal\t\tÍå ðîçêðèâàòè øàáëîíè" -#: ../main.c:2201 msgid "-v\t\t\tVi mode (like \"vi\")" msgstr "-v\t\t\tÐåæèì Vi (í³áè «vi»)" -#: ../main.c:2202 msgid "-e\t\t\tEx mode (like \"ex\")" msgstr "-e\t\t\tÐåæèì Ex (í³áè «ex»)" -#: ../main.c:2203 msgid "-E\t\t\tImproved Ex mode" msgstr "-E\t\t\tÏîêðàùåíèé ðåæèì Ex" -#: ../main.c:2204 msgid "-s\t\t\tSilent (batch) mode (only for \"ex\")" msgstr "-s\t\t\tÌîâ÷àçíèé (ïàêåòíèé) ðåæèì (ëèøå äëÿ «ex»)" -#: ../main.c:2205 msgid "-d\t\t\tDiff mode (like \"vimdiff\")" msgstr "-d\t\t\tÐåæèì ïîð³âíÿííÿ (í³áè «vimdiff»)" -#: ../main.c:2206 msgid "-y\t\t\tEasy mode (like \"evim\", modeless)" msgstr "-y\t\t\tÏðîñòèé ðåæèì (í³áè «evim», áåç ðåæèì³â)" -#: ../main.c:2207 msgid "-R\t\t\tReadonly mode (like \"view\")" msgstr "-R\t\t\tÐåæèì ïåðåãëÿäó (í³áè «view»)" -#: ../main.c:2208 msgid "-Z\t\t\tRestricted mode (like \"rvim\")" msgstr "-Z\t\t\tÎáìåæåíèé ðåæèì (í³áè «rvim»)" -#: ../main.c:2209 msgid "-m\t\t\tModifications (writing files) not allowed" msgstr "-m\t\t\tÇì³íè (çàïèñ ôàéë³â) íå äîçâîëåíî" -#: ../main.c:2210 msgid "-M\t\t\tModifications in text not allowed" msgstr "-M\t\t\tÇì³íè â òåêñò³ ôàéë³â íå äîçâîëåíî" -#: ../main.c:2211 msgid "-b\t\t\tBinary mode" msgstr "-b\t\t\tÄâ³éêîâèé ðåæèì" -#: ../main.c:2212 msgid "-l\t\t\tLisp mode" msgstr "-l\t\t\tÐåæèì lisp" -#: ../main.c:2213 msgid "-C\t\t\tCompatible with Vi: 'compatible'" msgstr "-C\t\t\tÑóì³ñíèé ç Vi ðåæèì: 'compatible'" -#: ../main.c:2214 msgid "-N\t\t\tNot fully Vi compatible: 'nocompatible'" msgstr "-N\t\t\tÍå çîâñ³ì ñóì³ñíèé ç Vi ðåæèì: 'nocompatible'" -#: ../main.c:2215 msgid "-V[N][fname]\t\tBe verbose [level N] [log messages to fname]" msgstr "-V[N][ôàéë]\t\tÁ³ëüøå ïîâ³äîìëåíü [ð³âåíü N] [ôàéë æóðí. ïîâ³äîìëåíü]" -#: ../main.c:2216 msgid "-D\t\t\tDebugging mode" msgstr "-D\t\t\tÐåæèì íàëàãîäæåííÿ" -#: ../main.c:2217 msgid "-n\t\t\tNo swap file, use memory only" msgstr "-n\t\t\tÍå âèêîðèñòîâóâàòè ôàéë îáì³íó, òðèìàòè óñå â ïàì'ÿò³" -#: ../main.c:2218 msgid "-r\t\t\tList swap files and exit" msgstr "-r\t\t\tÏîêàçàòè ôàéëè îáì³íó ³ âèéòè" -#: ../main.c:2219 msgid "-r (with file name)\tRecover crashed session" msgstr "-r (íàçâà ôàéëó)\t³äíîâèòè àâàð³éíî çàê³í÷åíèé ñåàíñ" -#: ../main.c:2220 msgid "-L\t\t\tSame as -r" msgstr "-L\t\t\tÒå ñàìå, ùî é -r" -#: ../main.c:2221 msgid "-A\t\t\tstart in Arabic mode" msgstr "-A\t\t\tÇàïóñòèòè â ðåæèì³ àðàáñüêî¿ ìîâè" -#: ../main.c:2222 msgid "-H\t\t\tStart in Hebrew mode" msgstr "-H\t\t\tÇàïóñòèòè â ðåæèì³ ³âðèòó" -#: ../main.c:2223 msgid "-F\t\t\tStart in Farsi mode" msgstr "-F\t\t\tÇàïóñòèòè â ðåæèì³ ïåðñüêî¿ ìîâè" -#: ../main.c:2224 msgid "-T <terminal>\tSet terminal type to <terminal>" msgstr "-T <òåðì³íàë>\tÂñòàíîâèòè òèï òåðì³íàëó ó <òåðì³íàë>" -#: ../main.c:2225 msgid "-u <vimrc>\t\tUse <vimrc> instead of any .vimrc" msgstr "-u <vimrc>\t\tÂèêîðèñòàòè ïîäàíèé ôàéë çàì³ñòü .vimrc" -#: ../main.c:2226 msgid "--noplugin\t\tDon't load plugin scripts" msgstr "--noplugin\t\tÍå âàíòàæèòè ñêðèïòè äîïîâíåííÿ" -#: ../main.c:2227 msgid "-p[N]\t\tOpen N tab pages (default: one for each file)" msgstr "-p[N]\t\t³äêðèòè N âêëàäîê (àáî ïî îäí³é äëÿ êîæíîãî ôàéëó)" -#: ../main.c:2228 msgid "-o[N]\t\tOpen N windows (default: one for each file)" msgstr "-o[N]\t\t³äêðèòè N â³êîí (àáî ïî îäíîìó äëÿ êîæíîãî ôàéëó)" -#: ../main.c:2229 msgid "-O[N]\t\tLike -o but split vertically" msgstr "-O[N]\t\tͳáè -o, àëå ïîä³ëèòè â³êíà âåðòèêàëüíî" -#: ../main.c:2230 msgid "+\t\t\tStart at end of file" msgstr "+\t\t\tÐîçïî÷àòè â ê³íö³ ôàéëó" -#: ../main.c:2231 msgid "+<lnum>\t\tStart at line <lnum>" msgstr "+<ðÿäîê>\t\tÐîçïî÷àòè ó âêàçàíîìó <ðÿäêó>" -#: ../main.c:2232 msgid "--cmd <command>\tExecute <command> before loading any vimrc file" msgstr "--cmd <êîìàíäà>\tÂèêîíàòè <êîìàíäó> ïåðåä çàâàíòàæåííÿì vimrc" -#: ../main.c:2233 msgid "-c <command>\t\tExecute <command> after loading the first file" msgstr "-c <êîìàíäà>\t\tÂèêîíàòè <êîìàíäó> ï³ñëÿ çàâàíòàæåííÿ ïåðøîãî ôàéëó" -#: ../main.c:2235 msgid "-S <session>\t\tSource file <session> after loading the first file" msgstr "-S <ñåàíñ>\t\tÂèêîíàòè ïîäàíèé ôàéë ï³ñëÿ ïåðøîãî çàâàíòàæåíîãî ôàéëó" -#: ../main.c:2236 msgid "-s <scriptin>\tRead Normal mode commands from file <scriptin>" msgstr "-s <ñêðèïò>\t\tÇ÷èòàòè êîìàíäè íîðìàëüíîãî ðåæèìó ç ôàéëó <ñêðèïò>" -#: ../main.c:2237 msgid "-w <scriptout>\tAppend all typed commands to file <scriptout>" msgstr "-w <ñêðèïò>\t\tÄîïèñàòè óñ³ íàáðàí³ êîìàíäè äî ôàéëó <ñêðèïò>" -#: ../main.c:2238 msgid "-W <scriptout>\tWrite all typed commands to file <scriptout>" msgstr "-w <ñêðèïò>\t\tÇàïèñàòè óñ³ íàáðàí³ êîìàíäè ó ôàéë <ñêðèïò>" -#: ../main.c:2240 msgid "--startuptime <file>\tWrite startup timing messages to <file>" msgstr "" "--startuptime <ôàéë>\tÇàïèñàòè çàïóñêí³ ïîâ³äîìëåííÿ ç ÷àñîâèìè â³äì³òêàìè " "äî <ôàéëó>" -#: ../main.c:2242 msgid "-i <viminfo>\t\tUse <viminfo> instead of .viminfo" msgstr "-i <viminfo>\t\tÂèêîðèñòàòè <viminfo> çàì³ñòü .viminfo" -#: ../main.c:2243 msgid "-h or --help\tPrint Help (this message) and exit" msgstr "-h ÷è --help\tÍàäðóêóâàòè öå ïîâ³äîìëåííÿ ³ âèéòè" -#: ../main.c:2244 msgid "--version\t\tPrint version information and exit" msgstr "--version\t\tÍàäðóêóâàòè ³íôîðìàö³þ ïðî âåðñ³þ ïðîãðàìè ³ âèéòè" -#: ../mark.c:676 msgid "No marks set" msgstr "Íå âñòàíîâëåíî æîäíî¿ ïîì³òêè" -#: ../mark.c:678 #, c-format msgid "E283: No marks matching \"%s\"" msgstr "E283: Ïîì³òêó «%s» íå çíàéäåíî" # msgstr "E283: " #. Highlight title -#: ../mark.c:687 msgid "" "\n" "mark line col file/text" @@ -3675,7 +2883,6 @@ msgstr "" "ïîì. ðÿä. êîë. ôàéë/òåêñò" #. Highlight title -#: ../mark.c:789 msgid "" "\n" " jump line col file/text" @@ -3685,7 +2892,6 @@ msgstr "" # msgstr "E283: " #. Highlight title -#: ../mark.c:831 msgid "" "\n" "change line col text" @@ -3694,7 +2900,6 @@ msgstr "" "çì³íèòè ðÿä. ñòîâï. òåêñò" # TODO -#: ../mark.c:1238 msgid "" "\n" "# File marks:\n" @@ -3703,7 +2908,6 @@ msgstr "" "# Ïîì³òêè:\n" #. Write the jumplist with -' -#: ../mark.c:1271 msgid "" "\n" "# Jumplist (newest first):\n" @@ -3712,7 +2916,6 @@ msgstr "" "# Ñïèñîê ïåðåõîä³â (â³ä íàéíîâ³øèõ):\n" # TODO -#: ../mark.c:1352 msgid "" "\n" "# History of marks within files (newest to oldest):\n" @@ -3720,90 +2923,71 @@ msgstr "" "\n" "# Ïîïåðåäí³ ïîì³òêè â ôàéëàõ (â³ä íàéíîâ³øèõ):\n" -#: ../mark.c:1431 msgid "Missing '>'" msgstr "Ïðîïóùåíî '>'" # msgstr "E292: " -#: ../memfile.c:426 msgid "E293: block was not locked" msgstr "E293: Áëîê íå áóëî çàô³êñîâàíî" # msgstr "E293: " -#: ../memfile.c:799 msgid "E294: Seek error in swap file read" msgstr "E294: Ïîìèëêà çì³íè ïîçèö³¿ ó ôàéë³ îáì³íó" -#: ../memfile.c:803 msgid "E295: Read error in swap file" msgstr "E295: Ïîìèëêà ç÷èòóâàííÿ ôàéëó îáì³íó" -#: ../memfile.c:849 msgid "E296: Seek error in swap file write" msgstr "E296: Ïîìèëêà çì³íè ïîçèö³¿ ï³ä ÷àñ çàïèñó ó ôàéë îáì³íó" -#: ../memfile.c:865 msgid "E297: Write error in swap file" msgstr "E297: Ïîìèëêà çàïèñó ôàéëó îáì³íó" -#: ../memfile.c:1036 msgid "E300: Swap file already exists (symlink attack?)" msgstr "E300: Ôàéë îáì³íó âæå ³ñíóº (àòàêà ñèìâîëüíèì ïîñèëàííÿì?)" -#: ../memline.c:318 msgid "E298: Didn't get block nr 0?" msgstr "E298: Íåìຠáëîêó 0?" -#: ../memline.c:361 msgid "E298: Didn't get block nr 1?" msgstr "E298: Íåìຠáëîêó 1?" # msgstr "E298: " -#: ../memline.c:377 msgid "E298: Didn't get block nr 2?" msgstr "E298: Íåìຠáëîêó 2?" #. could not (re)open the swap file, what can we do???? -#: ../memline.c:465 msgid "E301: Oops, lost the swap file!!!" msgstr "E301: Îé, âòðà÷åíî ôàéë îáì³íó!!!" # msgstr "E301: " -#: ../memline.c:477 msgid "E302: Could not rename swap file" msgstr "E302: Íå âäàëîñÿ ïåðåéìåíóâàòè ôàéëó îáì³íó" # msgstr "E302: " -#: ../memline.c:554 #, c-format msgid "E303: Unable to open swap file for \"%s\", recovery impossible" msgstr "E303: Íå âäàëîñÿ ïðî÷èòàòè ôàéë îáì³íó äëÿ «%s», â³äíîâëåííÿ íåìîæëèâå" -#: ../memline.c:666 msgid "E304: ml_upd_block0(): Didn't get block 0??" msgstr "E304: ml_upd_block0(): Íåìຠáëîêó 0??" #. no swap files found -#: ../memline.c:830 #, c-format msgid "E305: No swap file found for %s" msgstr "E305: Íå çíàéäåíî ôàéëó îáì³íó äëÿ %s" # msgstr "E305: " -#: ../memline.c:839 msgid "Enter number of swap file to use (0 to quit): " msgstr "Ââåä³òü íîìåð ôàéëó îáì³íó, êîòðèé âèêîðèñòàòè, (0 äëÿ âèõîäó):" -#: ../memline.c:879 #, c-format msgid "E306: Cannot open %s" msgstr "E306: Íå âäàëîñÿ â³äêðèòè %s" -#: ../memline.c:897 msgid "Unable to read block 0 from " msgstr "Íå âäàëîñÿ ïðî÷èòàòè áëîê 0 ç " -#: ../memline.c:900 msgid "" "\n" "Maybe no changes were made or Vim did not update the swap file." @@ -3811,28 +2995,22 @@ msgstr "" "\n" "Íàïåâíî, çì³í íå áóëî, àáî Vim íå ïîíîâèâ ôàéë îáì³íó." -#: ../memline.c:909 msgid " cannot be used with this version of Vim.\n" msgstr " íå ìîæíà âèêîðèñòàòè ç ö³ºþ âåðñ³ºþ Vim.\n" -#: ../memline.c:911 msgid "Use Vim version 3.0.\n" msgstr "Çíàéä³òü Vim 3.0\n" -#: ../memline.c:916 #, c-format msgid "E307: %s does not look like a Vim swap file" msgstr "E307: %s íå ñõîæå íà ôàéë îáì³íó Vim" -#: ../memline.c:922 msgid " cannot be used on this computer.\n" msgstr " íå ìîæíà âèêîðèñòàòè íà öüîìó êîìï'þòåð³.\n" -#: ../memline.c:924 msgid "The file was created on " msgstr "Ôàéë áóëî ñòâîðåíî íà " -#: ../memline.c:928 msgid "" ",\n" "or the file has been damaged." @@ -3840,89 +3018,70 @@ msgstr "" ",\n" "àáî ôàéë áóëî ïîøêîäæåíî." -#: ../memline.c:945 msgid " has been damaged (page size is smaller than minimum value).\n" msgstr " ïîøêîäæåíèé (ðîçì³ð ñòîð³íêè ìåíøèé ì³í³ìàëüíîãî çíà÷åííÿ).\n" -#: ../memline.c:974 #, c-format msgid "Using swap file \"%s\"" msgstr "Âèêîðèñòîâóºòüñÿ ôàéë îáì³íó «%s»" -#: ../memline.c:980 #, c-format msgid "Original file \"%s\"" msgstr "Ïî÷àòêîâèé ôàéë «%s»" -#: ../memline.c:995 msgid "E308: Warning: Original file may have been changed" msgstr "E308: Çàñòåðåæåííÿ: Ìîæëèâî, ïî÷àòêîâèé ôàéë áóëî çì³íåíî" # msgstr "E308: " -#: ../memline.c:1061 #, c-format msgid "E309: Unable to read block 1 from %s" msgstr "E309: Íå âäàëîñÿ ïðî÷èòàòè áëîê 1 ç %s" # msgstr "E309: " -#: ../memline.c:1065 msgid "???MANY LINES MISSING" msgstr "??? ÁÐÀÊÓª ÁÀÃÀÒÜÎÕ ÐßÄʲÂ" -#: ../memline.c:1076 msgid "???LINE COUNT WRONG" msgstr "??? ÍÅÏÐÀÂÈËÜÍÀ ʲËÜʲÑÒÜ ÐßÄʲÂ" -#: ../memline.c:1082 msgid "???EMPTY BLOCK" msgstr "??? ÏÎÐÎÆÍ²É ÁËÎÊ" -#: ../memline.c:1103 msgid "???LINES MISSING" msgstr "??? ÏÐÎÏÓÙÅͲ ÐßÄÊÈ" -#: ../memline.c:1128 #, c-format msgid "E310: Block 1 ID wrong (%s not a .swp file?)" msgstr "E310: ²äåíòèô³êàòîð áëîêó 1 íåïðàâèëüíèé (%s íå º ôàéëîì îáì³íó?)" # msgstr "E310: " -#: ../memline.c:1133 msgid "???BLOCK MISSING" msgstr "??? ÏÐÎÏÓÙÅÍÎ ÁËÎÊ" -#: ../memline.c:1147 msgid "??? from here until ???END lines may be messed up" msgstr "??? çâ³äñè ³ äî `??? ʲÍÅÖÜ' ðÿäêè, ìîæëèâî, ñïëóòàí³" -#: ../memline.c:1164 msgid "??? from here until ???END lines may have been inserted/deleted" msgstr "??? çâ³äñè ³ äî `??? ʲÍÅÖÜ' ðÿäêè, ìîæëèâî, áóëè äîäàí³/çíèùåí³" -#: ../memline.c:1181 msgid "???END" msgstr "??? ʲÍÅÖÜ" -#: ../memline.c:1238 msgid "E311: Recovery Interrupted" msgstr "E311: ³äíîâëåííÿ ïåðåðâàíî" -#: ../memline.c:1243 msgid "" "E312: Errors detected while recovering; look for lines starting with ???" msgstr "" "E312: ϳä ÷àñ â³äíîâëåííÿ çíàéäåíî ïîìèëêè. Ïåðåãëÿíüòå ðÿäêè, ùî " "ïî÷èíàþòüñÿ ç ???" -#: ../memline.c:1245 msgid "See \":help E312\" for more information." msgstr "Äèâ. «:help E312» äëÿ óòî÷íåííÿ." -#: ../memline.c:1249 msgid "Recovery completed. You should check if everything is OK." msgstr "³äíîâëåííÿ çàê³í÷åíî, ïåðåâ³ðòå ÷è âñå ãàðàçä." -#: ../memline.c:1251 msgid "" "\n" "(You might want to write out this file under another name\n" @@ -3930,15 +3089,12 @@ msgstr "" "\n" "(Ìîæëèâî, ïîòð³áíî çàïèñàòè öåé ôàéë ï³ä ³íøîþ íàçâîþ\n" -#: ../memline.c:1252 msgid "and run diff with the original file to check for changes)" msgstr "³ çàïóñòèòè diff ç îðèã³íàëîì ùîá ïåðåâ³ðèòè çì³íè)" -#: ../memline.c:1254 msgid "Recovery completed. Buffer contents equals file contents." msgstr "³äíîâëåííÿ çàê³í÷åíî. Âì³ñò áóôåðà ñï³âïàäàº ç³ âì³ñòîì ôàéëó." -#: ../memline.c:1255 msgid "" "\n" "You may want to delete the .swp file now.\n" @@ -3949,51 +3105,39 @@ msgstr "" "\n" #. use msg() to start the scrolling properly -#: ../memline.c:1327 msgid "Swap files found:" msgstr "Çíàéäåíî ôàéëè îáì³íó:" -#: ../memline.c:1446 msgid " In current directory:\n" msgstr "  ïîòî÷íîìó êàòàëîç³:\n" -#: ../memline.c:1448 msgid " Using specified name:\n" msgstr " Âèêîðèñòîâóþ÷è âêàçàíó íàçâó:\n" -#: ../memline.c:1450 msgid " In directory " msgstr " Ó êàòàëîç³ " -#: ../memline.c:1465 msgid " -- none --\n" msgstr " -- æîäíîãî --\n" -#: ../memline.c:1527 msgid " owned by: " msgstr " âëàñíèê: " -#: ../memline.c:1529 msgid " dated: " msgstr " äàòà: " -#: ../memline.c:1532 ../memline.c:3231 msgid " dated: " msgstr " äàòà: " -#: ../memline.c:1548 msgid " [from Vim version 3.0]" msgstr " [â³ä Vim 3.0]" -#: ../memline.c:1550 msgid " [does not look like a Vim swap file]" msgstr " [íå ñõîæå íà ôàéë îáì³íó]" -#: ../memline.c:1552 msgid " file name: " msgstr " íàçâà ôàéëó: " -#: ../memline.c:1558 msgid "" "\n" " modified: " @@ -4001,15 +3145,12 @@ msgstr "" "\n" " çì³íåíî: " -#: ../memline.c:1559 msgid "YES" msgstr "ÒÀÊ" -#: ../memline.c:1559 msgid "no" msgstr "í³" -#: ../memline.c:1562 msgid "" "\n" " user name: " @@ -4017,11 +3158,9 @@ msgstr "" "\n" " êîðèñòóâà÷: " -#: ../memline.c:1568 msgid " host name: " msgstr " íàçâà âóçëà: " -#: ../memline.c:1570 msgid "" "\n" " host name: " @@ -4029,7 +3168,6 @@ msgstr "" "\n" " íàçâà âóçëà: " -#: ../memline.c:1575 msgid "" "\n" " process ID: " @@ -4037,11 +3175,9 @@ msgstr "" "\n" " ID ïðîöåñó: " -#: ../memline.c:1579 msgid " (still running)" msgstr " (âèêîíóºòüñÿ)" -#: ../memline.c:1586 msgid "" "\n" " [not usable on this computer]" @@ -4049,106 +3185,84 @@ msgstr "" "\n" " [íåïðèäàòíèé íà öüîìó êîìï'þòåð³]" -#: ../memline.c:1590 msgid " [cannot be read]" msgstr " [íå ìîæíà ïðî÷èòàòè]" -#: ../memline.c:1593 msgid " [cannot be opened]" msgstr " [íå ìîæíà â³äêðèòè]" -#: ../memline.c:1698 msgid "E313: Cannot preserve, there is no swap file" msgstr "E313: Íå âäàëîñÿ çàãîòîâèòè, íåìຠôàéëó îáì³íó" # msgstr "E313: " -#: ../memline.c:1747 msgid "File preserved" msgstr "Ôàéë çáåðåæåíî" -#: ../memline.c:1749 msgid "E314: Preserve failed" msgstr "E314: Çáåðåæåííÿ íå âäàëîñÿ" # msgstr "E314: " -#: ../memline.c:1819 #, c-format msgid "E315: ml_get: invalid lnum: %<PRId64>" msgstr "E315: ml_get: íåïðàâèëüíèé lnum: %<PRId64>" # msgstr "E315: " -#: ../memline.c:1851 #, c-format msgid "E316: ml_get: cannot find line %<PRId64>" msgstr "E316: ml_get: íå çíàéøîâ ðÿäîê %<PRId64>" # msgstr "E316: " -#: ../memline.c:2236 msgid "E317: pointer block id wrong 3" msgstr "E317: Âêàç³âíèê áëîêó ïîìèëêîâèé 3" # msgstr "E317: " -#: ../memline.c:2311 msgid "stack_idx should be 0" msgstr "stack_idx ìຠáóòè ð³âíèì 0" -#: ../memline.c:2369 msgid "E318: Updated too many blocks?" msgstr "E318: Ïîíîâëåíî çàáàãàòî áëîê³â?" -#: ../memline.c:2511 msgid "E317: pointer block id wrong 4" msgstr "E317: Âêàç³âíèê áëîêó ïîìèëêîâèé 4" -#: ../memline.c:2536 msgid "deleted block 1?" msgstr "áëîê 1 çíèùåíî?" -#: ../memline.c:2707 #, c-format msgid "E320: Cannot find line %<PRId64>" msgstr "E320: Íå âäàëîñÿ çíàéòè ðÿäîê %<PRId64>" -#: ../memline.c:2916 msgid "E317: pointer block id wrong" msgstr "E317: Âêàç³âíèê áëîêó ïîìèëêîâèé" # msgstr "E317: " -#: ../memline.c:2930 msgid "pe_line_count is zero" msgstr "pe_line_count äîð³âíþº 0" -#: ../memline.c:2955 #, c-format msgid "E322: line number out of range: %<PRId64> past the end" msgstr "E322: Íîìåð ðÿäêà âèéøîâ çà ìåæ³: %<PRId64> çà ê³íöåì" # msgstr "E322: " -#: ../memline.c:2959 #, c-format msgid "E323: line count wrong in block %<PRId64>" msgstr "E323: ʳëüê³ñòü ðÿäê³â ó áëîö³ %<PRId64>" # msgstr "E323: " -#: ../memline.c:2999 msgid "Stack size increases" msgstr "Ðîçì³ð ñòåêó çá³ëüøóºòüñÿ" -#: ../memline.c:3038 msgid "E317: pointer block id wrong 2" msgstr "E317: Âêàç³âíèê áëîêó ïîìèëêîâèé 2" -#: ../memline.c:3070 #, c-format msgid "E773: Symlink loop for \"%s\"" msgstr "E773: Öèêë³÷í³ ñèìâîëüí³ ïîñèëàííÿ «%s»" # msgstr "E317: " -#: ../memline.c:3221 msgid "E325: ATTENTION" msgstr "E325: ÓÂÀÃÀ" -#: ../memline.c:3222 msgid "" "\n" "Found a swap file by the name \"" @@ -4156,15 +3270,12 @@ msgstr "" "\n" "Çíàéäåíî ôàéë îáì³íó ç íàçâîþ \"" -#: ../memline.c:3226 msgid "While opening file \"" msgstr "Ïðè â³äêðèòò³ ôàéëó \"" -#: ../memline.c:3239 msgid " NEWER than swap file!\n" msgstr " ÍβØÈÉ çà ôàéë îáì³íó!\n" -#: ../memline.c:3244 msgid "" "\n" "(1) Another program may be editing the same file. If this is the case,\n" @@ -4176,19 +3287,15 @@ msgstr "" " áóäüòå îáåðåæí³, ùîá íå çàëèøèëèñÿ äâà ð³çí³ åêçåìïëÿðè\n" " îäíîãî é òîãî ñàìîãî ôàéëó ï³ñëÿ çì³í." -#: ../memline.c:3245 msgid " Quit, or continue with caution.\n" msgstr " Âèéä³òü àáî ïðîäîâæóéòå îáåðåæíî.\n" -#: ../memline.c:3246 msgid "(2) An edit session for this file crashed.\n" msgstr "(2) Ñåàíñ ðåäàãóâàííÿ öüîãî ôàéëó çàçíàâ êðàõó.\n" -#: ../memline.c:3247 msgid " If this is the case, use \":recover\" or \"vim -r " msgstr " ßêùî öå ñïðàâä³ òðàïèëîñÿ, ñïðîáóéòå «:recover» àáî «vim -r " -#: ../memline.c:3249 msgid "" "\"\n" " to recover the changes (see \":help recovery\").\n" @@ -4196,11 +3303,9 @@ msgstr "" "»\n" " ùîá â³äíîâèòè çì³íè (äèâ. «:help recovery»).\n" -#: ../memline.c:3250 msgid " If you did this already, delete the swap file \"" msgstr " ßêùî âè âæå öå çðîáèëè, çíèù³òü ôàéë îáì³íó «" -#: ../memline.c:3252 msgid "" "\"\n" " to avoid this message.\n" @@ -4209,23 +3314,18 @@ msgstr "" " ùîá ïîçáóòèñÿ öüîãî ïîâ³äîìëåííÿ.\n" "\n" -#: ../memline.c:3450 ../memline.c:3452 msgid "Swap file \"" msgstr "Ôàéë îáì³íó «" -#: ../memline.c:3451 ../memline.c:3455 msgid "\" already exists!" msgstr "» âæå ³ñíóº!" -#: ../memline.c:3457 msgid "VIM - ATTENTION" msgstr "VIM — ÓÂÀÃÀ" -#: ../memline.c:3459 msgid "Swap file already exists!" msgstr "Ôàéë îáì³íó âæå ³ñíóº!" -#: ../memline.c:3464 msgid "" "&Open Read-Only\n" "&Edit anyway\n" @@ -4239,7 +3339,6 @@ msgstr "" "&Q:Âèéòè\n" "&A:Ïåðåðâàòè" -#: ../memline.c:3467 msgid "" "&Open Read-Only\n" "&Edit anyway\n" @@ -4263,56 +3362,46 @@ msgstr "" #. #. ".s?a" #. ".saa": tried enough, give up -#: ../memline.c:3528 msgid "E326: Too many swap files found" msgstr "E326: Çíàéäåíî çàáàãàòî ôàéë³â îáì³íó" # msgstr "E341: " -#: ../memory.c:227 #, c-format msgid "E342: Out of memory! (allocating %<PRIu64> bytes)" msgstr "E342: Çàáðàêëî ïàì'ÿò³! (ïîòð³áíî áóëî %<PRIu64> áàéò³â)" # msgstr "E326: " -#: ../menu.c:62 msgid "E327: Part of menu-item path is not sub-menu" msgstr "E327: ×àñòèíà øëÿõó äî åëåìåíòà ìåíþ íå º ï³äìåíþ" # msgstr "E327: " -#: ../menu.c:63 msgid "E328: Menu only exists in another mode" msgstr "E328: Ìåíþ ìîæå áóòè ò³ëüêè â ³íøîìó ðåæèì³" # msgstr "E328: " -#: ../menu.c:64 #, c-format msgid "E329: No menu \"%s\"" msgstr "E329: Íåìຠìåíþ «%s»" #. Only a mnemonic or accelerator is not valid. -#: ../menu.c:329 msgid "E792: Empty menu name" msgstr "E792: Ïîðîæíÿ íàçâà ìåíþ" # msgstr "E329: " -#: ../menu.c:340 msgid "E330: Menu path must not lead to a sub-menu" msgstr "E330: Øëÿõ äî ìåíþ íå ïîâèíåí âåñòè äî ï³äìåíþ" # msgstr "E330: " -#: ../menu.c:365 msgid "E331: Must not add menu items directly to menu bar" msgstr "E331: Íå ìîæíà äîäàâàòè åëåìåíòè ìåíþ ïðîñòî äî âåðõíüîãî ìåíþ" # msgstr "E331: " -#: ../menu.c:370 msgid "E332: Separator cannot be part of a menu path" msgstr "E332: Ðîçä³ëüíèê íå ìîæå áóòè ÷àñòèíîþ øëÿõó ìåíþ" # msgstr "E332: " #. Now we have found the matching menu, and we list the mappings #. Highlight title -#: ../menu.c:762 msgid "" "\n" "--- Menus ---" @@ -4320,78 +3409,59 @@ msgstr "" "\n" "--- Ìåíþ ---" -#: ../menu.c:1313 msgid "E333: Menu path must lead to a menu item" msgstr "E333: Øëÿõ ïîâèíåí âåñòè äî åëåìåíòà ìåíþ" # msgstr "E333: " -#: ../menu.c:1330 #, c-format msgid "E334: Menu not found: %s" msgstr "E334: Ìåíþ íå çíàéäåíî: %s" # msgstr "E334: " -#: ../menu.c:1396 #, c-format msgid "E335: Menu not defined for %s mode" msgstr "E335: Äëÿ ðåæèìó %s ìåíþ íå âèçíà÷åíî" # msgstr "E335: " -#: ../menu.c:1426 msgid "E336: Menu path must lead to a sub-menu" msgstr "E336: Øëÿõ ïîâèíåí âåñòè äî ï³äìåíþ" # msgstr "E336: " -#: ../menu.c:1447 msgid "E337: Menu not found - check menu names" msgstr "E337: Ìåíþ íå çíàéäåíî — ïåðåâ³ðòå íàçâó" # msgstr "E337: " -#: ../message.c:423 #, c-format msgid "Error detected while processing %s:" msgstr "Âèÿâëåíî ïîìèëêó ï³ä ÷àñ âèêîíàííÿ %s:" -#: ../message.c:445 #, c-format msgid "line %4ld:" msgstr "ðÿäîê %4ld:" -#: ../message.c:617 #, c-format msgid "E354: Invalid register name: '%s'" msgstr "E354: Íåïðàâèëüíà íàçâà ðåã³ñòðó: '%s'" -#: ../message.c:745 -msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>" -msgstr "Óêðà¿í³çàö³ÿ: Àíàòîë³é Ñàõí³ê <sakhnik@gmail.com>" - -#: ../message.c:986 msgid "Interrupt: " msgstr "Ïåðåðâàíî: " -#: ../message.c:988 msgid "Press ENTER or type command to continue" msgstr "Íàòèñí³òü ENTER àáî ââåä³òü êîìàíäó äëÿ ïðîäîâæåííÿ" -#: ../message.c:1843 #, c-format msgid "%s line %<PRId64>" msgstr "%s ðÿäîê %<PRId64>" -#: ../message.c:2392 msgid "-- More --" msgstr "-- Ùå --" -#: ../message.c:2398 msgid " SPACE/d/j: screen/page/line down, b/u/k: up, q: quit " msgstr " ÏÐÎÁ²Ë/d/j: âíèç íà åêðàí/ñòîð³íêó/ðÿäîê, b/u/k: âãîðó, q: âèéòè " -#: ../message.c:3021 ../message.c:3031 msgid "Question" msgstr "Çàïèòàííÿ" -#: ../message.c:3023 msgid "" "&Yes\n" "&No" @@ -4399,7 +3469,6 @@ msgstr "" "&Y:Òàê\n" "&N:ͳ" -#: ../message.c:3033 msgid "" "&Yes\n" "&No\n" @@ -4409,7 +3478,6 @@ msgstr "" "&N:ͳ\n" "&C:Ñêàñóâàòè" -#: ../message.c:3045 msgid "" "&Yes\n" "&No\n" @@ -4423,178 +3491,139 @@ msgstr "" "&D:Æîäíîãî\n" "&C:Ñêàñóâàòè" -#: ../message.c:3058 msgid "E766: Insufficient arguments for printf()" msgstr "E766: Íåäîñòàòíüî àðãóìåíò³â äëÿ printf()" -#: ../message.c:3119 msgid "E807: Expected Float argument for printf()" msgstr "E807: Î÷³êóºòüñÿ àðãóìåíò Float äëÿ printf()" -#: ../message.c:3873 msgid "E767: Too many arguments to printf()" msgstr "E767: Çàáàãàòî àðãóìåíò³â äëÿ printf()" # msgstr "E338: " -#: ../misc1.c:2256 msgid "W10: Warning: Changing a readonly file" msgstr "W10: Çàñòåðåæåííÿ: Çì³íþºòüñÿ ôàéë ïðèçíà÷åíèé ëèøå äëÿ ÷èòàííÿ" -#: ../misc1.c:2537 msgid "Type number and <Enter> or click with mouse (empty cancels): " msgstr "Íàáåð³òü ÷èñëî é <Enter> ÷è êëàöí³òü ìèøêîþ (ïîðîæíº ñêàñîâóº): " -#: ../misc1.c:2539 msgid "Type number and <Enter> (empty cancels): " msgstr "Íàáåð³òü ÷èñëî é <Enter> (ïîðîæíº ñêàñîâóº): " -#: ../misc1.c:2585 msgid "1 more line" msgstr "äîäàíî îäèí ðÿäîê" -#: ../misc1.c:2588 msgid "1 line less" msgstr "çíèùåíî îäèí ðÿäîê" -#: ../misc1.c:2593 #, c-format msgid "%<PRId64> more lines" msgstr "äîäàíî ðÿäê³â: %<PRId64>" -#: ../misc1.c:2596 #, c-format msgid "%<PRId64> fewer lines" msgstr "çíèùåíî ðÿäê³â: %<PRId64>" -#: ../misc1.c:2599 msgid " (Interrupted)" msgstr " (Ïåðåðâàíî)" -#: ../misc1.c:2635 msgid "Beep!" msgstr "Äçåíü!" # msgstr "E342: " -#: ../misc2.c:738 #, c-format msgid "Calling shell to execute: \"%s\"" msgstr "Âèêëèêàºòüñÿ îáîëîíêà ùîá âèêîíàòè: «%s»" # msgstr "E348: " -#: ../normal.c:183 msgid "E349: No identifier under cursor" msgstr "E349: Íåìຠ³äåíòèô³êàòîðà íàä êóðñîðîì" -#: ../normal.c:1866 msgid "E774: 'operatorfunc' is empty" msgstr "E774: 'operatorfunc' ïîðîæíÿ" -#: ../normal.c:2637 msgid "Warning: terminal cannot highlight" msgstr "Çàñòåðåæåííÿ: Òåðì³íàë íå ï³äòðèìóº êîëüîðè" -#: ../normal.c:2807 msgid "E348: No string under cursor" msgstr "E348: Íåìຠðÿäêà íà êóðñîð³" -#: ../normal.c:3937 msgid "E352: Cannot erase folds with current 'foldmethod'" msgstr "E352: Íå âäàëîñÿ çíèùèòè çãîðòêè ïîòî÷íèì ìåòîäîì 'foldmethod'" -#: ../normal.c:5897 msgid "E664: changelist is empty" msgstr "E664: Ñïèñîê çì³í ïîðîæí³é" -#: ../normal.c:5899 msgid "E662: At start of changelist" msgstr "E662: Ïî÷àòîê ñïèñêó çì³í" -#: ../normal.c:5901 msgid "E663: At end of changelist" msgstr "E663: ʳíåöü ñïèñêó çì³í" -#: ../normal.c:7053 msgid "Type :quit<Enter> to exit Nvim" msgstr "Óâåä³òü :quit<Enter> ùîá âèéòè ç Vim" -#: ../ops.c:248 #, c-format msgid "1 line %sed 1 time" msgstr "Îäèí ðÿäîê %s-íî" -#: ../ops.c:250 #, c-format msgid "1 line %sed %d times" msgstr "Îäèí ðÿäîê %s-íî %d ðàç³â" -#: ../ops.c:253 #, c-format msgid "%<PRId64> lines %sed 1 time" msgstr "%<PRId64> ðÿäê³â %s-íî" -#: ../ops.c:256 #, c-format msgid "%<PRId64> lines %sed %d times" msgstr "%<PRId64> ðÿäê³â %s-íî %d ðàç³â" -#: ../ops.c:592 #, c-format msgid "%<PRId64> lines to indent... " msgstr "Çàëèøèëîñÿ âèð³âíÿòè %<PRId64> ðÿäê³â..." -#: ../ops.c:634 msgid "1 line indented " msgstr "Âèð³âíÿíî îäèí ðÿäîê" -#: ../ops.c:636 #, c-format msgid "%<PRId64> lines indented " msgstr "Âèð³âíÿíî ðÿäê³â: %<PRId64>" -#: ../ops.c:938 msgid "E748: No previously used register" msgstr "E748: Ðåã³ñòðè ïåðåä öèì íå âæèâàëèñü" #. must display the prompt -#: ../ops.c:1433 msgid "cannot yank; delete anyway" msgstr "íå âäàëîñÿ çàïàì'ÿòàòè; âñå îäíî çíèùèòè?" -#: ../ops.c:1929 msgid "1 line changed" msgstr "Îäèí ðÿäîê çì³íåíî" -#: ../ops.c:1931 #, c-format msgid "%<PRId64> lines changed" msgstr "Çì³íåíî ðÿäê³â: %<PRId64>" -#: ../ops.c:2521 msgid "block of 1 line yanked" msgstr "Çàïàì'ÿòàâ áëîê ç îäíîãî ðÿäêà" -#: ../ops.c:2523 msgid "1 line yanked" msgstr "Çàïàì'ÿòàâ îäèí ðÿäîê" -#: ../ops.c:2525 #, c-format msgid "block of %<PRId64> lines yanked" msgstr "Çàïàì'ÿòàâ áëîê ³ç %<PRId64> ðÿäê³â" -#: ../ops.c:2528 #, c-format msgid "%<PRId64> lines yanked" msgstr "Çàïàì'ÿòàâ ðÿäê³â: %<PRId64>" -#: ../ops.c:2710 #, c-format msgid "E353: Nothing in register %s" msgstr "E353: Ó ðåã³ñòð³ %s í³÷îãî íåìàº" # msgstr "E353: " #. Highlight title -#: ../ops.c:3185 msgid "" "\n" "--- Registers ---" @@ -4602,11 +3631,9 @@ msgstr "" "\n" "--- Ðåã³ñòðè ---" -#: ../ops.c:4455 msgid "Illegal register name" msgstr "Íåïðàâèëüíà íàçâà ðåã³ñòðó" -#: ../ops.c:4533 msgid "" "\n" "# Registers:\n" @@ -4614,17 +3641,14 @@ msgstr "" "\n" "# Ðåã³ñòðè:\n" -#: ../ops.c:4575 #, c-format msgid "E574: Unknown register type %d" msgstr "E574: Íåâ³äîìèé òèï ðåã³ñòðó %d" -#: ../ops.c:5089 #, c-format msgid "%<PRId64> Cols; " msgstr "äîâæ.: %<PRId64>; " -#: ../ops.c:5097 #, c-format msgid "" "Selected %s%<PRId64> of %<PRId64> Lines; %<PRId64> of %<PRId64> Words; " @@ -4633,7 +3657,6 @@ msgstr "" "Âèáðàíî %s%<PRId64> ç %<PRId64> ðÿäê³â; %<PRId64> ç %<PRId64> ñë³â; " "%<PRId64> ç %<PRId64> áàéò³â" -#: ../ops.c:5105 #, c-format msgid "" "Selected %s%<PRId64> of %<PRId64> Lines; %<PRId64> of %<PRId64> Words; " @@ -4642,7 +3665,6 @@ msgstr "" "Âèáðàíî %s%<PRId64> ç %<PRId64> ðÿäê³â; %<PRId64> ç %<PRId64> ñë³â; " "%<PRId64> of %<PRId64> ñèìâîë³â; %<PRId64> ç %<PRId64> áàéò³â" -#: ../ops.c:5123 #, c-format msgid "" "Col %s of %s; Line %<PRId64> of %<PRId64>; Word %<PRId64> of %<PRId64>; Byte " @@ -4651,7 +3673,6 @@ msgstr "" "Êîëîíêà %s ç %s; ðÿäîê %<PRId64> ç %<PRId64>; ñëîâî %<PRId64> ç %<PRId64>; " "áàéò %<PRId64> ç %<PRId64>" -#: ../ops.c:5133 #, c-format msgid "" "Col %s of %s; Line %<PRId64> of %<PRId64>; Word %<PRId64> of %<PRId64>; Char " @@ -4660,136 +3681,105 @@ msgstr "" "Êîëîíêà %s ç %s; ðÿäîê %<PRId64> ç %<PRId64>; ñëîâî %<PRId64> ç %<PRId64>; " "ñèìâîë %<PRId64> of %<PRId64>; áàéò %<PRId64> ç %<PRId64>" -#: ../ops.c:5146 #, c-format msgid "(+%<PRId64> for BOM)" msgstr "(+%<PRId64> äëÿ BOM)" -#: ../option.c:1238 msgid "%<%f%h%m%=Page %N" msgstr "%<%f%h%m%=Ñòîð. %N" -#: ../option.c:1574 msgid "Thanks for flying Vim" msgstr "Äÿêóºìî çà âèá³ð Vim" #. found a mismatch: skip -#: ../option.c:2698 msgid "E518: Unknown option" msgstr "E518: Íåâ³äîìà îïö³ÿ" -#: ../option.c:2709 msgid "E519: Option not supported" msgstr "E519: Îïö³ÿ íå ï³äòðèìóºòüñÿ" -#: ../option.c:2740 msgid "E520: Not allowed in a modeline" msgstr "E520: Íå äîçâîëåíî ó modeline" -#: ../option.c:2815 msgid "E846: Key code not set" msgstr "E846: Êîä êëþ÷à íå âñòàíîâëåíî" -#: ../option.c:2924 msgid "E521: Number required after =" msgstr "E521: ϳñëÿ = ïîòð³áíî âêàçàòè ÷èñëî" -#: ../option.c:3226 ../option.c:3864 msgid "E522: Not found in termcap" msgstr "E522: Íå çíàéäåíî ñåðåä ìîæëèâîñòåé òåðì³íàë³â" -#: ../option.c:3335 #, c-format msgid "E539: Illegal character <%s>" msgstr "E539: Íåäîçâîëåíèé ñèìâîë <%s>" -#: ../option.c:3862 msgid "E529: Cannot set 'term' to empty string" msgstr "E529: Íå âäàëîñÿ ñïîðîæíèòè 'term'" -#: ../option.c:3885 msgid "E589: 'backupext' and 'patchmode' are equal" msgstr "E589: Îïö³¿ 'backupext' ³ 'patchmode' îäíàêîâ³" -#: ../option.c:3964 msgid "E834: Conflicts with value of 'listchars'" msgstr "E834: Êîíôë³êòóº ³ç çíà÷åííÿì 'listchars'" -#: ../option.c:3966 msgid "E835: Conflicts with value of 'fillchars'" msgstr "E835: Êîíôë³êòóº ³ç çíà÷åííÿì 'fillchars'" -#: ../option.c:4163 msgid "E524: Missing colon" msgstr "E524: Áðàêóº äâîêðàïêè" -#: ../option.c:4165 msgid "E525: Zero length string" msgstr "E525: Ðÿäîê ïîðîæí³é" -#: ../option.c:4220 #, c-format msgid "E526: Missing number after <%s>" msgstr "E526: ϳñëÿ <%s> áðàêóº ÷èñëà" -#: ../option.c:4232 msgid "E527: Missing comma" msgstr "E527: Áðàêóº êîìè" -#: ../option.c:4239 msgid "E528: Must specify a ' value" msgstr "E528: Ïîòð³áíî âêàçàòè çíà÷åííÿ '" -#: ../option.c:4271 msgid "E595: contains unprintable or wide character" msgstr "E595: ̳ñòèòü íåäðóêîâí³ àáî ðîçøèðåí³ ñèìâîëè" -#: ../option.c:4469 #, c-format msgid "E535: Illegal character after <%c>" msgstr "E535: Íåäîçâîëåíèé ñèìâîë ï³ñëÿ <%c>" -#: ../option.c:4534 msgid "E536: comma required" msgstr "E536: Ïîòð³áíà êîìà" -#: ../option.c:4543 #, c-format msgid "E537: 'commentstring' must be empty or contain %s" msgstr "E537: 'commentstring' ìຠáóòè ïîðîæíüîþ ÷è ì³ñòèòè %s" -#: ../option.c:4928 msgid "E540: Unclosed expression sequence" msgstr "E540: Ïîñë³äîâí³ñòü âèðàç³â íå çàâåðøåíî" -#: ../option.c:4932 msgid "E541: too many items" msgstr "E541: Çàáàãàòî åëåìåíò³â" -#: ../option.c:4934 msgid "E542: unbalanced groups" msgstr "E542: Ãðóïè íå çáàëàíñîâàíî" -#: ../option.c:5148 msgid "E590: A preview window already exists" msgstr "E590: ³êíî ïåðåãëÿäó âæå ³ñíóº" -#: ../option.c:5311 msgid "W17: Arabic requires UTF-8, do ':set encoding=utf-8'" msgstr "" "W17: Äëÿ àðàáñüêî¿ ìîâè ïîòð³áíå UTF-8, âèêîíàéòå ':set encoding=utf-8'" -#: ../option.c:5623 #, c-format msgid "E593: Need at least %d lines" msgstr "E593: Ïîòð³áíî ùîíàéìåíøå %d ðÿäê³â" -#: ../option.c:5631 #, c-format msgid "E594: Need at least %d columns" msgstr "E594: Ïîòð³áíî ùîíàéìåíøå %d ñòîâïö³â" -#: ../option.c:6011 #, c-format msgid "E355: Unknown option: %s" msgstr "E355: Íåâ³äîìà îïö³ÿ: %s" @@ -4797,13 +3787,11 @@ msgstr "E355: Íåâ³äîìà îïö³ÿ: %s" #. There's another character after zeros or the string #. * is empty. In both cases, we are trying to set a #. * num option using a string. -#: ../option.c:6037 #, c-format msgid "E521: Number required: &%s = '%s'" msgstr "E521: Ïîòð³áíî âêàçàòè Number: &%s = '%s'" # msgstr "E355: " -#: ../option.c:6149 msgid "" "\n" "--- Terminal codes ---" @@ -4811,7 +3799,6 @@ msgstr "" "\n" "--- Êîäè òåðì³íàëó ---" -#: ../option.c:6151 msgid "" "\n" "--- Global option values ---" @@ -4819,7 +3806,6 @@ msgstr "" "\n" "--- Çíà÷åííÿ çàãàëüíèõ îïö³é ---" -#: ../option.c:6153 msgid "" "\n" "--- Local option values ---" @@ -4827,7 +3813,6 @@ msgstr "" "\n" "--- Çíà÷åííÿ ëîêàëüíèõ îïö³é ---" -#: ../option.c:6155 msgid "" "\n" "--- Options ---" @@ -4835,23 +3820,19 @@ msgstr "" "\n" "--- Îïö³¿ ---" -#: ../option.c:6816 msgid "E356: get_varp ERROR" msgstr "E356: Ïîìèëêà get_varp" # msgstr "E356: " -#: ../option.c:7696 #, c-format msgid "E357: 'langmap': Matching character missing for %s" msgstr "E357: 'langmap': Äëÿ ñèìâîëó %s íåìຠïàðè" # msgstr "E357: " -#: ../option.c:7715 #, c-format msgid "E358: 'langmap': Extra characters after semicolon: %s" msgstr "E358: 'langmap': Çàéâ³ ñèìâîëè ï³ñëÿ `;': %s" -#: ../os/shell.c:194 msgid "" "\n" "Cannot execute shell " @@ -4860,7 +3841,6 @@ msgstr "" "Íå âäàëîñÿ çàïóñòèòè îáîëîíêó" # msgstr "E362: " -#: ../os/shell.c:439 msgid "" "\n" "shell returned " @@ -4868,7 +3848,6 @@ msgstr "" "\n" "îáîëîíêà ïîâåðíóëà: " -#: ../os_unix.c:465 ../os_unix.c:471 msgid "" "\n" "Could not get security context for " @@ -4876,7 +3855,6 @@ msgstr "" "\n" "Íå âäàëîñÿ îòðèìàòè êîíòåêñò áåçïåêè äëÿ " -#: ../os_unix.c:479 msgid "" "\n" "Could not set security context for " @@ -4884,234 +3862,187 @@ msgstr "" "\n" "Íå âäàëîñÿ âñòàíîâèòè êîíòåêñò áåçïåêè äëÿ " -#: ../os_unix.c:1558 ../os_unix.c:1647 #, c-format msgid "dlerror = \"%s\"" msgstr "dlerror = «%s»" # msgstr "E446: " -#: ../path.c:1449 #, c-format msgid "E447: Can't find file \"%s\" in path" msgstr "E447: Ôàéë «%s» íå çíàéäåíî ó øëÿõó ïîøóêó" # msgstr "E371: " -#: ../quickfix.c:359 #, c-format msgid "E372: Too many %%%c in format string" msgstr "E372: Çàáàãàòî %%%c ó ðÿäêó ôîðìàòó" # msgstr "E372: " -#: ../quickfix.c:371 #, c-format msgid "E373: Unexpected %%%c in format string" msgstr "E373: Íåî÷³êóâàíèé `%%%c' ó ðÿäêó ôîðìàòó" # msgstr "E373: " -#: ../quickfix.c:420 msgid "E374: Missing ] in format string" msgstr "E374: Ïðîïóùåíî ] ó ðÿäêó ôîðìàòó" # msgstr "E374: " -#: ../quickfix.c:431 #, c-format msgid "E375: Unsupported %%%c in format string" msgstr "E375: %%%c ó ðÿäêó ôîðìàòó íå ï³äòðèìóºòüñÿ" # msgstr "E375: " -#: ../quickfix.c:448 #, c-format msgid "E376: Invalid %%%c in format string prefix" msgstr "E376: Ïîìèëêîâèé `%%%c' ó ïðåô³êñ³ ðÿäêó ôîðìàòó" # msgstr "E376: " -#: ../quickfix.c:454 #, c-format msgid "E377: Invalid %%%c in format string" msgstr "E377: Ïîìèëêîâèé `%%%c' ó ðÿäêó ôîðìàòó" # msgstr "E377: " #. nothing found -#: ../quickfix.c:477 msgid "E378: 'errorformat' contains no pattern" msgstr "E378: 'errorformat' íå ì³ñòèòü çðàçîê" # msgstr "E378: " -#: ../quickfix.c:695 msgid "E379: Missing or empty directory name" msgstr "E379: Ïðîïóùåíà ÷è ïîðîæíÿ íàçâà êàòàëîãó" -#: ../quickfix.c:1305 msgid "E553: No more items" msgstr "E553: Íåìຠá³ëüøå åëåìåíò³â" -#: ../quickfix.c:1674 #, c-format msgid "(%d of %d)%s%s: " msgstr "(%d ç %d)%s%s: " -#: ../quickfix.c:1676 msgid " (line deleted)" msgstr " (ðÿäîê çíèùåíî)" -#: ../quickfix.c:1863 msgid "E380: At bottom of quickfix stack" msgstr "E380: Äíî ñòåêó âèïðàâëåíü" -#: ../quickfix.c:1869 msgid "E381: At top of quickfix stack" msgstr "E381: Âåðøèíà ñòåêó âèïðàâëåíü" -#: ../quickfix.c:1880 #, c-format msgid "error list %d of %d; %d errors" msgstr "ñïèñîê ïîìèëîê %d ç %d; %d ïîìèëîê" -#: ../quickfix.c:2427 msgid "E382: Cannot write, 'buftype' option is set" msgstr "E382: Íå ìîæó çàïèñàòè, âêàçàíà îïö³ÿ 'buftype'" -#: ../quickfix.c:2812 msgid "E683: File name missing or invalid pattern" msgstr "E683: Ïðîïóùåíî íàçâó ôàéëó ÷è íåêîðåêòíèé øàáëîí" -#: ../quickfix.c:2911 #, c-format msgid "Cannot open file \"%s\"" msgstr "Íå âäàëîñÿ â³äêðèòè ôàéë «%s»" -#: ../quickfix.c:3429 msgid "E681: Buffer is not loaded" msgstr "E681: Áóôåð íå çàâàíòàæåíî" -#: ../quickfix.c:3487 msgid "E777: String or List expected" msgstr "E777: Î÷³êóºòüñÿ String ÷è List" -#: ../regexp.c:359 #, c-format msgid "E369: invalid item in %s%%[]" msgstr "E369: Íåêîðåêòíèé åëåìåíò ó %s%%[]" -#: ../regexp.c:374 #, c-format msgid "E769: Missing ] after %s[" msgstr "E769: Áðàêóº ] ï³ñëÿ %s[" -#: ../regexp.c:375 #, c-format msgid "E53: Unmatched %s%%(" msgstr "E53: Íåìຠïàðè %s%%(" -#: ../regexp.c:376 #, c-format msgid "E54: Unmatched %s(" msgstr "E54: Íåìຠïàðè %s(" -#: ../regexp.c:377 #, c-format msgid "E55: Unmatched %s)" msgstr "E55: Íåìຠïàðè %s)" # msgstr "E406: " -#: ../regexp.c:378 msgid "E66: \\z( not allowed here" msgstr "E66: \\z( òóò íå äîçâîëåíî" # msgstr "E406: " -#: ../regexp.c:379 msgid "E67: \\z1 et al. not allowed here" msgstr "E67: \\z1 òà ³í. òóò íå äîçâîëåíî" -#: ../regexp.c:380 #, c-format msgid "E69: Missing ] after %s%%[" msgstr "E69: Ïðîïóùåíî ] ï³ñëÿ %s%%[" -#: ../regexp.c:381 #, c-format msgid "E70: Empty %s%%[]" msgstr "E70: %s%%[] ïîðîæí³é" # msgstr "E382: " -#: ../regexp.c:1209 ../regexp.c:1224 msgid "E339: Pattern too long" msgstr "E339: Çðàçîê çàíàäòî äîâãèé" -#: ../regexp.c:1371 msgid "E50: Too many \\z(" msgstr "E50: Çàáàãàòî \\z(" -#: ../regexp.c:1378 #, c-format msgid "E51: Too many %s(" msgstr "E51: Çàáàãàòî %s(" -#: ../regexp.c:1427 msgid "E52: Unmatched \\z(" msgstr "E52: Íåìຠïàðè \\z(" -#: ../regexp.c:1637 #, c-format msgid "E59: invalid character after %s@" msgstr "E59: Íåäîçâîëåíèé ñèìâîë ï³ñëÿ %s@" -#: ../regexp.c:1672 #, c-format msgid "E60: Too many complex %s{...}s" msgstr "E60: Çàáàãàòî ñêëàäíèõ %s{...}" # msgstr "E339: " -#: ../regexp.c:1687 #, c-format msgid "E61: Nested %s*" msgstr "E61: Âêëàäåí³ %s*" # msgstr "E61: " -#: ../regexp.c:1690 #, c-format msgid "E62: Nested %s%c" msgstr "E62: Âêëàäåí³ %s%c" -#: ../regexp.c:1800 msgid "E63: invalid use of \\_" msgstr "E63: Íåêîðåêòíî âæèòî \\_" # msgstr "E62: " -#: ../regexp.c:1850 #, c-format msgid "E64: %s%c follows nothing" msgstr "E64: ϳñëÿ %s%c í³÷îãî íåìàº" -#: ../regexp.c:1902 msgid "E65: Illegal back reference" msgstr "E65: Íåêîðåêòíå çâîðîòíº ïîñèëàííÿ" -#: ../regexp.c:1943 msgid "E68: Invalid character after \\z" msgstr "E68: Íåïðàâèëüíèé ñèìâîë ï³ñëÿ \\z" -#: ../regexp.c:2049 ../regexp_nfa.c:1296 #, c-format msgid "E678: Invalid character after %s%%[dxouU]" msgstr "E678: Íåäîçâîëåíèé ñèìâîë ï³ñëÿ %s%%[dxouU]" -#: ../regexp.c:2107 #, c-format msgid "E71: Invalid character after %s%%" msgstr "E71: Íåäîçâîëåíèé ñèìâîë ï³ñëÿ %s%%" # msgstr "E64: " -#: ../regexp.c:3017 #, c-format msgid "E554: Syntax error in %s{...}" msgstr "E554: Ñèíòàêñè÷íà ïîìèëêà â %s{...}" -#: ../regexp.c:3805 msgid "External submatches:\n" msgstr "Çîâí³øí³ ï³ä-çá³ãè:\n" -#: ../regexp.c:7022 msgid "" "E864: \\%#= can only be followed by 0, 1, or 2. The automatic engine will be " "used " @@ -5119,62 +4050,49 @@ msgstr "" "E864: ï³ñëÿ \\%#= ìîæå áóòè ò³ëüêè 0, 1, or 2. Áóäå âèêîðèñòàíî àâòîìàòè÷íèé " "ìåõàí³çì " -#: ../regexp_nfa.c:239 msgid "E865: (NFA) Regexp end encountered prematurely" msgstr "E865: (NFA) Çàðàíî òðàïèâñÿ ê³íåöü ðåãóëÿðíîãî âèðàçó" -#: ../regexp_nfa.c:240 #, c-format msgid "E866: (NFA regexp) Misplaced %c" msgstr "E866: (NFA regexp) Íå íà ì³ñö³ %c" -#: ../regexp_nfa.c:242 #, c-format msgid "E877: (NFA regexp) Invalid character class: %<PRId64>" -msgstr "" +msgstr "E877: (NFA regexp) Íåïðàâèëüíèé êëàñ ñèìâîë³â: %<PRId64>" -#: ../regexp_nfa.c:1261 #, c-format msgid "E867: (NFA) Unknown operator '\\z%c'" msgstr "E867: (NFA) Íåâ³äîìèé îïåðàòîð '\\z%c'" -#: ../regexp_nfa.c:1387 #, c-format msgid "E867: (NFA) Unknown operator '\\%%%c'" msgstr "E867: (NFA) Íåâ³äîìèé îïåðàòîð '\\%%%c'" -#: ../regexp_nfa.c:1802 #, c-format msgid "E869: (NFA) Unknown operator '\\@%c'" msgstr "E869: (NFA) Íåâ³äîìèé îïåðàòîð '\\@%c'" -#: ../regexp_nfa.c:1831 msgid "E870: (NFA regexp) Error reading repetition limits" msgstr "E870: (NFA regexp) Íå âäàëîñÿ ïðî÷èòàòè ìåæ³ ïîâòîðåííÿ" #. Can't have a multi follow a multi. -#: ../regexp_nfa.c:1895 msgid "E871: (NFA regexp) Can't have a multi follow a multi !" msgstr "E871: (NFA regexp) Ìóëüòè íå ìîæå áóòè çà ìóëüòè!" #. Too many `(' -#: ../regexp_nfa.c:2037 msgid "E872: (NFA regexp) Too many '('" msgstr "E872: (NFA regexp) Çàáàãàòî '('" -#: ../regexp_nfa.c:2042 msgid "E879: (NFA regexp) Too many \\z(" msgstr "E879: (NFA regexp) Çàáàãàòî \\z(" -#: ../regexp_nfa.c:2066 msgid "E873: (NFA regexp) proper termination error" msgstr "E873: (NFA regexp) ïîìèëêà íàëåæíîãî ïðèïèíåííÿ" -#: ../regexp_nfa.c:2599 msgid "E874: (NFA) Could not pop the stack !" msgstr "E874: (NFA) Ñòåê ïîðîæí³é!" -#: ../regexp_nfa.c:3298 msgid "" "E875: (NFA regexp) (While converting from postfix to NFA), too many states " "left on stack" @@ -5182,178 +4100,137 @@ msgstr "" "E875: (NFA regexp) (ϳä ÷àñ ïåðåòâîðåííÿ ç ïîñòô³êñ ó NFA) çàëèøèëîñÿ " "çàáàãàòî ñòàí³â ó ñòåêó" -#: ../regexp_nfa.c:3302 msgid "E876: (NFA regexp) Not enough space to store the whole NFA " msgstr "E876: (NFA regexp) Íåäîñòàòíüî ïàì’ÿò³, ùîá çáåðåãòè âåñü NFA " -#: ../regexp_nfa.c:4571 ../regexp_nfa.c:4869 msgid "" "Could not open temporary log file for writing, displaying on stderr ... " msgstr "" "Íå âäàëîñÿ â³äêðèòè òèì÷àñîâèé ôàéë æóðíàëó äëÿ çàïèñó, ïîêàçóºòüñÿ íà " "stderr ... " -#: ../regexp_nfa.c:4840 #, c-format msgid "(NFA) COULD NOT OPEN %s !" msgstr "(NFA) ÍÅ ÂÄÀËÎÑß Â²ÄÊÐÈÒÈ %s!" -#: ../regexp_nfa.c:6049 msgid "Could not open temporary log file for writing " msgstr "Íå âäàëîñÿ â³äêðèòè òèì÷àñîâèé ôàéë æóðíàëó äëÿ çàïèñó " -#: ../screen.c:7435 msgid " VREPLACE" msgstr " ²ÐÒ ÇÀ̲ÍÀ" -#: ../screen.c:7437 msgid " REPLACE" msgstr " ÇÀ̲ÍÀ" -#: ../screen.c:7440 msgid " REVERSE" msgstr " ÍÀÂÈÂÎвÒ" -#: ../screen.c:7441 msgid " INSERT" msgstr " ÂÑÒÀÂÊÀ" -#: ../screen.c:7443 msgid " (insert)" msgstr " (âñòàâêà)" -#: ../screen.c:7445 msgid " (replace)" msgstr " (çàì³íà)" -#: ../screen.c:7447 msgid " (vreplace)" msgstr " (â³ðò çàì³íà)" -#: ../screen.c:7449 msgid " Hebrew" msgstr " ²âðèò" -#: ../screen.c:7454 msgid " Arabic" msgstr " Àðàáñüêà" -#: ../screen.c:7456 msgid " (lang)" msgstr " (ìîâà)" -#: ../screen.c:7459 msgid " (paste)" msgstr " (êëåé)" -#: ../screen.c:7469 msgid " VISUAL" msgstr " ÂÈÁ²Ð" -#: ../screen.c:7470 msgid " VISUAL LINE" msgstr " ÂÈÁ²Ð ÐßÄʲÂ" -#: ../screen.c:7471 msgid " VISUAL BLOCK" msgstr " ÂÈÁ²Ð ÁËÎÊÓ" -#: ../screen.c:7472 msgid " SELECT" msgstr " ÂÈIJËÅÍÍß" -#: ../screen.c:7473 msgid " SELECT LINE" msgstr " ÂÈIJËÅÍÍß ÐßÄʲÂ" -#: ../screen.c:7474 msgid " SELECT BLOCK" msgstr " ÂÈIJËÅÍÍß ÁËÎÊÓ" -#: ../screen.c:7486 ../screen.c:7541 msgid "recording" msgstr "éäå çàïèñ" -#: ../search.c:487 #, c-format msgid "E383: Invalid search string: %s" msgstr "E383: Íåïðàâèëüíèé çðàçîê äëÿ ïîøóêó: %s" -#: ../search.c:832 #, c-format msgid "E384: search hit TOP without match for: %s" msgstr "E384: Ïîøóê ä³éøîâ äî ÏÎ×ÀÒÊÓ áåç çá³ã³â ç %s" -#: ../search.c:835 #, c-format msgid "E385: search hit BOTTOM without match for: %s" msgstr "E385: Ïîøóê ä³éøîâ äî ʲÍÖß áåç çá³ã³â ç %s" -#: ../search.c:1200 msgid "E386: Expected '?' or '/' after ';'" msgstr "E386: ϳñëÿ `;' ìຠáóòè `?' àáî `/'" # msgstr "E386: " -#: ../search.c:4085 msgid " (includes previously listed match)" msgstr " (ðàçîì ç ïîïåðåäí³ìè çá³ãàìè)" #. cursor at status line -#: ../search.c:4104 msgid "--- Included files " msgstr "--- Âêëþ÷åí³ ôàéëè " -#: ../search.c:4106 msgid "not found " msgstr "íå çíàéäåíî " -#: ../search.c:4107 msgid "in path ---\n" msgstr "ó øëÿõó ïîøóêó ---\n" -#: ../search.c:4168 msgid " (Already listed)" msgstr " (Óæå ó ñïèñêó)" -#: ../search.c:4170 msgid " NOT FOUND" msgstr " ÍÅ ÇÍÀÉÄÅÍÎ" -#: ../search.c:4211 #, c-format msgid "Scanning included file: %s" msgstr "Ïîøóê ó âêëþ÷åíîìó ôàéë³: %s" -#: ../search.c:4216 #, c-format msgid "Searching included file %s" msgstr "Øóêàºòüñÿ ó âêëþ÷åíîìó ôàéë³ %s" -#: ../search.c:4405 msgid "E387: Match is on current line" msgstr "E387: Çá³ã ó ïîòî÷íîìó ðÿäêó" -#: ../search.c:4517 msgid "All included files were found" msgstr "Áóëè çíàéäåí³ âñ³ âêëþ÷åí³ ôàéëè" -#: ../search.c:4519 msgid "No included files" msgstr "Æîäíîãî âêëþ÷åíîãî ôàéëó" -#: ../search.c:4527 msgid "E388: Couldn't find definition" msgstr "E388: Âèçíà÷åííÿ íå çíàéäåíî" -#: ../search.c:4529 msgid "E389: Couldn't find pattern" msgstr "E389: Çðàçîê íå çíàéäåíî" -#: ../search.c:4668 msgid "Substitute " msgstr "Çàì³íà " -#: ../search.c:4681 #, c-format msgid "" "\n" @@ -5364,100 +4241,79 @@ msgstr "" "# Îñò. %sÇðàçîê ïîøóêó:\n" "~" -#: ../spell.c:951 msgid "E759: Format error in spell file" msgstr "E759: Ïîìèëêà ôîðìàòó ó ôàéë³ îðôîãðàô³¿" # msgstr "E364: " -#: ../spell.c:952 msgid "E758: Truncated spell file" msgstr "E758: Îá³ðâàíèé ôàéë îðôîãðàô³¿" -#: ../spell.c:953 #, c-format msgid "Trailing text in %s line %d: %s" msgstr "Çàéâèé òåêñò ó %s ó ðÿäêó %d: %s" -#: ../spell.c:954 #, c-format msgid "Affix name too long in %s line %d: %s" msgstr "Íàçâà àô³êñó çàâåëèêà ó %s ó ðÿäêó %d: %s" # msgstr "E430: " -#: ../spell.c:955 msgid "E761: Format error in affix file FOL, LOW or UPP" msgstr "E761: Ïîìèëêà ôîðìàòó ó ôàéë³ àô³êñ³â FOL, LOW ÷è UPP" -#: ../spell.c:957 msgid "E762: Character in FOL, LOW or UPP is out of range" msgstr "E762: Ñèìâîë ó FOL, LOW ÷è UPP ïîçà ìåæàìè" -#: ../spell.c:958 msgid "Compressing word tree..." msgstr "Ñòèñêóºòüñÿ äåðåâî ñë³â..." -#: ../spell.c:1951 msgid "E756: Spell checking is not enabled" msgstr "E756: Ïåðåâ³ðêà îðôîãðàô³¿ íå äîçâîëåíà" -#: ../spell.c:2249 #, c-format msgid "Warning: Cannot find word list \"%s.%s.spl\" or \"%s.ascii.spl\"" msgstr "" "Çàñòåðåæåííÿ: Íå âäàëîñÿ çíàéòè ñïèñîê ñë³â «%s.%s.spl» ÷è «%s.ascii.spl»" -#: ../spell.c:2473 #, c-format msgid "Reading spell file \"%s\"" msgstr "×èòàºòüñÿ ôàéë îðôîãðàô³¿ «%s»" -#: ../spell.c:2496 msgid "E757: This does not look like a spell file" msgstr "E757: Íå ñõîæå íà ôàéë îðôîãðàô³¿" -#: ../spell.c:2501 msgid "E771: Old spell file, needs to be updated" msgstr "E771: Ôàéë îðôîãðàô³¿ ñòàðèé, òðåáà ïîíîâèòè" -#: ../spell.c:2504 msgid "E772: Spell file is for newer version of Vim" msgstr "E772: Ôàéë îðôîãðàô³¿ ïðèçíà÷åíèé äëÿ á³ëüø íîâî¿ âåðñ³¿ Vim" -#: ../spell.c:2602 msgid "E770: Unsupported section in spell file" msgstr "E770: Íåäîçâîëåíà ñåêö³ÿ ó ôàéë³ îðôîãðàô³¿" -#: ../spell.c:3762 #, c-format msgid "Warning: region %s not supported" msgstr "Çàñòåðåæåííÿ: ðåã³îí %s íå ï³äòðèìóºòüñÿ" -#: ../spell.c:4550 #, c-format msgid "Reading affix file %s ..." msgstr "×èòàºòüñÿ ôàéë àô³êñ³â %s ..." -#: ../spell.c:4589 ../spell.c:5635 ../spell.c:6140 #, c-format msgid "Conversion failure for word in %s line %d: %s" msgstr "Ïîìèëêà ïåðåòâîðåííÿ ñëîâà ó %s ó ðÿäêó %d: %s" -#: ../spell.c:4630 ../spell.c:6170 #, c-format msgid "Conversion in %s not supported: from %s to %s" msgstr "Ïåðåòâîðåííÿ ó %s íå ï³äòðèìóºòüñÿ: ç %s äî %s" -#: ../spell.c:4642 #, c-format msgid "Invalid value for FLAG in %s line %d: %s" msgstr "Íåêîðåêòíå çíà÷åííÿ FLAG ó %s ó ðÿäêó %d: %s" -#: ../spell.c:4655 #, c-format msgid "FLAG after using flags in %s line %d: %s" msgstr "FLAG ï³ñëÿ âèêîðèñòàííÿ ïðàïîðö³â ó %s ó ðÿäêó %d: %s" -#: ../spell.c:4723 #, c-format msgid "" "Defining COMPOUNDFORBIDFLAG after PFX item may give wrong results in %s line " @@ -5466,7 +4322,6 @@ msgstr "" "Âèçíà÷åííÿ COMPOUNDFORBIDFLAG ï³ñëÿ åëåìåíòó PFX ìîæå äàòè íåïðàâèëüíèé " "ðåçóëüòàò ó %s ó ðÿäêó %d" -#: ../spell.c:4731 #, c-format msgid "" "Defining COMPOUNDPERMITFLAG after PFX item may give wrong results in %s line " @@ -5475,43 +4330,35 @@ msgstr "" "Âèçíà÷åííÿ COMPOUNDPERMITFLAG ï³ñëÿ åëåìåíòó PFX ìîæó äàòè íåïðàâèëüíèé " "ðåçóëüòàò ó %s ó ðÿäêó %d" -#: ../spell.c:4747 #, c-format msgid "Wrong COMPOUNDRULES value in %s line %d: %s" msgstr "Íåïðàâèëüíå çíà÷åííÿ COMPOUNDRULES ó %s ó ðÿäêó %d: %s" -#: ../spell.c:4771 #, c-format msgid "Wrong COMPOUNDWORDMAX value in %s line %d: %s" msgstr "Íåïðàâèëüíå çíà÷åííÿ COMPOUNDWORDMAX ó %s ó ðÿäêó %d: %s" -#: ../spell.c:4777 #, c-format msgid "Wrong COMPOUNDMIN value in %s line %d: %s" msgstr "Íåïðàâèëüíå çíà÷åííÿ COMPOUNDMIN ó %s ó ðÿäêó %d: %s" -#: ../spell.c:4783 #, c-format msgid "Wrong COMPOUNDSYLMAX value in %s line %d: %s" msgstr "Íåïðàâèëüíå çíà÷åííÿ COMPOUNDSYLMAX ó %s ó ðÿäêó %d: %s" -#: ../spell.c:4795 #, c-format msgid "Wrong CHECKCOMPOUNDPATTERN value in %s line %d: %s" msgstr "Íåïðàâèëüíå çíà÷åííÿ CHECKCOMPOUNDPATTERN ó %s ó ðÿäêó %d: %s" -#: ../spell.c:4847 #, c-format msgid "Different combining flag in continued affix block in %s line %d: %s" msgstr "" "²íøèé ïðàïîðåöü êîìá³íàö³¿ ó ïðîäîâæåíí³ áëîêó àô³êñ³â ó %s ó ðÿäêó %d: %s" -#: ../spell.c:4850 #, c-format msgid "Duplicate affix in %s line %d: %s" msgstr "Ïîäâ³éíèé àô³êñ ó %s ó ðÿäêó %d: %s" -#: ../spell.c:4871 #, c-format msgid "" "Affix also used for BAD/RARE/KEEPCASE/NEEDAFFIX/NEEDCOMPOUND/NOSUGGEST in %s " @@ -5520,337 +4367,268 @@ msgstr "" "Àô³êñ òàêîæ âèêîðèñòîâóºòüñÿ äëÿ BAD/RARE/KEEPCASE/NEEDAFFIX/NEEDCOMPOUND/" "NOSUGGEST ó %s ó ðÿäêó %d: %s" -#: ../spell.c:4893 #, c-format msgid "Expected Y or N in %s line %d: %s" msgstr "Òðåáà Y ÷è N ó %s ó ðÿäêó %d: %s" -#: ../spell.c:4968 #, c-format msgid "Broken condition in %s line %d: %s" msgstr "Íåïðèäàòíà óìîâà ó %s ó ðÿäêó %d: %s" -#: ../spell.c:5091 #, c-format msgid "Expected REP(SAL) count in %s line %d" msgstr "Òðåáà ê³ëüê³ñòü REP(SAL) ó %s ó ðÿäêó %d" -#: ../spell.c:5120 #, c-format msgid "Expected MAP count in %s line %d" msgstr "Òðåáà ê³ëüê³ñòü MAP ó %s ó ðÿäêó %d" -#: ../spell.c:5132 #, c-format msgid "Duplicate character in MAP in %s line %d" msgstr "Ïîâòîðåííÿ ñèìâîëó ó MAP ó %s ó ðÿäêó %d" -#: ../spell.c:5176 #, c-format msgid "Unrecognized or duplicate item in %s line %d: %s" msgstr "Íåðîçï³çíàíèé ÷è ïîâòîðíèé åëåìåíò ó %s ó ðÿäêó %d: %s" -#: ../spell.c:5197 #, c-format msgid "Missing FOL/LOW/UPP line in %s" msgstr "Ïðîïóùåíî ðÿäîê FOL/LOW/UPP ó %s" -#: ../spell.c:5220 msgid "COMPOUNDSYLMAX used without SYLLABLE" msgstr "Âæèòî COMPOUNDSYLMAX áåç SYLLABLE" -#: ../spell.c:5236 msgid "Too many postponed prefixes" msgstr "Çàáàãàòî â³äêëàäåíèõ ïðåô³êñ³â" -#: ../spell.c:5238 msgid "Too many compound flags" msgstr "Çàáàãàòî ñêëàäíèõ ïðàïîðö³â" -#: ../spell.c:5240 msgid "Too many postponed prefixes and/or compound flags" msgstr "Çàáàãàòî â³äêëàäåíèõ ïðåô³êñ³â ³/àáî ñêëàäíèõ ïðàïîðö³â" -#: ../spell.c:5250 #, c-format msgid "Missing SOFO%s line in %s" msgstr "Ïðîïóùåíî ðÿäîê SOFO%s ó %s" -#: ../spell.c:5253 #, c-format msgid "Both SAL and SOFO lines in %s" msgstr "Îáèäâà ðÿäêè SAL ³ SOFO ó %s" -#: ../spell.c:5331 #, c-format msgid "Flag is not a number in %s line %d: %s" msgstr "Ïðàïîðåöü íå º ÷èñëîì ó %s ó ðÿäêó %d: %s" -#: ../spell.c:5334 #, c-format msgid "Illegal flag in %s line %d: %s" msgstr "Íåïðàâèëüíèé ïðàïîðåöü ó %s ó ðÿäêó %d: %s" -#: ../spell.c:5493 ../spell.c:5501 #, c-format msgid "%s value differs from what is used in another .aff file" msgstr "Çíà÷åííÿ %s â³äð³çíÿºòüñÿ â³ä òîãî, ùî âæèòî ó ³íøîìó ôàéë³ .aff" -#: ../spell.c:5602 #, c-format msgid "Reading dictionary file %s ..." msgstr "Ç÷èòóºòüñÿ ñëîâíèêîâèé ôàéë %s ..." -#: ../spell.c:5611 #, c-format msgid "E760: No word count in %s" msgstr "E760: Íåìຠê³ëüêîñò³ ñë³â ó %s" -#: ../spell.c:5669 #, c-format msgid "line %6d, word %6d - %s" msgstr "ðÿäîê %6d, ñëîâî %6d - %s" -#: ../spell.c:5691 #, c-format msgid "Duplicate word in %s line %d: %s" msgstr "Ïîâòîðåííÿ ñëîâà ó %s ó ðÿäêó %d: %s" -#: ../spell.c:5694 #, c-format msgid "First duplicate word in %s line %d: %s" msgstr "Ïåðøå ïîâòîðåííÿ ñëîâà ó %s ó ðÿäêó %d: %s" -#: ../spell.c:5746 #, c-format msgid "%d duplicate word(s) in %s" msgstr "%d ïîâòîðþâàíèõ ñë³â ó %s" -#: ../spell.c:5748 #, c-format msgid "Ignored %d word(s) with non-ASCII characters in %s" msgstr "Ïðîïóùåíî %d ñë³â(~) ³ç íå-ASCII ñèìâîëàìè ó %s" -#: ../spell.c:6115 #, c-format msgid "Reading word file %s ..." msgstr "×èòàºòüñÿ ôàéë ñë³â %s ..." -#: ../spell.c:6155 #, c-format msgid "Duplicate /encoding= line ignored in %s line %d: %s" msgstr "Ïîâòîðåííÿ ðÿäêà /encoding= ïðî³ãíîðîâàíî ó %s ó ðÿäêó %d: %s" -#: ../spell.c:6159 #, c-format msgid "/encoding= line after word ignored in %s line %d: %s" msgstr "Ðÿäîê /encoding= ï³ñëÿ ñëîâà ïðî³ãíîðîâàíî ó %s ó ðÿäêó %d: %s" -#: ../spell.c:6180 #, c-format msgid "Duplicate /regions= line ignored in %s line %d: %s" msgstr "Ïîâòîðåííÿ ðÿäêà /regions= ïðî³ãíîðîâàíî ó %s ó ðÿäêó %d: %s" -#: ../spell.c:6185 #, c-format msgid "Too many regions in %s line %d: %s" msgstr "Çàáàãàòî ðåã³îí³â ó %s ó ðÿäêó %d: %s" -#: ../spell.c:6198 #, c-format msgid "/ line ignored in %s line %d: %s" msgstr "Ðÿäîê / ïðî³ãíîðîâàíî ó %s ó ðÿäêó %d: %s" -#: ../spell.c:6224 #, c-format msgid "Invalid region nr in %s line %d: %s" msgstr "Íåêîðåêòíèé íîìåð ðåã³îíó ó %s ó ðÿäêó %d: %s" -#: ../spell.c:6230 #, c-format msgid "Unrecognized flags in %s line %d: %s" msgstr "Íåðîçï³çíàí³ ïðàïîðö³ ó %s ó ðÿäêó %d: %s" -#: ../spell.c:6257 #, c-format msgid "Ignored %d words with non-ASCII characters" msgstr "Ïðî³ãíîðîâàíî %d ñë³â ³ç íå-ASCII ñèìâîëàìè" -#: ../spell.c:6656 #, c-format msgid "Compressed %d of %d nodes; %d (%d%%) remaining" msgstr "Ñòèñíåíî %d ç %d âóçë³â; çàëèøèëîñÿ %d (%d%%)" -#: ../spell.c:7340 msgid "Reading back spell file..." msgstr "Ïåðå÷èòóºòüñÿ ôàéë îðôîãðàô³¿..." #. Go through the trie of good words, soundfold each word and add it to #. the soundfold trie. -#: ../spell.c:7357 msgid "Performing soundfolding..." msgstr "Âèêîíóºòüñÿ çãîðòàííÿ çâóê³â..." -#: ../spell.c:7368 #, c-format msgid "Number of words after soundfolding: %<PRId64>" msgstr "ʳëüê³ñòü ñë³â ï³ñëÿ çãîðòàííÿ çâóê³â: %<PRId64>" -#: ../spell.c:7476 #, c-format msgid "Total number of words: %d" msgstr "Ïîâíà ê³ëüê³ñòü ñë³â: %d" -#: ../spell.c:7655 #, c-format msgid "Writing suggestion file %s ..." msgstr "Çàïèñóºòüñÿ ôàéë ïðèïóùåíü %s ..." -#: ../spell.c:7707 ../spell.c:7927 #, c-format msgid "Estimated runtime memory use: %d bytes" msgstr "Îö³íêà ñïîæèâàííÿ ïàì'ÿò³: %d áàéò" -#: ../spell.c:7820 msgid "E751: Output file name must not have region name" msgstr "E751: Âèõ³äíèé ôàéë íå ïîâèíåí ìàòè íàçâó ðåã³îíó" -#: ../spell.c:7822 msgid "E754: Only up to 8 regions supported" msgstr "E754: ϳäòðèìóºòüñÿ ò³ëüêè äî âîñüìè ðåã³îí³â" -#: ../spell.c:7846 #, c-format msgid "E755: Invalid region in %s" msgstr "E755: Íåêîðåêòíèé ðåã³îí ó %s" -#: ../spell.c:7907 msgid "Warning: both compounding and NOBREAK specified" msgstr "Çàñòåðåæåííÿ: çàçíà÷åíî îáèäâà `ñêëàäí³ ñëîâà' ³ NOBREAK" -#: ../spell.c:7920 #, c-format msgid "Writing spell file %s ..." msgstr "Çàïèñóºòüñÿ ôàéë îðôîãðàô³¿ %s ..." -#: ../spell.c:7925 msgid "Done!" msgstr "Çðîáëåíî!" -#: ../spell.c:8034 #, c-format msgid "E765: 'spellfile' does not have %<PRId64> entries" msgstr "E765: 'spellfile' íå ì³ñòèòü %<PRId64> åëåìåíò³â" -#: ../spell.c:8074 #, c-format msgid "Word '%.*s' removed from %s" msgstr "Ñëîâî '%.*s' çíèùåíî ç %s" -#: ../spell.c:8117 #, c-format msgid "Word '%.*s' added to %s" msgstr "Ñëîâî '%.*s' äîäàíî äî %s" -#: ../spell.c:8381 msgid "E763: Word characters differ between spell files" msgstr "E763: Ñèìâîëè ó ñëîâ³ â³äð³çíÿþòüñÿ ó ôàéëàõ îðôîãðàô³¿" -#: ../spell.c:8684 msgid "Sorry, no suggestions" msgstr "Ïðîáà÷òå, íåìຠïðîïîçèö³é" -#: ../spell.c:8687 #, c-format msgid "Sorry, only %<PRId64> suggestions" msgstr "Ïðîáà÷òå, ò³ëüêè %<PRId64> ïðîïîçèö³é" #. for when 'cmdheight' > 1 #. avoid more prompt -#: ../spell.c:8704 #, c-format msgid "Change \"%.*s\" to:" msgstr "Çàì³íèòè «%.*s» íà:" -#: ../spell.c:8737 #, c-format msgid " < \"%.*s\"" msgstr " < «%.*s»" # msgstr "E34: " -#: ../spell.c:8882 msgid "E752: No previous spell replacement" msgstr "E752: Íåìຠïîïåðåäíüî¿ çàì³íè" # msgstr "E333: " -#: ../spell.c:8925 #, c-format msgid "E753: Not found: %s" msgstr "E753: Íå çíàéäåíî: %s" -#: ../spell.c:9276 #, c-format msgid "E778: This does not look like a .sug file: %s" msgstr "E778: Íå ñõîæå íà ôàéë .sug: %s" -#: ../spell.c:9282 #, c-format msgid "E779: Old .sug file, needs to be updated: %s" msgstr "E779: Çàñòàð³ëèé ôàéë .sug, òðåáà ïîíîâèòè: %s" -#: ../spell.c:9286 #, c-format msgid "E780: .sug file is for newer version of Vim: %s" msgstr "E780: Ôàéë .sug äëÿ á³ëüø íîâî¿ âåðñ³¿ Vim: %s" -#: ../spell.c:9295 #, c-format msgid "E781: .sug file doesn't match .spl file: %s" msgstr "E781: Ôàéë .sug íå â³äïîâ³äຠôàéëó .spl: %s" -#: ../spell.c:9305 #, c-format msgid "E782: error while reading .sug file: %s" msgstr "E782: Ïîìèëêà ÷èòàííÿ ôàéëó .sug: %s" #. This should have been checked when generating the .spl #. file. -#: ../spell.c:11575 msgid "E783: duplicate char in MAP entry" msgstr "E783: Ïîâòîðåíî ñèìâîë ó åëåìåíò³ MAP" # msgstr "E391: " -#: ../syntax.c:266 msgid "No Syntax items defined for this buffer" msgstr "Äëÿ áóôåðà íå âèçíà÷åíî åëåìåíò³â ñèíòàêñèñó" -#: ../syntax.c:3083 ../syntax.c:3104 ../syntax.c:3127 #, c-format msgid "E390: Illegal argument: %s" msgstr "E390: Íåïðàâèëüíèé àðãóìåíò: %s" -#: ../syntax.c:3299 #, c-format msgid "E391: No such syntax cluster: %s" msgstr "E391: Íåìຠòàêîãî ñèíòàêñè÷íîãî êëàñòåðà: %s" -#: ../syntax.c:3433 msgid "syncing on C-style comments" msgstr "ñèíõðîí³çóºòüñÿ ïî êîìåíòàðÿõ ñòèëþ Ñ" -#: ../syntax.c:3439 msgid "no syncing" msgstr "áåç ñèíõðîí³çàö³¿" -#: ../syntax.c:3441 msgid "syncing starts " msgstr "ïî÷èíàºòüñÿ ñèíõðîí³çàö³ÿ çà " -#: ../syntax.c:3443 ../syntax.c:3506 msgid " lines before top line" msgstr " ðÿäê³â ïåðåä ïåðøèì ðÿäêîì" -#: ../syntax.c:3448 msgid "" "\n" "--- Syntax sync items ---" @@ -5858,7 +4636,6 @@ msgstr "" "\n" "--- Åëåìåíòè ñèíõðîí³çàö³¿ ñèíòàêñèñó ---" -#: ../syntax.c:3452 msgid "" "\n" "syncing on items" @@ -5866,7 +4643,6 @@ msgstr "" "\n" "ñèíõðîí³çàö³ÿ ïî åëåìåíòàõ" -#: ../syntax.c:3457 msgid "" "\n" "--- Syntax items ---" @@ -5874,300 +4650,241 @@ msgstr "" "\n" "--- Åëåìåíòè ñèíòàêñèñó ---" -#: ../syntax.c:3475 #, c-format msgid "E392: No such syntax cluster: %s" msgstr "E392: Íåìຠòàêîãî ñèíòàêñè÷íîãî êëàñòåðà: %s" -#: ../syntax.c:3497 msgid "minimal " msgstr "ì³í³ìàëüíèé " -#: ../syntax.c:3503 msgid "maximal " msgstr "ìàêñèìàëüíèé " -#: ../syntax.c:3513 msgid "; match " msgstr "; çá³ã " -#: ../syntax.c:3515 msgid " line breaks" msgstr " ðîçðèâè ðÿäê³â" -#: ../syntax.c:4076 msgid "E395: contains argument not accepted here" msgstr "E395: ̳ñòèòü íåïðèéíÿòí³ òóò àðãóìåíòè" # msgstr "E14: " -#: ../syntax.c:4096 msgid "E844: invalid cchar value" msgstr "E844: Íåêîðåêòíå çíà÷åííÿ cchar" -#: ../syntax.c:4107 msgid "E393: group[t]here not accepted here" msgstr "E393: group[t]hete òóò íåïðèéíÿòíèé" -#: ../syntax.c:4126 #, c-format msgid "E394: Didn't find region item for %s" msgstr "E394: Íå çíàéäåíî åëåìåíò ðåã³îíó äëÿ %s" # msgstr "E396: " -#: ../syntax.c:4188 msgid "E397: Filename required" msgstr "E397: Ïîòð³áíà íàçâà ôàéëó" -#: ../syntax.c:4221 msgid "E847: Too many syntax includes" msgstr "E847: Çàáàãàòî ñèíòàêñè÷íèõ âêëþ÷åíü" -#: ../syntax.c:4303 #, c-format msgid "E789: Missing ']': %s" msgstr "E789: Ïðîïóùåíî ']': %s" -#: ../syntax.c:4531 #, c-format msgid "E398: Missing '=': %s" msgstr "E398: Ïðîïóùåíî `=': %s" # --------------------------------------- -#: ../syntax.c:4666 #, c-format msgid "E399: Not enough arguments: syntax region %s" msgstr "E399: Áðàêóº àðãóìåíò³â: ñèíòàêñè÷íèé ðåã³îí %s" -#: ../syntax.c:4870 msgid "E848: Too many syntax clusters" msgstr "E848: Çàáàãàòî ñèíòàêñè÷íèõ êëàñòåð³â" -#: ../syntax.c:4954 msgid "E400: No cluster specified" msgstr "E400: Êëàñòåð íå âêàçàíî" #. end delimiter not found -#: ../syntax.c:4986 #, c-format msgid "E401: Pattern delimiter not found: %s" msgstr "E401: ʳíåöü çðàçêó íå çíàéäåíî: %s" -#: ../syntax.c:5049 #, c-format msgid "E402: Garbage after pattern: %s" msgstr "E402: Ñì³òòÿ ï³ñëÿ çðàçêó: %s" # msgstr "E402: " -#: ../syntax.c:5120 msgid "E403: syntax sync: line continuations pattern specified twice" msgstr "" "E403: Ñèíòàêñè÷íà ñèíõðîí³çàö³ÿ: çðàçîê äëÿ ïðîäîâæåííÿ ðÿäêà âêàçàíî äâ³÷³" -#: ../syntax.c:5169 #, c-format msgid "E404: Illegal arguments: %s" msgstr "E404: Íåïðàâèëüí³ àðãóìåíòè: %s" # msgstr "E404: " -#: ../syntax.c:5217 #, c-format msgid "E405: Missing equal sign: %s" msgstr "E405: Ïðîïóùåíî çíàê ð³âíîñò³: %s" # msgstr "E405: " -#: ../syntax.c:5222 #, c-format msgid "E406: Empty argument: %s" msgstr "E406: Ïîðîæí³é àðãóìåíò: %s" # msgstr "E406: " -#: ../syntax.c:5240 #, c-format msgid "E407: %s not allowed here" msgstr "E407: %s òóò íå äîçâîëåíî" -#: ../syntax.c:5246 #, c-format msgid "E408: %s must be first in contains list" msgstr "E408: %s ìຠáóòè ïåðøèì ðÿäêîì ó ñïèñêó contains" -#: ../syntax.c:5304 #, c-format msgid "E409: Unknown group name: %s" msgstr "E409: Íåâ³äîìà íàçâà ãðóïè: %s" # msgstr "E409: " -#: ../syntax.c:5512 #, c-format msgid "E410: Invalid :syntax subcommand: %s" msgstr "E410: Íåïðàâèëüíà ï³äêîìàíäà :syntax: %s" -#: ../syntax.c:5854 msgid "" " TOTAL COUNT MATCH SLOWEST AVERAGE NAME PATTERN" msgstr "" " ÂÑÜÎÃÎ Ê-ÒÜ ÑϲÂÏ. ÍÀÉÏβË. ÑÅÐÅÄÍ. ÍÀÇÂÀ ØÀÁËÎÍ" -#: ../syntax.c:6146 msgid "E679: recursive loop loading syncolor.vim" msgstr "E679: Ðåêóðñèâíèé öèêë ÷èòàííÿ syncolor.vim" # msgstr "E410: " -#: ../syntax.c:6256 #, c-format msgid "E411: highlight group not found: %s" msgstr "E411: Ãðóïó ï³äñâ³÷óâàííÿ íå çíàéäåíî: %s" # msgstr "E411: " -#: ../syntax.c:6278 #, c-format msgid "E412: Not enough arguments: \":highlight link %s\"" msgstr "E412: Íåäîñòàòíüî àðãóìåíò³â: «:highlight link %s»" # msgstr "E412: " -#: ../syntax.c:6284 #, c-format msgid "E413: Too many arguments: \":highlight link %s\"" msgstr "E413: Çàáàãàòî àðãóìåíò³â: «:highlight link %s»" # msgstr "E413: " -#: ../syntax.c:6302 msgid "E414: group has settings, highlight link ignored" msgstr "E414: Ãðóìà ìຠsettings, highlight link ïðî³ãíîðîâàíî" # msgstr "E414: " -#: ../syntax.c:6367 #, c-format msgid "E415: unexpected equal sign: %s" msgstr "E415: Íåñïîä³âàíèé çíàê ð³âíîñò³: %s" # msgstr "E415: " -#: ../syntax.c:6395 #, c-format msgid "E416: missing equal sign: %s" msgstr "E416: Ïðîïóùåíî çíàê ð³âíîñò³: %s" -#: ../syntax.c:6418 #, c-format msgid "E417: missing argument: %s" msgstr "E417: Ïðîïóùåíî àðãóìåíò: %s" -#: ../syntax.c:6446 #, c-format msgid "E418: Illegal value: %s" msgstr "E418: Íåïðàâèëüíå çíà÷åííÿ: %s" # msgstr "E418: " -#: ../syntax.c:6496 msgid "E419: FG color unknown" msgstr "E419: Íåâ³äîìèé êîë³ð òåêñòó" # msgstr "E419: " -#: ../syntax.c:6504 msgid "E420: BG color unknown" msgstr "E420: Íåâ³äîìèé êîë³ð ôîíó" # msgstr "E420: " -#: ../syntax.c:6564 #, c-format msgid "E421: Color name or number not recognized: %s" msgstr "E421: Íåðîçï³çíàíà íàçâà àáî íîìåð êîëüîðó: %s" # msgstr "E421: " -#: ../syntax.c:6714 #, c-format msgid "E422: terminal code too long: %s" msgstr "E422: Çàíàäòî äîâãèé êîä òåðì³íàëó: %s" # msgstr "E422: " -#: ../syntax.c:6753 #, c-format msgid "E423: Illegal argument: %s" msgstr "E423: Íåïðàâèëüíèé àðãóìåíò: %s" # msgstr "E423: " -#: ../syntax.c:6925 msgid "E424: Too many different highlighting attributes in use" msgstr "E424: Âèêîðèñòàíî çàáàãàòî ð³çíèõ àòðèáóò³â êîëüîðó" -#: ../syntax.c:7427 msgid "E669: Unprintable character in group name" msgstr "E669: Íåäðóêîâíèé ñèìâîë ó íàçâ³ ãðóïè" # msgstr "E181: " -#: ../syntax.c:7434 msgid "W18: Invalid character in group name" msgstr "W18: Íåêîðåêòíèé ñèìâîë ó íàçâ³ ãðóïè" -#: ../syntax.c:7448 msgid "E849: Too many highlight and syntax groups" msgstr "E849: Çàáàãàòî ãðóï ï³äñâ³÷óâàííÿ ³ ñèíòàêñèñó" # msgstr "E424: " -#: ../tag.c:104 msgid "E555: at bottom of tag stack" msgstr "E555: ʳíåöü ñòåêó òå´³â" -#: ../tag.c:105 msgid "E556: at top of tag stack" msgstr "E556: Âåðøèíà ñòåêó òå´³â" -#: ../tag.c:380 msgid "E425: Cannot go before first matching tag" msgstr "E425: Öå âæå íàéïåðøèé â³äïîâ³äíèé òå´" # msgstr "E425: " -#: ../tag.c:504 #, c-format msgid "E426: tag not found: %s" msgstr "E426: Òå´ íå çíàéäåíî: %s" # msgstr "E426: " -#: ../tag.c:528 msgid " # pri kind tag" msgstr " # ïð³ òèï òå´" -#: ../tag.c:531 msgid "file\n" msgstr "ôàéë\n" -#: ../tag.c:829 msgid "E427: There is only one matching tag" msgstr "E427: Ëèøå îäèí â³äïîâ³äíèé òå´" # msgstr "E427: " -#: ../tag.c:831 msgid "E428: Cannot go beyond last matching tag" msgstr "E428: Öå âæå îñòàíí³é â³äïîâ³äíèé òå´" # msgstr "E428: " -#: ../tag.c:850 #, c-format msgid "File \"%s\" does not exist" msgstr "Ôàéë «%s» íå ³ñíóº" #. Give an indication of the number of matching tags -#: ../tag.c:859 #, c-format msgid "tag %d of %d%s" msgstr "òå´ %d ç %d%s" -#: ../tag.c:862 msgid " or more" msgstr " àáî á³ëüøå" -#: ../tag.c:864 msgid " Using tag with different case!" msgstr " Âèêîðèñòàíî òå´, íå ðîçð³çíÿþ÷è âåëèê³ é ìàë³ ë³òåðè" -#: ../tag.c:909 #, c-format msgid "E429: File \"%s\" does not exist" msgstr "E429: Ôàéë «%s» íå ³ñíóº" # msgstr "E429: " #. Highlight title -#: ../tag.c:960 msgid "" "\n" " # TO tag FROM line in file/text" @@ -6175,85 +4892,68 @@ msgstr "" "\n" " # ÄÎ òå´ó Ç ðÿäêà ó ôàéë³/òåêñò³" -#: ../tag.c:1303 #, c-format msgid "Searching tags file %s" msgstr "Øóêàºòüñÿ ó ôàéë³ òå´³â %s" -#: ../tag.c:1545 msgid "Ignoring long line in tags file" msgstr "²ãíîðóºòüñÿ äîâãèé ðÿäîê ó ôàéë³ ç ïîçíà÷êàìè" # msgstr "E430: " -#: ../tag.c:1915 #, c-format msgid "E431: Format error in tags file \"%s\"" msgstr "E431: Ïîìèëêà ôîðìàòó ó ôàéë³ ò崳⠫%s»" # msgstr "E431: " -#: ../tag.c:1917 #, c-format msgid "Before byte %<PRId64>" msgstr "Ïåðåä áàéòîì %<PRId64>" -#: ../tag.c:1929 #, c-format msgid "E432: Tags file not sorted: %s" msgstr "E432: Ôàéë òå´³â íå âïîðÿäêîâàíèé: %s" # msgstr "E432: " #. never opened any tags file -#: ../tag.c:1960 msgid "E433: No tags file" msgstr "E433: Íåìຠôàéëó òå´³â" # msgstr "E433: " -#: ../tag.c:2536 msgid "E434: Can't find tag pattern" msgstr "E434: Íå âäàëîñÿ çíàéòè çðàçîê òå´ó" # msgstr "E434: " -#: ../tag.c:2544 msgid "E435: Couldn't find tag, just guessing!" msgstr "E435: Íå âäàëîñÿ çíàéòè òå´, ò³ëüêè ïðèïóùåííÿ!" -#: ../tag.c:2797 #, c-format msgid "Duplicate field name: %s" msgstr "Íàçâà ïîëÿ ïîâòîðþºòüñÿ: %s" # msgstr "E435: " -#: ../term.c:1442 msgid "' not known. Available builtin terminals are:" msgstr "' íå â³äîìèé. Âáóäîâàí³ òåðì³íàëè:" -#: ../term.c:1463 msgid "defaulting to '" msgstr "ïî÷àòêîâî '" -#: ../term.c:1731 msgid "E557: Cannot open termcap file" msgstr "E557: Íå âäàëîñÿ â³äêðèòè ôàéë ìîæëèâîñòåé òåðì³íàë³â" -#: ../term.c:1735 msgid "E558: Terminal entry not found in terminfo" msgstr "E558: Íåìຠ³íôîðìàö³¿ ïðî òåðì³íàë" -#: ../term.c:1737 msgid "E559: Terminal entry not found in termcap" msgstr "E559: Íåìຠ³íôîðìàö³¿ ïðî ìîæëèâîñò³ òåðì³íàëó" -#: ../term.c:1878 #, c-format msgid "E436: No \"%s\" entry in termcap" msgstr "E436: Íåìຠçàïèñó «%s» ïðî ìîæëèâîñò³ òåðì³íàëó" -#: ../term.c:2249 msgid "E437: terminal capability \"cm\" required" msgstr "E437: Ïîòð³áíà ìîæëèâ³ñòü òåðì³íàëó «cm»" #. Highlight title -#: ../term.c:4376 msgid "" "\n" "--- Terminal keys ---" @@ -6261,174 +4961,136 @@ msgstr "" "\n" "--- Êëàâ³ø³ òåðì³íàëó ---" -#: ../ui.c:481 msgid "Vim: Error reading input, exiting...\n" msgstr "Vim: Ïîìèëêà ÷èòàííÿ ââîäó, ðîáîòà çàâåðøóºòüñÿ...\n" #. This happens when the FileChangedRO autocommand changes the #. * file in a way it becomes shorter. -#: ../undo.c:379 -#, fuzzy msgid "E881: Line count changed unexpectedly" -msgstr "E834: ʳëüê³ñòü ðÿäê³â íåñïîä³âàíî çì³íèëàñÿ" +msgstr "E881: ʳëüê³ñòü ðÿäê³â íåñïîä³âàíî çì³íèëàñÿ" -#: ../undo.c:627 #, c-format msgid "E828: Cannot open undo file for writing: %s" msgstr "E828: Íå âäàëîñÿ â³äêðèòè ôàéë ³ñòî𳿠äëÿ çàïèñó: %s" -#: ../undo.c:717 #, c-format msgid "E825: Corrupted undo file (%s): %s" msgstr "E825: Ôàéë ³ñòî𳿠ïîøêîäæåíî (%s): %s" -#: ../undo.c:1039 msgid "Cannot write undo file in any directory in 'undodir'" msgstr "Íå âäàëîñÿ çàïèñàòè ôàéë ³ñòî𳿠ó æîäíó ç äèðåêòîð³é ó 'undodir'" -#: ../undo.c:1074 #, c-format msgid "Will not overwrite with undo file, cannot read: %s" msgstr "Will not overwrite with undo file, cannot read: %s" -#: ../undo.c:1092 #, c-format msgid "Will not overwrite, this is not an undo file: %s" msgstr "Íå ìîæíà ïåðåçàïèñàòè, öå íå ôàéë ³ñòîð³¿: %s" -#: ../undo.c:1108 msgid "Skipping undo file write, nothing to undo" msgstr "Ôàéë ³ñòî𳿠íå çàïèñóºòüñÿ, í³÷îãî ïîâåðòàòè" -#: ../undo.c:1121 #, c-format msgid "Writing undo file: %s" msgstr "Çàïèñóºòüñÿ ôàéë ³ñòîð³¿: %s" -#: ../undo.c:1213 #, c-format msgid "E829: write error in undo file: %s" msgstr "E829: Ïîìèëêà çàïèñó ó ôàéë³ ³ñòîð³¿: %s" -#: ../undo.c:1280 #, c-format msgid "Not reading undo file, owner differs: %s" msgstr "Ôàéë ³ñòî𳿠ïðî÷èòàíî íå áóäå, âëàñíèê ³íøèé: %s" -#: ../undo.c:1292 #, c-format msgid "Reading undo file: %s" msgstr "×èòàºòüñÿ ôàéë ³ñòîð³¿: %s" -#: ../undo.c:1299 #, c-format msgid "E822: Cannot open undo file for reading: %s" msgstr "E822: Íå âäàëîñÿ â³äêðèòè ôàéë äëÿ ÷èòàííÿ: %s" # msgstr "E333: " -#: ../undo.c:1308 #, c-format msgid "E823: Not an undo file: %s" msgstr "E823: Íå ôàéë ³ñòîð³¿: %s" -#: ../undo.c:1313 #, c-format msgid "E824: Incompatible undo file: %s" msgstr "E824: Íåñóì³ñíèé ôàéë ³ñòîð³¿: %s" -#: ../undo.c:1328 msgid "File contents changed, cannot use undo info" msgstr "Âì³ñò ôàéëó çì³íèâñÿ, íå ìîæíà âèêîðèñòàòè ³íôîðìàö³þ ïðî ³ñòîð³þ" -#: ../undo.c:1497 #, c-format msgid "Finished reading undo file %s" msgstr "Çàê³í÷åíî ÷èòàííÿ ôàéëó ³ñòî𳿠%s" -#: ../undo.c:1586 ../undo.c:1812 msgid "Already at oldest change" msgstr "Âæå íà íàéñòàðø³é çì³í³" -#: ../undo.c:1597 ../undo.c:1814 msgid "Already at newest change" msgstr "Âæå íà íàéíîâ³ø³é çì³í³" -#: ../undo.c:1806 #, c-format msgid "E830: Undo number %<PRId64> not found" msgstr "E830: Çì³íó %<PRId64> íå çíàéäåíî â ³ñòîð³¿" -#: ../undo.c:1979 msgid "E438: u_undo: line numbers wrong" msgstr "E438: u_undo: íåïðàâèëüí³ íîìåðè ðÿäê³â" -#: ../undo.c:2183 msgid "more line" msgstr "äîäàíî ðÿäîê" -#: ../undo.c:2185 msgid "more lines" msgstr "ðÿäê³â äîäàíî" -#: ../undo.c:2187 msgid "line less" msgstr "çíèùåíî ðÿäîê" -#: ../undo.c:2189 msgid "fewer lines" msgstr "ðÿäê³â çíèùåíî" # msgstr "E438: " -#: ../undo.c:2193 msgid "change" msgstr "çì³íà" # msgstr "E438: " -#: ../undo.c:2195 msgid "changes" msgstr "çì³í" -#: ../undo.c:2225 #, c-format msgid "%<PRId64> %s; %s #%<PRId64> %s" msgstr "%<PRId64> %s; %s #%<PRId64> %s" -#: ../undo.c:2228 msgid "before" msgstr "ïåðåä" -#: ../undo.c:2228 msgid "after" msgstr "ï³ñëÿ" -#: ../undo.c:2325 msgid "Nothing to undo" msgstr "Íåìຠí³÷îãî ñêàñîâóâàòè" -#: ../undo.c:2330 msgid "number changes when saved" msgstr "íîìåð çì³íè ÷àñ çáåðåæåíî" -#: ../undo.c:2360 #, c-format msgid "%<PRId64> seconds ago" msgstr "%<PRId64> ñåêóíä òîìó" # msgstr "E406: " -#: ../undo.c:2372 msgid "E790: undojoin is not allowed after undo" msgstr "E790: Íå ìîæíà âèêîíàòè undojoin ï³ñëÿ undo" -#: ../undo.c:2466 msgid "E439: undo list corrupt" msgstr "E439: Ñïèñîê ñêàñóâàííÿ ïîøêîäæåíî" # msgstr "E439: " -#: ../undo.c:2495 msgid "E440: undo line missing" msgstr "E440: ³äñóòí³é ðÿäîê ñêàñóâàííÿ" -#: ../version.c:600 msgid "" "\n" "Included patches: " @@ -6436,7 +5098,6 @@ msgstr "" "\n" "Âêëþ÷åí³ ëàòêè: " -#: ../version.c:627 msgid "" "\n" "Extra patches: " @@ -6444,11 +5105,9 @@ msgstr "" "\n" "Äîäàòêîâ³ ëàòêè: " -#: ../version.c:639 ../version.c:864 msgid "Modified by " msgstr "Çì³íèâ " -#: ../version.c:646 msgid "" "\n" "Compiled " @@ -6456,11 +5115,9 @@ msgstr "" "\n" "Ñêîìï³ëþâàâ " -#: ../version.c:649 msgid "by " msgstr " " -#: ../version.c:660 msgid "" "\n" "Huge version " @@ -6468,1921 +5125,126 @@ msgstr "" "\n" "óãàíòñüêà âåðñ³ÿ " -#: ../version.c:661 msgid "without GUI." msgstr "áåç GUI." -#: ../version.c:662 msgid " Features included (+) or not (-):\n" msgstr " Âêëþ÷åí³ (+) àáî íå âêëþ÷åí³ (-) êîìïîíåíòè:\n" -#: ../version.c:667 msgid " system vimrc file: \"" msgstr " ñèñòåìíèé vimrc: \"" -#: ../version.c:672 msgid " user vimrc file: \"" msgstr " vimrc êîðèñòóâà÷à: \"" -#: ../version.c:677 msgid " 2nd user vimrc file: \"" msgstr " äðóãèé vimrc êîðèñòóâà÷à: \"" -#: ../version.c:682 msgid " 3rd user vimrc file: \"" msgstr " òðåò³é vimrc êîðèñòóâà÷à: \"" -#: ../version.c:687 msgid " user exrc file: \"" msgstr " exrc êîðèñòóâà÷à: \"" -#: ../version.c:692 msgid " 2nd user exrc file: \"" msgstr " äðóãèé exrc êîðèñòóâà÷à: \"" -#: ../version.c:699 msgid " fall-back for $VIM: \"" msgstr " çàì³íà äëÿ $VIM: \"" -#: ../version.c:705 msgid " f-b for $VIMRUNTIME: \"" msgstr " çàì³íà äëÿ $VIMRUNTIME: \"" -#: ../version.c:709 msgid "Compilation: " msgstr "Ñêîìï³ëüîâàíî: " -#: ../version.c:712 msgid "Linking: " msgstr "Ñêîìïîíîâàíî: " -#: ../version.c:717 msgid " DEBUG BUILD" msgstr " ÂÅÐÑ²ß ÄËß ÍÀËÀÃÎÄÆÅÍÍß" -#: ../version.c:767 msgid "VIM - Vi IMproved" msgstr "VIM - Ïîêðàùåíèé Vi" -#: ../version.c:769 msgid "version " msgstr "âåðñ³ÿ " -#: ../version.c:770 msgid "by Bram Moolenaar et al." msgstr "àâòîð: Bram Moolenaar òà ³í." -#: ../version.c:774 msgid "Vim is open source and freely distributable" msgstr "Vim — öå â³äêðèòà é â³ëüíî ðîçïîâñþäæóâàíà ïðîãðàìà" -#: ../version.c:776 msgid "Help poor children in Uganda!" msgstr "Äîïîìîæ³òü ñèðîòàì ç Óãàíäè!" -#: ../version.c:777 msgid "type :help iccf<Enter> for information " msgstr ":help iccf<Enter> ïîäðîáèö³ " -#: ../version.c:779 msgid "type :q<Enter> to exit " msgstr ":q<Enter> âèõ³ä ç Vim " -#: ../version.c:780 msgid "type :help<Enter> or <F1> for on-line help" msgstr ":help<Enter> àáî <F1> ïåðåãëÿä äîïîìîãè " -#: ../version.c:781 msgid "type :help version7<Enter> for version info" msgstr ":help version7<Enter> ³íôîðìàö³ÿ ïðî âåðñ³þ " -#: ../version.c:784 msgid "Running in Vi compatible mode" msgstr "Âè ïðàöþºòå â ðåæèì³ ñóì³ñíîìó ç Vi" -#: ../version.c:785 msgid "type :set nocp<Enter> for Vim defaults" msgstr ":set nocp<Enter> ðåæèì íåñóì³ñíèé ç Vi " -#: ../version.c:786 msgid "type :help cp-default<Enter> for info on this" msgstr ":help cp-default<Enter> ³íôîðìàö³ÿ ïðî ñóì³ñí³ñòü" -#: ../version.c:827 msgid "Sponsor Vim development!" msgstr "ϳäòðèìàéòå ðîçðîáêó ðåäàêòîðà Vim!" -#: ../version.c:828 msgid "Become a registered Vim user!" msgstr "Ñòàíüòå çàðåºñòðîâàíèì êîðèñòóâà÷åì Vim!" -#: ../version.c:831 msgid "type :help sponsor<Enter> for information " msgstr ":help sponsor<Enter> ïîäàëüøà ³íôîðìàö³ÿ " -#: ../version.c:832 msgid "type :help register<Enter> for information " msgstr ":help register<Enter> ïîäàëüøà ³íôîðìàö³ÿ " -#: ../version.c:834 msgid "menu Help->Sponsor/Register for information " msgstr "ìåíþ Äîïîìîãà->Ñïîíñîð/Ðåºñòðàö³ÿ ïîäðîáèö³ " # msgstr "E444: " -#: ../window.c:119 msgid "Already only one window" msgstr "Öå âæå ºäèíå â³êíî" -#: ../window.c:224 msgid "E441: There is no preview window" msgstr "E441: Íåìຠâ³êíà ïåðåãëÿäó" # msgstr "E441: " -#: ../window.c:559 msgid "E442: Can't split topleft and botright at the same time" msgstr "E442: Íå âäàëîñÿ îäíî÷àñíî ðîçáèòè topleft ³ botright" # msgstr "E442: " -#: ../window.c:1228 msgid "E443: Cannot rotate when another window is split" msgstr "E443: Íå âäàëîñÿ ïåðåì³ñòèòè â³êíî, çàâàæàþòü ³íø³" # msgstr "E443: " -#: ../window.c:1803 msgid "E444: Cannot close last window" msgstr "E444: Íå âäàëîñÿ çàêðèòè îñòàííº â³êíî" # msgstr "E443: " -#: ../window.c:1810 msgid "E813: Cannot close autocmd window" msgstr "E813: Íå âäàëîñÿ çàêðèòè â³êíî autocmd" # msgstr "E443: " -#: ../window.c:1814 msgid "E814: Cannot close window, only autocmd window would remain" msgstr "E814: Íå âäàëîñÿ çàêðèòè â³êíî, çàëèøèëîñÿ á ò³ëüêè â³êíî autocmd" -#: ../window.c:2717 msgid "E445: Other window contains changes" msgstr "E445: Ó ³íøîìó â³êí³ º çì³íè" # msgstr "E445: " -#: ../window.c:4805 msgid "E446: No file name under cursor" msgstr "E446: Íåìຠíàçâè ôàéëó íàä êóðñîðîì" - -#~ msgid "E831: bf_key_init() called with empty password" -#~ msgstr "E831: Âèêëèêàíî bf_key_init() ç ïîðîæí³ì ïàðîëåì" - -#~ msgid "E820: sizeof(uint32_t) != 4" -#~ msgstr "E820: sizeof(uint32_t) != 4" - -#~ msgid "E817: Blowfish big/little endian use wrong" -#~ msgstr "E817: Íåïðàâèëüíå âèêîðèñòàííÿ ïîðÿäêó áàéò³â Blowfish (BE/LE)" - -#~ msgid "E818: sha256 test failed" -#~ msgstr "E818: Íå ïðîéøëà ïåðåâ³ðêà sha256" - -#~ msgid "E819: Blowfish test failed" -#~ msgstr "E819: Íå ïðîéøëà ïåðåâ³ðêà Blowfish" - -#~ msgid "Patch file" -#~ msgstr "Ëàòêà" - -#~ msgid "" -#~ "&OK\n" -#~ "&Cancel" -#~ msgstr "" -#~ "&O:Ãàðàçä\n" -#~ "&C:Ñêàñóâàòè" - -#~ msgid "E240: No connection to Vim server" -#~ msgstr "E240: Íåìຠç'ºäíàííÿ ³ç ñåðâåðîì Vim" - -#~ msgid "E241: Unable to send to %s" -#~ msgstr "E241: Íå âäàëîñÿ â³ä³ñëàòè äî %s" - -#~ msgid "E277: Unable to read a server reply" -#~ msgstr "E277: Íå âäàëîñÿ ïðî÷èòàòè â³äïîâ³äü ñåðâåðà" - -#~ msgid "E258: Unable to send to client" -#~ msgstr "E258: Íå âäàëîñÿ íàä³ñëàòè ê볺íòó" - -#~ msgid "Save As" -#~ msgstr "Çáåðåãòè ÿê" - -#~ msgid "Source Vim script" -#~ msgstr "Ïðî÷èòàòè ñêðèïò Vim" - -#~ msgid "Edit File" -#~ msgstr "Ðåäàãóâàòè Ôàéë" - -#~ msgid " (NOT FOUND)" -#~ msgstr " (ÍÅ ÇÍÀÉÄÅÍÎ)" - -#~ msgid "unknown" -#~ msgstr "Íåâ³äîìî" - -# msgstr "E185: " -#~ msgid "Edit File in new window" -#~ msgstr "Ðåäàãóâàòè ôàéë ó íîâîìó â³êí³" - -#~ msgid "Append File" -#~ msgstr "Äîïèñàòè ôàéë" - -# msgstr "E187: " -#~ msgid "Window position: X %d, Y %d" -#~ msgstr "Ïîçèö³ÿ â³êíà: X %d, Y %d" - -# msgstr "E188: " -#~ msgid "Save Redirection" -#~ msgstr "Çáåðåãòè ïåðåàäðåñîâàíèé âèâ³ä" - -#~ msgid "Save View" -#~ msgstr "Çáåðåãòè âèãëÿä" - -#~ msgid "Save Session" -#~ msgstr "Çáåðåãòè ñåàíñ" - -#~ msgid "Save Setup" -#~ msgstr "Çáåðåãòè íàëàøòóâàííÿ" - -#~ msgid "E809: #< is not available without the +eval feature" -#~ msgstr "E809: #< íå äîñòóïíà áåç ìîæëèâîñò³ +eval" - -#~ msgid "E196: No digraphs in this version" -#~ msgstr "E196: Ó ö³é âåðñ³¿ íåìຠäèãðàô³â" - -#~ msgid "is a device (disabled with 'opendevice' option)" -#~ msgstr "º ïðèñòðîºì (âèìêíåíî îïö³ºþ 'opendevice')" - -#~ msgid "Reading from stdin..." -#~ msgstr "×èòàºòüñÿ ç stdin..." - -#~ msgid "[blowfish]" -#~ msgstr "[blowfish]" - -#~ msgid "[crypted]" -#~ msgstr "[çàøèôðîâàíî]" - -#~ msgid "E821: File is encrypted with unknown method" -#~ msgstr "E821: Ôàéë çàøèôðîâàíî íåâ³äîìèì ìåòîäîì" - -#~ msgid "NetBeans disallows writes of unmodified buffers" -#~ msgstr "NetBeans íå äîçâîëÿº çàïèñóâàòè ó íåçì³íåí³ áóôåðè" - -# msgstr "E391: " -#~ msgid "Partial writes disallowed for NetBeans buffers" -#~ msgstr "×àñòêîâ³ çàïèñè çàáîðîíåí³ äëÿ áóôåð³â NetBeans" - -#~ msgid "writing to device disabled with 'opendevice' option" -#~ msgstr "Çàïèñ äî ïðèñòðîþ çàáîðîíåíî îïö³ºþ 'opendevice'" - -#~ msgid "E460: The resource fork would be lost (add ! to override)" -#~ msgstr "E460: óëêó ðåñóðñ³â ìîæíà âòðàòèòè (! ùîá íå çâàæàòè)" - -#~ msgid "<cannot open> " -#~ msgstr "<íå â³äêðèâàºòüñÿ> " - -#~ msgid "E616: vim_SelFile: can't get font %s" -#~ msgstr "E616: vim_SelFile: íå âäàëîñÿ îòðèìàòè øðèôò %s" - -#~ msgid "E614: vim_SelFile: can't return to current directory" -#~ msgstr "E614: vim_SelFile: íå âäàëîñÿ ïîâåðíóòèñÿ â ïîòî÷íèé êàòàëîã" - -#~ msgid "Pathname:" -#~ msgstr "Øëÿõ:" - -#~ msgid "E615: vim_SelFile: can't get current directory" -#~ msgstr "E615: vim_SelFile: íå âäàëîñÿ îòðèìàòè ïîòî÷íèé êàòàëîã" - -#~ msgid "OK" -#~ msgstr "Ãàðàçä" - -#~ msgid "Cancel" -#~ msgstr "Ñêàñóâàòè" - -#~ msgid "Vim dialog" -#~ msgstr "ijàëîã Vim" - -#~ msgid "Scrollbar Widget: Could not get geometry of thumb pixmap." -#~ msgstr "Scrollbar Widget: Íå âäàëîñÿ âèçíà÷èòè ðîçì³ð ñêîðî÷åíî¿ êàðòèíêè." - -#~ msgid "E232: Cannot create BalloonEval with both message and callback" -#~ msgstr "E232: Íå âäàëîñÿ ñòâîðèòè BalloonEval ç ïîâ³äîìëåííÿì ³ ôóíêö³ºþ" - -#~ msgid "E851: Failed to create a new process for the GUI" -#~ msgstr "E851: Íå âäàëîñÿ ñòâîðèòè íîâèé ïðîöåñ äëÿ GUI" - -#~ msgid "E852: The child process failed to start the GUI" -#~ msgstr "E852: Äî÷³ðí³é ïðîöåñ íå çì³ã çàïóñòèòè GUI" - -# msgstr "E228: " -#~ msgid "E229: Cannot start the GUI" -#~ msgstr "E229: Íå âäàëîñÿ çàïóñòèòè GUI" - -# msgstr "E229: " -#~ msgid "E230: Cannot read from \"%s\"" -#~ msgstr "E230: Íå âäàëîñÿ ïðî÷èòàòè ç «%s»" - -#~ msgid "E665: Cannot start GUI, no valid font found" -#~ msgstr "E665: Íå âäàëîñÿ çàïóñòèòè GUI, íå çíàéäåíî øðèôò" - -# msgstr "E230: " -#~ msgid "E231: 'guifontwide' invalid" -#~ msgstr "E231: Íåêîðåêòíèé 'guifontwide'" - -#~ msgid "E599: Value of 'imactivatekey' is invalid" -#~ msgstr "E599: Çíà÷åííÿ 'imactivatekey' íåêîðåêòíå" - -#~ msgid "E254: Cannot allocate color %s" -#~ msgstr "E254: Íå âäàëîñÿ îòðèìàòè êîë³ð %s" - -#~ msgid "No match at cursor, finding next" -#~ msgstr "Íåìຠíàä êóðñîðîì, ïîøóê òðèâàº" - -#~ msgid "Input _Methods" -#~ msgstr "Ìåòîäè ââåäåííÿ" - -#~ msgid "VIM - Search and Replace..." -#~ msgstr "VIM - Çíàéòè é çàì³íèòè..." - -#~ msgid "VIM - Search..." -#~ msgstr "VIM - Ïîøóê..." - -#~ msgid "Find what:" -#~ msgstr "Çíàéòè:" - -#~ msgid "Replace with:" -#~ msgstr "Çàì³íèòè íà:" - -#~ msgid "Match whole word only" -#~ msgstr "Ëèøå ïîâíå ñëîâî" - -#~ msgid "Match case" -#~ msgstr "Çâàæàòè íà ðåã³ñòð" - -#~ msgid "Direction" -#~ msgstr "Íàïðÿì" - -#~ msgid "Up" -#~ msgstr "Âãîðó" - -#~ msgid "Down" -#~ msgstr "Óíèç" - -#~ msgid "Find Next" -#~ msgstr "Íàñòóïíå" - -#~ msgid "Replace" -#~ msgstr "Çàì³íèòè" - -#~ msgid "Replace All" -#~ msgstr "Çàì³íèòè óñ³" - -#~ msgid "Vim: Received \"die\" request from session manager\n" -#~ msgstr "Vim: Îòðèìàâ çàïèò «die» â³ä ìåíåäæåðà ñåñ³é\n" - -#~ msgid "Close" -#~ msgstr "Çàêðèòè" - -#~ msgid "New tab" -#~ msgstr "Íîâà âêëàäêà" - -#~ msgid "Open Tab..." -#~ msgstr "³äêðèòè âêëàäêó..." - -#~ msgid "Vim: Main window unexpectedly destroyed\n" -#~ msgstr "Vim: Íåñïîä³âàíî çíèùèëîñÿ ãîëîâíå â³êíî\n" - -#~ msgid "&Filter" -#~ msgstr "&F:Ô³ëüòðóâàòè" - -#~ msgid "&Cancel" -#~ msgstr "&C:Ñêàñóâàòè" - -#~ msgid "Directories" -#~ msgstr "Êàòàëîãè" - -#~ msgid "Filter" -#~ msgstr "Ô³ëüòð" - -#~ msgid "&Help" -#~ msgstr "&H:Äîïîìîãà" - -#~ msgid "Files" -#~ msgstr "Ôàéëè" - -#~ msgid "&OK" -#~ msgstr "&O:Ãàðàçä" - -#~ msgid "Selection" -#~ msgstr "Âèä³ëåííÿ" - -#~ msgid "Find &Next" -#~ msgstr "&N:Çíàéòè äàë³" - -#~ msgid "&Replace" -#~ msgstr "&R:Çàì³íèòè" - -#~ msgid "Replace &All" -#~ msgstr "&A:Çàì³íèòè óñ³" - -#~ msgid "&Undo" -#~ msgstr "&U:Ñêàñóâàòè" - -#~ msgid "E671: Cannot find window title \"%s\"" -#~ msgstr "E671: Íå âäàëîñÿ çíàéòè â³êíî «%s»" - -#~ msgid "E243: Argument not supported: \"-%s\"; Use the OLE version." -#~ msgstr "E243: Àðãóìåíò íå ï³äòðèìóºòüñÿ: «-%s»; êîðèñòóéòåñü âåðñ³ºþ ç OLE." - -#~ msgid "E672: Unable to open window inside MDI application" -#~ msgstr "E672: Íå âäàëîñÿ â³äêðèòè â³êíî âñåðåäèí³ ïðîãðàìè MDI" - -#~ msgid "Close tab" -#~ msgstr "Çàêðèòè âêëàäêó" - -#~ msgid "Open tab..." -#~ msgstr "³äêðèòè âêëàäêó..." - -# msgstr "E245: " -#~ msgid "Find string (use '\\\\' to find a '\\')" -#~ msgstr "Çíàéòè ðÿäîê ('\\\\' ùîá çíàéòè '\\')" - -#~ msgid "Find & Replace (use '\\\\' to find a '\\')" -#~ msgstr "Çíàéòè ³ çàì³íèòè ('\\\\' ùîá çíàéòè '\\')" - -#~ msgid "Not Used" -#~ msgstr "Íåìàº" - -#~ msgid "Directory\t*.nothing\n" -#~ msgstr "Êàòàëîã\t*.í³÷îãî\n" - -#~ msgid "" -#~ "Vim E458: Cannot allocate colormap entry, some colors may be incorrect" -#~ msgstr "" -#~ "Vim E458: Íåìຠâ³ëüíèõ êîì³ðîê ó ïàë³òð³, äåÿê³ êîëüîðè ìîæóòü áóòè " -#~ "íåïðàâèëüí³" - -#~ msgid "E250: Fonts for the following charsets are missing in fontset %s:" -#~ msgstr "E250: Øðèôòè äëÿ öèõ ñèìâîë³â â³äñóòí³ ó íàáîð³ %s:" - -# msgstr "E250: " -#~ msgid "E252: Fontset name: %s" -#~ msgstr "E252: Íàçâà íàáîðó øðèôò³â: %s" - -# msgstr "E252: " -#~ msgid "Font '%s' is not fixed-width" -#~ msgstr "Øðèôò '%s' íå º ìîíîøèðèííèì" - -#~ msgid "E253: Fontset name: %s" -#~ msgstr "E253: Íàçâà íàáîðó øðèôò³â: %s" - -#~ msgid "Font0: %s" -#~ msgstr "Øðèôò0: %s" - -#~ msgid "Font1: %s" -#~ msgstr "Øðèôò1: %s" - -#~ msgid "Font%<PRId64> width is not twice that of font0" -#~ msgstr "Øèðèíà øðèôòó%<PRId64> íå á³ëüøà óäâ³÷³ çà øèðèíó øðèôòó0" - -#~ msgid "Font0 width: %<PRId64>" -#~ msgstr "Øèðèíà øðèôòó0: %<PRId64>" - -#~ msgid "Font1 width: %<PRId64>" -#~ msgstr "Øèðèíà øðèôòó1: %<PRId64>" - -#~ msgid "Invalid font specification" -#~ msgstr "Íåêîðåêòíà ñïåöèô³êàö³ÿ øðèôòó" - -#~ msgid "&Dismiss" -#~ msgstr "&D:Ïðèïèíèòè" - -#~ msgid "no specific match" -#~ msgstr "íåìຠêîíêðåòíîãî çá³ãó" - -# msgstr "E234: " -#~ msgid "Vim - Font Selector" -#~ msgstr "Vim - Âèá³ð øðèôòó" - -#~ msgid "Name:" -#~ msgstr "Íàçâà:" - -#~ msgid "Show size in Points" -#~ msgstr "Ïîêàçàòè ðîçì³ð ó ïóíêòàõ" - -#~ msgid "Encoding:" -#~ msgstr "Êîäóâàííÿ:" - -#~ msgid "Font:" -#~ msgstr "Øðèôò:" - -#~ msgid "Style:" -#~ msgstr "Ñòèëü:" - -#~ msgid "Size:" -#~ msgstr "Ðîçì³ð:" - -#~ msgid "E256: Hangul automata ERROR" -#~ msgstr "E256: Ïîìèëêà àâòîìàòó Hangul" - -#~ msgid "E563: stat error" -#~ msgstr "E563: ïîìèëêà stat" - -#~ msgid "E625: cannot open cscope database: %s" -#~ msgstr "E625: Íå âäàëîñÿ â³äêðèòè áàçó äàíèõ cscope: %s" - -#~ msgid "E626: cannot get cscope database information" -#~ msgstr "E626: Íå âäàëîñÿ îòðèìàòè ³íôîðìàö³þ ç áàçè äàíèõ cscope" - -#~ msgid "Lua library cannot be loaded." -#~ msgstr "Íå âäàëîñÿ çàâàíòàæèòè á³áë³îòåêó Lua" - -#~ msgid "cannot save undo information" -#~ msgstr "íå âäàëîñÿ çáåðåãòè ³íôîðìàö³þ äëÿ ñêàñóâàííÿ" - -#~ msgid "" -#~ "E815: Sorry, this command is disabled, the MzScheme libraries could not " -#~ "be loaded." -#~ msgstr "" -#~ "E815: Âèáà÷òå, öÿ êîìàíäà âèìêíåíà, á³áë³îòåêè MzScheme íå ìîæóòü áóòè " -#~ "çàâàíòàæåí³." - -#~ msgid "invalid expression" -#~ msgstr "íåêîðåêòíèé âèðàç" - -#~ msgid "expressions disabled at compile time" -#~ msgstr "îáðîáêó âèðàç³â âèìêíåíî ï³ä ÷àñ êîìï³ëÿö³¿" - -#~ msgid "hidden option" -#~ msgstr "ïðèõîâàíà îïö³ÿ" - -#~ msgid "unknown option" -#~ msgstr "íåâ³äîìà îïö³ÿ" - -#~ msgid "window index is out of range" -#~ msgstr "íåêîðåêòíèé íîìåð â³êíà" - -#~ msgid "couldn't open buffer" -#~ msgstr "íå âäàëîñÿ â³äêðèòè áóôåð" - -#~ msgid "cannot delete line" -#~ msgstr "íåìîæëèâî çíèùèòè ðÿäîê" - -#~ msgid "cannot replace line" -#~ msgstr "íåìîæëèâî çàì³íèòè ðÿäîê" - -#~ msgid "cannot insert line" -#~ msgstr "íå âäàëîñÿ âñòàâèòè ðÿäîê" - -#~ msgid "string cannot contain newlines" -#~ msgstr "á³ëüøå í³æ îäèí ðÿäîê" - -#~ msgid "error converting Scheme values to Vim" -#~ msgstr "íå âäàëîñÿ ïåðåòâîðèòè çíà÷åííÿ Scheme ó Vim" - -#~ msgid "Vim error: ~a" -#~ msgstr "Ïîìèëêà Vim: ~a" - -#~ msgid "Vim error" -#~ msgstr "Ïîìèëêà Vim" - -#~ msgid "buffer is invalid" -#~ msgstr "áóôåð íåïðèäàòíèé" - -#~ msgid "window is invalid" -#~ msgstr "â³êíî íåïðèäàòíå" - -#~ msgid "linenr out of range" -#~ msgstr "íîìåð ðÿäêà çà ìåæàìè ôàéëó" - -#~ msgid "not allowed in the Vim sandbox" -#~ msgstr "íå äîçâîëåíî ó ï³ñî÷íèö³ Vim" - -#~ msgid "E837: This Vim cannot execute :py3 after using :python" -#~ msgstr "E837: Python: Íå ìîæíà âèêîðèñòàòè :py ³ :py3 â îäíîìó ñåàíñ³" - -#~ msgid "" -#~ "E263: Sorry, this command is disabled, the Python library could not be " -#~ "loaded." -#~ msgstr "" -#~ "E263: Âèáà÷òå, öÿ êîìàíäà âèìêíåíà, á³áë³îòåêà Python íå ìîæå áóòè " -#~ "çàâàíòàæåíà." - -#~ msgid "E836: This Vim cannot execute :python after using :py3" -#~ msgstr "E836: Python: Íå ìîæíà âèêîðèñòàòè :py ³ :py3 â îäíîìó ñåàíñ³" - -#~ msgid "E659: Cannot invoke Python recursively" -#~ msgstr "E659: Íå ìîæíà ðåêóðñèâíî âèêëèêàòè Python" - -#~ msgid "E265: $_ must be an instance of String" -#~ msgstr "E265: $_ ìຠáóòè åêçåìïëÿðîì String" - -#~ msgid "" -#~ "E266: Sorry, this command is disabled, the Ruby library could not be " -#~ "loaded." -#~ msgstr "" -#~ "E266: Âèáà÷òå, öÿ êîìàíäà âèìêíåíà, á³áë³îòåêà Ruby íå ìîæå áóòè " -#~ "çàâàíòàæåíà." - -# msgstr "E414: " -#~ msgid "E267: unexpected return" -#~ msgstr "E267: íåñïîä³âàíèé return" - -#~ msgid "E268: unexpected next" -#~ msgstr "E268: íåñïîä³âàíèé next" - -#~ msgid "E269: unexpected break" -#~ msgstr "E269: íåñïîä³âàíèé break" - -#~ msgid "E270: unexpected redo" -#~ msgstr "E270: íåñïîä³âàíèé redo" - -#~ msgid "E271: retry outside of rescue clause" -#~ msgstr "E271: retry ïîçà rescue" - -#~ msgid "E272: unhandled exception" -#~ msgstr "E272: Íåîáðîáëåíèé âèíÿòîê" - -# msgstr "E233: " -#~ msgid "E273: unknown longjmp status %d" -#~ msgstr "E273: Íåâ³äîìèé ñòàòóñ longjmp: %d" - -#~ msgid "Toggle implementation/definition" -#~ msgstr "Ïåðåìêíóòè ðåàë³çàö³þ/âèçíà÷åííÿ" - -#~ msgid "Show base class of" -#~ msgstr "Çíàéòè áàçîâèé êëàñ" - -#~ msgid "Show overridden member function" -#~ msgstr "Ïîêàçàòè çàì³íåí³ ôóíêö³¿-÷ëåíè" - -#~ msgid "Retrieve from file" -#~ msgstr "Ïðî÷èòàòè ç ôàéëó" - -#~ msgid "Retrieve from project" -#~ msgstr "Îòðèìàòè ç ïðîåêòó" - -#~ msgid "Retrieve from all projects" -#~ msgstr "Îòðèìàòè ç óñ³õ ïðîåêò³â" - -#~ msgid "Retrieve" -#~ msgstr "Îòðèìàòè" - -#~ msgid "Show source of" -#~ msgstr "Äæåðåëî" - -#~ msgid "Find symbol" -#~ msgstr "Çíàéòè ñèìâîë" - -#~ msgid "Browse class" -#~ msgstr "Ïåðåãëÿíóòè êëàñ" - -#~ msgid "Show class in hierarchy" -#~ msgstr "Ïîêàçàòè êëàñ â ³ºðàðõ³¿" - -#~ msgid "Show class in restricted hierarchy" -#~ msgstr "Ïîêàçàòè êëàñ â îáìåæåí³é ³ºðàðõ³¿" - -#~ msgid "Xref refers to" -#~ msgstr "Xref âêàçóº íà" - -#~ msgid "Xref referred by" -#~ msgstr "Íà Xref âêàçàíî ç" - -#~ msgid "Xref has a" -#~ msgstr "Xref ìàº" - -#~ msgid "Xref used by" -#~ msgstr "Xref âèêîðèñòàíî" - -#~ msgid "Show docu of" -#~ msgstr "Ïîêàçàòè docu" - -#~ msgid "Generate docu for" -#~ msgstr "Ñòâîðèòè docu äëÿ" - -#~ msgid "" -#~ "Cannot connect to SNiFF+. Check environment (sniffemacs must be found in " -#~ "$PATH).\n" -#~ msgstr "" -#~ "Íå âäàëîñÿ ç'ºäíàòèñÿ ç³ SNiFF+. Ïåðåâ³ðòå îòî÷åííÿ (sniffemacs ìຠáóòè " -#~ "ó $PATH).\n" - -#~ msgid "E274: Sniff: Error during read. Disconnected" -#~ msgstr "E274: Sniff: Ïîìèëêà ï³ä ÷àñ ÷èòàííÿ. ³ä'ºäíàíî" - -#~ msgid "SNiFF+ is currently " -#~ msgstr "SNiFF+ çàðàç " - -#~ msgid "not " -#~ msgstr "íå " - -#~ msgid "connected" -#~ msgstr "ï³ä'ºäíàíèé" - -#~ msgid "E275: Unknown SNiFF+ request: %s" -#~ msgstr "E275: Íåâ³äîìèé çàïèò äî SNiFF+: %s" - -#~ msgid "E276: Error connecting to SNiFF+" -#~ msgstr "E276: Ïîìèëêà ç'ºäíàííÿ äî SNiFF+" - -#~ msgid "E278: SNiFF+ not connected" -#~ msgstr "E278: SNiFF+ íå ï³ä'ºäíàíî" - -#~ msgid "E279: Not a SNiFF+ buffer" -#~ msgstr "E279: Íå º áóôåðîì SNiFF+" - -#~ msgid "Sniff: Error during write. Disconnected" -#~ msgstr "Sniff: Ïîìèëêà çàïèñó. ³ä'ºäíàíî" - -#~ msgid "invalid buffer number" -#~ msgstr "íåïðàâèëüíà íàçâà áóôåðà" - -#~ msgid "not implemented yet" -#~ msgstr "ùå íå ðåàë³çîâàíî" - -#~ msgid "cannot set line(s)" -#~ msgstr "íå âäàëîñÿ âñòàíîâèòè ðÿäêè" - -#~ msgid "invalid mark name" -#~ msgstr "íåïðàâèëüíà íàçâà ïîçíà÷êè" - -# msgstr "E19: " -#~ msgid "mark not set" -#~ msgstr "ïîì³òêó íå âêàçàíî" - -#~ msgid "row %d column %d" -#~ msgstr "ðÿäîê %d êîëîíêà %d" - -#~ msgid "cannot insert/append line" -#~ msgstr "Íå âäàëîñÿ âñòàâèòè/äîäàòè ðÿäîê" - -#~ msgid "line number out of range" -#~ msgstr "íîìåð ðÿäêà çà ìåæàìè ôàéëó" - -#~ msgid "unknown flag: " -#~ msgstr "íåâ³äîìèé ïðàïîðåöü: " - -#~ msgid "unknown vimOption" -#~ msgstr "Íåâ³äîìà vimOption" - -#~ msgid "keyboard interrupt" -#~ msgstr "ïåðåðâàíî ç êëàâ³àòóðè" - -#~ msgid "vim error" -#~ msgstr "ïîìèëêà Vim" - -#~ msgid "cannot create buffer/window command: object is being deleted" -#~ msgstr "íå âäàëîñÿ ñòâîðèòè êîìàíäó â³êíà/áóôåðà: îá'ºêò çíèùóºòüñÿ" - -#~ msgid "" -#~ "cannot register callback command: buffer/window is already being deleted" -#~ msgstr "Íå âäàëîñÿ çàðåºñòðóâàòè ïîä³þ: áóôåð/â³êíî óæå çíèùóºòüñÿ" - -#~ msgid "" -#~ "E280: TCL FATAL ERROR: reflist corrupt!? Please report this to vim-" -#~ "dev@vim.org" -#~ msgstr "" -#~ "E280: ÔÀÒÀËÜÍÀ ÏÎÌÈËÊÀ TCL: ìîæëèâî ïîøêîäæåíî ñïèñîê ïîñèëàíü!? Áóäü " -#~ "ëàñêà, ïîâ³äîìòå ó vim-dev@vim.org" - -#~ msgid "cannot register callback command: buffer/window reference not found" -#~ msgstr "" -#~ "Íå âäàëîñÿ çàðåºñòðóâàòè êîìàíäó ïî䳿: ïîñèëàííÿ íà áóôåð/â³êíî íå " -#~ "çíàéäåíî" - -#~ msgid "" -#~ "E571: Sorry, this command is disabled: the Tcl library could not be " -#~ "loaded." -#~ msgstr "" -#~ "E571: Âèáà÷òå, öÿ êîìàíäà âèìêíåíà, á³áë³îòåêà Tcl íå ìîæå áóòè " -#~ "çàâàíòàæåíà." - -#~ msgid "E572: exit code %d" -#~ msgstr "E572: Êîä âèõîäó %d" - -#~ msgid "cannot get line" -#~ msgstr "íå âäàëîñÿ ä³ñòàòè ðÿäîê" - -#~ msgid "Unable to register a command server name" -#~ msgstr "Íå âäàëîñÿ çàðåºñòðóâàòè íàçâó ñåðâåðà êîìàíä" - -#~ msgid "E248: Failed to send command to the destination program" -#~ msgstr "E248: Íå âäàëîñÿ â³ä³ñëàòè êîìàíäó äî ïðîãðàìè-ö³ë³" - -#~ msgid "E573: Invalid server id used: %s" -#~ msgstr "E573: Âèêîðèñòàíî íåêîðåêòíèé ³äåíòèô³êàòîð ñåðâåðà: %s" - -#~ msgid "E251: VIM instance registry property is badly formed. Deleted!" -#~ msgstr "" -#~ "E251: Ðåêâ³çèò ðåºñòðó çðàçêó VIM ñôîðìîâàíèé íåïðàâèëüíî. Çíèùåíî!" - -#~ msgid "netbeans is not supported with this GUI\n" -#~ msgstr "netbeans íå ï³äòðèìóºòüñÿ ç öèì GUI\n" - -#~ msgid "This Vim was not compiled with the diff feature." -#~ msgstr "Öÿ âåðñ³ÿ Vim íå áóëà ñêîìï³ëüîâàíà ç ï³äòðèìêîþ ïîð³âíÿííÿ." - -#~ msgid "'-nb' cannot be used: not enabled at compile time\n" -#~ msgstr "Íå ìîæíà âèêîðèñòàòè '-nb': íå äîçâîëåíî ï³ä ÷àñ êîìï³ëÿö³¿\n" - -#~ msgid "Vim: Error: Failure to start gvim from NetBeans\n" -#~ msgstr "Vim: Ïîìèëêà: Íå âäàëîñÿ çàïóñòèòè gvim äëÿ NetBeans\n" - -#~ msgid "" -#~ "\n" -#~ "Where case is ignored prepend / to make flag upper case" -#~ msgstr "" -#~ "\n" -#~ "ßêùî ðåã³ñòð ³ãíîðóºòüñÿ, äîäàéòå / ñïåðåäó ùîá ïðàïîðåöü áóâ ó âåðõíüîìó " -#~ "ðåã³ñòð³." - -#~ msgid "-register\t\tRegister this gvim for OLE" -#~ msgstr "-register\t\tÇàðåºñòðóâàòè öåé gvim äëÿ OLE" - -#~ msgid "-unregister\t\tUnregister gvim for OLE" -#~ msgstr "-unregister\t\tÑêàñóâàòè ðåºñòðàö³þ öüîãî gvim äëÿ OLE" - -#~ msgid "-g\t\t\tRun using GUI (like \"gvim\")" -#~ msgstr "-g\t\t\tÇàïóñòèòè GUI (í³áè «gvim»)" - -#~ msgid "-f or --nofork\tForeground: Don't fork when starting GUI" -#~ msgstr "-f ÷è --nofork\tÏåðåäí³é ïëàí: òðèìàòè òåðì³íàë ï³ñëÿ çàïóñêó GUI" - -#~ msgid "-f\t\t\tDon't use newcli to open window" -#~ msgstr "-f\t\t\tÍå âèêîðèñòîâóâàòè newcli äëÿ â³äêðèòòÿ â³êíà" - -#~ msgid "-dev <device>\t\tUse <device> for I/O" -#~ msgstr "-dev <ïðèñòð³é>\t\t\tÂèêîðèñòîâóâàòè <ïðèñòð³é> äëÿ ââîäó/âèâîäó" - -#~ msgid "-U <gvimrc>\t\tUse <gvimrc> instead of any .gvimrc" -#~ msgstr "-u <gvimrc>\t\tÂèêîðèñòàòè ïîäàíèé ôàéë çàì³ñòü .gvimrc" - -#~ msgid "-x\t\t\tEdit encrypted files" -#~ msgstr "-x\t\t\tÐåäàãóâàòè çàøèôðîâàí³ ôàéëè" - -#~ msgid "-display <display>\tConnect vim to this particular X-server" -#~ msgstr "-display <äèñïëåé>\tϳä'ºäíàòè vim äî çàäàíîãî äèñïëåþ ñåðâåðà X" - -#~ msgid "-X\t\t\tDo not connect to X server" -#~ msgstr "-X\t\t\tÍå ç'ºäíóâàòèñÿ ç X ñåðâåðîì" - -#~ msgid "--remote <files>\tEdit <files> in a Vim server if possible" -#~ msgstr "" -#~ "--remote <ôàéëè>\tÐåäàãóâàòè <ôàéëè> íà ñåðâåð³ Vim, ÿêùî öå ìîæëèâî" - -#~ msgid "--remote-silent <files> Same, don't complain if there is no server" -#~ msgstr "" -#~ "--remote-silent <ôàéëè> Òå ñàìå, ò³ëüêè íå ñêàðæèòèñÿ íà â³äñóòí³ñòü " -#~ "ñåðâåðà" - -#~ msgid "" -#~ "--remote-wait <files> As --remote but wait for files to have been edited" -#~ msgstr "" -#~ "--remote-wait <ôàéëè> ..., àëå çà÷åêàòè ïîêè óñ³ ôàéëè áóäóòü " -#~ "â³äðåäàãîâàí³" - -#~ msgid "" -#~ "--remote-wait-silent <files> Same, don't complain if there is no server" -#~ msgstr "" -#~ "--remote-wait-silent <ôàéëè> Òå ñàìå, ò³ëüêè íå ñêàðæèòèñÿ, ÿêùî ñåðâåðà " -#~ "íåìàº" - -#~ msgid "" -#~ "--remote-tab[-wait][-silent] <files> As --remote but use tab page per " -#~ "file" -#~ msgstr "" -#~ "--remote-tab[-wait][-silent] <ôàéëè> Òàê ñàìî, ÿê --remote, àëå ïî " -#~ "âêëàäö³ íà ôàéë" - -#~ msgid "--remote-send <keys>\tSend <keys> to a Vim server and exit" -#~ msgstr "" -#~ "--remote-send <ñèìâîëè> ³ä³ñëàòè <ñèìâîëè> ñåðâåðó ³ çàâåðøèòè ðîáîòó" - -#~ msgid "" -#~ "--remote-expr <expr>\tEvaluate <expr> in a Vim server and print result" -#~ msgstr "" -#~ "--remote-expr <âèðàç> Âèêîíàòè <âèðàç> ó ñåðâåð³ Vim ³ íàäðóêóâàòè " -#~ "ðåçóëüòàò" - -#~ msgid "--serverlist\t\tList available Vim server names and exit" -#~ msgstr "" -#~ "--serverlist\t\tÏîêàçàòè ñïèñîê íàÿâíèõ ñåðâåð³â Vim ³ çàâåðøèòè ðîáîòó" - -#~ msgid "--servername <name>\tSend to/become the Vim server <name>" -#~ msgstr "--servername <íàçâà>\tÍàä³ñëàòè äî/ñòàòè Vim ñåðâåðîì ç <íàçâîþ>" - -#~ msgid "" -#~ "\n" -#~ "Arguments recognised by gvim (Motif version):\n" -#~ msgstr "" -#~ "\n" -#~ "Àðãóìåíòè äëÿ gvim (âåðñ³ÿ Motif)\n" - -#~ msgid "" -#~ "\n" -#~ "Arguments recognised by gvim (neXtaw version):\n" -#~ msgstr "" -#~ "\n" -#~ "Àðãóìåíòè äëÿ gvim (âåðñ³ÿ neXtaw):\n" - -#~ msgid "" -#~ "\n" -#~ "Arguments recognised by gvim (Athena version):\n" -#~ msgstr "" -#~ "\n" -#~ "Àðãóìåíòè äëÿ gvim (âåðñ³ÿ Athena)\n" - -#~ msgid "-display <display>\tRun vim on <display>" -#~ msgstr "-display <äèñïëåé>\tÂèêîíàòè vim íà çàäàíîìó <äèñïëå¿>" - -#~ msgid "-iconic\t\tStart vim iconified" -#~ msgstr "-iconic\t\tÇàïóñòèòè Vim ³ çãîðíóòè éîãî â³êíî" - -#~ msgid "-background <color>\tUse <color> for the background (also: -bg)" -#~ msgstr "-background <êîë³ð>\tÂèêîðèñòàòè <êîë³ð> äëÿ ôîíó (òàêîæ: -bg)" - -#~ msgid "-foreground <color>\tUse <color> for normal text (also: -fg)" -#~ msgstr "" -#~ "-foreground <êîë³ð>\tÂèêîðèñòàòè <êîë³ð> äëÿ çâè÷àéíîãî òåêñòó (òàêîæ: -" -#~ "fg)" - -#~ msgid "-font <font>\t\tUse <font> for normal text (also: -fn)" -#~ msgstr "" -#~ "-font <øðèôò>\tÂèêîðèñòàòè <øðèôò> äëÿ çâè÷àéíîãî òåêñòó (òàêîæ: -fn)" - -#~ msgid "-boldfont <font>\tUse <font> for bold text" -#~ msgstr "-boldfont <øðèôò>\tÂèêîðèñòàòè <øðèôò> äëÿ æèðíîãî òåêñòó" - -#~ msgid "-italicfont <font>\tUse <font> for italic text" -#~ msgstr "-italicfont <øðèôò>\tÂèêîðèñòàòè <øðèôò> äëÿ ïîõèëîãî òåêñòó" - -#~ msgid "-geometry <geom>\tUse <geom> for initial geometry (also: -geom)" -#~ msgstr "-geometry <ãåîì>\tÇàäàòè ðîçì³ðè é ïîëîæåííÿ (òàêîæ: -geom)" - -#~ msgid "-borderwidth <width>\tUse a border width of <width> (also: -bw)" -#~ msgstr "-borderwidth <òîâù>\tÂñòàíîâèòè òîâùèíó ìåæ <òîâù> (òàêîæ: -bw)" - -#~ msgid "" -#~ "-scrollbarwidth <width> Use a scrollbar width of <width> (also: -sw)" -#~ msgstr "" -#~ "-scrollbarwidth <òîâù> Âñòàíîâèòè òîâùèíó ë³í³éêè çñóâó (òàêîæ: -sw)" - -#~ msgid "-menuheight <height>\tUse a menu bar height of <height> (also: -mh)" -#~ msgstr "-menuheight <âèñîòà>\tÂñòàíîâèòè âèñîòó ìåíþ <âèñîòà> (òàêîæ: -mh)" - -#~ msgid "-reverse\t\tUse reverse video (also: -rv)" -#~ msgstr "-reverse\t\tÎáåðíóòè êîëüîðè (òàêîæ: -rv)" - -#~ msgid "+reverse\t\tDon't use reverse video (also: +rv)" -#~ msgstr "+reverse\t\tÍå îáåðòàòè êîëüîðè (òàêîæ: +rv)" - -#~ msgid "-xrm <resource>\tSet the specified resource" -#~ msgstr "-xrm <ðåñóðñ>\t\tÂñòàíîâèòè çàçíà÷åíèé ðåñóðñ" - -#~ msgid "" -#~ "\n" -#~ "Arguments recognised by gvim (GTK+ version):\n" -#~ msgstr "" -#~ "\n" -#~ "Àðãóìåíòè gvim (âåðñ³ÿ GTK+)\n" - -#~ msgid "-display <display>\tRun vim on <display> (also: --display)" -#~ msgstr "-display <äèñïëåé>\tÂèêîíàòè vim íà <äèñïëå¿> (òàêîæ: --display)" - -#~ msgid "--role <role>\tSet a unique role to identify the main window" -#~ msgstr "" -#~ "--role <ðîëü>\tÂñòàíîâèòè óí³êàëüíó ðîëü äëÿ ³äåíòèô³êàö³¿ ãîëîâíîãî â³êíà" - -#~ msgid "--socketid <xid>\tOpen Vim inside another GTK widget" -#~ msgstr "--socketid <xid>\t³äêðèòè Vim â ³íøîìó åëåìåíò³ ³íòåðôåéñó GTK" - -#~ msgid "--echo-wid\t\tMake gvim echo the Window ID on stdout" -#~ msgstr "--echo-wid\t\tÕàé gvim íàäðóêóº ³äåíòèô³êàòîð â³êíà íà stdout" - -#~ msgid "-P <parent title>\tOpen Vim inside parent application" -#~ msgstr "-P <çàãîëîâîê áàòüêà>\t³äêðèòè Vim âñåðåäèí³ áàòüê³âñüêîãî â³êíà" - -#~ msgid "--windowid <HWND>\tOpen Vim inside another win32 widget" -#~ msgstr "--windowid <HWND>\t³äêðèòè Vim âñåðåäèí³ ³íøîãî åëåìåíòó win32" - -#~ msgid "No display" -#~ msgstr "Íåìຠäèñïëåþ" - -#~ msgid ": Send failed.\n" -#~ msgstr ": Íå âäàëîñÿ â³ä³ñëàòè.\n" - -#~ msgid ": Send failed. Trying to execute locally\n" -#~ msgstr ": Íå âäàëîñÿ â³ä³ñëàòè. Ñïðîáà âèêîíàòè íà ì³ñö³\n" - -#~ msgid "%d of %d edited" -#~ msgstr "â³äðåäàãîâàíî %d ç %d" - -#~ msgid "No display: Send expression failed.\n" -#~ msgstr "Íåìຠäèñïëåþ: ³ä³ñëàòè âèðàç íå âäàëîñÿ.\n" - -#~ msgid ": Send expression failed.\n" -#~ msgstr ": ³ä³ñëàòè âèðàç íå âäàëîñÿ.\n" - -#~ msgid "E543: Not a valid codepage" -#~ msgstr "E543: Íåêîðåêòíà êîäîâà ñòîð³íêà" - -#~ msgid "E284: Cannot set IC values" -#~ msgstr "E284: Íå âäàëîñÿ âñòàíîâèòè çíà÷åííÿ êîíòåêñòó ââîäó" - -#~ msgid "E285: Failed to create input context" -#~ msgstr "E285: Íå âäàëîñÿ ñòâîðèòè êîíòåêñò ââîäó" - -#~ msgid "E286: Failed to open input method" -#~ msgstr "E286: Íå âäàëîñÿ ñòâîðèòè ìåòîä ââîäó" - -# msgstr "E286: " -#~ msgid "E287: Warning: Could not set destroy callback to IM" -#~ msgstr "" -#~ "E287: Çàñòåðåæåííÿ: Íå âäàëîñÿ âñòàíîâèòè â ìåòîä³ ââîäó ïîä³þ çíèùåííÿ" - -# msgstr "E287: " -#~ msgid "E288: input method doesn't support any style" -#~ msgstr "E288: Ìåòîä ââîäó íå ï³äòðèìóº ñòèë³" - -# msgstr "E288: " -#~ msgid "E289: input method doesn't support my preedit type" -#~ msgstr "E289: Ìåòîä ââîäó íå ï³äòðèìóº â³äðåäàãîâàí³ òèïè" - -#~ msgid "E843: Error while updating swap file crypt" -#~ msgstr "E843: Ïîìèëêà ïîíîâëåííÿ øèôðóâàííÿ ôàéëó îáì³íó" - -#~ msgid "" -#~ "E833: %s is encrypted and this version of Vim does not support encryption" -#~ msgstr "E833: %s çàøèôðîâàíî, à öÿ âåðñ³ÿ Vim íå ï³äòðèìóº øèôðóâàííÿ" - -#~ msgid "Swap file is encrypted: \"%s\"" -#~ msgstr "Ôàéë îáì³íó çàøèôðîâàíèé: «%s»" - -#~ msgid "" -#~ "\n" -#~ "If you entered a new crypt key but did not write the text file," -#~ msgstr "" -#~ "\n" -#~ "ßêùî âè çàäàëè íîâèé êëþ÷ øèôðó, àëå íå çàïèñàëè òåêñòîâèé ôàéë," - -#~ msgid "" -#~ "\n" -#~ "enter the new crypt key." -#~ msgstr "" -#~ "\n" -#~ "ââåä³òü íîâèé êëþ÷ øèôðó." - -#~ msgid "" -#~ "\n" -#~ "If you wrote the text file after changing the crypt key press enter" -#~ msgstr "" -#~ "\n" -#~ "ßêùî âè çàïèñàëè òåêñòîâèé ôàéë ï³ñëÿ çì³íè êëþ÷à øèôðó, íàòèñí³òü enter" - -#~ msgid "" -#~ "\n" -#~ "to use the same key for text file and swap file" -#~ msgstr "" -#~ "\n" -#~ "ùîá âèêîðèñòàòè îäíàêîâèé êëþ÷ äëÿ òåêñòîâîãî ôàéëó òà ôàéëó îáì³íó" - -#~ msgid "Using crypt key from swap file for the text file.\n" -#~ msgstr "Äëÿ òåêñòîâîãî ôàéëó âèêîðèñòîâóºòüñÿ êëþ÷ øèôðó ç ôàéëó îáì³íó.\n" - -#~ msgid "" -#~ "\n" -#~ " [not usable with this version of Vim]" -#~ msgstr "" -#~ "\n" -#~ " [íå ïðèäàòíèé äëÿ ö³º¿ âåðñ³¿ Vim]" - -#~ msgid "Tear off this menu" -#~ msgstr "³ä³ðâàòè öå ìåíþ" - -#~ msgid "Select Directory dialog" -#~ msgstr "Âèáðàòè êàòàëîã" - -#~ msgid "Save File dialog" -#~ msgstr "Çàïàì'ÿòàòè ôàéë" - -#~ msgid "Open File dialog" -#~ msgstr "³äêðèòè ôàéë" - -#~ msgid "E338: Sorry, no file browser in console mode" -#~ msgstr "E338: Âèáà÷òå, àëå â êîíñîë³ íåìຠä³àëîãó âèáîðó ôàéëó" - -#~ msgid "ERROR: " -#~ msgstr "ÏÎÌÈËÊÀ: " - -#~ msgid "" -#~ "\n" -#~ "[bytes] total alloc-freed %<PRIu64>-%<PRIu64>, in use %<PRIu64>, peak use " -#~ "%<PRIu64>\n" -#~ msgstr "" -#~ "\n" -#~ "[áàéò] âñüîãî ðîçì/çíèù. %<PRIu64>/%<PRIu64>, âèêîð. %<PRIu64>, ìàêñ. " -#~ "%<PRIu64>\n" - -#~ msgid "" -#~ "[calls] total re/malloc()'s %<PRIu64>, total free()'s %<PRIu64>\n" -#~ "\n" -#~ msgstr "" -#~ "[âèêëèêè] óñüîãî re/malloc() - %<PRIu64>, óñüîãî free() - %<PRIu64>\n" -#~ "\n" - -#~ msgid "E340: Line is becoming too long" -#~ msgstr "E340: Ðÿäîê ñòຠçàíàäòî äîâãèì" - -# msgstr "E340: " -#~ msgid "E341: Internal error: lalloc(%<PRId64>, )" -#~ msgstr "E341: Âíóòð³øíÿ ïîìèëêà: lalloc(%<PRId64>, )" - -#~ msgid "E547: Illegal mouseshape" -#~ msgstr "E547: Íåïðàâèëüíèé âèãëÿä ìèø³" - -#~ msgid "Enter encryption key: " -#~ msgstr "Âêàæ³òü êëþ÷ øèôðó: " - -#~ msgid "Enter same key again: " -#~ msgstr "Ïîâòîð³òü êëþ÷: " - -#~ msgid "Keys don't match!" -#~ msgstr "Êëþ÷³ íå îäíàêîâ³!" - -#~ msgid "Cannot connect to Netbeans #2" -#~ msgstr "Íå âäàëîñÿ ç'ºäíàòèñÿ ³ç Netbeans #2" - -#~ msgid "Cannot connect to Netbeans" -#~ msgstr "Íå âäàëîñÿ ç'ºäíàòèñÿ ³ç Netbeans" - -#~ msgid "E668: Wrong access mode for NetBeans connection info file: \"%s\"" -#~ msgstr "" -#~ "E668: Íåïðàâèëüíèé ðåæèì äîñòóïó äî ôàéëó ³íôîðìàö³¿ ïðî ç'ºäíàííÿ ç " -#~ "NetBenans: «%s»" - -#~ msgid "read from Netbeans socket" -#~ msgstr "÷èòàºòüñÿ ç ñîêåòà Netbeans" - -#~ msgid "E658: NetBeans connection lost for buffer %<PRId64>" -#~ msgstr "E658: Âòðà÷åíî çâ'ÿçîê ³ç NetBeans äëÿ áóôåðà %<PRId64>" - -#~ msgid "E838: netbeans is not supported with this GUI" -#~ msgstr "E838: netbeans íå ï³äòðèìóºòüñÿ ç öèì GUI" - -#~ msgid "E511: netbeans already connected" -#~ msgstr "E511: netbeans âæå ï³ä'ºäíàíî" - -#~ msgid "E505: %s is read-only (add ! to override)" -#~ msgstr "E505: %s ò³ëüêè äëÿ ÷èòàííÿ (! ùîá íå çâàæàòè)" - -#~ msgid "E775: Eval feature not available" -#~ msgstr "E775: Ìîæëèâ³ñòü eval íåäîñòóïíà" - -#~ msgid "freeing %<PRId64> lines" -#~ msgstr "Çâ³ëüíåíî ðÿäê³â: %<PRId64>" - -#~ msgid "E530: Cannot change term in GUI" -#~ msgstr "E530: Íå âäàëîñÿ çì³íèòè term â GUI" - -#~ msgid "E531: Use \":gui\" to start the GUI" -#~ msgstr "E531: Çàñòîñóéòå «:gui» äëÿ çàïóñêó GUI" - -#~ msgid "E617: Cannot be changed in the GTK+ 2 GUI" -#~ msgstr "E617: Íå ìîæíà çì³íèòè â GUI GTK+ 2" - -#~ msgid "E596: Invalid font(s)" -#~ msgstr "E596: Íåêîðåêòíèé(³) øðèôò(è)" - -#~ msgid "E597: can't select fontset" -#~ msgstr "E597: Íå âäàëîñÿ âèáðàòè íàá³ð øðèôò³â" - -#~ msgid "E598: Invalid fontset" -#~ msgstr "E598: Íåïðàâèëüíèé íàá³ð øðèôò³â" - -#~ msgid "E533: can't select wide font" -#~ msgstr "E533: Íå âäàëîñÿ âèêîðèñòàòè ðîçøèðåíèé øðèôò" - -#~ msgid "E534: Invalid wide font" -#~ msgstr "E534: Íåêîðåêòíèé ðîçøèðåíèé øðèôò" - -#~ msgid "E538: No mouse support" -#~ msgstr "E538: Ìèøà íå ï³äòðèìóºòüñÿ" - -# msgstr "E358: " -#~ msgid "cannot open " -#~ msgstr "íå âäàëîñÿ â³äêðèòè " - -#~ msgid "VIM: Can't open window!\n" -#~ msgstr "VIM: Íå âäàëîñÿ â³äêðèòè â³êíî!\n" - -#~ msgid "Need Amigados version 2.04 or later\n" -#~ msgstr "Ïîòð³áíà Amigados 2.04 àáî ï³çí³øà\n" - -#~ msgid "Need %s version %<PRId64>\n" -#~ msgstr "Ïîòð³áíî %s âåðñ³¿ %<PRId64>\n" - -#~ msgid "Cannot open NIL:\n" -#~ msgstr "Íå âäàëîñÿ â³äêðèòè NIL:\n" - -#~ msgid "Cannot create " -#~ msgstr "Íå âäàëîñÿ ñòâîðèòè " - -#~ msgid "Vim exiting with %d\n" -#~ msgstr "Vim çàâåðøóº ðîáîòó ç %d\n" - -#~ msgid "cannot change console mode ?!\n" -#~ msgstr "íå ìîæó çì³íèòè ðåæèì êîíñîë³ ?!\n" - -# msgstr "E359: " -#~ msgid "mch_get_shellsize: not a console??\n" -#~ msgstr "mch_get_shellsize: íå êîíñîëü??\n" - -#~ msgid "E360: Cannot execute shell with -f option" -#~ msgstr "E360: Íå âäàëîñÿ çàïóñòèòè îáîëîíêó ç îïö³ºþ -f" - -# msgstr "E360: " -#~ msgid "Cannot execute " -#~ msgstr "Íå âäàëîñÿ âèêîíàòè " - -#~ msgid "shell " -#~ msgstr "îáîëîíêó " - -#~ msgid " returned\n" -#~ msgstr " ïîâåðíóòî\n" - -#~ msgid "ANCHOR_BUF_SIZE too small." -#~ msgstr "ANCHOR_BUF_SIZE çàìàëèé" - -#~ msgid "I/O ERROR" -#~ msgstr "Ïîìèëêà ââîäó/âèâîäó" - -#~ msgid "Message" -#~ msgstr "Ïîâ³äîìëåííÿ" - -#~ msgid "'columns' is not 80, cannot execute external commands" -#~ msgstr "'columns' íå 80, íå ìîæíà âèêîíóâàòè çîâí³øí³ êîìàíäè" - -# msgstr "E364: " -#~ msgid "E237: Printer selection failed" -#~ msgstr "E237: Íå âäàëîñÿ âèáðàòè ïðèíòåð" - -#~ msgid "to %s on %s" -#~ msgstr "íà %s ç %s" - -#~ msgid "E613: Unknown printer font: %s" -#~ msgstr "E613: Íåâ³äîìèé øðèôò ïðèíòåðà: %s" - -#~ msgid "E238: Print error: %s" -#~ msgstr "E238: Ïîìèëêà äðóêó: %s" - -#~ msgid "Printing '%s'" -#~ msgstr "Äðóêóºòüñÿ '%s'" - -#~ msgid "E244: Illegal charset name \"%s\" in font name \"%s\"" -#~ msgstr "E244: Íåêîðåêòíà íàçâà íàáîðó ñèìâîë³â «%s» ó íàçâ³ øðèôòó «%s»" - -#~ msgid "E245: Illegal char '%c' in font name \"%s\"" -#~ msgstr "E245: Ïîìèëêîâèé ñèìâîë %c â íàçâ³ øðèôòó «%s»" - -#~ msgid "Opening the X display took %<PRId64> msec" -#~ msgstr "Íà â³äêðèòòÿ äèñïëåþ X ï³øëî %<PRId64> ì³ë³ñåêóíä" - -#~ msgid "" -#~ "\n" -#~ "Vim: Got X error\n" -#~ msgstr "" -#~ "\n" -#~ "Vim: Ïîìèëêà X\n" - -#~ msgid "Testing the X display failed" -#~ msgstr "Äèñïëåé Õ íå ïðîéøîâ ïåðåâ³ðêó" - -#~ msgid "Opening the X display timed out" -#~ msgstr "Ñïëèâ ÷àñ î÷³êóâàííÿ â³äêðèòòÿ äèñïëåþ Õ" - -#~ msgid "" -#~ "\n" -#~ "Cannot execute shell sh\n" -#~ msgstr "" -#~ "\n" -#~ "Íå âäàëîñÿ çàïóñòèòè îáîëîíêó `sh'\n" - -#~ msgid "" -#~ "\n" -#~ "Cannot create pipes\n" -#~ msgstr "" -#~ "\n" -#~ "Íå ìîæíà ñòâîðèòè êàíàëè\n" - -#~ msgid "" -#~ "\n" -#~ "Cannot fork\n" -#~ msgstr "" -#~ "\n" -#~ "Íå âäàëîñÿ ðîçäâî¿òèñÿ\n" - -#~ msgid "" -#~ "\n" -#~ "Command terminated\n" -#~ msgstr "" -#~ "\n" -#~ "Êîìàíäà çàê³í÷èëà âèêîíàííÿ\n" - -#~ msgid "XSMP lost ICE connection" -#~ msgstr "XSMP âòðàòèâ ç'ºäíàííÿ ICE" - -#~ msgid "Opening the X display failed" -#~ msgstr "Íå âäàëîñÿ â³äêðèòè äèñïëåé X" - -#~ msgid "XSMP handling save-yourself request" -#~ msgstr "XSMP îáðîáëÿºòüñÿ çàïèò 'çáåðåæè ñåáå'" - -#~ msgid "XSMP opening connection" -#~ msgstr "XSMP â³äêðèâàºòüñÿ ç'ºäíàííÿ" - -#~ msgid "XSMP ICE connection watch failed" -#~ msgstr "XSMP ñïîñòåðåæåííÿ çà ç'ºäíàííÿì ç ICE íå âäàëîñÿ" - -#~ msgid "XSMP SmcOpenConnection failed: %s" -#~ msgstr "XSMP íå âäàëîñÿ SmcOpenConnection: %s" - -#~ msgid "At line" -#~ msgstr "Ðÿäîê:" - -#~ msgid "Could not load vim32.dll!" -#~ msgstr "Íå âäàëîñÿ çàâàíòàæèòè vim32.dll" - -#~ msgid "VIM Error" -#~ msgstr "Ïîìèëêà VIM" - -#~ msgid "Could not fix up function pointers to the DLL!" -#~ msgstr "Íå âäàëîñÿ âèïðàâèòè âêàç³âíèêè íà ôóíêö³¿ DLL!" - -#~ msgid "shell returned %d" -#~ msgstr "îáîëîíêà ïîâåðíóëà %d" - -#~ msgid "Vim: Caught %s event\n" -#~ msgstr "Vim: Âèÿâëåíî ïîä³þ %s\n" - -#~ msgid "close" -#~ msgstr "close" - -#~ msgid "logoff" -#~ msgstr "logoff" - -#~ msgid "shutdown" -#~ msgstr "shutdown" - -#~ msgid "E371: Command not found" -#~ msgstr "E371: Êîìàíäó íå çíàéäåíî" - -#~ msgid "" -#~ "VIMRUN.EXE not found in your $PATH.\n" -#~ "External commands will not pause after completion.\n" -#~ "See :help win32-vimrun for more information." -#~ msgstr "" -#~ "Ôàéë VIMRUN.EXE íå çíàéäåíî ó øëÿõó ïîøóêó.\n" -#~ "Çîâí³øí³ êîìàíäè íå áóäóòü ïðèçóïèíåí³ ï³ñëÿ âèêîíàííÿ.\n" -#~ "Ãëÿíüòå :help win32-vimrun ùîá îòðèìàòè ïîäðîáèö³." - -#~ msgid "Vim Warning" -#~ msgstr "Çàñòåðåæåííÿ Vim" - -# msgstr "E231: " -#~ msgid "Error file" -#~ msgstr "Ôàéë ïîìèëîê" - -#~ msgid "E868: Error building NFA with equivalence class!" -#~ msgstr "E868: Íå âäàëîñÿ ïîáóäóâàòè NFA ç êëàñîì åêâ³âàëåíòíîñò³!" - -#~ msgid "E878: (NFA) Could not allocate memory for branch traversal!" -#~ msgstr "E878: (NFA) Íå âäàëîñÿ îòðèìàòè ïàì’ÿòü äëÿ îáõîäó ã³ëîê!" - -#~ msgid "Warning: Cannot find word list \"%s_%s.spl\" or \"%s_ascii.spl\"" -#~ msgstr "" -#~ "Çàñòåðåæåííÿ: Íå âäàëîñÿ çíàéòè ñïèñîê ñë³â «%s_%s.spl» ÷è «%s_ascii.spl»" - -#~ msgid "Conversion in %s not supported" -#~ msgstr "Ïåðåòâîðåííÿ ó %s íå ï³äòðèìóºòüñÿ" - -#~ msgid "E845: Insufficient memory, word list will be incomplete" -#~ msgstr "E845: Íåäîñòàòíüî ïàì’ÿò³, ñïèñîê ñë³â áóäå íåïîâíèì" - -#~ msgid "E430: Tag file path truncated for %s\n" -#~ msgstr "E430: Øëÿõ ôàéëó òå´³â ñêîðî÷åíî äî %s\n" - -#~ msgid "new shell started\n" -#~ msgstr "çàïóùåíî íîâó îáîëîíêó\n" - -# msgstr "E242: " -#~ msgid "Used CUT_BUFFER0 instead of empty selection" -#~ msgstr "Âèêîðèñòàíî CUT_BUFFER0 çàì³ñòü ïîðîæíüîãî âèä³ëåííÿ" - -#~ msgid "No undo possible; continue anyway" -#~ msgstr "Ñêàñóâàííÿ áóäå íåìîæëèâå, âñå îäíî ïðîäîâæèòè" - -#~ msgid "E832: Non-encrypted file has encrypted undo file: %s" -#~ msgstr "E832: Íåçàøèôðîâàíèé ôàéë ìຠçàøèôðîâàíèé ôàéë ³ñòîð³¿: %s" - -#~ msgid "E826: Undo file decryption failed: %s" -#~ msgstr "E826: Íå âäàëîñÿ ðîçøèôðóâàòè ôàéë ³ñòîð³¿: %s" - -#~ msgid "E827: Undo file is encrypted: %s" -#~ msgstr "E827: Ôàéë ³ñòî𳿠çàøèôðîâàíèé: %s" - -# msgstr "E440: " -# --------------------------------------- -#~ msgid "" -#~ "\n" -#~ "MS-Windows 16/32-bit GUI version" -#~ msgstr "" -#~ "\n" -#~ "Âåðñ³ÿ ç GUI äëÿ 16/32-ðîçðÿäíî¿ Windows" - -#~ msgid "" -#~ "\n" -#~ "MS-Windows 64-bit GUI version" -#~ msgstr "" -#~ "\n" -#~ "Âåðñ³ÿ ç GUI äëÿ 64-ðîçðÿäíî¿ MS-Windows" - -#~ msgid "" -#~ "\n" -#~ "MS-Windows 32-bit GUI version" -#~ msgstr "" -#~ "\n" -#~ "Âåðñ³ÿ ç GUI äëÿ 32-ðîçðÿäíî¿ Windows" - -#~ msgid " in Win32s mode" -#~ msgstr " â ðåæèì³ Win32s" - -#~ msgid " with OLE support" -#~ msgstr " ç ï³äòðèìêîþ OLE" - -#~ msgid "" -#~ "\n" -#~ "MS-Windows 64-bit console version" -#~ msgstr "" -#~ "\n" -#~ "Êîíñîëüíà âåðñ³ÿ äëÿ 64-ðîçðÿäíî¿ Windows" - -#~ msgid "" -#~ "\n" -#~ "MS-Windows 32-bit console version" -#~ msgstr "" -#~ "\n" -#~ "Êîíñîëüíà âåðñ³ÿ äëÿ 32-ðîçðÿäíî¿ Windows" - -#~ msgid "" -#~ "\n" -#~ "MS-Windows 16-bit version" -#~ msgstr "" -#~ "\n" -#~ "Âåðñ³ÿ äëÿ 16-ðîçðÿäíî¿ Windows" - -#~ msgid "" -#~ "\n" -#~ "32-bit MS-DOS version" -#~ msgstr "" -#~ "\n" -#~ "Âåðñ³ÿ äëÿ 32-ðîçðÿäíî¿ MS-DOS" - -#~ msgid "" -#~ "\n" -#~ "16-bit MS-DOS version" -#~ msgstr "" -#~ "\n" -#~ "Âåðñ³ÿ äëÿ 16-ðîçðÿäíî¿ MS-DOS" - -#~ msgid "" -#~ "\n" -#~ "MacOS X (unix) version" -#~ msgstr "" -#~ "\n" -#~ "Âåðñ³ÿ äëÿ MacOS X (unix)" - -#~ msgid "" -#~ "\n" -#~ "MacOS X version" -#~ msgstr "" -#~ "\n" -#~ "Âåðñ³ÿ äëÿ MacOS X" - -#~ msgid "" -#~ "\n" -#~ "MacOS version" -#~ msgstr "" -#~ "\n" -#~ "Âåðñ³ÿ äëÿ MacOS" - -#~ msgid "" -#~ "\n" -#~ "OpenVMS version" -#~ msgstr "" -#~ "\n" -#~ "Âåðñ³ÿ äëÿ OpenVMS" - -#~ msgid "" -#~ "\n" -#~ "Big version " -#~ msgstr "" -#~ "\n" -#~ "Âåëèêà âåðñ³ÿ " - -#~ msgid "" -#~ "\n" -#~ "Normal version " -#~ msgstr "" -#~ "\n" -#~ "Íîðìàëüíà âåðñ³ÿ " - -#~ msgid "" -#~ "\n" -#~ "Small version " -#~ msgstr "" -#~ "\n" -#~ "Ìàëà âåðñ³ÿ " - -#~ msgid "" -#~ "\n" -#~ "Tiny version " -#~ msgstr "" -#~ "\n" -#~ "Êðèõ³òíà âåðñ³ÿ " - -#~ msgid "with GTK2-GNOME GUI." -#~ msgstr "ç GUI GTK2-GNOME." - -#~ msgid "with GTK2 GUI." -#~ msgstr "ç GUI GTK2." - -#~ msgid "with X11-Motif GUI." -#~ msgstr "ç GUI X11-Motif." - -#~ msgid "with X11-neXtaw GUI." -#~ msgstr "ç GUI X11-neXtaw." - -#~ msgid "with X11-Athena GUI." -#~ msgstr "ç GUI X11-Athena." - -#~ msgid "with Photon GUI." -#~ msgstr "ç GUI Photon." - -#~ msgid "with GUI." -#~ msgstr "ç GUI." - -#~ msgid "with Carbon GUI." -#~ msgstr "ç GUI Carbon." - -#~ msgid "with Cocoa GUI." -#~ msgstr "ç GUI Cocoa." - -#~ msgid "with (classic) GUI." -#~ msgstr "ç (êëàñè÷íèì) GUI." - -#~ msgid " system gvimrc file: \"" -#~ msgstr " ñèñòåìíèé gvimrc: \"" - -#~ msgid " user gvimrc file: \"" -#~ msgstr " gvimrc êîðèñòóâà÷à: \"" - -#~ msgid "2nd user gvimrc file: \"" -#~ msgstr "äðóãèé gvimrc êîðèñòóâà÷à: \"" - -#~ msgid "3rd user gvimrc file: \"" -#~ msgstr "òðåò³é gvimrc êîðèñòóâà÷à: \"" - -#~ msgid " system menu file: \"" -#~ msgstr " ñèñòåìíå ìåíþ: \"" - -#~ msgid "Compiler: " -#~ msgstr "Êîìï³ëÿòîð: " - -#~ msgid "menu Help->Orphans for information " -#~ msgstr "ìåíþ Help->Orphans ïîäàëüøà ³íôîðìàö³ÿ " - -#~ msgid "Running modeless, typed text is inserted" -#~ msgstr "Áåç ðåæèì³â, òåêñò ùî íàáðàíî âñòàâëÿºòüñÿ" - -#~ msgid "menu Edit->Global Settings->Toggle Insert Mode " -#~ msgstr "ìåíþ Edit->Global Settings->Toggle Insert Mode " - -#~ msgid " for two modes " -#~ msgstr " äëÿ äâîõ ðåæèì³â " - -#~ msgid "menu Edit->Global Settings->Toggle Vi Compatible" -#~ msgstr "ìåíþ Edit->Global Settings->Toggle Vi Compatible " - -#~ msgid " for Vim defaults " -#~ msgstr " ùîá ïî÷èíàòè â ðåæèì³ ñóì³ñíîñò³ ç Vi" - -#~ msgid "WARNING: Windows 95/98/ME detected" -#~ msgstr "ÇÀÑÒÅÐÅÆÅÍÍß: Âè êîðèñòóºòåñÿ Windows 95/98/ME" - -#~ msgid "type :help windows95<Enter> for info on this" -#~ msgstr ":help windows95<Enter> ³íôîðìàö³ÿ ïðî öå " - -#~ msgid "E370: Could not load library %s" -#~ msgstr "E370: Íå âäàëîñÿ çàâàíòàæèòè á³áë³îòåêó %s" - -#~ msgid "" -#~ "Sorry, this command is disabled: the Perl library could not be loaded." -#~ msgstr "" -#~ "Âèáà÷òå, öÿ êîìàíäà âèìêíåíà, á³áë³îòåêà Perl íå ìîæå áóòè çàâàíòàæåíà." - -#~ msgid "E299: Perl evaluation forbidden in sandbox without the Safe module" -#~ msgstr "" -#~ "E299: Îá÷èñëåííÿ âèðàç³â Perl çàáîðîíåíå ó ï³ñî÷íèö³ áåç ìîäóëÿ Safe" - -#~ msgid "Edit with &multiple Vims" -#~ msgstr "Ðåäàãóâàòè ó (&m)ð³çíèõ Vim" - -#~ msgid "Edit with single &Vim" -#~ msgstr "Ðåäàãóâàòè ó îäíîìó &Vim" - -#~ msgid "Diff with Vim" -#~ msgstr "Ïîð³âíÿòè ç äîïîìîãîþ Vim" - -#~ msgid "Edit with &Vim" -#~ msgstr "Ðåäàãóâàòè çà äîïîìîãîþ &Vim" - -#~ msgid "Edit with existing Vim - " -#~ msgstr "Ðåäàãóâàòè ó âæå çàïóùåíîìó Vim - " - -#~ msgid "Edits the selected file(s) with Vim" -#~ msgstr "Ðåäàãóº âèáðàí³ ôàéëè ç äîïîìîãîþ Vim" - -#~ msgid "Error creating process: Check if gvim is in your path!" -#~ msgstr "Ïîìèëêà ñòâîðåííÿ ïðîöåñó, ïåðåâ³ðòå ÷è º gvim ó øëÿõó ïîøóêó!" - -#~ msgid "gvimext.dll error" -#~ msgstr "ïîìèëêà gvimext.dll" - -#~ msgid "Path length too long!" -#~ msgstr "Øëÿõ çàíàäòî äîâãèé!" - -# msgstr "E233: " -#~ msgid "E234: Unknown fontset: %s" -#~ msgstr "E234: Íåâ³äîìèé íàá³ð øðèôò³â: %s" - -#~ msgid "E235: Unknown font: %s" -#~ msgstr "E235: Íåâ³äîìèé øðèôò: %s" - -# msgstr "E235: " -#~ msgid "E236: Font \"%s\" is not fixed-width" -#~ msgstr "E236: Øðèôò «%s» íå ìîíîøèðèííèé" - -#~ msgid "E448: Could not load library function %s" -#~ msgstr "E448: Íå âäàëîñÿ çàâàíòàæèòè á³áë³îòå÷íó ôóíêö³þ %s" - -#~ msgid "E26: Hebrew cannot be used: Not enabled at compile time\n" -#~ msgstr "E26: Íå ìîæíà âèêîðèñòàòè ³âðèò: Íå ââ³ìêíåíî ï³ä ÷àñ êîìï³ëÿö³¿\n" - -#~ msgid "E27: Farsi cannot be used: Not enabled at compile time\n" -#~ msgstr "E27: Íå ìîæíà âèêîðèñòàòè ôàðñ³: Íå ââ³ìêíåíî ï³ä ÷àñ êîìï³ëÿö³¿\n" - -#~ msgid "E800: Arabic cannot be used: Not enabled at compile time\n" -#~ msgstr "" -#~ "E800: Íå ìîæíà âèêîðèñòàòè àðàáñüêó ìîâó: Íå ââ³ìêíåíî ï³ä ÷àñ " -#~ "êîìï³ëÿö³¿\n" - -#~ msgid "E247: no registered server named \"%s\"" -#~ msgstr "E247: Íåìຠçàðåºñòðîâàíèõ ñåðâåð³â ç íàçâîþ «%s»" - -#~ msgid "E233: cannot open display" -#~ msgstr "E233: Íå âäàëîñÿ â³äêðèòè äèñïëåé" - -#~ msgid "E449: Invalid expression received" -#~ msgstr "E449: Îòðèìàíî íåêîðåêòíèé âèðàç" - -#~ msgid "E463: Region is guarded, cannot modify" -#~ msgstr "E463: Íå ìîæíà çì³íèòè çàõèùåíèé ðåã³îí" - -#~ msgid "E744: NetBeans does not allow changes in read-only files" -#~ msgstr "E744: NetBeans íå äîçâîëÿº çì³íþâàòè çàõèùåí³ â³ä çàïèñó ôàéëè" - -#~ msgid "Need encryption key for \"%s\"" -#~ msgstr "Äëÿ «%s» ïîòð³áåí êëþ÷: " - -# msgstr "E406: " -#~ msgid "empty keys are not allowed" -#~ msgstr "ïîðîæí³ êëþ÷³ íå äîçâîëåí³" - -#~ msgid "dictionary is locked" -#~ msgstr "ñëîâíèê çàáëîêîâàíî" - -#~ msgid "list is locked" -#~ msgstr "ñïèñîê çàáëîêîâàíî" - -#~ msgid "failed to add key '%s' to dictionary" -#~ msgstr "íå âäàëîñÿ äîäàòè êëþ÷ '%s' äî ñëîâíèêà" - -#~ msgid "index must be int or slice, not %s" -#~ msgstr "³íäåêñ ìຠáóòè ö³ëèé ÷è çð³ç, íå %s" - -#~ msgid "expected str() or unicode() instance, but got %s" -#~ msgstr "î÷³êóâàâñÿ åêçåìïëÿð str() ÷è unicode(), àëå îòðèìàíî %s" - -#~ msgid "expected bytes() or str() instance, but got %s" -#~ msgstr "î÷³êóâàâñÿ åêçåìïëÿð bytes() ÷è str(), àëå îòðèìàíî %s" - -#~ msgid "" -#~ "expected int(), long() or something supporting coercing to long(), but " -#~ "got %s" -#~ msgstr "" -#~ "î÷³êóâàâñÿ int(), long() ÷è ùîñü, ùî ìîæå áóòè âì³ùåíå long(), àëå " -#~ "îòðèìàíî %s" - -#~ msgid "expected int() or something supporting coercing to int(), but got %s" -#~ msgstr "" -#~ "î÷³êóâàâñÿ int() ÷è ùîñü, ùî ìîæå áóòè âì³ùåíå int(), àëå îòðèìàíî %s" - -#~ msgid "value is too large to fit into C int type" -#~ msgstr "çíà÷åííÿ çàâåëèêå, ùîá âì³ñòèòèñÿ ó òèï C int" - -#~ msgid "value is too small to fit into C int type" -#~ msgstr "çíà÷åííÿ çàìàëå, ùîá âì³ñòèòèñÿ ó òèï C int" - -#~ msgid "number must be greater then zero" -#~ msgstr "÷èñëî ìຠáóòè á³ëüøå, í³æ íóëü" - -#~ msgid "number must be greater or equal to zero" -#~ msgstr "÷èñëî ìຠáóòè íå ìåíøå, í³æ íóëü" - -#~ msgid "can't delete OutputObject attributes" -#~ msgstr "íå âäàëîñÿ çíèùèòè àòðèáóòè OutputObject" - -# msgstr "E180: " -#~ msgid "invalid attribute: %s" -#~ msgstr "íåïðàâèëüíèé àòðèáóò: %s" - -#~ msgid "E264: Python: Error initialising I/O objects" -#~ msgstr "E264: Python: Ïîìèëêà ³í³ö³àë³çàö³¿ îá'ºêò³â ââîäó/âèâîäó" - -#~ msgid "failed to change directory" -#~ msgstr "íå âäàëîñÿ çì³íèòè äèðåêòîð³þ" - -#~ msgid "expected 3-tuple as imp.find_module() result, but got %s" -#~ msgstr "î÷³êóâàâñÿ 3-êîðòåæ ÿê ðåçóëüòàò imp.find_module(), àëå îòðèìàíî %s" - -#~ msgid "" -#~ "expected 3-tuple as imp.find_module() result, but got tuple of size %d" -#~ msgstr "î÷³êóâàâñÿ 3-êîðòåæ ÿê ðåçóëüòàò imp.find_module(), àëå îòðèìàíî %d" - -#~ msgid "internal error: imp.find_module returned tuple with NULL" -#~ msgstr "âíóòð³øíÿ ïîìèëêà: imp.find_module ïîâåðíóëà êîðòåæ ç NULL" - -#~ msgid "cannot delete vim.Dictionary attributes" -#~ msgstr "íå âäàëîñÿ çíèùèòè àòðèáóòè vim.Dictionary" - -#~ msgid "cannot modify fixed dictionary" -#~ msgstr "íå ìîæíà çì³íèòè ô³êñîâàíèé ñëîâíèê" - -#~ msgid "cannot set attribute %s" -#~ msgstr "íå ìîæíà âñòàíîâèòè àòðèáóò %s" - -#~ msgid "hashtab changed during iteration" -#~ msgstr "õåø-òàáëèöÿ çì³íèëàñÿ ï³ä ÷àñ ïåðåáèðàííÿ" - -#~ msgid "expected sequence element of size 2, but got sequence of size %d" -#~ msgstr "" -#~ "î÷³êóâàëàñü ïîñë³äîâí³ñòü ðîçì³ðîì 2, àëå îòðèìàíî ïîñë³äîâí³ñòü ðîçì³ðó " -#~ "%d" - -#~ msgid "list constructor does not accept keyword arguments" -#~ msgstr "ñïèñêîâèé êîíñòðóêòîð íå ïðèéìຠ³ìåíîâàí³ àðãóìåíòè" - -#~ msgid "list index out of range" -#~ msgstr "³íäåêñ ñïèñêó çà ìåæàìè" - -#~ msgid "internal error: failed to get vim list item %d" -#~ msgstr "âíóòð³øíÿ ïîìèëêà: íå âäàëîñÿ îòðèìàòè åëåìåíò ñïèñêó vim %d" - -#~ msgid "failed to add item to list" -#~ msgstr "íå âäàëîñÿ äîäàòè åëåìåíò äî ñïèñêó" - -#~ msgid "internal error: no vim list item %d" -#~ msgstr "âíóòð³øíÿ ïîìèëêà: íåìຠåëåìåíòà ñïèñêó vim %d" - -#~ msgid "internal error: failed to add item to list" -#~ msgstr "âíóòð³øíÿ ïîìèëêà: íå âäàëîñÿ äîäàòè åëåìåíò äî ñïèñêó" - -#~ msgid "cannot delete vim.List attributes" -#~ msgstr "íå âäàëîñÿ çíèùèòè àòðèáóòè vim.List" - -#~ msgid "cannot modify fixed list" -#~ msgstr "íå ìîæíà çì³íèòè ô³êñîâàíèé ñïèñîê" - -# msgstr "E428: " -#~ msgid "unnamed function %s does not exist" -#~ msgstr "áåç³ìåííî¿ ôóíêö³¿ %s íå ³ñíóº" - -# msgstr "E428: " -#~ msgid "function %s does not exist" -#~ msgstr "ôóíêö³¿ %s íå ³ñíóº" - -#~ msgid "function constructor does not accept keyword arguments" -#~ msgstr "êîíñòðóêòîð ôóíêö³¿ íå ïðèéìຠ³ìåíîâàí³ àðãóìåíòè" - -#~ msgid "failed to run function %s" -#~ msgstr "íå âäàëîñÿ âèêîíàòè ôóíêö³þ %s" - -#~ msgid "problem while switching windows" -#~ msgstr "íå âäàëîñÿ ïåðåìêíóòè â³êíà" - -#~ msgid "unable to unset global option %s" -#~ msgstr "íå âäàëîñÿ ñêèíóòè ãëîáàëüíó îïö³þ %s" - -#~ msgid "unable to unset option %s which does not have global value" -#~ msgstr "íå âäàëîñÿ ñêèíóòè îïö³þ %s, ÿêà íå ìຠãëîáàëüíîãî çíà÷åííÿ" - -#~ msgid "attempt to refer to deleted tab page" -#~ msgstr "ñïðîáà çâåðíåííÿ äî çíèùåíî¿ âêëàäêè" - -#~ msgid "no such tab page" -#~ msgstr "òàêî¿ âêëàäêè íåìàº" - -#~ msgid "attempt to refer to deleted window" -#~ msgstr "ñïðîáà çâåðíóòèñÿ äî çíèùåíîãî â³êíà" - -#~ msgid "readonly attribute: buffer" -#~ msgstr "àòðèáóò ëèøå äëÿ ÷èòàííÿ: áóôåð" - -#~ msgid "cursor position outside buffer" -#~ msgstr "êóðñîð çà ìåæàìè áóôåðà" - -#~ msgid "no such window" -#~ msgstr "òàêîãî â³êíà íåìàº" - -#~ msgid "attempt to refer to deleted buffer" -#~ msgstr "ñïðîáà çâåðíåííÿ äî çíèùåíîãî áóôåðà" - -#~ msgid "failed to rename buffer" -#~ msgstr "íå âäàëîñÿ ïåðåéìåíóâàòè áóôåð" - -#~ msgid "mark name must be a single character" -#~ msgstr "íàçâîþ ì³òêè ìຠáóòè îäèí ñèìâîë" - -#~ msgid "expected vim.Buffer object, but got %s" -#~ msgstr "î÷³êóâàâñÿ îá’ºêò vim.Buffer, àëå îòðèìàíî %s" - -#~ msgid "failed to switch to buffer %d" -#~ msgstr "íå âäàëîñÿ ïåðåìêíóòèñÿ äî áóôåðà %d" - -#~ msgid "expected vim.Window object, but got %s" -#~ msgstr "î÷³êóâàâñÿ îá’ºêò vim.Window, àëå îòðèìàíî %s" - -#~ msgid "failed to find window in the current tab page" -#~ msgstr "íå âäàëîñÿ çíàéòè â³êíî ó ïîòî÷í³é âêëàäö³" - -#~ msgid "did not switch to the specified window" -#~ msgstr "íå ïåðåìêíóâñÿ äî âêàçàíîãî â³êíà" - -#~ msgid "expected vim.TabPage object, but got %s" -#~ msgstr "î÷³êóâàâñÿ îá’ºêò vim.TabPage, àëå îòðèìàíî %s" - -#~ msgid "did not switch to the specified tab page" -#~ msgstr "íå ïåðåìêíóâñÿ äî âêàçàíî¿ âêëàäêè" - -#~ msgid "failed to run the code" -#~ msgstr "íå âäàëîñÿ âèêîíàòè êîä" - -#~ msgid "E858: Eval did not return a valid python object" -#~ msgstr "E858: Eval íå ïîâåðíóâ ä³éñíèé îá’ºêò python" - -#~ msgid "E859: Failed to convert returned python object to vim value" -#~ msgstr "E859: Íå âäàëîñÿ ïåðåòâîðèòè îá’ºêò python ó çíà÷åííÿ vim" - -#~ msgid "unable to convert %s to vim dictionary" -#~ msgstr "íå âäàëîñÿ ïåðåòâîðèòè %s ó ñëîâíèê vim" - -#~ msgid "unable to convert %s to vim structure" -#~ msgstr "íå âäàëîñÿ ïåðåòâîðèòè %s ó ñòðóêòóðó vim" - -#~ msgid "internal error: NULL reference passed" -#~ msgstr "âíóòð³øíÿ ïîìèëêà: ïåðåäàíî ïîñèëàííÿ NULL" - -#~ msgid "internal error: invalid value type" -#~ msgstr "âíóòð³øíÿ ïîìèëêà: íåïðàâèëüíèé òèï çíà÷åííÿ" - -#~ msgid "" -#~ "Failed to set path hook: sys.path_hooks is not a list\n" -#~ "You should now do the following:\n" -#~ "- append vim.path_hook to sys.path_hooks\n" -#~ "- append vim.VIM_SPECIAL_PATH to sys.path\n" -#~ msgstr "" -#~ "Íå âäàëîñÿ âñòàíîâèòè îáðîáíèê øëÿõó: sys.path_hooks íå ñïèñîê\n" -#~ "Âàì ñë³ä â÷èíèòè òàê:\n" -#~ "- äîäàéòå vim.path_hook äî sys.path_hooks\n" -#~ "- äîäàéòå vim.VIM_SPECIAL_PATH äî sys.path\n" - -#~ msgid "" -#~ "Failed to set path: sys.path is not a list\n" -#~ "You should now append vim.VIM_SPECIAL_PATH to sys.path" -#~ msgstr "" -#~ "Íå âäàëîñÿ âñòàíîâèòè øëÿõ: sys.path íå ñïèñîê\n" -#~ "Âàñ ñë³ä äîäàòè vim.VIM_SPECIAL_PATH äî sys.path" diff --git a/src/nvim/po/uk.po b/src/nvim/po/uk.po index eaa3a5bfa9..6a75018726 100644 --- a/src/nvim/po/uk.po +++ b/src/nvim/po/uk.po @@ -21,204 +21,157 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -#: ../api/private/helpers.c:201 -#, fuzzy msgid "Unable to get option value" -msgstr "не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¾Ð¿Ñ†Ñ–Ñ—" +msgstr "Ðе вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¾Ð¿Ñ†Ñ–Ñ—" -#: ../api/private/helpers.c:204 msgid "internal error: unknown option type" msgstr "Ð²Ð½ÑƒÑ‚Ñ€Ñ–ÑˆÐ½Ñ Ð¿Ð¾Ð¼Ð¸Ð»ÐºÐ°: невідомий тип опції" -#: ../buffer.c:92 msgid "[Location List]" msgstr "[СпиÑок міÑць]" -#: ../buffer.c:93 msgid "[Quickfix List]" msgstr "[СпиÑок виправлень]" -#: ../buffer.c:94 msgid "E855: Autocommands caused command to abort" msgstr "E855: Ðвтокоманди призвели до ÑкаÑÑƒÐ²Ð°Ð½Ð½Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð¸" -#: ../buffer.c:135 msgid "E82: Cannot allocate any buffer, exiting..." msgstr "E82: Ðемає можливоÑті розміÑтити хоч один буфер, Ð·Ð°Ð²ÐµÑ€ÑˆÐµÐ½Ð½Ñ Ñ€Ð¾Ð±Ð¾Ñ‚Ð¸..." -#: ../buffer.c:138 msgid "E83: Cannot allocate buffer, using other one..." msgstr "E83: Ðемає можливоÑті розміÑтити буфер, буде викориÑтано інший..." -#: ../buffer.c:763 msgid "E515: No buffers were unloaded" msgstr "E515: Жоден з буферів не був вивантажений" -#: ../buffer.c:765 msgid "E516: No buffers were deleted" msgstr "E516: Жоден з буферів не знищено" -#: ../buffer.c:767 msgid "E517: No buffers were wiped out" msgstr "E517: Жоден з буферів не витерто" -#: ../buffer.c:772 msgid "1 buffer unloaded" msgstr "Вивантажено один буфер" -#: ../buffer.c:774 #, c-format msgid "%d buffers unloaded" msgstr "Вивантажено %d буфери(ів)" -#: ../buffer.c:777 msgid "1 buffer deleted" msgstr "Знищено один буфер" -#: ../buffer.c:779 #, c-format msgid "%d buffers deleted" msgstr "Знищено %d буфери(ів)" -#: ../buffer.c:782 msgid "1 buffer wiped out" msgstr "Витерто один буфер" -#: ../buffer.c:784 #, c-format msgid "%d buffers wiped out" msgstr "Витерто %d буфери(ів)" -#: ../buffer.c:806 msgid "E90: Cannot unload last buffer" msgstr "E90: Ðе можу вивантажити оÑтанній буфер" -#: ../buffer.c:874 msgid "E84: No modified buffer found" msgstr "E84: Жоден буфер не змінено" #. back where we started, didn't find anything. -#: ../buffer.c:903 msgid "E85: There is no listed buffer" msgstr "E85: У ÑпиÑку немає буферів" -#: ../buffer.c:913 #, c-format msgid "E86: Buffer %<PRId64> does not exist" msgstr "E86: Буфера %<PRId64> немає" -#: ../buffer.c:915 msgid "E87: Cannot go beyond last buffer" msgstr "E87: Це вже оÑтанній буфер" -#: ../buffer.c:917 msgid "E88: Cannot go before first buffer" msgstr "E88: Це вже найперший буфер" -#: ../buffer.c:945 #, c-format msgid "" "E89: No write since last change for buffer %<PRId64> (add ! to override)" msgstr "E89: Буфер %<PRId64> має зміни (! щоб не зважати)" #. wrap around (may cause duplicates) -#: ../buffer.c:1423 msgid "W14: Warning: List of file names overflow" msgstr "W14: Обережно: СпиÑок назв файлів переповнено" -#: ../buffer.c:1555 ../quickfix.c:3361 #, c-format msgid "E92: Buffer %<PRId64> not found" msgstr "E92: Буфер %<PRId64> не знайдено" -#: ../buffer.c:1798 #, c-format msgid "E93: More than one match for %s" msgstr "E93: Знайдено кілька збігів з %s" -#: ../buffer.c:1800 #, c-format msgid "E94: No matching buffer for %s" msgstr "E94: Ðе знайдено буфер, Ñхожий на %s" -#: ../buffer.c:2161 #, c-format msgid "line %<PRId64>" msgstr "Ñ€Ñдок %<PRId64>" -#: ../buffer.c:2233 msgid "E95: Buffer with this name already exists" msgstr "E95: Буфер з такою назвою вже Ñ–Ñнує" -#: ../buffer.c:2498 msgid " [Modified]" msgstr " [Змінено]" -#: ../buffer.c:2501 msgid "[Not edited]" msgstr "[Ðе редаговано]" -#: ../buffer.c:2504 msgid "[New file]" msgstr "[Ðовий файл]" -#: ../buffer.c:2505 msgid "[Read errors]" msgstr "[Помилки читаннÑ]" -#: ../buffer.c:2506 ../buffer.c:3217 ../fileio.c:1807 ../screen.c:4895 msgid "[RO]" msgstr "[RO]" -#: ../buffer.c:2507 ../fileio.c:1807 msgid "[readonly]" msgstr "[лише читати]" -#: ../buffer.c:2524 #, c-format msgid "1 line --%d%%--" msgstr "один Ñ€Ñдок --%d%%--" -#: ../buffer.c:2526 #, c-format msgid "%<PRId64> lines --%d%%--" msgstr "%<PRId64> Ñ€Ñдки(ів) --%d%%--" -#: ../buffer.c:2530 #, c-format msgid "line %<PRId64> of %<PRId64> --%d%%-- col " msgstr "Ñ€Ñдок %<PRId64> з %<PRId64> --%d%%-- колонка " -#: ../buffer.c:2632 ../buffer.c:4292 ../memline.c:1554 msgid "[No Name]" msgstr "[Без назви]" #. must be a help buffer -#: ../buffer.c:2667 msgid "help" msgstr "допомога" -#: ../buffer.c:3225 ../screen.c:4883 msgid "[Help]" msgstr "[Допомога]" -#: ../buffer.c:3254 ../screen.c:4887 msgid "[Preview]" msgstr "[ПереглÑд]" -#: ../buffer.c:3528 msgid "All" msgstr "УÑе" -#: ../buffer.c:3528 msgid "Bot" msgstr "Знизу" -#: ../buffer.c:3531 msgid "Top" msgstr "Вгорі" -#: ../buffer.c:4244 msgid "" "\n" "# Buffer list:\n" @@ -226,11 +179,9 @@ msgstr "" "\n" "# СпиÑок буферів:\n" -#: ../buffer.c:4289 msgid "[Scratch]" msgstr "[З нулÑ]" -#: ../buffer.c:4529 msgid "" "\n" "--- Signs ---" @@ -238,202 +189,155 @@ msgstr "" "\n" "--- Позначки ---" -#: ../buffer.c:4538 #, c-format msgid "Signs for %s:" msgstr "Позначки Ð´Ð»Ñ %s:" -#: ../buffer.c:4543 #, c-format msgid " line=%<PRId64> id=%d name=%s" msgstr " Ñ€Ñдок=%<PRId64> id=%d назва=%s" -#: ../cursor_shape.c:68 msgid "E545: Missing colon" msgstr "E545: Пропущено двокрапку" -#: ../cursor_shape.c:70 ../cursor_shape.c:94 msgid "E546: Illegal mode" msgstr "E546: Ðеправильний режим" -#: ../cursor_shape.c:134 msgid "E548: digit expected" msgstr "E548: Потрібна цифра" -#: ../cursor_shape.c:138 msgid "E549: Illegal percentage" msgstr "E549: Ðеправильний відÑоток" -#: ../diff.c:146 #, c-format msgid "E96: Can not diff more than %<PRId64> buffers" msgstr "E96: Ðе можна порівнювати понад %<PRId64> буфери(ів)" -#: ../diff.c:753 msgid "E810: Cannot read or write temp files" msgstr "E810: Ðе можна читати чи запиÑувати тимчаÑові файли" -#: ../diff.c:755 msgid "E97: Cannot create diffs" msgstr "E97: Ðе вдалоÑÑ Ñтворити порівнÑннÑ" -#: ../diff.c:966 msgid "E816: Cannot read patch output" msgstr "E816: Ðе вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ результат patch" -#: ../diff.c:1220 msgid "E98: Cannot read diff output" msgstr "E98: Ðе вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ результат diff" -#: ../diff.c:2081 msgid "E99: Current buffer is not in diff mode" msgstr "E99: Цей буфер не в режимі порівнÑннÑ" -#: ../diff.c:2100 msgid "E793: No other buffer in diff mode is modifiable" msgstr "E793: Ðемає більше модифіковних буферів в режимі порівнÑннÑ" -#: ../diff.c:2102 msgid "E100: No other buffer in diff mode" msgstr "E100: Ðемає інших буферів в режимі порівнÑннÑ" -#: ../diff.c:2112 msgid "E101: More than two buffers in diff mode, don't know which one to use" msgstr "" "E101: Понад два буфери у режимі порівнÑннÑ, не зрозуміло, котрий із них " "викориÑтати" -#: ../diff.c:2141 #, c-format msgid "E102: Can't find buffer \"%s\"" msgstr "E102: Ðе вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ буфер «%s»" -#: ../diff.c:2152 #, c-format msgid "E103: Buffer \"%s\" is not in diff mode" msgstr "E103: Буфер «%s» не в режимі порівнÑннÑ" -#: ../diff.c:2193 msgid "E787: Buffer changed unexpectedly" msgstr "E787: Буфер неÑподівано змінивÑÑ" -#: ../digraph.c:1598 msgid "E104: Escape not allowed in digraph" msgstr "E104: У диграфах не може міÑтитиÑÑ escape" -#: ../digraph.c:1760 msgid "E544: Keymap file not found" msgstr "E544: Ðе знайдено файл розкладки" -#: ../digraph.c:1785 msgid "E105: Using :loadkeymap not in a sourced file" msgstr "E105: :loadkeymap викориÑтано не у файлі команд" -#: ../digraph.c:1821 msgid "E791: Empty keymap entry" msgstr "E791: Елемент розкладки порожній" -#: ../edit.c:82 msgid " Keyword completion (^N^P)" msgstr " Ð”Ð¾Ð¿Ð¾Ð²Ð½ÐµÐ½Ð½Ñ ÐºÐ»ÑŽÑ‡Ð¾Ð²Ð¸Ñ… Ñлів (^N^P)" #. ctrl_x_mode == 0, ^P/^N compl. -#: ../edit.c:83 msgid " ^X mode (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y)" msgstr " Режим ^X (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y)" -#: ../edit.c:85 msgid " Whole line completion (^L^N^P)" msgstr " Ð”Ð¾Ð¿Ð¾Ð²Ð½ÐµÐ½Ð½Ñ ÑƒÑього Ñ€Ñдка (^L^N^P)" -#: ../edit.c:86 msgid " File name completion (^F^N^P)" msgstr " Ð”Ð¾Ð¿Ð¾Ð²Ð½ÐµÐ½Ð½Ñ Ð½Ð°Ð·Ð²Ð¸ файлу (^F^N^P)" -#: ../edit.c:87 msgid " Tag completion (^]^N^P)" msgstr " Ð”Ð¾Ð¿Ð¾Ð²Ð½ÐµÐ½Ð½Ñ Ñ‚ÐµÒ‘Ñ–Ð² (^]^N^P)" -#: ../edit.c:88 msgid " Path pattern completion (^N^P)" msgstr " Ð”Ð¾Ð¿Ð¾Ð²Ð½ÐµÐ½Ð½Ñ ÑˆÐ»Ñху за зразком (^N^P)" -#: ../edit.c:89 msgid " Definition completion (^D^N^P)" msgstr " Ð”Ð¾Ð¿Ð¾Ð²Ð½ÐµÐ½Ð½Ñ Ð²Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ (^D^N^P)" -#: ../edit.c:91 msgid " Dictionary completion (^K^N^P)" msgstr " Ð”Ð¾Ð¿Ð¾Ð²Ð½ÐµÐ½Ð½Ñ Ð·Ñ– Ñловника (^K^N^P)" -#: ../edit.c:92 msgid " Thesaurus completion (^T^N^P)" msgstr " Ð”Ð¾Ð¿Ð¾Ð²Ð½ÐµÐ½Ð½Ñ Ð· тезауруÑу (^T^N^P)" -#: ../edit.c:93 msgid " Command-line completion (^V^N^P)" msgstr " Ð”Ð¾Ð¿Ð¾Ð²Ð½ÐµÐ½Ð½Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´ (^V^N^P)" -#: ../edit.c:94 msgid " User defined completion (^U^N^P)" msgstr " КориÑтувацьке Ð´Ð¾Ð¿Ð¾Ð²Ð½ÐµÐ½Ð½Ñ (^U^N^P)" -#: ../edit.c:95 msgid " Omni completion (^O^N^P)" msgstr " Кмітливе Ð´Ð¾Ð¿Ð¾Ð²Ð½ÐµÐ½Ð½Ñ (^O^N^P)" -#: ../edit.c:96 msgid " Spelling suggestion (s^N^P)" msgstr " Орфографічна підказка (s^N^P)" -#: ../edit.c:97 msgid " Keyword Local completion (^N^P)" msgstr " Ð”Ð¾Ð¿Ð¾Ð²Ð½ÐµÐ½Ð½Ñ Ð¼Ñ–Ñцевих ключових Ñлів (^N^P)" -#: ../edit.c:100 msgid "Hit end of paragraph" msgstr "ТрапивÑÑ ÐºÑ–Ð½ÐµÑ†ÑŒ параграфа" # msgstr "E443: " -#: ../edit.c:101 msgid "E839: Completion function changed window" msgstr "E839: Ð¤ÑƒÐ½ÐºÑ†Ñ–Ñ Ð´Ð¾Ð¿Ð¾Ð²Ð½ÐµÐ½Ð½Ñ Ð·Ð¼Ñ–Ð½Ð¸Ð»Ð° вікно" -#: ../edit.c:102 msgid "E840: Completion function deleted text" msgstr "E840: Ð¤ÑƒÐ½ÐºÑ†Ñ–Ñ Ð´Ð¾Ð¿Ð¾Ð²Ð½ÐµÐ½Ð½Ñ Ð·Ð½Ð¸Ñ‰Ð¸Ð»Ð° текÑÑ‚" -#: ../edit.c:1847 msgid "'dictionary' option is empty" msgstr "ÐžÐ¿Ñ†Ñ–Ñ 'dictionary' порожнÑ" -#: ../edit.c:1848 msgid "'thesaurus' option is empty" msgstr "ÐžÐ¿Ñ†Ñ–Ñ 'thesaurus' порожнÑ" -#: ../edit.c:2655 #, c-format msgid "Scanning dictionary: %s" msgstr "СкануєтьÑÑ Ñловник: %s" -#: ../edit.c:3079 msgid " (insert) Scroll (^E/^Y)" msgstr " (вÑтавка) Прогорнути (^E/^Y)" -#: ../edit.c:3081 msgid " (replace) Scroll (^E/^Y)" msgstr " (заміна) Прогорнути (^E/^Y)" -#: ../edit.c:3587 #, c-format msgid "Scanning: %s" msgstr "Пошук у: %s" -#: ../edit.c:3614 msgid "Scanning tags." msgstr "Пошук Ñеред теґів." -#: ../edit.c:4519 msgid " Adding" msgstr " ДодаєтьÑÑ" @@ -441,598 +345,468 @@ msgstr " ДодаєтьÑÑ" #. * be called before line = ml_get(), or when this address is no #. * longer needed. -- Acevedo. #. -#: ../edit.c:4562 msgid "-- Searching..." msgstr "-- Пошук..." -#: ../edit.c:4618 msgid "Back at original" msgstr "Початковий варіант" -#: ../edit.c:4621 msgid "Word from other line" msgstr "Слово з іншого Ñ€Ñдка" -#: ../edit.c:4624 msgid "The only match" msgstr "Єдиний збіг" -#: ../edit.c:4680 #, c-format msgid "match %d of %d" msgstr "збіг %d з %d" -#: ../edit.c:4684 #, c-format msgid "match %d" msgstr "збіг %d" # msgstr "E17: " -#: ../eval.c:137 msgid "E18: Unexpected characters in :let" msgstr "E18: Ðеочікувані Ñимволи у :let" -#: ../eval.c:138 #, c-format msgid "E684: list index out of range: %<PRId64>" msgstr "E684: Ð†Ð½Ð´ÐµÐºÑ ÑпиÑку поза межами: %<PRId64>" -#: ../eval.c:139 #, c-format msgid "E121: Undefined variable: %s" msgstr "E121: Ðевизначена змінна: %s" -#: ../eval.c:140 msgid "E111: Missing ']'" msgstr "E111: Бракує ']'" -#: ../eval.c:141 #, c-format msgid "E686: Argument of %s must be a List" msgstr "E686: Ðргумент у %s має бути ÑпиÑком" -#: ../eval.c:143 #, c-format msgid "E712: Argument of %s must be a List or Dictionary" msgstr "E712: Ðргумент у %s має бути ÑпиÑком чи Ñловником" -#: ../eval.c:144 msgid "E713: Cannot use empty key for Dictionary" msgstr "E713: Ключ Ñловника не може бути порожнім" # msgstr "E396: " -#: ../eval.c:145 msgid "E714: List required" msgstr "E714: Потрібен ÑпиÑок" -#: ../eval.c:146 msgid "E715: Dictionary required" msgstr "E715: Потрібен Ñловник" -#: ../eval.c:147 #, c-format msgid "E118: Too many arguments for function: %s" msgstr "E118: Забагато аргументів Ð´Ð»Ñ Ñ„ÑƒÐ½ÐºÑ†Ñ–Ñ—: %s" -#: ../eval.c:148 #, c-format msgid "E716: Key not present in Dictionary: %s" msgstr "E716: Ðемає такого ключа у Ñловнику: %s" -#: ../eval.c:150 #, c-format msgid "E122: Function %s already exists, add ! to replace it" msgstr "E122: Ð¤ÑƒÐ½ÐºÑ†Ñ–Ñ %s уже Ñ–Ñнує, ! щоб замінити" -#: ../eval.c:151 msgid "E717: Dictionary entry already exists" msgstr "E717: Ð—Ð°Ð¿Ð¸Ñ Ñƒ Ñловнику вже Ñ–Ñнує" -#: ../eval.c:152 msgid "E718: Funcref required" msgstr "E718: Треба поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð½Ð° функцію" -#: ../eval.c:153 msgid "E719: Cannot use [:] with a Dictionary" msgstr "E719: Ðе можна викориÑтати [:] зі Ñловником" -#: ../eval.c:154 #, c-format msgid "E734: Wrong variable type for %s=" msgstr "E734: Ðеправильний тип змінної Ð´Ð»Ñ %s=" -#: ../eval.c:155 #, c-format msgid "E130: Unknown function: %s" msgstr "E130: Ðевідома функціÑ: %s" -#: ../eval.c:156 #, c-format msgid "E461: Illegal variable name: %s" msgstr "E461: ÐеприпуÑтима назва змінної: %s" # msgstr "E373: " -#: ../eval.c:157 msgid "E806: using Float as a String" msgstr "E806: Float вжито Ñк String" -#: ../eval.c:1830 msgid "E687: Less targets than List items" msgstr "E687: Цілей менше, ніж елементів ÑпиÑку" -#: ../eval.c:1834 msgid "E688: More targets than List items" msgstr "E688: Цілей більше, ніж елементів ÑпиÑку" -#: ../eval.c:1906 msgid "Double ; in list of variables" msgstr "Друга ; у ÑпиÑку змінних" # msgstr "E235: " -#: ../eval.c:2078 #, c-format msgid "E738: Can't list variables for %s" msgstr "E738: Ðе можна перерахувати змінні у %s" -#: ../eval.c:2391 msgid "E689: Can only index a List or Dictionary" msgstr "E689: ІндекÑний доÑтуп може бути тільки до ÑпиÑку чи Ñловника" -#: ../eval.c:2396 msgid "E708: [:] must come last" msgstr "E708: [:] має бути оÑтанньою" -#: ../eval.c:2439 msgid "E709: [:] requires a List value" msgstr "E709: [:] вимагає ÑпиÑок" -#: ../eval.c:2674 msgid "E710: List value has more items than target" msgstr "E710: СпиÑок має більше елементів, ніж ціль" -#: ../eval.c:2678 msgid "E711: List value has not enough items" msgstr "E711: СпиÑок має недоÑтатньо елементів" -#: ../eval.c:2867 msgid "E690: Missing \"in\" after :for" msgstr "E690: Пропущено «in» піÑÐ»Ñ :for" -#: ../eval.c:3063 #, c-format msgid "E107: Missing parentheses: %s" msgstr "E107: Пропущено дужки: %s" -#: ../eval.c:3263 #, c-format msgid "E108: No such variable: \"%s\"" msgstr "E108: Змінної немає: «%s»" -#: ../eval.c:3333 msgid "E743: variable nested too deep for (un)lock" msgstr "E743: Змінна має забагато вкладень щоб бути за-/відкритою." -#: ../eval.c:3630 msgid "E109: Missing ':' after '?'" msgstr "E109: Бракує ':' піÑÐ»Ñ '?'" -#: ../eval.c:3893 msgid "E691: Can only compare List with List" msgstr "E691: СпиÑок можна порівнÑти тільки зі ÑпиÑком" -#: ../eval.c:3895 msgid "E692: Invalid operation for Lists" msgstr "E692: Ðекоректна Ð¾Ð¿ÐµÑ€Ð°Ñ†Ñ–Ñ Ð½Ð°Ð´ ÑпиÑком" -#: ../eval.c:3915 msgid "E735: Can only compare Dictionary with Dictionary" msgstr "E735: Словник можна порівнÑти тільки із Ñловником" -#: ../eval.c:3917 msgid "E736: Invalid operation for Dictionary" msgstr "E736: Ðекоректна Ð¾Ð¿ÐµÑ€Ð°Ñ†Ñ–Ñ Ð½Ð°Ð´ Ñловником" -#: ../eval.c:3932 msgid "E693: Can only compare Funcref with Funcref" msgstr "E693: Функцію можна порівнÑти тільки з функцією" -#: ../eval.c:3934 msgid "E694: Invalid operation for Funcrefs" msgstr "E694: Ðекоректна Ð¾Ð¿ÐµÑ€Ð°Ñ†Ñ–Ñ Ð½Ð°Ð´ функцією" -#: ../eval.c:4277 msgid "E804: Cannot use '%' with Float" msgstr "E804: Ðе можна виконати '%' над Float" -#: ../eval.c:4478 msgid "E110: Missing ')'" msgstr "E110: Пропущено ')'" -#: ../eval.c:4609 msgid "E695: Cannot index a Funcref" msgstr "E695: Ð¤ÑƒÐ½ÐºÑ†Ñ–Ñ Ð½Ðµ має індекÑації" -#: ../eval.c:4839 #, c-format msgid "E112: Option name missing: %s" msgstr "E112: Бракує назви опції: %s" -#: ../eval.c:4855 #, c-format msgid "E113: Unknown option: %s" msgstr "E113: Ðевідома опціÑ: %s" -#: ../eval.c:4904 #, c-format msgid "E114: Missing quote: %s" msgstr "E114: Бракує лапки: %s" -#: ../eval.c:5020 #, c-format msgid "E115: Missing quote: %s" msgstr "E115: Бракує лапки: %s" # msgstr "E404: " -#: ../eval.c:5084 #, c-format msgid "E696: Missing comma in List: %s" msgstr "E696: Бракує коми у ÑпиÑку: %s" -#: ../eval.c:5091 #, c-format msgid "E697: Missing end of List ']': %s" msgstr "E697: Ðемає кінцівки ÑпиÑку ']': %s" # msgstr "E235: " -#: ../eval.c:6475 #, c-format msgid "E720: Missing colon in Dictionary: %s" msgstr "E720: Бракує двокрапки у Ñловнику: %s" -#: ../eval.c:6499 #, c-format msgid "E721: Duplicate key in Dictionary: \"%s\"" msgstr "E721: ÐŸÐ¾Ð²Ñ‚Ð¾Ñ€ÐµÐ½Ð½Ñ ÐºÐ»ÑŽÑ‡Ð° в Ñловнику: «%s»" # msgstr "E235: " -#: ../eval.c:6517 #, c-format msgid "E722: Missing comma in Dictionary: %s" msgstr "E722: Бракує коми у Ñловнику: %s" -#: ../eval.c:6524 #, c-format msgid "E723: Missing end of Dictionary '}': %s" msgstr "E723: Ðемає кінцівки Ñловника '}': %s" # msgstr "E21: " -#: ../eval.c:6555 msgid "E724: variable nested too deep for displaying" msgstr "E724: У змінній забагато вкладень щоб Ñ—Ñ— показати" -#: ../eval.c:7188 #, c-format msgid "E740: Too many arguments for function %s" msgstr "E740: Забагато аргументів Ð´Ð»Ñ Ñ„ÑƒÐ½ÐºÑ†Ñ–Ñ— %s" -#: ../eval.c:7190 #, c-format msgid "E116: Invalid arguments for function %s" msgstr "E116: Ðеправильні аргументи функції %s" -#: ../eval.c:7377 #, c-format msgid "E117: Unknown function: %s" msgstr "E117: Ðевідома функціÑ: %s" -#: ../eval.c:7383 #, c-format msgid "E119: Not enough arguments for function: %s" msgstr "E119: Замало аргументів Ð´Ð»Ñ Ñ„ÑƒÐ½ÐºÑ†Ñ–Ñ— %s" -#: ../eval.c:7387 #, c-format msgid "E120: Using <SID> not in a script context: %s" msgstr "E120: <SID> викориÑтовуєтьÑÑ Ð½Ðµ у контекÑті Ñкрипту: %s" -#: ../eval.c:7391 #, c-format msgid "E725: Calling dict function without Dictionary: %s" msgstr "E725: Виклик dict-функції без Ñловника: %s" -#: ../eval.c:7453 msgid "E808: Number or Float required" msgstr "E808: Треба вказати Number чи Float" # msgstr "E14: " -#: ../eval.c:7503 msgid "add() argument" msgstr "аргумент add()" -#: ../eval.c:7907 msgid "E699: Too many arguments" msgstr "E699: Забагато аргументів" # msgstr "E327: " -#: ../eval.c:8073 msgid "E785: complete() can only be used in Insert mode" msgstr "E785: complete() можна вживати тільки в режимі вÑтавки" -#: ../eval.c:8156 msgid "&Ok" msgstr "&O:Гаразд" # msgstr "E226: " -#: ../eval.c:8676 #, c-format msgid "E737: Key already exists: %s" msgstr "E737: Ключ вже Ñ–Ñнує: %s" # msgstr "E14: " -#: ../eval.c:8692 msgid "extend() argument" msgstr "аргумент extend()" # msgstr "E14: " -#: ../eval.c:8915 msgid "map() argument" msgstr "аргумент map()" # msgstr "E14: " -#: ../eval.c:8916 msgid "filter() argument" msgstr "аргумент filter()" -#: ../eval.c:9229 #, c-format msgid "+-%s%3ld lines: " msgstr "+-%s%3ld Ñ€Ñдків: " -#: ../eval.c:9291 #, c-format msgid "E700: Unknown function: %s" msgstr "E700: Ðевідома функціÑ: %s" -#: ../eval.c:10729 msgid "called inputrestore() more often than inputsave()" msgstr "Виклики до inputrestore() чаÑтіше, ніж до inputsave()" # msgstr "E14: " -#: ../eval.c:10771 msgid "insert() argument" msgstr "аргумент insert()" # msgstr "E406: " -#: ../eval.c:10841 msgid "E786: Range not allowed" msgstr "E786: Інтервал не дозволено" # msgstr "E177: " -#: ../eval.c:11140 msgid "E701: Invalid type for len()" msgstr "E701: Ðекоректний тип Ð´Ð»Ñ len()" -#: ../eval.c:11980 msgid "E726: Stride is zero" msgstr "E726: Крок нульовий" -#: ../eval.c:11982 msgid "E727: Start past end" msgstr "E727: Початок за кінцем" -#: ../eval.c:12024 ../eval.c:15297 msgid "<empty>" msgstr "<нічого>" # msgstr "E14: " -#: ../eval.c:12282 msgid "remove() argument" msgstr "аргумент remove()" -#: ../eval.c:12466 msgid "E655: Too many symbolic links (cycle?)" msgstr "E655: Забагато Ñимвольних поÑилань (цикл?)" # msgstr "E14: " -#: ../eval.c:12593 msgid "reverse() argument" msgstr "аргумент reverse()" # msgstr "E14: " -#: ../eval.c:13721 msgid "sort() argument" msgstr "аргумент sort()" # msgstr "E14: " -#: ../eval.c:13721 -#, fuzzy msgid "uniq() argument" -msgstr "аргумент add()" +msgstr "аргумент uniq()" # msgstr "E364: " -#: ../eval.c:13776 msgid "E702: Sort compare function failed" msgstr "E702: Помилка у функції порівнÑннÑ" # msgstr "E364: " -#: ../eval.c:13806 -#, fuzzy msgid "E882: Uniq compare function failed" -msgstr "E702: Помилка у функції порівнÑннÑ" +msgstr "E882: Помилка у функції порівнÑÐ½Ð½Ñ uniq" -#: ../eval.c:14085 msgid "(Invalid)" msgstr "(Ðеможливо)" -#: ../eval.c:14590 msgid "E677: Error writing temp file" msgstr "E677: Ðе вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати тимчаÑовий файл" -#: ../eval.c:16159 msgid "E805: Using a Float as a Number" msgstr "E805: Float вжито Ñк Number" -#: ../eval.c:16162 msgid "E703: Using a Funcref as a Number" msgstr "E703: Funcref вжито Ñк Number" -#: ../eval.c:16170 msgid "E745: Using a List as a Number" msgstr "E745: List вжито Ñк Number" -#: ../eval.c:16173 msgid "E728: Using a Dictionary as a Number" msgstr "E728: Dictionary вжито Ñк Number" -#: ../eval.c:16259 msgid "E729: using Funcref as a String" msgstr "E729: Funcref вжито Ñк String" # msgstr "E373: " -#: ../eval.c:16262 msgid "E730: using List as a String" msgstr "E730: List вжито Ñк String" -#: ../eval.c:16265 msgid "E731: using Dictionary as a String" msgstr "E731: Dictionary вжито Ñк String" -#: ../eval.c:16619 #, c-format msgid "E706: Variable type mismatch for: %s" msgstr "E706: Ðеправильний тип змінної: %s" -#: ../eval.c:16705 #, c-format msgid "E795: Cannot delete variable %s" msgstr "E795: Ðе можна знищити змінну %s" -#: ../eval.c:16724 #, c-format msgid "E704: Funcref variable name must start with a capital: %s" msgstr "E704: Ðазва змінної Funcref має починатиÑÑ Ð· великої літери: %s" -#: ../eval.c:16732 #, c-format msgid "E705: Variable name conflicts with existing function: %s" msgstr "E705: Ðазва змінної Ñпівпадає з Ñ–Ñнуючою функцією: %s" -#: ../eval.c:16763 #, c-format msgid "E741: Value is locked: %s" msgstr "E741: Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð·Ð°Ñ…Ð¸Ñ‰ÐµÐ½Ðµ: %s" -#: ../eval.c:16764 ../eval.c:16769 ../message.c:1839 msgid "Unknown" msgstr "Ðевідомо" -#: ../eval.c:16768 #, c-format msgid "E742: Cannot change value of %s" msgstr "E742: Ðе можна змінити Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ %s" -#: ../eval.c:16838 msgid "E698: variable nested too deep for making a copy" msgstr "E698: Змінна вкладена занадто глибоко щоб зробити Ñ—Ñ— копію" -#: ../eval.c:17249 #, c-format msgid "E123: Undefined function: %s" msgstr "E123: Ðевизначена функціÑ: %s" -#: ../eval.c:17260 #, c-format msgid "E124: Missing '(': %s" msgstr "E124: Бракує '(': %s" -#: ../eval.c:17293 msgid "E862: Cannot use g: here" msgstr "E862: Тут не можна викориÑтати g:" -#: ../eval.c:17312 #, c-format msgid "E125: Illegal argument: %s" msgstr "E125: Ðедозволений аргумент: %s" -#: ../eval.c:17323 #, c-format msgid "E853: Duplicate argument name: %s" msgstr "E853: Ðазва аргументу повторюєтьÑÑ: %s" -#: ../eval.c:17416 msgid "E126: Missing :endfunction" msgstr "E126: Бракує :endfunction" -#: ../eval.c:17537 #, c-format msgid "E707: Function name conflicts with variable: %s" msgstr "E707: Ðазва функції Ñпівпадає зі змінною: %s" -#: ../eval.c:17549 #, c-format msgid "E127: Cannot redefine function %s: It is in use" msgstr "E127: Ðе вдалоÑÑ Ð¿ÐµÑ€ÐµÐ²Ð¸Ð·Ð½Ð°Ñ‡Ð¸Ñ‚Ð¸ функцію %s: вона викориÑтовуєтьÑÑ" -#: ../eval.c:17604 #, c-format msgid "E746: Function name does not match script file name: %s" msgstr "E746: Ðазва функції не збігаєтьÑÑ Ð· назвою файлу Ñкрипту: %s" -#: ../eval.c:17716 msgid "E129: Function name required" msgstr "E129: Ðе вказано назву функції" -#: ../eval.c:17824 -#, fuzzy, c-format +#, c-format msgid "E128: Function name must start with a capital or \"s:\": %s" msgstr "" -"E128: Ðазва функції має починатиÑÑ Ð· великої літери або міÑтити двокрапку: %s" +"E128: Ðазва функції має починатиÑÑ Ð· великої літери або \"s:\": %s" -#: ../eval.c:17833 -#, fuzzy, c-format +#, c-format msgid "E884: Function name cannot contain a colon: %s" msgstr "" -"E128: Ðазва функції має починатиÑÑ Ð· великої літери або міÑтити двокрапку: %s" +"E884: Ðазва функції не може міÑтити двокрапку: %s" -#: ../eval.c:18336 #, c-format msgid "E131: Cannot delete function %s: It is in use" msgstr "E131: Ðе вдалоÑÑ Ð·Ð½Ð¸Ñ‰Ð¸Ñ‚Ð¸ функцію %s: Вона викориÑтовуєтьÑÑ" -#: ../eval.c:18441 msgid "E132: Function call depth is higher than 'maxfuncdepth'" msgstr "E132: Глибина викликів функції перевищує 'maxfuncdepth'" -#: ../eval.c:18568 #, c-format msgid "calling %s" msgstr "викликаєтьÑÑ %s" -#: ../eval.c:18651 #, c-format msgid "%s aborted" msgstr "%s припинено" -#: ../eval.c:18653 #, c-format msgid "%s returning #%<PRId64>" msgstr "%s повертає #%<PRId64>" -#: ../eval.c:18670 #, c-format msgid "%s returning %s" msgstr "%s повертає %s" -#: ../eval.c:18691 ../ex_cmds2.c:2695 #, c-format msgid "continuing in %s" msgstr "Ð¿Ñ€Ð¾Ð´Ð¾Ð²Ð¶ÐµÐ½Ð½Ñ Ð² %s" -#: ../eval.c:18795 msgid "E133: :return not inside a function" msgstr "E133: :return поза межами функції" -#: ../eval.c:19159 msgid "" "\n" "# global variables:\n" @@ -1040,7 +814,6 @@ msgstr "" "\n" "# глобальні змінні:\n" -#: ../eval.c:19254 msgid "" "\n" "\tLast set from " @@ -1048,104 +821,82 @@ msgstr "" "\n" "\tВоÑтаннє змінена у " -#: ../eval.c:19272 msgid "No old files" msgstr "Жодного Ñтарого файлу" -#: ../ex_cmds.c:122 #, c-format msgid "<%s>%s%s %d, Hex %02x, Octal %03o" msgstr "<%s>%s%s %d, шіÑÑ‚ %02x, Ð²Ñ–Ñ %03o" -#: ../ex_cmds.c:145 #, c-format msgid "> %d, Hex %04x, Octal %o" msgstr "> %d, шіÑÑ‚ %04x, Ð²Ñ–Ñ %o" -#: ../ex_cmds.c:146 #, c-format msgid "> %d, Hex %08x, Octal %o" msgstr "> %d, шіÑÑ‚ %08x, Ð²Ñ–Ñ %o" -#: ../ex_cmds.c:684 msgid "E134: Move lines into themselves" msgstr "E134: Ðеможливо переміÑтити Ñ€Ñдки Ñамі в Ñебе" -#: ../ex_cmds.c:747 msgid "1 line moved" msgstr "Переміщено один Ñ€Ñдок" -#: ../ex_cmds.c:749 #, c-format msgid "%<PRId64> lines moved" msgstr "Переміщено %<PRId64> Ñ€Ñдки(ів)" -#: ../ex_cmds.c:1175 #, c-format msgid "%<PRId64> lines filtered" msgstr "Відфільтровано %<PRId64> Ñ€Ñдки(ів)" -#: ../ex_cmds.c:1194 msgid "E135: *Filter* Autocommands must not change current buffer" msgstr "E135: Ðвтокоманди *Filter* не повинні змінювати поточний буфер" -#: ../ex_cmds.c:1244 msgid "[No write since last change]\n" msgstr "[Зміни не запиÑано]\n" -#: ../ex_cmds.c:1424 #, c-format msgid "%sviminfo: %s in line: " msgstr "%sviminfo: %s в Ñ€Ñдку: " -#: ../ex_cmds.c:1431 msgid "E136: viminfo: Too many errors, skipping rest of file" msgstr "E136: viminfo: Забагато помилок, решта файлу буде пропущено" -#: ../ex_cmds.c:1458 #, c-format msgid "Reading viminfo file \"%s\"%s%s%s" msgstr "ЗчитуєтьÑÑ Ñ„Ð°Ð¹Ð» viminfo: «%s»%s%s%s" -#: ../ex_cmds.c:1460 msgid " info" msgstr " інформаціÑ" -#: ../ex_cmds.c:1461 msgid " marks" msgstr " позначки" -#: ../ex_cmds.c:1462 msgid " oldfiles" msgstr " Ñтарі файли" -#: ../ex_cmds.c:1463 msgid " FAILED" msgstr " ÐЕ ВДÐЛОСЯ" #. avoid a wait_return for this message, it's annoying -#: ../ex_cmds.c:1541 #, c-format msgid "E137: Viminfo file is not writable: %s" msgstr "E137: Ðе дозволено Ð·Ð°Ð¿Ð¸Ñ Ñƒ файл viminfo: %s" -#: ../ex_cmds.c:1626 #, c-format msgid "E138: Can't write viminfo file %s!" msgstr "E138: Ðе вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати файл viminfo %s!" -#: ../ex_cmds.c:1635 #, c-format msgid "Writing viminfo file \"%s\"" msgstr "ЗапиÑуєтьÑÑ Ñ„Ð°Ð¹Ð» viminfo «%s»" #. Write the info: -#: ../ex_cmds.c:1720 #, c-format msgid "# This viminfo file was generated by Vim %s.\n" msgstr "# Цей файл автоматично Ñтворений Vim %s.\n" -#: ../ex_cmds.c:1722 msgid "" "# You may edit it if you're careful!\n" "\n" @@ -1153,47 +904,37 @@ msgstr "" "# Можете редагувати, але ОБЕРЕЖÐО!\n" "\n" -#: ../ex_cmds.c:1723 msgid "# Value of 'encoding' when this file was written\n" msgstr "# Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ 'encoding' під Ñ‡Ð°Ñ ÑÑ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ Ñ†ÑŒÐ¾Ð³Ð¾ файлу\n" -#: ../ex_cmds.c:1800 msgid "Illegal starting char" msgstr "Ðедозволений Ñимвол на початку Ñ€Ñдка" -#: ../ex_cmds.c:2162 msgid "Write partial file?" msgstr "ЗапиÑати чаÑтину файлу?" -#: ../ex_cmds.c:2166 msgid "E140: Use ! to write partial buffer" msgstr "E140: ВикориÑтайте ! Ð´Ð»Ñ Ð·Ð°Ð¿Ð¸Ñу чаÑтини буфера" -#: ../ex_cmds.c:2281 #, c-format msgid "Overwrite existing file \"%s\"?" msgstr "ПерепиÑати Ñ–Ñнуючий файл «%s»?" -#: ../ex_cmds.c:2317 #, c-format msgid "Swap file \"%s\" exists, overwrite anyway?" msgstr "Файл обміну «%s» Ñ–Ñнує, перезапиÑати?" -#: ../ex_cmds.c:2326 #, c-format msgid "E768: Swap file exists: %s (:silent! overrides)" msgstr "E768: Файл обміну Ñ–Ñнує: %s (:silent! переважує)" -#: ../ex_cmds.c:2381 #, c-format msgid "E141: No file name for buffer %<PRId64>" msgstr "E141: Ðемає вхідного файлу Ð´Ð»Ñ Ð±ÑƒÑ„ÐµÑ€Ð° %<PRId64>" -#: ../ex_cmds.c:2412 msgid "E142: File not written: Writing is disabled by 'write' option" msgstr "E142: Файл не запиÑано: Ð·Ð°Ð¿Ð¸Ñ Ð·Ð°Ð±Ð¾Ñ€Ð¾Ð½ÐµÐ½Ð¾ опцією 'write'" -#: ../ex_cmds.c:2434 #, c-format msgid "" "'readonly' option is set for \"%s\".\n" @@ -1202,7 +943,6 @@ msgstr "" "Ð”Ð»Ñ Â«%s» вÑтановлено 'readonly'.\n" "Бажаєте вÑе одно продовжити запиÑ?" -#: ../ex_cmds.c:2439 #, c-format msgid "" "File permissions of \"%s\" are read-only.\n" @@ -1213,84 +953,66 @@ msgstr "" "Проте, можливо, його можна запиÑати.\n" "Хочете Ñпробувати?" -#: ../ex_cmds.c:2451 #, c-format msgid "E505: \"%s\" is read-only (add ! to override)" msgstr "E505: «%s» тільки Ð´Ð»Ñ Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ (! щоб не зважати)" -#: ../ex_cmds.c:3120 #, c-format msgid "E143: Autocommands unexpectedly deleted new buffer %s" msgstr "E143: Ðвтокоманди неÑподівано знищили новий буфер %s" -#: ../ex_cmds.c:3313 msgid "E144: non-numeric argument to :z" msgstr "E144: нечиÑловий аргумент Ð´Ð»Ñ :z" -#: ../ex_cmds.c:3404 msgid "E145: Shell commands not allowed in rvim" msgstr "E145: У rvim не дозволені команди оболонки" -#: ../ex_cmds.c:3498 msgid "E146: Regular expressions can't be delimited by letters" msgstr "E146: РегулÑрні вирази не можна розділÑти літерами" -#: ../ex_cmds.c:3964 #, c-format msgid "replace with %s (y/n/a/q/l/^E/^Y)?" msgstr "Замінити на %s (y/n/a/q/l/^E/^Y)?" -#: ../ex_cmds.c:4379 msgid "(Interrupted) " msgstr "(Перервано) " # msgstr "E31: " -#: ../ex_cmds.c:4384 msgid "1 match" msgstr "Один збіг" -#: ../ex_cmds.c:4384 msgid "1 substitution" msgstr "Одна заміна" -#: ../ex_cmds.c:4387 #, c-format msgid "%<PRId64> matches" msgstr "%<PRId64> збіги(ів)" -#: ../ex_cmds.c:4388 #, c-format msgid "%<PRId64> substitutions" msgstr "%<PRId64> замін(и)" -#: ../ex_cmds.c:4392 msgid " on 1 line" msgstr " в одному Ñ€Ñдку" -#: ../ex_cmds.c:4395 #, c-format msgid " on %<PRId64> lines" msgstr " в %<PRId64> Ñ€Ñдках" -#: ../ex_cmds.c:4438 msgid "E147: Cannot do :global recursive" msgstr "E147: :global не можна вживати рекурÑивно" -#: ../ex_cmds.c:4467 msgid "E148: Regular expression missing from global" msgstr "E148: У global бракує зразка" -#: ../ex_cmds.c:4508 #, c-format msgid "Pattern found in every line: %s" msgstr "Зразок знайдено у кожному Ñ€Ñдку: %s" -#: ../ex_cmds.c:4510 #, c-format msgid "Pattern not found: %s" msgstr "Зразок не знайдено: %s" -#: ../ex_cmds.c:4587 msgid "" "\n" "# Last Substitute String:\n" @@ -1300,338 +1022,265 @@ msgstr "" "# ОÑÑ‚Ð°Ð½Ð½Ñ Ð·Ð°Ð¼Ñ–Ð½Ð°:\n" "$" -#: ../ex_cmds.c:4679 msgid "E478: Don't panic!" msgstr "E478: Без паніки!" -#: ../ex_cmds.c:4717 #, c-format msgid "E661: Sorry, no '%s' help for %s" msgstr "E661: Вибачте, немає допомоги '%s' Ð´Ð»Ñ %s" -#: ../ex_cmds.c:4719 #, c-format msgid "E149: Sorry, no help for %s" msgstr "E149: Вибачте, немає допомоги Ð´Ð»Ñ %s" -#: ../ex_cmds.c:4751 #, c-format msgid "Sorry, help file \"%s\" not found" msgstr "Вибачте, файл допомоги «%s» не знайдено" -#: ../ex_cmds.c:5323 #, c-format msgid "E150: Not a directory: %s" msgstr "E150: Ðе Ñ” каталогом: %s" -#: ../ex_cmds.c:5446 #, c-format msgid "E152: Cannot open %s for writing" msgstr "E152: Ðе вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ %s Ð´Ð»Ñ Ð·Ð°Ð¿Ð¸Ñу" -#: ../ex_cmds.c:5471 #, c-format msgid "E153: Unable to open %s for reading" msgstr "E153: Ðе вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ %s Ð´Ð»Ñ Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ" -#: ../ex_cmds.c:5500 #, c-format msgid "E670: Mix of help file encodings within a language: %s" msgstr "E670: Мішанина кодувань файлу допомоги Ð´Ð»Ñ Ð¼Ð¾Ð²Ð¸ %s" -#: ../ex_cmds.c:5565 #, c-format msgid "E154: Duplicate tag \"%s\" in file %s/%s" msgstr "E154: ÐŸÐ¾Ð²Ñ‚Ð¾Ñ€ÐµÐ½Ð½Ñ Ñ‚ÐµÒ‘Ñƒ «%s» у файлі %s/%s" -#: ../ex_cmds.c:5687 #, c-format msgid "E160: Unknown sign command: %s" msgstr "E160: Ðевідома команда надпиÑу: %s" -#: ../ex_cmds.c:5704 msgid "E156: Missing sign name" msgstr "E156: Пропущено назву надпиÑу" -#: ../ex_cmds.c:5746 msgid "E612: Too many signs defined" msgstr "E612: Визначено забагато надпиÑів" -#: ../ex_cmds.c:5813 #, c-format msgid "E239: Invalid sign text: %s" msgstr "E239: Ðекоректний надпиÑ: %s" -#: ../ex_cmds.c:5844 ../ex_cmds.c:6035 #, c-format msgid "E155: Unknown sign: %s" msgstr "E155: Ðевідомий надпиÑ: %s" -#: ../ex_cmds.c:5877 msgid "E159: Missing sign number" msgstr "E159: Пропущено номер надпиÑу" -#: ../ex_cmds.c:5971 #, c-format msgid "E158: Invalid buffer name: %s" msgstr "E158: Ðекоректна назва буфера: %s" -#: ../ex_cmds.c:6008 #, c-format msgid "E157: Invalid sign ID: %<PRId64>" msgstr "E157: Ðеправильний ID надпиÑу: %<PRId64>" -#: ../ex_cmds.c:6066 msgid " (not supported)" msgstr " (не підтримуєтьÑÑ)" -#: ../ex_cmds.c:6169 msgid "[Deleted]" msgstr "[Знищено]" -#: ../ex_cmds2.c:139 msgid "Entering Debug mode. Type \"cont\" to continue." msgstr "Режим налагодженнÑ. Щоб продовжити введіть «cont»." -#: ../ex_cmds2.c:143 ../ex_docmd.c:759 #, c-format msgid "line %<PRId64>: %s" msgstr "Ñ€Ñдок %<PRId64>: %s" -#: ../ex_cmds2.c:145 #, c-format msgid "cmd: %s" msgstr "команда: %s" -#: ../ex_cmds2.c:322 #, c-format msgid "Breakpoint in \"%s%s\" line %<PRId64>" msgstr "Точка зупинки в «%s%s» Ñ€Ñдок %<PRId64>" -#: ../ex_cmds2.c:581 #, c-format msgid "E161: Breakpoint not found: %s" msgstr "E161: Точку зупинки не знайдено: %s" -#: ../ex_cmds2.c:611 msgid "No breakpoints defined" msgstr "Ðе визначено жодної точки зупинки" -#: ../ex_cmds2.c:617 #, c-format msgid "%3d %s %s line %<PRId64>" msgstr "%3d %s %s Ñ€Ñдок %<PRId64>" -#: ../ex_cmds2.c:942 msgid "E750: First use \":profile start {fname}\"" msgstr "E750: Спочатку зробіть «:profile start {файл}»" -#: ../ex_cmds2.c:1269 #, c-format msgid "Save changes to \"%s\"?" msgstr "Зберегти зміни в «%s»?" -#: ../ex_cmds2.c:1271 ../ex_docmd.c:8851 msgid "Untitled" msgstr "Ðеназваний" -#: ../ex_cmds2.c:1421 #, c-format msgid "E162: No write since last change for buffer \"%s\"" msgstr "E162: Буфер «%s» має незбережені зміни" -#: ../ex_cmds2.c:1480 msgid "Warning: Entered other buffer unexpectedly (check autocommands)" msgstr "" "Обережно: ÐеÑподівано опинилиÑÑ Ñƒ іншому буфері (перевірте автокоманди)" -#: ../ex_cmds2.c:1826 msgid "E163: There is only one file to edit" msgstr "E163: РедагуєтьÑÑ Ð»Ð¸ÑˆÐµ один файл" -#: ../ex_cmds2.c:1828 msgid "E164: Cannot go before first file" msgstr "E164: Це вже найперший файл" -#: ../ex_cmds2.c:1830 msgid "E165: Cannot go beyond last file" msgstr "E165: Це вже оÑтанній файл" -#: ../ex_cmds2.c:2175 #, c-format msgid "E666: compiler not supported: %s" msgstr "E666: КомпілÑтор не підтримуєтьÑÑ: %s" # msgstr "E195: " -#: ../ex_cmds2.c:2257 #, c-format msgid "Searching for \"%s\" in \"%s\"" msgstr "Пошук «%s» в «%s»" -#: ../ex_cmds2.c:2284 #, c-format msgid "Searching for \"%s\"" msgstr "Пошук «%s»" -#: ../ex_cmds2.c:2307 #, c-format msgid "not found in 'runtimepath': \"%s\"" msgstr "Ð’ 'runtimepath' не знайдено «%s»" -#: ../ex_cmds2.c:2472 #, c-format msgid "Cannot source a directory: \"%s\"" msgstr "Ðе вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ каталог: «%s»" -#: ../ex_cmds2.c:2518 #, c-format msgid "could not source \"%s\"" msgstr "Ðе вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ «%s»" -#: ../ex_cmds2.c:2520 #, c-format msgid "line %<PRId64>: could not source \"%s\"" msgstr "Ñ€Ñдок %<PRId64>: не вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ «%s»" -#: ../ex_cmds2.c:2535 #, c-format msgid "sourcing \"%s\"" msgstr "виконуєтьÑÑ Â«%s»" -#: ../ex_cmds2.c:2537 #, c-format msgid "line %<PRId64>: sourcing \"%s\"" msgstr "Ñ€Ñдок %<PRId64>: виконуєтьÑÑ Â«%s»" -#: ../ex_cmds2.c:2693 #, c-format msgid "finished sourcing %s" msgstr "закінчено Ð²Ð¸ÐºÐ¾Ð½Ð°Ð½Ð½Ñ %s" -#: ../ex_cmds2.c:2765 msgid "modeline" msgstr "modeline" # msgstr "E14: " -#: ../ex_cmds2.c:2767 msgid "--cmd argument" msgstr "--cmd аргумент" # msgstr "E14: " -#: ../ex_cmds2.c:2769 msgid "-c argument" msgstr "-c аргумент" -#: ../ex_cmds2.c:2771 msgid "environment variable" msgstr "змінна оточеннÑ" -#: ../ex_cmds2.c:2773 msgid "error handler" msgstr "обробник помилки" -#: ../ex_cmds2.c:3020 msgid "W15: Warning: Wrong line separator, ^M may be missing" msgstr "W15: ЗаÑтереженнÑ: Ðеправильний роздільник Ñ€Ñдків, можливо, бракує ^M" -#: ../ex_cmds2.c:3139 msgid "E167: :scriptencoding used outside of a sourced file" msgstr "E167: :scriptencoding викориÑтано поза виконуваним файлом" -#: ../ex_cmds2.c:3166 msgid "E168: :finish used outside of a sourced file" msgstr "E168: :finish викориÑтано поза виконуваним файлом" -#: ../ex_cmds2.c:3389 #, c-format msgid "Current %slanguage: \"%s\"" msgstr "Мова (%s): «%s»" -#: ../ex_cmds2.c:3404 #, c-format msgid "E197: Cannot set language to \"%s\"" msgstr "E197: Ðе вдалоÑÑ Ð²Ñтановити мову «%s»" #. don't redisplay the window #. don't wait for return -#: ../ex_docmd.c:387 msgid "Entering Ex mode. Type \"visual\" to go to Normal mode." msgstr "Режим Ex. Ð”Ð»Ñ Ð¿Ð¾Ð²ÐµÑ€Ð½ÐµÐ½Ð½Ñ Ð´Ð¾ нормального режиму виконайте «visual»" -#: ../ex_docmd.c:428 msgid "E501: At end-of-file" msgstr "E501: Кінець файлу" -#: ../ex_docmd.c:513 msgid "E169: Command too recursive" msgstr "E169: Команда занадто рекурÑивна" -#: ../ex_docmd.c:1006 #, c-format msgid "E605: Exception not caught: %s" msgstr "E605: ВинÑткова ÑÐ¸Ñ‚ÑƒÐ°Ñ†Ñ–Ñ Ð½Ðµ оброблена: %s" -#: ../ex_docmd.c:1085 msgid "End of sourced file" msgstr "Кінець виконуваного файлу" -#: ../ex_docmd.c:1086 msgid "End of function" msgstr "Кінець функції" -#: ../ex_docmd.c:1628 msgid "E464: Ambiguous use of user-defined command" msgstr "E464: Ðеоднозначний вжиток команди кориÑтувача" -#: ../ex_docmd.c:1638 msgid "E492: Not an editor command" msgstr "E492: Це не команда редактора" -#: ../ex_docmd.c:1729 msgid "E493: Backwards range given" msgstr "E493: Інтервал задано навиворіт" -#: ../ex_docmd.c:1733 msgid "Backwards range given, OK to swap" msgstr "Інтервал задано навиворіт, щоб помінÑти міÑцÑми — ГÐÐ ÐЗД" #. append #. typed wrong -#: ../ex_docmd.c:1787 msgid "E494: Use w or w>>" msgstr "E494: Спробуйте w або w>>" -#: ../ex_docmd.c:3454 msgid "E319: The command is not available in this version" msgstr "E319: Вибачте, цієї команди немає у цій верÑÑ–Ñ—" -#: ../ex_docmd.c:3752 msgid "E172: Only one file name allowed" msgstr "E172: Дозволено тільки одну назву файлу" -#: ../ex_docmd.c:4238 msgid "1 more file to edit. Quit anyway?" msgstr "ЗалишилоÑÑ Ð²Ñ–Ð´Ñ€ÐµÐ´Ð°Ð³ÑƒÐ²Ð°Ñ‚Ð¸ ще один файл. Ð’Ñе одно вийти?" -#: ../ex_docmd.c:4242 #, c-format msgid "%d more files to edit. Quit anyway?" msgstr "Ще Ñ” %d не редагованих файлів. Ð’Ñе одно вийти?" -#: ../ex_docmd.c:4248 msgid "E173: 1 more file to edit" msgstr "E173: ЗалишилоÑÑ Ð²Ñ–Ð´Ñ€ÐµÐ´Ð°Ð³ÑƒÐ²Ð°Ñ‚Ð¸ ще один файл" -#: ../ex_docmd.c:4250 #, c-format msgid "E173: %<PRId64> more files to edit" msgstr "E173: ЗалишилоÑÑ %<PRId64> не редагованих файлів" -#: ../ex_docmd.c:4320 msgid "E174: Command already exists: add ! to replace it" msgstr "E174: Команда вже Ñ–Ñнує, ! щоб замінити Ñ—Ñ—" -#: ../ex_docmd.c:4432 msgid "" "\n" " Name Args Range Complete Definition" @@ -1639,353 +1288,276 @@ msgstr "" "\n" " Ðазва Ðрг. Межа Ð”Ð¾Ð¿Ð¾Ð²Ð½ÐµÐ½Ð½Ñ Ð’Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ" -#: ../ex_docmd.c:4516 msgid "No user-defined commands found" msgstr "Ðе знайдено команд кориÑтувача" -#: ../ex_docmd.c:4538 msgid "E175: No attribute specified" msgstr "E175: Ðе вказано атрибутів" -#: ../ex_docmd.c:4583 msgid "E176: Invalid number of arguments" msgstr "E176: Ðеправильна кількіÑть аргументів" -#: ../ex_docmd.c:4594 msgid "E177: Count cannot be specified twice" msgstr "E177: Лічильник не може бути вказано двічі" # msgstr "E177: " -#: ../ex_docmd.c:4603 msgid "E178: Invalid default value for count" msgstr "E178: Ðеправильне початкове Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð»Ñ–Ñ‡Ð¸Ð»ÑŒÐ½Ð¸ÐºÐ°" # msgstr "E178: " -#: ../ex_docmd.c:4625 msgid "E179: argument required for -complete" msgstr "E179: Ð´Ð»Ñ -complete потрібний аргумент" # msgstr "E180: " -#: ../ex_docmd.c:4635 #, c-format msgid "E181: Invalid attribute: %s" msgstr "E181: Ðеправильний атрибут: %s" # msgstr "E181: " -#: ../ex_docmd.c:4678 msgid "E182: Invalid command name" msgstr "E182: Ðеправильна назва команди" # msgstr "E182: " -#: ../ex_docmd.c:4691 msgid "E183: User defined commands must start with an uppercase letter" msgstr "E183: Команди кориÑтувача повинні починатиÑÑ Ð· великої літери" -#: ../ex_docmd.c:4696 msgid "E841: Reserved name, cannot be used for user defined command" msgstr "" "E841: Зарезервована назва, не можна викориÑтати Ð´Ð»Ñ ÐºÐ¾Ñ€Ð¸Ñтувацької команди" # msgstr "E183: " -#: ../ex_docmd.c:4751 #, c-format msgid "E184: No such user-defined command: %s" msgstr "E184: Команду кориÑтувача не знайдено: %s" # msgstr "E179: " -#: ../ex_docmd.c:5219 #, c-format msgid "E180: Invalid complete value: %s" msgstr "E180: Ðеправильне доповненнÑ: %s" -#: ../ex_docmd.c:5225 msgid "E468: Completion argument only allowed for custom completion" msgstr "E468: Ðргумент дозволений тільки Ð´Ð»Ñ ÐºÐ¾Ñ€Ð¸Ñтувацького доповненнÑ" -#: ../ex_docmd.c:5231 msgid "E467: Custom completion requires a function argument" msgstr "E467: КориÑтувацьке Ð´Ð¾Ð¿Ð¾Ð²Ð½ÐµÐ½Ð½Ñ Ð²Ð¸Ð¼Ð°Ð³Ð°Ñ” аргумент-функцію" # msgstr "E184: " -#: ../ex_docmd.c:5257 #, c-format msgid "E185: Cannot find color scheme '%s'" msgstr "E185: Ðе вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ Ñхему кольорів «%s»" -#: ../ex_docmd.c:5263 msgid "Greetings, Vim user!" msgstr "ВітаннÑ, кориÑтувачу Vim!" # msgstr "E443: " -#: ../ex_docmd.c:5431 msgid "E784: Cannot close last tab page" msgstr "E784: Ðе можна закрити оÑтанню вкладку" # msgstr "E444: " -#: ../ex_docmd.c:5462 msgid "Already only one tab page" msgstr "Вже й так лише одна вкладка" -#: ../ex_docmd.c:6004 #, c-format msgid "Tab page %d" msgstr "Вкладка %d" -#: ../ex_docmd.c:6295 msgid "No swap file" msgstr "Ðемає файлу обміну" -#: ../ex_docmd.c:6478 msgid "E747: Cannot change directory, buffer is modified (add ! to override)" msgstr "E747: Ðе вдалоÑÑ Ð·Ð¼Ñ–Ð½Ð¸Ñ‚Ð¸ каталог, буфер має зміни (! щоб не зважати)" -#: ../ex_docmd.c:6485 msgid "E186: No previous directory" msgstr "E186: Це вже найперший каталог" # msgstr "E186: " -#: ../ex_docmd.c:6530 msgid "E187: Unknown" msgstr "E187: Ðевідомо" -#: ../ex_docmd.c:6610 msgid "E465: :winsize requires two number arguments" msgstr "E465: :winsize вимагає два чиÑлових аргументи" -#: ../ex_docmd.c:6655 msgid "E188: Obtaining window position not implemented for this platform" msgstr "E188: Ðе можна отримати позицію вікна на цій платформі" -#: ../ex_docmd.c:6662 msgid "E466: :winpos requires two number arguments" msgstr "E466: :winpos вимагає два чиÑлових аргументи" -#: ../ex_docmd.c:7241 #, c-format msgid "E739: Cannot create directory: %s" msgstr "E739: Ðе вдалоÑÑ Ñтворити каталог: %s" -#: ../ex_docmd.c:7268 #, c-format msgid "E189: \"%s\" exists (add ! to override)" msgstr "E189: Файл «%s» Ñ–Ñнує (! щоб не зважати)" # msgstr "E189: " -#: ../ex_docmd.c:7273 #, c-format msgid "E190: Cannot open \"%s\" for writing" msgstr "E190: Ðе вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ «%s» Ð´Ð»Ñ Ð·Ð°Ð¿Ð¸Ñу" # msgstr "E190: " #. set mark -#: ../ex_docmd.c:7294 msgid "E191: Argument must be a letter or forward/backward quote" msgstr "E191: Ðргумент має бути літерою, ` або '" # msgstr "E191: " -#: ../ex_docmd.c:7333 msgid "E192: Recursive use of :normal too deep" msgstr "E192: Забагато вкладених :normal" # msgstr "E193: " -#: ../ex_docmd.c:7807 msgid "E194: No alternate file name to substitute for '#'" msgstr "E194: Ðемає назви вторинного файлу Ð´Ð»Ñ Ð·Ð°Ð¼Ñ–Ð½Ð¸ '#'" -#: ../ex_docmd.c:7841 msgid "E495: no autocommand file name to substitute for \"<afile>\"" msgstr "E495: Ðемає назви файлу автокоманди Ð´Ð»Ñ Ð·Ð°Ð¼Ñ–Ð½Ð¸ «<afile>»" -#: ../ex_docmd.c:7850 msgid "E496: no autocommand buffer number to substitute for \"<abuf>\"" msgstr "E496: Ðемає номера буфера автокоманди Ð´Ð»Ñ Ð·Ð°Ð¼Ñ–Ð½Ð¸ «<abuf>»" -#: ../ex_docmd.c:7861 msgid "E497: no autocommand match name to substitute for \"<amatch>\"" msgstr "E497: Ðемає назви збігу автокоманди Ð´Ð»Ñ Ð·Ð°Ð¼Ñ–Ð½Ð¸ «<amatch>»" -#: ../ex_docmd.c:7870 msgid "E498: no :source file name to substitute for \"<sfile>\"" msgstr "E498: Ðемає назви файлу :source Ð´Ð»Ñ Ð·Ð°Ð¼Ñ–Ð½Ð¸ «<sfile>»" -#: ../ex_docmd.c:7876 msgid "E842: no line number to use for \"<slnum>\"" msgstr "E842: немає номера Ñ€Ñдка, щоб викориÑтати з «<sfile>»" -#: ../ex_docmd.c:7903 -#, fuzzy, c-format +#, c-format msgid "E499: Empty file name for '%' or '#', only works with \":p:h\"" msgstr "E499: Ðазва файлу Ð´Ð»Ñ '%' чи '#' порожнÑ, працює лише з «:p:h»" -#: ../ex_docmd.c:7905 msgid "E500: Evaluates to an empty string" msgstr "E500: Результат — порожній Ñ€Ñдок" -#: ../ex_docmd.c:8838 msgid "E195: Cannot open viminfo file for reading" msgstr "E195: Ðе вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ файл viminfo" -#: ../ex_eval.c:464 msgid "E608: Cannot :throw exceptions with 'Vim' prefix" msgstr "E608: Ðе можна викидати (:throw) винÑтки з префікÑом 'Vim'" #. always scroll up, don't overwrite -#: ../ex_eval.c:496 #, c-format msgid "Exception thrown: %s" msgstr "ВинÑткова ÑитуаціÑ: %s" -#: ../ex_eval.c:545 #, c-format msgid "Exception finished: %s" msgstr "ВинÑток закінчено: %s" -#: ../ex_eval.c:546 #, c-format msgid "Exception discarded: %s" msgstr "ВинÑток Ñкинуто: %s" -#: ../ex_eval.c:588 ../ex_eval.c:634 #, c-format msgid "%s, line %<PRId64>" msgstr "%s, Ñ€Ñдок %<PRId64>" #. always scroll up, don't overwrite -#: ../ex_eval.c:608 #, c-format msgid "Exception caught: %s" msgstr "Спіймано винÑткову Ñитуацію: %s" -#: ../ex_eval.c:676 #, c-format msgid "%s made pending" msgstr "ОчікуєтьÑÑ %s" -#: ../ex_eval.c:679 #, c-format msgid "%s resumed" msgstr "Відновлено %s" -#: ../ex_eval.c:683 #, c-format msgid "%s discarded" msgstr "Скинуто %s" -#: ../ex_eval.c:708 msgid "Exception" msgstr "ВинÑток" -#: ../ex_eval.c:713 msgid "Error and interrupt" msgstr "Помилка, перервано" # msgstr "E231: " -#: ../ex_eval.c:715 msgid "Error" msgstr "Помилка" #. if (pending & CSTP_INTERRUPT) -#: ../ex_eval.c:717 msgid "Interrupt" msgstr "Перервано" -#: ../ex_eval.c:795 msgid "E579: :if nesting too deep" msgstr "E579: Занадто багато вкладених :if" -#: ../ex_eval.c:830 msgid "E580: :endif without :if" msgstr "E580: :endif без :if" -#: ../ex_eval.c:873 msgid "E581: :else without :if" msgstr "E581: :else без :if" -#: ../ex_eval.c:876 msgid "E582: :elseif without :if" msgstr "E582: :elseif без :if" -#: ../ex_eval.c:880 msgid "E583: multiple :else" msgstr "E583: Ðе одне :else" -#: ../ex_eval.c:883 msgid "E584: :elseif after :else" msgstr "E584: :elseif піÑÐ»Ñ :else" -#: ../ex_eval.c:941 msgid "E585: :while/:for nesting too deep" msgstr "E585: Забагато вкладених :while/:for" -#: ../ex_eval.c:1028 msgid "E586: :continue without :while or :for" msgstr "E586: :continue без :while чи :for" -#: ../ex_eval.c:1061 msgid "E587: :break without :while or :for" msgstr "E587: :break без :while чи :for" -#: ../ex_eval.c:1102 msgid "E732: Using :endfor with :while" msgstr "E732: Вжито :endfor із :while" -#: ../ex_eval.c:1104 msgid "E733: Using :endwhile with :for" msgstr "E733: Вжито :endwhile із :for" -#: ../ex_eval.c:1247 msgid "E601: :try nesting too deep" msgstr "E601: Забагато вкладених :try" -#: ../ex_eval.c:1317 msgid "E603: :catch without :try" msgstr "E603: :catch без :try" #. Give up for a ":catch" after ":finally" and ignore it. #. * Just parse. -#: ../ex_eval.c:1332 msgid "E604: :catch after :finally" msgstr "E604: :catch піÑÐ»Ñ :finally" -#: ../ex_eval.c:1451 msgid "E606: :finally without :try" msgstr "E606: :finally без :try" #. Give up for a multiple ":finally" and ignore it. -#: ../ex_eval.c:1467 msgid "E607: multiple :finally" msgstr "E607: Ðе одне :finally" -#: ../ex_eval.c:1571 msgid "E602: :endtry without :try" msgstr "E602: :entry без :try" -#: ../ex_eval.c:2026 msgid "E193: :endfunction not inside a function" msgstr "E193: :endfunction поза межами функції" -#: ../ex_getln.c:1643 msgid "E788: Not allowed to edit another buffer now" msgstr "E788: Зараз не можна редагувати інший буфер" -#: ../ex_getln.c:1656 msgid "E811: Not allowed to change buffer information now" msgstr "E811: Зараз не можна змінювати інформацію буфера" # msgstr "E197: " -#: ../ex_getln.c:3178 msgid "tagname" msgstr "назва теґу" -#: ../ex_getln.c:3181 msgid " kind file\n" msgstr " тип файлу\n" -#: ../ex_getln.c:4799 msgid "'history' option is zero" msgstr "ÐžÐ¿Ñ†Ñ–Ñ 'history' порожнÑ" -#: ../ex_getln.c:5046 #, c-format msgid "" "\n" @@ -1994,35 +1566,27 @@ msgstr "" "\n" "# Попередні %s (від найновіших):\n" -#: ../ex_getln.c:5047 msgid "Command Line" msgstr "команди" -#: ../ex_getln.c:5048 msgid "Search String" msgstr "шукані Ñ€Ñдки" -#: ../ex_getln.c:5049 msgid "Expression" msgstr "вирази" -#: ../ex_getln.c:5050 msgid "Input Line" msgstr "введені Ñ€Ñдки" -#: ../ex_getln.c:5117 msgid "E198: cmd_pchar beyond the command length" msgstr "E198: cmd_pchar поза межами команди" -#: ../ex_getln.c:5279 msgid "E199: Active window or buffer deleted" msgstr "E199: Ðктивне вікно або буфер було знищено" -#: ../file_search.c:203 msgid "E854: path too long for completion" msgstr "E854: шлÑÑ… занадто довгий Ð´Ð»Ñ Ð´Ð¾Ð¿Ð¾Ð²Ð½ÐµÐ½Ð½Ñ" -#: ../file_search.c:446 #, c-format msgid "" "E343: Invalid path: '**[number]' must be at the end of the path or be " @@ -2032,217 +1596,169 @@ msgstr "" "'%s'." # msgstr "E343: " -#: ../file_search.c:1505 #, c-format msgid "E344: Can't find directory \"%s\" in cdpath" msgstr "E344: Ðе вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ каталог «%s» у cdpath" # msgstr "E344: " -#: ../file_search.c:1508 #, c-format msgid "E345: Can't find file \"%s\" in path" msgstr "E345: Ðе вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ файл «%s» у path" # msgstr "E345: " -#: ../file_search.c:1512 #, c-format msgid "E346: No more directory \"%s\" found in cdpath" msgstr "E346: У cdpath немає більше каталогу «%s»" # msgstr "E346: " -#: ../file_search.c:1515 #, c-format msgid "E347: No more file \"%s\" found in path" msgstr "E347: У шлÑху пошуку більше немає файлів «%s»" -#: ../fileio.c:137 msgid "E812: Autocommands changed buffer or buffer name" msgstr "E812: Ðвтокоманди змінили буфер чи його назву" # msgstr "E199: " -#: ../fileio.c:368 msgid "Illegal file name" msgstr "Ðедозволена назва файлу" -#: ../fileio.c:395 ../fileio.c:476 ../fileio.c:2543 ../fileio.c:2578 msgid "is a directory" msgstr "каталог" -#: ../fileio.c:397 msgid "is not a file" msgstr "не файл" -#: ../fileio.c:508 ../fileio.c:3522 msgid "[New File]" msgstr "[Ðовий файл]" -#: ../fileio.c:511 msgid "[New DIRECTORY]" msgstr "[Ðовий каталог]" -#: ../fileio.c:529 ../fileio.c:532 msgid "[File too big]" msgstr "[Файл завеликий]" -#: ../fileio.c:534 msgid "[Permission Denied]" msgstr "[Відмовлено]" -#: ../fileio.c:653 msgid "E200: *ReadPre autocommands made the file unreadable" msgstr "E200: Ðвтокоманди *ReadPre унеможливили Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ Ñ„Ð°Ð¹Ð»Ñƒ" # msgstr "E200: " -#: ../fileio.c:655 msgid "E201: *ReadPre autocommands must not change current buffer" msgstr "E201: Ðвтокоманди *ReadPre не повинні змінювати цей буфер" # msgstr "E201: " -#: ../fileio.c:672 msgid "Nvim: Reading from stdin...\n" msgstr "Vim: ЧитаєтьÑÑ Ð· stdin...\n" #. Re-opening the original file failed! -#: ../fileio.c:909 msgid "E202: Conversion made file unreadable!" msgstr "E202: ÐšÐ¾Ð½Ð²ÐµÑ€Ñ‚Ð°Ñ†Ñ–Ñ ÑƒÐ½ÐµÐ¼Ð¾Ð¶Ð»Ð¸Ð²Ð¸Ð»Ð° Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ Ñ„Ð°Ð¹Ð»Ñƒ!" # msgstr "E202: " #. fifo or socket -#: ../fileio.c:1782 msgid "[fifo/socket]" msgstr "[канал/Ñокет]" #. fifo -#: ../fileio.c:1788 msgid "[fifo]" msgstr "[канал]" #. or socket -#: ../fileio.c:1794 msgid "[socket]" msgstr "[Ñокет]" #. or character special -#: ../fileio.c:1801 msgid "[character special]" msgstr "[Ñпец. Ñимвольний]" -#: ../fileio.c:1815 msgid "[CR missing]" msgstr "[Бракує CR]" -#: ../fileio.c:1819 msgid "[long lines split]" msgstr "[Розбито довгі Ñ€Ñдки]" -#: ../fileio.c:1823 ../fileio.c:3512 msgid "[NOT converted]" msgstr "[ÐЕ конвертовано]" -#: ../fileio.c:1826 ../fileio.c:3515 msgid "[converted]" msgstr "[конвертовано]" -#: ../fileio.c:1831 #, c-format msgid "[CONVERSION ERROR in line %<PRId64>]" msgstr "[ПОМИЛКРКОÐВЕРТÐЦІЇ у Ñ€Ñдку %<PRId64>]" -#: ../fileio.c:1835 #, c-format msgid "[ILLEGAL BYTE in line %<PRId64>]" msgstr "[ÐЕКОРЕКТÐИЙ БÐЙТ у Ñ€Ñдку %<PRId64>]" -#: ../fileio.c:1838 msgid "[READ ERRORS]" msgstr "[ПОМИЛКРЧИТÐÐÐЯ]" -#: ../fileio.c:2104 msgid "Can't find temp file for conversion" msgstr "Ðе вдалоÑÑ Ð¿Ñ–Ð´ÑˆÑƒÐºÐ°Ñ‚Ð¸ тимчаÑовий файл Ð´Ð»Ñ ÐºÐ¾Ð½Ð²ÐµÑ€Ñ‚Ð°Ñ†Ñ–Ñ—" -#: ../fileio.c:2110 msgid "Conversion with 'charconvert' failed" msgstr "ÐšÐ¾Ð½Ð²ÐµÑ€Ñ‚Ð°Ñ†Ñ–Ñ Ð· 'charconvert' не вдалаÑÑ" -#: ../fileio.c:2113 msgid "can't read output of 'charconvert'" msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ вивід 'charconvert'" # msgstr "E217: " -#: ../fileio.c:2437 msgid "E676: No matching autocommands for acwrite buffer" msgstr "E676: Ðемає відповідних автокоманд" -#: ../fileio.c:2466 msgid "E203: Autocommands deleted or unloaded buffer to be written" msgstr "E203: Ðвтокоманда знищила або вивантажила буфер, що мав бути запиÑаний" -#: ../fileio.c:2486 msgid "E204: Autocommand changed number of lines in unexpected way" msgstr "E204: Ðвтокоманда неÑподіваним чином змінила кількіÑть Ñ€Ñдків" -#: ../fileio.c:2548 ../fileio.c:2565 msgid "is not a file or writable device" msgstr "Ðе придатний Ð´Ð»Ñ Ð·Ð°Ð¿Ð¸Ñу" -#: ../fileio.c:2601 msgid "is read-only (add ! to override)" msgstr "лише Ð´Ð»Ñ Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ (! щоб не зважати)" -#: ../fileio.c:2886 msgid "E506: Can't write to backup file (add ! to override)" msgstr "E506: Ðе вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати резервний файл (! щоб не зважати)" -#: ../fileio.c:2898 msgid "E507: Close error for backup file (add ! to override)" msgstr "E507: Помилка Ð·Ð°ÐºÑ€Ð¸Ñ‚Ñ‚Ñ Ñ€ÐµÐ·ÐµÑ€Ð²Ð½Ð¾Ð³Ð¾ файлу (! щоб не зважати)" -#: ../fileio.c:2901 msgid "E508: Can't read file for backup (add ! to override)" msgstr "" "E508: Ðе вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ файл щоб Ñтворити резервну копію (! щоб не " "зважати)" -#: ../fileio.c:2923 msgid "E509: Cannot create backup file (add ! to override)" msgstr "E509: Ðе вдалоÑÑ Ñтворити резервну копію (! щоб не зважати)" -#: ../fileio.c:3008 msgid "E510: Can't make backup file (add ! to override)" msgstr "E510: Ðе вдалоÑÑ Ð·Ñ€Ð¾Ð±Ð¸Ñ‚Ð¸ резервну копію (! щоб не зважати)" #. Can't write without a tempfile! -#: ../fileio.c:3121 msgid "E214: Can't find temp file for writing" msgstr "E214: Ðе вдалоÑÑ Ð¿Ñ–Ð´ÑˆÑƒÐºÐ°Ñ‚Ð¸ тимчаÑовий файл Ð´Ð»Ñ Ð·Ð°Ð¿Ð¸Ñу" -#: ../fileio.c:3134 msgid "E213: Cannot convert (add ! to write without conversion)" msgstr "E213: Ðе вдалоÑÑ Ð¿ÐµÑ€ÐµÑ‚Ð²Ð¾Ñ€Ð¸Ñ‚Ð¸ (! щоб запиÑати без конвертації)" -#: ../fileio.c:3169 msgid "E166: Can't open linked file for writing" msgstr "E166: Ðе вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ Ð´Ð»Ñ Ð·Ð°Ð¿Ð¸Ñу зв'Ñзаний файл" -#: ../fileio.c:3173 msgid "E212: Can't open file for writing" msgstr "E212: Ðе вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ файл Ð´Ð»Ñ Ð·Ð°Ð¿Ð¸Ñу" -#: ../fileio.c:3363 msgid "E667: Fsync failed" msgstr "E667: Ðе вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ fsync" -#: ../fileio.c:3398 msgid "E512: Close failed" msgstr "E512: Ðе вдалоÑÑ Ð·Ð°ÐºÑ€Ð¸Ñ‚Ð¸" -#: ../fileio.c:3436 msgid "E513: write error, conversion failed (make 'fenc' empty to override)" msgstr "E513: Помилка запиÑу, ÐºÐ¾Ð½Ð²ÐµÑ€Ñ‚Ð°Ñ†Ñ–Ñ Ð½Ðµ вдалаÑÑ (Ñкиньте 'fenc')" -#: ../fileio.c:3441 #, c-format msgid "" "E513: write error, conversion failed in line %<PRId64> (make 'fenc' empty to " @@ -2251,56 +1767,43 @@ msgstr "" "E513: Помилка запиÑу, ÐºÐ¾Ð½Ð²ÐµÑ€Ñ‚Ð°Ñ†Ñ–Ñ Ð½Ðµ вдалаÑÑ Ñƒ Ñ€Ñдку %<PRId64> (Ñкиньте " "'fenc')" -#: ../fileio.c:3448 msgid "E514: write error (file system full?)" msgstr "E514: Помилка запиÑу (ÑкінчилоÑÑŒ вільне міÑце?)" -#: ../fileio.c:3506 msgid " CONVERSION ERROR" msgstr " ПОМИЛКРКОÐВЕРТÐЦІЇ" -#: ../fileio.c:3509 #, c-format msgid " in line %<PRId64>;" msgstr " у Ñ€Ñдку %<PRId64>;" -#: ../fileio.c:3519 msgid "[Device]" msgstr "[ПриÑтрій]" -#: ../fileio.c:3522 msgid "[New]" msgstr "[Ðовий]" -#: ../fileio.c:3535 msgid " [a]" msgstr "[д]" -#: ../fileio.c:3535 msgid " appended" msgstr " допиÑаний" -#: ../fileio.c:3537 msgid " [w]" msgstr "[з]" -#: ../fileio.c:3537 msgid " written" msgstr " запиÑаний" -#: ../fileio.c:3579 msgid "E205: Patchmode: can't save original file" msgstr "E205: ЛатаннÑ: не вдалоÑÑ Ð·Ð±ÐµÑ€ÐµÐ³Ñ‚Ð¸ оригінал" -#: ../fileio.c:3602 msgid "E206: patchmode: can't touch empty original file" msgstr "E206: ЛатаннÑ: не вдалоÑÑ Ñтворити оригінал" -#: ../fileio.c:3616 msgid "E207: Can't delete backup file" msgstr "E207: Ðе вдалоÑÑ Ð·Ð½Ð¸Ñ‰Ð¸Ñ‚Ð¸ резервний файл" -#: ../fileio.c:3672 msgid "" "\n" "WARNING: Original file may be lost or damaged\n" @@ -2308,134 +1811,105 @@ msgstr "" "\n" "ЗÐСТЕРЕЖЕÐÐЯ: Оригінал, мабуть, втрачений чи пошкоджений\n" -#: ../fileio.c:3675 msgid "don't quit the editor until the file is successfully written!" msgstr "Ðе виходьте з редактора, доки файл не запиÑано!" -#: ../fileio.c:3795 msgid "[dos]" msgstr "[dos]" -#: ../fileio.c:3795 msgid "[dos format]" msgstr "[формат dos]" -#: ../fileio.c:3801 msgid "[mac]" msgstr "[mac]" -#: ../fileio.c:3801 msgid "[mac format]" msgstr "[формат mac]" -#: ../fileio.c:3807 msgid "[unix]" msgstr "[unix]" -#: ../fileio.c:3807 msgid "[unix format]" msgstr "[формат unix]" -#: ../fileio.c:3831 msgid "1 line, " msgstr "один Ñ€Ñдок, " -#: ../fileio.c:3833 #, c-format msgid "%<PRId64> lines, " msgstr "%<PRId64> Ñ€Ñдків, " -#: ../fileio.c:3836 msgid "1 character" msgstr "один Ñимвол" -#: ../fileio.c:3838 #, c-format msgid "%<PRId64> characters" msgstr "%<PRId64> Ñимволів" -#: ../fileio.c:3849 msgid "[noeol]" msgstr "[noeol]" -#: ../fileio.c:3849 msgid "[Incomplete last line]" msgstr "[Ðеповний оÑтанній Ñ€Ñдок]" #. don't overwrite messages here #. must give this prompt #. don't use emsg() here, don't want to flush the buffers -#: ../fileio.c:3865 msgid "WARNING: The file has been changed since reading it!!!" msgstr "ЗÐСТЕРЕЖЕÐÐЯ: Файл змінивÑÑ Ð· чаÑу оÑтаннього читаннÑ!!!" -#: ../fileio.c:3867 msgid "Do you really want to write to it" msgstr "Ви Ñправді хочете його перепиÑати??" -#: ../fileio.c:4648 #, c-format msgid "E208: Error writing to \"%s\"" msgstr "E208: Помилка запиÑу у «%s»" -#: ../fileio.c:4655 #, c-format msgid "E209: Error closing \"%s\"" msgstr "E209: Помилка Ð·Ð°ÐºÑ€Ð¸Ñ‚Ñ‚Ñ Â«%s»" -#: ../fileio.c:4657 #, c-format msgid "E210: Error reading \"%s\"" msgstr "E210: Помилка Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ Â«%s»" -#: ../fileio.c:4883 msgid "E246: FileChangedShell autocommand deleted buffer" msgstr "E246: Ðвтокоманда FileChangedShell знищила буфер" -#: ../fileio.c:4894 #, c-format msgid "E211: File \"%s\" no longer available" msgstr "E211: Файл «%s» більше не доÑÑжний" -#: ../fileio.c:4906 #, c-format msgid "" "W12: Warning: File \"%s\" has changed and the buffer was changed in Vim as " "well" msgstr "W12: ЗаÑтереженнÑ: Файл «%s» змінивÑÑ, але й буфер у Vim також" -#: ../fileio.c:4907 msgid "See \":help W12\" for more info." msgstr "Див. «:help W12» Ð´Ð»Ñ ÑƒÑ‚Ð¾Ñ‡Ð½ÐµÐ½Ð½Ñ." -#: ../fileio.c:4910 #, c-format msgid "W11: Warning: File \"%s\" has changed since editing started" msgstr "W11: ЗаÑтереженнÑ: Файл «%s» змінивÑÑ Ð¿Ñ–ÑÐ»Ñ Ð¿Ð¾Ñ‡Ð°Ñ‚ÐºÑƒ редагуваннÑ" -#: ../fileio.c:4911 msgid "See \":help W11\" for more info." msgstr "Див. «:help W11» Ð´Ð»Ñ ÑƒÑ‚Ð¾Ñ‡Ð½ÐµÐ½Ð½Ñ." -#: ../fileio.c:4914 #, c-format msgid "W16: Warning: Mode of file \"%s\" has changed since editing started" msgstr "W16: ЗаÑтереженнÑ: Режим файлу «%s» змінивÑÑ Ð¿Ñ–ÑÐ»Ñ Ð¿Ð¾Ñ‡Ð°Ñ‚ÐºÑƒ редагуваннÑ" -#: ../fileio.c:4915 msgid "See \":help W16\" for more info." msgstr "Див. «:help W16» Ð´Ð»Ñ ÑƒÑ‚Ð¾Ñ‡Ð½ÐµÐ½Ð½Ñ." -#: ../fileio.c:4927 #, c-format msgid "W13: Warning: File \"%s\" has been created after editing started" msgstr "W13: ЗаÑтереженнÑ: Файл «%s» було Ñтворено піÑÐ»Ñ Ð¿Ð¾Ñ‡Ð°Ñ‚ÐºÑƒ редагуваннÑ" -#: ../fileio.c:4947 msgid "Warning" msgstr "ЗаÑтереженнÑ" -#: ../fileio.c:4948 msgid "" "&OK\n" "&Load File" @@ -2443,51 +1917,42 @@ msgstr "" "&O:Гаразд\n" "&L:Завантажити" -#: ../fileio.c:5065 #, c-format msgid "E462: Could not prepare for reloading \"%s\"" msgstr "E462: Ðе вдалоÑÑ Ð¿Ñ–Ð´Ð³Ð¾Ñ‚ÑƒÐ²Ð°Ñ‚Ð¸ «%s», щоб перечитати" -#: ../fileio.c:5078 #, c-format msgid "E321: Could not reload \"%s\"" msgstr "E321: Ðе вдалоÑÑ Ð¿ÐµÑ€ÐµÑ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ «%s»" -#: ../fileio.c:5601 msgid "--Deleted--" msgstr "--Знищено--" -#: ../fileio.c:5732 #, c-format msgid "auto-removing autocommand: %s <buffer=%d>" msgstr "Ðвтоматичне Ð·Ð½Ð¸Ñ‰ÐµÐ½Ð½Ñ Ð°Ð²Ñ‚Ð¾ÐºÐ¾Ð¼Ð°Ð½Ð´Ð¸: %s <буфер=%d>" #. the group doesn't exist -#: ../fileio.c:5772 #, c-format msgid "E367: No such group: \"%s\"" msgstr "E367: Ðемає такої групи: «%s»" -#: ../fileio.c:5897 #, c-format msgid "E215: Illegal character after *: %s" msgstr "E215: Ðедозволений Ñимвол піÑÐ»Ñ *: %s" # msgstr "E215: " -#: ../fileio.c:5905 #, c-format msgid "E216: No such event: %s" msgstr "E216: Ðемає такої події: %s" # msgstr "E215: " -#: ../fileio.c:5907 #, c-format msgid "E216: No such group or event: %s" msgstr "E216: Ðемає такої групи чи події: %s" # msgstr "E216: " #. Highlight title -#: ../fileio.c:6090 msgid "" "\n" "--- Auto-Commands ---" @@ -2495,111 +1960,89 @@ msgstr "" "\n" "--- Ðвтокоманди ---" -#: ../fileio.c:6293 #, c-format msgid "E680: <buffer=%d>: invalid buffer number " msgstr "E680: <буфер=%d>: некоректний номер буфера " -#: ../fileio.c:6370 msgid "E217: Can't execute autocommands for ALL events" msgstr "E217: Ðе можу виконувати автокоманди Ð´Ð»Ñ Ð£Ð¡Ð†Ð¥ подій" # msgstr "E217: " -#: ../fileio.c:6393 msgid "No matching autocommands" msgstr "Ðемає відповідних автокоманд" -#: ../fileio.c:6831 msgid "E218: autocommand nesting too deep" msgstr "E218: Забагато вкладених автокоманд" # msgstr "E218: " -#: ../fileio.c:7143 #, c-format msgid "%s Auto commands for \"%s\"" msgstr "Ðвтокоманди %s Ð´Ð»Ñ Â«%s»" -#: ../fileio.c:7149 #, c-format msgid "Executing %s" msgstr "ВиконуєтьÑÑ %s" -#: ../fileio.c:7211 #, c-format msgid "autocommand %s" msgstr "автокоманда %s" -#: ../fileio.c:7795 msgid "E219: Missing {." msgstr "E219: Бракує {." # msgstr "E219: " -#: ../fileio.c:7797 msgid "E220: Missing }." msgstr "E220: Бракує }." # msgstr "E220: " -#: ../fold.c:93 msgid "E490: No fold found" msgstr "E490: Згорток не знайдено" # msgstr "E349: " -#: ../fold.c:544 msgid "E350: Cannot create fold with current 'foldmethod'" msgstr "E350: Ðе вдалоÑÑ Ñтворити згортку методом 'foldmethod'" -#: ../fold.c:546 msgid "E351: Cannot delete fold with current 'foldmethod'" msgstr "E351: Ðе вдалоÑÑ Ð·Ð½Ð¸Ñ‰Ð¸Ñ‚Ð¸ згортку методом 'foldmethod'" -#: ../fold.c:1784 #, c-format msgid "+--%3ld lines folded " msgstr "+-- згорнуто %3ld Ñ€Ñдків " #. buffer has already been read -#: ../getchar.c:273 msgid "E222: Add to read buffer" msgstr "E222: Додати до буфера читаннÑ" -#: ../getchar.c:2040 msgid "E223: recursive mapping" msgstr "E223: Заміна рекурÑивна" # msgstr "E223: " -#: ../getchar.c:2849 #, c-format msgid "E224: global abbreviation already exists for %s" msgstr "E224: Загальне ÑÐºÐ¾Ñ€Ð¾Ñ‡ÐµÐ½Ð½Ñ Ð´Ð»Ñ %s вже Ñ–Ñнує" # msgstr "E224: " -#: ../getchar.c:2852 #, c-format msgid "E225: global mapping already exists for %s" msgstr "E225: Загальна заміна Ð´Ð»Ñ %s вже Ñ–Ñнує" # msgstr "E225: " -#: ../getchar.c:2952 #, c-format msgid "E226: abbreviation already exists for %s" msgstr "E226: Вже Ñ” ÑÐºÐ¾Ñ€Ð¾Ñ‡ÐµÐ½Ð½Ñ Ð´Ð»Ñ %s" # msgstr "E226: " -#: ../getchar.c:2955 #, c-format msgid "E227: mapping already exists for %s" msgstr "E227: Вже Ñ” заміна Ð´Ð»Ñ %s" # msgstr "E227: " -#: ../getchar.c:3008 msgid "No abbreviation found" msgstr "Ð¡ÐºÐ¾Ñ€Ð¾Ñ‡ÐµÐ½Ð½Ñ Ð½Ðµ знайдено" -#: ../getchar.c:3010 msgid "No mapping found" msgstr "Заміни не знайдено" -#: ../getchar.c:3974 msgid "E228: makemap: Illegal mode" msgstr "E228: makemap: ÐеприпуÑтимий режим" @@ -2607,7 +2050,6 @@ msgstr "E228: makemap: ÐеприпуÑтимий режим" #. key value of 'cedit' option #. type of cmdline window or 0 #. result of cmdline window or 0 -#: ../globals.h:924 msgid "--No lines in buffer--" msgstr "--Жодного Ñ€Ñдка--" @@ -2615,680 +2057,526 @@ msgstr "--Жодного Ñ€Ñдка--" #. * The error messages that can be shared are included here. #. * Excluded are errors that are only used once and debugging messages. #. -#: ../globals.h:996 msgid "E470: Command aborted" msgstr "E470: Команду перервано" -#: ../globals.h:997 msgid "E471: Argument required" msgstr "E471: Ðеобхідно вказати аргумент" -#: ../globals.h:998 msgid "E10: \\ should be followed by /, ? or &" msgstr "E10: За \\ має йти /, ? або &" # msgstr "E10: " -#: ../globals.h:1000 msgid "E11: Invalid in command-line window; <CR> executes, CTRL-C quits" msgstr "E11: ÐеприпуÑтимо у вікні команд, <CR> виконує, CTRL-C виходить" -#: ../globals.h:1002 msgid "E12: Command not allowed from exrc/vimrc in current dir or tag search" msgstr "" "E12: Команда не дозволена у exrc/vimrc у пошуку поточного каталогу чи теґу" -#: ../globals.h:1003 msgid "E171: Missing :endif" msgstr "E171: Бракує :endif" -#: ../globals.h:1004 msgid "E600: Missing :endtry" msgstr "E600: Бракує :endtry" -#: ../globals.h:1005 msgid "E170: Missing :endwhile" msgstr "E170: Бракує :endwhile" -#: ../globals.h:1006 msgid "E170: Missing :endfor" msgstr "E170: Бракує :endfor" -#: ../globals.h:1007 msgid "E588: :endwhile without :while" msgstr "E588: :endwhile без :while" -#: ../globals.h:1008 msgid "E588: :endfor without :for" msgstr "E588: :endfor без :for" -#: ../globals.h:1009 msgid "E13: File exists (add ! to override)" msgstr "E13: Файл Ñ–Ñнує (! щоб не зважати)" -#: ../globals.h:1010 msgid "E472: Command failed" msgstr "E472: Команда на вдалаÑÑŒ" -#: ../globals.h:1011 msgid "E473: Internal error" msgstr "E473: Ð’Ð½ÑƒÑ‚Ñ€Ñ–ÑˆÐ½Ñ Ð¿Ð¾Ð¼Ð¸Ð»ÐºÐ°" -#: ../globals.h:1012 msgid "Interrupted" msgstr "Перервано" -#: ../globals.h:1013 msgid "E14: Invalid address" msgstr "E14: Ðеправильна адреÑа" # msgstr "E14: " -#: ../globals.h:1014 msgid "E474: Invalid argument" msgstr "E474: Ðекоректний аргумент" -#: ../globals.h:1015 #, c-format msgid "E475: Invalid argument: %s" msgstr "E475: Ðекоректний аргумент: %s" -#: ../globals.h:1016 #, c-format msgid "E15: Invalid expression: %s" msgstr "E15: Ðеправильний вираз: %s" # msgstr "E15: " -#: ../globals.h:1017 msgid "E16: Invalid range" msgstr "E16: Ðеправильні межі" # msgstr "E16: " -#: ../globals.h:1018 msgid "E476: Invalid command" msgstr "E476: Ðекоректна команда" -#: ../globals.h:1019 #, c-format msgid "E17: \"%s\" is a directory" msgstr "E17: «%s» — це каталог" -#: ../globals.h:1020 -#, fuzzy msgid "E900: Invalid job id" -msgstr "E49: Ðекоректний розмір зÑуву" +msgstr "E900: Ðекоректний ід. завданнÑ" -#: ../globals.h:1021 msgid "E901: Job table is full" -msgstr "" +msgstr "E901: Ð¢Ð°Ð±Ð»Ð¸Ñ†Ñ Ð·Ð°Ð²Ð´Ð°Ð½ÑŒ заповнена" -#: ../globals.h:1022 #, c-format msgid "E902: \"%s\" is not an executable" -msgstr "" +msgstr "E902: \"%s\" не можна виконати" -#: ../globals.h:1024 #, c-format msgid "E364: Library call failed for \"%s()\"" msgstr "E364: Бібліотечний виклик до «%s()» не вдавÑÑ" # msgstr "E18: " -#: ../globals.h:1026 msgid "E19: Mark has invalid line number" msgstr "E19: У помітки некоректний номер Ñ€Ñдка" # msgstr "E19: " -#: ../globals.h:1027 msgid "E20: Mark not set" msgstr "E20: Помітку не вÑтановлено" # msgstr "E20: " -#: ../globals.h:1029 msgid "E21: Cannot make changes, 'modifiable' is off" msgstr "E21: Зміни не дозволені: вимкнено 'modifiable'" # msgstr "E21: " -#: ../globals.h:1030 msgid "E22: Scripts nested too deep" msgstr "E22: Забагато вкладених Ñкриптів" # msgstr "E22: " -#: ../globals.h:1031 msgid "E23: No alternate file" msgstr "E23: Ðемає вторинного файлу" # msgstr "E23: " -#: ../globals.h:1032 msgid "E24: No such abbreviation" msgstr "E24: Такого ÑÐºÐ¾Ñ€Ð¾Ñ‡ÐµÐ½Ð½Ñ Ð½ÐµÐ¼Ð°Ñ”" # msgstr "E24: " -#: ../globals.h:1033 msgid "E477: No ! allowed" msgstr "E477: ! не дозволено" -#: ../globals.h:1035 msgid "E25: Nvim does not have a built-in GUI" msgstr "E25: Ðе можна викориÑтати GUI: Ðе ввімкнено під Ñ‡Ð°Ñ ÐºÐ¾Ð¼Ð¿Ñ–Ð»Ñції" # msgstr "E25: " -#: ../globals.h:1036 #, c-format msgid "E28: No such highlight group name: %s" msgstr "E28: Ðемає такої групи підÑвічуваннÑ: %s" # msgstr "E28: " -#: ../globals.h:1037 msgid "E29: No inserted text yet" msgstr "E29: ТекÑÑ‚ ще не було додано" # msgstr "E29: " -#: ../globals.h:1038 msgid "E30: No previous command line" msgstr "E30: Ще не було команд" # msgstr "E30: " -#: ../globals.h:1039 msgid "E31: No such mapping" msgstr "E31: Ðемає такої заміни" # msgstr "E31: " -#: ../globals.h:1040 msgid "E479: No match" msgstr "E479: Жодного збігу" -#: ../globals.h:1041 #, c-format msgid "E480: No match: %s" msgstr "E480: Жодного збігу: %s" -#: ../globals.h:1042 msgid "E32: No file name" msgstr "E32: Бракує назви файлу" # msgstr "E32: " -#: ../globals.h:1044 msgid "E33: No previous substitute regular expression" msgstr "E33: Заміна зразків ще не викориÑтовувалаÑÑŒ" # msgstr "E33: " -#: ../globals.h:1045 msgid "E34: No previous command" msgstr "E34: Команд ще не було" # msgstr "E34: " -#: ../globals.h:1046 msgid "E35: No previous regular expression" msgstr "E35: Зразків пошуку ще не було" # msgstr "E35: " -#: ../globals.h:1047 msgid "E481: No range allowed" msgstr "E481: Ðе дозволено вказувати межі" -#: ../globals.h:1048 msgid "E36: Not enough room" msgstr "E36: МіÑÑ†Ñ Ð½Ðµ виÑтачить" # msgstr "E36: " -#: ../globals.h:1049 #, c-format msgid "E482: Can't create file %s" msgstr "E482: Ðе вдалоÑÑ Ñтворити файл %s" -#: ../globals.h:1050 msgid "E483: Can't get temp file name" msgstr "E483: Ðе вдалоÑÑ Ñформувати назву тимчаÑового файлу" -#: ../globals.h:1051 #, c-format msgid "E484: Can't open file %s" msgstr "E484: Ðе вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ файл %s" -#: ../globals.h:1052 #, c-format msgid "E485: Can't read file %s" msgstr "E485: Ðе вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ файл %s" -#: ../globals.h:1054 msgid "E37: No write since last change (add ! to override)" msgstr "E37: Зміни не було запиÑано (! щоб не зважати)" -#: ../globals.h:1055 -#, fuzzy msgid "E37: No write since last change" -msgstr "[Зміни не запиÑано]\n" +msgstr "E37: Ðе запиÑано піÑÐ»Ñ Ð¾Ñтанніх змін" -#: ../globals.h:1056 msgid "E38: Null argument" msgstr "E38: ВідÑутній аргумент" -#: ../globals.h:1057 msgid "E39: Number expected" msgstr "E39: ОчікуєтьÑÑ Ñ‡Ð¸Ñло" -#: ../globals.h:1058 #, c-format msgid "E40: Can't open errorfile %s" msgstr "E40: Ðе вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ файл помилок %s" -#: ../globals.h:1059 msgid "E41: Out of memory!" msgstr "E41: Забракло пам'Ñті!" -#: ../globals.h:1060 msgid "Pattern not found" msgstr "Зразок не знайдено" -#: ../globals.h:1061 #, c-format msgid "E486: Pattern not found: %s" msgstr "E486: Зразок не знайдено: %s" -#: ../globals.h:1062 msgid "E487: Argument must be positive" msgstr "E487: Ðргумент має бути додатний" -#: ../globals.h:1064 msgid "E459: Cannot go back to previous directory" msgstr "E459: Ðе вдалоÑÑ Ð¿ÐµÑ€ÐµÐ¹Ñ‚Ð¸ до попереднього каталогу" -#: ../globals.h:1066 msgid "E42: No Errors" msgstr "E42: Жодної помилки" -#: ../globals.h:1067 msgid "E776: No location list" msgstr "E776: Ðемає ÑпиÑку міÑць" -#: ../globals.h:1068 msgid "E43: Damaged match string" msgstr "E43: ТекÑÑ‚ збігу пошкоджено" -#: ../globals.h:1069 msgid "E44: Corrupted regexp program" msgstr "E44: ЗіпÑована програма регулÑрних виразів" -#: ../globals.h:1071 msgid "E45: 'readonly' option is set (add ! to override)" msgstr "E45: Ð’Ñтановлено опцію 'readonly' (! щоб не зважати)" -#: ../globals.h:1073 #, c-format msgid "E46: Cannot change read-only variable \"%s\"" msgstr "E46: Змінна тільки Ð´Ð»Ñ Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ: «%s»" -#: ../globals.h:1075 #, c-format msgid "E794: Cannot set variable in the sandbox: \"%s\"" msgstr "E794: Ðе можна вÑтановити змінну у піÑочниці: «%s»" -#: ../globals.h:1076 msgid "E47: Error while reading errorfile" msgstr "E47: Помилка Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ Ñ„Ð°Ð¹Ð»Ñƒ помилок" -#: ../globals.h:1078 msgid "E48: Not allowed in sandbox" msgstr "E48: Ðа дозволено у піÑочниці" -#: ../globals.h:1080 msgid "E523: Not allowed here" msgstr "E523: Ðе дозволено тут" -#: ../globals.h:1082 msgid "E359: Screen mode setting not supported" msgstr "E359: Режим екрану не підтримуєтьÑÑ" -#: ../globals.h:1083 msgid "E49: Invalid scroll size" msgstr "E49: Ðекоректний розмір зÑуву" -#: ../globals.h:1084 msgid "E91: 'shell' option is empty" msgstr "E91: ÐžÐ¿Ñ†Ñ–Ñ 'shell' порожнÑ" # msgstr "E254: " -#: ../globals.h:1085 msgid "E255: Couldn't read in sign data!" msgstr "E255: Ðе можна зчитати дані напиÑу!" -#: ../globals.h:1086 msgid "E72: Close error on swap file" msgstr "E72: Помилка під Ñ‡Ð°Ñ Ð·Ð°ÐºÑ€Ð¸Ñ‚Ñ‚Ñ Ñ„Ð°Ð¹Ð»Ñƒ обміну" -#: ../globals.h:1087 msgid "E73: tag stack empty" msgstr "E73: Стек теґів порожній" -#: ../globals.h:1088 msgid "E74: Command too complex" msgstr "E74: Занадто Ñкладна команда" -#: ../globals.h:1089 msgid "E75: Name too long" msgstr "E75: Задовге ім'Ñ" -#: ../globals.h:1090 msgid "E76: Too many [" msgstr "E76: Забагато '['" -#: ../globals.h:1091 msgid "E77: Too many file names" msgstr "E77: Забагато назв файлів" -#: ../globals.h:1092 msgid "E488: Trailing characters" msgstr "E488: Ðадлишкові Ñимволи" -#: ../globals.h:1093 msgid "E78: Unknown mark" msgstr "E78: Ðевідома помітка" -#: ../globals.h:1094 msgid "E79: Cannot expand wildcards" msgstr "E79: Ðе вдалоÑÑ Ñ€Ð¾Ð·ÐºÑ€Ð¸Ñ‚Ð¸ шаблон" -#: ../globals.h:1096 msgid "E591: 'winheight' cannot be smaller than 'winminheight'" msgstr "E591: 'winheight' не може бути меншим за 'winminheight'" -#: ../globals.h:1098 msgid "E592: 'winwidth' cannot be smaller than 'winminwidth'" msgstr "E592: 'winwidth' не може бути меншим за 'winminwidth'" # msgstr "E79: " -#: ../globals.h:1099 msgid "E80: Error while writing" msgstr "E80: Помилка під Ñ‡Ð°Ñ Ð·Ð°Ð¿Ð¸Ñу" -#: ../globals.h:1100 msgid "Zero count" msgstr "Ðульова кількіÑть" -#: ../globals.h:1101 msgid "E81: Using <SID> not in a script context" msgstr "E81: <SID> викориÑтовуєтьÑÑ Ð½Ðµ в контекÑті Ñкрипту" -#: ../globals.h:1102 #, c-format msgid "E685: Internal error: %s" msgstr "E685: Ð’Ð½ÑƒÑ‚Ñ€Ñ–ÑˆÐ½Ñ Ð¿Ð¾Ð¼Ð¸Ð»ÐºÐ°: %s" -#: ../globals.h:1104 msgid "E363: pattern uses more memory than 'maxmempattern'" msgstr "E363: Зразок викориÑтовує більше, ніж 'maxmempattern', пам'Ñті" -#: ../globals.h:1105 msgid "E749: empty buffer" msgstr "E749: Порожній буфер" -#: ../globals.h:1108 msgid "E682: Invalid search pattern or delimiter" msgstr "E682: Ðекоректний зразок Ð´Ð»Ñ Ð¿Ð¾ÑˆÑƒÐºÑƒ чи роздільник" -#: ../globals.h:1109 msgid "E139: File is loaded in another buffer" msgstr "E139: Файл уже завантажено в інший буфер" # msgstr "E235: " -#: ../globals.h:1110 #, c-format msgid "E764: Option '%s' is not set" msgstr "E764: ÐžÐ¿Ñ†Ñ–Ñ '%s' не вÑтановлена" -#: ../globals.h:1111 msgid "E850: Invalid register name" msgstr "E850: Ðеправильна назва регіÑтру" -#: ../globals.h:1114 msgid "search hit TOP, continuing at BOTTOM" msgstr "Пошук дійшов до ПОЧÐТКУ, продовжуєтьÑÑ Ð· КІÐЦЯ" -#: ../globals.h:1115 msgid "search hit BOTTOM, continuing at TOP" msgstr "Пошук дійшов до КІÐЦЯ, продовжуєтьÑÑ Ð· ПОЧÐТКУ" -#: ../hardcopy.c:240 msgid "E550: Missing colon" msgstr "E550: Пропущено двокрапку" # msgstr "E347: " -#: ../hardcopy.c:252 msgid "E551: Illegal component" msgstr "E551: Ðекоректний компонент" -#: ../hardcopy.c:259 msgid "E552: digit expected" msgstr "E552: очікуєтьÑÑ Ñ†Ð¸Ñ„Ñ€Ð°" -#: ../hardcopy.c:473 #, c-format msgid "Page %d" msgstr "Сторінка %d" -#: ../hardcopy.c:597 msgid "No text to be printed" msgstr "Ðічого друкувати" -#: ../hardcopy.c:668 #, c-format msgid "Printing page %d (%d%%)" msgstr "ДрукуєтьÑÑ Ñторінка %d (%d%%)" -#: ../hardcopy.c:680 #, c-format msgid " Copy %d of %d" msgstr " ÐšÐ¾Ð¿Ñ–Ñ %d з %d" -#: ../hardcopy.c:733 #, c-format msgid "Printed: %s" msgstr "Ðадруковано: %s" -#: ../hardcopy.c:740 msgid "Printing aborted" msgstr "Друк перервано" -#: ../hardcopy.c:1365 msgid "E455: Error writing to PostScript output file" msgstr "E455: Ðе вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати вихідний файл PostScript" -#: ../hardcopy.c:1747 #, c-format msgid "E624: Can't open file \"%s\"" msgstr "E624: Ðе вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ файл «%s»" -#: ../hardcopy.c:1756 ../hardcopy.c:2470 #, c-format msgid "E457: Can't read PostScript resource file \"%s\"" msgstr "E457: Ðе вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ файл реÑурÑів PostScript «%s»" -#: ../hardcopy.c:1772 #, c-format msgid "E618: file \"%s\" is not a PostScript resource file" msgstr "E618: «%s» не Ñ” файлом реÑурÑів PostScript" -#: ../hardcopy.c:1788 ../hardcopy.c:1805 ../hardcopy.c:1844 #, c-format msgid "E619: file \"%s\" is not a supported PostScript resource file" msgstr "E619: «%s» не Ñ” підтримуваним файлом реÑурÑів PostScript" -#: ../hardcopy.c:1856 #, c-format msgid "E621: \"%s\" resource file has wrong version" msgstr "E621: Ðеправильна верÑÑ–Ñ Ñ„Ð°Ð¹Ð»Ñƒ реÑурÑів «%s»" -#: ../hardcopy.c:2225 msgid "E673: Incompatible multi-byte encoding and character set." msgstr "E673: ÐеÑуміÑні багатобайтове ÐºÐ¾Ð´ÑƒÐ²Ð°Ð½Ð½Ñ Ð¹ набір Ñимволів." -#: ../hardcopy.c:2238 msgid "E674: printmbcharset cannot be empty with multi-byte encoding." msgstr "" "E674: printmbcharset не може бути порожнім з багатобайтовим кодуваннÑм." -#: ../hardcopy.c:2254 msgid "E675: No default font specified for multi-byte printing." msgstr "E675: Ðе зазначено шрифт Ð´Ð»Ñ Ð±Ð°Ð³Ð°Ñ‚Ð¾Ð±Ð°Ð¹Ñ‚Ð¾Ð²Ð¾Ð³Ð¾ друку." -#: ../hardcopy.c:2426 msgid "E324: Can't open PostScript output file" msgstr "E324: Ðе вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ файл PostScript Ð´Ð»Ñ Ð²Ð¸Ð²Ð¾Ð´Ñƒ" -#: ../hardcopy.c:2458 #, c-format msgid "E456: Can't open file \"%s\"" msgstr "E456: Ðе вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ файл «%s»" -#: ../hardcopy.c:2583 msgid "E456: Can't find PostScript resource file \"prolog.ps\"" msgstr "E456: Ðе вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ файл реÑурÑів PostScript «prolog.ps»" -#: ../hardcopy.c:2593 msgid "E456: Can't find PostScript resource file \"cidfont.ps\"" msgstr "E456: Ðе вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ файл реÑурÑів PostScript «cidfont.ps»" -#: ../hardcopy.c:2622 ../hardcopy.c:2639 ../hardcopy.c:2665 #, c-format msgid "E456: Can't find PostScript resource file \"%s.ps\"" msgstr "E456: Ðе вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ файл реÑурÑів PostScript «%s.ps»" -#: ../hardcopy.c:2654 #, c-format msgid "E620: Unable to convert to print encoding \"%s\"" msgstr "E620: Ðе вдалоÑÑ Ð¿ÐµÑ€ÐµÑ‚Ð²Ð¾Ñ€Ð¸Ñ‚Ð¸ до ÐºÐ¾Ð´ÑƒÐ²Ð°Ð½Ð½Ñ Ð´Ñ€ÑƒÐºÑƒ «%s»" -#: ../hardcopy.c:2877 msgid "Sending to printer..." msgstr "ВідÑилаєтьÑÑ Ð½Ð° принтер..." -#: ../hardcopy.c:2881 msgid "E365: Failed to print PostScript file" msgstr "E365: Ðе вдалоÑÑ Ð½Ð°Ð´Ñ€ÑƒÐºÑƒÐ²Ð°Ñ‚Ð¸ файл PostScript" -#: ../hardcopy.c:2883 msgid "Print job sent." msgstr "Ð—Ð°Ð²Ð´Ð°Ð½Ð½Ñ Ð´Ñ€ÑƒÐºÑƒ відіÑлано." # msgstr "E255: " -#: ../if_cscope.c:85 msgid "Add a new database" msgstr "Додати нову базу даних" -#: ../if_cscope.c:87 msgid "Query for a pattern" msgstr "Запит за зразком" -#: ../if_cscope.c:89 msgid "Show this message" msgstr "Показати це повідомленнÑ" -#: ../if_cscope.c:91 msgid "Kill a connection" msgstr "Знищити з'єднаннÑ" -#: ../if_cscope.c:93 msgid "Reinit all connections" msgstr "ПерезапуÑтити уÑÑ– з'єднаннÑ" -#: ../if_cscope.c:95 msgid "Show connections" msgstr "Показати з'єднаннÑ" -#: ../if_cscope.c:101 #, c-format msgid "E560: Usage: cs[cope] %s" msgstr "E560: ВикориÑтаннÑ: cs[cope] %s" -#: ../if_cscope.c:225 msgid "This cscope command does not support splitting the window.\n" msgstr "Ð¦Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð° cscope не вміє ділити вікно.\n" -#: ../if_cscope.c:266 msgid "E562: Usage: cstag <ident>" msgstr "E562: ВикориÑтаннÑ: cstag <ідентиф-ор>" -#: ../if_cscope.c:313 msgid "E257: cstag: tag not found" msgstr "E257: cstag: теґ не знайдено" # msgstr "E257: " -#: ../if_cscope.c:461 #, c-format msgid "E563: stat(%s) error: %d" msgstr "E563: stat(%s) помилка: %d" -#: ../if_cscope.c:551 #, c-format msgid "E564: %s is not a directory or a valid cscope database" msgstr "E564: %s не Ñ” ні каталогом, ні базою даних cscope" -#: ../if_cscope.c:566 #, c-format msgid "Added cscope database %s" msgstr "Додано базу даних cscope %s" -#: ../if_cscope.c:616 #, c-format msgid "E262: error reading cscope connection %<PRId64>" msgstr "E262: Помилка Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ Ð·Ñ– з'Ñ”Ð´Ð½Ð°Ð½Ð½Ñ cscope %<PRId64>" -#: ../if_cscope.c:711 msgid "E561: unknown cscope search type" msgstr "E561: Ðевідомий тип пошуку cscope" -#: ../if_cscope.c:752 ../if_cscope.c:789 msgid "E566: Could not create cscope pipes" msgstr "E566: Ðе вдалоÑÑ Ñтворити канали до cscope" -#: ../if_cscope.c:767 msgid "E622: Could not fork for cscope" msgstr "E622: Ðе вдалоÑÑ Ñ€Ð¾Ð·Ð´Ñ–Ð»Ð¸Ñ‚Ð¸ Ð¿Ñ€Ð¾Ñ†ÐµÑ Ð´Ð»Ñ cscope" -#: ../if_cscope.c:849 msgid "cs_create_connection setpgid failed" msgstr "cs_create_connection: помилка setpgid" -#: ../if_cscope.c:853 ../if_cscope.c:889 msgid "cs_create_connection exec failed" msgstr "cs_create_connection: помилка під Ñ‡Ð°Ñ Ð²Ð¸ÐºÐ¾Ð½Ð°Ð½Ð½Ñ" -#: ../if_cscope.c:863 ../if_cscope.c:902 msgid "cs_create_connection: fdopen for to_fp failed" msgstr "cs_create_connection: fdopen Ð´Ð»Ñ to_fp не вдавÑÑ" -#: ../if_cscope.c:865 ../if_cscope.c:906 msgid "cs_create_connection: fdopen for fr_fp failed" msgstr "cs_create_connection: fdopen Ð´Ð»Ñ fr_fp не вдавÑÑ" -#: ../if_cscope.c:890 msgid "E623: Could not spawn cscope process" msgstr "E623: Ðе вдалоÑÑ Ñтворити Ð¿Ñ€Ð¾Ñ†ÐµÑ cscope" -#: ../if_cscope.c:932 msgid "E567: no cscope connections" msgstr "E567: жодного з'Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ñ–Ð· cscope" -#: ../if_cscope.c:1009 #, c-format msgid "E469: invalid cscopequickfix flag %c for %c" msgstr "E469: Ðекоректний прапорець cscopequickfix %c Ð´Ð»Ñ %c" # msgstr "E258: " -#: ../if_cscope.c:1058 #, c-format msgid "E259: no matches found for cscope query %s of %s" msgstr "E259: Ð”Ð»Ñ Ð·Ð°Ð¿Ð¸Ñ‚Ñƒ cscope %s з %s нічого не знайдено" # msgstr "E259: " -#: ../if_cscope.c:1142 msgid "cscope commands:\n" msgstr "Команди cscope:\n" -#: ../if_cscope.c:1150 #, c-format msgid "%-5s: %s%*s (Usage: %s)" msgstr "%-5s: %s%*s (ВикориÑтаннÑ: %s)" -#: ../if_cscope.c:1155 msgid "" "\n" " c: Find functions calling this function\n" @@ -3310,32 +2598,26 @@ msgstr "" " s: Знайти цей Ñимвол C\n" " t: Знайти цей текÑÑ‚\n" -#: ../if_cscope.c:1226 msgid "E568: duplicate cscope database not added" msgstr "E568: Повторна база даних cscope не додана" # msgstr "E260: " -#: ../if_cscope.c:1335 #, c-format msgid "E261: cscope connection %s not found" msgstr "E261: З'Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð· cscope %s не знайдено" -#: ../if_cscope.c:1364 #, c-format msgid "cscope connection %s closed" msgstr "З'Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð· cscope %s закінчено" #. should not reach here -#: ../if_cscope.c:1486 msgid "E570: fatal error in cs_manage_matches" msgstr "E570: Фатальна помилка в cs_manage_matches" -#: ../if_cscope.c:1693 #, c-format msgid "Cscope tag: %s" msgstr "Теґ cscope: %s" -#: ../if_cscope.c:1711 msgid "" "\n" " # line" @@ -3343,89 +2625,69 @@ msgstr "" "\n" " # Ñ€Ñдок" -#: ../if_cscope.c:1713 msgid "filename / context / line\n" msgstr "файл / контекÑÑ‚ / Ñ€Ñдок\n" -#: ../if_cscope.c:1809 #, c-format msgid "E609: Cscope error: %s" msgstr "E609: Помилка cscope: %s" -#: ../if_cscope.c:2053 msgid "All cscope databases reset" msgstr "УÑÑ– бази даних cscope перезавантажено" -#: ../if_cscope.c:2123 msgid "no cscope connections\n" msgstr "Жодного з'Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð· cscope\n" -#: ../if_cscope.c:2126 msgid " # pid database name prepend path\n" msgstr " # pid назва бази даних шлÑÑ…\n" -#: ../main.c:144 msgid "Unknown option argument" msgstr "Ðевідомий аргумент опції" -#: ../main.c:146 msgid "Too many edit arguments" msgstr "Забагато аргументів" -#: ../main.c:148 msgid "Argument missing after" msgstr "Пропущено аргумент піÑлÑ" -#: ../main.c:150 msgid "Garbage after option argument" msgstr "Ð¡Ð¼Ñ–Ñ‚Ñ‚Ñ Ð¿Ñ–ÑÐ»Ñ Ð°Ñ€Ð³ÑƒÐ¼ÐµÐ½Ñ‚Ñƒ опції" -#: ../main.c:152 msgid "Too many \"+command\", \"-c command\" or \"--cmd command\" arguments" msgstr "Забагато аргументів у «+команда», «-c команда» або «--cmd команда»" # msgstr "E14: " -#: ../main.c:154 msgid "Invalid argument for" msgstr "Ðеправильний аргумент у" -#: ../main.c:294 #, c-format msgid "%d files to edit\n" msgstr "%d файли(ів)\n" -#: ../main.c:1342 msgid "Attempt to open script file again: \"" msgstr "Спроба повторно відкрити Ñкрипт: \"" -#: ../main.c:1350 msgid "Cannot open for reading: \"" msgstr "Ðе вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸: \"" -#: ../main.c:1393 msgid "Cannot open for script output: \"" msgstr "Ðе вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ Ñк вихідний файл: \"" -#: ../main.c:1622 msgid "Vim: Warning: Output is not to a terminal\n" msgstr "Vim: ЗаÑтереженнÑ: Вивід не у термінал\n" -#: ../main.c:1624 msgid "Vim: Warning: Input is not from a terminal\n" msgstr "Vim: ЗаÑтереженнÑ: Ð£Ð²ÐµÐ´ÐµÐ½Ð½Ñ Ð½Ðµ з терміналу\n" #. just in case.. -#: ../main.c:1891 msgid "pre-vimrc command line" msgstr "команди перед vimrc" -#: ../main.c:1964 #, c-format msgid "E282: Cannot read from \"%s\"" msgstr "E282: Ðе вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ з «%s»" # msgstr "E282: " -#: ../main.c:2149 msgid "" "\n" "More info with: \"vim -h\"\n" @@ -3433,23 +2695,18 @@ msgstr "" "\n" "ДізнайтеÑÑ Ð±Ñ–Ð»ÑŒÑˆÐµ: «vim -h»\n" -#: ../main.c:2178 msgid "[file ..] edit specified file(s)" msgstr "[файл ..] редагувати вказані файли" -#: ../main.c:2179 msgid "- read text from stdin" msgstr "- читати текÑÑ‚ з stdin" -#: ../main.c:2180 msgid "-t tag edit file where tag is defined" msgstr "-t помітка перейти до теґу" -#: ../main.c:2181 msgid "-q [errorfile] edit file with first error" msgstr "-q [файл] перейти до першої помилки" -#: ../main.c:2187 msgid "" "\n" "\n" @@ -3459,11 +2716,9 @@ msgstr "" "\n" "Вжиток:" -#: ../main.c:2189 msgid " vim [arguments] " msgstr " vim [аргументи] " -#: ../main.c:2193 msgid "" "\n" " or:" @@ -3471,7 +2726,6 @@ msgstr "" "\n" " або:" -#: ../main.c:2196 msgid "" "\n" "\n" @@ -3481,192 +2735,146 @@ msgstr "" "\n" "Ðргументи:\n" -#: ../main.c:2197 msgid "--\t\t\tOnly file names after this" msgstr "--\t\t\tЛише назви файлів піÑÐ»Ñ Ñ†ÑŒÐ¾Ð³Ð¾" -#: ../main.c:2199 msgid "--literal\t\tDon't expand wildcards" msgstr "--literal\t\tÐе розкривати шаблони" -#: ../main.c:2201 msgid "-v\t\t\tVi mode (like \"vi\")" msgstr "-v\t\t\tРежим Vi (ніби «vi»)" -#: ../main.c:2202 msgid "-e\t\t\tEx mode (like \"ex\")" msgstr "-e\t\t\tРежим Ex (ніби «ex»)" -#: ../main.c:2203 msgid "-E\t\t\tImproved Ex mode" msgstr "-E\t\t\tПокращений режим Ex" -#: ../main.c:2204 msgid "-s\t\t\tSilent (batch) mode (only for \"ex\")" msgstr "-s\t\t\tМовчазний (пакетний) режим (лише Ð´Ð»Ñ Â«ex»)" -#: ../main.c:2205 msgid "-d\t\t\tDiff mode (like \"vimdiff\")" msgstr "-d\t\t\tРежим порівнÑÐ½Ð½Ñ (ніби «vimdiff»)" -#: ../main.c:2206 msgid "-y\t\t\tEasy mode (like \"evim\", modeless)" msgstr "-y\t\t\tПроÑтий режим (ніби «evim», без режимів)" -#: ../main.c:2207 msgid "-R\t\t\tReadonly mode (like \"view\")" msgstr "-R\t\t\tРежим переглÑду (ніби «view»)" -#: ../main.c:2208 msgid "-Z\t\t\tRestricted mode (like \"rvim\")" msgstr "-Z\t\t\tОбмежений режим (ніби «rvim»)" -#: ../main.c:2209 msgid "-m\t\t\tModifications (writing files) not allowed" msgstr "-m\t\t\tЗміни (Ð·Ð°Ð¿Ð¸Ñ Ñ„Ð°Ð¹Ð»Ñ–Ð²) не дозволено" -#: ../main.c:2210 msgid "-M\t\t\tModifications in text not allowed" msgstr "-M\t\t\tЗміни в текÑті файлів не дозволено" -#: ../main.c:2211 msgid "-b\t\t\tBinary mode" msgstr "-b\t\t\tДвійковий режим" -#: ../main.c:2212 msgid "-l\t\t\tLisp mode" msgstr "-l\t\t\tРежим lisp" -#: ../main.c:2213 msgid "-C\t\t\tCompatible with Vi: 'compatible'" msgstr "-C\t\t\tСуміÑний з Vi режим: 'compatible'" -#: ../main.c:2214 msgid "-N\t\t\tNot fully Vi compatible: 'nocompatible'" msgstr "-N\t\t\tÐе зовÑім ÑуміÑний з Vi режим: 'nocompatible'" -#: ../main.c:2215 msgid "-V[N][fname]\t\tBe verbose [level N] [log messages to fname]" msgstr "-V[N][файл]\t\tБільше повідомлень [рівень N] [файл журн. повідомлень]" -#: ../main.c:2216 msgid "-D\t\t\tDebugging mode" msgstr "-D\t\t\tРежим налагодженнÑ" -#: ../main.c:2217 msgid "-n\t\t\tNo swap file, use memory only" msgstr "-n\t\t\tÐе викориÑтовувати файл обміну, тримати уÑе в пам'Ñті" -#: ../main.c:2218 msgid "-r\t\t\tList swap files and exit" msgstr "-r\t\t\tПоказати файли обміну Ñ– вийти" -#: ../main.c:2219 msgid "-r (with file name)\tRecover crashed session" msgstr "-r (назва файлу)\tВідновити аварійно закінчений ÑеанÑ" -#: ../main.c:2220 msgid "-L\t\t\tSame as -r" msgstr "-L\t\t\tТе Ñаме, що й -r" -#: ../main.c:2221 msgid "-A\t\t\tstart in Arabic mode" msgstr "-A\t\t\tЗапуÑтити в режимі арабÑької мови" -#: ../main.c:2222 msgid "-H\t\t\tStart in Hebrew mode" msgstr "-H\t\t\tЗапуÑтити в режимі івриту" -#: ../main.c:2223 msgid "-F\t\t\tStart in Farsi mode" msgstr "-F\t\t\tЗапуÑтити в режимі перÑької мови" -#: ../main.c:2224 msgid "-T <terminal>\tSet terminal type to <terminal>" msgstr "-T <термінал>\tÐ’Ñтановити тип терміналу у <термінал>" -#: ../main.c:2225 msgid "-u <vimrc>\t\tUse <vimrc> instead of any .vimrc" msgstr "-u <vimrc>\t\tВикориÑтати поданий файл заміÑть .vimrc" -#: ../main.c:2226 msgid "--noplugin\t\tDon't load plugin scripts" msgstr "--noplugin\t\tÐе вантажити Ñкрипти доповненнÑ" -#: ../main.c:2227 msgid "-p[N]\t\tOpen N tab pages (default: one for each file)" msgstr "-p[N]\t\tВідкрити N вкладок (або по одній Ð´Ð»Ñ ÐºÐ¾Ð¶Ð½Ð¾Ð³Ð¾ файлу)" -#: ../main.c:2228 msgid "-o[N]\t\tOpen N windows (default: one for each file)" msgstr "-o[N]\t\tВідкрити N вікон (або по одному Ð´Ð»Ñ ÐºÐ¾Ð¶Ð½Ð¾Ð³Ð¾ файлу)" -#: ../main.c:2229 msgid "-O[N]\t\tLike -o but split vertically" msgstr "-O[N]\t\tÐіби -o, але поділити вікна вертикально" -#: ../main.c:2230 msgid "+\t\t\tStart at end of file" msgstr "+\t\t\tРозпочати в кінці файлу" -#: ../main.c:2231 msgid "+<lnum>\t\tStart at line <lnum>" msgstr "+<Ñ€Ñдок>\t\tРозпочати у вказаному <Ñ€Ñдку>" -#: ../main.c:2232 msgid "--cmd <command>\tExecute <command> before loading any vimrc file" msgstr "--cmd <команда>\tВиконати <команду> перед завантаженнÑм vimrc" -#: ../main.c:2233 msgid "-c <command>\t\tExecute <command> after loading the first file" msgstr "-c <команда>\t\tВиконати <команду> піÑÐ»Ñ Ð·Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶ÐµÐ½Ð½Ñ Ð¿ÐµÑ€ÑˆÐ¾Ð³Ð¾ файлу" -#: ../main.c:2235 msgid "-S <session>\t\tSource file <session> after loading the first file" msgstr "-S <ÑеанÑ>\t\tВиконати поданий файл піÑÐ»Ñ Ð¿ÐµÑ€ÑˆÐ¾Ð³Ð¾ завантаженого файлу" -#: ../main.c:2236 msgid "-s <scriptin>\tRead Normal mode commands from file <scriptin>" msgstr "-s <Ñкрипт>\t\tЗчитати команди нормального режиму з файлу <Ñкрипт>" -#: ../main.c:2237 msgid "-w <scriptout>\tAppend all typed commands to file <scriptout>" msgstr "-w <Ñкрипт>\t\tДопиÑати уÑÑ– набрані команди до файлу <Ñкрипт>" -#: ../main.c:2238 msgid "-W <scriptout>\tWrite all typed commands to file <scriptout>" msgstr "-w <Ñкрипт>\t\tЗапиÑати уÑÑ– набрані команди у файл <Ñкрипт>" -#: ../main.c:2240 msgid "--startuptime <file>\tWrite startup timing messages to <file>" msgstr "" "--startuptime <файл>\tЗапиÑати запуÑкні Ð¿Ð¾Ð²Ñ–Ð´Ð¾Ð¼Ð»ÐµÐ½Ð½Ñ Ð· чаÑовими відмітками " "до <файлу>" -#: ../main.c:2242 msgid "-i <viminfo>\t\tUse <viminfo> instead of .viminfo" msgstr "-i <viminfo>\t\tВикориÑтати <viminfo> заміÑть .viminfo" -#: ../main.c:2243 msgid "-h or --help\tPrint Help (this message) and exit" msgstr "-h чи --help\tÐадрукувати це Ð¿Ð¾Ð²Ñ–Ð´Ð¾Ð¼Ð»ÐµÐ½Ð½Ñ Ñ– вийти" -#: ../main.c:2244 msgid "--version\t\tPrint version information and exit" msgstr "--version\t\tÐадрукувати інформацію про верÑÑ–ÑŽ програми Ñ– вийти" -#: ../mark.c:676 msgid "No marks set" msgstr "Ðе вÑтановлено жодної помітки" -#: ../mark.c:678 #, c-format msgid "E283: No marks matching \"%s\"" msgstr "E283: Помітку «%s» не знайдено" # msgstr "E283: " #. Highlight title -#: ../mark.c:687 msgid "" "\n" "mark line col file/text" @@ -3675,7 +2883,6 @@ msgstr "" "пом. Ñ€Ñд. кол. файл/текÑÑ‚" #. Highlight title -#: ../mark.c:789 msgid "" "\n" " jump line col file/text" @@ -3685,7 +2892,6 @@ msgstr "" # msgstr "E283: " #. Highlight title -#: ../mark.c:831 msgid "" "\n" "change line col text" @@ -3694,7 +2900,6 @@ msgstr "" "змінити Ñ€Ñд. Ñтовп. текÑÑ‚" # TODO -#: ../mark.c:1238 msgid "" "\n" "# File marks:\n" @@ -3703,7 +2908,6 @@ msgstr "" "# Помітки:\n" #. Write the jumplist with -' -#: ../mark.c:1271 msgid "" "\n" "# Jumplist (newest first):\n" @@ -3712,7 +2916,6 @@ msgstr "" "# СпиÑок переходів (від найновіших):\n" # TODO -#: ../mark.c:1352 msgid "" "\n" "# History of marks within files (newest to oldest):\n" @@ -3720,90 +2923,71 @@ msgstr "" "\n" "# Попередні помітки в файлах (від найновіших):\n" -#: ../mark.c:1431 msgid "Missing '>'" msgstr "Пропущено '>'" # msgstr "E292: " -#: ../memfile.c:426 msgid "E293: block was not locked" msgstr "E293: Блок не було зафікÑовано" # msgstr "E293: " -#: ../memfile.c:799 msgid "E294: Seek error in swap file read" msgstr "E294: Помилка зміни позиції у файлі обміну" -#: ../memfile.c:803 msgid "E295: Read error in swap file" msgstr "E295: Помилка Ð·Ñ‡Ð¸Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ñ„Ð°Ð¹Ð»Ñƒ обміну" -#: ../memfile.c:849 msgid "E296: Seek error in swap file write" msgstr "E296: Помилка зміни позиції під Ñ‡Ð°Ñ Ð·Ð°Ð¿Ð¸Ñу у файл обміну" -#: ../memfile.c:865 msgid "E297: Write error in swap file" msgstr "E297: Помилка запиÑу файлу обміну" -#: ../memfile.c:1036 msgid "E300: Swap file already exists (symlink attack?)" msgstr "E300: Файл обміну вже Ñ–Ñнує (атака Ñимвольним поÑиланнÑм?)" -#: ../memline.c:318 msgid "E298: Didn't get block nr 0?" msgstr "E298: Ðемає блоку 0?" -#: ../memline.c:361 msgid "E298: Didn't get block nr 1?" msgstr "E298: Ðемає блоку 1?" # msgstr "E298: " -#: ../memline.c:377 msgid "E298: Didn't get block nr 2?" msgstr "E298: Ðемає блоку 2?" #. could not (re)open the swap file, what can we do???? -#: ../memline.c:465 msgid "E301: Oops, lost the swap file!!!" msgstr "E301: Ой, втрачено файл обміну!!!" # msgstr "E301: " -#: ../memline.c:477 msgid "E302: Could not rename swap file" msgstr "E302: Ðе вдалоÑÑ Ð¿ÐµÑ€ÐµÐ¹Ð¼ÐµÐ½ÑƒÐ²Ð°Ñ‚Ð¸ файлу обміну" # msgstr "E302: " -#: ../memline.c:554 #, c-format msgid "E303: Unable to open swap file for \"%s\", recovery impossible" msgstr "E303: Ðе вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ файл обміну Ð´Ð»Ñ Â«%s», Ð²Ñ–Ð´Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð½ÐµÐ¼Ð¾Ð¶Ð»Ð¸Ð²Ðµ" -#: ../memline.c:666 msgid "E304: ml_upd_block0(): Didn't get block 0??" msgstr "E304: ml_upd_block0(): Ðемає блоку 0??" #. no swap files found -#: ../memline.c:830 #, c-format msgid "E305: No swap file found for %s" msgstr "E305: Ðе знайдено файлу обміну Ð´Ð»Ñ %s" # msgstr "E305: " -#: ../memline.c:839 msgid "Enter number of swap file to use (0 to quit): " msgstr "Введіть номер файлу обміну, котрий викориÑтати, (0 Ð´Ð»Ñ Ð²Ð¸Ñ…Ð¾Ð´Ñƒ):" -#: ../memline.c:879 #, c-format msgid "E306: Cannot open %s" msgstr "E306: Ðе вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ %s" -#: ../memline.c:897 msgid "Unable to read block 0 from " msgstr "Ðе вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ блок 0 з " -#: ../memline.c:900 msgid "" "\n" "Maybe no changes were made or Vim did not update the swap file." @@ -3811,28 +2995,22 @@ msgstr "" "\n" "Ðапевно, змін не було, або Vim не поновив файл обміну." -#: ../memline.c:909 msgid " cannot be used with this version of Vim.\n" msgstr " не можна викориÑтати з цією верÑією Vim.\n" -#: ../memline.c:911 msgid "Use Vim version 3.0.\n" msgstr "Знайдіть Vim 3.0\n" -#: ../memline.c:916 #, c-format msgid "E307: %s does not look like a Vim swap file" msgstr "E307: %s не Ñхоже на файл обміну Vim" -#: ../memline.c:922 msgid " cannot be used on this computer.\n" msgstr " не можна викориÑтати на цьому комп'ютері.\n" -#: ../memline.c:924 msgid "The file was created on " msgstr "Файл було Ñтворено на " -#: ../memline.c:928 msgid "" ",\n" "or the file has been damaged." @@ -3840,89 +3018,70 @@ msgstr "" ",\n" "або файл було пошкоджено." -#: ../memline.c:945 msgid " has been damaged (page size is smaller than minimum value).\n" msgstr " пошкоджений (розмір Ñторінки менший мінімального значеннÑ).\n" -#: ../memline.c:974 #, c-format msgid "Using swap file \"%s\"" msgstr "ВикориÑтовуєтьÑÑ Ñ„Ð°Ð¹Ð» обміну «%s»" -#: ../memline.c:980 #, c-format msgid "Original file \"%s\"" msgstr "Початковий файл «%s»" -#: ../memline.c:995 msgid "E308: Warning: Original file may have been changed" msgstr "E308: ЗаÑтереженнÑ: Можливо, початковий файл було змінено" # msgstr "E308: " -#: ../memline.c:1061 #, c-format msgid "E309: Unable to read block 1 from %s" msgstr "E309: Ðе вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ блок 1 з %s" # msgstr "E309: " -#: ../memline.c:1065 msgid "???MANY LINES MISSING" msgstr "??? БРÐКУЄ БÐГÐТЬОХ РЯДКІВ" -#: ../memline.c:1076 msgid "???LINE COUNT WRONG" msgstr "??? ÐЕПРÐВИЛЬÐРКІЛЬКІСТЬ РЯДКІВ" -#: ../memline.c:1082 msgid "???EMPTY BLOCK" msgstr "??? ПОРОЖÐІЙ БЛОК" -#: ../memline.c:1103 msgid "???LINES MISSING" msgstr "??? ПРОПУЩЕÐІ РЯДКИ" -#: ../memline.c:1128 #, c-format msgid "E310: Block 1 ID wrong (%s not a .swp file?)" msgstr "E310: Ідентифікатор блоку 1 неправильний (%s не Ñ” файлом обміну?)" # msgstr "E310: " -#: ../memline.c:1133 msgid "???BLOCK MISSING" msgstr "??? ПРОПУЩЕÐО БЛОК" -#: ../memline.c:1147 msgid "??? from here until ???END lines may be messed up" msgstr "??? звідÑи Ñ– до `??? КІÐЕЦЬ' Ñ€Ñдки, можливо, Ñплутані" -#: ../memline.c:1164 msgid "??? from here until ???END lines may have been inserted/deleted" msgstr "??? звідÑи Ñ– до `??? КІÐЕЦЬ' Ñ€Ñдки, можливо, були додані/знищені" -#: ../memline.c:1181 msgid "???END" msgstr "??? КІÐЕЦЬ" -#: ../memline.c:1238 msgid "E311: Recovery Interrupted" msgstr "E311: Ð’Ñ–Ð´Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð¿ÐµÑ€ÐµÑ€Ð²Ð°Ð½Ð¾" -#: ../memline.c:1243 msgid "" "E312: Errors detected while recovering; look for lines starting with ???" msgstr "" "E312: Під Ñ‡Ð°Ñ Ð²Ñ–Ð´Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð·Ð½Ð°Ð¹Ð´ÐµÐ½Ð¾ помилки. ПереглÑньте Ñ€Ñдки, що " "починаютьÑÑ Ð· ???" -#: ../memline.c:1245 msgid "See \":help E312\" for more information." msgstr "Див. «:help E312» Ð´Ð»Ñ ÑƒÑ‚Ð¾Ñ‡Ð½ÐµÐ½Ð½Ñ." -#: ../memline.c:1249 msgid "Recovery completed. You should check if everything is OK." msgstr "Ð’Ñ–Ð´Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð·Ð°ÐºÑ–Ð½Ñ‡ÐµÐ½Ð¾, перевірте чи вÑе гаразд." -#: ../memline.c:1251 msgid "" "\n" "(You might want to write out this file under another name\n" @@ -3930,15 +3089,12 @@ msgstr "" "\n" "(Можливо, потрібно запиÑати цей файл під іншою назвою\n" -#: ../memline.c:1252 msgid "and run diff with the original file to check for changes)" msgstr "Ñ– запуÑтити diff з оригіналом щоб перевірити зміни)" -#: ../memline.c:1254 msgid "Recovery completed. Buffer contents equals file contents." msgstr "Ð’Ñ–Ð´Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð·Ð°ÐºÑ–Ð½Ñ‡ÐµÐ½Ð¾. ВміÑÑ‚ буфера Ñпівпадає зі вміÑтом файлу." -#: ../memline.c:1255 msgid "" "\n" "You may want to delete the .swp file now.\n" @@ -3949,51 +3105,39 @@ msgstr "" "\n" #. use msg() to start the scrolling properly -#: ../memline.c:1327 msgid "Swap files found:" msgstr "Знайдено файли обміну:" -#: ../memline.c:1446 msgid " In current directory:\n" msgstr " Ð’ поточному каталозі:\n" -#: ../memline.c:1448 msgid " Using specified name:\n" msgstr " ВикориÑтовуючи вказану назву:\n" -#: ../memline.c:1450 msgid " In directory " msgstr " У каталозі " -#: ../memline.c:1465 msgid " -- none --\n" msgstr " -- жодного --\n" -#: ../memline.c:1527 msgid " owned by: " msgstr " влаÑник: " -#: ../memline.c:1529 msgid " dated: " msgstr " дата: " -#: ../memline.c:1532 ../memline.c:3231 msgid " dated: " msgstr " дата: " -#: ../memline.c:1548 msgid " [from Vim version 3.0]" msgstr " [від Vim 3.0]" -#: ../memline.c:1550 msgid " [does not look like a Vim swap file]" msgstr " [не Ñхоже на файл обміну]" -#: ../memline.c:1552 msgid " file name: " msgstr " назва файлу: " -#: ../memline.c:1558 msgid "" "\n" " modified: " @@ -4001,15 +3145,12 @@ msgstr "" "\n" " змінено: " -#: ../memline.c:1559 msgid "YES" msgstr "ТÐК" -#: ../memline.c:1559 msgid "no" msgstr "ні" -#: ../memline.c:1562 msgid "" "\n" " user name: " @@ -4017,11 +3158,9 @@ msgstr "" "\n" " кориÑтувач: " -#: ../memline.c:1568 msgid " host name: " msgstr " назва вузла: " -#: ../memline.c:1570 msgid "" "\n" " host name: " @@ -4029,7 +3168,6 @@ msgstr "" "\n" " назва вузла: " -#: ../memline.c:1575 msgid "" "\n" " process ID: " @@ -4037,11 +3175,9 @@ msgstr "" "\n" " ID процеÑу: " -#: ../memline.c:1579 msgid " (still running)" msgstr " (виконуєтьÑÑ)" -#: ../memline.c:1586 msgid "" "\n" " [not usable on this computer]" @@ -4049,106 +3185,84 @@ msgstr "" "\n" " [непридатний на цьому комп'ютері]" -#: ../memline.c:1590 msgid " [cannot be read]" msgstr " [не можна прочитати]" -#: ../memline.c:1593 msgid " [cannot be opened]" msgstr " [не можна відкрити]" -#: ../memline.c:1698 msgid "E313: Cannot preserve, there is no swap file" msgstr "E313: Ðе вдалоÑÑ Ð·Ð°Ð³Ð¾Ñ‚Ð¾Ð²Ð¸Ñ‚Ð¸, немає файлу обміну" # msgstr "E313: " -#: ../memline.c:1747 msgid "File preserved" msgstr "Файл збережено" -#: ../memline.c:1749 msgid "E314: Preserve failed" msgstr "E314: Ð—Ð±ÐµÑ€ÐµÐ¶ÐµÐ½Ð½Ñ Ð½Ðµ вдалоÑÑ" # msgstr "E314: " -#: ../memline.c:1819 #, c-format msgid "E315: ml_get: invalid lnum: %<PRId64>" msgstr "E315: ml_get: неправильний lnum: %<PRId64>" # msgstr "E315: " -#: ../memline.c:1851 #, c-format msgid "E316: ml_get: cannot find line %<PRId64>" msgstr "E316: ml_get: не знайшов Ñ€Ñдок %<PRId64>" # msgstr "E316: " -#: ../memline.c:2236 msgid "E317: pointer block id wrong 3" msgstr "E317: Вказівник блоку помилковий 3" # msgstr "E317: " -#: ../memline.c:2311 msgid "stack_idx should be 0" msgstr "stack_idx має бути рівним 0" -#: ../memline.c:2369 msgid "E318: Updated too many blocks?" msgstr "E318: Поновлено забагато блоків?" -#: ../memline.c:2511 msgid "E317: pointer block id wrong 4" msgstr "E317: Вказівник блоку помилковий 4" -#: ../memline.c:2536 msgid "deleted block 1?" msgstr "блок 1 знищено?" -#: ../memline.c:2707 #, c-format msgid "E320: Cannot find line %<PRId64>" msgstr "E320: Ðе вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ Ñ€Ñдок %<PRId64>" -#: ../memline.c:2916 msgid "E317: pointer block id wrong" msgstr "E317: Вказівник блоку помилковий" # msgstr "E317: " -#: ../memline.c:2930 msgid "pe_line_count is zero" msgstr "pe_line_count дорівнює 0" -#: ../memline.c:2955 #, c-format msgid "E322: line number out of range: %<PRId64> past the end" msgstr "E322: Ðомер Ñ€Ñдка вийшов за межі: %<PRId64> за кінцем" # msgstr "E322: " -#: ../memline.c:2959 #, c-format msgid "E323: line count wrong in block %<PRId64>" msgstr "E323: КількіÑть Ñ€Ñдків у блоці %<PRId64>" # msgstr "E323: " -#: ../memline.c:2999 msgid "Stack size increases" msgstr "Розмір Ñтеку збільшуєтьÑÑ" -#: ../memline.c:3038 msgid "E317: pointer block id wrong 2" msgstr "E317: Вказівник блоку помилковий 2" -#: ../memline.c:3070 #, c-format msgid "E773: Symlink loop for \"%s\"" msgstr "E773: Циклічні Ñимвольні поÑÐ¸Ð»Ð°Ð½Ð½Ñ Â«%s»" # msgstr "E317: " -#: ../memline.c:3221 msgid "E325: ATTENTION" msgstr "E325: УВÐГÐ" -#: ../memline.c:3222 msgid "" "\n" "Found a swap file by the name \"" @@ -4156,15 +3270,12 @@ msgstr "" "\n" "Знайдено файл обміну з назвою \"" -#: ../memline.c:3226 msgid "While opening file \"" msgstr "При відкритті файлу \"" -#: ../memline.c:3239 msgid " NEWER than swap file!\n" msgstr " ÐОВІШИЙ за файл обміну!\n" -#: ../memline.c:3244 msgid "" "\n" "(1) Another program may be editing the same file. If this is the case,\n" @@ -4176,19 +3287,15 @@ msgstr "" " будьте обережні, щоб не залишилиÑÑ Ð´Ð²Ð° різні екземплÑри\n" " одного й того Ñамого файлу піÑÐ»Ñ Ð·Ð¼Ñ–Ð½." -#: ../memline.c:3245 msgid " Quit, or continue with caution.\n" msgstr " Вийдіть або продовжуйте обережно.\n" -#: ../memline.c:3246 msgid "(2) An edit session for this file crashed.\n" msgstr "(2) Ð¡ÐµÐ°Ð½Ñ Ñ€ÐµÐ´Ð°Ð³ÑƒÐ²Ð°Ð½Ð½Ñ Ñ†ÑŒÐ¾Ð³Ð¾ файлу зазнав краху.\n" -#: ../memline.c:3247 msgid " If this is the case, use \":recover\" or \"vim -r " msgstr " Якщо це Ñправді трапилоÑÑ, Ñпробуйте «:recover» або «vim -r " -#: ../memline.c:3249 msgid "" "\"\n" " to recover the changes (see \":help recovery\").\n" @@ -4196,11 +3303,9 @@ msgstr "" "»\n" " щоб відновити зміни (див. «:help recovery»).\n" -#: ../memline.c:3250 msgid " If you did this already, delete the swap file \"" msgstr " Якщо ви вже це зробили, знищіть файл обміну «" -#: ../memline.c:3252 msgid "" "\"\n" " to avoid this message.\n" @@ -4209,23 +3314,18 @@ msgstr "" " щоб позбутиÑÑ Ñ†ÑŒÐ¾Ð³Ð¾ повідомленнÑ.\n" "\n" -#: ../memline.c:3450 ../memline.c:3452 msgid "Swap file \"" msgstr "Файл обміну «" -#: ../memline.c:3451 ../memline.c:3455 msgid "\" already exists!" msgstr "» вже Ñ–Ñнує!" -#: ../memline.c:3457 msgid "VIM - ATTENTION" msgstr "VIM — УВÐГÐ" -#: ../memline.c:3459 msgid "Swap file already exists!" msgstr "Файл обміну вже Ñ–Ñнує!" -#: ../memline.c:3464 msgid "" "&Open Read-Only\n" "&Edit anyway\n" @@ -4239,7 +3339,6 @@ msgstr "" "&Q:Вийти\n" "&A:Перервати" -#: ../memline.c:3467 msgid "" "&Open Read-Only\n" "&Edit anyway\n" @@ -4263,56 +3362,46 @@ msgstr "" #. #. ".s?a" #. ".saa": tried enough, give up -#: ../memline.c:3528 msgid "E326: Too many swap files found" msgstr "E326: Знайдено забагато файлів обміну" # msgstr "E341: " -#: ../memory.c:227 #, c-format msgid "E342: Out of memory! (allocating %<PRIu64> bytes)" msgstr "E342: Забракло пам'Ñті! (потрібно було %<PRIu64> байтів)" # msgstr "E326: " -#: ../menu.c:62 msgid "E327: Part of menu-item path is not sub-menu" msgstr "E327: ЧаÑтина шлÑху до елемента меню не Ñ” підменю" # msgstr "E327: " -#: ../menu.c:63 msgid "E328: Menu only exists in another mode" msgstr "E328: Меню може бути тільки в іншому режимі" # msgstr "E328: " -#: ../menu.c:64 #, c-format msgid "E329: No menu \"%s\"" msgstr "E329: Ðемає меню «%s»" #. Only a mnemonic or accelerator is not valid. -#: ../menu.c:329 msgid "E792: Empty menu name" msgstr "E792: ÐŸÐ¾Ñ€Ð¾Ð¶Ð½Ñ Ð½Ð°Ð·Ð²Ð° меню" # msgstr "E329: " -#: ../menu.c:340 msgid "E330: Menu path must not lead to a sub-menu" msgstr "E330: ШлÑÑ… до меню не повинен веÑти до підменю" # msgstr "E330: " -#: ../menu.c:365 msgid "E331: Must not add menu items directly to menu bar" msgstr "E331: Ðе можна додавати елементи меню проÑто до верхнього меню" # msgstr "E331: " -#: ../menu.c:370 msgid "E332: Separator cannot be part of a menu path" msgstr "E332: Роздільник не може бути чаÑтиною шлÑху меню" # msgstr "E332: " #. Now we have found the matching menu, and we list the mappings #. Highlight title -#: ../menu.c:762 msgid "" "\n" "--- Menus ---" @@ -4320,78 +3409,59 @@ msgstr "" "\n" "--- Меню ---" -#: ../menu.c:1313 msgid "E333: Menu path must lead to a menu item" msgstr "E333: ШлÑÑ… повинен веÑти до елемента меню" # msgstr "E333: " -#: ../menu.c:1330 #, c-format msgid "E334: Menu not found: %s" msgstr "E334: Меню не знайдено: %s" # msgstr "E334: " -#: ../menu.c:1396 #, c-format msgid "E335: Menu not defined for %s mode" msgstr "E335: Ð”Ð»Ñ Ñ€ÐµÐ¶Ð¸Ð¼Ñƒ %s меню не визначено" # msgstr "E335: " -#: ../menu.c:1426 msgid "E336: Menu path must lead to a sub-menu" msgstr "E336: ШлÑÑ… повинен веÑти до підменю" # msgstr "E336: " -#: ../menu.c:1447 msgid "E337: Menu not found - check menu names" msgstr "E337: Меню не знайдено — перевірте назву" # msgstr "E337: " -#: ../message.c:423 #, c-format msgid "Error detected while processing %s:" msgstr "ВиÑвлено помилку під Ñ‡Ð°Ñ Ð²Ð¸ÐºÐ¾Ð½Ð°Ð½Ð½Ñ %s:" -#: ../message.c:445 #, c-format msgid "line %4ld:" msgstr "Ñ€Ñдок %4ld:" -#: ../message.c:617 #, c-format msgid "E354: Invalid register name: '%s'" msgstr "E354: Ðеправильна назва регіÑтру: '%s'" -#: ../message.c:745 -msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>" -msgstr "УкраїнізаціÑ: Ðнатолій Сахнік <sakhnik@gmail.com>" - -#: ../message.c:986 msgid "Interrupt: " msgstr "Перервано: " -#: ../message.c:988 msgid "Press ENTER or type command to continue" msgstr "ÐатиÑніть ENTER або введіть команду Ð´Ð»Ñ Ð¿Ñ€Ð¾Ð´Ð¾Ð²Ð¶ÐµÐ½Ð½Ñ" -#: ../message.c:1843 #, c-format msgid "%s line %<PRId64>" msgstr "%s Ñ€Ñдок %<PRId64>" -#: ../message.c:2392 msgid "-- More --" msgstr "-- Ще --" -#: ../message.c:2398 msgid " SPACE/d/j: screen/page/line down, b/u/k: up, q: quit " msgstr " ПРОБІЛ/d/j: вниз на екран/Ñторінку/Ñ€Ñдок, b/u/k: вгору, q: вийти " -#: ../message.c:3021 ../message.c:3031 msgid "Question" msgstr "ЗапитаннÑ" -#: ../message.c:3023 msgid "" "&Yes\n" "&No" @@ -4399,7 +3469,6 @@ msgstr "" "&Y:Так\n" "&N:ÐÑ–" -#: ../message.c:3033 msgid "" "&Yes\n" "&No\n" @@ -4409,7 +3478,6 @@ msgstr "" "&N:ÐÑ–\n" "&C:СкаÑувати" -#: ../message.c:3045 msgid "" "&Yes\n" "&No\n" @@ -4423,178 +3491,139 @@ msgstr "" "&D:Жодного\n" "&C:СкаÑувати" -#: ../message.c:3058 msgid "E766: Insufficient arguments for printf()" msgstr "E766: ÐедоÑтатньо аргументів Ð´Ð»Ñ printf()" -#: ../message.c:3119 msgid "E807: Expected Float argument for printf()" msgstr "E807: ОчікуєтьÑÑ Ð°Ñ€Ð³ÑƒÐ¼ÐµÐ½Ñ‚ Float Ð´Ð»Ñ printf()" -#: ../message.c:3873 msgid "E767: Too many arguments to printf()" msgstr "E767: Забагато аргументів Ð´Ð»Ñ printf()" # msgstr "E338: " -#: ../misc1.c:2256 msgid "W10: Warning: Changing a readonly file" msgstr "W10: ЗаÑтереженнÑ: ЗмінюєтьÑÑ Ñ„Ð°Ð¹Ð» призначений лише Ð´Ð»Ñ Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ" -#: ../misc1.c:2537 msgid "Type number and <Enter> or click with mouse (empty cancels): " msgstr "Ðаберіть чиÑло й <Enter> чи клацніть мишкою (порожнє ÑкаÑовує): " -#: ../misc1.c:2539 msgid "Type number and <Enter> (empty cancels): " msgstr "Ðаберіть чиÑло й <Enter> (порожнє ÑкаÑовує): " -#: ../misc1.c:2585 msgid "1 more line" msgstr "додано один Ñ€Ñдок" -#: ../misc1.c:2588 msgid "1 line less" msgstr "знищено один Ñ€Ñдок" -#: ../misc1.c:2593 #, c-format msgid "%<PRId64> more lines" msgstr "додано Ñ€Ñдків: %<PRId64>" -#: ../misc1.c:2596 #, c-format msgid "%<PRId64> fewer lines" msgstr "знищено Ñ€Ñдків: %<PRId64>" -#: ../misc1.c:2599 msgid " (Interrupted)" msgstr " (Перервано)" -#: ../misc1.c:2635 msgid "Beep!" msgstr "Дзень!" # msgstr "E342: " -#: ../misc2.c:738 #, c-format msgid "Calling shell to execute: \"%s\"" msgstr "ВикликаєтьÑÑ Ð¾Ð±Ð¾Ð»Ð¾Ð½ÐºÐ° щоб виконати: «%s»" # msgstr "E348: " -#: ../normal.c:183 msgid "E349: No identifier under cursor" msgstr "E349: Ðемає ідентифікатора над курÑором" -#: ../normal.c:1866 msgid "E774: 'operatorfunc' is empty" msgstr "E774: 'operatorfunc' порожнÑ" -#: ../normal.c:2637 msgid "Warning: terminal cannot highlight" msgstr "ЗаÑтереженнÑ: Термінал не підтримує кольори" -#: ../normal.c:2807 msgid "E348: No string under cursor" msgstr "E348: Ðемає Ñ€Ñдка на курÑорі" -#: ../normal.c:3937 msgid "E352: Cannot erase folds with current 'foldmethod'" msgstr "E352: Ðе вдалоÑÑ Ð·Ð½Ð¸Ñ‰Ð¸Ñ‚Ð¸ згортки поточним методом 'foldmethod'" -#: ../normal.c:5897 msgid "E664: changelist is empty" msgstr "E664: СпиÑок змін порожній" -#: ../normal.c:5899 msgid "E662: At start of changelist" msgstr "E662: Початок ÑпиÑку змін" -#: ../normal.c:5901 msgid "E663: At end of changelist" msgstr "E663: Кінець ÑпиÑку змін" -#: ../normal.c:7053 msgid "Type :quit<Enter> to exit Nvim" msgstr "Уведіть :quit<Enter> щоб вийти з Vim" -#: ../ops.c:248 #, c-format msgid "1 line %sed 1 time" msgstr "Один Ñ€Ñдок %s-но" -#: ../ops.c:250 #, c-format msgid "1 line %sed %d times" msgstr "Один Ñ€Ñдок %s-но %d разів" -#: ../ops.c:253 #, c-format msgid "%<PRId64> lines %sed 1 time" msgstr "%<PRId64> Ñ€Ñдків %s-но" -#: ../ops.c:256 #, c-format msgid "%<PRId64> lines %sed %d times" msgstr "%<PRId64> Ñ€Ñдків %s-но %d разів" -#: ../ops.c:592 #, c-format msgid "%<PRId64> lines to indent... " msgstr "ЗалишилоÑÑ Ð²Ð¸Ñ€Ñ–Ð²Ð½Ñти %<PRId64> Ñ€Ñдків..." -#: ../ops.c:634 msgid "1 line indented " msgstr "ВирівнÑно один Ñ€Ñдок" -#: ../ops.c:636 #, c-format msgid "%<PRId64> lines indented " msgstr "ВирівнÑно Ñ€Ñдків: %<PRId64>" -#: ../ops.c:938 msgid "E748: No previously used register" msgstr "E748: РегіÑтри перед цим не вживалиÑÑŒ" #. must display the prompt -#: ../ops.c:1433 msgid "cannot yank; delete anyway" msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð°Ð¼'Ñтати; вÑе одно знищити?" -#: ../ops.c:1929 msgid "1 line changed" msgstr "Один Ñ€Ñдок змінено" -#: ../ops.c:1931 #, c-format msgid "%<PRId64> lines changed" msgstr "Змінено Ñ€Ñдків: %<PRId64>" -#: ../ops.c:2521 msgid "block of 1 line yanked" msgstr "Запам'Ñтав блок з одного Ñ€Ñдка" -#: ../ops.c:2523 msgid "1 line yanked" msgstr "Запам'Ñтав один Ñ€Ñдок" -#: ../ops.c:2525 #, c-format msgid "block of %<PRId64> lines yanked" msgstr "Запам'Ñтав блок із %<PRId64> Ñ€Ñдків" -#: ../ops.c:2528 #, c-format msgid "%<PRId64> lines yanked" msgstr "Запам'Ñтав Ñ€Ñдків: %<PRId64>" -#: ../ops.c:2710 #, c-format msgid "E353: Nothing in register %s" msgstr "E353: У регіÑтрі %s нічого немає" # msgstr "E353: " #. Highlight title -#: ../ops.c:3185 msgid "" "\n" "--- Registers ---" @@ -4602,11 +3631,9 @@ msgstr "" "\n" "--- РегіÑтри ---" -#: ../ops.c:4455 msgid "Illegal register name" msgstr "Ðеправильна назва регіÑтру" -#: ../ops.c:4533 msgid "" "\n" "# Registers:\n" @@ -4614,17 +3641,14 @@ msgstr "" "\n" "# РегіÑтри:\n" -#: ../ops.c:4575 #, c-format msgid "E574: Unknown register type %d" msgstr "E574: Ðевідомий тип регіÑтру %d" -#: ../ops.c:5089 #, c-format msgid "%<PRId64> Cols; " msgstr "довж.: %<PRId64>; " -#: ../ops.c:5097 #, c-format msgid "" "Selected %s%<PRId64> of %<PRId64> Lines; %<PRId64> of %<PRId64> Words; " @@ -4633,7 +3657,6 @@ msgstr "" "Вибрано %s%<PRId64> з %<PRId64> Ñ€Ñдків; %<PRId64> з %<PRId64> Ñлів; " "%<PRId64> з %<PRId64> байтів" -#: ../ops.c:5105 #, c-format msgid "" "Selected %s%<PRId64> of %<PRId64> Lines; %<PRId64> of %<PRId64> Words; " @@ -4642,7 +3665,6 @@ msgstr "" "Вибрано %s%<PRId64> з %<PRId64> Ñ€Ñдків; %<PRId64> з %<PRId64> Ñлів; " "%<PRId64> of %<PRId64> Ñимволів; %<PRId64> з %<PRId64> байтів" -#: ../ops.c:5123 #, c-format msgid "" "Col %s of %s; Line %<PRId64> of %<PRId64>; Word %<PRId64> of %<PRId64>; Byte " @@ -4651,7 +3673,6 @@ msgstr "" "Колонка %s з %s; Ñ€Ñдок %<PRId64> з %<PRId64>; Ñлово %<PRId64> з %<PRId64>; " "байт %<PRId64> з %<PRId64>" -#: ../ops.c:5133 #, c-format msgid "" "Col %s of %s; Line %<PRId64> of %<PRId64>; Word %<PRId64> of %<PRId64>; Char " @@ -4660,136 +3681,105 @@ msgstr "" "Колонка %s з %s; Ñ€Ñдок %<PRId64> з %<PRId64>; Ñлово %<PRId64> з %<PRId64>; " "Ñимвол %<PRId64> of %<PRId64>; байт %<PRId64> з %<PRId64>" -#: ../ops.c:5146 #, c-format msgid "(+%<PRId64> for BOM)" msgstr "(+%<PRId64> Ð´Ð»Ñ BOM)" -#: ../option.c:1238 msgid "%<%f%h%m%=Page %N" msgstr "%<%f%h%m%=Стор. %N" -#: ../option.c:1574 msgid "Thanks for flying Vim" msgstr "ДÑкуємо за вибір Vim" #. found a mismatch: skip -#: ../option.c:2698 msgid "E518: Unknown option" msgstr "E518: Ðевідома опціÑ" -#: ../option.c:2709 msgid "E519: Option not supported" msgstr "E519: ÐžÐ¿Ñ†Ñ–Ñ Ð½Ðµ підтримуєтьÑÑ" -#: ../option.c:2740 msgid "E520: Not allowed in a modeline" msgstr "E520: Ðе дозволено у modeline" -#: ../option.c:2815 msgid "E846: Key code not set" msgstr "E846: Код ключа не вÑтановлено" -#: ../option.c:2924 msgid "E521: Number required after =" msgstr "E521: ПіÑÐ»Ñ = потрібно вказати чиÑло" -#: ../option.c:3226 ../option.c:3864 msgid "E522: Not found in termcap" msgstr "E522: Ðе знайдено Ñеред можливоÑтей терміналів" -#: ../option.c:3335 #, c-format msgid "E539: Illegal character <%s>" msgstr "E539: Ðедозволений Ñимвол <%s>" -#: ../option.c:3862 msgid "E529: Cannot set 'term' to empty string" msgstr "E529: Ðе вдалоÑÑ Ñпорожнити 'term'" -#: ../option.c:3885 msgid "E589: 'backupext' and 'patchmode' are equal" msgstr "E589: Опції 'backupext' Ñ– 'patchmode' однакові" -#: ../option.c:3964 msgid "E834: Conflicts with value of 'listchars'" msgstr "E834: Конфліктує із значеннÑм 'listchars'" -#: ../option.c:3966 msgid "E835: Conflicts with value of 'fillchars'" msgstr "E835: Конфліктує із значеннÑм 'fillchars'" -#: ../option.c:4163 msgid "E524: Missing colon" msgstr "E524: Бракує двокрапки" -#: ../option.c:4165 msgid "E525: Zero length string" msgstr "E525: Ð Ñдок порожній" -#: ../option.c:4220 #, c-format msgid "E526: Missing number after <%s>" msgstr "E526: ПіÑÐ»Ñ <%s> бракує чиÑла" -#: ../option.c:4232 msgid "E527: Missing comma" msgstr "E527: Бракує коми" -#: ../option.c:4239 msgid "E528: Must specify a ' value" msgstr "E528: Потрібно вказати Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ '" -#: ../option.c:4271 msgid "E595: contains unprintable or wide character" msgstr "E595: МіÑтить недруковні або розширені Ñимволи" -#: ../option.c:4469 #, c-format msgid "E535: Illegal character after <%c>" msgstr "E535: Ðедозволений Ñимвол піÑÐ»Ñ <%c>" -#: ../option.c:4534 msgid "E536: comma required" msgstr "E536: Потрібна кома" -#: ../option.c:4543 #, c-format msgid "E537: 'commentstring' must be empty or contain %s" msgstr "E537: 'commentstring' має бути порожньою чи міÑтити %s" -#: ../option.c:4928 msgid "E540: Unclosed expression sequence" msgstr "E540: ПоÑлідовніÑть виразів не завершено" -#: ../option.c:4932 msgid "E541: too many items" msgstr "E541: Забагато елементів" -#: ../option.c:4934 msgid "E542: unbalanced groups" msgstr "E542: Групи не збаланÑовано" -#: ../option.c:5148 msgid "E590: A preview window already exists" msgstr "E590: Вікно переглÑду вже Ñ–Ñнує" -#: ../option.c:5311 msgid "W17: Arabic requires UTF-8, do ':set encoding=utf-8'" msgstr "" "W17: Ð”Ð»Ñ Ð°Ñ€Ð°Ð±Ñької мови потрібне UTF-8, виконайте ':set encoding=utf-8'" -#: ../option.c:5623 #, c-format msgid "E593: Need at least %d lines" msgstr "E593: Потрібно щонайменше %d Ñ€Ñдків" -#: ../option.c:5631 #, c-format msgid "E594: Need at least %d columns" msgstr "E594: Потрібно щонайменше %d Ñтовпців" -#: ../option.c:6011 #, c-format msgid "E355: Unknown option: %s" msgstr "E355: Ðевідома опціÑ: %s" @@ -4797,13 +3787,11 @@ msgstr "E355: Ðевідома опціÑ: %s" #. There's another character after zeros or the string #. * is empty. In both cases, we are trying to set a #. * num option using a string. -#: ../option.c:6037 #, c-format msgid "E521: Number required: &%s = '%s'" msgstr "E521: Потрібно вказати Number: &%s = '%s'" # msgstr "E355: " -#: ../option.c:6149 msgid "" "\n" "--- Terminal codes ---" @@ -4811,7 +3799,6 @@ msgstr "" "\n" "--- Коди терміналу ---" -#: ../option.c:6151 msgid "" "\n" "--- Global option values ---" @@ -4819,7 +3806,6 @@ msgstr "" "\n" "--- Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð·Ð°Ð³Ð°Ð»ÑŒÐ½Ð¸Ñ… опцій ---" -#: ../option.c:6153 msgid "" "\n" "--- Local option values ---" @@ -4827,7 +3813,6 @@ msgstr "" "\n" "--- Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð»Ð¾ÐºÐ°Ð»ÑŒÐ½Ð¸Ñ… опцій ---" -#: ../option.c:6155 msgid "" "\n" "--- Options ---" @@ -4835,23 +3820,19 @@ msgstr "" "\n" "--- Опції ---" -#: ../option.c:6816 msgid "E356: get_varp ERROR" msgstr "E356: Помилка get_varp" # msgstr "E356: " -#: ../option.c:7696 #, c-format msgid "E357: 'langmap': Matching character missing for %s" msgstr "E357: 'langmap': Ð”Ð»Ñ Ñимволу %s немає пари" # msgstr "E357: " -#: ../option.c:7715 #, c-format msgid "E358: 'langmap': Extra characters after semicolon: %s" msgstr "E358: 'langmap': Зайві Ñимволи піÑÐ»Ñ `;': %s" -#: ../os/shell.c:194 msgid "" "\n" "Cannot execute shell " @@ -4860,7 +3841,6 @@ msgstr "" "Ðе вдалоÑÑ Ð·Ð°Ð¿ÑƒÑтити оболонку" # msgstr "E362: " -#: ../os/shell.c:439 msgid "" "\n" "shell returned " @@ -4868,7 +3848,6 @@ msgstr "" "\n" "оболонка повернула: " -#: ../os_unix.c:465 ../os_unix.c:471 msgid "" "\n" "Could not get security context for " @@ -4876,7 +3855,6 @@ msgstr "" "\n" "Ðе вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ контекÑÑ‚ безпеки Ð´Ð»Ñ " -#: ../os_unix.c:479 msgid "" "\n" "Could not set security context for " @@ -4884,234 +3862,187 @@ msgstr "" "\n" "Ðе вдалоÑÑ Ð²Ñтановити контекÑÑ‚ безпеки Ð´Ð»Ñ " -#: ../os_unix.c:1558 ../os_unix.c:1647 #, c-format msgid "dlerror = \"%s\"" msgstr "dlerror = «%s»" # msgstr "E446: " -#: ../path.c:1449 #, c-format msgid "E447: Can't find file \"%s\" in path" msgstr "E447: Файл «%s» не знайдено у шлÑху пошуку" # msgstr "E371: " -#: ../quickfix.c:359 #, c-format msgid "E372: Too many %%%c in format string" msgstr "E372: Забагато %%%c у Ñ€Ñдку формату" # msgstr "E372: " -#: ../quickfix.c:371 #, c-format msgid "E373: Unexpected %%%c in format string" msgstr "E373: Ðеочікуваний `%%%c' у Ñ€Ñдку формату" # msgstr "E373: " -#: ../quickfix.c:420 msgid "E374: Missing ] in format string" msgstr "E374: Пропущено ] у Ñ€Ñдку формату" # msgstr "E374: " -#: ../quickfix.c:431 #, c-format msgid "E375: Unsupported %%%c in format string" msgstr "E375: %%%c у Ñ€Ñдку формату не підтримуєтьÑÑ" # msgstr "E375: " -#: ../quickfix.c:448 #, c-format msgid "E376: Invalid %%%c in format string prefix" msgstr "E376: Помилковий `%%%c' у префікÑÑ– Ñ€Ñдку формату" # msgstr "E376: " -#: ../quickfix.c:454 #, c-format msgid "E377: Invalid %%%c in format string" msgstr "E377: Помилковий `%%%c' у Ñ€Ñдку формату" # msgstr "E377: " #. nothing found -#: ../quickfix.c:477 msgid "E378: 'errorformat' contains no pattern" msgstr "E378: 'errorformat' не міÑтить зразок" # msgstr "E378: " -#: ../quickfix.c:695 msgid "E379: Missing or empty directory name" msgstr "E379: Пропущена чи Ð¿Ð¾Ñ€Ð¾Ð¶Ð½Ñ Ð½Ð°Ð·Ð²Ð° каталогу" -#: ../quickfix.c:1305 msgid "E553: No more items" msgstr "E553: Ðемає більше елементів" -#: ../quickfix.c:1674 #, c-format msgid "(%d of %d)%s%s: " msgstr "(%d з %d)%s%s: " -#: ../quickfix.c:1676 msgid " (line deleted)" msgstr " (Ñ€Ñдок знищено)" -#: ../quickfix.c:1863 msgid "E380: At bottom of quickfix stack" msgstr "E380: Дно Ñтеку виправлень" -#: ../quickfix.c:1869 msgid "E381: At top of quickfix stack" msgstr "E381: Вершина Ñтеку виправлень" -#: ../quickfix.c:1880 #, c-format msgid "error list %d of %d; %d errors" msgstr "ÑпиÑок помилок %d з %d; %d помилок" -#: ../quickfix.c:2427 msgid "E382: Cannot write, 'buftype' option is set" msgstr "E382: Ðе можу запиÑати, вказана Ð¾Ð¿Ñ†Ñ–Ñ 'buftype'" -#: ../quickfix.c:2812 msgid "E683: File name missing or invalid pattern" msgstr "E683: Пропущено назву файлу чи некоректний шаблон" -#: ../quickfix.c:2911 #, c-format msgid "Cannot open file \"%s\"" msgstr "Ðе вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ файл «%s»" -#: ../quickfix.c:3429 msgid "E681: Buffer is not loaded" msgstr "E681: Буфер не завантажено" -#: ../quickfix.c:3487 msgid "E777: String or List expected" msgstr "E777: ОчікуєтьÑÑ String чи List" -#: ../regexp.c:359 #, c-format msgid "E369: invalid item in %s%%[]" msgstr "E369: Ðекоректний елемент у %s%%[]" -#: ../regexp.c:374 #, c-format msgid "E769: Missing ] after %s[" msgstr "E769: Бракує ] піÑÐ»Ñ %s[" -#: ../regexp.c:375 #, c-format msgid "E53: Unmatched %s%%(" msgstr "E53: Ðемає пари %s%%(" -#: ../regexp.c:376 #, c-format msgid "E54: Unmatched %s(" msgstr "E54: Ðемає пари %s(" -#: ../regexp.c:377 #, c-format msgid "E55: Unmatched %s)" msgstr "E55: Ðемає пари %s)" # msgstr "E406: " -#: ../regexp.c:378 msgid "E66: \\z( not allowed here" msgstr "E66: \\z( тут не дозволено" # msgstr "E406: " -#: ../regexp.c:379 msgid "E67: \\z1 et al. not allowed here" msgstr "E67: \\z1 та ін. тут не дозволено" -#: ../regexp.c:380 #, c-format msgid "E69: Missing ] after %s%%[" msgstr "E69: Пропущено ] піÑÐ»Ñ %s%%[" -#: ../regexp.c:381 #, c-format msgid "E70: Empty %s%%[]" msgstr "E70: %s%%[] порожній" # msgstr "E382: " -#: ../regexp.c:1209 ../regexp.c:1224 msgid "E339: Pattern too long" msgstr "E339: Зразок занадто довгий" -#: ../regexp.c:1371 msgid "E50: Too many \\z(" msgstr "E50: Забагато \\z(" -#: ../regexp.c:1378 #, c-format msgid "E51: Too many %s(" msgstr "E51: Забагато %s(" -#: ../regexp.c:1427 msgid "E52: Unmatched \\z(" msgstr "E52: Ðемає пари \\z(" -#: ../regexp.c:1637 #, c-format msgid "E59: invalid character after %s@" msgstr "E59: Ðедозволений Ñимвол піÑÐ»Ñ %s@" -#: ../regexp.c:1672 #, c-format msgid "E60: Too many complex %s{...}s" msgstr "E60: Забагато Ñкладних %s{...}" # msgstr "E339: " -#: ../regexp.c:1687 #, c-format msgid "E61: Nested %s*" msgstr "E61: Вкладені %s*" # msgstr "E61: " -#: ../regexp.c:1690 #, c-format msgid "E62: Nested %s%c" msgstr "E62: Вкладені %s%c" -#: ../regexp.c:1800 msgid "E63: invalid use of \\_" msgstr "E63: Ðекоректно вжито \\_" # msgstr "E62: " -#: ../regexp.c:1850 #, c-format msgid "E64: %s%c follows nothing" msgstr "E64: ПіÑÐ»Ñ %s%c нічого немає" -#: ../regexp.c:1902 msgid "E65: Illegal back reference" msgstr "E65: Ðекоректне зворотнє поÑиланнÑ" -#: ../regexp.c:1943 msgid "E68: Invalid character after \\z" msgstr "E68: Ðеправильний Ñимвол піÑÐ»Ñ \\z" -#: ../regexp.c:2049 ../regexp_nfa.c:1296 #, c-format msgid "E678: Invalid character after %s%%[dxouU]" msgstr "E678: Ðедозволений Ñимвол піÑÐ»Ñ %s%%[dxouU]" -#: ../regexp.c:2107 #, c-format msgid "E71: Invalid character after %s%%" msgstr "E71: Ðедозволений Ñимвол піÑÐ»Ñ %s%%" # msgstr "E64: " -#: ../regexp.c:3017 #, c-format msgid "E554: Syntax error in %s{...}" msgstr "E554: СинтакÑична помилка в %s{...}" -#: ../regexp.c:3805 msgid "External submatches:\n" msgstr "Зовнішні під-збіги:\n" -#: ../regexp.c:7022 msgid "" "E864: \\%#= can only be followed by 0, 1, or 2. The automatic engine will be " "used " @@ -5119,62 +4050,49 @@ msgstr "" "E864: піÑÐ»Ñ \\%#= може бути тільки 0, 1, or 2. Буде викориÑтано автоматичний " "механізм " -#: ../regexp_nfa.c:239 msgid "E865: (NFA) Regexp end encountered prematurely" msgstr "E865: (NFA) Зарано трапивÑÑ ÐºÑ–Ð½ÐµÑ†ÑŒ регулÑрного виразу" -#: ../regexp_nfa.c:240 #, c-format msgid "E866: (NFA regexp) Misplaced %c" msgstr "E866: (NFA regexp) Ðе на міÑці %c" -#: ../regexp_nfa.c:242 #, c-format msgid "E877: (NFA regexp) Invalid character class: %<PRId64>" -msgstr "" +msgstr "E877: (NFA regexp) Ðеправильний ÐºÐ»Ð°Ñ Ñимволів: %<PRId64>" -#: ../regexp_nfa.c:1261 #, c-format msgid "E867: (NFA) Unknown operator '\\z%c'" msgstr "E867: (NFA) Ðевідомий оператор '\\z%c'" -#: ../regexp_nfa.c:1387 #, c-format msgid "E867: (NFA) Unknown operator '\\%%%c'" msgstr "E867: (NFA) Ðевідомий оператор '\\%%%c'" -#: ../regexp_nfa.c:1802 #, c-format msgid "E869: (NFA) Unknown operator '\\@%c'" msgstr "E869: (NFA) Ðевідомий оператор '\\@%c'" -#: ../regexp_nfa.c:1831 msgid "E870: (NFA regexp) Error reading repetition limits" msgstr "E870: (NFA regexp) Ðе вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ межі повтореннÑ" #. Can't have a multi follow a multi. -#: ../regexp_nfa.c:1895 msgid "E871: (NFA regexp) Can't have a multi follow a multi !" msgstr "E871: (NFA regexp) Мульти не може бути за мульти!" #. Too many `(' -#: ../regexp_nfa.c:2037 msgid "E872: (NFA regexp) Too many '('" msgstr "E872: (NFA regexp) Забагато '('" -#: ../regexp_nfa.c:2042 msgid "E879: (NFA regexp) Too many \\z(" msgstr "E879: (NFA regexp) Забагато \\z(" -#: ../regexp_nfa.c:2066 msgid "E873: (NFA regexp) proper termination error" msgstr "E873: (NFA regexp) помилка належного припиненнÑ" -#: ../regexp_nfa.c:2599 msgid "E874: (NFA) Could not pop the stack !" msgstr "E874: (NFA) Стек порожній!" -#: ../regexp_nfa.c:3298 msgid "" "E875: (NFA regexp) (While converting from postfix to NFA), too many states " "left on stack" @@ -5182,178 +4100,137 @@ msgstr "" "E875: (NFA regexp) (Під Ñ‡Ð°Ñ Ð¿ÐµÑ€ÐµÑ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ Ð· поÑÑ‚Ñ„Ñ–ÐºÑ Ñƒ NFA) залишилоÑÑ " "забагато Ñтанів у Ñтеку" -#: ../regexp_nfa.c:3302 msgid "E876: (NFA regexp) Not enough space to store the whole NFA " msgstr "E876: (NFA regexp) ÐедоÑтатньо пам’Ñті, щоб зберегти веÑÑŒ NFA " -#: ../regexp_nfa.c:4571 ../regexp_nfa.c:4869 msgid "" "Could not open temporary log file for writing, displaying on stderr ... " msgstr "" "Ðе вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ тимчаÑовий файл журналу Ð´Ð»Ñ Ð·Ð°Ð¿Ð¸Ñу, показуєтьÑÑ Ð½Ð° " "stderr ... " -#: ../regexp_nfa.c:4840 #, c-format msgid "(NFA) COULD NOT OPEN %s !" msgstr "(NFA) ÐЕ ВДÐЛОСЯ ВІДКРИТИ %s!" -#: ../regexp_nfa.c:6049 msgid "Could not open temporary log file for writing " msgstr "Ðе вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ тимчаÑовий файл журналу Ð´Ð»Ñ Ð·Ð°Ð¿Ð¸Ñу " -#: ../screen.c:7435 msgid " VREPLACE" msgstr " ВІРТ ЗÐМІÐÐ" -#: ../screen.c:7437 msgid " REPLACE" msgstr " ЗÐМІÐÐ" -#: ../screen.c:7440 msgid " REVERSE" msgstr " ÐÐВИВОРІТ" -#: ../screen.c:7441 msgid " INSERT" msgstr " ВСТÐВКÐ" -#: ../screen.c:7443 msgid " (insert)" msgstr " (вÑтавка)" -#: ../screen.c:7445 msgid " (replace)" msgstr " (заміна)" -#: ../screen.c:7447 msgid " (vreplace)" msgstr " (вірт заміна)" -#: ../screen.c:7449 msgid " Hebrew" msgstr " Іврит" -#: ../screen.c:7454 msgid " Arabic" msgstr " ÐрабÑька" -#: ../screen.c:7456 msgid " (lang)" msgstr " (мова)" -#: ../screen.c:7459 msgid " (paste)" msgstr " (клей)" -#: ../screen.c:7469 msgid " VISUAL" msgstr " ВИБІР" -#: ../screen.c:7470 msgid " VISUAL LINE" msgstr " ВИБІРРЯДКІВ" -#: ../screen.c:7471 msgid " VISUAL BLOCK" msgstr " ВИБІРБЛОКУ" -#: ../screen.c:7472 msgid " SELECT" msgstr " ВИДІЛЕÐÐЯ" -#: ../screen.c:7473 msgid " SELECT LINE" msgstr " ВИДІЛЕÐÐЯ РЯДКІВ" -#: ../screen.c:7474 msgid " SELECT BLOCK" msgstr " ВИДІЛЕÐÐЯ БЛОКУ" -#: ../screen.c:7486 ../screen.c:7541 msgid "recording" msgstr "йде запиÑ" -#: ../search.c:487 #, c-format msgid "E383: Invalid search string: %s" msgstr "E383: Ðеправильний зразок Ð´Ð»Ñ Ð¿Ð¾ÑˆÑƒÐºÑƒ: %s" -#: ../search.c:832 #, c-format msgid "E384: search hit TOP without match for: %s" msgstr "E384: Пошук дійшов до ПОЧÐТКУ без збігів з %s" -#: ../search.c:835 #, c-format msgid "E385: search hit BOTTOM without match for: %s" msgstr "E385: Пошук дійшов до КІÐЦЯ без збігів з %s" -#: ../search.c:1200 msgid "E386: Expected '?' or '/' after ';'" msgstr "E386: ПіÑÐ»Ñ `;' має бути `?' або `/'" # msgstr "E386: " -#: ../search.c:4085 msgid " (includes previously listed match)" msgstr " (разом з попередніми збігами)" #. cursor at status line -#: ../search.c:4104 msgid "--- Included files " msgstr "--- Включені файли " -#: ../search.c:4106 msgid "not found " msgstr "не знайдено " -#: ../search.c:4107 msgid "in path ---\n" msgstr "у шлÑху пошуку ---\n" -#: ../search.c:4168 msgid " (Already listed)" msgstr " (Уже у ÑпиÑку)" -#: ../search.c:4170 msgid " NOT FOUND" msgstr " ÐЕ ЗÐÐЙДЕÐО" -#: ../search.c:4211 #, c-format msgid "Scanning included file: %s" msgstr "Пошук у включеному файлі: %s" -#: ../search.c:4216 #, c-format msgid "Searching included file %s" msgstr "ШукаєтьÑÑ Ñƒ включеному файлі %s" -#: ../search.c:4405 msgid "E387: Match is on current line" msgstr "E387: Збіг у поточному Ñ€Ñдку" -#: ../search.c:4517 msgid "All included files were found" msgstr "Були знайдені вÑÑ– включені файли" -#: ../search.c:4519 msgid "No included files" msgstr "Жодного включеного файлу" -#: ../search.c:4527 msgid "E388: Couldn't find definition" msgstr "E388: Ð’Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð½Ðµ знайдено" -#: ../search.c:4529 msgid "E389: Couldn't find pattern" msgstr "E389: Зразок не знайдено" -#: ../search.c:4668 msgid "Substitute " msgstr "Заміна " -#: ../search.c:4681 #, c-format msgid "" "\n" @@ -5364,100 +4241,79 @@ msgstr "" "# ОÑÑ‚. %sЗразок пошуку:\n" "~" -#: ../spell.c:951 msgid "E759: Format error in spell file" msgstr "E759: Помилка формату у файлі орфографії" # msgstr "E364: " -#: ../spell.c:952 msgid "E758: Truncated spell file" msgstr "E758: Обірваний файл орфографії" -#: ../spell.c:953 #, c-format msgid "Trailing text in %s line %d: %s" msgstr "Зайвий текÑÑ‚ у %s у Ñ€Ñдку %d: %s" -#: ../spell.c:954 #, c-format msgid "Affix name too long in %s line %d: %s" msgstr "Ðазва афікÑу завелика у %s у Ñ€Ñдку %d: %s" # msgstr "E430: " -#: ../spell.c:955 msgid "E761: Format error in affix file FOL, LOW or UPP" msgstr "E761: Помилка формату у файлі афікÑів FOL, LOW чи UPP" -#: ../spell.c:957 msgid "E762: Character in FOL, LOW or UPP is out of range" msgstr "E762: Символ у FOL, LOW чи UPP поза межами" -#: ../spell.c:958 msgid "Compressing word tree..." msgstr "СтиÑкуєтьÑÑ Ð´ÐµÑ€ÐµÐ²Ð¾ Ñлів..." -#: ../spell.c:1951 msgid "E756: Spell checking is not enabled" msgstr "E756: Перевірка орфографії не дозволена" -#: ../spell.c:2249 #, c-format msgid "Warning: Cannot find word list \"%s.%s.spl\" or \"%s.ascii.spl\"" msgstr "" "ЗаÑтереженнÑ: Ðе вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ ÑпиÑок Ñлів «%s.%s.spl» чи «%s.ascii.spl»" -#: ../spell.c:2473 #, c-format msgid "Reading spell file \"%s\"" msgstr "ЧитаєтьÑÑ Ñ„Ð°Ð¹Ð» орфографії «%s»" -#: ../spell.c:2496 msgid "E757: This does not look like a spell file" msgstr "E757: Ðе Ñхоже на файл орфографії" -#: ../spell.c:2501 msgid "E771: Old spell file, needs to be updated" msgstr "E771: Файл орфографії Ñтарий, треба поновити" -#: ../spell.c:2504 msgid "E772: Spell file is for newer version of Vim" msgstr "E772: Файл орфографії призначений Ð´Ð»Ñ Ð±Ñ–Ð»ÑŒÑˆ нової верÑÑ–Ñ— Vim" -#: ../spell.c:2602 msgid "E770: Unsupported section in spell file" msgstr "E770: Ðедозволена ÑÐµÐºÑ†Ñ–Ñ Ñƒ файлі орфографії" -#: ../spell.c:3762 #, c-format msgid "Warning: region %s not supported" msgstr "ЗаÑтереженнÑ: регіон %s не підтримуєтьÑÑ" -#: ../spell.c:4550 #, c-format msgid "Reading affix file %s ..." msgstr "ЧитаєтьÑÑ Ñ„Ð°Ð¹Ð» афікÑів %s ..." -#: ../spell.c:4589 ../spell.c:5635 ../spell.c:6140 #, c-format msgid "Conversion failure for word in %s line %d: %s" msgstr "Помилка Ð¿ÐµÑ€ÐµÑ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ Ñлова у %s у Ñ€Ñдку %d: %s" -#: ../spell.c:4630 ../spell.c:6170 #, c-format msgid "Conversion in %s not supported: from %s to %s" msgstr "ÐŸÐµÑ€ÐµÑ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ Ñƒ %s не підтримуєтьÑÑ: з %s до %s" -#: ../spell.c:4642 #, c-format msgid "Invalid value for FLAG in %s line %d: %s" msgstr "Ðекоректне Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ FLAG у %s у Ñ€Ñдку %d: %s" -#: ../spell.c:4655 #, c-format msgid "FLAG after using flags in %s line %d: %s" msgstr "FLAG піÑÐ»Ñ Ð²Ð¸ÐºÐ¾Ñ€Ð¸ÑÑ‚Ð°Ð½Ð½Ñ Ð¿Ñ€Ð°Ð¿Ð¾Ñ€Ñ†Ñ–Ð² у %s у Ñ€Ñдку %d: %s" -#: ../spell.c:4723 #, c-format msgid "" "Defining COMPOUNDFORBIDFLAG after PFX item may give wrong results in %s line " @@ -5466,7 +4322,6 @@ msgstr "" "Ð’Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ COMPOUNDFORBIDFLAG піÑÐ»Ñ ÐµÐ»ÐµÐ¼ÐµÐ½Ñ‚Ñƒ PFX може дати неправильний " "результат у %s у Ñ€Ñдку %d" -#: ../spell.c:4731 #, c-format msgid "" "Defining COMPOUNDPERMITFLAG after PFX item may give wrong results in %s line " @@ -5475,43 +4330,35 @@ msgstr "" "Ð’Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ COMPOUNDPERMITFLAG піÑÐ»Ñ ÐµÐ»ÐµÐ¼ÐµÐ½Ñ‚Ñƒ PFX можу дати неправильний " "результат у %s у Ñ€Ñдку %d" -#: ../spell.c:4747 #, c-format msgid "Wrong COMPOUNDRULES value in %s line %d: %s" msgstr "Ðеправильне Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ COMPOUNDRULES у %s у Ñ€Ñдку %d: %s" -#: ../spell.c:4771 #, c-format msgid "Wrong COMPOUNDWORDMAX value in %s line %d: %s" msgstr "Ðеправильне Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ COMPOUNDWORDMAX у %s у Ñ€Ñдку %d: %s" -#: ../spell.c:4777 #, c-format msgid "Wrong COMPOUNDMIN value in %s line %d: %s" msgstr "Ðеправильне Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ COMPOUNDMIN у %s у Ñ€Ñдку %d: %s" -#: ../spell.c:4783 #, c-format msgid "Wrong COMPOUNDSYLMAX value in %s line %d: %s" msgstr "Ðеправильне Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ COMPOUNDSYLMAX у %s у Ñ€Ñдку %d: %s" -#: ../spell.c:4795 #, c-format msgid "Wrong CHECKCOMPOUNDPATTERN value in %s line %d: %s" msgstr "Ðеправильне Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ CHECKCOMPOUNDPATTERN у %s у Ñ€Ñдку %d: %s" -#: ../spell.c:4847 #, c-format msgid "Different combining flag in continued affix block in %s line %d: %s" msgstr "" "Інший прапорець комбінації у продовженні блоку афікÑів у %s у Ñ€Ñдку %d: %s" -#: ../spell.c:4850 #, c-format msgid "Duplicate affix in %s line %d: %s" msgstr "Подвійний Ð°Ñ„Ñ–ÐºÑ Ñƒ %s у Ñ€Ñдку %d: %s" -#: ../spell.c:4871 #, c-format msgid "" "Affix also used for BAD/RARE/KEEPCASE/NEEDAFFIX/NEEDCOMPOUND/NOSUGGEST in %s " @@ -5520,337 +4367,268 @@ msgstr "" "ÐÑ„Ñ–ÐºÑ Ñ‚Ð°ÐºÐ¾Ð¶ викориÑтовуєтьÑÑ Ð´Ð»Ñ BAD/RARE/KEEPCASE/NEEDAFFIX/NEEDCOMPOUND/" "NOSUGGEST у %s у Ñ€Ñдку %d: %s" -#: ../spell.c:4893 #, c-format msgid "Expected Y or N in %s line %d: %s" msgstr "Треба Y чи N у %s у Ñ€Ñдку %d: %s" -#: ../spell.c:4968 #, c-format msgid "Broken condition in %s line %d: %s" msgstr "Ðепридатна умова у %s у Ñ€Ñдку %d: %s" -#: ../spell.c:5091 #, c-format msgid "Expected REP(SAL) count in %s line %d" msgstr "Треба кількіÑть REP(SAL) у %s у Ñ€Ñдку %d" -#: ../spell.c:5120 #, c-format msgid "Expected MAP count in %s line %d" msgstr "Треба кількіÑть MAP у %s у Ñ€Ñдку %d" -#: ../spell.c:5132 #, c-format msgid "Duplicate character in MAP in %s line %d" msgstr "ÐŸÐ¾Ð²Ñ‚Ð¾Ñ€ÐµÐ½Ð½Ñ Ñимволу у MAP у %s у Ñ€Ñдку %d" -#: ../spell.c:5176 #, c-format msgid "Unrecognized or duplicate item in %s line %d: %s" msgstr "Ðерозпізнаний чи повторний елемент у %s у Ñ€Ñдку %d: %s" -#: ../spell.c:5197 #, c-format msgid "Missing FOL/LOW/UPP line in %s" msgstr "Пропущено Ñ€Ñдок FOL/LOW/UPP у %s" -#: ../spell.c:5220 msgid "COMPOUNDSYLMAX used without SYLLABLE" msgstr "Вжито COMPOUNDSYLMAX без SYLLABLE" -#: ../spell.c:5236 msgid "Too many postponed prefixes" msgstr "Забагато відкладених префікÑів" -#: ../spell.c:5238 msgid "Too many compound flags" msgstr "Забагато Ñкладних прапорців" -#: ../spell.c:5240 msgid "Too many postponed prefixes and/or compound flags" msgstr "Забагато відкладених префікÑів Ñ–/або Ñкладних прапорців" -#: ../spell.c:5250 #, c-format msgid "Missing SOFO%s line in %s" msgstr "Пропущено Ñ€Ñдок SOFO%s у %s" -#: ../spell.c:5253 #, c-format msgid "Both SAL and SOFO lines in %s" msgstr "Обидва Ñ€Ñдки SAL Ñ– SOFO у %s" -#: ../spell.c:5331 #, c-format msgid "Flag is not a number in %s line %d: %s" msgstr "Прапорець не Ñ” чиÑлом у %s у Ñ€Ñдку %d: %s" -#: ../spell.c:5334 #, c-format msgid "Illegal flag in %s line %d: %s" msgstr "Ðеправильний прапорець у %s у Ñ€Ñдку %d: %s" -#: ../spell.c:5493 ../spell.c:5501 #, c-format msgid "%s value differs from what is used in another .aff file" msgstr "Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ %s відрізнÑєтьÑÑ Ð²Ñ–Ð´ того, що вжито у іншому файлі .aff" -#: ../spell.c:5602 #, c-format msgid "Reading dictionary file %s ..." msgstr "ЗчитуєтьÑÑ Ñловниковий файл %s ..." -#: ../spell.c:5611 #, c-format msgid "E760: No word count in %s" msgstr "E760: Ðемає кількоÑті Ñлів у %s" -#: ../spell.c:5669 #, c-format msgid "line %6d, word %6d - %s" msgstr "Ñ€Ñдок %6d, Ñлово %6d - %s" -#: ../spell.c:5691 #, c-format msgid "Duplicate word in %s line %d: %s" msgstr "ÐŸÐ¾Ð²Ñ‚Ð¾Ñ€ÐµÐ½Ð½Ñ Ñлова у %s у Ñ€Ñдку %d: %s" -#: ../spell.c:5694 #, c-format msgid "First duplicate word in %s line %d: %s" msgstr "Перше Ð¿Ð¾Ð²Ñ‚Ð¾Ñ€ÐµÐ½Ð½Ñ Ñлова у %s у Ñ€Ñдку %d: %s" -#: ../spell.c:5746 #, c-format msgid "%d duplicate word(s) in %s" msgstr "%d повторюваних Ñлів у %s" -#: ../spell.c:5748 #, c-format msgid "Ignored %d word(s) with non-ASCII characters in %s" msgstr "Пропущено %d Ñлів(~) із не-ASCII Ñимволами у %s" -#: ../spell.c:6115 #, c-format msgid "Reading word file %s ..." msgstr "ЧитаєтьÑÑ Ñ„Ð°Ð¹Ð» Ñлів %s ..." -#: ../spell.c:6155 #, c-format msgid "Duplicate /encoding= line ignored in %s line %d: %s" msgstr "ÐŸÐ¾Ð²Ñ‚Ð¾Ñ€ÐµÐ½Ð½Ñ Ñ€Ñдка /encoding= проігноровано у %s у Ñ€Ñдку %d: %s" -#: ../spell.c:6159 #, c-format msgid "/encoding= line after word ignored in %s line %d: %s" msgstr "Ð Ñдок /encoding= піÑÐ»Ñ Ñлова проігноровано у %s у Ñ€Ñдку %d: %s" -#: ../spell.c:6180 #, c-format msgid "Duplicate /regions= line ignored in %s line %d: %s" msgstr "ÐŸÐ¾Ð²Ñ‚Ð¾Ñ€ÐµÐ½Ð½Ñ Ñ€Ñдка /regions= проігноровано у %s у Ñ€Ñдку %d: %s" -#: ../spell.c:6185 #, c-format msgid "Too many regions in %s line %d: %s" msgstr "Забагато регіонів у %s у Ñ€Ñдку %d: %s" -#: ../spell.c:6198 #, c-format msgid "/ line ignored in %s line %d: %s" msgstr "Ð Ñдок / проігноровано у %s у Ñ€Ñдку %d: %s" -#: ../spell.c:6224 #, c-format msgid "Invalid region nr in %s line %d: %s" msgstr "Ðекоректний номер регіону у %s у Ñ€Ñдку %d: %s" -#: ../spell.c:6230 #, c-format msgid "Unrecognized flags in %s line %d: %s" msgstr "Ðерозпізнані прапорці у %s у Ñ€Ñдку %d: %s" -#: ../spell.c:6257 #, c-format msgid "Ignored %d words with non-ASCII characters" msgstr "Проігноровано %d Ñлів із не-ASCII Ñимволами" -#: ../spell.c:6656 #, c-format msgid "Compressed %d of %d nodes; %d (%d%%) remaining" msgstr "СтиÑнено %d з %d вузлів; залишилоÑÑ %d (%d%%)" -#: ../spell.c:7340 msgid "Reading back spell file..." msgstr "ПеречитуєтьÑÑ Ñ„Ð°Ð¹Ð» орфографії..." #. Go through the trie of good words, soundfold each word and add it to #. the soundfold trie. -#: ../spell.c:7357 msgid "Performing soundfolding..." msgstr "ВиконуєтьÑÑ Ð·Ð³Ð¾Ñ€Ñ‚Ð°Ð½Ð½Ñ Ð·Ð²ÑƒÐºÑ–Ð²..." -#: ../spell.c:7368 #, c-format msgid "Number of words after soundfolding: %<PRId64>" msgstr "КількіÑть Ñлів піÑÐ»Ñ Ð·Ð³Ð¾Ñ€Ñ‚Ð°Ð½Ð½Ñ Ð·Ð²ÑƒÐºÑ–Ð²: %<PRId64>" -#: ../spell.c:7476 #, c-format msgid "Total number of words: %d" msgstr "Повна кількіÑть Ñлів: %d" -#: ../spell.c:7655 #, c-format msgid "Writing suggestion file %s ..." msgstr "ЗапиÑуєтьÑÑ Ñ„Ð°Ð¹Ð» припущень %s ..." -#: ../spell.c:7707 ../spell.c:7927 #, c-format msgid "Estimated runtime memory use: %d bytes" msgstr "Оцінка ÑÐ¿Ð¾Ð¶Ð¸Ð²Ð°Ð½Ð½Ñ Ð¿Ð°Ð¼'Ñті: %d байт" -#: ../spell.c:7820 msgid "E751: Output file name must not have region name" msgstr "E751: Вихідний файл не повинен мати назву регіону" -#: ../spell.c:7822 msgid "E754: Only up to 8 regions supported" msgstr "E754: ПідтримуєтьÑÑ Ñ‚Ñ–Ð»ÑŒÐºÐ¸ до воÑьми регіонів" -#: ../spell.c:7846 #, c-format msgid "E755: Invalid region in %s" msgstr "E755: Ðекоректний регіон у %s" -#: ../spell.c:7907 msgid "Warning: both compounding and NOBREAK specified" msgstr "ЗаÑтереженнÑ: зазначено обидва `Ñкладні Ñлова' Ñ– NOBREAK" -#: ../spell.c:7920 #, c-format msgid "Writing spell file %s ..." msgstr "ЗапиÑуєтьÑÑ Ñ„Ð°Ð¹Ð» орфографії %s ..." -#: ../spell.c:7925 msgid "Done!" msgstr "Зроблено!" -#: ../spell.c:8034 #, c-format msgid "E765: 'spellfile' does not have %<PRId64> entries" msgstr "E765: 'spellfile' не міÑтить %<PRId64> елементів" -#: ../spell.c:8074 #, c-format msgid "Word '%.*s' removed from %s" msgstr "Слово '%.*s' знищено з %s" -#: ../spell.c:8117 #, c-format msgid "Word '%.*s' added to %s" msgstr "Слово '%.*s' додано до %s" -#: ../spell.c:8381 msgid "E763: Word characters differ between spell files" msgstr "E763: Символи у Ñлові відрізнÑютьÑÑ Ñƒ файлах орфографії" -#: ../spell.c:8684 msgid "Sorry, no suggestions" msgstr "Пробачте, немає пропозицій" -#: ../spell.c:8687 #, c-format msgid "Sorry, only %<PRId64> suggestions" msgstr "Пробачте, тільки %<PRId64> пропозицій" #. for when 'cmdheight' > 1 #. avoid more prompt -#: ../spell.c:8704 #, c-format msgid "Change \"%.*s\" to:" msgstr "Замінити «%.*s» на:" -#: ../spell.c:8737 #, c-format msgid " < \"%.*s\"" msgstr " < «%.*s»" # msgstr "E34: " -#: ../spell.c:8882 msgid "E752: No previous spell replacement" msgstr "E752: Ðемає попередньої заміни" # msgstr "E333: " -#: ../spell.c:8925 #, c-format msgid "E753: Not found: %s" msgstr "E753: Ðе знайдено: %s" -#: ../spell.c:9276 #, c-format msgid "E778: This does not look like a .sug file: %s" msgstr "E778: Ðе Ñхоже на файл .sug: %s" -#: ../spell.c:9282 #, c-format msgid "E779: Old .sug file, needs to be updated: %s" msgstr "E779: ЗаÑтарілий файл .sug, треба поновити: %s" -#: ../spell.c:9286 #, c-format msgid "E780: .sug file is for newer version of Vim: %s" msgstr "E780: Файл .sug Ð´Ð»Ñ Ð±Ñ–Ð»ÑŒÑˆ нової верÑÑ–Ñ— Vim: %s" -#: ../spell.c:9295 #, c-format msgid "E781: .sug file doesn't match .spl file: %s" msgstr "E781: Файл .sug не відповідає файлу .spl: %s" -#: ../spell.c:9305 #, c-format msgid "E782: error while reading .sug file: %s" msgstr "E782: Помилка Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ Ñ„Ð°Ð¹Ð»Ñƒ .sug: %s" #. This should have been checked when generating the .spl #. file. -#: ../spell.c:11575 msgid "E783: duplicate char in MAP entry" msgstr "E783: Повторено Ñимвол у елементі MAP" # msgstr "E391: " -#: ../syntax.c:266 msgid "No Syntax items defined for this buffer" msgstr "Ð”Ð»Ñ Ð±ÑƒÑ„ÐµÑ€Ð° не визначено елементів ÑинтакÑиÑу" -#: ../syntax.c:3083 ../syntax.c:3104 ../syntax.c:3127 #, c-format msgid "E390: Illegal argument: %s" msgstr "E390: Ðеправильний аргумент: %s" -#: ../syntax.c:3299 #, c-format msgid "E391: No such syntax cluster: %s" msgstr "E391: Ðемає такого ÑинтакÑичного клаÑтера: %s" -#: ../syntax.c:3433 msgid "syncing on C-style comments" msgstr "ÑинхронізуєтьÑÑ Ð¿Ð¾ коментарÑÑ… Ñтилю С" -#: ../syntax.c:3439 msgid "no syncing" msgstr "без Ñинхронізації" -#: ../syntax.c:3441 msgid "syncing starts " msgstr "починаєтьÑÑ ÑÐ¸Ð½Ñ…Ñ€Ð¾Ð½Ñ–Ð·Ð°Ñ†Ñ–Ñ Ð·Ð° " -#: ../syntax.c:3443 ../syntax.c:3506 msgid " lines before top line" msgstr " Ñ€Ñдків перед першим Ñ€Ñдком" -#: ../syntax.c:3448 msgid "" "\n" "--- Syntax sync items ---" @@ -5858,7 +4636,6 @@ msgstr "" "\n" "--- Елементи Ñинхронізації ÑинтакÑиÑу ---" -#: ../syntax.c:3452 msgid "" "\n" "syncing on items" @@ -5866,7 +4643,6 @@ msgstr "" "\n" "ÑÐ¸Ð½Ñ…Ñ€Ð¾Ð½Ñ–Ð·Ð°Ñ†Ñ–Ñ Ð¿Ð¾ елементах" -#: ../syntax.c:3457 msgid "" "\n" "--- Syntax items ---" @@ -5874,300 +4650,241 @@ msgstr "" "\n" "--- Елементи ÑинтакÑиÑу ---" -#: ../syntax.c:3475 #, c-format msgid "E392: No such syntax cluster: %s" msgstr "E392: Ðемає такого ÑинтакÑичного клаÑтера: %s" -#: ../syntax.c:3497 msgid "minimal " msgstr "мінімальний " -#: ../syntax.c:3503 msgid "maximal " msgstr "макÑимальний " -#: ../syntax.c:3513 msgid "; match " msgstr "; збіг " -#: ../syntax.c:3515 msgid " line breaks" msgstr " розриви Ñ€Ñдків" -#: ../syntax.c:4076 msgid "E395: contains argument not accepted here" msgstr "E395: МіÑтить неприйнÑтні тут аргументи" # msgstr "E14: " -#: ../syntax.c:4096 msgid "E844: invalid cchar value" msgstr "E844: Ðекоректне Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ cchar" -#: ../syntax.c:4107 msgid "E393: group[t]here not accepted here" msgstr "E393: group[t]hete тут неприйнÑтний" -#: ../syntax.c:4126 #, c-format msgid "E394: Didn't find region item for %s" msgstr "E394: Ðе знайдено елемент регіону Ð´Ð»Ñ %s" # msgstr "E396: " -#: ../syntax.c:4188 msgid "E397: Filename required" msgstr "E397: Потрібна назва файлу" -#: ../syntax.c:4221 msgid "E847: Too many syntax includes" msgstr "E847: Забагато ÑинтакÑичних включень" -#: ../syntax.c:4303 #, c-format msgid "E789: Missing ']': %s" msgstr "E789: Пропущено ']': %s" -#: ../syntax.c:4531 #, c-format msgid "E398: Missing '=': %s" msgstr "E398: Пропущено `=': %s" # --------------------------------------- -#: ../syntax.c:4666 #, c-format msgid "E399: Not enough arguments: syntax region %s" msgstr "E399: Бракує аргументів: ÑинтакÑичний регіон %s" -#: ../syntax.c:4870 msgid "E848: Too many syntax clusters" msgstr "E848: Забагато ÑинтакÑичних клаÑтерів" -#: ../syntax.c:4954 msgid "E400: No cluster specified" msgstr "E400: КлаÑтер не вказано" #. end delimiter not found -#: ../syntax.c:4986 #, c-format msgid "E401: Pattern delimiter not found: %s" msgstr "E401: Кінець зразку не знайдено: %s" -#: ../syntax.c:5049 #, c-format msgid "E402: Garbage after pattern: %s" msgstr "E402: Ð¡Ð¼Ñ–Ñ‚Ñ‚Ñ Ð¿Ñ–ÑÐ»Ñ Ð·Ñ€Ð°Ð·ÐºÑƒ: %s" # msgstr "E402: " -#: ../syntax.c:5120 msgid "E403: syntax sync: line continuations pattern specified twice" msgstr "" "E403: СинтакÑична ÑинхронізаціÑ: зразок Ð´Ð»Ñ Ð¿Ñ€Ð¾Ð´Ð¾Ð²Ð¶ÐµÐ½Ð½Ñ Ñ€Ñдка вказано двічі" -#: ../syntax.c:5169 #, c-format msgid "E404: Illegal arguments: %s" msgstr "E404: Ðеправильні аргументи: %s" # msgstr "E404: " -#: ../syntax.c:5217 #, c-format msgid "E405: Missing equal sign: %s" msgstr "E405: Пропущено знак рівноÑті: %s" # msgstr "E405: " -#: ../syntax.c:5222 #, c-format msgid "E406: Empty argument: %s" msgstr "E406: Порожній аргумент: %s" # msgstr "E406: " -#: ../syntax.c:5240 #, c-format msgid "E407: %s not allowed here" msgstr "E407: %s тут не дозволено" -#: ../syntax.c:5246 #, c-format msgid "E408: %s must be first in contains list" msgstr "E408: %s має бути першим Ñ€Ñдком у ÑпиÑку contains" -#: ../syntax.c:5304 #, c-format msgid "E409: Unknown group name: %s" msgstr "E409: Ðевідома назва групи: %s" # msgstr "E409: " -#: ../syntax.c:5512 #, c-format msgid "E410: Invalid :syntax subcommand: %s" msgstr "E410: Ðеправильна підкоманда :syntax: %s" -#: ../syntax.c:5854 msgid "" " TOTAL COUNT MATCH SLOWEST AVERAGE NAME PATTERN" msgstr "" " ВСЬОГО К-ТЬ СПІВП. ÐÐЙПОВІЛ. СЕРЕДÐ. ÐÐЗВРШÐБЛОÐ" -#: ../syntax.c:6146 msgid "E679: recursive loop loading syncolor.vim" msgstr "E679: РекурÑивний цикл Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ syncolor.vim" # msgstr "E410: " -#: ../syntax.c:6256 #, c-format msgid "E411: highlight group not found: %s" msgstr "E411: Групу підÑÐ²Ñ–Ñ‡ÑƒÐ²Ð°Ð½Ð½Ñ Ð½Ðµ знайдено: %s" # msgstr "E411: " -#: ../syntax.c:6278 #, c-format msgid "E412: Not enough arguments: \":highlight link %s\"" msgstr "E412: ÐедоÑтатньо аргументів: «:highlight link %s»" # msgstr "E412: " -#: ../syntax.c:6284 #, c-format msgid "E413: Too many arguments: \":highlight link %s\"" msgstr "E413: Забагато аргументів: «:highlight link %s»" # msgstr "E413: " -#: ../syntax.c:6302 msgid "E414: group has settings, highlight link ignored" msgstr "E414: Грума має settings, highlight link проігноровано" # msgstr "E414: " -#: ../syntax.c:6367 #, c-format msgid "E415: unexpected equal sign: %s" msgstr "E415: ÐеÑподіваний знак рівноÑті: %s" # msgstr "E415: " -#: ../syntax.c:6395 #, c-format msgid "E416: missing equal sign: %s" msgstr "E416: Пропущено знак рівноÑті: %s" -#: ../syntax.c:6418 #, c-format msgid "E417: missing argument: %s" msgstr "E417: Пропущено аргумент: %s" -#: ../syntax.c:6446 #, c-format msgid "E418: Illegal value: %s" msgstr "E418: Ðеправильне значеннÑ: %s" # msgstr "E418: " -#: ../syntax.c:6496 msgid "E419: FG color unknown" msgstr "E419: Ðевідомий колір текÑту" # msgstr "E419: " -#: ../syntax.c:6504 msgid "E420: BG color unknown" msgstr "E420: Ðевідомий колір фону" # msgstr "E420: " -#: ../syntax.c:6564 #, c-format msgid "E421: Color name or number not recognized: %s" msgstr "E421: Ðерозпізнана назва або номер кольору: %s" # msgstr "E421: " -#: ../syntax.c:6714 #, c-format msgid "E422: terminal code too long: %s" msgstr "E422: Занадто довгий код терміналу: %s" # msgstr "E422: " -#: ../syntax.c:6753 #, c-format msgid "E423: Illegal argument: %s" msgstr "E423: Ðеправильний аргумент: %s" # msgstr "E423: " -#: ../syntax.c:6925 msgid "E424: Too many different highlighting attributes in use" msgstr "E424: ВикориÑтано забагато різних атрибутів кольору" -#: ../syntax.c:7427 msgid "E669: Unprintable character in group name" msgstr "E669: Ðедруковний Ñимвол у назві групи" # msgstr "E181: " -#: ../syntax.c:7434 msgid "W18: Invalid character in group name" msgstr "W18: Ðекоректний Ñимвол у назві групи" -#: ../syntax.c:7448 msgid "E849: Too many highlight and syntax groups" msgstr "E849: Забагато груп підÑÐ²Ñ–Ñ‡ÑƒÐ²Ð°Ð½Ð½Ñ Ñ– ÑинтакÑиÑу" # msgstr "E424: " -#: ../tag.c:104 msgid "E555: at bottom of tag stack" msgstr "E555: Кінець Ñтеку теґів" -#: ../tag.c:105 msgid "E556: at top of tag stack" msgstr "E556: Вершина Ñтеку теґів" -#: ../tag.c:380 msgid "E425: Cannot go before first matching tag" msgstr "E425: Це вже найперший відповідний теґ" # msgstr "E425: " -#: ../tag.c:504 #, c-format msgid "E426: tag not found: %s" msgstr "E426: Теґ не знайдено: %s" # msgstr "E426: " -#: ../tag.c:528 msgid " # pri kind tag" msgstr " # прі тип теґ" -#: ../tag.c:531 msgid "file\n" msgstr "файл\n" -#: ../tag.c:829 msgid "E427: There is only one matching tag" msgstr "E427: Лише один відповідний теґ" # msgstr "E427: " -#: ../tag.c:831 msgid "E428: Cannot go beyond last matching tag" msgstr "E428: Це вже оÑтанній відповідний теґ" # msgstr "E428: " -#: ../tag.c:850 #, c-format msgid "File \"%s\" does not exist" msgstr "Файл «%s» не Ñ–Ñнує" #. Give an indication of the number of matching tags -#: ../tag.c:859 #, c-format msgid "tag %d of %d%s" msgstr "теґ %d з %d%s" -#: ../tag.c:862 msgid " or more" msgstr " або більше" -#: ../tag.c:864 msgid " Using tag with different case!" msgstr " ВикориÑтано теґ, не розрізнÑючи великі й малі літери" -#: ../tag.c:909 #, c-format msgid "E429: File \"%s\" does not exist" msgstr "E429: Файл «%s» не Ñ–Ñнує" # msgstr "E429: " #. Highlight title -#: ../tag.c:960 msgid "" "\n" " # TO tag FROM line in file/text" @@ -6175,85 +4892,68 @@ msgstr "" "\n" " # ДО теґу З Ñ€Ñдка у файлі/текÑті" -#: ../tag.c:1303 #, c-format msgid "Searching tags file %s" msgstr "ШукаєтьÑÑ Ñƒ файлі теґів %s" -#: ../tag.c:1545 msgid "Ignoring long line in tags file" msgstr "ІгноруєтьÑÑ Ð´Ð¾Ð²Ð³Ð¸Ð¹ Ñ€Ñдок у файлі з позначками" # msgstr "E430: " -#: ../tag.c:1915 #, c-format msgid "E431: Format error in tags file \"%s\"" msgstr "E431: Помилка формату у файлі теґів «%s»" # msgstr "E431: " -#: ../tag.c:1917 #, c-format msgid "Before byte %<PRId64>" msgstr "Перед байтом %<PRId64>" -#: ../tag.c:1929 #, c-format msgid "E432: Tags file not sorted: %s" msgstr "E432: Файл теґів не впорÑдкований: %s" # msgstr "E432: " #. never opened any tags file -#: ../tag.c:1960 msgid "E433: No tags file" msgstr "E433: Ðемає файлу теґів" # msgstr "E433: " -#: ../tag.c:2536 msgid "E434: Can't find tag pattern" msgstr "E434: Ðе вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ зразок теґу" # msgstr "E434: " -#: ../tag.c:2544 msgid "E435: Couldn't find tag, just guessing!" msgstr "E435: Ðе вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ теґ, тільки припущеннÑ!" -#: ../tag.c:2797 #, c-format msgid "Duplicate field name: %s" msgstr "Ðазва Ð¿Ð¾Ð»Ñ Ð¿Ð¾Ð²Ñ‚Ð¾Ñ€ÑŽÑ”Ñ‚ÑŒÑÑ: %s" # msgstr "E435: " -#: ../term.c:1442 msgid "' not known. Available builtin terminals are:" msgstr "' не відомий. Вбудовані термінали:" -#: ../term.c:1463 msgid "defaulting to '" msgstr "початково '" -#: ../term.c:1731 msgid "E557: Cannot open termcap file" msgstr "E557: Ðе вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ файл можливоÑтей терміналів" -#: ../term.c:1735 msgid "E558: Terminal entry not found in terminfo" msgstr "E558: Ðемає інформації про термінал" -#: ../term.c:1737 msgid "E559: Terminal entry not found in termcap" msgstr "E559: Ðемає інформації про можливоÑті терміналу" -#: ../term.c:1878 #, c-format msgid "E436: No \"%s\" entry in termcap" msgstr "E436: Ðемає запиÑу «%s» про можливоÑті терміналу" -#: ../term.c:2249 msgid "E437: terminal capability \"cm\" required" msgstr "E437: Потрібна можливіÑть терміналу «cm»" #. Highlight title -#: ../term.c:4376 msgid "" "\n" "--- Terminal keys ---" @@ -6261,174 +4961,136 @@ msgstr "" "\n" "--- Клавіші терміналу ---" -#: ../ui.c:481 msgid "Vim: Error reading input, exiting...\n" msgstr "Vim: Помилка Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ Ð²Ð²Ð¾Ð´Ñƒ, робота завершуєтьÑÑ...\n" #. This happens when the FileChangedRO autocommand changes the #. * file in a way it becomes shorter. -#: ../undo.c:379 -#, fuzzy msgid "E881: Line count changed unexpectedly" -msgstr "E834: КількіÑть Ñ€Ñдків неÑподівано змінилаÑÑ" +msgstr "E881: КількіÑть Ñ€Ñдків неÑподівано змінилаÑÑ" -#: ../undo.c:627 #, c-format msgid "E828: Cannot open undo file for writing: %s" msgstr "E828: Ðе вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ файл Ñ–Ñторії Ð´Ð»Ñ Ð·Ð°Ð¿Ð¸Ñу: %s" -#: ../undo.c:717 #, c-format msgid "E825: Corrupted undo file (%s): %s" msgstr "E825: Файл Ñ–Ñторії пошкоджено (%s): %s" -#: ../undo.c:1039 msgid "Cannot write undo file in any directory in 'undodir'" msgstr "Ðе вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати файл Ñ–Ñторії у жодну з директорій у 'undodir'" -#: ../undo.c:1074 #, c-format msgid "Will not overwrite with undo file, cannot read: %s" msgstr "Will not overwrite with undo file, cannot read: %s" -#: ../undo.c:1092 #, c-format msgid "Will not overwrite, this is not an undo file: %s" msgstr "Ðе можна перезапиÑати, це не файл Ñ–Ñторії: %s" -#: ../undo.c:1108 msgid "Skipping undo file write, nothing to undo" msgstr "Файл Ñ–Ñторії не запиÑуєтьÑÑ, нічого повертати" -#: ../undo.c:1121 #, c-format msgid "Writing undo file: %s" msgstr "ЗапиÑуєтьÑÑ Ñ„Ð°Ð¹Ð» Ñ–Ñторії: %s" -#: ../undo.c:1213 #, c-format msgid "E829: write error in undo file: %s" msgstr "E829: Помилка запиÑу у файлі Ñ–Ñторії: %s" -#: ../undo.c:1280 #, c-format msgid "Not reading undo file, owner differs: %s" msgstr "Файл Ñ–Ñторії прочитано не буде, влаÑник інший: %s" -#: ../undo.c:1292 #, c-format msgid "Reading undo file: %s" msgstr "ЧитаєтьÑÑ Ñ„Ð°Ð¹Ð» Ñ–Ñторії: %s" -#: ../undo.c:1299 #, c-format msgid "E822: Cannot open undo file for reading: %s" msgstr "E822: Ðе вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ файл Ð´Ð»Ñ Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ: %s" # msgstr "E333: " -#: ../undo.c:1308 #, c-format msgid "E823: Not an undo file: %s" msgstr "E823: Ðе файл Ñ–Ñторії: %s" -#: ../undo.c:1313 #, c-format msgid "E824: Incompatible undo file: %s" msgstr "E824: ÐеÑуміÑний файл Ñ–Ñторії: %s" -#: ../undo.c:1328 msgid "File contents changed, cannot use undo info" msgstr "ВміÑÑ‚ файлу змінивÑÑ, не можна викориÑтати інформацію про Ñ–Ñторію" -#: ../undo.c:1497 #, c-format msgid "Finished reading undo file %s" msgstr "Закінчено Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ Ñ„Ð°Ð¹Ð»Ñƒ Ñ–Ñторії %s" -#: ../undo.c:1586 ../undo.c:1812 msgid "Already at oldest change" msgstr "Вже на найÑтаршій зміні" -#: ../undo.c:1597 ../undo.c:1814 msgid "Already at newest change" msgstr "Вже на найновішій зміні" -#: ../undo.c:1806 #, c-format msgid "E830: Undo number %<PRId64> not found" msgstr "E830: Зміну %<PRId64> не знайдено в Ñ–Ñторії" -#: ../undo.c:1979 msgid "E438: u_undo: line numbers wrong" msgstr "E438: u_undo: неправильні номери Ñ€Ñдків" -#: ../undo.c:2183 msgid "more line" msgstr "додано Ñ€Ñдок" -#: ../undo.c:2185 msgid "more lines" msgstr "Ñ€Ñдків додано" -#: ../undo.c:2187 msgid "line less" msgstr "знищено Ñ€Ñдок" -#: ../undo.c:2189 msgid "fewer lines" msgstr "Ñ€Ñдків знищено" # msgstr "E438: " -#: ../undo.c:2193 msgid "change" msgstr "зміна" # msgstr "E438: " -#: ../undo.c:2195 msgid "changes" msgstr "змін" -#: ../undo.c:2225 #, c-format msgid "%<PRId64> %s; %s #%<PRId64> %s" msgstr "%<PRId64> %s; %s #%<PRId64> %s" -#: ../undo.c:2228 msgid "before" msgstr "перед" -#: ../undo.c:2228 msgid "after" msgstr "піÑлÑ" -#: ../undo.c:2325 msgid "Nothing to undo" msgstr "Ðемає нічого ÑкаÑовувати" -#: ../undo.c:2330 msgid "number changes when saved" msgstr "номер зміни Ñ‡Ð°Ñ Ð·Ð±ÐµÑ€ÐµÐ¶ÐµÐ½Ð¾" -#: ../undo.c:2360 #, c-format msgid "%<PRId64> seconds ago" msgstr "%<PRId64> Ñекунд тому" # msgstr "E406: " -#: ../undo.c:2372 msgid "E790: undojoin is not allowed after undo" msgstr "E790: Ðе можна виконати undojoin піÑÐ»Ñ undo" -#: ../undo.c:2466 msgid "E439: undo list corrupt" msgstr "E439: СпиÑок ÑкаÑÑƒÐ²Ð°Ð½Ð½Ñ Ð¿Ð¾ÑˆÐºÐ¾Ð´Ð¶ÐµÐ½Ð¾" # msgstr "E439: " -#: ../undo.c:2495 msgid "E440: undo line missing" msgstr "E440: ВідÑутній Ñ€Ñдок ÑкаÑуваннÑ" -#: ../version.c:600 msgid "" "\n" "Included patches: " @@ -6436,7 +5098,6 @@ msgstr "" "\n" "Включені латки: " -#: ../version.c:627 msgid "" "\n" "Extra patches: " @@ -6444,11 +5105,9 @@ msgstr "" "\n" "Додаткові латки: " -#: ../version.c:639 ../version.c:864 msgid "Modified by " msgstr "Змінив " -#: ../version.c:646 msgid "" "\n" "Compiled " @@ -6456,11 +5115,9 @@ msgstr "" "\n" "Скомпілював " -#: ../version.c:649 msgid "by " msgstr " " -#: ../version.c:660 msgid "" "\n" "Huge version " @@ -6468,1921 +5125,126 @@ msgstr "" "\n" "ГігантÑька верÑÑ–Ñ " -#: ../version.c:661 msgid "without GUI." msgstr "без GUI." -#: ../version.c:662 msgid " Features included (+) or not (-):\n" msgstr " Включені (+) або не включені (-) компоненти:\n" -#: ../version.c:667 msgid " system vimrc file: \"" msgstr " ÑиÑтемний vimrc: \"" -#: ../version.c:672 msgid " user vimrc file: \"" msgstr " vimrc кориÑтувача: \"" -#: ../version.c:677 msgid " 2nd user vimrc file: \"" msgstr " другий vimrc кориÑтувача: \"" -#: ../version.c:682 msgid " 3rd user vimrc file: \"" msgstr " третій vimrc кориÑтувача: \"" -#: ../version.c:687 msgid " user exrc file: \"" msgstr " exrc кориÑтувача: \"" -#: ../version.c:692 msgid " 2nd user exrc file: \"" msgstr " другий exrc кориÑтувача: \"" -#: ../version.c:699 msgid " fall-back for $VIM: \"" msgstr " заміна Ð´Ð»Ñ $VIM: \"" -#: ../version.c:705 msgid " f-b for $VIMRUNTIME: \"" msgstr " заміна Ð´Ð»Ñ $VIMRUNTIME: \"" -#: ../version.c:709 msgid "Compilation: " msgstr "Скомпільовано: " -#: ../version.c:712 msgid "Linking: " msgstr "Скомпоновано: " -#: ../version.c:717 msgid " DEBUG BUILD" msgstr " ВЕРСІЯ ДЛЯ ÐÐЛÐГОДЖЕÐÐЯ" -#: ../version.c:767 msgid "VIM - Vi IMproved" msgstr "VIM - Покращений Vi" -#: ../version.c:769 msgid "version " msgstr "верÑÑ–Ñ " -#: ../version.c:770 msgid "by Bram Moolenaar et al." msgstr "автор: Bram Moolenaar та ін." -#: ../version.c:774 msgid "Vim is open source and freely distributable" msgstr "Vim — це відкрита й вільно розповÑюджувана програма" -#: ../version.c:776 msgid "Help poor children in Uganda!" msgstr "Допоможіть Ñиротам з Уганди!" -#: ../version.c:777 msgid "type :help iccf<Enter> for information " msgstr ":help iccf<Enter> подробиці " -#: ../version.c:779 msgid "type :q<Enter> to exit " msgstr ":q<Enter> вихід з Vim " -#: ../version.c:780 msgid "type :help<Enter> or <F1> for on-line help" msgstr ":help<Enter> або <F1> переглÑд допомоги " -#: ../version.c:781 msgid "type :help version7<Enter> for version info" msgstr ":help version7<Enter> Ñ–Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ñ–Ñ Ð¿Ñ€Ð¾ верÑÑ–ÑŽ " -#: ../version.c:784 msgid "Running in Vi compatible mode" msgstr "Ви працюєте в режимі ÑуміÑному з Vi" -#: ../version.c:785 msgid "type :set nocp<Enter> for Vim defaults" msgstr ":set nocp<Enter> режим неÑуміÑний з Vi " -#: ../version.c:786 msgid "type :help cp-default<Enter> for info on this" msgstr ":help cp-default<Enter> Ñ–Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ñ–Ñ Ð¿Ñ€Ð¾ ÑуміÑніÑть" -#: ../version.c:827 msgid "Sponsor Vim development!" msgstr "Підтримайте розробку редактора Vim!" -#: ../version.c:828 msgid "Become a registered Vim user!" msgstr "Станьте зареєÑтрованим кориÑтувачем Vim!" -#: ../version.c:831 msgid "type :help sponsor<Enter> for information " msgstr ":help sponsor<Enter> подальша Ñ–Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ñ–Ñ " -#: ../version.c:832 msgid "type :help register<Enter> for information " msgstr ":help register<Enter> подальша Ñ–Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ñ–Ñ " -#: ../version.c:834 msgid "menu Help->Sponsor/Register for information " msgstr "меню Допомога->СпонÑор/РеєÑÑ‚Ñ€Ð°Ñ†Ñ–Ñ Ð¿Ð¾Ð´Ñ€Ð¾Ð±Ð¸Ñ†Ñ– " # msgstr "E444: " -#: ../window.c:119 msgid "Already only one window" msgstr "Це вже єдине вікно" -#: ../window.c:224 msgid "E441: There is no preview window" msgstr "E441: Ðемає вікна переглÑду" # msgstr "E441: " -#: ../window.c:559 msgid "E442: Can't split topleft and botright at the same time" msgstr "E442: Ðе вдалоÑÑ Ð¾Ð´Ð½Ð¾Ñ‡Ð°Ñно розбити topleft Ñ– botright" # msgstr "E442: " -#: ../window.c:1228 msgid "E443: Cannot rotate when another window is split" msgstr "E443: Ðе вдалоÑÑ Ð¿ÐµÑ€ÐµÐ¼Ñ–Ñтити вікно, заважають інші" # msgstr "E443: " -#: ../window.c:1803 msgid "E444: Cannot close last window" msgstr "E444: Ðе вдалоÑÑ Ð·Ð°ÐºÑ€Ð¸Ñ‚Ð¸ оÑтаннє вікно" # msgstr "E443: " -#: ../window.c:1810 msgid "E813: Cannot close autocmd window" msgstr "E813: Ðе вдалоÑÑ Ð·Ð°ÐºÑ€Ð¸Ñ‚Ð¸ вікно autocmd" # msgstr "E443: " -#: ../window.c:1814 msgid "E814: Cannot close window, only autocmd window would remain" msgstr "E814: Ðе вдалоÑÑ Ð·Ð°ÐºÑ€Ð¸Ñ‚Ð¸ вікно, залишилоÑÑ Ð± тільки вікно autocmd" -#: ../window.c:2717 msgid "E445: Other window contains changes" msgstr "E445: У іншому вікні Ñ” зміни" # msgstr "E445: " -#: ../window.c:4805 msgid "E446: No file name under cursor" msgstr "E446: Ðемає назви файлу над курÑором" - -#~ msgid "E831: bf_key_init() called with empty password" -#~ msgstr "E831: Викликано bf_key_init() з порожнім паролем" - -#~ msgid "E820: sizeof(uint32_t) != 4" -#~ msgstr "E820: sizeof(uint32_t) != 4" - -#~ msgid "E817: Blowfish big/little endian use wrong" -#~ msgstr "E817: Ðеправильне викориÑÑ‚Ð°Ð½Ð½Ñ Ð¿Ð¾Ñ€Ñдку байтів Blowfish (BE/LE)" - -#~ msgid "E818: sha256 test failed" -#~ msgstr "E818: Ðе пройшла перевірка sha256" - -#~ msgid "E819: Blowfish test failed" -#~ msgstr "E819: Ðе пройшла перевірка Blowfish" - -#~ msgid "Patch file" -#~ msgstr "Латка" - -#~ msgid "" -#~ "&OK\n" -#~ "&Cancel" -#~ msgstr "" -#~ "&O:Гаразд\n" -#~ "&C:СкаÑувати" - -#~ msgid "E240: No connection to Vim server" -#~ msgstr "E240: Ðемає з'Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ñ–Ð· Ñервером Vim" - -#~ msgid "E241: Unable to send to %s" -#~ msgstr "E241: Ðе вдалоÑÑ Ð²Ñ–Ð´Ñ–Ñлати до %s" - -#~ msgid "E277: Unable to read a server reply" -#~ msgstr "E277: Ðе вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ відповідь Ñервера" - -#~ msgid "E258: Unable to send to client" -#~ msgstr "E258: Ðе вдалоÑÑ Ð½Ð°Ð´Ñ–Ñлати клієнту" - -#~ msgid "Save As" -#~ msgstr "Зберегти Ñк" - -#~ msgid "Source Vim script" -#~ msgstr "Прочитати Ñкрипт Vim" - -#~ msgid "Edit File" -#~ msgstr "Редагувати Файл" - -#~ msgid " (NOT FOUND)" -#~ msgstr " (ÐЕ ЗÐÐЙДЕÐО)" - -#~ msgid "unknown" -#~ msgstr "Ðевідомо" - -# msgstr "E185: " -#~ msgid "Edit File in new window" -#~ msgstr "Редагувати файл у новому вікні" - -#~ msgid "Append File" -#~ msgstr "ДопиÑати файл" - -# msgstr "E187: " -#~ msgid "Window position: X %d, Y %d" -#~ msgstr "ÐŸÐ¾Ð·Ð¸Ñ†Ñ–Ñ Ð²Ñ–ÐºÐ½Ð°: X %d, Y %d" - -# msgstr "E188: " -#~ msgid "Save Redirection" -#~ msgstr "Зберегти переадреÑований вивід" - -#~ msgid "Save View" -#~ msgstr "Зберегти виглÑд" - -#~ msgid "Save Session" -#~ msgstr "Зберегти ÑеанÑ" - -#~ msgid "Save Setup" -#~ msgstr "Зберегти налаштуваннÑ" - -#~ msgid "E809: #< is not available without the +eval feature" -#~ msgstr "E809: #< не доÑтупна без можливоÑті +eval" - -#~ msgid "E196: No digraphs in this version" -#~ msgstr "E196: У цій верÑÑ–Ñ— немає диграфів" - -#~ msgid "is a device (disabled with 'opendevice' option)" -#~ msgstr "Ñ” приÑтроєм (вимкнено опцією 'opendevice')" - -#~ msgid "Reading from stdin..." -#~ msgstr "ЧитаєтьÑÑ Ð· stdin..." - -#~ msgid "[blowfish]" -#~ msgstr "[blowfish]" - -#~ msgid "[crypted]" -#~ msgstr "[зашифровано]" - -#~ msgid "E821: File is encrypted with unknown method" -#~ msgstr "E821: Файл зашифровано невідомим методом" - -#~ msgid "NetBeans disallows writes of unmodified buffers" -#~ msgstr "NetBeans не дозволÑÑ” запиÑувати у незмінені буфери" - -# msgstr "E391: " -#~ msgid "Partial writes disallowed for NetBeans buffers" -#~ msgstr "ЧаÑткові запиÑи заборонені Ð´Ð»Ñ Ð±ÑƒÑ„ÐµÑ€Ñ–Ð² NetBeans" - -#~ msgid "writing to device disabled with 'opendevice' option" -#~ msgstr "Ð—Ð°Ð¿Ð¸Ñ Ð´Ð¾ приÑтрою заборонено опцією 'opendevice'" - -#~ msgid "E460: The resource fork would be lost (add ! to override)" -#~ msgstr "E460: Гілку реÑурÑів можна втратити (! щоб не зважати)" - -#~ msgid "<cannot open> " -#~ msgstr "<не відкриваєтьÑÑ> " - -#~ msgid "E616: vim_SelFile: can't get font %s" -#~ msgstr "E616: vim_SelFile: не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ шрифт %s" - -#~ msgid "E614: vim_SelFile: can't return to current directory" -#~ msgstr "E614: vim_SelFile: не вдалоÑÑ Ð¿Ð¾Ð²ÐµÑ€Ð½ÑƒÑ‚Ð¸ÑÑ Ð² поточний каталог" - -#~ msgid "Pathname:" -#~ msgstr "ШлÑÑ…:" - -#~ msgid "E615: vim_SelFile: can't get current directory" -#~ msgstr "E615: vim_SelFile: не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ поточний каталог" - -#~ msgid "OK" -#~ msgstr "Гаразд" - -#~ msgid "Cancel" -#~ msgstr "СкаÑувати" - -#~ msgid "Vim dialog" -#~ msgstr "Діалог Vim" - -#~ msgid "Scrollbar Widget: Could not get geometry of thumb pixmap." -#~ msgstr "Scrollbar Widget: Ðе вдалоÑÑ Ð²Ð¸Ð·Ð½Ð°Ñ‡Ð¸Ñ‚Ð¸ розмір Ñкороченої картинки." - -#~ msgid "E232: Cannot create BalloonEval with both message and callback" -#~ msgstr "E232: Ðе вдалоÑÑ Ñтворити BalloonEval з повідомленнÑм Ñ– функцією" - -#~ msgid "E851: Failed to create a new process for the GUI" -#~ msgstr "E851: Ðе вдалоÑÑ Ñтворити новий Ð¿Ñ€Ð¾Ñ†ÐµÑ Ð´Ð»Ñ GUI" - -#~ msgid "E852: The child process failed to start the GUI" -#~ msgstr "E852: Дочірній Ð¿Ñ€Ð¾Ñ†ÐµÑ Ð½Ðµ зміг запуÑтити GUI" - -# msgstr "E228: " -#~ msgid "E229: Cannot start the GUI" -#~ msgstr "E229: Ðе вдалоÑÑ Ð·Ð°Ð¿ÑƒÑтити GUI" - -# msgstr "E229: " -#~ msgid "E230: Cannot read from \"%s\"" -#~ msgstr "E230: Ðе вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ з «%s»" - -#~ msgid "E665: Cannot start GUI, no valid font found" -#~ msgstr "E665: Ðе вдалоÑÑ Ð·Ð°Ð¿ÑƒÑтити GUI, не знайдено шрифт" - -# msgstr "E230: " -#~ msgid "E231: 'guifontwide' invalid" -#~ msgstr "E231: Ðекоректний 'guifontwide'" - -#~ msgid "E599: Value of 'imactivatekey' is invalid" -#~ msgstr "E599: Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ 'imactivatekey' некоректне" - -#~ msgid "E254: Cannot allocate color %s" -#~ msgstr "E254: Ðе вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ колір %s" - -#~ msgid "No match at cursor, finding next" -#~ msgstr "Ðемає над курÑором, пошук триває" - -#~ msgid "Input _Methods" -#~ msgstr "Методи введеннÑ" - -#~ msgid "VIM - Search and Replace..." -#~ msgstr "VIM - Знайти й замінити..." - -#~ msgid "VIM - Search..." -#~ msgstr "VIM - Пошук..." - -#~ msgid "Find what:" -#~ msgstr "Знайти:" - -#~ msgid "Replace with:" -#~ msgstr "Замінити на:" - -#~ msgid "Match whole word only" -#~ msgstr "Лише повне Ñлово" - -#~ msgid "Match case" -#~ msgstr "Зважати на регіÑтр" - -#~ msgid "Direction" -#~ msgstr "ÐапрÑм" - -#~ msgid "Up" -#~ msgstr "Вгору" - -#~ msgid "Down" -#~ msgstr "Униз" - -#~ msgid "Find Next" -#~ msgstr "ÐаÑтупне" - -#~ msgid "Replace" -#~ msgstr "Замінити" - -#~ msgid "Replace All" -#~ msgstr "Замінити уÑÑ–" - -#~ msgid "Vim: Received \"die\" request from session manager\n" -#~ msgstr "Vim: Отримав запит «die» від менеджера ÑеÑій\n" - -#~ msgid "Close" -#~ msgstr "Закрити" - -#~ msgid "New tab" -#~ msgstr "Ðова вкладка" - -#~ msgid "Open Tab..." -#~ msgstr "Відкрити вкладку..." - -#~ msgid "Vim: Main window unexpectedly destroyed\n" -#~ msgstr "Vim: ÐеÑподівано знищилоÑÑ Ð³Ð¾Ð»Ð¾Ð²Ð½Ðµ вікно\n" - -#~ msgid "&Filter" -#~ msgstr "&F:Фільтрувати" - -#~ msgid "&Cancel" -#~ msgstr "&C:СкаÑувати" - -#~ msgid "Directories" -#~ msgstr "Каталоги" - -#~ msgid "Filter" -#~ msgstr "Фільтр" - -#~ msgid "&Help" -#~ msgstr "&H:Допомога" - -#~ msgid "Files" -#~ msgstr "Файли" - -#~ msgid "&OK" -#~ msgstr "&O:Гаразд" - -#~ msgid "Selection" -#~ msgstr "ВиділеннÑ" - -#~ msgid "Find &Next" -#~ msgstr "&N:Знайти далі" - -#~ msgid "&Replace" -#~ msgstr "&R:Замінити" - -#~ msgid "Replace &All" -#~ msgstr "&A:Замінити уÑÑ–" - -#~ msgid "&Undo" -#~ msgstr "&U:СкаÑувати" - -#~ msgid "E671: Cannot find window title \"%s\"" -#~ msgstr "E671: Ðе вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ вікно «%s»" - -#~ msgid "E243: Argument not supported: \"-%s\"; Use the OLE version." -#~ msgstr "E243: Ðргумент не підтримуєтьÑÑ: «-%s»; кориÑтуйтеÑÑŒ верÑією з OLE." - -#~ msgid "E672: Unable to open window inside MDI application" -#~ msgstr "E672: Ðе вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ вікно вÑередині програми MDI" - -#~ msgid "Close tab" -#~ msgstr "Закрити вкладку" - -#~ msgid "Open tab..." -#~ msgstr "Відкрити вкладку..." - -# msgstr "E245: " -#~ msgid "Find string (use '\\\\' to find a '\\')" -#~ msgstr "Знайти Ñ€Ñдок ('\\\\' щоб знайти '\\')" - -#~ msgid "Find & Replace (use '\\\\' to find a '\\')" -#~ msgstr "Знайти Ñ– замінити ('\\\\' щоб знайти '\\')" - -#~ msgid "Not Used" -#~ msgstr "Ðемає" - -#~ msgid "Directory\t*.nothing\n" -#~ msgstr "Каталог\t*.нічого\n" - -#~ msgid "" -#~ "Vim E458: Cannot allocate colormap entry, some colors may be incorrect" -#~ msgstr "" -#~ "Vim E458: Ðемає вільних комірок у палітрі, деÑкі кольори можуть бути " -#~ "неправильні" - -#~ msgid "E250: Fonts for the following charsets are missing in fontset %s:" -#~ msgstr "E250: Шрифти Ð´Ð»Ñ Ñ†Ð¸Ñ… Ñимволів відÑутні у наборі %s:" - -# msgstr "E250: " -#~ msgid "E252: Fontset name: %s" -#~ msgstr "E252: Ðазва набору шрифтів: %s" - -# msgstr "E252: " -#~ msgid "Font '%s' is not fixed-width" -#~ msgstr "Шрифт '%s' не Ñ” моноширинним" - -#~ msgid "E253: Fontset name: %s" -#~ msgstr "E253: Ðазва набору шрифтів: %s" - -#~ msgid "Font0: %s" -#~ msgstr "Шрифт0: %s" - -#~ msgid "Font1: %s" -#~ msgstr "Шрифт1: %s" - -#~ msgid "Font%<PRId64> width is not twice that of font0" -#~ msgstr "Ширина шрифту%<PRId64> не більша удвічі за ширину шрифту0" - -#~ msgid "Font0 width: %<PRId64>" -#~ msgstr "Ширина шрифту0: %<PRId64>" - -#~ msgid "Font1 width: %<PRId64>" -#~ msgstr "Ширина шрифту1: %<PRId64>" - -#~ msgid "Invalid font specification" -#~ msgstr "Ðекоректна ÑÐ¿ÐµÑ†Ð¸Ñ„Ñ–ÐºÐ°Ñ†Ñ–Ñ ÑˆÑ€Ð¸Ñ„Ñ‚Ñƒ" - -#~ msgid "&Dismiss" -#~ msgstr "&D:Припинити" - -#~ msgid "no specific match" -#~ msgstr "немає конкретного збігу" - -# msgstr "E234: " -#~ msgid "Vim - Font Selector" -#~ msgstr "Vim - Вибір шрифту" - -#~ msgid "Name:" -#~ msgstr "Ðазва:" - -#~ msgid "Show size in Points" -#~ msgstr "Показати розмір у пунктах" - -#~ msgid "Encoding:" -#~ msgstr "КодуваннÑ:" - -#~ msgid "Font:" -#~ msgstr "Шрифт:" - -#~ msgid "Style:" -#~ msgstr "Стиль:" - -#~ msgid "Size:" -#~ msgstr "Розмір:" - -#~ msgid "E256: Hangul automata ERROR" -#~ msgstr "E256: Помилка автомату Hangul" - -#~ msgid "E563: stat error" -#~ msgstr "E563: помилка stat" - -#~ msgid "E625: cannot open cscope database: %s" -#~ msgstr "E625: Ðе вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ базу даних cscope: %s" - -#~ msgid "E626: cannot get cscope database information" -#~ msgstr "E626: Ðе вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ інформацію з бази даних cscope" - -#~ msgid "Lua library cannot be loaded." -#~ msgstr "Ðе вдалоÑÑ Ð·Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶Ð¸Ñ‚Ð¸ бібліотеку Lua" - -#~ msgid "cannot save undo information" -#~ msgstr "не вдалоÑÑ Ð·Ð±ÐµÑ€ÐµÐ³Ñ‚Ð¸ інформацію Ð´Ð»Ñ ÑкаÑуваннÑ" - -#~ msgid "" -#~ "E815: Sorry, this command is disabled, the MzScheme libraries could not " -#~ "be loaded." -#~ msgstr "" -#~ "E815: Вибачте, Ñ†Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð° вимкнена, бібліотеки MzScheme не можуть бути " -#~ "завантажені." - -#~ msgid "invalid expression" -#~ msgstr "некоректний вираз" - -#~ msgid "expressions disabled at compile time" -#~ msgstr "обробку виразів вимкнено під Ñ‡Ð°Ñ ÐºÐ¾Ð¼Ð¿Ñ–Ð»Ñції" - -#~ msgid "hidden option" -#~ msgstr "прихована опціÑ" - -#~ msgid "unknown option" -#~ msgstr "невідома опціÑ" - -#~ msgid "window index is out of range" -#~ msgstr "некоректний номер вікна" - -#~ msgid "couldn't open buffer" -#~ msgstr "не вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ буфер" - -#~ msgid "cannot delete line" -#~ msgstr "неможливо знищити Ñ€Ñдок" - -#~ msgid "cannot replace line" -#~ msgstr "неможливо замінити Ñ€Ñдок" - -#~ msgid "cannot insert line" -#~ msgstr "не вдалоÑÑ Ð²Ñтавити Ñ€Ñдок" - -#~ msgid "string cannot contain newlines" -#~ msgstr "більше ніж один Ñ€Ñдок" - -#~ msgid "error converting Scheme values to Vim" -#~ msgstr "не вдалоÑÑ Ð¿ÐµÑ€ÐµÑ‚Ð²Ð¾Ñ€Ð¸Ñ‚Ð¸ Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Scheme у Vim" - -#~ msgid "Vim error: ~a" -#~ msgstr "Помилка Vim: ~a" - -#~ msgid "Vim error" -#~ msgstr "Помилка Vim" - -#~ msgid "buffer is invalid" -#~ msgstr "буфер непридатний" - -#~ msgid "window is invalid" -#~ msgstr "вікно непридатне" - -#~ msgid "linenr out of range" -#~ msgstr "номер Ñ€Ñдка за межами файлу" - -#~ msgid "not allowed in the Vim sandbox" -#~ msgstr "не дозволено у піÑочниці Vim" - -#~ msgid "E837: This Vim cannot execute :py3 after using :python" -#~ msgstr "E837: Python: Ðе можна викориÑтати :py Ñ– :py3 в одному ÑеанÑÑ–" - -#~ msgid "" -#~ "E263: Sorry, this command is disabled, the Python library could not be " -#~ "loaded." -#~ msgstr "" -#~ "E263: Вибачте, Ñ†Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð° вимкнена, бібліотека Python не може бути " -#~ "завантажена." - -#~ msgid "E836: This Vim cannot execute :python after using :py3" -#~ msgstr "E836: Python: Ðе можна викориÑтати :py Ñ– :py3 в одному ÑеанÑÑ–" - -#~ msgid "E659: Cannot invoke Python recursively" -#~ msgstr "E659: Ðе можна рекурÑивно викликати Python" - -#~ msgid "E265: $_ must be an instance of String" -#~ msgstr "E265: $_ має бути екземплÑром String" - -#~ msgid "" -#~ "E266: Sorry, this command is disabled, the Ruby library could not be " -#~ "loaded." -#~ msgstr "" -#~ "E266: Вибачте, Ñ†Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð° вимкнена, бібліотека Ruby не може бути " -#~ "завантажена." - -# msgstr "E414: " -#~ msgid "E267: unexpected return" -#~ msgstr "E267: неÑподіваний return" - -#~ msgid "E268: unexpected next" -#~ msgstr "E268: неÑподіваний next" - -#~ msgid "E269: unexpected break" -#~ msgstr "E269: неÑподіваний break" - -#~ msgid "E270: unexpected redo" -#~ msgstr "E270: неÑподіваний redo" - -#~ msgid "E271: retry outside of rescue clause" -#~ msgstr "E271: retry поза rescue" - -#~ msgid "E272: unhandled exception" -#~ msgstr "E272: Ðеоброблений винÑток" - -# msgstr "E233: " -#~ msgid "E273: unknown longjmp status %d" -#~ msgstr "E273: Ðевідомий ÑÑ‚Ð°Ñ‚ÑƒÑ longjmp: %d" - -#~ msgid "Toggle implementation/definition" -#~ msgstr "Перемкнути реалізацію/визначеннÑ" - -#~ msgid "Show base class of" -#~ msgstr "Знайти базовий клаÑ" - -#~ msgid "Show overridden member function" -#~ msgstr "Показати замінені функції-члени" - -#~ msgid "Retrieve from file" -#~ msgstr "Прочитати з файлу" - -#~ msgid "Retrieve from project" -#~ msgstr "Отримати з проекту" - -#~ msgid "Retrieve from all projects" -#~ msgstr "Отримати з уÑÑ–Ñ… проектів" - -#~ msgid "Retrieve" -#~ msgstr "Отримати" - -#~ msgid "Show source of" -#~ msgstr "Джерело" - -#~ msgid "Find symbol" -#~ msgstr "Знайти Ñимвол" - -#~ msgid "Browse class" -#~ msgstr "ПереглÑнути клаÑ" - -#~ msgid "Show class in hierarchy" -#~ msgstr "Показати ÐºÐ»Ð°Ñ Ð² ієрархії" - -#~ msgid "Show class in restricted hierarchy" -#~ msgstr "Показати ÐºÐ»Ð°Ñ Ð² обмеженій ієрархії" - -#~ msgid "Xref refers to" -#~ msgstr "Xref вказує на" - -#~ msgid "Xref referred by" -#~ msgstr "Ðа Xref вказано з" - -#~ msgid "Xref has a" -#~ msgstr "Xref має" - -#~ msgid "Xref used by" -#~ msgstr "Xref викориÑтано" - -#~ msgid "Show docu of" -#~ msgstr "Показати docu" - -#~ msgid "Generate docu for" -#~ msgstr "Створити docu длÑ" - -#~ msgid "" -#~ "Cannot connect to SNiFF+. Check environment (sniffemacs must be found in " -#~ "$PATH).\n" -#~ msgstr "" -#~ "Ðе вдалоÑÑ Ð·'єднатиÑÑ Ð·Ñ– SNiFF+. Перевірте Ð¾Ñ‚Ð¾Ñ‡ÐµÐ½Ð½Ñ (sniffemacs має бути " -#~ "у $PATH).\n" - -#~ msgid "E274: Sniff: Error during read. Disconnected" -#~ msgstr "E274: Sniff: Помилка під Ñ‡Ð°Ñ Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ. Від'єднано" - -#~ msgid "SNiFF+ is currently " -#~ msgstr "SNiFF+ зараз " - -#~ msgid "not " -#~ msgstr "не " - -#~ msgid "connected" -#~ msgstr "під'єднаний" - -#~ msgid "E275: Unknown SNiFF+ request: %s" -#~ msgstr "E275: Ðевідомий запит до SNiFF+: %s" - -#~ msgid "E276: Error connecting to SNiFF+" -#~ msgstr "E276: Помилка з'Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð´Ð¾ SNiFF+" - -#~ msgid "E278: SNiFF+ not connected" -#~ msgstr "E278: SNiFF+ не під'єднано" - -#~ msgid "E279: Not a SNiFF+ buffer" -#~ msgstr "E279: Ðе Ñ” буфером SNiFF+" - -#~ msgid "Sniff: Error during write. Disconnected" -#~ msgstr "Sniff: Помилка запиÑу. Від'єднано" - -#~ msgid "invalid buffer number" -#~ msgstr "неправильна назва буфера" - -#~ msgid "not implemented yet" -#~ msgstr "ще не реалізовано" - -#~ msgid "cannot set line(s)" -#~ msgstr "не вдалоÑÑ Ð²Ñтановити Ñ€Ñдки" - -#~ msgid "invalid mark name" -#~ msgstr "неправильна назва позначки" - -# msgstr "E19: " -#~ msgid "mark not set" -#~ msgstr "помітку не вказано" - -#~ msgid "row %d column %d" -#~ msgstr "Ñ€Ñдок %d колонка %d" - -#~ msgid "cannot insert/append line" -#~ msgstr "Ðе вдалоÑÑ Ð²Ñтавити/додати Ñ€Ñдок" - -#~ msgid "line number out of range" -#~ msgstr "номер Ñ€Ñдка за межами файлу" - -#~ msgid "unknown flag: " -#~ msgstr "невідомий прапорець: " - -#~ msgid "unknown vimOption" -#~ msgstr "Ðевідома vimOption" - -#~ msgid "keyboard interrupt" -#~ msgstr "перервано з клавіатури" - -#~ msgid "vim error" -#~ msgstr "помилка Vim" - -#~ msgid "cannot create buffer/window command: object is being deleted" -#~ msgstr "не вдалоÑÑ Ñтворити команду вікна/буфера: об'єкт знищуєтьÑÑ" - -#~ msgid "" -#~ "cannot register callback command: buffer/window is already being deleted" -#~ msgstr "Ðе вдалоÑÑ Ð·Ð°Ñ€ÐµÑ”Ñтрувати подію: буфер/вікно уже знищуєтьÑÑ" - -#~ msgid "" -#~ "E280: TCL FATAL ERROR: reflist corrupt!? Please report this to vim-" -#~ "dev@vim.org" -#~ msgstr "" -#~ "E280: ФÐТÐЛЬÐРПОМИЛКРTCL: можливо пошкоджено ÑпиÑок поÑилань!? Будь " -#~ "лаÑка, повідомте у vim-dev@vim.org" - -#~ msgid "cannot register callback command: buffer/window reference not found" -#~ msgstr "" -#~ "Ðе вдалоÑÑ Ð·Ð°Ñ€ÐµÑ”Ñтрувати команду події: поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð½Ð° буфер/вікно не " -#~ "знайдено" - -#~ msgid "" -#~ "E571: Sorry, this command is disabled: the Tcl library could not be " -#~ "loaded." -#~ msgstr "" -#~ "E571: Вибачте, Ñ†Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð° вимкнена, бібліотека Tcl не може бути " -#~ "завантажена." - -#~ msgid "E572: exit code %d" -#~ msgstr "E572: Код виходу %d" - -#~ msgid "cannot get line" -#~ msgstr "не вдалоÑÑ Ð´Ñ–Ñтати Ñ€Ñдок" - -#~ msgid "Unable to register a command server name" -#~ msgstr "Ðе вдалоÑÑ Ð·Ð°Ñ€ÐµÑ”Ñтрувати назву Ñервера команд" - -#~ msgid "E248: Failed to send command to the destination program" -#~ msgstr "E248: Ðе вдалоÑÑ Ð²Ñ–Ð´Ñ–Ñлати команду до програми-цілі" - -#~ msgid "E573: Invalid server id used: %s" -#~ msgstr "E573: ВикориÑтано некоректний ідентифікатор Ñервера: %s" - -#~ msgid "E251: VIM instance registry property is badly formed. Deleted!" -#~ msgstr "" -#~ "E251: Реквізит реєÑтру зразку VIM Ñформований неправильно. Знищено!" - -#~ msgid "netbeans is not supported with this GUI\n" -#~ msgstr "netbeans не підтримуєтьÑÑ Ð· цим GUI\n" - -#~ msgid "This Vim was not compiled with the diff feature." -#~ msgstr "Ð¦Ñ Ð²ÐµÑ€ÑÑ–Ñ Vim не була Ñкомпільована з підтримкою порівнÑннÑ." - -#~ msgid "'-nb' cannot be used: not enabled at compile time\n" -#~ msgstr "Ðе можна викориÑтати '-nb': не дозволено під Ñ‡Ð°Ñ ÐºÐ¾Ð¼Ð¿Ñ–Ð»Ñції\n" - -#~ msgid "Vim: Error: Failure to start gvim from NetBeans\n" -#~ msgstr "Vim: Помилка: Ðе вдалоÑÑ Ð·Ð°Ð¿ÑƒÑтити gvim Ð´Ð»Ñ NetBeans\n" - -#~ msgid "" -#~ "\n" -#~ "Where case is ignored prepend / to make flag upper case" -#~ msgstr "" -#~ "\n" -#~ "Якщо регіÑтр ігноруєтьÑÑ, додайте / Ñпереду щоб прапорець був у верхньому " -#~ "регіÑтрі." - -#~ msgid "-register\t\tRegister this gvim for OLE" -#~ msgstr "-register\t\tЗареєÑтрувати цей gvim Ð´Ð»Ñ OLE" - -#~ msgid "-unregister\t\tUnregister gvim for OLE" -#~ msgstr "-unregister\t\tСкаÑувати реєÑтрацію цього gvim Ð´Ð»Ñ OLE" - -#~ msgid "-g\t\t\tRun using GUI (like \"gvim\")" -#~ msgstr "-g\t\t\tЗапуÑтити GUI (ніби «gvim»)" - -#~ msgid "-f or --nofork\tForeground: Don't fork when starting GUI" -#~ msgstr "-f чи --nofork\tПередній план: тримати термінал піÑÐ»Ñ Ð·Ð°Ð¿ÑƒÑку GUI" - -#~ msgid "-f\t\t\tDon't use newcli to open window" -#~ msgstr "-f\t\t\tÐе викориÑтовувати newcli Ð´Ð»Ñ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ñ‚Ñ Ð²Ñ–ÐºÐ½Ð°" - -#~ msgid "-dev <device>\t\tUse <device> for I/O" -#~ msgstr "-dev <приÑтрій>\t\t\tВикориÑтовувати <приÑтрій> Ð´Ð»Ñ Ð²Ð²Ð¾Ð´Ñƒ/виводу" - -#~ msgid "-U <gvimrc>\t\tUse <gvimrc> instead of any .gvimrc" -#~ msgstr "-u <gvimrc>\t\tВикориÑтати поданий файл заміÑть .gvimrc" - -#~ msgid "-x\t\t\tEdit encrypted files" -#~ msgstr "-x\t\t\tРедагувати зашифровані файли" - -#~ msgid "-display <display>\tConnect vim to this particular X-server" -#~ msgstr "-display <диÑплей>\tПід'єднати vim до заданого диÑплею Ñервера X" - -#~ msgid "-X\t\t\tDo not connect to X server" -#~ msgstr "-X\t\t\tÐе з'єднуватиÑÑ Ð· X Ñервером" - -#~ msgid "--remote <files>\tEdit <files> in a Vim server if possible" -#~ msgstr "" -#~ "--remote <файли>\tРедагувати <файли> на Ñервері Vim, Ñкщо це можливо" - -#~ msgid "--remote-silent <files> Same, don't complain if there is no server" -#~ msgstr "" -#~ "--remote-silent <файли> Те Ñаме, тільки не ÑкаржитиÑÑ Ð½Ð° відÑутніÑть " -#~ "Ñервера" - -#~ msgid "" -#~ "--remote-wait <files> As --remote but wait for files to have been edited" -#~ msgstr "" -#~ "--remote-wait <файли> ..., але зачекати поки уÑÑ– файли будуть " -#~ "відредаговані" - -#~ msgid "" -#~ "--remote-wait-silent <files> Same, don't complain if there is no server" -#~ msgstr "" -#~ "--remote-wait-silent <файли> Те Ñаме, тільки не ÑкаржитиÑÑ, Ñкщо Ñервера " -#~ "немає" - -#~ msgid "" -#~ "--remote-tab[-wait][-silent] <files> As --remote but use tab page per " -#~ "file" -#~ msgstr "" -#~ "--remote-tab[-wait][-silent] <файли> Так Ñамо, Ñк --remote, але по " -#~ "вкладці на файл" - -#~ msgid "--remote-send <keys>\tSend <keys> to a Vim server and exit" -#~ msgstr "" -#~ "--remote-send <Ñимволи> ВідіÑлати <Ñимволи> Ñерверу Ñ– завершити роботу" - -#~ msgid "" -#~ "--remote-expr <expr>\tEvaluate <expr> in a Vim server and print result" -#~ msgstr "" -#~ "--remote-expr <вираз> Виконати <вираз> у Ñервері Vim Ñ– надрукувати " -#~ "результат" - -#~ msgid "--serverlist\t\tList available Vim server names and exit" -#~ msgstr "" -#~ "--serverlist\t\tПоказати ÑпиÑок наÑвних Ñерверів Vim Ñ– завершити роботу" - -#~ msgid "--servername <name>\tSend to/become the Vim server <name>" -#~ msgstr "--servername <назва>\tÐадіÑлати до/Ñтати Vim Ñервером з <назвою>" - -#~ msgid "" -#~ "\n" -#~ "Arguments recognised by gvim (Motif version):\n" -#~ msgstr "" -#~ "\n" -#~ "Ðргументи Ð´Ð»Ñ gvim (верÑÑ–Ñ Motif)\n" - -#~ msgid "" -#~ "\n" -#~ "Arguments recognised by gvim (neXtaw version):\n" -#~ msgstr "" -#~ "\n" -#~ "Ðргументи Ð´Ð»Ñ gvim (верÑÑ–Ñ neXtaw):\n" - -#~ msgid "" -#~ "\n" -#~ "Arguments recognised by gvim (Athena version):\n" -#~ msgstr "" -#~ "\n" -#~ "Ðргументи Ð´Ð»Ñ gvim (верÑÑ–Ñ Athena)\n" - -#~ msgid "-display <display>\tRun vim on <display>" -#~ msgstr "-display <диÑплей>\tВиконати vim на заданому <диÑплеї>" - -#~ msgid "-iconic\t\tStart vim iconified" -#~ msgstr "-iconic\t\tЗапуÑтити Vim Ñ– згорнути його вікно" - -#~ msgid "-background <color>\tUse <color> for the background (also: -bg)" -#~ msgstr "-background <колір>\tВикориÑтати <колір> Ð´Ð»Ñ Ñ„Ð¾Ð½Ñƒ (також: -bg)" - -#~ msgid "-foreground <color>\tUse <color> for normal text (also: -fg)" -#~ msgstr "" -#~ "-foreground <колір>\tВикориÑтати <колір> Ð´Ð»Ñ Ð·Ð²Ð¸Ñ‡Ð°Ð¹Ð½Ð¾Ð³Ð¾ текÑту (також: -" -#~ "fg)" - -#~ msgid "-font <font>\t\tUse <font> for normal text (also: -fn)" -#~ msgstr "" -#~ "-font <шрифт>\tВикориÑтати <шрифт> Ð´Ð»Ñ Ð·Ð²Ð¸Ñ‡Ð°Ð¹Ð½Ð¾Ð³Ð¾ текÑту (також: -fn)" - -#~ msgid "-boldfont <font>\tUse <font> for bold text" -#~ msgstr "-boldfont <шрифт>\tВикориÑтати <шрифт> Ð´Ð»Ñ Ð¶Ð¸Ñ€Ð½Ð¾Ð³Ð¾ текÑту" - -#~ msgid "-italicfont <font>\tUse <font> for italic text" -#~ msgstr "-italicfont <шрифт>\tВикориÑтати <шрифт> Ð´Ð»Ñ Ð¿Ð¾Ñ…Ð¸Ð»Ð¾Ð³Ð¾ текÑту" - -#~ msgid "-geometry <geom>\tUse <geom> for initial geometry (also: -geom)" -#~ msgstr "-geometry <геом>\tЗадати розміри й Ð¿Ð¾Ð»Ð¾Ð¶ÐµÐ½Ð½Ñ (також: -geom)" - -#~ msgid "-borderwidth <width>\tUse a border width of <width> (also: -bw)" -#~ msgstr "-borderwidth <товщ>\tÐ’Ñтановити товщину меж <товщ> (також: -bw)" - -#~ msgid "" -#~ "-scrollbarwidth <width> Use a scrollbar width of <width> (also: -sw)" -#~ msgstr "" -#~ "-scrollbarwidth <товщ> Ð’Ñтановити товщину лінійки зÑуву (також: -sw)" - -#~ msgid "-menuheight <height>\tUse a menu bar height of <height> (also: -mh)" -#~ msgstr "-menuheight <виÑота>\tÐ’Ñтановити виÑоту меню <виÑота> (також: -mh)" - -#~ msgid "-reverse\t\tUse reverse video (also: -rv)" -#~ msgstr "-reverse\t\tОбернути кольори (також: -rv)" - -#~ msgid "+reverse\t\tDon't use reverse video (also: +rv)" -#~ msgstr "+reverse\t\tÐе обертати кольори (також: +rv)" - -#~ msgid "-xrm <resource>\tSet the specified resource" -#~ msgstr "-xrm <реÑурÑ>\t\tÐ’Ñтановити зазначений реÑурÑ" - -#~ msgid "" -#~ "\n" -#~ "Arguments recognised by gvim (GTK+ version):\n" -#~ msgstr "" -#~ "\n" -#~ "Ðргументи gvim (верÑÑ–Ñ GTK+)\n" - -#~ msgid "-display <display>\tRun vim on <display> (also: --display)" -#~ msgstr "-display <диÑплей>\tВиконати vim на <диÑплеї> (також: --display)" - -#~ msgid "--role <role>\tSet a unique role to identify the main window" -#~ msgstr "" -#~ "--role <роль>\tÐ’Ñтановити унікальну роль Ð´Ð»Ñ Ñ–Ð´ÐµÐ½Ñ‚Ð¸Ñ„Ñ–ÐºÐ°Ñ†Ñ–Ñ— головного вікна" - -#~ msgid "--socketid <xid>\tOpen Vim inside another GTK widget" -#~ msgstr "--socketid <xid>\tВідкрити Vim в іншому елементі інтерфейÑу GTK" - -#~ msgid "--echo-wid\t\tMake gvim echo the Window ID on stdout" -#~ msgstr "--echo-wid\t\tХай gvim надрукує ідентифікатор вікна на stdout" - -#~ msgid "-P <parent title>\tOpen Vim inside parent application" -#~ msgstr "-P <заголовок батька>\tВідкрити Vim вÑередині батьківÑького вікна" - -#~ msgid "--windowid <HWND>\tOpen Vim inside another win32 widget" -#~ msgstr "--windowid <HWND>\tВідкрити Vim вÑередині іншого елементу win32" - -#~ msgid "No display" -#~ msgstr "Ðемає диÑплею" - -#~ msgid ": Send failed.\n" -#~ msgstr ": Ðе вдалоÑÑ Ð²Ñ–Ð´Ñ–Ñлати.\n" - -#~ msgid ": Send failed. Trying to execute locally\n" -#~ msgstr ": Ðе вдалоÑÑ Ð²Ñ–Ð´Ñ–Ñлати. Спроба виконати на міÑці\n" - -#~ msgid "%d of %d edited" -#~ msgstr "відредаговано %d з %d" - -#~ msgid "No display: Send expression failed.\n" -#~ msgstr "Ðемає диÑплею: ВідіÑлати вираз не вдалоÑÑ.\n" - -#~ msgid ": Send expression failed.\n" -#~ msgstr ": ВідіÑлати вираз не вдалоÑÑ.\n" - -#~ msgid "E543: Not a valid codepage" -#~ msgstr "E543: Ðекоректна кодова Ñторінка" - -#~ msgid "E284: Cannot set IC values" -#~ msgstr "E284: Ðе вдалоÑÑ Ð²Ñтановити Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ ÐºÐ¾Ð½Ñ‚ÐµÐºÑту вводу" - -#~ msgid "E285: Failed to create input context" -#~ msgstr "E285: Ðе вдалоÑÑ Ñтворити контекÑÑ‚ вводу" - -#~ msgid "E286: Failed to open input method" -#~ msgstr "E286: Ðе вдалоÑÑ Ñтворити метод вводу" - -# msgstr "E286: " -#~ msgid "E287: Warning: Could not set destroy callback to IM" -#~ msgstr "" -#~ "E287: ЗаÑтереженнÑ: Ðе вдалоÑÑ Ð²Ñтановити в методі вводу подію знищеннÑ" - -# msgstr "E287: " -#~ msgid "E288: input method doesn't support any style" -#~ msgstr "E288: Метод вводу не підтримує Ñтилі" - -# msgstr "E288: " -#~ msgid "E289: input method doesn't support my preedit type" -#~ msgstr "E289: Метод вводу не підтримує відредаговані типи" - -#~ msgid "E843: Error while updating swap file crypt" -#~ msgstr "E843: Помилка Ð¿Ð¾Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ ÑˆÐ¸Ñ„Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ Ñ„Ð°Ð¹Ð»Ñƒ обміну" - -#~ msgid "" -#~ "E833: %s is encrypted and this version of Vim does not support encryption" -#~ msgstr "E833: %s зашифровано, а Ñ†Ñ Ð²ÐµÑ€ÑÑ–Ñ Vim не підтримує шифруваннÑ" - -#~ msgid "Swap file is encrypted: \"%s\"" -#~ msgstr "Файл обміну зашифрований: «%s»" - -#~ msgid "" -#~ "\n" -#~ "If you entered a new crypt key but did not write the text file," -#~ msgstr "" -#~ "\n" -#~ "Якщо ви задали новий ключ шифру, але не запиÑали текÑтовий файл," - -#~ msgid "" -#~ "\n" -#~ "enter the new crypt key." -#~ msgstr "" -#~ "\n" -#~ "введіть новий ключ шифру." - -#~ msgid "" -#~ "\n" -#~ "If you wrote the text file after changing the crypt key press enter" -#~ msgstr "" -#~ "\n" -#~ "Якщо ви запиÑали текÑтовий файл піÑÐ»Ñ Ð·Ð¼Ñ–Ð½Ð¸ ключа шифру, натиÑніть enter" - -#~ msgid "" -#~ "\n" -#~ "to use the same key for text file and swap file" -#~ msgstr "" -#~ "\n" -#~ "щоб викориÑтати однаковий ключ Ð´Ð»Ñ Ñ‚ÐµÐºÑтового файлу та файлу обміну" - -#~ msgid "Using crypt key from swap file for the text file.\n" -#~ msgstr "Ð”Ð»Ñ Ñ‚ÐµÐºÑтового файлу викориÑтовуєтьÑÑ ÐºÐ»ÑŽÑ‡ шифру з файлу обміну.\n" - -#~ msgid "" -#~ "\n" -#~ " [not usable with this version of Vim]" -#~ msgstr "" -#~ "\n" -#~ " [не придатний Ð´Ð»Ñ Ñ†Ñ–Ñ”Ñ— верÑÑ–Ñ— Vim]" - -#~ msgid "Tear off this menu" -#~ msgstr "Відірвати це меню" - -#~ msgid "Select Directory dialog" -#~ msgstr "Вибрати каталог" - -#~ msgid "Save File dialog" -#~ msgstr "Запам'Ñтати файл" - -#~ msgid "Open File dialog" -#~ msgstr "Відкрити файл" - -#~ msgid "E338: Sorry, no file browser in console mode" -#~ msgstr "E338: Вибачте, але в конÑолі немає діалогу вибору файлу" - -#~ msgid "ERROR: " -#~ msgstr "ПОМИЛКÐ: " - -#~ msgid "" -#~ "\n" -#~ "[bytes] total alloc-freed %<PRIu64>-%<PRIu64>, in use %<PRIu64>, peak use " -#~ "%<PRIu64>\n" -#~ msgstr "" -#~ "\n" -#~ "[байт] вÑього розм/знищ. %<PRIu64>/%<PRIu64>, викор. %<PRIu64>, макÑ. " -#~ "%<PRIu64>\n" - -#~ msgid "" -#~ "[calls] total re/malloc()'s %<PRIu64>, total free()'s %<PRIu64>\n" -#~ "\n" -#~ msgstr "" -#~ "[виклики] уÑього re/malloc() - %<PRIu64>, уÑього free() - %<PRIu64>\n" -#~ "\n" - -#~ msgid "E340: Line is becoming too long" -#~ msgstr "E340: Ð Ñдок Ñтає занадто довгим" - -# msgstr "E340: " -#~ msgid "E341: Internal error: lalloc(%<PRId64>, )" -#~ msgstr "E341: Ð’Ð½ÑƒÑ‚Ñ€Ñ–ÑˆÐ½Ñ Ð¿Ð¾Ð¼Ð¸Ð»ÐºÐ°: lalloc(%<PRId64>, )" - -#~ msgid "E547: Illegal mouseshape" -#~ msgstr "E547: Ðеправильний виглÑд миші" - -#~ msgid "Enter encryption key: " -#~ msgstr "Вкажіть ключ шифру: " - -#~ msgid "Enter same key again: " -#~ msgstr "Повторіть ключ: " - -#~ msgid "Keys don't match!" -#~ msgstr "Ключі не однакові!" - -#~ msgid "Cannot connect to Netbeans #2" -#~ msgstr "Ðе вдалоÑÑ Ð·'єднатиÑÑ Ñ–Ð· Netbeans #2" - -#~ msgid "Cannot connect to Netbeans" -#~ msgstr "Ðе вдалоÑÑ Ð·'єднатиÑÑ Ñ–Ð· Netbeans" - -#~ msgid "E668: Wrong access mode for NetBeans connection info file: \"%s\"" -#~ msgstr "" -#~ "E668: Ðеправильний режим доÑтупу до файлу інформації про з'Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð· " -#~ "NetBenans: «%s»" - -#~ msgid "read from Netbeans socket" -#~ msgstr "читаєтьÑÑ Ð· Ñокета Netbeans" - -#~ msgid "E658: NetBeans connection lost for buffer %<PRId64>" -#~ msgstr "E658: Втрачено зв'Ñзок із NetBeans Ð´Ð»Ñ Ð±ÑƒÑ„ÐµÑ€Ð° %<PRId64>" - -#~ msgid "E838: netbeans is not supported with this GUI" -#~ msgstr "E838: netbeans не підтримуєтьÑÑ Ð· цим GUI" - -#~ msgid "E511: netbeans already connected" -#~ msgstr "E511: netbeans вже під'єднано" - -#~ msgid "E505: %s is read-only (add ! to override)" -#~ msgstr "E505: %s тільки Ð´Ð»Ñ Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ (! щоб не зважати)" - -#~ msgid "E775: Eval feature not available" -#~ msgstr "E775: МожливіÑть eval недоÑтупна" - -#~ msgid "freeing %<PRId64> lines" -#~ msgstr "Звільнено Ñ€Ñдків: %<PRId64>" - -#~ msgid "E530: Cannot change term in GUI" -#~ msgstr "E530: Ðе вдалоÑÑ Ð·Ð¼Ñ–Ð½Ð¸Ñ‚Ð¸ term в GUI" - -#~ msgid "E531: Use \":gui\" to start the GUI" -#~ msgstr "E531: ЗаÑтоÑуйте «:gui» Ð´Ð»Ñ Ð·Ð°Ð¿ÑƒÑку GUI" - -#~ msgid "E617: Cannot be changed in the GTK+ 2 GUI" -#~ msgstr "E617: Ðе можна змінити в GUI GTK+ 2" - -#~ msgid "E596: Invalid font(s)" -#~ msgstr "E596: Ðекоректний(Ñ–) шрифт(и)" - -#~ msgid "E597: can't select fontset" -#~ msgstr "E597: Ðе вдалоÑÑ Ð²Ð¸Ð±Ñ€Ð°Ñ‚Ð¸ набір шрифтів" - -#~ msgid "E598: Invalid fontset" -#~ msgstr "E598: Ðеправильний набір шрифтів" - -#~ msgid "E533: can't select wide font" -#~ msgstr "E533: Ðе вдалоÑÑ Ð²Ð¸ÐºÐ¾Ñ€Ð¸Ñтати розширений шрифт" - -#~ msgid "E534: Invalid wide font" -#~ msgstr "E534: Ðекоректний розширений шрифт" - -#~ msgid "E538: No mouse support" -#~ msgstr "E538: Миша не підтримуєтьÑÑ" - -# msgstr "E358: " -#~ msgid "cannot open " -#~ msgstr "не вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ " - -#~ msgid "VIM: Can't open window!\n" -#~ msgstr "VIM: Ðе вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ вікно!\n" - -#~ msgid "Need Amigados version 2.04 or later\n" -#~ msgstr "Потрібна Amigados 2.04 або пізніша\n" - -#~ msgid "Need %s version %<PRId64>\n" -#~ msgstr "Потрібно %s верÑÑ–Ñ— %<PRId64>\n" - -#~ msgid "Cannot open NIL:\n" -#~ msgstr "Ðе вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ NIL:\n" - -#~ msgid "Cannot create " -#~ msgstr "Ðе вдалоÑÑ Ñтворити " - -#~ msgid "Vim exiting with %d\n" -#~ msgstr "Vim завершує роботу з %d\n" - -#~ msgid "cannot change console mode ?!\n" -#~ msgstr "не можу змінити режим конÑолі ?!\n" - -# msgstr "E359: " -#~ msgid "mch_get_shellsize: not a console??\n" -#~ msgstr "mch_get_shellsize: не конÑоль??\n" - -#~ msgid "E360: Cannot execute shell with -f option" -#~ msgstr "E360: Ðе вдалоÑÑ Ð·Ð°Ð¿ÑƒÑтити оболонку з опцією -f" - -# msgstr "E360: " -#~ msgid "Cannot execute " -#~ msgstr "Ðе вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ " - -#~ msgid "shell " -#~ msgstr "оболонку " - -#~ msgid " returned\n" -#~ msgstr " повернуто\n" - -#~ msgid "ANCHOR_BUF_SIZE too small." -#~ msgstr "ANCHOR_BUF_SIZE замалий" - -#~ msgid "I/O ERROR" -#~ msgstr "Помилка вводу/виводу" - -#~ msgid "Message" -#~ msgstr "ПовідомленнÑ" - -#~ msgid "'columns' is not 80, cannot execute external commands" -#~ msgstr "'columns' не 80, не можна виконувати зовнішні команди" - -# msgstr "E364: " -#~ msgid "E237: Printer selection failed" -#~ msgstr "E237: Ðе вдалоÑÑ Ð²Ð¸Ð±Ñ€Ð°Ñ‚Ð¸ принтер" - -#~ msgid "to %s on %s" -#~ msgstr "на %s з %s" - -#~ msgid "E613: Unknown printer font: %s" -#~ msgstr "E613: Ðевідомий шрифт принтера: %s" - -#~ msgid "E238: Print error: %s" -#~ msgstr "E238: Помилка друку: %s" - -#~ msgid "Printing '%s'" -#~ msgstr "ДрукуєтьÑÑ '%s'" - -#~ msgid "E244: Illegal charset name \"%s\" in font name \"%s\"" -#~ msgstr "E244: Ðекоректна назва набору Ñимволів «%s» у назві шрифту «%s»" - -#~ msgid "E245: Illegal char '%c' in font name \"%s\"" -#~ msgstr "E245: Помилковий Ñимвол %c в назві шрифту «%s»" - -#~ msgid "Opening the X display took %<PRId64> msec" -#~ msgstr "Ðа Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ñ‚Ñ Ð´Ð¸Ñплею X пішло %<PRId64> міліÑекунд" - -#~ msgid "" -#~ "\n" -#~ "Vim: Got X error\n" -#~ msgstr "" -#~ "\n" -#~ "Vim: Помилка X\n" - -#~ msgid "Testing the X display failed" -#~ msgstr "ДиÑплей Ð¥ не пройшов перевірку" - -#~ msgid "Opening the X display timed out" -#~ msgstr "Сплив Ñ‡Ð°Ñ Ð¾Ñ‡Ñ–ÐºÑƒÐ²Ð°Ð½Ð½Ñ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ñ‚Ñ Ð´Ð¸Ñплею Ð¥" - -#~ msgid "" -#~ "\n" -#~ "Cannot execute shell sh\n" -#~ msgstr "" -#~ "\n" -#~ "Ðе вдалоÑÑ Ð·Ð°Ð¿ÑƒÑтити оболонку `sh'\n" - -#~ msgid "" -#~ "\n" -#~ "Cannot create pipes\n" -#~ msgstr "" -#~ "\n" -#~ "Ðе можна Ñтворити канали\n" - -#~ msgid "" -#~ "\n" -#~ "Cannot fork\n" -#~ msgstr "" -#~ "\n" -#~ "Ðе вдалоÑÑ Ñ€Ð¾Ð·Ð´Ð²Ð¾Ñ—Ñ‚Ð¸ÑÑ\n" - -#~ msgid "" -#~ "\n" -#~ "Command terminated\n" -#~ msgstr "" -#~ "\n" -#~ "Команда закінчила виконаннÑ\n" - -#~ msgid "XSMP lost ICE connection" -#~ msgstr "XSMP втратив з'Ñ”Ð´Ð½Ð°Ð½Ð½Ñ ICE" - -#~ msgid "Opening the X display failed" -#~ msgstr "Ðе вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ диÑплей X" - -#~ msgid "XSMP handling save-yourself request" -#~ msgstr "XSMP оброблÑєтьÑÑ Ð·Ð°Ð¿Ð¸Ñ‚ 'збережи Ñебе'" - -#~ msgid "XSMP opening connection" -#~ msgstr "XSMP відкриваєтьÑÑ Ð·'єднаннÑ" - -#~ msgid "XSMP ICE connection watch failed" -#~ msgstr "XSMP ÑпоÑÑ‚ÐµÑ€ÐµÐ¶ÐµÐ½Ð½Ñ Ð·Ð° з'єднаннÑм з ICE не вдалоÑÑ" - -#~ msgid "XSMP SmcOpenConnection failed: %s" -#~ msgstr "XSMP не вдалоÑÑ SmcOpenConnection: %s" - -#~ msgid "At line" -#~ msgstr "Ð Ñдок:" - -#~ msgid "Could not load vim32.dll!" -#~ msgstr "Ðе вдалоÑÑ Ð·Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶Ð¸Ñ‚Ð¸ vim32.dll" - -#~ msgid "VIM Error" -#~ msgstr "Помилка VIM" - -#~ msgid "Could not fix up function pointers to the DLL!" -#~ msgstr "Ðе вдалоÑÑ Ð²Ð¸Ð¿Ñ€Ð°Ð²Ð¸Ñ‚Ð¸ вказівники на функції DLL!" - -#~ msgid "shell returned %d" -#~ msgstr "оболонка повернула %d" - -#~ msgid "Vim: Caught %s event\n" -#~ msgstr "Vim: ВиÑвлено подію %s\n" - -#~ msgid "close" -#~ msgstr "close" - -#~ msgid "logoff" -#~ msgstr "logoff" - -#~ msgid "shutdown" -#~ msgstr "shutdown" - -#~ msgid "E371: Command not found" -#~ msgstr "E371: Команду не знайдено" - -#~ msgid "" -#~ "VIMRUN.EXE not found in your $PATH.\n" -#~ "External commands will not pause after completion.\n" -#~ "See :help win32-vimrun for more information." -#~ msgstr "" -#~ "Файл VIMRUN.EXE не знайдено у шлÑху пошуку.\n" -#~ "Зовнішні команди не будуть призупинені піÑÐ»Ñ Ð²Ð¸ÐºÐ¾Ð½Ð°Ð½Ð½Ñ.\n" -#~ "ГлÑньте :help win32-vimrun щоб отримати подробиці." - -#~ msgid "Vim Warning" -#~ msgstr "ЗаÑÑ‚ÐµÑ€ÐµÐ¶ÐµÐ½Ð½Ñ Vim" - -# msgstr "E231: " -#~ msgid "Error file" -#~ msgstr "Файл помилок" - -#~ msgid "E868: Error building NFA with equivalence class!" -#~ msgstr "E868: Ðе вдалоÑÑ Ð¿Ð¾Ð±ÑƒÐ´ÑƒÐ²Ð°Ñ‚Ð¸ NFA з клаÑом еквівалентноÑті!" - -#~ msgid "E878: (NFA) Could not allocate memory for branch traversal!" -#~ msgstr "E878: (NFA) Ðе вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ пам’Ñть Ð´Ð»Ñ Ð¾Ð±Ñ…Ð¾Ð´Ñƒ гілок!" - -#~ msgid "Warning: Cannot find word list \"%s_%s.spl\" or \"%s_ascii.spl\"" -#~ msgstr "" -#~ "ЗаÑтереженнÑ: Ðе вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ ÑпиÑок Ñлів «%s_%s.spl» чи «%s_ascii.spl»" - -#~ msgid "Conversion in %s not supported" -#~ msgstr "ÐŸÐµÑ€ÐµÑ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ Ñƒ %s не підтримуєтьÑÑ" - -#~ msgid "E845: Insufficient memory, word list will be incomplete" -#~ msgstr "E845: ÐедоÑтатньо пам’Ñті, ÑпиÑок Ñлів буде неповним" - -#~ msgid "E430: Tag file path truncated for %s\n" -#~ msgstr "E430: ШлÑÑ… файлу теґів Ñкорочено до %s\n" - -#~ msgid "new shell started\n" -#~ msgstr "запущено нову оболонку\n" - -# msgstr "E242: " -#~ msgid "Used CUT_BUFFER0 instead of empty selection" -#~ msgstr "ВикориÑтано CUT_BUFFER0 заміÑть порожнього виділеннÑ" - -#~ msgid "No undo possible; continue anyway" -#~ msgstr "СкаÑÑƒÐ²Ð°Ð½Ð½Ñ Ð±ÑƒÐ´Ðµ неможливе, вÑе одно продовжити" - -#~ msgid "E832: Non-encrypted file has encrypted undo file: %s" -#~ msgstr "E832: Ðезашифрований файл має зашифрований файл Ñ–Ñторії: %s" - -#~ msgid "E826: Undo file decryption failed: %s" -#~ msgstr "E826: Ðе вдалоÑÑ Ñ€Ð¾Ð·ÑˆÐ¸Ñ„Ñ€ÑƒÐ²Ð°Ñ‚Ð¸ файл Ñ–Ñторії: %s" - -#~ msgid "E827: Undo file is encrypted: %s" -#~ msgstr "E827: Файл Ñ–Ñторії зашифрований: %s" - -# msgstr "E440: " -# --------------------------------------- -#~ msgid "" -#~ "\n" -#~ "MS-Windows 16/32-bit GUI version" -#~ msgstr "" -#~ "\n" -#~ "ВерÑÑ–Ñ Ð· GUI Ð´Ð»Ñ 16/32-розрÑдної Windows" - -#~ msgid "" -#~ "\n" -#~ "MS-Windows 64-bit GUI version" -#~ msgstr "" -#~ "\n" -#~ "ВерÑÑ–Ñ Ð· GUI Ð´Ð»Ñ 64-розрÑдної MS-Windows" - -#~ msgid "" -#~ "\n" -#~ "MS-Windows 32-bit GUI version" -#~ msgstr "" -#~ "\n" -#~ "ВерÑÑ–Ñ Ð· GUI Ð´Ð»Ñ 32-розрÑдної Windows" - -#~ msgid " in Win32s mode" -#~ msgstr " в режимі Win32s" - -#~ msgid " with OLE support" -#~ msgstr " з підтримкою OLE" - -#~ msgid "" -#~ "\n" -#~ "MS-Windows 64-bit console version" -#~ msgstr "" -#~ "\n" -#~ "КонÑольна верÑÑ–Ñ Ð´Ð»Ñ 64-розрÑдної Windows" - -#~ msgid "" -#~ "\n" -#~ "MS-Windows 32-bit console version" -#~ msgstr "" -#~ "\n" -#~ "КонÑольна верÑÑ–Ñ Ð´Ð»Ñ 32-розрÑдної Windows" - -#~ msgid "" -#~ "\n" -#~ "MS-Windows 16-bit version" -#~ msgstr "" -#~ "\n" -#~ "ВерÑÑ–Ñ Ð´Ð»Ñ 16-розрÑдної Windows" - -#~ msgid "" -#~ "\n" -#~ "32-bit MS-DOS version" -#~ msgstr "" -#~ "\n" -#~ "ВерÑÑ–Ñ Ð´Ð»Ñ 32-розрÑдної MS-DOS" - -#~ msgid "" -#~ "\n" -#~ "16-bit MS-DOS version" -#~ msgstr "" -#~ "\n" -#~ "ВерÑÑ–Ñ Ð´Ð»Ñ 16-розрÑдної MS-DOS" - -#~ msgid "" -#~ "\n" -#~ "MacOS X (unix) version" -#~ msgstr "" -#~ "\n" -#~ "ВерÑÑ–Ñ Ð´Ð»Ñ MacOS X (unix)" - -#~ msgid "" -#~ "\n" -#~ "MacOS X version" -#~ msgstr "" -#~ "\n" -#~ "ВерÑÑ–Ñ Ð´Ð»Ñ MacOS X" - -#~ msgid "" -#~ "\n" -#~ "MacOS version" -#~ msgstr "" -#~ "\n" -#~ "ВерÑÑ–Ñ Ð´Ð»Ñ MacOS" - -#~ msgid "" -#~ "\n" -#~ "OpenVMS version" -#~ msgstr "" -#~ "\n" -#~ "ВерÑÑ–Ñ Ð´Ð»Ñ OpenVMS" - -#~ msgid "" -#~ "\n" -#~ "Big version " -#~ msgstr "" -#~ "\n" -#~ "Велика верÑÑ–Ñ " - -#~ msgid "" -#~ "\n" -#~ "Normal version " -#~ msgstr "" -#~ "\n" -#~ "Ðормальна верÑÑ–Ñ " - -#~ msgid "" -#~ "\n" -#~ "Small version " -#~ msgstr "" -#~ "\n" -#~ "Мала верÑÑ–Ñ " - -#~ msgid "" -#~ "\n" -#~ "Tiny version " -#~ msgstr "" -#~ "\n" -#~ "Крихітна верÑÑ–Ñ " - -#~ msgid "with GTK2-GNOME GUI." -#~ msgstr "з GUI GTK2-GNOME." - -#~ msgid "with GTK2 GUI." -#~ msgstr "з GUI GTK2." - -#~ msgid "with X11-Motif GUI." -#~ msgstr "з GUI X11-Motif." - -#~ msgid "with X11-neXtaw GUI." -#~ msgstr "з GUI X11-neXtaw." - -#~ msgid "with X11-Athena GUI." -#~ msgstr "з GUI X11-Athena." - -#~ msgid "with Photon GUI." -#~ msgstr "з GUI Photon." - -#~ msgid "with GUI." -#~ msgstr "з GUI." - -#~ msgid "with Carbon GUI." -#~ msgstr "з GUI Carbon." - -#~ msgid "with Cocoa GUI." -#~ msgstr "з GUI Cocoa." - -#~ msgid "with (classic) GUI." -#~ msgstr "з (клаÑичним) GUI." - -#~ msgid " system gvimrc file: \"" -#~ msgstr " ÑиÑтемний gvimrc: \"" - -#~ msgid " user gvimrc file: \"" -#~ msgstr " gvimrc кориÑтувача: \"" - -#~ msgid "2nd user gvimrc file: \"" -#~ msgstr "другий gvimrc кориÑтувача: \"" - -#~ msgid "3rd user gvimrc file: \"" -#~ msgstr "третій gvimrc кориÑтувача: \"" - -#~ msgid " system menu file: \"" -#~ msgstr " ÑиÑтемне меню: \"" - -#~ msgid "Compiler: " -#~ msgstr "КомпілÑтор: " - -#~ msgid "menu Help->Orphans for information " -#~ msgstr "меню Help->Orphans подальша Ñ–Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ñ–Ñ " - -#~ msgid "Running modeless, typed text is inserted" -#~ msgstr "Без режимів, текÑÑ‚ що набрано вÑтавлÑєтьÑÑ" - -#~ msgid "menu Edit->Global Settings->Toggle Insert Mode " -#~ msgstr "меню Edit->Global Settings->Toggle Insert Mode " - -#~ msgid " for two modes " -#~ msgstr " Ð´Ð»Ñ Ð´Ð²Ð¾Ñ… режимів " - -#~ msgid "menu Edit->Global Settings->Toggle Vi Compatible" -#~ msgstr "меню Edit->Global Settings->Toggle Vi Compatible " - -#~ msgid " for Vim defaults " -#~ msgstr " щоб починати в режимі ÑуміÑноÑті з Vi" - -#~ msgid "WARNING: Windows 95/98/ME detected" -#~ msgstr "ЗÐСТЕРЕЖЕÐÐЯ: Ви кориÑтуєтеÑÑ Windows 95/98/ME" - -#~ msgid "type :help windows95<Enter> for info on this" -#~ msgstr ":help windows95<Enter> Ñ–Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ñ–Ñ Ð¿Ñ€Ð¾ це " - -#~ msgid "E370: Could not load library %s" -#~ msgstr "E370: Ðе вдалоÑÑ Ð·Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶Ð¸Ñ‚Ð¸ бібліотеку %s" - -#~ msgid "" -#~ "Sorry, this command is disabled: the Perl library could not be loaded." -#~ msgstr "" -#~ "Вибачте, Ñ†Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð° вимкнена, бібліотека Perl не може бути завантажена." - -#~ msgid "E299: Perl evaluation forbidden in sandbox without the Safe module" -#~ msgstr "" -#~ "E299: ОбчиÑÐ»ÐµÐ½Ð½Ñ Ð²Ð¸Ñ€Ð°Ð·Ñ–Ð² Perl заборонене у піÑочниці без Ð¼Ð¾Ð´ÑƒÐ»Ñ Safe" - -#~ msgid "Edit with &multiple Vims" -#~ msgstr "Редагувати у (&m)різних Vim" - -#~ msgid "Edit with single &Vim" -#~ msgstr "Редагувати у одному &Vim" - -#~ msgid "Diff with Vim" -#~ msgstr "ПорівнÑти з допомогою Vim" - -#~ msgid "Edit with &Vim" -#~ msgstr "Редагувати за допомогою &Vim" - -#~ msgid "Edit with existing Vim - " -#~ msgstr "Редагувати у вже запущеному Vim - " - -#~ msgid "Edits the selected file(s) with Vim" -#~ msgstr "Редагує вибрані файли з допомогою Vim" - -#~ msgid "Error creating process: Check if gvim is in your path!" -#~ msgstr "Помилка ÑÑ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ Ð¿Ñ€Ð¾Ñ†ÐµÑу, перевірте чи Ñ” gvim у шлÑху пошуку!" - -#~ msgid "gvimext.dll error" -#~ msgstr "помилка gvimext.dll" - -#~ msgid "Path length too long!" -#~ msgstr "ШлÑÑ… занадто довгий!" - -# msgstr "E233: " -#~ msgid "E234: Unknown fontset: %s" -#~ msgstr "E234: Ðевідомий набір шрифтів: %s" - -#~ msgid "E235: Unknown font: %s" -#~ msgstr "E235: Ðевідомий шрифт: %s" - -# msgstr "E235: " -#~ msgid "E236: Font \"%s\" is not fixed-width" -#~ msgstr "E236: Шрифт «%s» не моноширинний" - -#~ msgid "E448: Could not load library function %s" -#~ msgstr "E448: Ðе вдалоÑÑ Ð·Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶Ð¸Ñ‚Ð¸ бібліотечну функцію %s" - -#~ msgid "E26: Hebrew cannot be used: Not enabled at compile time\n" -#~ msgstr "E26: Ðе можна викориÑтати іврит: Ðе ввімкнено під Ñ‡Ð°Ñ ÐºÐ¾Ð¼Ð¿Ñ–Ð»Ñції\n" - -#~ msgid "E27: Farsi cannot be used: Not enabled at compile time\n" -#~ msgstr "E27: Ðе можна викориÑтати фарÑÑ–: Ðе ввімкнено під Ñ‡Ð°Ñ ÐºÐ¾Ð¼Ð¿Ñ–Ð»Ñції\n" - -#~ msgid "E800: Arabic cannot be used: Not enabled at compile time\n" -#~ msgstr "" -#~ "E800: Ðе можна викориÑтати арабÑьку мову: Ðе ввімкнено під Ñ‡Ð°Ñ " -#~ "компілÑції\n" - -#~ msgid "E247: no registered server named \"%s\"" -#~ msgstr "E247: Ðемає зареєÑтрованих Ñерверів з назвою «%s»" - -#~ msgid "E233: cannot open display" -#~ msgstr "E233: Ðе вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ диÑплей" - -#~ msgid "E449: Invalid expression received" -#~ msgstr "E449: Отримано некоректний вираз" - -#~ msgid "E463: Region is guarded, cannot modify" -#~ msgstr "E463: Ðе можна змінити захищений регіон" - -#~ msgid "E744: NetBeans does not allow changes in read-only files" -#~ msgstr "E744: NetBeans не дозволÑÑ” змінювати захищені від запиÑу файли" - -#~ msgid "Need encryption key for \"%s\"" -#~ msgstr "Ð”Ð»Ñ Â«%s» потрібен ключ: " - -# msgstr "E406: " -#~ msgid "empty keys are not allowed" -#~ msgstr "порожні ключі не дозволені" - -#~ msgid "dictionary is locked" -#~ msgstr "Ñловник заблоковано" - -#~ msgid "list is locked" -#~ msgstr "ÑпиÑок заблоковано" - -#~ msgid "failed to add key '%s' to dictionary" -#~ msgstr "не вдалоÑÑ Ð´Ð¾Ð´Ð°Ñ‚Ð¸ ключ '%s' до Ñловника" - -#~ msgid "index must be int or slice, not %s" -#~ msgstr "Ñ–Ð½Ð´ÐµÐºÑ Ð¼Ð°Ñ” бути цілий чи зріз, не %s" - -#~ msgid "expected str() or unicode() instance, but got %s" -#~ msgstr "очікувавÑÑ ÐµÐºÐ·ÐµÐ¼Ð¿Ð»ÑÑ€ str() чи unicode(), але отримано %s" - -#~ msgid "expected bytes() or str() instance, but got %s" -#~ msgstr "очікувавÑÑ ÐµÐºÐ·ÐµÐ¼Ð¿Ð»ÑÑ€ bytes() чи str(), але отримано %s" - -#~ msgid "" -#~ "expected int(), long() or something supporting coercing to long(), but " -#~ "got %s" -#~ msgstr "" -#~ "очікувавÑÑ int(), long() чи щоÑÑŒ, що може бути вміщене long(), але " -#~ "отримано %s" - -#~ msgid "expected int() or something supporting coercing to int(), but got %s" -#~ msgstr "" -#~ "очікувавÑÑ int() чи щоÑÑŒ, що може бути вміщене int(), але отримано %s" - -#~ msgid "value is too large to fit into C int type" -#~ msgstr "Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð·Ð°Ð²ÐµÐ»Ð¸ÐºÐµ, щоб вміÑтитиÑÑ Ñƒ тип C int" - -#~ msgid "value is too small to fit into C int type" -#~ msgstr "Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð·Ð°Ð¼Ð°Ð»Ðµ, щоб вміÑтитиÑÑ Ñƒ тип C int" - -#~ msgid "number must be greater then zero" -#~ msgstr "чиÑло має бути більше, ніж нуль" - -#~ msgid "number must be greater or equal to zero" -#~ msgstr "чиÑло має бути не менше, ніж нуль" - -#~ msgid "can't delete OutputObject attributes" -#~ msgstr "не вдалоÑÑ Ð·Ð½Ð¸Ñ‰Ð¸Ñ‚Ð¸ атрибути OutputObject" - -# msgstr "E180: " -#~ msgid "invalid attribute: %s" -#~ msgstr "неправильний атрибут: %s" - -#~ msgid "E264: Python: Error initialising I/O objects" -#~ msgstr "E264: Python: Помилка ініціалізації об'єктів вводу/виводу" - -#~ msgid "failed to change directory" -#~ msgstr "не вдалоÑÑ Ð·Ð¼Ñ–Ð½Ð¸Ñ‚Ð¸ директорію" - -#~ msgid "expected 3-tuple as imp.find_module() result, but got %s" -#~ msgstr "очікувавÑÑ 3-кортеж Ñк результат imp.find_module(), але отримано %s" - -#~ msgid "" -#~ "expected 3-tuple as imp.find_module() result, but got tuple of size %d" -#~ msgstr "очікувавÑÑ 3-кортеж Ñк результат imp.find_module(), але отримано %d" - -#~ msgid "internal error: imp.find_module returned tuple with NULL" -#~ msgstr "Ð²Ð½ÑƒÑ‚Ñ€Ñ–ÑˆÐ½Ñ Ð¿Ð¾Ð¼Ð¸Ð»ÐºÐ°: imp.find_module повернула кортеж з NULL" - -#~ msgid "cannot delete vim.Dictionary attributes" -#~ msgstr "не вдалоÑÑ Ð·Ð½Ð¸Ñ‰Ð¸Ñ‚Ð¸ атрибути vim.Dictionary" - -#~ msgid "cannot modify fixed dictionary" -#~ msgstr "не можна змінити фікÑований Ñловник" - -#~ msgid "cannot set attribute %s" -#~ msgstr "не можна вÑтановити атрибут %s" - -#~ msgid "hashtab changed during iteration" -#~ msgstr "хеш-Ñ‚Ð°Ð±Ð»Ð¸Ñ†Ñ Ð·Ð¼Ñ–Ð½Ð¸Ð»Ð°ÑÑ Ð¿Ñ–Ð´ Ñ‡Ð°Ñ Ð¿ÐµÑ€ÐµÐ±Ð¸Ñ€Ð°Ð½Ð½Ñ" - -#~ msgid "expected sequence element of size 2, but got sequence of size %d" -#~ msgstr "" -#~ "очікувалаÑÑŒ поÑлідовніÑть розміром 2, але отримано поÑлідовніÑть розміру " -#~ "%d" - -#~ msgid "list constructor does not accept keyword arguments" -#~ msgstr "ÑпиÑковий конÑтруктор не приймає іменовані аргументи" - -#~ msgid "list index out of range" -#~ msgstr "Ñ–Ð½Ð´ÐµÐºÑ ÑпиÑку за межами" - -#~ msgid "internal error: failed to get vim list item %d" -#~ msgstr "Ð²Ð½ÑƒÑ‚Ñ€Ñ–ÑˆÐ½Ñ Ð¿Ð¾Ð¼Ð¸Ð»ÐºÐ°: не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ елемент ÑпиÑку vim %d" - -#~ msgid "failed to add item to list" -#~ msgstr "не вдалоÑÑ Ð´Ð¾Ð´Ð°Ñ‚Ð¸ елемент до ÑпиÑку" - -#~ msgid "internal error: no vim list item %d" -#~ msgstr "Ð²Ð½ÑƒÑ‚Ñ€Ñ–ÑˆÐ½Ñ Ð¿Ð¾Ð¼Ð¸Ð»ÐºÐ°: немає елемента ÑпиÑку vim %d" - -#~ msgid "internal error: failed to add item to list" -#~ msgstr "Ð²Ð½ÑƒÑ‚Ñ€Ñ–ÑˆÐ½Ñ Ð¿Ð¾Ð¼Ð¸Ð»ÐºÐ°: не вдалоÑÑ Ð´Ð¾Ð´Ð°Ñ‚Ð¸ елемент до ÑпиÑку" - -#~ msgid "cannot delete vim.List attributes" -#~ msgstr "не вдалоÑÑ Ð·Ð½Ð¸Ñ‰Ð¸Ñ‚Ð¸ атрибути vim.List" - -#~ msgid "cannot modify fixed list" -#~ msgstr "не можна змінити фікÑований ÑпиÑок" - -# msgstr "E428: " -#~ msgid "unnamed function %s does not exist" -#~ msgstr "безіменної функції %s не Ñ–Ñнує" - -# msgstr "E428: " -#~ msgid "function %s does not exist" -#~ msgstr "функції %s не Ñ–Ñнує" - -#~ msgid "function constructor does not accept keyword arguments" -#~ msgstr "конÑтруктор функції не приймає іменовані аргументи" - -#~ msgid "failed to run function %s" -#~ msgstr "не вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ функцію %s" - -#~ msgid "problem while switching windows" -#~ msgstr "не вдалоÑÑ Ð¿ÐµÑ€ÐµÐ¼ÐºÐ½ÑƒÑ‚Ð¸ вікна" - -#~ msgid "unable to unset global option %s" -#~ msgstr "не вдалоÑÑ Ñкинути глобальну опцію %s" - -#~ msgid "unable to unset option %s which does not have global value" -#~ msgstr "не вдалоÑÑ Ñкинути опцію %s, Ñка не має глобального значеннÑ" - -#~ msgid "attempt to refer to deleted tab page" -#~ msgstr "Ñпроба Ð·Ð²ÐµÑ€Ð½ÐµÐ½Ð½Ñ Ð´Ð¾ знищеної вкладки" - -#~ msgid "no such tab page" -#~ msgstr "такої вкладки немає" - -#~ msgid "attempt to refer to deleted window" -#~ msgstr "Ñпроба звернутиÑÑ Ð´Ð¾ знищеного вікна" - -#~ msgid "readonly attribute: buffer" -#~ msgstr "атрибут лише Ð´Ð»Ñ Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ: буфер" - -#~ msgid "cursor position outside buffer" -#~ msgstr "курÑор за межами буфера" - -#~ msgid "no such window" -#~ msgstr "такого вікна немає" - -#~ msgid "attempt to refer to deleted buffer" -#~ msgstr "Ñпроба Ð·Ð²ÐµÑ€Ð½ÐµÐ½Ð½Ñ Ð´Ð¾ знищеного буфера" - -#~ msgid "failed to rename buffer" -#~ msgstr "не вдалоÑÑ Ð¿ÐµÑ€ÐµÐ¹Ð¼ÐµÐ½ÑƒÐ²Ð°Ñ‚Ð¸ буфер" - -#~ msgid "mark name must be a single character" -#~ msgstr "назвою мітки має бути один Ñимвол" - -#~ msgid "expected vim.Buffer object, but got %s" -#~ msgstr "очікувавÑÑ Ð¾Ð±â€™Ñ”ÐºÑ‚ vim.Buffer, але отримано %s" - -#~ msgid "failed to switch to buffer %d" -#~ msgstr "не вдалоÑÑ Ð¿ÐµÑ€ÐµÐ¼ÐºÐ½ÑƒÑ‚Ð¸ÑÑ Ð´Ð¾ буфера %d" - -#~ msgid "expected vim.Window object, but got %s" -#~ msgstr "очікувавÑÑ Ð¾Ð±â€™Ñ”ÐºÑ‚ vim.Window, але отримано %s" - -#~ msgid "failed to find window in the current tab page" -#~ msgstr "не вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ вікно у поточній вкладці" - -#~ msgid "did not switch to the specified window" -#~ msgstr "не перемкнувÑÑ Ð´Ð¾ вказаного вікна" - -#~ msgid "expected vim.TabPage object, but got %s" -#~ msgstr "очікувавÑÑ Ð¾Ð±â€™Ñ”ÐºÑ‚ vim.TabPage, але отримано %s" - -#~ msgid "did not switch to the specified tab page" -#~ msgstr "не перемкнувÑÑ Ð´Ð¾ вказаної вкладки" - -#~ msgid "failed to run the code" -#~ msgstr "не вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ код" - -#~ msgid "E858: Eval did not return a valid python object" -#~ msgstr "E858: Eval не повернув дійÑний об’єкт python" - -#~ msgid "E859: Failed to convert returned python object to vim value" -#~ msgstr "E859: Ðе вдалоÑÑ Ð¿ÐµÑ€ÐµÑ‚Ð²Ð¾Ñ€Ð¸Ñ‚Ð¸ об’єкт python у Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ vim" - -#~ msgid "unable to convert %s to vim dictionary" -#~ msgstr "не вдалоÑÑ Ð¿ÐµÑ€ÐµÑ‚Ð²Ð¾Ñ€Ð¸Ñ‚Ð¸ %s у Ñловник vim" - -#~ msgid "unable to convert %s to vim structure" -#~ msgstr "не вдалоÑÑ Ð¿ÐµÑ€ÐµÑ‚Ð²Ð¾Ñ€Ð¸Ñ‚Ð¸ %s у Ñтруктуру vim" - -#~ msgid "internal error: NULL reference passed" -#~ msgstr "Ð²Ð½ÑƒÑ‚Ñ€Ñ–ÑˆÐ½Ñ Ð¿Ð¾Ð¼Ð¸Ð»ÐºÐ°: передано поÑÐ¸Ð»Ð°Ð½Ð½Ñ NULL" - -#~ msgid "internal error: invalid value type" -#~ msgstr "Ð²Ð½ÑƒÑ‚Ñ€Ñ–ÑˆÐ½Ñ Ð¿Ð¾Ð¼Ð¸Ð»ÐºÐ°: неправильний тип значеннÑ" - -#~ msgid "" -#~ "Failed to set path hook: sys.path_hooks is not a list\n" -#~ "You should now do the following:\n" -#~ "- append vim.path_hook to sys.path_hooks\n" -#~ "- append vim.VIM_SPECIAL_PATH to sys.path\n" -#~ msgstr "" -#~ "Ðе вдалоÑÑ Ð²Ñтановити обробник шлÑху: sys.path_hooks не ÑпиÑок\n" -#~ "Вам Ñлід вчинити так:\n" -#~ "- додайте vim.path_hook до sys.path_hooks\n" -#~ "- додайте vim.VIM_SPECIAL_PATH до sys.path\n" - -#~ msgid "" -#~ "Failed to set path: sys.path is not a list\n" -#~ "You should now append vim.VIM_SPECIAL_PATH to sys.path" -#~ msgstr "" -#~ "Ðе вдалоÑÑ Ð²Ñтановити шлÑÑ…: sys.path не ÑпиÑок\n" -#~ "Ð’Ð°Ñ Ñлід додати vim.VIM_SPECIAL_PATH до sys.path" diff --git a/src/nvim/po/vi.po b/src/nvim/po/vi.po index a720510426..49c6765843 100644 --- a/src/nvim/po/vi.po +++ b/src/nvim/po/vi.po @@ -4311,11 +4311,6 @@ msgstr "dòng %4ld:" msgid "E354: Invalid register name: '%s'" msgstr "E354: Tên sổ đăng ký không cho phép: '%s'" -#: ../message.c:745 -msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>" -msgstr "" -"Bản dịch các thông báo sang tiếng Việt: Phan VÄ©nh Thịnh <teppi@vnlinux.org>" - #: ../message.c:986 msgid "Interrupt: " msgstr "Gián Ä‘oạn: " diff --git a/src/nvim/po/zh_CN.UTF-8.po b/src/nvim/po/zh_CN.UTF-8.po index 82b895d9d6..e88efed8e3 100644 --- a/src/nvim/po/zh_CN.UTF-8.po +++ b/src/nvim/po/zh_CN.UTF-8.po @@ -4264,10 +4264,6 @@ msgstr "第 %4ld 行:" msgid "E354: Invalid register name: '%s'" msgstr "E354: æ— æ•ˆçš„å¯„å˜å™¨å: '%s'" -#: ../message.c:745 -msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>" -msgstr "ç®€ä½“ä¸æ–‡æ¶ˆæ¯ç»´æŠ¤è€…: Yuheng Xie <elephant@linux.net.cn>" - #: ../message.c:986 msgid "Interrupt: " msgstr "已䏿–: " diff --git a/src/nvim/po/zh_CN.cp936.po b/src/nvim/po/zh_CN.cp936.po index cf66010c71..e5351cc22a 100644 --- a/src/nvim/po/zh_CN.cp936.po +++ b/src/nvim/po/zh_CN.cp936.po @@ -4265,10 +4265,6 @@ msgstr "µÚ %4ld ÐÐ:" msgid "E354: Invalid register name: '%s'" msgstr "E354: ÎÞЧµÄ¼Ä´æÆ÷Ãû: '%s'" -#: ../message.c:745 -msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>" -msgstr "¼òÌåÖÐÎÄÏûϢά»¤Õß: Yuheng Xie <elephant@linux.net.cn>" - #: ../message.c:986 msgid "Interrupt: " msgstr "ÒÑÖжÏ: " diff --git a/src/nvim/po/zh_CN.po b/src/nvim/po/zh_CN.po index 254ebbce6b..6cc4dd42ac 100644 --- a/src/nvim/po/zh_CN.po +++ b/src/nvim/po/zh_CN.po @@ -4265,10 +4265,6 @@ msgstr "µÚ %4ld ÐÐ:" msgid "E354: Invalid register name: '%s'" msgstr "E354: ÎÞЧµÄ¼Ä´æÆ÷Ãû: '%s'" -#: ../message.c:745 -msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>" -msgstr "¼òÌåÖÐÎÄÏûϢά»¤Õß: Yuheng Xie <elephant@linux.net.cn>" - #: ../message.c:986 msgid "Interrupt: " msgstr "ÒÑÖжÏ: " diff --git a/src/nvim/po/zh_TW.UTF-8.po b/src/nvim/po/zh_TW.UTF-8.po index 79e09c83d1..da86d80c27 100644 --- a/src/nvim/po/zh_TW.UTF-8.po +++ b/src/nvim/po/zh_TW.UTF-8.po @@ -4304,12 +4304,6 @@ msgstr "行 %4ld:" msgid "E354: Invalid register name: '%s'" msgstr "E354: æš«å˜å™¨å稱錯誤: '%s'" -#: ../message.c:745 -msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>" -msgstr "" -"æ£é«”䏿–‡è¨Šæ¯ç¶è·è€…: Francis S.Lin <piaip@csie.ntu.edu." -"tw>, Cecil Sheng <b7506022@csie.ntu.edu.tw>" - #: ../message.c:986 msgid "Interrupt: " msgstr "已䏿–·: " diff --git a/src/nvim/po/zh_TW.po b/src/nvim/po/zh_TW.po index 07d510c0c6..977f18086e 100644 --- a/src/nvim/po/zh_TW.po +++ b/src/nvim/po/zh_TW.po @@ -4296,12 +4296,6 @@ msgstr "¦æ %4ld:" msgid "E354: Invalid register name: '%s'" msgstr "E354: ¼È¦s¾¹¦WºÙ¿ù»~: '%s'" -#: ../message.c:745 -msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>" -msgstr "" -"¥¿Å餤¤å°T®§ºûÅ@ªÌ: Francis S.Lin <piaip@csie.ntu.edu." -"tw>, Cecil Sheng <b7506022@csie.ntu.edu.tw>" - #: ../message.c:986 msgid "Interrupt: " msgstr "¤w¤¤Â_: " diff --git a/src/nvim/popupmnu.c b/src/nvim/popupmnu.c index 5ad621e666..947814de4f 100644 --- a/src/nvim/popupmnu.c +++ b/src/nvim/popupmnu.c @@ -7,12 +7,12 @@ #include <stdbool.h> #include "nvim/vim.h" +#include "nvim/api/private/helpers.h" #include "nvim/ascii.h" #include "nvim/popupmnu.h" #include "nvim/charset.h" #include "nvim/ex_cmds.h" #include "nvim/memline.h" -#include "nvim/misc2.h" #include "nvim/move.h" #include "nvim/option.h" #include "nvim/screen.h" @@ -21,6 +21,7 @@ #include "nvim/memory.h" #include "nvim/window.h" #include "nvim/edit.h" +#include "nvim/ui.h" static pumitem_T *pum_array = NULL; // items of displayed pum static int pum_size; // nr of items in "pum_array" @@ -36,8 +37,10 @@ static int pum_scrollbar; // TRUE when scrollbar present static int pum_row; // top row of pum static int pum_col; // left column of pum -static int pum_do_redraw = FALSE; // do redraw anyway +static bool pum_is_visible = false; +static bool pum_external = false; +static bool pum_wants_external = false; #ifdef INCLUDE_GENERATED_DECLARATIONS # include "popupmnu.c.generated.h" @@ -53,7 +56,10 @@ static int pum_do_redraw = FALSE; // do redraw anyway /// @param array /// @param size /// @param selected index of initially selected item, none if out of range -void pum_display(pumitem_T *array, int size, int selected) +/// @param array_changed if true, array contains different items since last call +/// if false, a new item is selected, but the array +/// is the same +void pum_display(pumitem_T *array, int size, int selected, bool array_changed) { int w; int def_width; @@ -68,20 +74,55 @@ void pum_display(pumitem_T *array, int size, int selected) int above_row = cmdline_row; int redo_count = 0; + if (!pum_is_visible) { + // To keep the code simple, we only allow changing the + // draw mode when the popup menu is not being displayed + pum_external = pum_wants_external; + } + redo: + // Mark the pum as visible already here, + // to avoid that must_redraw is set when 'cursorcolumn' is on. + pum_is_visible = true; + validate_cursor_col(); + + // anchor position: the start of the completed word + row = curwin->w_wrow + curwin->w_winrow; + if (curwin->w_p_rl) { + col = curwin->w_wincol + curwin->w_width - curwin->w_wcol - 1; + } else { + col = curwin->w_wincol + curwin->w_wcol; + } + + if (pum_external) { + Array args = ARRAY_DICT_INIT; + if (array_changed) { + Array arr = ARRAY_DICT_INIT; + for (i = 0; i < size; i++) { + Array item = ARRAY_DICT_INIT; + ADD(item, STRING_OBJ(cstr_to_string((char *)array[i].pum_text))); + ADD(item, STRING_OBJ(cstr_to_string((char *)array[i].pum_kind))); + ADD(item, STRING_OBJ(cstr_to_string((char *)array[i].pum_extra))); + ADD(item, STRING_OBJ(cstr_to_string((char *)array[i].pum_info))); + ADD(arr, ARRAY_OBJ(item)); + } + ADD(args, ARRAY_OBJ(arr)); + ADD(args, INTEGER_OBJ(selected)); + ADD(args, INTEGER_OBJ(row)); + ADD(args, INTEGER_OBJ(col)); + ui_event("popupmenu_show", args); + } else { + ADD(args, INTEGER_OBJ(selected)); + ui_event("popupmenu_select", args); + } + return; + } + def_width = PUM_DEF_WIDTH; max_width = 0; kind_width = 0; extra_width = 0; - // Pretend the pum is already there to avoid that must_redraw is set when - // 'cuc' is on. - pum_array = (pumitem_T *)1; - validate_cursor_col(); - pum_array = NULL; - - row = curwin->w_wrow + curwin->w_winrow; - if (firstwin->w_p_pvw) { top_clear = firstwin->w_height; } else { @@ -194,13 +235,6 @@ redo: pum_base_width = max_width; pum_kind_width = kind_width; - // Calculate column - if (curwin->w_p_rl) { - col = curwin->w_wincol + curwin->w_width - curwin->w_wcol - 1; - } else { - col = curwin->w_wincol + curwin->w_wcol; - } - // if there are more items than room we need a scrollbar if (pum_height < size) { pum_scrollbar = 1; @@ -641,9 +675,9 @@ static int pum_set_selected(int n, int repeat) // Update the screen before drawing the popup menu. // Enable updating the status lines. - pum_do_redraw = TRUE; + pum_is_visible = false; update_screen(0); - pum_do_redraw = FALSE; + pum_is_visible = true; if (!resized && win_valid(curwin_save)) { no_u_sync++; @@ -653,9 +687,9 @@ static int pum_set_selected(int n, int repeat) // May need to update the screen again when there are // autocommands involved. - pum_do_redraw = TRUE; + pum_is_visible = false; update_screen(0); - pum_do_redraw = FALSE; + pum_is_visible = true; } } } @@ -672,10 +706,17 @@ static int pum_set_selected(int n, int repeat) /// Undisplay the popup menu (later). void pum_undisplay(void) { + pum_is_visible = false; pum_array = NULL; - redraw_all_later(SOME_VALID); - redraw_tabline = TRUE; - status_redraw_all(); + + if (pum_external) { + Array args = ARRAY_DICT_INIT; + ui_event("popupmenu_hide", args); + } else { + redraw_all_later(SOME_VALID); + redraw_tabline = true; + status_redraw_all(); + } } /// Clear the popup menu. Currently only resets the offset to the first @@ -685,12 +726,16 @@ void pum_clear(void) pum_first = 0; } -/// Overruled when "pum_do_redraw" is set, used to redraw the status lines. -/// -/// @return TRUE if the popup menu is displayed. -int pum_visible(void) +/// @return true if the popup menu is displayed. +bool pum_visible(void) { - return !pum_do_redraw && pum_array != NULL; + return pum_is_visible; +} + +/// @return true if the popup menu is displayed and drawn on the grid. +bool pum_drawn(void) +{ + return pum_visible() && !pum_external; } /// Gets the height of the menu. @@ -701,3 +746,8 @@ int pum_get_height(void) { return pum_height; } + +void pum_set_external(bool external) +{ + pum_wants_external = external; +} diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index dfd795b0ba..a7aff15121 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -27,7 +27,6 @@ #include "nvim/memline.h" #include "nvim/message.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" #include "nvim/memory.h" #include "nvim/move.h" #include "nvim/normal.h" @@ -1732,15 +1731,29 @@ void qf_list(exarg_T *eap) EMSG(_(e_quickfix)); return; } + + bool plus = false; + if (*arg == '+') { + arg++; + plus = true; + } if (!get_list_range(&arg, &idx1, &idx2) || *arg != NUL) { EMSG(_(e_trailing)); return; } - i = qi->qf_lists[qi->qf_curlist].qf_count; - if (idx1 < 0) - idx1 = (-idx1 > i) ? 0 : idx1 + i + 1; - if (idx2 < 0) - idx2 = (-idx2 > i) ? 0 : idx2 + i + 1; + if (plus) { + i = qi->qf_lists[qi->qf_curlist].qf_index; + idx2 = i + idx1; + idx1 = i; + } else { + i = qi->qf_lists[qi->qf_curlist].qf_count; + if (idx1 < 0) { + idx1 = (-idx1 > i) ? 0 : idx1 + i + 1; + } + if (idx2 < 0) { + idx2 = (-idx2 > i) ? 0 : idx2 + i + 1; + } + } if (qi->qf_lists[qi->qf_curlist].qf_nonevalid) all = TRUE; @@ -1764,16 +1777,18 @@ void qf_list(exarg_T *eap) vim_snprintf((char *)IObuff, IOSIZE, "%2d %s", i, (char *)fname); msg_outtrans_attr(IObuff, i == qi->qf_lists[qi->qf_curlist].qf_index - ? hl_attr(HLF_L) : hl_attr(HLF_D)); - if (qfp->qf_lnum == 0) + ? hl_attr(HLF_QFL) : hl_attr(HLF_D)); + if (qfp->qf_lnum == 0) { IObuff[0] = NUL; - else if (qfp->qf_col == 0) - sprintf((char *)IObuff, ":%" PRId64, (int64_t)qfp->qf_lnum); - else - sprintf((char *)IObuff, ":%" PRId64 " col %d", - (int64_t)qfp->qf_lnum, qfp->qf_col); - sprintf((char *)IObuff + STRLEN(IObuff), "%s:", - (char *)qf_types(qfp->qf_type, qfp->qf_nr)); + } else if (qfp->qf_col == 0) { + vim_snprintf((char *)IObuff, IOSIZE, ":%" PRId64, + (int64_t)qfp->qf_lnum); + } else { + vim_snprintf((char *)IObuff, IOSIZE, ":%" PRId64 " col %d", + (int64_t)qfp->qf_lnum, qfp->qf_col); + } + vim_snprintf((char *)IObuff + STRLEN(IObuff), IOSIZE, "%s:", + (char *)qf_types(qfp->qf_type, qfp->qf_nr)); msg_puts_attr(IObuff, hl_attr(HLF_N)); if (qfp->qf_pattern != NULL) { qf_fmt_text(qfp->qf_pattern, IObuff, IOSIZE); @@ -3503,15 +3518,15 @@ int set_errorlist(win_T *wp, list_T *list, int action, char_u *title) if (d == NULL) continue; - char_u *filename = get_dict_string(d, (char_u *)"filename", true); - int bufnum = (int)get_dict_number(d, (char_u *)"bufnr"); - long lnum = get_dict_number(d, (char_u *)"lnum"); - int col = (int)get_dict_number(d, (char_u *)"col"); - char_u vcol = (char_u)get_dict_number(d, (char_u *)"vcol"); - int nr = (int)get_dict_number(d, (char_u *)"nr"); - char_u *type = get_dict_string(d, (char_u *)"type", true); - char_u *pattern = get_dict_string(d, (char_u *)"pattern", true); - char_u *text = get_dict_string(d, (char_u *)"text", true); + char_u *filename = get_dict_string(d, "filename", true); + int bufnum = (int)get_dict_number(d, "bufnr"); + long lnum = get_dict_number(d, "lnum"); + int col = (int)get_dict_number(d, "col"); + char_u vcol = (char_u)get_dict_number(d, "vcol"); + int nr = (int)get_dict_number(d, "nr"); + char_u *type = get_dict_string(d, "type", true); + char_u *pattern = get_dict_string(d, "pattern", true); + char_u *text = get_dict_string(d, "text", true); if (text == NULL) { text = vim_strsave((char_u *)""); } diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index f8fd7d4ef8..64a70c295a 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -59,7 +59,6 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" #include "nvim/garray.h" #include "nvim/strings.h" diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c index 92dbd693ea..35308b7411 100644 --- a/src/nvim/regexp_nfa.c +++ b/src/nvim/regexp_nfa.c @@ -11,7 +11,6 @@ #include <limits.h> #include "nvim/ascii.h" -#include "nvim/misc2.h" #include "nvim/garray.h" /* @@ -4855,9 +4854,15 @@ static int nfa_regmatch(nfa_regprog_T *prog, nfa_state_T *start, // recursive_regmatch(). Allow interrupting them with CTRL-C. fast_breakcheck(); if (got_int) { +#ifdef NFA_REGEXP_DEBUG_LOG + fclose(debug); +#endif return false; } if (nfa_time_limit != NULL && profile_passed_limit(*nfa_time_limit)) { +#ifdef NFA_REGEXP_DEBUG_LOG + fclose(debug); +#endif return false; } diff --git a/src/nvim/screen.c b/src/nvim/screen.c index d67142822f..9a2eeda8b2 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -108,7 +108,6 @@ #include "nvim/menu.h" #include "nvim/message.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" #include "nvim/garray.h" #include "nvim/move.h" #include "nvim/normal.h" @@ -120,6 +119,7 @@ #include "nvim/regexp.h" #include "nvim/search.h" #include "nvim/spell.h" +#include "nvim/state.h" #include "nvim/strings.h" #include "nvim/syntax.h" #include "nvim/terminal.h" @@ -420,9 +420,10 @@ void update_screen(int type) } } end_search_hl(); - /* May need to redraw the popup menu. */ - if (pum_visible()) + // May need to redraw the popup menu. + if (pum_drawn()) { pum_redraw(); + } /* Reset b_mod_set flags. Going through all windows is probably faster * than going through all buffers (there could be many buffers). */ @@ -2403,11 +2404,14 @@ win_line ( if (v != 0) line_attr = sign_get_attr((int)v, TRUE); - /* Highlight the current line in the quickfix window. */ - if (bt_quickfix(wp->w_buffer) && qf_current_entry(wp) == lnum) - line_attr = hl_attr(HLF_L); - if (line_attr != 0) - area_highlighting = TRUE; + // Highlight the current line in the quickfix window. + if (bt_quickfix(wp->w_buffer) && qf_current_entry(wp) == lnum) { + line_attr = hl_attr(HLF_QFL); + } + + if (line_attr != 0) { + area_highlighting = true; + } line = ml_get_buf(wp->w_buffer, lnum, FALSE); ptr = line; @@ -2624,7 +2628,12 @@ win_line ( * then. */ if (wp->w_p_cul && lnum == wp->w_cursor.lnum && !(wp == curwin && VIsual_active)) { - line_attr = hl_attr(HLF_CUL); + if (line_attr != 0 && !(State & INSERT) && bt_quickfix(wp->w_buffer) + && qf_current_entry(wp) == lnum) { + line_attr = hl_combine_attr(hl_attr(HLF_CUL), line_attr); + } else { + line_attr = hl_attr(HLF_CUL); + } area_highlighting = true; } @@ -4819,15 +4828,12 @@ void win_redr_status(win_T *wp) wp->w_redr_status = FALSE; if (wp->w_status_height == 0) { - /* no status line, can only be last window */ - redraw_cmdline = TRUE; - } else if (!redrawing() - /* don't update status line when popup menu is visible and may be - * drawn over it */ - || pum_visible() - ) { - /* Don't redraw right now, do it later. */ - wp->w_redr_status = TRUE; + // no status line, can only be last window + redraw_cmdline = true; + } else if (!redrawing() || pum_drawn()) { + // Don't redraw right now, do it later. Don't update status line when + // popup menu is visible and may be drawn over it + wp->w_redr_status = true; } else if (*p_stl != NUL || *wp->w_p_stl != NUL) { /* redraw custom status line */ redraw_custom_statusline(wp); @@ -7073,9 +7079,9 @@ void showruler(int always) { if (!always && !redrawing()) return; - if (pum_visible()) { - /* Don't redraw right now, do it later. */ - curwin->w_redr_status = TRUE; + if (pum_drawn()) { + // Don't redraw right now, do it later. + curwin->w_redr_status = true; return; } if ((*p_stl != NUL || *curwin->w_p_stl != NUL) && curwin->w_status_height) { @@ -7111,9 +7117,10 @@ static void win_redr_ruler(win_T *wp, int always) if (wp == lastwin && lastwin->w_status_height == 0) if (edit_submode != NULL) return; - /* Don't draw the ruler when the popup menu is visible, it may overlap. */ - if (pum_visible()) + // Don't draw the ruler when the popup menu is visible, it may overlap. + if (pum_drawn()) { return; + } if (*p_ruf) { int save_called_emsg = called_emsg; @@ -7363,7 +7370,7 @@ void screen_resize(int width, int height) redrawcmdline(); } else { update_topline(); - if (pum_visible()) { + if (pum_drawn()) { redraw_later(NOT_VALID); ins_compl_show_pum(); /* This includes the redraw. */ } else diff --git a/src/nvim/search.c b/src/nvim/search.c index 6e2b69fff7..5f4df3be92 100644 --- a/src/nvim/search.c +++ b/src/nvim/search.c @@ -31,7 +31,6 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" #include "nvim/move.h" #include "nvim/mouse.h" #include "nvim/normal.h" diff --git a/src/nvim/shada.c b/src/nvim/shada.c index b5921eb810..01c0807d82 100644 --- a/src/nvim/shada.c +++ b/src/nvim/shada.c @@ -27,7 +27,6 @@ #include "nvim/api/private/helpers.h" #include "nvim/buffer.h" #include "nvim/buffer_defs.h" -#include "nvim/misc2.h" #include "nvim/ex_getln.h" #include "nvim/search.h" #include "nvim/regexp.h" @@ -1524,7 +1523,7 @@ static const char *shada_get_default_file(void) FUNC_ATTR_WARN_UNUSED_RESULT { if (default_shada_file == NULL) { - char *shada_dir = stdpaths_user_data_subpath("shada", 0); + char *shada_dir = stdpaths_user_data_subpath("shada", 0, false); default_shada_file = concat_fnames_realloc(shada_dir, "main.shada", true); } return default_shada_file; @@ -2976,7 +2975,7 @@ shada_write_file_nomerge: {} if (sd_writer.cookie == NULL) { xfree(fname); xfree(tempname); - if (sd_reader.close != NULL) { + if (sd_reader.cookie != NULL) { sd_reader.close(&sd_reader); } return FAIL; diff --git a/src/nvim/spell.c b/src/nvim/spell.c index 610fb660e7..ba7f31be25 100644 --- a/src/nvim/spell.c +++ b/src/nvim/spell.c @@ -312,7 +312,6 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" #include "nvim/garray.h" #include "nvim/normal.h" #include "nvim/option.h" diff --git a/src/nvim/state.c b/src/nvim/state.c index 30133e2201..f792ec00a4 100644 --- a/src/nvim/state.c +++ b/src/nvim/state.c @@ -2,10 +2,12 @@ #include "nvim/lib/kvec.h" +#include "nvim/ascii.h" #include "nvim/state.h" #include "nvim/vim.h" #include "nvim/main.h" #include "nvim/getchar.h" +#include "nvim/option_defs.h" #include "nvim/ui.h" #include "nvim/os/input.h" @@ -61,3 +63,35 @@ getkey: } } } + +/// Return TRUE if in the current mode we need to use virtual. +int virtual_active(void) +{ + // While an operator is being executed we return "virtual_op", because + // VIsual_active has already been reset, thus we can't check for "block" + // being used. + if (virtual_op != MAYBE) { + return virtual_op; + } + return ve_flags == VE_ALL + || ((ve_flags & VE_BLOCK) && VIsual_active && VIsual_mode == Ctrl_V) + || ((ve_flags & VE_INSERT) && (State & INSERT)); +} + +/// VISUAL, SELECTMODE and OP_PENDING State are never set, they are equal to +/// NORMAL State with a condition. This function returns the real State. +int get_real_state(void) +{ + if (State & NORMAL) { + if (VIsual_active) { + if (VIsual_select) { + return SELECTMODE; + } + return VISUAL; + } else if (finish_op) { + return OP_PENDING; + } + } + return State; +} + diff --git a/src/nvim/strings.c b/src/nvim/strings.c index 37a0fb82da..c1800a0639 100644 --- a/src/nvim/strings.c +++ b/src/nvim/strings.c @@ -5,7 +5,6 @@ #include "nvim/vim.h" #include "nvim/ascii.h" #include "nvim/strings.h" -#include "nvim/misc2.h" #include "nvim/file_search.h" #include "nvim/buffer.h" #include "nvim/charset.h" diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index 3215f7ea14..6fd7603629 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -25,7 +25,6 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" #include "nvim/keymap.h" #include "nvim/garray.h" #include "nvim/option.h" @@ -5902,6 +5901,7 @@ static char *highlight_init_both[] = "VertSplit cterm=reverse gui=reverse", "WildMenu ctermbg=Yellow ctermfg=Black guibg=Yellow guifg=Black", "default link EndOfBuffer NonText", + "default link QuickFixLine Search", NULL }; @@ -6597,6 +6597,9 @@ do_highlight ( else { if (is_normal_group) { HL_TABLE()[idx].sg_attr = 0; + // Need to update all groups, because they might be using "bg" and/or + // "fg", which have been changed now. + highlight_attr_set_all(); // If the normal group has changed, it is simpler to refresh every UI ui_refresh(); } else @@ -6998,11 +7001,15 @@ highlight_color ( if (font || sp) return NULL; if (modec == 'c') { - if (fg) + if (fg) { n = HL_TABLE()[id - 1].sg_cterm_fg - 1; - else + } else { n = HL_TABLE()[id - 1].sg_cterm_bg - 1; - sprintf((char *)name, "%d", n); + } + if (n < 0) { + return NULL; + } + snprintf((char *)name, sizeof(name), "%d", n); return name; } /* term doesn't have color */ @@ -7261,6 +7268,23 @@ int syn_get_final_id(int hl_id) return hl_id; } +/// Refresh the color attributes of all highlight groups. +static void highlight_attr_set_all(void) +{ + for (int idx = 0; idx < highlight_ga.ga_len; idx++) { + struct hl_group *sgp = &HL_TABLE()[idx]; + if (sgp->sg_rgb_bg_name != NULL) { + sgp->sg_rgb_bg = name_to_color(sgp->sg_rgb_bg_name); + } + if (sgp->sg_rgb_fg_name != NULL) { + sgp->sg_rgb_fg = name_to_color(sgp->sg_rgb_fg_name); + } + if (sgp->sg_rgb_sp_name != NULL) { + sgp->sg_rgb_sp = name_to_color(sgp->sg_rgb_sp_name); + } + set_hl_attr(idx); + } +} /* * Translate the 'highlight' option into attributes in highlight_attr[] and @@ -7702,6 +7726,10 @@ RgbValue name_to_color(uint8_t *name) && isxdigit(name[6]) && name[7] == NUL) { // rgb hex string return strtol((char *)(name + 1), NULL, 16); + } else if (!STRICMP(name, "bg") || !STRICMP(name, "background")) { + return normal_bg; + } else if (!STRICMP(name, "fg") || !STRICMP(name, "foreground")) { + return normal_fg; } for (int i = 0; color_name_table[i].name != NULL; i++) { diff --git a/src/nvim/tag.c b/src/nvim/tag.c index dfecfb776d..81256b4f01 100644 --- a/src/nvim/tag.c +++ b/src/nvim/tag.c @@ -26,7 +26,6 @@ #include "nvim/mbyte.h" #include "nvim/message.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" #include "nvim/file_search.h" #include "nvim/garray.h" #include "nvim/memory.h" diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c index 6f50c03be9..ff98dc9f22 100644 --- a/src/nvim/terminal.c +++ b/src/nvim/terminal.c @@ -127,7 +127,7 @@ struct terminal { // we can't store a direct reference to the buffer because the // refresh_timer_cb may be called after the buffer was freed, and there's // no way to know if the memory was reused. - uint64_t buf_handle; + handle_T buf_handle; // program exited bool closed, destroy; // some vterm properties @@ -623,11 +623,12 @@ static void buf_set_term_title(buf_T *buf, char *title) FUNC_ATTR_NONNULL_ALL { Error err; - api_free_object(dict_set_value(buf->b_vars, - cstr_as_string("term_title"), - STRING_OBJ(cstr_as_string(title)), - false, - &err)); + dict_set_value(buf->b_vars, + cstr_as_string("term_title"), + STRING_OBJ(cstr_as_string(title)), + false, + false, + &err); } static int term_settermprop(VTermProp prop, VTermValue *val, void *data) @@ -1081,7 +1082,8 @@ static void redraw(bool restore_cursor) restore_cursor = true; } - int save_row, save_col; + int save_row = 0; + int save_col = 0; if (restore_cursor) { // save the current row/col to restore after updating screen when not // focused diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile index 9a0bba83fe..10d26bd8cf 100644 --- a/src/nvim/testdir/Makefile +++ b/src/nvim/testdir/Makefile @@ -9,7 +9,6 @@ SCRIPTSOURCE := ../../../runtime SCRIPTS := \ test8.out \ - test12.out \ test13.out \ test14.out \ test17.out \ @@ -32,13 +31,16 @@ SCRIPTS := \ # Tests using runtest.vim.vim. # Keep test_alot*.res as the last one, sort the others. NEW_TESTS = \ + test_cscope.res \ test_hardcopy.res \ test_help_tagjump.res \ test_langmap.res \ test_syntax.res \ + test_usercommands.res \ test_timers.res \ test_viml.res \ test_visual.res \ + test_window_id.res \ test_alot.res SCRIPTS_GUI := test16.out diff --git a/src/nvim/testdir/test12.in b/src/nvim/testdir/test12.in deleted file mode 100644 index 0c0623e5d4..0000000000 --- a/src/nvim/testdir/test12.in +++ /dev/null @@ -1,50 +0,0 @@ -Tests for 'directory' option. -- ".", in same dir as file -- "./dir", in directory relative to file -- "dir", in directory relative to current dir - -STARTTEST -:set dir=.,~ -:/start of testfile/,/end of testfile/w! Xtest1 -:" do an ls of the current dir to find the swap file (should not be there) -:if has("unix") -: !ls .X*.swp >test.out -:else -: r !ls X*.swp >test.out -:endif -:!echo first line >>test.out -:e Xtest1 -:if has("unix") -:" Do an ls of the current dir to find the swap file, remove the leading dot -:" to make the result the same for all systems. -: r!ls .X*.swp -: s/\.*X/X/ -: .w >>test.out -: undo -:else -: !ls X*.swp >>test.out -:endif -:!echo under Xtest1.swp >>test.out -:!mkdir Xtest2 -:set dir=./Xtest2,.,~ -:e Xtest1 -:!ls X*.swp >>test.out -:!echo under under >>test.out -:!ls Xtest2 >>test.out -:!echo under Xtest1.swp >>test.out -:!mkdir Xtest.je -:/start of testfile/,/end of testfile/w! Xtest2/Xtest3 -:set dir=Xtest.je,~ -:e Xtest2/Xtest3 -:swap -:!ls Xtest2 >>test.out -:!echo under Xtest3 >>test.out -:!ls Xtest.je >>test.out -:!echo under Xtest3.swp >>test.out -:qa! -ENDTEST - -start of testfile -line 2 Abcdefghij -line 3 Abcdefghij -end of testfile diff --git a/src/nvim/testdir/test12.ok b/src/nvim/testdir/test12.ok deleted file mode 100644 index 605623b117..0000000000 --- a/src/nvim/testdir/test12.ok +++ /dev/null @@ -1,10 +0,0 @@ -first line -Xtest1.swp -under Xtest1.swp -under under -Xtest1.swp -under Xtest1.swp -Xtest3 -under Xtest3 -Xtest3.swp -under Xtest3.swp diff --git a/src/nvim/testdir/test_alot.vim b/src/nvim/testdir/test_alot.vim index 30b8a9ceb8..f0efd6e4ed 100644 --- a/src/nvim/testdir/test_alot.vim +++ b/src/nvim/testdir/test_alot.vim @@ -3,7 +3,10 @@ source test_assign.vim source test_cursor_func.vim +source test_feedkeys.vim source test_cmdline.vim source test_menu.vim source test_popup.vim +source test_regexp_utf8.vim +source test_syn_attr.vim source test_unlet.vim diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim index 438b20cc5e..902ec1c05d 100644 --- a/src/nvim/testdir/test_cmdline.vim +++ b/src/nvim/testdir/test_cmdline.vim @@ -47,45 +47,79 @@ func Test_getcompletion() let l = getcompletion('v:n', 'var') call assert_true(index(l, 'v:null') >= 0) + let l = getcompletion('v:notexists', 'var') + call assert_equal([], l) let l = getcompletion('', 'augroup') call assert_true(index(l, 'END') >= 0) + let l = getcompletion('blahblah', 'augroup') + call assert_equal([], l) let l = getcompletion('', 'behave') call assert_true(index(l, 'mswin') >= 0) + let l = getcompletion('not', 'behave') + call assert_equal([], l) let l = getcompletion('', 'color') call assert_true(index(l, 'default') >= 0) + let l = getcompletion('dirty', 'color') + call assert_equal([], l) let l = getcompletion('', 'command') call assert_true(index(l, 'sleep') >= 0) + let l = getcompletion('awake', 'command') + call assert_equal([], l) let l = getcompletion('', 'dir') - call assert_true(index(l, 'sautest') >= 0) + call assert_true(index(l, 'sautest/') >= 0) + let l = getcompletion('NoMatch', 'dir') + call assert_equal([], l) let l = getcompletion('exe', 'expression') call assert_true(index(l, 'executable(') >= 0) + let l = getcompletion('kill', 'expression') + call assert_equal([], l) let l = getcompletion('tag', 'function') call assert_true(index(l, 'taglist(') >= 0) + let l = getcompletion('paint', 'function') + call assert_equal([], l) let l = getcompletion('run', 'file') call assert_true(index(l, 'runtest.vim') >= 0) + let l = getcompletion('walk', 'file') + call assert_equal([], l) let l = getcompletion('ha', 'filetype') call assert_true(index(l, 'hamster') >= 0) + let l = getcompletion('horse', 'filetype') + call assert_equal([], l) let l = getcompletion('z', 'syntax') call assert_true(index(l, 'zimbu') >= 0) + let l = getcompletion('emacs', 'syntax') + call assert_equal([], l) let l = getcompletion('jikes', 'compiler') call assert_true(index(l, 'jikes') >= 0) + let l = getcompletion('break', 'compiler') + call assert_equal([], l) + + helptags ALL + let l = getcompletion('last', 'help') + call assert_true(index(l, ':tablast') >= 0) + let l = getcompletion('giveup', 'help') + call assert_equal([], l) let l = getcompletion('time', 'option') call assert_true(index(l, 'timeoutlen') >= 0) + let l = getcompletion('space', 'option') + call assert_equal([], l) let l = getcompletion('er', 'highlight') call assert_true(index(l, 'ErrorMsg') >= 0) + let l = getcompletion('dark', 'highlight') + call assert_equal([], l) " For others test if the name is recognized. let names = ['buffer', 'environment', 'file_in_path', diff --git a/src/nvim/testdir/test_cscope.vim b/src/nvim/testdir/test_cscope.vim new file mode 100644 index 0000000000..b6d70f0765 --- /dev/null +++ b/src/nvim/testdir/test_cscope.vim @@ -0,0 +1,15 @@ +" Test for cscope commands. + +if !has('cscope') + finish +endif + +func Test_cscopequickfix() + set cscopequickfix=s-,g-,d+,c-,t+,e-,f0,i-,a- + call assert_equal('s-,g-,d+,c-,t+,e-,f0,i-,a-', &cscopequickfix) + + call assert_fails('set cscopequickfix=x-', 'E474:') + call assert_fails('set cscopequickfix=s', 'E474:') + call assert_fails('set cscopequickfix=s7', 'E474:') + call assert_fails('set cscopequickfix=s-a', 'E474:') +endfunc diff --git a/src/nvim/testdir/test_feedkeys.vim b/src/nvim/testdir/test_feedkeys.vim new file mode 100644 index 0000000000..33cd58949d --- /dev/null +++ b/src/nvim/testdir/test_feedkeys.vim @@ -0,0 +1,10 @@ +" Test feedkeys() function. + +func Test_feedkeys_x_with_empty_string() + new + call feedkeys("ifoo\<Esc>") + call assert_equal('', getline('.')) + call feedkeys('', 'x') + call assert_equal('foo', getline('.')) + quit! +endfunc diff --git a/src/nvim/testdir/test_help_tagjump.vim b/src/nvim/testdir/test_help_tagjump.vim index 9f9207d27d..42f8391aba 100644 --- a/src/nvim/testdir/test_help_tagjump.vim +++ b/src/nvim/testdir/test_help_tagjump.vim @@ -37,4 +37,14 @@ func Test_help_tagjump() call assert_equal("help", &filetype) call assert_true(getline('.') =~ '\*arglistid()\*') helpclose + + exec "help! 'autoindent'." + call assert_equal("help", &filetype) + call assert_true(getline('.') =~ "\\*'autoindent'\\*") + helpclose + + exec "help! {address}." + call assert_equal("help", &filetype) + call assert_true(getline('.') =~ '\*{address}\*') + helpclose endfunc diff --git a/src/nvim/testdir/test_regexp_utf8.vim b/src/nvim/testdir/test_regexp_utf8.vim new file mode 100644 index 0000000000..38f9ed41d5 --- /dev/null +++ b/src/nvim/testdir/test_regexp_utf8.vim @@ -0,0 +1,41 @@ +" Tests for regexp in utf8 encoding +scriptencoding utf-8 + +func s:equivalence_test() + let str = "AÀÃÂÃÄÅĀĂĄÇÇžÇ áº¢ BḂḆ CÇĆĈĊČ DÄŽÄḊḎḠEÈÉÊËĒĔĖĘĚẺẼ FḞ GÄœÄžÄ Ä¢Ç¤Ç¦Ç´á¸ HĤĦḢḦḨ IÃŒÃÃŽÃĨĪĬĮİÇỈ JÄ´ KĶǨḰḴ LĹĻĽĿÅḺ MḾṀ NÑŃŅŇṄṈ OÃ’Ã“Ã”Ã•Ã–Ã˜ÅŒÅŽÅÆ ǑǪǬỎ PṔṖ Q RŔŖŘṘṞ SŚŜŞŠṠTŢŤŦṪṮ UÙÚÛÜŨŪŬŮŰŲƯǓỦ Vá¹¼ WŴẀẂẄẆ XẊẌ YÃŶŸẎỲỶỸ ZŹŻŽƵáºáº” aà áâãäåÄăąǎǟǡả bḃḇ cÃ§Ä‡Ä‰Ä‹Ä dÄđḋá¸á¸‘ eèéêëēĕėęěẻẽ fḟ gÄğġģǥǧǵḡ hĥħḣḧḩẖ iìÃîïĩīÄįÇỉ jĵǰ kķǩḱḵ lĺļľŀłḻ mḿṠnñńņňʼnṅṉ oòóôõöøÅÅőơǒǫÇá» pṕṗ q rŕŗřṙṟ sÅ›Åşšṡ tţťŧṫṯẗ uùúûüũūÅůűųưǔủ vá¹½ wŵáºáºƒáº…ẇẘ xẋẠyýÿŷáºáº™á»³á»·á»¹ zźżžƶẑẕ" + let groups = split(str) + for group1 in groups + for c in split(group1, '\zs') + " next statement confirms that equivalence class matches every + " character in group + call assert_match('^[[=' . c . '=]]*$', group1) + for group2 in groups + if group2 != group1 + " next statement converts that equivalence class doesn't match + " character in any other group + call assert_equal(-1, match(group2, '[[=' . c . '=]]')) + endif + endfor + endfor + endfor +endfunc + +func Test_equivalence_re1() + set re=1 + call s:equivalence_test() + set re=0 +endfunc + +func Test_equivalence_re2() + set re=2 + call s:equivalence_test() + set re=0 +endfunc + +func Test_recursive_substitute() + new + s/^/\=execute("s#^##gn") + " check we are now not in the sandbox + call setwinvar(1, 'myvar', 1) + bwipe! +endfunc diff --git a/src/nvim/testdir/test_syn_attr.vim b/src/nvim/testdir/test_syn_attr.vim new file mode 100644 index 0000000000..809442eb94 --- /dev/null +++ b/src/nvim/testdir/test_syn_attr.vim @@ -0,0 +1,24 @@ +" Test syntax highlighting functions. + +func Test_missing_attr() + hi Mine cterm=italic + call assert_equal('Mine', synIDattr(hlID("Mine"), "name")) + call assert_equal('1', synIDattr(hlID("Mine"), "italic", 'cterm')) + hi Mine cterm=inverse + call assert_equal('1', synIDattr(hlID("Mine"), "inverse", 'cterm')) + hi Mine cterm=standout gui=undercurl + call assert_equal('1', synIDattr(hlID("Mine"), "standout", 'cterm')) + call assert_equal('1', synIDattr(hlID("Mine"), "undercurl", 'gui')) + hi Mine cterm=NONE gui=NONE + call assert_equal('', synIDattr(hlID("Mine"), "italic", 'cterm')) + call assert_equal('', synIDattr(hlID("Mine"), "inverse", 'cterm')) + call assert_equal('', synIDattr(hlID("Mine"), "standout", 'cterm')) + call assert_equal('', synIDattr(hlID("Mine"), "undercurl", 'gui')) + + if has('gui') + hi Mine guifg=blue guibg=red font=something + call assert_equal('blue', synIDattr(hlID("Mine"), "fg", 'gui')) + call assert_equal('red', synIDattr(hlID("Mine"), "bg", 'gui')) + call assert_equal('something', synIDattr(hlID("Mine"), "font", 'gui')) + endif +endfunc diff --git a/src/nvim/testdir/test_usercommands.vim b/src/nvim/testdir/test_usercommands.vim new file mode 100644 index 0000000000..f593d16dbf --- /dev/null +++ b/src/nvim/testdir/test_usercommands.vim @@ -0,0 +1,48 @@ +" Tests for user defined commands + +" Test for <mods> in user defined commands +function Test_cmdmods() + let g:mods = '' + + command! -nargs=* MyCmd let g:mods .= '<mods> ' + + MyCmd + aboveleft MyCmd + belowright MyCmd + botright MyCmd + browse MyCmd + confirm MyCmd + hide MyCmd + keepalt MyCmd + keepjumps MyCmd + keepmarks MyCmd + keeppatterns MyCmd + lockmarks MyCmd + noswapfile MyCmd + silent MyCmd + tab MyCmd + topleft MyCmd + verbose MyCmd + vertical MyCmd + + aboveleft belowright botright browse confirm hide keepalt keepjumps + \ keepmarks keeppatterns lockmarks noswapfile silent tab + \ topleft verbose vertical MyCmd + + call assert_equal(' aboveleft belowright botright browse confirm ' . + \ 'hide keepalt keepjumps keepmarks keeppatterns lockmarks ' . + \ 'noswapfile silent tab topleft verbose vertical aboveleft ' . + \ 'belowright botright browse confirm hide keepalt keepjumps ' . + \ 'keepmarks keeppatterns lockmarks noswapfile silent tab topleft ' . + \ 'verbose vertical ', g:mods) + + let g:mods = '' + command! -nargs=* MyQCmd let g:mods .= '<q-mods> ' + + vertical MyQCmd + call assert_equal('"vertical" ', g:mods) + + delcommand MyCmd + delcommand MyQCmd + unlet g:mods +endfunction diff --git a/src/nvim/testdir/test_window_id.vim b/src/nvim/testdir/test_window_id.vim new file mode 100644 index 0000000000..fa3ebd757e --- /dev/null +++ b/src/nvim/testdir/test_window_id.vim @@ -0,0 +1,79 @@ +" Test using the window ID. + +func Test_win_getid() + edit one + let id1 = win_getid() + split two + let id2 = win_getid() + let bufnr2 = bufnr('%') + split three + let id3 = win_getid() + tabnew + edit four + let id4 = win_getid() + split five + let id5 = win_getid() + let bufnr5 = bufnr('%') + tabnext + + wincmd w + call assert_equal("two", expand("%")) + call assert_equal(id2, win_getid()) + let nr2 = winnr() + wincmd w + call assert_equal("one", expand("%")) + call assert_equal(id1, win_getid()) + let nr1 = winnr() + wincmd w + call assert_equal("three", expand("%")) + call assert_equal(id3, win_getid()) + let nr3 = winnr() + tabnext + call assert_equal("five", expand("%")) + call assert_equal(id5, win_getid()) + let nr5 = winnr() + wincmd w + call assert_equal("four", expand("%")) + call assert_equal(id4, win_getid()) + let nr4 = winnr() + tabnext + + exe nr1 . "wincmd w" + call assert_equal(id1, win_getid()) + exe nr2 . "wincmd w" + call assert_equal(id2, win_getid()) + exe nr3 . "wincmd w" + call assert_equal(id3, win_getid()) + tabnext + exe nr4 . "wincmd w" + call assert_equal(id4, win_getid()) + exe nr5 . "wincmd w" + call assert_equal(id5, win_getid()) + + call win_gotoid(id2) + call assert_equal("two", expand("%")) + call win_gotoid(id4) + call assert_equal("four", expand("%")) + call win_gotoid(id1) + call assert_equal("one", expand("%")) + call win_gotoid(id5) + call assert_equal("five", expand("%")) + + call assert_equal(0, win_id2win(9999)) + call assert_equal(nr5, win_id2win(id5)) + call assert_equal(0, win_id2win(id1)) + tabnext + call assert_equal(nr1, win_id2win(id1)) + + call assert_equal([0, 0], win_id2tabwin(9999)) + call assert_equal([1, nr2], win_id2tabwin(id2)) + call assert_equal([2, nr4], win_id2tabwin(id4)) + + call assert_equal([], win_findbuf(9999)) + call assert_equal([id2], win_findbuf(bufnr2)) + call win_gotoid(id5) + split + call assert_equal(sort([id5, win_getid()]), sort(win_findbuf(bufnr5))) + + only! +endfunc diff --git a/src/nvim/tui/input.c b/src/nvim/tui/input.c index be256f3ebc..68ea00ee63 100644 --- a/src/nvim/tui/input.c +++ b/src/nvim/tui/input.c @@ -5,7 +5,6 @@ #include "nvim/api/private/helpers.h" #include "nvim/ascii.h" #include "nvim/main.h" -#include "nvim/misc2.h" #include "nvim/os/os.h" #include "nvim/os/input.h" #include "nvim/event/rstream.h" @@ -38,7 +37,7 @@ void term_input_init(TermInput *input, Loop *loop) int curflags = termkey_get_canonflags(input->tk); termkey_set_canonflags(input->tk, curflags | TERMKEY_CANON_DELBS); // setup input handle - rstream_init_fd(loop, &input->read_stream, input->in_fd, 0xfff, input); + rstream_init_fd(loop, &input->read_stream, input->in_fd, 0xfff); // initialize a timer handle for handling ESC with libtermkey time_watcher_init(loop, &input->timer_handle, input); } @@ -49,13 +48,13 @@ void term_input_destroy(TermInput *input) uv_mutex_destroy(&input->key_buffer_mutex); uv_cond_destroy(&input->key_buffer_cond); time_watcher_close(&input->timer_handle, NULL); - stream_close(&input->read_stream, NULL); + stream_close(&input->read_stream, NULL, NULL); termkey_destroy(input->tk); } void term_input_start(TermInput *input) { - rstream_start(&input->read_stream, read_cb); + rstream_start(&input->read_stream, read_cb, input); } void term_input_stop(TermInput *input) @@ -216,8 +215,8 @@ static int get_key_code_timeout(void) // Check 'ttimeout' to determine if we should send ESC after 'ttimeoutlen'. // See :help 'ttimeout' for more information Error err = ERROR_INIT; - if (vim_get_option(cstr_as_string("ttimeout"), &err).data.boolean) { - ms = vim_get_option(cstr_as_string("ttimeoutlen"), &err).data.integer; + if (nvim_get_option(cstr_as_string("ttimeout"), &err).data.boolean) { + ms = nvim_get_option(cstr_as_string("ttimeoutlen"), &err).data.integer; } return (int)ms; @@ -340,7 +339,7 @@ static void read_cb(Stream *stream, RBuffer *buf, size_t c, void *data, // // ls *.md | xargs nvim input->in_fd = 2; - stream_close(&input->read_stream, NULL); + stream_close(&input->read_stream, NULL, NULL); queue_put(input->loop->fast_events, restart_reading, 1, input); } else { loop_schedule(&main_loop, event_create(1, input_done_event, 0)); @@ -391,6 +390,6 @@ static void read_cb(Stream *stream, RBuffer *buf, size_t c, void *data, static void restart_reading(void **argv) { TermInput *input = argv[0]; - rstream_init_fd(input->loop, &input->read_stream, input->in_fd, 0xfff, input); - rstream_start(&input->read_stream, read_cb); + rstream_init_fd(input->loop, &input->read_stream, input->in_fd, 0xfff); + rstream_start(&input->read_stream, read_cb, input); } diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index d220df508a..bfc03dfb81 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -83,6 +83,7 @@ UI *tui_start(void) UI *ui = xcalloc(1, sizeof(UI)); ui->stop = tui_stop; ui->rgb = p_tgc; + ui->pum_external = false; ui->resize = tui_resize; ui->clear = tui_clear; ui->eol_clear = tui_eol_clear; @@ -106,6 +107,7 @@ UI *tui_start(void) ui->suspend = tui_suspend; ui->set_title = tui_set_title; ui->set_icon = tui_set_icon; + ui->event = tui_event; return ui_bridge_attach(ui, tui_main, tui_scheduler); } @@ -650,6 +652,12 @@ static void tui_set_icon(UI *ui, char *icon) { } +// NB: if we start to use this, the ui_bridge must be updated +// to make a copy for the tui thread +static void tui_event(UI *ui, char *name, Array args, bool *args_consumed) +{ +} + static void invalidate(UI *ui, int top, int bot, int left, int right) { TUIData *data = ui->data; diff --git a/src/nvim/types.h b/src/nvim/types.h index bfe8be2091..35a5d1e2bd 100644 --- a/src/nvim/types.h +++ b/src/nvim/types.h @@ -13,4 +13,5 @@ typedef unsigned char char_u; // Can hold one decoded UTF-8 character. typedef uint32_t u8char_T; +typedef struct expand expand_T; #endif // NVIM_TYPES_H diff --git a/src/nvim/ui.c b/src/nvim/ui.c index d968cbc390..dd278893c2 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -12,10 +12,8 @@ #include "nvim/ex_cmds2.h" #include "nvim/fold.h" #include "nvim/main.h" -#include "nvim/mbyte.h" #include "nvim/ascii.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" #include "nvim/mbyte.h" #include "nvim/garray.h" #include "nvim/memory.h" @@ -27,6 +25,7 @@ #include "nvim/os/time.h" #include "nvim/os/input.h" #include "nvim/os/signal.h" +#include "nvim/popupmnu.h" #include "nvim/screen.h" #include "nvim/syntax.h" #include "nvim/window.h" @@ -35,6 +34,7 @@ #else # include "nvim/msgpack_rpc/server.h" #endif +#include "nvim/api/private/helpers.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "ui.c.generated.h" @@ -143,6 +143,15 @@ void ui_set_icon(char *icon) UI_CALL(flush); } +void ui_event(char *name, Array args) +{ + bool args_consumed = false; + UI_CALL(event, name, args, &args_consumed); + if (!args_consumed) { + api_free_array(args); + } +} + // May update the shape of the cursor. void ui_cursor_shape(void) { @@ -156,15 +165,18 @@ void ui_refresh(void) } int width = INT_MAX, height = INT_MAX; + bool pum_external = true; for (size_t i = 0; i < ui_count; i++) { UI *ui = uis[i]; width = ui->width < width ? ui->width : width; height = ui->height < height ? ui->height : height; + pum_external &= ui->pum_external; } row = col = 0; screen_resize(width, height); + pum_set_external(pum_external); } void ui_resize(int new_width, int new_height) @@ -519,3 +531,4 @@ static void ui_mode_change(void) UI_CALL(mode_change, mode); conceal_check_cursur_line(); } + diff --git a/src/nvim/ui.h b/src/nvim/ui.h index 5934d2fee9..d14bc5812c 100644 --- a/src/nvim/ui.h +++ b/src/nvim/ui.h @@ -5,6 +5,8 @@ #include <stdbool.h> #include <stdint.h> +#include "api/private/defs.h" + typedef struct { bool bold, underline, undercurl, italic, reverse; int foreground, background, special; @@ -13,7 +15,7 @@ typedef struct { typedef struct ui_t UI; struct ui_t { - bool rgb; + bool rgb, pum_external; int width, height; void *data; void (*resize)(UI *ui, int rows, int columns); @@ -39,6 +41,7 @@ struct ui_t { void (*suspend)(UI *ui); void (*set_title)(UI *ui, char *title); void (*set_icon)(UI *ui, char *icon); + void (*event)(UI *ui, char *name, Array args, bool *args_consumed); void (*stop)(UI *ui); }; diff --git a/src/nvim/ui_bridge.c b/src/nvim/ui_bridge.c index 6290fb3d87..34b95baf6c 100644 --- a/src/nvim/ui_bridge.c +++ b/src/nvim/ui_bridge.c @@ -31,6 +31,7 @@ UI *ui_bridge_attach(UI *ui, ui_main_fn ui_main, event_scheduler scheduler) UIBridgeData *rv = xcalloc(1, sizeof(UIBridgeData)); rv->ui = ui; rv->bridge.rgb = ui->rgb; + rv->bridge.pum_external = ui->pum_external; rv->bridge.stop = ui_bridge_stop; rv->bridge.resize = ui_bridge_resize; rv->bridge.clear = ui_bridge_clear; diff --git a/src/nvim/undo.c b/src/nvim/undo.c index fc5d6acaa4..d80aaf443a 100644 --- a/src/nvim/undo.c +++ b/src/nvim/undo.c @@ -99,6 +99,7 @@ #include "nvim/quickfix.h" #include "nvim/screen.h" #include "nvim/sha256.h" +#include "nvim/state.h" #include "nvim/strings.h" #include "nvim/types.h" #include "nvim/os/os.h" diff --git a/src/nvim/version.c b/src/nvim/version.c index 6b189a820f..685a2a843b 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -15,7 +15,6 @@ #include "nvim/memline.h" #include "nvim/memory.h" #include "nvim/message.h" -#include "nvim/misc2.h" #include "nvim/screen.h" #include "nvim/strings.h" @@ -75,31 +74,198 @@ static char *features[] = { // clang-format off static int included_patches[] = { + // 2367, + // 2366 NA + // 2365 NA + // 2364, + // 2363 NA + // 2362, + // 2361 NA + // 2360, + // 2359 NA + // 2358 NA + // 2357, + // 2356, + // 2355, + // 2354, + // 2353, + // 2352 NA + // 2351 NA + // 2350, + // 2349, + // 2348, + // 2347, + // 2346, + // 2345 NA + // 2344 NA + // 2343, + // 2342 NA + // 2341, + // 2340 NA + // 2339, + // 2338 NA + // 2337, + // 2336, + // 2335, + // 2334, + // 2333, + // 2332 NA + // 2331, + // 2330, + // 2329, + // 2328, + // 2327 NA + // 2326, + // 2325 NA + // 2324, + // 2323, + // 2322, + // 2321, + // 2320, + // 2319, + // 2318, + // 2317, + // 2316 NA + // 2315, + // 2314, + // 2313, + // 2312, + // 2311, + // 2310 NA + // 2309, + // 2308 NA + // 2307, + // 2306, + // 2305, + // 2304 NA + // 2303, + // 2302 NA + // 2301 NA + // 2300, + // 2299, + // 2298 NA + // 2297 NA + // 2296, + // 2295, + // 2294, + // 2293, + // 2292, + // 2291, + // 2290 NA + // 2289 NA + // 2288 NA + // 2287 NA + // 2286 NA + // 2285 NA + 2284, + // 2283, + // 2282 NA + // 2281 NA + // 2280, + // 2279, + // 2278, + // 2277, + // 2276, + // 2275, + // 2274, + // 2273, + // 2272, + // 2271 NA + // 2270 NA + // 2269, + // 2268, + // 2267 NA + // 2266, + // 2265, + // 2264, + // 2263, + // 2262 NA + // 2261 NA + // 2260 NA + // 2259, + // 2258 NA + // 2257 NA + // 2256, + // 2255, + // 2254 NA + // 2253 NA + // 2252 NA + // 2251, + // 2250, + // 2249, + // 2248, + // 2247 NA + // 2246, + // 2245, + // 2244, + // 2243 NA + // 2242, + // 2241, + // 2240, + // 2239, + // 2238 NA + // 2237, + // 2236, + // 2235, + // 2234 NA + // 2233, + // 2232, + // 2231, + // 2230, + // 2229, + // 2228, + // 2227, + // 2226, + // 2225, + // 2224, + // 2223, + // 2222, + // 2221, + // 2220, + 2219, + // 2218 NA + // 2217, + // 2216 NA + // 2215, + // 2214 NA + 2213, + // 2212, + // 2211 NA + // 2210 NA + // 2209, + // 2208, + // 2207 NA + // 2206 NA + // 2205, + // 2204, + // 2203 NA + // 2202 NA + // 2201, // 2200, - // 2199, + // 2199 NA // 2198, // 2197, // 2196, - // 2195, + // 2195 NA // 2194, - // 2193, - // 2192, - // 2191, + // 2193 NA + // 2192 NA + // 2191 NA // 2190, // 2189, // 2188, // 2187, - // 2186, + // 2186 NA // 2185, // 2184, // 2183, - // 2182, + // 2182 NA // 2181, // 2180, // 2179, // 2178, // 2177, - // 2176, + // 2176 NA // 2175, // 2174, // 2173, @@ -107,9 +273,9 @@ static int included_patches[] = { // 2171, // 2170, // 2169, - // 2168, - // 2167, - // 2166, + // 2168 NA + // 2167 NA + // 2166 NA // 2165, // 2164, // 2163, @@ -118,56 +284,56 @@ static int included_patches[] = { // 2160, // 2159, // 2158, - // 2157, - // 2156, - // 2155, - // 2154, - // 2153, + // 2157 NA + // 2156 NA + // 2155 NA + // 2154 NA + // 2153 NA // 2152, // 2151, - // 2150, + // 2150 NA // 2149, // 2148, // 2147, // 2146, - // 2145, + // 2145 NA // 2144, // 2143, // 2142, // 2141, - // 2140, + // 2140 NA // 2139, - // 2138, + // 2138 NA // 2137, // 2136, // 2135, // 2134, - // 2133, + // 2133 NA // 2132, - // 2131, - // 2130, - // 2129, + // 2131 NA + // 2130 NA + // 2129 NA // 2128, // 2127, // 2126, // 2125, // 2124, // 2123, - // 2122, + // 2122 NA // 2121, // 2120, // 2119, - // 2118, + // 2118 NA // 2117, - // 2116, + // 2116 NA // 2115, - // 2114, + // 2114 NA // 2113, - // 2112, + 2112, // 2111, // 2110, // 2109, - // 2108, + // 2108 NA // 2107, // 2106, // 2105 NA @@ -242,7 +408,7 @@ static int included_patches[] = { // 2036, // 2035 NA // 2034 NA - // 2033, + 2033, // 2032 NA // 2031, // 2030 NA @@ -285,7 +451,7 @@ static int included_patches[] = { // 1993, // 1992, // 1991, - // 1990, + 1990, // 1989, // 1988 NA // 1987 NA @@ -304,7 +470,7 @@ static int included_patches[] = { // 1974 NA 1973, // 1972, - // 1971, + 1971, // 1970, // 1969 NA // 1968, @@ -323,7 +489,7 @@ static int included_patches[] = { // 1955, // 1954, // 1953, - // 1952, + 1952, // 1951 NA // 1950, // 1949, @@ -362,7 +528,7 @@ static int included_patches[] = { // 1916 NA // 1915 NA // 1914, - // 1913, + 1913, // 1912, // 1911, // 1910, @@ -375,11 +541,11 @@ static int included_patches[] = { // 1903, // 1902 NA // 1901 NA - // 1900, + 1900, // 1899 NA - // 1898, + 1898, // 1897, - // 1896, + 1896, // 1895, // 1894 NA // 1893, @@ -577,7 +743,7 @@ static int included_patches[] = { 1703, // 1702, // 1701, - // 1700, + 1700, // 1699, // 1698 NA // 1697, @@ -674,7 +840,7 @@ static int included_patches[] = { // 1606, // 1605, // 1604, - // 1603, + 1603, // 1602 NA // 1601 NA // 1600 NA @@ -719,8 +885,8 @@ static int included_patches[] = { // 1561 NA // 1560 NA // 1559, - // 1558, - // 1557, + 1558, + 1557, // 1556 NA // 1555 NA 1554, @@ -730,7 +896,7 @@ static int included_patches[] = { 1550, // 1549, 1548, - // 1547, + 1547, 1546, // 1545 NA // 1544 NA @@ -742,9 +908,9 @@ static int included_patches[] = { // 1538 NA // 1537 NA // 1536 NA - // 1535, + 1535, // 1534 NA - // 1533, + 1533, // 1532 NA // 1531 NA // 1530 NA @@ -1011,7 +1177,7 @@ static int included_patches[] = { 1269, // 1268 NA 1267, - // 1266 + 1266, // 1265 NA // 1264 NA // 1263 NA diff --git a/src/nvim/window.c b/src/nvim/window.c index e267d493bf..e9a66ad907 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -28,7 +28,6 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" #include "nvim/file_search.h" #include "nvim/garray.h" #include "nvim/move.h" @@ -41,6 +40,7 @@ #include "nvim/regexp.h" #include "nvim/screen.h" #include "nvim/search.h" +#include "nvim/state.h" #include "nvim/strings.h" #include "nvim/syntax.h" #include "nvim/terminal.h" @@ -2926,7 +2926,9 @@ void win_init_size(void) */ static tabpage_T *alloc_tabpage(void) { + static int last_tp_handle = 0; tabpage_T *tp = xcalloc(1, sizeof(tabpage_T)); + tp->handle = ++last_tp_handle; handle_register_tabpage(tp); /* init t: variables */ @@ -2976,6 +2978,9 @@ int win_new_tabpage(int after, char_u *filename) xfree(newtp); return FAIL; } + + newtp->localdir = tp->localdir ? vim_strsave(tp->localdir) : NULL; + curtab = newtp; /* Create a new empty window. */ @@ -3689,13 +3694,15 @@ win_T *buf_jump_open_tab(buf_T *buf) */ static win_T *win_alloc(win_T *after, int hidden) { - /* - * allocate window structure and linesizes arrays - */ + static int last_win_id = 0; + + // allocate window structure and linesizes arrays win_T *new_wp = xcalloc(1, sizeof(win_T)); - handle_register_window(new_wp); win_alloc_lines(new_wp); + new_wp->handle = ++last_win_id; + handle_register_window(new_wp); + /* init w: variables */ new_wp->w_vars = dict_alloc(); init_var_dict(new_wp->w_vars, &new_wp->w_winvar, VAR_SCOPE); @@ -5674,3 +5681,107 @@ static bool frame_check_width(frame_T *topfrp, int width) } return true; } + +int win_getid(typval_T *argvars) +{ + if (argvars[0].v_type == VAR_UNKNOWN) { + return curwin->handle; + } + int winnr = get_tv_number(&argvars[0]); + win_T *wp; + if (winnr > 0) { + if (argvars[1].v_type == VAR_UNKNOWN) { + wp = firstwin; + } else { + tabpage_T *tp; + int tabnr = get_tv_number(&argvars[1]); + for (tp = first_tabpage; tp != NULL; tp = tp->tp_next) { + if (--tabnr == 0) { + break; + } + } + if (tp == NULL) { + return -1; + } + wp = tp->tp_firstwin; + } + for ( ; wp != NULL; wp = wp->w_next) { + if (--winnr == 0) { + return wp->handle; + } + } + } + return 0; +} + +int win_gotoid(typval_T *argvars) +{ + win_T *wp; + tabpage_T *tp; + int id = get_tv_number(&argvars[0]); + + for (tp = first_tabpage; tp != NULL; tp = tp->tp_next) { + for (wp = tp == curtab ? firstwin : tp->tp_firstwin; + wp != NULL; wp = wp->w_next) { + if (wp->handle == id) { + goto_tabpage_win(tp, wp); + return 1; + } + } + } + return 0; +} + +void win_id2tabwin(typval_T *argvars, list_T *list) +{ + win_T *wp; + tabpage_T *tp; + int winnr = 1; + int tabnr = 1; + int id = get_tv_number(&argvars[0]); + + for (tp = first_tabpage; tp != NULL; tp = tp->tp_next) { + for (wp = tp == curtab ? firstwin : tp->tp_firstwin; + wp != NULL; wp = wp->w_next) { + if (wp->handle == id) { + list_append_number(list, tabnr); + list_append_number(list, winnr); + return; + } + winnr++; + } + tabnr++; + winnr = 1; + } + list_append_number(list, 0); + list_append_number(list, 0); +} + +int win_id2win(typval_T *argvars) +{ + win_T *wp; + int nr = 1; + int id = get_tv_number(&argvars[0]); + + for (wp = firstwin; wp != NULL; wp = wp->w_next) { + if (wp->handle == id) { + return nr; + } + nr++; + } + return 0; +} + +void win_findbuf(typval_T *argvars, list_T *list) +{ + int bufnr = get_tv_number(&argvars[0]); + + for (tabpage_T *tp = first_tabpage; tp != NULL; tp = tp->tp_next) { + for (win_T *wp = tp == curtab ? firstwin : tp->tp_firstwin; + wp != NULL; wp = wp->w_next) { + if (wp->w_buffer->b_fnum == bufnr) { + list_append_number(list, wp->handle); + } + } + } +} diff --git a/test/functional/api/buffer_spec.lua b/test/functional/api/buffer_spec.lua index cf8a83ad81..71ec213b97 100644 --- a/test/functional/api/buffer_spec.lua +++ b/test/functional/api/buffer_spec.lua @@ -3,105 +3,112 @@ local helpers = require('test.functional.helpers')(after_each) local clear, nvim, buffer = helpers.clear, helpers.nvim, helpers.buffer local curbuf, curwin, eq = helpers.curbuf, helpers.curwin, helpers.eq local curbufmeths, ok = helpers.curbufmeths, helpers.ok -local funcs = helpers.funcs +local funcs, request = helpers.funcs, helpers.request +local NIL = helpers.NIL describe('buffer_* functions', function() before_each(clear) + -- access deprecated functions + local function curbuf_depr(method, ...) + return request('buffer_'..method, 0, ...) + end + + describe('line_count, insert and del_line', function() it('works', function() - eq(1, curbuf('line_count')) - curbuf('insert', -1, {'line'}) - eq(2, curbuf('line_count')) - curbuf('insert', -1, {'line'}) - eq(3, curbuf('line_count')) - curbuf('del_line', -1) - eq(2, curbuf('line_count')) - curbuf('del_line', -1) - curbuf('del_line', -1) + eq(1, curbuf_depr('line_count')) + curbuf_depr('insert', -1, {'line'}) + eq(2, curbuf_depr('line_count')) + curbuf_depr('insert', -1, {'line'}) + eq(3, curbuf_depr('line_count')) + curbuf_depr('del_line', -1) + eq(2, curbuf_depr('line_count')) + curbuf_depr('del_line', -1) + curbuf_depr('del_line', -1) -- There's always at least one line - eq(1, curbuf('line_count')) + eq(1, curbuf_depr('line_count')) end) end) describe('{get,set,del}_line', function() it('works', function() - eq('', curbuf('get_line', 0)) - curbuf('set_line', 0, 'line1') - eq('line1', curbuf('get_line', 0)) - curbuf('set_line', 0, 'line2') - eq('line2', curbuf('get_line', 0)) - curbuf('del_line', 0) - eq('', curbuf('get_line', 0)) + eq('', curbuf_depr('get_line', 0)) + curbuf_depr('set_line', 0, 'line1') + eq('line1', curbuf_depr('get_line', 0)) + curbuf_depr('set_line', 0, 'line2') + eq('line2', curbuf_depr('get_line', 0)) + curbuf_depr('del_line', 0) + eq('', curbuf_depr('get_line', 0)) end) it('get_line: out-of-bounds is an error', function() - curbuf('set_line', 0, 'line1.a') - eq(1, curbuf('line_count')) -- sanity - eq(false, pcall(curbuf, 'get_line', 1)) - eq(false, pcall(curbuf, 'get_line', -2)) + curbuf_depr('set_line', 0, 'line1.a') + eq(1, curbuf_depr('line_count')) -- sanity + eq(false, pcall(curbuf_depr, 'get_line', 1)) + eq(false, pcall(curbuf_depr, 'get_line', -2)) end) it('set_line, del_line: out-of-bounds is an error', function() - curbuf('set_line', 0, 'line1.a') - eq(false, pcall(curbuf, 'set_line', 1, 'line1.b')) - eq(false, pcall(curbuf, 'set_line', -2, 'line1.b')) - eq(false, pcall(curbuf, 'del_line', 2)) - eq(false, pcall(curbuf, 'del_line', -3)) + curbuf_depr('set_line', 0, 'line1.a') + eq(false, pcall(curbuf_depr, 'set_line', 1, 'line1.b')) + eq(false, pcall(curbuf_depr, 'set_line', -2, 'line1.b')) + eq(false, pcall(curbuf_depr, 'del_line', 2)) + eq(false, pcall(curbuf_depr, 'del_line', -3)) end) it('can handle NULs', function() - curbuf('set_line', 0, 'ab\0cd') - eq('ab\0cd', curbuf('get_line', 0)) + curbuf_depr('set_line', 0, 'ab\0cd') + eq('ab\0cd', curbuf_depr('get_line', 0)) end) end) describe('{get,set}_line_slice', function() it('get_line_slice: out-of-bounds returns empty array', function() - curbuf('set_line_slice', 0, 0, true, true, {'a', 'b', 'c'}) - eq({'a', 'b', 'c'}, curbuf('get_line_slice', 0, 2, true, true)) --sanity - - eq({}, curbuf('get_line_slice', 2, 3, false, true)) - eq({}, curbuf('get_line_slice', 3, 9, true, true)) - eq({}, curbuf('get_line_slice', 3, -1, true, true)) - eq({}, curbuf('get_line_slice', -3, -4, false, true)) - eq({}, curbuf('get_line_slice', -4, -5, true, true)) + curbuf_depr('set_line_slice', 0, 0, true, true, {'a', 'b', 'c'}) + eq({'a', 'b', 'c'}, curbuf_depr('get_line_slice', 0, 2, true, true)) --sanity + + eq({}, curbuf_depr('get_line_slice', 2, 3, false, true)) + eq({}, curbuf_depr('get_line_slice', 3, 9, true, true)) + eq({}, curbuf_depr('get_line_slice', 3, -1, true, true)) + eq({}, curbuf_depr('get_line_slice', -3, -4, false, true)) + eq({}, curbuf_depr('get_line_slice', -4, -5, true, true)) end) it('set_line_slice: out-of-bounds extends past end', function() - curbuf('set_line_slice', 0, 0, true, true, {'a', 'b', 'c'}) - eq({'a', 'b', 'c'}, curbuf('get_line_slice', 0, 2, true, true)) --sanity - - eq({'c'}, curbuf('get_line_slice', -1, 4, true, true)) - eq({'a', 'b', 'c'}, curbuf('get_line_slice', 0, 5, true, true)) - curbuf('set_line_slice', 4, 5, true, true, {'d'}) - eq({'a', 'b', 'c', 'd'}, curbuf('get_line_slice', 0, 5, true, true)) - curbuf('set_line_slice', -4, -5, true, true, {'e'}) - eq({'e', 'a', 'b', 'c', 'd'}, curbuf('get_line_slice', 0, 5, true, true)) + curbuf_depr('set_line_slice', 0, 0, true, true, {'a', 'b', 'c'}) + eq({'a', 'b', 'c'}, curbuf_depr('get_line_slice', 0, 2, true, true)) --sanity + + eq({'c'}, curbuf_depr('get_line_slice', -1, 4, true, true)) + eq({'a', 'b', 'c'}, curbuf_depr('get_line_slice', 0, 5, true, true)) + curbuf_depr('set_line_slice', 4, 5, true, true, {'d'}) + eq({'a', 'b', 'c', 'd'}, curbuf_depr('get_line_slice', 0, 5, true, true)) + curbuf_depr('set_line_slice', -4, -5, true, true, {'e'}) + eq({'e', 'a', 'b', 'c', 'd'}, curbuf_depr('get_line_slice', 0, 5, true, true)) end) it('works', function() - eq({''}, curbuf('get_line_slice', 0, -1, true, true)) + eq({''}, curbuf_depr('get_line_slice', 0, -1, true, true)) -- Replace buffer - curbuf('set_line_slice', 0, -1, true, true, {'a', 'b', 'c'}) - eq({'a', 'b', 'c'}, curbuf('get_line_slice', 0, -1, true, true)) - eq({'b', 'c'}, curbuf('get_line_slice', 1, -1, true, true)) - eq({'b'}, curbuf('get_line_slice', 1, 2, true, false)) - eq({}, curbuf('get_line_slice', 1, 1, true, false)) - eq({'a', 'b'}, curbuf('get_line_slice', 0, -1, true, false)) - eq({'b'}, curbuf('get_line_slice', 1, -1, true, false)) - eq({'b', 'c'}, curbuf('get_line_slice', -2, -1, true, true)) - curbuf('set_line_slice', 1, 2, true, false, {'a', 'b', 'c'}) - eq({'a', 'a', 'b', 'c', 'c'}, curbuf('get_line_slice', 0, -1, true, true)) - curbuf('set_line_slice', -1, -1, true, true, {'a', 'b', 'c'}) + curbuf_depr('set_line_slice', 0, -1, true, true, {'a', 'b', 'c'}) + eq({'a', 'b', 'c'}, curbuf_depr('get_line_slice', 0, -1, true, true)) + eq({'b', 'c'}, curbuf_depr('get_line_slice', 1, -1, true, true)) + eq({'b'}, curbuf_depr('get_line_slice', 1, 2, true, false)) + eq({}, curbuf_depr('get_line_slice', 1, 1, true, false)) + eq({'a', 'b'}, curbuf_depr('get_line_slice', 0, -1, true, false)) + eq({'b'}, curbuf_depr('get_line_slice', 1, -1, true, false)) + eq({'b', 'c'}, curbuf_depr('get_line_slice', -2, -1, true, true)) + curbuf_depr('set_line_slice', 1, 2, true, false, {'a', 'b', 'c'}) + eq({'a', 'a', 'b', 'c', 'c'}, curbuf_depr('get_line_slice', 0, -1, true, true)) + curbuf_depr('set_line_slice', -1, -1, true, true, {'a', 'b', 'c'}) eq({'a', 'a', 'b', 'c', 'a', 'b', 'c'}, - curbuf('get_line_slice', 0, -1, true, true)) - curbuf('set_line_slice', 0, -3, true, false, {}) - eq({'a', 'b', 'c'}, curbuf('get_line_slice', 0, -1, true, true)) - curbuf('set_line_slice', 0, -1, true, true, {}) - eq({''}, curbuf('get_line_slice', 0, -1, true, true)) + curbuf_depr('get_line_slice', 0, -1, true, true)) + curbuf_depr('set_line_slice', 0, -3, true, false, {}) + eq({'a', 'b', 'c'}, curbuf_depr('get_line_slice', 0, -1, true, true)) + curbuf_depr('set_line_slice', 0, -1, true, true, {}) + eq({''}, curbuf_depr('get_line_slice', 0, -1, true, true)) end) end) @@ -244,6 +251,21 @@ describe('buffer_* functions', function() curbufmeths.del_var('lua') eq(0, funcs.exists('b:lua')) end) + + it('buffer_set_var returns the old value', function() + local val1 = {1, 2, {['3'] = 1}} + local val2 = {4, 7} + eq(NIL, request('buffer_set_var', 0, 'lua', val1)) + eq(val1, request('buffer_set_var', 0, 'lua', val2)) + end) + + it('buffer_del_var returns the old value', function() + local val1 = {1, 2, {['3'] = 1}} + local val2 = {4, 7} + eq(NIL, request('buffer_set_var', 0, 'lua', val1)) + eq(val1, request('buffer_set_var', 0, 'lua', val2)) + eq(val2, request('buffer_del_var', 0, 'lua')) + end) end) describe('{get,set}_option', function() @@ -277,7 +299,7 @@ describe('buffer_* functions', function() describe('is_valid', function() it('works', function() nvim('command', 'new') - local b = nvim('get_current_buffer') + local b = nvim('get_current_buf') ok(buffer('is_valid', b)) nvim('command', 'bw!') ok(not buffer('is_valid', b)) @@ -286,7 +308,7 @@ describe('buffer_* functions', function() describe('get_mark', function() it('works', function() - curbuf('insert', -1, {'a', 'bit of', 'text'}) + curbuf('set_lines', -1, -1, true, {'a', 'bit of', 'text'}) curwin('set_cursor', {3, 4}) nvim('command', 'mark V') eq({3, 0}, curbuf('get_mark', 'V')) diff --git a/test/functional/api/rpc_fixture.lua b/test/functional/api/rpc_fixture.lua new file mode 100644 index 0000000000..423864740f --- /dev/null +++ b/test/functional/api/rpc_fixture.lua @@ -0,0 +1,38 @@ +local deps_prefix = './.deps/usr' +if os.getenv('DEPS_PREFIX') then + deps_prefix = os.getenv('DEPS_PREFIX') +end + +package.path = deps_prefix .. '/share/lua/5.1/?.lua;' .. + deps_prefix .. '/share/lua/5.1/?/init.lua;' .. + package.path + +package.cpath = deps_prefix .. '/lib/lua/5.1/?.so;' .. + package.cpath + +local mpack = require('mpack') +local StdioStream = require('nvim.stdio_stream') +local Session = require('nvim.session') + +local stdio_stream = StdioStream.open() +local session = Session.new(stdio_stream) + +local function on_request(method, args) + if method == 'poll' then + return 'ok' + elseif method == 'write_stderr' then + io.stderr:write(args[1]) + return "done!" + elseif method == "exit" then + session:stop() + return mpack.NIL + end +end + +local function on_notification(event, args) + if event == 'ping' and #args == 0 then + session:notify("vim_eval", "rpcnotify(g:channel, 'pong')") + end +end + +session:run(on_request, on_notification) diff --git a/test/functional/api/server_requests_spec.lua b/test/functional/api/server_requests_spec.lua index 54095112fb..480f099b4d 100644 --- a/test/functional/api/server_requests_spec.lua +++ b/test/functional/api/server_requests_spec.lua @@ -4,8 +4,11 @@ local helpers = require('test.functional.helpers')(after_each) local clear, nvim, eval = helpers.clear, helpers.nvim, helpers.eval local eq, neq, run, stop = helpers.eq, helpers.neq, helpers.run, helpers.stop -local nvim_prog = helpers.nvim_prog +local nvim_prog, command, funcs = helpers.nvim_prog, helpers.command, helpers.funcs +local source, next_message = helpers.source, helpers.next_message +local meths = helpers.meths +if helpers.pending_win32(pending) then return end describe('server -> client', function() local cid @@ -137,12 +140,18 @@ describe('server -> client', function() end) describe('when the client is a recursive vim instance', function() + if os.getenv("TRAVIS") and helpers.os_name() == "osx" then + -- XXX: Hangs Travis macOS since e9061117a5b8f195c3f26a5cb94e18ddd7752d86. + pending("[Hangs on Travis macOS. #5002]", function() end) + return + end + before_each(function() - nvim('command', "let vim = rpcstart('"..nvim_prog.."', ['-u', 'NONE', '-i', 'NONE', '--cmd', 'set noswapfile', '--embed'])") + command("let vim = rpcstart('"..nvim_prog.."', ['-u', 'NONE', '-i', 'NONE', '--cmd', 'set noswapfile', '--embed'])") neq(0, eval('vim')) end) - after_each(function() nvim('command', 'call rpcstop(vim)') end) + after_each(function() command('call rpcstop(vim)') end) it('can send/recieve notifications and make requests', function() nvim('command', "call rpcnotify(vim, 'vim_set_current_line', 'SOME TEXT')") @@ -154,11 +163,11 @@ describe('server -> client', function() end) it('can communicate buffers, tabpages, and windows', function() - eq({3}, eval("rpcrequest(vim, 'vim_get_tabpages')")) - eq({1}, eval("rpcrequest(vim, 'vim_get_windows')")) + eq({1}, eval("rpcrequest(vim, 'nvim_list_tabpages')")) + eq({1}, eval("rpcrequest(vim, 'nvim_list_wins')")) - local buf = eval("rpcrequest(vim, 'vim_get_buffers')")[1] - eq(2, buf) + local buf = eval("rpcrequest(vim, 'nvim_list_bufs')")[1] + eq(1, buf) eval("rpcnotify(vim, 'buffer_set_line', "..buf..", 0, 'SOME TEXT')") nvim('command', "call rpcrequest(vim, 'vim_eval', '0')") -- wait @@ -175,4 +184,42 @@ describe('server -> client', function() eq(true, string.match(err, ': (.*)') == 'Failed to evaluate expression') end) end) + + describe('when using jobstart', function() + local jobid + before_each(function() + local channel = nvim('get_api_info')[1] + nvim('set_var', 'channel', channel) + source([[ + function! s:OnEvent(id, data, event) + call rpcnotify(g:channel, a:event, 0, a:data) + endfunction + let g:job_opts = { + \ 'on_stderr': function('s:OnEvent'), + \ 'on_exit': function('s:OnEvent'), + \ 'user': 0, + \ 'rpc': v:true + \ } + ]]) + local lua_prog = arg[-1] + meths.set_var("args", {lua_prog, 'test/functional/api/rpc_fixture.lua'}) + jobid = eval("jobstart(g:args, g:job_opts)") + neq(0, 'jobid') + end) + + after_each(function() + funcs.jobstop(jobid) + end) + + it('rpc and text stderr can be combined', function() + eq("ok",funcs.rpcrequest(jobid, "poll")) + funcs.rpcnotify(jobid, "ping") + eq({'notification', 'pong', {}}, next_message()) + eq("done!",funcs.rpcrequest(jobid, "write_stderr", "fluff\n")) + eq({'notification', 'stderr', {0, {'fluff', ''}}}, next_message()) + funcs.rpcrequest(jobid, "exit") + eq({'notification', 'exit', {0, 0}}, next_message()) + end) + end) + end) diff --git a/test/functional/api/tabpage_spec.lua b/test/functional/api/tabpage_spec.lua index 7b97c7f067..47dede8b44 100644 --- a/test/functional/api/tabpage_spec.lua +++ b/test/functional/api/tabpage_spec.lua @@ -5,21 +5,23 @@ local clear, nvim, tabpage, curtab, eq, ok = helpers.ok local curtabmeths = helpers.curtabmeths local funcs = helpers.funcs +local request = helpers.request +local NIL = helpers.NIL describe('tabpage_* functions', function() before_each(clear) - describe('get_windows and get_window', function() + describe('list_wins and get_win', function() it('works', function() nvim('command', 'tabnew') nvim('command', 'vsplit') - local tab1, tab2 = unpack(nvim('get_tabpages')) - local win1, win2, win3 = unpack(nvim('get_windows')) - eq({win1}, tabpage('get_windows', tab1)) - eq({win2, win3}, tabpage('get_windows', tab2)) - eq(win2, tabpage('get_window', tab2)) - nvim('set_current_window', win3) - eq(win3, tabpage('get_window', tab2)) + local tab1, tab2 = unpack(nvim('list_tabpages')) + local win1, win2, win3 = unpack(nvim('list_wins')) + eq({win1}, tabpage('list_wins', tab1)) + eq({win2, win3}, tabpage('list_wins', tab2)) + eq(win2, tabpage('get_win', tab2)) + nvim('set_current_win', win3) + eq(win3, tabpage('get_win', tab2)) end) end) @@ -32,12 +34,27 @@ describe('tabpage_* functions', function() curtabmeths.del_var('lua') eq(0, funcs.exists('t:lua')) end) + + it('tabpage_set_var returns the old value', function() + local val1 = {1, 2, {['3'] = 1}} + local val2 = {4, 7} + eq(NIL, request('tabpage_set_var', 0, 'lua', val1)) + eq(val1, request('tabpage_set_var', 0, 'lua', val2)) + end) + + it('tabpage_del_var returns the old value', function() + local val1 = {1, 2, {['3'] = 1}} + local val2 = {4, 7} + eq(NIL, request('tabpage_set_var', 0, 'lua', val1)) + eq(val1, request('tabpage_set_var', 0, 'lua', val2)) + eq(val2, request('tabpage_del_var', 0, 'lua')) + end) end) describe('is_valid', function() it('works', function() nvim('command', 'tabnew') - local tab = nvim('get_tabpages')[2] + local tab = nvim('list_tabpages')[2] nvim('set_current_tabpage', tab) ok(tabpage('is_valid', tab)) nvim('command', 'tabclose') diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index c4976ea06b..6b30c0e81c 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -7,13 +7,14 @@ local ok, nvim_async, feed = helpers.ok, helpers.nvim_async, helpers.feed local os_name = helpers.os_name local meths = helpers.meths local funcs = helpers.funcs +local request = helpers.request describe('vim_* functions', function() before_each(clear) describe('command', function() it('works', function() - local fname = os.tmpname() + local fname = helpers.tmpname() nvim('command', 'new') nvim('command', 'edit '..fname) nvim('command', 'normal itesting\napi') @@ -41,6 +42,10 @@ describe('vim_* functions', function() eq(1, nvim('eval',"matcharg(1) == ['', '']")) eq({'', ''}, nvim('eval','matcharg(1)')) end) + + it('works under deprecated name', function() + eq(2, request("vim_eval", "1+1")) + end) end) describe('call_function', function() @@ -83,19 +88,19 @@ describe('vim_* functions', function() eq(0, funcs.exists('g:lua')) end) - it('set_var returns the old value', function() + it('vim_set_var returns the old value', function() local val1 = {1, 2, {['3'] = 1}} local val2 = {4, 7} - eq(NIL, nvim('set_var', 'lua', val1)) - eq(val1, nvim('set_var', 'lua', val2)) + eq(NIL, request('vim_set_var', 'lua', val1)) + eq(val1, request('vim_set_var', 'lua', val2)) end) - it('del_var returns the old value', function() + it('vim_del_var returns the old value', function() local val1 = {1, 2, {['3'] = 1}} local val2 = {4, 7} - eq(NIL, meths.set_var('lua', val1)) - eq(val1, meths.set_var('lua', val2)) - eq(val2, meths.del_var('lua')) + eq(NIL, request('vim_set_var', 'lua', val1)) + eq(val1, request('vim_set_var', 'lua', val2)) + eq(val2, request('vim_del_var', 'lua')) end) it('truncates values with NULs in them', function() @@ -112,47 +117,47 @@ describe('vim_* functions', function() end) end) - describe('{get,set}_current_buffer and get_buffers', function() + describe('{get,set}_current_buf and list_bufs', function() it('works', function() - eq(1, #nvim('get_buffers')) - eq(nvim('get_buffers')[1], nvim('get_current_buffer')) + eq(1, #nvim('list_bufs')) + eq(nvim('list_bufs')[1], nvim('get_current_buf')) nvim('command', 'new') - eq(2, #nvim('get_buffers')) - eq(nvim('get_buffers')[2], nvim('get_current_buffer')) - nvim('set_current_buffer', nvim('get_buffers')[1]) - eq(nvim('get_buffers')[1], nvim('get_current_buffer')) + eq(2, #nvim('list_bufs')) + eq(nvim('list_bufs')[2], nvim('get_current_buf')) + nvim('set_current_buf', nvim('list_bufs')[1]) + eq(nvim('list_bufs')[1], nvim('get_current_buf')) end) end) - describe('{get,set}_current_window and get_windows', function() + describe('{get,set}_current_win and list_wins', function() it('works', function() - eq(1, #nvim('get_windows')) - eq(nvim('get_windows')[1], nvim('get_current_window')) + eq(1, #nvim('list_wins')) + eq(nvim('list_wins')[1], nvim('get_current_win')) nvim('command', 'vsplit') nvim('command', 'split') - eq(3, #nvim('get_windows')) - eq(nvim('get_windows')[1], nvim('get_current_window')) - nvim('set_current_window', nvim('get_windows')[2]) - eq(nvim('get_windows')[2], nvim('get_current_window')) + eq(3, #nvim('list_wins')) + eq(nvim('list_wins')[1], nvim('get_current_win')) + nvim('set_current_win', nvim('list_wins')[2]) + eq(nvim('list_wins')[2], nvim('get_current_win')) end) end) - describe('{get,set}_current_tabpage and get_tabpages', function() + describe('{get,set}_current_tabpage and list_tabpages', function() it('works', function() - eq(1, #nvim('get_tabpages')) - eq(nvim('get_tabpages')[1], nvim('get_current_tabpage')) + eq(1, #nvim('list_tabpages')) + eq(nvim('list_tabpages')[1], nvim('get_current_tabpage')) nvim('command', 'tabnew') - eq(2, #nvim('get_tabpages')) - eq(2, #nvim('get_windows')) - eq(nvim('get_windows')[2], nvim('get_current_window')) - eq(nvim('get_tabpages')[2], nvim('get_current_tabpage')) - nvim('set_current_window', nvim('get_windows')[1]) + eq(2, #nvim('list_tabpages')) + eq(2, #nvim('list_wins')) + eq(nvim('list_wins')[2], nvim('get_current_win')) + eq(nvim('list_tabpages')[2], nvim('get_current_tabpage')) + nvim('set_current_win', nvim('list_wins')[1]) -- Switching window also switches tabpages if necessary - eq(nvim('get_tabpages')[1], nvim('get_current_tabpage')) - eq(nvim('get_windows')[1], nvim('get_current_window')) - nvim('set_current_tabpage', nvim('get_tabpages')[2]) - eq(nvim('get_tabpages')[2], nvim('get_current_tabpage')) - eq(nvim('get_windows')[2], nvim('get_current_window')) + eq(nvim('list_tabpages')[1], nvim('get_current_tabpage')) + eq(nvim('list_wins')[1], nvim('get_current_win')) + nvim('set_current_tabpage', nvim('list_tabpages')[2]) + eq(nvim('list_tabpages')[2], nvim('get_current_tabpage')) + eq(nvim('list_wins')[2], nvim('get_current_win')) end) end) @@ -213,22 +218,22 @@ describe('vim_* functions', function() screen = Screen.new(40, 8) screen:attach() screen:set_default_attr_ids({ + [0] = {bold=true, foreground=Screen.colors.Blue}, [1] = {foreground = Screen.colors.White, background = Screen.colors.Red}, [2] = {bold = true, foreground = Screen.colors.SeaGreen} }) - screen:set_default_attr_ignore( {{bold=true, foreground=Screen.colors.Blue}} ) end) it('can show one line', function() nvim_async('err_write', 'has bork\n') screen:expect([[ ^ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| {1:has bork} | ]]) end) @@ -236,11 +241,11 @@ describe('vim_* functions', function() it('shows return prompt when more than &cmdheight lines', function() nvim_async('err_write', 'something happened\nvery bad\n') screen:expect([[ - ~ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| {1:something happened} | {1:very bad} | {2:Press ENTER or type command to continue}^ | @@ -250,9 +255,9 @@ describe('vim_* functions', function() it('shows return prompt after all lines are shown', function() nvim_async('err_write', 'FAILURE\nERROR\nEXCEPTION\nTRACEBACK\n') screen:expect([[ - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| {1:FAILURE} | {1:ERROR} | {1:EXCEPTION} | @@ -267,12 +272,12 @@ describe('vim_* functions', function() nvim_async('err_write', 'fail\n') screen:expect([[ ^ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| {1:very fail} | ]]) helpers.wait() @@ -280,11 +285,11 @@ describe('vim_* functions', function() -- shows up to &cmdheight lines nvim_async('err_write', 'more fail\ntoo fail\n') screen:expect([[ - ~ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| {1:more fail} | {1:too fail} | {2:Press ENTER or type command to continue}^ | @@ -298,4 +303,11 @@ describe('vim_* functions', function() eq(false, status) ok(err:match('Invalid option name') ~= nil) end) + + it("doesn't leak memory on incorrect argument types", function() + local status, err = pcall(nvim, 'set_current_dir',{'not', 'a', 'dir'}) + eq(false, status) + ok(err:match(': Wrong type for argument 1, expecting String') ~= nil) + end) + end) diff --git a/test/functional/api/window_spec.lua b/test/functional/api/window_spec.lua index d90323181c..2c43e4db2c 100644 --- a/test/functional/api/window_spec.lua +++ b/test/functional/api/window_spec.lua @@ -7,6 +7,8 @@ local clear, nvim, curbuf, curbuf_contents, window, curwin, eq, neq, local wait = helpers.wait local curwinmeths = helpers.curwinmeths local funcs = helpers.funcs +local request = helpers.request +local NIL = helpers.NIL -- check if str is visible at the beginning of some line local function is_visible(str) @@ -30,14 +32,14 @@ end describe('window_* functions', function() before_each(clear) - describe('get_buffer', function() + describe('get_buf', function() it('works', function() - eq(curbuf(), window('get_buffer', nvim('get_windows')[1])) + eq(curbuf(), window('get_buf', nvim('list_wins')[1])) nvim('command', 'new') - nvim('set_current_window', nvim('get_windows')[2]) - eq(curbuf(), window('get_buffer', nvim('get_windows')[2])) - neq(window('get_buffer', nvim('get_windows')[1]), - window('get_buffer', nvim('get_windows')[2])) + nvim('set_current_win', nvim('list_wins')[2]) + eq(curbuf(), window('get_buf', nvim('list_wins')[2])) + neq(window('get_buf', nvim('list_wins')[1]), + window('get_buf', nvim('list_wins')[2])) end) end) @@ -103,28 +105,28 @@ describe('window_* functions', function() describe('{get,set}_height', function() it('works', function() nvim('command', 'vsplit') - eq(window('get_height', nvim('get_windows')[2]), - window('get_height', nvim('get_windows')[1])) - nvim('set_current_window', nvim('get_windows')[2]) + eq(window('get_height', nvim('list_wins')[2]), + window('get_height', nvim('list_wins')[1])) + nvim('set_current_win', nvim('list_wins')[2]) nvim('command', 'split') - eq(window('get_height', nvim('get_windows')[2]), - math.floor(window('get_height', nvim('get_windows')[1]) / 2)) - window('set_height', nvim('get_windows')[2], 2) - eq(2, window('get_height', nvim('get_windows')[2])) + eq(window('get_height', nvim('list_wins')[2]), + math.floor(window('get_height', nvim('list_wins')[1]) / 2)) + window('set_height', nvim('list_wins')[2], 2) + eq(2, window('get_height', nvim('list_wins')[2])) end) end) describe('{get,set}_width', function() it('works', function() nvim('command', 'split') - eq(window('get_width', nvim('get_windows')[2]), - window('get_width', nvim('get_windows')[1])) - nvim('set_current_window', nvim('get_windows')[2]) + eq(window('get_width', nvim('list_wins')[2]), + window('get_width', nvim('list_wins')[1])) + nvim('set_current_win', nvim('list_wins')[2]) nvim('command', 'vsplit') - eq(window('get_width', nvim('get_windows')[2]), - math.floor(window('get_width', nvim('get_windows')[1]) / 2)) - window('set_width', nvim('get_windows')[2], 2) - eq(2, window('get_width', nvim('get_windows')[2])) + eq(window('get_width', nvim('list_wins')[2]), + math.floor(window('get_width', nvim('list_wins')[1]) / 2)) + window('set_width', nvim('list_wins')[2], 2) + eq(2, window('get_width', nvim('list_wins')[2])) end) end) @@ -137,6 +139,21 @@ describe('window_* functions', function() curwinmeths.del_var('lua') eq(0, funcs.exists('w:lua')) end) + + it('window_set_var returns the old value', function() + local val1 = {1, 2, {['3'] = 1}} + local val2 = {4, 7} + eq(NIL, request('window_set_var', 0, 'lua', val1)) + eq(val1, request('window_set_var', 0, 'lua', val2)) + end) + + it('window_del_var returns the old value', function() + local val1 = {1, 2, {['3'] = 1}} + local val2 = {4, 7} + eq(NIL, request('window_set_var', 0, 'lua', val1)) + eq(val1, request('window_set_var', 0, 'lua', val2)) + eq(val2, request('window_del_var', 0, 'lua')) + end) end) describe('{get,set}_option', function() @@ -152,17 +169,17 @@ describe('window_* functions', function() describe('get_position', function() it('works', function() - local height = window('get_height', nvim('get_windows')[1]) - local width = window('get_width', nvim('get_windows')[1]) + local height = window('get_height', nvim('list_wins')[1]) + local width = window('get_width', nvim('list_wins')[1]) nvim('command', 'split') nvim('command', 'vsplit') - eq({0, 0}, window('get_position', nvim('get_windows')[1])) + eq({0, 0}, window('get_position', nvim('list_wins')[1])) local vsplit_pos = math.floor(width / 2) local split_pos = math.floor(height / 2) local win2row, win2col = - unpack(window('get_position', nvim('get_windows')[2])) + unpack(window('get_position', nvim('list_wins')[2])) local win3row, win3col = - unpack(window('get_position', nvim('get_windows')[3])) + unpack(window('get_position', nvim('list_wins')[3])) eq(0, win2row) eq(0, win3col) ok(vsplit_pos - 1 <= win2col and win2col <= vsplit_pos + 1) @@ -175,19 +192,19 @@ describe('window_* functions', function() nvim('command', 'tabnew') nvim('command', 'vsplit') eq(window('get_tabpage', - nvim('get_windows')[1]), nvim('get_tabpages')[1]) + nvim('list_wins')[1]), nvim('list_tabpages')[1]) eq(window('get_tabpage', - nvim('get_windows')[2]), nvim('get_tabpages')[2]) + nvim('list_wins')[2]), nvim('list_tabpages')[2]) eq(window('get_tabpage', - nvim('get_windows')[3]), nvim('get_tabpages')[2]) + nvim('list_wins')[3]), nvim('list_tabpages')[2]) end) end) describe('is_valid', function() it('works', function() nvim('command', 'split') - local win = nvim('get_windows')[2] - nvim('set_current_window', win) + local win = nvim('list_wins')[2] + nvim('set_current_win', win) ok(window('is_valid', win)) nvim('command', 'close') ok(not window('is_valid', win)) diff --git a/test/functional/autocmd/tabnew_spec.lua b/test/functional/autocmd/tabnew_spec.lua index 8c94dee49b..2148b21832 100644 --- a/test/functional/autocmd/tabnew_spec.lua +++ b/test/functional/autocmd/tabnew_spec.lua @@ -5,6 +5,8 @@ local command = helpers.command local eq = helpers.eq local eval = helpers.eval +if helpers.pending_win32(pending) then return end + describe('autocmd TabNew', function() before_each(clear) diff --git a/test/functional/autocmd/tabnewentered_spec.lua b/test/functional/autocmd/tabnewentered_spec.lua index 7044307399..f033bd5fe4 100644 --- a/test/functional/autocmd/tabnewentered_spec.lua +++ b/test/functional/autocmd/tabnewentered_spec.lua @@ -1,6 +1,8 @@ local helpers = require('test.functional.helpers')(after_each) local clear, nvim, eq = helpers.clear, helpers.nvim, helpers.eq +if helpers.pending_win32(pending) then return end + describe('TabNewEntered', function() describe('au TabNewEntered', function() describe('with * as <afile>', function() diff --git a/test/functional/autocmd/termclose_spec.lua b/test/functional/autocmd/termclose_spec.lua index 02ea0dbd95..6871711058 100644 --- a/test/functional/autocmd/termclose_spec.lua +++ b/test/functional/autocmd/termclose_spec.lua @@ -5,6 +5,8 @@ local clear, execute, feed, nvim, nvim_dir = helpers.clear, helpers.execute, helpers.feed, helpers.nvim, helpers.nvim_dir local eval, eq = helpers.eval, helpers.eq +if helpers.pending_win32(pending) then return end + describe('TermClose event', function() local screen before_each(function() @@ -12,7 +14,7 @@ describe('TermClose event', function() nvim('set_option', 'shell', nvim_dir .. '/shell-test') nvim('set_option', 'shellcmdflag', 'EXE') screen = Screen.new(20, 4) - screen:attach(false) + screen:attach({rgb=false}) end) it('works as expected', function() diff --git a/test/functional/clipboard/clipboard_provider_spec.lua b/test/functional/clipboard/clipboard_provider_spec.lua index 15977b9777..6424b39e13 100644 --- a/test/functional/clipboard/clipboard_provider_spec.lua +++ b/test/functional/clipboard/clipboard_provider_spec.lua @@ -5,6 +5,8 @@ local Screen = require('test.functional.ui.screen') local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert local execute, expect, eq, eval = helpers.execute, helpers.expect, helpers.eq, helpers.eval +if helpers.pending_win32(pending) then return end + local function basic_register_test(noblock) insert("some words") diff --git a/test/functional/core/job_spec.lua b/test/functional/core/job_spec.lua index 61ecdd1835..adbe17d4b5 100644 --- a/test/functional/core/job_spec.lua +++ b/test/functional/core/job_spec.lua @@ -5,8 +5,10 @@ local clear, eq, eval, execute, feed, insert, neq, next_msg, nvim, helpers.insert, helpers.neq, helpers.next_message, helpers.nvim, helpers.nvim_dir, helpers.ok, helpers.source, helpers.write_file, helpers.mkdir, helpers.rmdir +local command = helpers.command local Screen = require('test.functional.ui.screen') +if helpers.pending_win32(pending) then return end describe('jobs', function() local channel @@ -89,7 +91,7 @@ describe('jobs', function() it('preserves NULs', function() -- Make a file with NULs in it. - local filename = os.tmpname() + local filename = helpers.tmpname() write_file(filename, "abc\0def\n") nvim('command', "let j = jobstart(['cat', '"..filename.."'], g:job_opts)") @@ -105,6 +107,13 @@ describe('jobs', function() end) it("will not buffer data if it doesn't end in newlines", function() + if os.getenv("TRAVIS") and os.getenv("CC") == "gcc-4.9" + and helpers.os_name() == "osx" then + -- XXX: Hangs Travis macOS since e9061117a5b8f195c3f26a5cb94e18ddd7752d86. + pending("[Hangs on Travis macOS. #5002]", function() end) + return + end + nvim('command', "let j = jobstart(['cat', '-'], g:job_opts)") nvim('command', 'call jobsend(j, "abc\\nxyz")') eq({'notification', 'stdout', {0, {'abc', 'xyz'}}}, next_msg()) @@ -422,6 +431,13 @@ describe('jobs', function() eq({'notification', 'j', {0, {jobid, 'exit'}}}, next_msg()) end) + it('cannot have both rpc and pty options', function() + command("let g:job_opts.pty = v:true") + command("let g:job_opts.rpc = v:true") + local _, err = pcall(command, "let j = jobstart(['cat', '-'], g:job_opts)") + ok(string.find(err, "E475: Invalid argument: job cannot have both 'pty' and 'rpc' options set") ~= nil) + end) + describe('running tty-test program', function() local function next_chunk() local rv diff --git a/test/functional/eval/api_functions_spec.lua b/test/functional/eval/api_functions_spec.lua new file mode 100644 index 0000000000..2ef67e7808 --- /dev/null +++ b/test/functional/eval/api_functions_spec.lua @@ -0,0 +1,148 @@ +local helpers = require('test.functional.helpers')(after_each) +local Screen = require('test.functional.ui.screen') +local lfs = require('lfs') +local neq, eq, execute = helpers.neq, helpers.eq, helpers.execute +local clear, curbufmeths = helpers.clear, helpers.curbufmeths +local exc_exec, expect, eval = helpers.exc_exec, helpers.expect, helpers.eval +local insert = helpers.insert + +describe('api functions', function() + before_each(clear) + + it("work", function() + execute("call nvim_command('let g:test = 1')") + eq(1, eval("nvim_get_var('test')")) + + local buf = eval("nvim_get_current_buf()") + execute("call nvim_buf_set_lines("..buf..", 0, -1, v:true, ['aa', 'bb'])") + expect([[ + aa + bb]]) + + execute("call nvim_win_set_cursor(0, [1, 1])") + execute("call nvim_input('ax<esc>')") + expect([[ + aax + bb]]) + end) + + it("throw errors for invalid arguments", function() + local err = exc_exec('call nvim_get_current_buf("foo")') + eq('Vim(call):E118: Too many arguments for function: nvim_get_current_buf', err) + + err = exc_exec('call nvim_set_option("hlsearch")') + eq('Vim(call):E119: Not enough arguments for function: nvim_set_option', err) + + err = exc_exec('call nvim_buf_set_lines(1, 0, -1, [], ["list"])') + eq('Vim(call):Wrong type for argument 4, expecting Boolean', err) + + err = exc_exec('call nvim_buf_set_lines(0, 0, -1, v:true, "string")') + eq('Vim(call):Wrong type for argument 5, expecting ArrayOf(String)', err) + + err = exc_exec('call nvim_buf_get_number("0")') + eq('Vim(call):Wrong type for argument 1, expecting Buffer', err) + + err = exc_exec('call nvim_buf_line_count(17)') + eq('Vim(call):Invalid buffer id', err) + end) + + + it("use buffer numbers and windows ids as handles", function() + local screen = Screen.new(40, 8) + screen:attach() + local bnr = eval("bufnr('')") + local bhnd = eval("nvim_get_current_buf()") + local wid = eval("win_getid()") + local whnd = eval("nvim_get_current_win()") + eq(bnr, bhnd) + eq(wid, whnd) + + execute("new") -- creates new buffer and new window + local bnr2 = eval("bufnr('')") + local bhnd2 = eval("nvim_get_current_buf()") + local wid2 = eval("win_getid()") + local whnd2 = eval("nvim_get_current_win()") + eq(bnr2, bhnd2) + eq(wid2, whnd2) + neq(bnr, bnr2) + neq(wid, wid2) + -- 0 is synonymous to the current buffer + eq(bnr2, eval("nvim_buf_get_number(0)")) + + execute("bn") -- show old buffer in new window + eq(bnr, eval("nvim_get_current_buf()")) + eq(bnr, eval("bufnr('')")) + eq(bnr, eval("nvim_buf_get_number(0)")) + eq(wid2, eval("win_getid()")) + eq(whnd2, eval("nvim_get_current_win()")) + end) + + it("get_lines and set_lines use NL to represent NUL", function() + curbufmeths.set_lines(0, -1, true, {"aa\0", "b\0b"}) + eq({'aa\n', 'b\nb'}, eval("nvim_buf_get_lines(0, 0, -1, 1)")) + + execute('call nvim_buf_set_lines(0, 1, 2, v:true, ["xx", "\\nyy"])') + eq({'aa\0', 'xx', '\0yy'}, curbufmeths.get_lines(0, -1, 1)) + end) + + it("that are FUNC_ATTR_NOEVAL cannot be called", function() + -- Deprecated vim_ prefix is not exported. + local err = exc_exec('call vim_get_current_buffer("foo")') + eq('Vim(call):E117: Unknown function: vim_get_current_buffer', err) + + -- Deprecated buffer_ prefix is not exported. + err = exc_exec('call buffer_line_count(0)') + eq('Vim(call):E117: Unknown function: buffer_line_count', err) + + -- Functions deprecated before the api functions became available + -- in vimscript are not exported. + err = exc_exec('call buffer_get_line(0, 1)') + eq('Vim(call):E117: Unknown function: buffer_get_line', err) + + -- some api functions are only useful from a msgpack-rpc channel + err = exc_exec('call nvim_subscribe("fancyevent")') + eq('Vim(call):E117: Unknown function: nvim_subscribe', err) + end) + + it('have metadata accessible with api_info()', function() + local api_keys = eval("sort(keys(api_info()))") + eq({'error_types', 'functions', 'types'}, api_keys) + end) + + it('are highlighted by vim.vim syntax file', function() + if lfs.attributes("build/runtime/syntax/vim/generated.vim",'uid') == nil then + pending("runtime was not built, skipping test") + return + end + local screen = Screen.new(40, 8) + screen:attach() + screen:set_default_attr_ids({ + [1] = {bold = true, foreground = Screen.colors.Brown}, + [2] = {foreground = Screen.colors.DarkCyan}, + [3] = {foreground = Screen.colors.SlateBlue}, + [4] = {foreground = Screen.colors.Fuchsia}, + [5] = {bold = true, foreground = Screen.colors.Blue}, + }) + + execute("set ft=vim") + execute("let &rtp='build/runtime/,'.&rtp") + execute("syntax on") + insert([[ + call bufnr('%') + call nvim_input('typing...') + call not_a_function(42)]]) + + screen:expect([[ + {1:call} {2:bufnr}{3:(}{4:'%'}{3:)} | + {1:call} {2:nvim_input}{3:(}{4:'typing...'}{3:)} | + {1:call} not_a_function{3:(}{4:42}{3:^)} | + {5:~ }| + {5:~ }| + {5:~ }| + {5:~ }| + | + ]]) + screen:detach() + end) + +end) diff --git a/test/functional/eval/execute_spec.lua b/test/functional/eval/execute_spec.lua index a91a04341f..10a6de6eb4 100644 --- a/test/functional/eval/execute_spec.lua +++ b/test/functional/eval/execute_spec.lua @@ -72,13 +72,13 @@ describe('execute()', function() it('silences command run inside', function() local screen = Screen.new(20, 5) screen:attach() - screen:set_default_attr_ignore({{bold=true, foreground=255}}) + screen:set_default_attr_ids( {[0] = {bold=true, foreground=255}} ) feed(':let g:mes = execute("echon 42")<CR>') screen:expect([[ ^ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| | ]]) eq('42', eval('g:mes')) diff --git a/test/functional/eval/server_spec.lua b/test/functional/eval/server_spec.lua index 0fd55ce2f9..d2c985e894 100644 --- a/test/functional/eval/server_spec.lua +++ b/test/functional/eval/server_spec.lua @@ -4,6 +4,8 @@ local nvim, eq, neq, eval = helpers.nvim, helpers.eq, helpers.neq, helpers.eval local clear, funcs, meths = helpers.clear, helpers.funcs, helpers.meths local os_name = helpers.os_name +if helpers.pending_win32(pending) then return end + describe('serverstart(), serverstop()', function() before_each(clear) diff --git a/test/functional/eval/timer_spec.lua b/test/functional/eval/timer_spec.lua index 2f83edb9e4..295c763d74 100644 --- a/test/functional/eval/timer_spec.lua +++ b/test/functional/eval/timer_spec.lua @@ -119,10 +119,25 @@ describe('timers', function() eq(2,eval("g:val2")) end) + it('do not crash when processing events in the handler', function() + source([[ + let g:val = 0 + func! MyHandler(timer) + call timer_stop(a:timer) + sleep 100m + let g:val += 1 + endfunc + ]]) + execute("call timer_start(5, 'MyHandler', {'repeat': 1})") + run(nil, nil, nil, 300) + eq(1,eval("g:val")) + end) + + it("doesn't mess up the cmdline", function() local screen = Screen.new(40, 6) screen:attach() - screen:set_default_attr_ignore({{bold=true, foreground=Screen.colors.Blue}}) + screen:set_default_attr_ids( {[0] = {bold=true, foreground=255}} ) source([[ func! MyHandler(timer) echo "evil" @@ -133,10 +148,10 @@ describe('timers', function() screen:sleep(200) screen:expect([[ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| :good^ | ]]) end) diff --git a/test/functional/ex_cmds/cd_spec.lua b/test/functional/ex_cmds/cd_spec.lua index fcd826c25d..5bf4d22d0f 100644 --- a/test/functional/ex_cmds/cd_spec.lua +++ b/test/functional/ex_cmds/cd_spec.lua @@ -9,6 +9,8 @@ local clear = helpers.clear local execute = helpers.execute local exc_exec = helpers.exc_exec +if helpers.pending_win32(pending) then return end + -- These directories will be created for testing local directories = { tab = 'Xtest-functional-ex_cmds-cd_spec.tab', -- Tab @@ -138,6 +140,27 @@ for _, cmd in ipairs {'cd', 'chdir'} do end) end) + describe('Local directory gets inherited', function() + it('by tabs', function() + local globalDir = directories.start + + -- Create a new tab and change directory + execute('tabnew') + execute('silent t' .. cmd .. ' ' .. directories.tab) + eq(globalDir .. '/' .. directories.tab, tcwd()) + + -- Create a new tab and verify it has inherited the directory + execute('tabnew') + eq(globalDir .. '/' .. directories.tab, tcwd()) + + -- Change tab and change back, verify that directories are correct + execute('tabnext') + eq(globalDir, tcwd()) + execute('tabprevious') + eq(globalDir .. '/' .. directories.tab, tcwd()) + end) + end) + it('works', function() local globalDir = directories.start -- Create a new tab first and verify that is has the same working dir @@ -246,3 +269,21 @@ for _, cmd in ipairs {'getcwd', 'haslocaldir'} do end) end +describe("getcwd()", function () + before_each(function() + clear() + lfs.mkdir(directories.global) + end) + + after_each(function() + helpers.rmdir(directories.global) + end) + + it("returns empty string if working directory does not exist", function() + execute("cd "..directories.global) + execute("call delete('../"..directories.global.."', 'd')") + eq("", helpers.eval("getcwd()")) + end) +end) + + diff --git a/test/functional/ex_cmds/drop_spec.lua b/test/functional/ex_cmds/drop_spec.lua index 16b194dd7d..99db5ea333 100644 --- a/test/functional/ex_cmds/drop_spec.lua +++ b/test/functional/ex_cmds/drop_spec.lua @@ -9,8 +9,8 @@ describe(":drop", function() clear() screen = Screen.new(35, 10) screen:attach() - screen:set_default_attr_ignore({{bold=true, foreground=Screen.colors.Blue}}) screen:set_default_attr_ids({ + [0] = {bold=true, foreground=Screen.colors.Blue}, [1] = {bold = true, reverse = true}, [2] = {reverse = true}, [3] = {bold = true}, @@ -26,13 +26,13 @@ describe(":drop", function() execute("drop tmp1.vim") screen:expect([[ ^ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| {1:tmp1.vim }| "tmp1.vim" [New File] | ]]) @@ -45,13 +45,13 @@ describe(":drop", function() execute("drop tmp1") screen:expect([[ {2:|}^ | - ~ {2:|}~ | - ~ {2:|}~ | - ~ {2:|}~ | - ~ {2:|}~ | - ~ {2:|}~ | - ~ {2:|}~ | - ~ {2:|}~ | + {0:~ }{2:|}{0:~ }| + {0:~ }{2:|}{0:~ }| + {0:~ }{2:|}{0:~ }| + {0:~ }{2:|}{0:~ }| + {0:~ }{2:|}{0:~ }| + {0:~ }{2:|}{0:~ }| + {0:~ }{2:|}{0:~ }| {2:tmp2 }{1:tmp1 }| :drop tmp1 | ]]) @@ -65,13 +65,13 @@ describe(":drop", function() execute("drop tmp3") screen:expect([[ ^ {2:|} | - ~ {2:|}~ | - ~ {2:|}~ | - ~ {2:|}~ | - {1:tmp3 }{2:|}~ | - ABC {2:|}~ | - ~ {2:|}~ | - ~ {2:|}~ | + {0:~ }{2:|}{0:~ }| + {0:~ }{2:|}{0:~ }| + {0:~ }{2:|}{0:~ }| + {1:tmp3 }{2:|}{0:~ }| + ABC {2:|}{0:~ }| + {0:~ }{2:|}{0:~ }| + {0:~ }{2:|}{0:~ }| {2:tmp2 [+] tmp1 }| "tmp3" [New File] | ]]) diff --git a/test/functional/ex_cmds/oldfiles_spec.lua b/test/functional/ex_cmds/oldfiles_spec.lua index b7109f2f98..716c1ebfb2 100644 --- a/test/functional/ex_cmds/oldfiles_spec.lua +++ b/test/functional/ex_cmds/oldfiles_spec.lua @@ -47,7 +47,7 @@ describe(':oldfiles', function() end) end) -describe(':oldfiles!', function() +describe(':browse oldfiles', function() local filename local filename2 local oldfiles @@ -74,7 +74,7 @@ describe(':oldfiles!', function() ok(filename == oldfiles[1] or filename == oldfiles[2]) ok(filename2 == oldfiles[1] or filename2 == oldfiles[2]) - execute('oldfiles!') + execute('browse oldfiles') end) after_each(function() diff --git a/test/functional/ex_cmds/profile_spec.lua b/test/functional/ex_cmds/profile_spec.lua index d390806679..f185db192a 100644 --- a/test/functional/ex_cmds/profile_spec.lua +++ b/test/functional/ex_cmds/profile_spec.lua @@ -5,9 +5,9 @@ local helpers = require('test.functional.helpers')(after_each) local eval = helpers.eval local command = helpers.command local eq, neq = helpers.eq, helpers.neq -local tempfile = os.tmpname() +local tempfile = helpers.tmpname() --- os.tmpname() also creates the file on POSIX systems. Remove it again. +-- tmpname() also creates the file on POSIX systems. Remove it again. -- We just need the name, ignoring any race conditions. if lfs.attributes(tempfile, 'uid') then os.remove(tempfile) diff --git a/test/functional/ex_cmds/recover_spec.lua b/test/functional/ex_cmds/recover_spec.lua index 60673d25ef..0c97857180 100644 --- a/test/functional/ex_cmds/recover_spec.lua +++ b/test/functional/ex_cmds/recover_spec.lua @@ -6,6 +6,8 @@ local execute, eq, clear, eval, feed, expect, source = helpers.execute, helpers.eq, helpers.clear, helpers.eval, helpers.feed, helpers.expect, helpers.source +if helpers.pending_win32(pending) then return end + describe(':recover', function() before_each(clear) diff --git a/test/functional/ex_cmds/write_spec.lua b/test/functional/ex_cmds/write_spec.lua index b38ae29f7d..c1bc5d3140 100644 --- a/test/functional/ex_cmds/write_spec.lua +++ b/test/functional/ex_cmds/write_spec.lua @@ -5,6 +5,8 @@ local eq, eval, clear, write_file, execute, source = helpers.eq, helpers.eval, helpers.clear, helpers.write_file, helpers.execute, helpers.source +if helpers.pending_win32(pending) then return end + describe(':write', function() after_each(function() os.remove('test_bkc_file.txt') diff --git a/test/functional/fixtures/autoload/health/broken.vim b/test/functional/fixtures/autoload/health/broken.vim new file mode 100644 index 0000000000..a2a595b96f --- /dev/null +++ b/test/functional/fixtures/autoload/health/broken.vim @@ -0,0 +1,3 @@ +function! health#broken#check() + throw 'caused an error' +endfunction diff --git a/test/functional/fixtures/autoload/health/success1.vim b/test/functional/fixtures/autoload/health/success1.vim new file mode 100644 index 0000000000..a360347455 --- /dev/null +++ b/test/functional/fixtures/autoload/health/success1.vim @@ -0,0 +1,6 @@ +function! health#success1#check() + call health#report_start("report 1") + call health#report_ok("everything is fine") + call health#report_start("report 2") + call health#report_ok("nothing to see here") +endfunction diff --git a/test/functional/fixtures/autoload/health/success2.vim b/test/functional/fixtures/autoload/health/success2.vim new file mode 100644 index 0000000000..b742b4879d --- /dev/null +++ b/test/functional/fixtures/autoload/health/success2.vim @@ -0,0 +1,4 @@ +function! health#success2#check() + call health#report_start("another 1") + call health#report_ok("ok") +endfunction diff --git a/test/functional/fixtures/tty-test.c b/test/functional/fixtures/tty-test.c index 40ba131003..ca905ce65e 100644 --- a/test/functional/fixtures/tty-test.c +++ b/test/functional/fixtures/tty-test.c @@ -31,12 +31,14 @@ static void walk_cb(uv_handle_t *handle, void *arg) { } } +#ifndef WIN32 static void sigwinch_handler(int signum) { int width, height; uv_tty_get_winsize(&tty, &width, &height); fprintf(stderr, "rows: %d, cols: %d\n", height, width); } +#endif // static void sigwinch_cb(uv_signal_t *handle, int signum) // { @@ -135,6 +137,7 @@ int main(int argc, char **argv) uv_tty_set_mode(&tty, UV_TTY_MODE_RAW); tty.data = &interrupted; uv_read_start((uv_stream_t *)&tty, alloc_cb, read_cb); +#ifndef WIN32 struct sigaction sa; sigemptyset(&sa.sa_mask); sa.sa_flags = 0; @@ -144,6 +147,7 @@ int main(int argc, char **argv) // uv_signal_init(uv_default_loop(), &sigwinch_watcher); // sigwinch_watcher.data = &tty; // uv_signal_start(&sigwinch_watcher, sigwinch_cb, SIGWINCH); +#endif uv_run(uv_default_loop(), UV_RUN_DEFAULT); return 0; diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index 02109d0889..d5b7442b57 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -133,11 +133,11 @@ local function stop() end local function nvim_command(cmd) - request('vim_command', cmd) + request('nvim_command', cmd) end local function nvim_eval(expr) - return request('vim_eval', expr) + return request('nvim_eval', expr) end local os_name = (function() @@ -157,12 +157,12 @@ local os_name = (function() end)() local function nvim_call(name, ...) - return request('vim_call_function', name, {...}) + return request('nvim_call_function', name, {...}) end local function nvim_feed(input) while #input > 0 do - local written = request('vim_input', input) + local written = request('nvim_input', input) input = input:sub(written + 1) end end @@ -216,17 +216,48 @@ local function merge_args(...) return argv end -local function spawn(argv, merge) - local child_stream = ChildProcessStream.spawn(merge and merge_args(prepend_argv, argv) or argv) +local function spawn(argv, merge, env) + local child_stream = ChildProcessStream.spawn( + merge and merge_args(prepend_argv, argv) or argv, + env) return Session.new(child_stream) end local function clear(...) local args = {unpack(nvim_argv)} - for _, arg in ipairs({...}) do + local new_args + local env = nil + local opts = select(1, ...) + if type(opts) == 'table' then + if opts.env then + local env_tbl = {} + for k, v in pairs(opts.env) do + assert(type(k) == 'string') + assert(type(v) == 'string') + env_tbl[k] = v + end + for _, k in ipairs({ + 'HOME', + 'ASAN_OPTIONS', + 'LD_LIBRARY_PATH', 'PATH', + 'NVIM_LOG_FILE', + 'NVIM_RPLUGIN_MANIFEST', + }) do + env_tbl[k] = os.getenv(k) + end + env = {} + for k, v in pairs(env_tbl) do + env[#env + 1] = k .. '=' .. v + end + end + new_args = opts.args or {} + else + new_args = {...} + end + for _, arg in ipairs(new_args) do table.insert(args, arg) end - set_session(spawn(args)) + set_session(spawn(args, nil, env)) end local function insert(...) @@ -260,43 +291,82 @@ local function write_file(name, text, dont_dedent) file:close() end -local function source(code) - local tmpname = os.tmpname() - if os_name() == 'osx' and string.match(tmpname, '^/tmp') then - tmpname = '/private'..tmpname +-- Tries to get platform name, from $SYSTEM_NAME, uname, +-- fallback is 'Windows' +local uname = (function() + local platform = nil + return (function() + if platform then + return platform + end + + platform = os.getenv("SYSTEM_NAME") + if platform then + return platform + end + + local status, f = pcall(io.popen, "uname -s") + if status then + platform = f:read("*l") + else + platform = 'Windows' + end + return platform + end) +end)() + +local function tmpname() + local fname = os.tmpname() + if uname() == 'Windows' and fname:sub(1, 2) == '\\s' then + -- In Windows tmpname() returns a filename starting with + -- special sequence \s, prepend $TEMP path + local tmpdir = os.getenv('TEMP') + return tmpdir..fname + elseif fname:match('^/tmp') and uname() == 'Darwin' then + -- In OS X /tmp links to /private/tmp + return '/private'..fname + else + return fname end - write_file(tmpname, code) - nvim_command('source '..tmpname) - os.remove(tmpname) - return tmpname +end + +local function source(code) + local fname = tmpname() + write_file(fname, code) + nvim_command('source '..fname) + os.remove(fname) + return fname end local function nvim(method, ...) - return request('vim_'..method, ...) + return request('nvim_'..method, ...) +end + +local function ui(method, ...) + return request('nvim_ui_'..method, ...) end local function nvim_async(method, ...) - session:notify('vim_'..method, ...) + session:notify('nvim_'..method, ...) end local function buffer(method, ...) - return request('buffer_'..method, ...) + return request('nvim_buf_'..method, ...) end local function window(method, ...) - return request('window_'..method, ...) + return request('nvim_win_'..method, ...) end local function tabpage(method, ...) - return request('tabpage_'..method, ...) + return request('nvim_tabpage_'..method, ...) end local function curbuf(method, ...) - local buf = nvim('get_current_buffer') if not method then - return buf + return nvim('get_current_buf') end - return buffer(method, buf, ...) + return buffer(method, 0, ...) end local function wait() @@ -306,8 +376,8 @@ local function wait() end -- sleeps the test runner (_not_ the nvim instance) -local function sleep(timeout) - run(nil, nil, nil, timeout) +local function sleep(ms) + run(nil, nil, nil, ms) end local function curbuf_contents() @@ -316,26 +386,24 @@ local function curbuf_contents() end local function curwin(method, ...) - local win = nvim('get_current_window') if not method then - return win + return nvim('get_current_win') end - return window(method, win, ...) + return window(method, 0, ...) end local function curtab(method, ...) - local tab = nvim('get_current_tabpage') if not method then - return tab + return nvim('get_current_tabpage') end - return tabpage(method, tab, ...) + return tabpage(method, 0, ...) end local function expect(contents) return eq(dedent(contents), curbuf_contents()) end -local function rmdir(path) +local function do_rmdir(path) if lfs.attributes(path, 'mode') ~= 'directory' then return nil end @@ -343,7 +411,7 @@ local function rmdir(path) if file ~= '.' and file ~= '..' then local abspath = path..'/'..file if lfs.attributes(abspath, 'mode') == 'directory' then - local ret = rmdir(abspath) -- recurse + local ret = do_rmdir(abspath) -- recurse if not ret then return nil end @@ -356,13 +424,23 @@ local function rmdir(path) end end end - local ret, err = os.remove(path) + local ret, err = lfs.rmdir(path) if not ret then - error('os.remove: '..err) + error('lfs.rmdir('..path..'): '..err) end return ret end +local function rmdir(path) + local ret, _ = pcall(do_rmdir, path) + -- During teardown, the nvim process may not exit quickly enough, then rmdir() + -- will fail (on Windows). + if not ret then -- Try again. + sleep(1000) + do_rmdir(path) + end +end + local exc_exec = function(cmd) nvim_command(([[ try @@ -399,8 +477,23 @@ local function create_callindex(func) return table end +-- Helper to skip tests. Returns true in Windows systems. +-- pending_func is pending() from busted +local function pending_win32(pending_func) + clear() + if uname() == 'Windows' then + if pending_func ~= nil then + pending_func('FIXME: Windows', function() end) + end + return true + else + return false + end +end + local funcs = create_callindex(nvim_call) local meths = create_callindex(nvim) +local uimeths = create_callindex(ui) local bufmeths = create_callindex(buffer) local winmeths = create_callindex(window) local tabmeths = create_callindex(tabpage) @@ -459,9 +552,12 @@ return function(after_each) bufmeths = bufmeths, winmeths = winmeths, tabmeths = tabmeths, + uimeths = uimeths, curbufmeths = curbufmeths, curwinmeths = curwinmeths, curtabmeths = curtabmeths, + pending_win32 = pending_win32, + tmpname = tmpname, NIL = mpack.NIL, } end diff --git a/test/functional/legacy/011_autocommands_spec.lua b/test/functional/legacy/011_autocommands_spec.lua index 6e613c85df..ba899f8119 100644 --- a/test/functional/legacy/011_autocommands_spec.lua +++ b/test/functional/legacy/011_autocommands_spec.lua @@ -18,6 +18,8 @@ local clear, execute, expect, eq, neq, dedent, write_file, feed = helpers.clear, helpers.execute, helpers.expect, helpers.eq, helpers.neq, helpers.dedent, helpers.write_file, helpers.feed +if helpers.pending_win32(pending) then return end + local function has_gzip() return os.execute('gzip --help >/dev/null 2>&1') == 0 end diff --git a/test/functional/legacy/012_directory_spec.lua b/test/functional/legacy/012_directory_spec.lua new file mode 100644 index 0000000000..cef31ae405 --- /dev/null +++ b/test/functional/legacy/012_directory_spec.lua @@ -0,0 +1,82 @@ +-- Tests for 'directory' option. +-- - ".", in same dir as file +-- - "./dir", in directory relative to file +-- - "dir", in directory relative to current dir + +local helpers = require('test.functional.helpers')(after_each) +local lfs = require('lfs') +local insert, eq = helpers.insert, helpers.eq +local neq, eval = helpers.neq, helpers.eval +local clear, execute = helpers.clear, helpers.execute +local wait, write_file = helpers.wait, helpers.write_file + +local function ls_dir_sorted(dirname) + local files = {} + for f in lfs.dir(dirname) do + if f ~= "." and f~= ".." then + table.insert(files, f) + end + end + table.sort(files) + return files +end + +describe("'directory' option", function() + setup(function() + local text = [[ + start of testfile + line 2 Abcdefghij + line 3 Abcdefghij + end of testfile + ]] + write_file('Xtest1', text) + lfs.mkdir('Xtest.je') + lfs.mkdir('Xtest2') + write_file('Xtest2/Xtest3', text) + clear() + end) + teardown(function() + execute('qall!') + helpers.rmdir('Xtest.je') + helpers.rmdir('Xtest2') + os.remove('Xtest1') + end) + + it('is working', function() + insert([[ + start of testfile + line 2 Abcdefghij + line 3 Abcdefghij + end of testfile]]) + + execute('set swapfile') + execute('set dir=.,~') + + -- sanity check: files should not exist yet. + eq(nil, lfs.attributes('.Xtest1.swp')) + + execute('e! Xtest1') + wait() + eq('Xtest1', eval('buffer_name("%")')) + -- Verify that the swapfile exists. In the legacy test this was done by + -- reading the output from :!ls. + neq(nil, lfs.attributes('.Xtest1.swp')) + + execute('set dir=./Xtest2,.,~') + execute('e Xtest1') + wait() + + -- swapfile should no longer exist in CWD. + eq(nil, lfs.attributes('.Xtest1.swp')) + + eq({ "Xtest1.swp", "Xtest3" }, ls_dir_sorted("Xtest2")) + + execute('set dir=Xtest.je,~') + execute('e Xtest2/Xtest3') + eq(1, eval('&swapfile')) + wait() + + eq({ "Xtest3" }, ls_dir_sorted("Xtest2")) + eq({ "Xtest3.swp" }, ls_dir_sorted("Xtest.je")) + end) +end) diff --git a/test/functional/legacy/025_jump_tag_hidden_spec.lua b/test/functional/legacy/025_jump_tag_hidden_spec.lua index 7b7ddb07b9..99224f9e08 100644 --- a/test/functional/legacy/025_jump_tag_hidden_spec.lua +++ b/test/functional/legacy/025_jump_tag_hidden_spec.lua @@ -5,6 +5,8 @@ local helpers = require('test.functional.helpers')(after_each) local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert local execute, expect = helpers.execute, helpers.expect +if helpers.pending_win32(pending) then return end + describe('jump to a tag with hidden set', function() setup(clear) diff --git a/test/functional/legacy/030_fileformats_spec.lua b/test/functional/legacy/030_fileformats_spec.lua index 9bc62a375e..5fd78b2c59 100644 --- a/test/functional/legacy/030_fileformats_spec.lua +++ b/test/functional/legacy/030_fileformats_spec.lua @@ -4,6 +4,8 @@ local helpers = require('test.functional.helpers')(after_each) local feed, clear, execute = helpers.feed, helpers.clear, helpers.execute local eq, write_file = helpers.eq, helpers.write_file +if helpers.pending_win32(pending) then return end + describe('fileformats option', function() setup(function() clear() diff --git a/test/functional/legacy/031_close_commands_spec.lua b/test/functional/legacy/031_close_commands_spec.lua index eaf4e2982f..d41eadaa00 100644 --- a/test/functional/legacy/031_close_commands_spec.lua +++ b/test/functional/legacy/031_close_commands_spec.lua @@ -19,7 +19,18 @@ local expect = helpers.expect local execute = helpers.execute describe('Commands that close windows and/or buffers', function() - setup(clear) + local function cleanup() + os.remove('Xtest1') + os.remove('Xtest2') + os.remove('Xtest3') + end + setup(function() + cleanup() + clear() + end) + teardown(function() + cleanup() + end) it('is working', function() insert('testtext') @@ -112,10 +123,4 @@ describe('Commands that close windows and/or buffers', function() " Now nvim should have exited throw "Oh, Not finished yet."]]) end) - - teardown(function() - os.remove('Xtest1') - os.remove('Xtest2') - os.remove('Xtest3') - end) end) diff --git a/test/functional/legacy/036_regexp_character_classes_spec.lua b/test/functional/legacy/036_regexp_character_classes_spec.lua index 9e67bb9429..15287b9901 100644 --- a/test/functional/legacy/036_regexp_character_classes_spec.lua +++ b/test/functional/legacy/036_regexp_character_classes_spec.lua @@ -3,7 +3,6 @@ local helpers = require('test.functional.helpers')(after_each) local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect local source, write_file = helpers.source, helpers.write_file -local os_name = helpers.os_name local function sixlines(text) local result = '' @@ -14,19 +13,16 @@ local function sixlines(text) end local function diff(text, nodedent) - local tmpname = os.tmpname() - if os_name() == 'osx' and string.match(tmpname, '^/tmp') then - tmpname = '/private'..tmpname - end - execute('w! '..tmpname) + local fname = helpers.tmpname() + execute('w! '..fname) helpers.wait() - local data = io.open(tmpname):read('*all') + local data = io.open(fname):read('*all') if nodedent then helpers.eq(text, data) else helpers.eq(helpers.dedent(text), data) end - os.remove(tmpname) + os.remove(fname) end describe('character classes in regexp', function() diff --git a/test/functional/legacy/051_highlight_spec.lua b/test/functional/legacy/051_highlight_spec.lua index 5bf3b51b90..ef392d8c67 100644 --- a/test/functional/legacy/051_highlight_spec.lua +++ b/test/functional/legacy/051_highlight_spec.lua @@ -7,6 +7,8 @@ local clear, feed = helpers.clear, helpers.feed local execute, expect = helpers.execute, helpers.expect local wait = helpers.wait +if helpers.pending_win32(pending) then return end + describe(':highlight', function() setup(clear) diff --git a/test/functional/legacy/059_utf8_spell_checking_spec.lua b/test/functional/legacy/059_utf8_spell_checking_spec.lua index c44ab44b3c..2fb8f3557d 100644 --- a/test/functional/legacy/059_utf8_spell_checking_spec.lua +++ b/test/functional/legacy/059_utf8_spell_checking_spec.lua @@ -5,6 +5,8 @@ local feed, insert, source = helpers.feed, helpers.insert, helpers.source local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect local write_file, call = helpers.write_file, helpers.call +if helpers.pending_win32(pending) then return end + local function write_latin1(name, text) text = call('iconv', text, 'utf-8', 'latin-1') write_file(name, text) diff --git a/test/functional/legacy/093_mksession_cursor_cols_latin1_spec.lua b/test/functional/legacy/093_mksession_cursor_cols_latin1_spec.lua index 719ce25099..40be7dcca4 100644 --- a/test/functional/legacy/093_mksession_cursor_cols_latin1_spec.lua +++ b/test/functional/legacy/093_mksession_cursor_cols_latin1_spec.lua @@ -7,6 +7,8 @@ local helpers = require('test.functional.helpers')(after_each) local feed, insert = helpers.feed, helpers.insert local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect +if helpers.pending_win32(pending) then return end + describe('store cursor position in session file in Latin-1', function() setup(clear) diff --git a/test/functional/legacy/097_glob_path_spec.lua b/test/functional/legacy/097_glob_path_spec.lua index a6c146891a..23f1427cb5 100644 --- a/test/functional/legacy/097_glob_path_spec.lua +++ b/test/functional/legacy/097_glob_path_spec.lua @@ -6,6 +6,8 @@ local helpers = require('test.functional.helpers')(after_each) local clear = helpers.clear local execute, expect = helpers.execute, helpers.expect +if helpers.pending_win32(pending) then return end + describe('glob() and globpath()', function() setup(clear) diff --git a/test/functional/legacy/107_adjust_window_and_contents_spec.lua b/test/functional/legacy/107_adjust_window_and_contents_spec.lua index ce8d967e00..610bac7f21 100644 --- a/test/functional/legacy/107_adjust_window_and_contents_spec.lua +++ b/test/functional/legacy/107_adjust_window_and_contents_spec.lua @@ -5,6 +5,8 @@ local Screen = require('test.functional.ui.screen') local insert = helpers.insert local clear, execute = helpers.clear, helpers.execute +if helpers.pending_win32(pending) then return end + describe('107', function() setup(clear) diff --git a/test/functional/legacy/arglist_spec.lua b/test/functional/legacy/arglist_spec.lua index c128aaf115..b86d3f0aea 100644 --- a/test/functional/legacy/arglist_spec.lua +++ b/test/functional/legacy/arglist_spec.lua @@ -4,6 +4,8 @@ local helpers = require('test.functional.helpers')(after_each) local clear, execute, eq = helpers.clear, helpers.execute, helpers.eq local eval, exc_exec, neq = helpers.eval, helpers.exc_exec, helpers.neq +if helpers.pending_win32(pending) then return end + describe('argument list commands', function() before_each(clear) diff --git a/test/functional/legacy/delete_spec.lua b/test/functional/legacy/delete_spec.lua index 42238b3a9e..cd19e31a79 100644 --- a/test/functional/legacy/delete_spec.lua +++ b/test/functional/legacy/delete_spec.lua @@ -2,6 +2,8 @@ local helpers = require('test.functional.helpers')(after_each) local clear, source = helpers.clear, helpers.source local eq, eval, execute = helpers.eq, helpers.eval, helpers.execute +if helpers.pending_win32(pending) then return end + describe('Test for delete()', function() before_each(clear) diff --git a/test/functional/legacy/file_perm_spec.lua b/test/functional/legacy/file_perm_spec.lua index 98bdf630dd..77e82352c5 100644 --- a/test/functional/legacy/file_perm_spec.lua +++ b/test/functional/legacy/file_perm_spec.lua @@ -6,7 +6,7 @@ local clear, call, eq = helpers.clear, helpers.call, helpers.eq local neq, exc_exec = helpers.neq, helpers.exc_exec describe('Test getting and setting file permissions', function() - local tempfile = os.tmpname() + local tempfile = helpers.tmpname() before_each(function() os.remove(tempfile) @@ -21,7 +21,7 @@ describe('Test getting and setting file permissions', function() eq(9, call('len', call('getfperm', tempfile))) eq(1, call('setfperm', tempfile, 'rwx------')) - if helpers.os_name == 'windows' then + if helpers.os_name() == 'windows' then eq('rw-rw-rw-', call('getfperm', tempfile)) else eq('rwx------', call('getfperm', tempfile)) diff --git a/test/functional/legacy/fixeol_spec.lua b/test/functional/legacy/fixeol_spec.lua index bba1415535..1e9e832536 100644 --- a/test/functional/legacy/fixeol_spec.lua +++ b/test/functional/legacy/fixeol_spec.lua @@ -4,6 +4,8 @@ local helpers = require('test.functional.helpers')(after_each) local feed = helpers.feed local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect +if helpers.pending_win32(pending) then return end + describe('fixeol', function() local function rmtestfiles() os.remove('test.out') diff --git a/test/functional/legacy/fnamemodify_spec.lua b/test/functional/legacy/fnamemodify_spec.lua index f614b07b36..d8ecbfe058 100644 --- a/test/functional/legacy/fnamemodify_spec.lua +++ b/test/functional/legacy/fnamemodify_spec.lua @@ -4,6 +4,8 @@ local helpers = require('test.functional.helpers')(after_each) local clear, source = helpers.clear, helpers.source local call, eq, nvim = helpers.call, helpers.eq, helpers.meths +if helpers.pending_win32(pending) then return end + local function expected_empty() eq({}, nvim.get_vvar('errors')) end diff --git a/test/functional/legacy/getcwd_spec.lua b/test/functional/legacy/getcwd_spec.lua index 3bb9930b74..dcb56eb242 100644 --- a/test/functional/legacy/getcwd_spec.lua +++ b/test/functional/legacy/getcwd_spec.lua @@ -4,6 +4,8 @@ local helpers = require('test.functional.helpers')(after_each) local eq, eval, source = helpers.eq, helpers.eval, helpers.source local call, clear, execute = helpers.call, helpers.clear, helpers.execute +if helpers.pending_win32(pending) then return end + describe('getcwd', function() before_each(clear) diff --git a/test/functional/legacy/packadd_spec.lua b/test/functional/legacy/packadd_spec.lua index b2ed39f288..68bdbf5257 100644 --- a/test/functional/legacy/packadd_spec.lua +++ b/test/functional/legacy/packadd_spec.lua @@ -9,6 +9,8 @@ local function expected_empty() eq({}, nvim.get_vvar('errors')) end +if helpers.pending_win32(pending) then return end + describe('packadd', function() before_each(function() clear() @@ -248,14 +250,13 @@ describe('packadd', function() screen = Screen.new(30, 5) screen:attach() screen:set_default_attr_ids({ + [0] = {bold=true, foreground=Screen.colors.Blue}, [1] = { foreground = Screen.colors.Black, background = Screen.colors.Yellow, }, [2] = {bold = true, reverse = true} }) - local NonText = Screen.colors.Blue - screen:set_default_attr_ignore({{}, {bold=true, foreground=NonText}}) execute([[let optdir1 = &packpath . '/pack/mine/opt']]) execute([[let optdir2 = &packpath . '/pack/candidate/opt']]) @@ -269,32 +270,32 @@ describe('packadd', function() feed(':packadd <Tab>') screen:expect([=[ | - ~ | - ~ | + {0:~ }| + {0:~ }| {1:pluginA}{2: pluginB pluginC }| :packadd pluginA^ | ]=]) feed('<Tab>') screen:expect([=[ | - ~ | - ~ | + {0:~ }| + {0:~ }| {2:pluginA }{1:pluginB}{2: pluginC }| :packadd pluginB^ | ]=]) feed('<Tab>') screen:expect([=[ | - ~ | - ~ | + {0:~ }| + {0:~ }| {2:pluginA pluginB }{1:pluginC}{2: }| :packadd pluginC^ | ]=]) feed('<Tab>') screen:expect([=[ | - ~ | - ~ | + {0:~ }| + {0:~ }| {2:pluginA pluginB pluginC }| :packadd ^ | ]=]) @@ -316,32 +317,32 @@ describe('packadd', function() feed(':colorscheme <Tab>') screen:expect([=[ | - ~ | - ~ | + {0:~ }| + {0:~ }| {1:one}{2: three two }| :colorscheme one^ | ]=]) feed('<Tab>') screen:expect([=[ | - ~ | - ~ | + {0:~ }| + {0:~ }| {2:one }{1:three}{2: two }| :colorscheme three^ | ]=]) feed('<Tab>') screen:expect([=[ | - ~ | - ~ | + {0:~ }| + {0:~ }| {2:one three }{1:two}{2: }| :colorscheme two^ | ]=]) feed('<Tab>') screen:expect([=[ | - ~ | - ~ | + {0:~ }| + {0:~ }| {2:one three two }| :colorscheme ^ | ]=]) diff --git a/test/functional/legacy/wordcount_spec.lua b/test/functional/legacy/wordcount_spec.lua index 300a777772..171ec3de92 100644 --- a/test/functional/legacy/wordcount_spec.lua +++ b/test/functional/legacy/wordcount_spec.lua @@ -5,6 +5,8 @@ local feed, insert, source = helpers.feed, helpers.insert, helpers.source local clear, execute = helpers.clear, helpers.execute local eq, eval = helpers.eq, helpers.eval +if helpers.pending_win32(pending) then return end + describe('wordcount', function() before_each(clear) diff --git a/test/functional/normal/K_spec.lua b/test/functional/normal/K_spec.lua index af0f82ef9a..43e598633c 100644 --- a/test/functional/normal/K_spec.lua +++ b/test/functional/normal/K_spec.lua @@ -2,6 +2,8 @@ local helpers = require('test.functional.helpers')(after_each) local eq, clear, eval, feed = helpers.eq, helpers.clear, helpers.eval, helpers.feed +if helpers.pending_win32(pending) then return end + describe('K', function() local test_file = 'K_spec_out' before_each(function() diff --git a/test/functional/options/autochdir_spec.lua b/test/functional/options/autochdir_spec.lua index 0e293761ad..209531515c 100644 --- a/test/functional/options/autochdir_spec.lua +++ b/test/functional/options/autochdir_spec.lua @@ -3,6 +3,8 @@ local clear = helpers.clear local eq = helpers.eq local getcwd = helpers.funcs.getcwd +if helpers.pending_win32(pending) then return end + describe("'autochdir'", function() it('given on the shell gets processed properly', function() local targetdir = 'test/functional/fixtures' diff --git a/test/functional/options/defaults_spec.lua b/test/functional/options/defaults_spec.lua index a36939b0bd..1ae855f26c 100644 --- a/test/functional/options/defaults_spec.lua +++ b/test/functional/options/defaults_spec.lua @@ -1,7 +1,15 @@ local helpers = require('test.functional.helpers')(after_each) + local Screen = require('test.functional.ui.screen') -local eval, eq = helpers.eval, helpers.eq + +local meths = helpers.meths local execute = helpers.execute +local clear = helpers.clear +local eval = helpers.eval +local eq = helpers.eq +local neq = helpers.neq + +if helpers.pending_win32(pending) then return end local function init_session(...) local args = { helpers.nvim_prog, '-i', 'NONE', '--embed', @@ -75,6 +83,194 @@ describe('startup defaults', function() eq(0, eval('exists("g:syntax_on")')) end) end) + + describe('packpath', function() + it('defaults to &runtimepath', function() + eq(meths.get_option('runtimepath'), meths.get_option('packpath')) + end) + + it('does not follow modifications to runtimepath', function() + meths.command('set runtimepath+=foo') + neq(meths.get_option('runtimepath'), meths.get_option('packpath')) + meths.command('set packpath+=foo') + eq(meths.get_option('runtimepath'), meths.get_option('packpath')) + end) + end) end) +describe('XDG-based defaults', function() + -- Need to be in separate describe() block to not run clear() twice. + -- Do not put before_each() here for the same reasons. + describe('with too long XDG variables', function() + before_each(function() + clear({env={ + XDG_CONFIG_HOME=('/x'):rep(4096), + XDG_CONFIG_DIRS=(('/a'):rep(2048) + .. ':' .. ('/b'):rep(2048) + .. (':/c'):rep(512)), + XDG_DATA_HOME=('/X'):rep(4096), + XDG_DATA_DIRS=(('/A'):rep(2048) + .. ':' .. ('/B'):rep(2048) + .. (':/C'):rep(512)), + }}) + end) + + it('are correctly set', function() + eq((('/x'):rep(4096) .. '/nvim' + .. ',' .. ('/a'):rep(2048) .. '/nvim' + .. ',' .. ('/b'):rep(2048) .. '/nvim' + .. (',' .. '/c/nvim'):rep(512) + .. ',' .. ('/X'):rep(4096) .. '/nvim/site' + .. ',' .. ('/A'):rep(2048) .. '/nvim/site' + .. ',' .. ('/B'):rep(2048) .. '/nvim/site' + .. (',' .. '/C/nvim/site'):rep(512) + .. ',' .. eval('$VIMRUNTIME') + .. (',' .. '/C/nvim/site/after'):rep(512) + .. ',' .. ('/B'):rep(2048) .. '/nvim/site/after' + .. ',' .. ('/A'):rep(2048) .. '/nvim/site/after' + .. ',' .. ('/X'):rep(4096) .. '/nvim/site/after' + .. (',' .. '/c/nvim/after'):rep(512) + .. ',' .. ('/b'):rep(2048) .. '/nvim/after' + .. ',' .. ('/a'):rep(2048) .. '/nvim/after' + .. ',' .. ('/x'):rep(4096) .. '/nvim/after' + ), meths.get_option('runtimepath')) + meths.command('set runtimepath&') + meths.command('set backupdir&') + meths.command('set directory&') + meths.command('set undodir&') + meths.command('set viewdir&') + eq((('/x'):rep(4096) .. '/nvim' + .. ',' .. ('/a'):rep(2048) .. '/nvim' + .. ',' .. ('/b'):rep(2048) .. '/nvim' + .. (',' .. '/c/nvim'):rep(512) + .. ',' .. ('/X'):rep(4096) .. '/nvim/site' + .. ',' .. ('/A'):rep(2048) .. '/nvim/site' + .. ',' .. ('/B'):rep(2048) .. '/nvim/site' + .. (',' .. '/C/nvim/site'):rep(512) + .. ',' .. eval('$VIMRUNTIME') + .. (',' .. '/C/nvim/site/after'):rep(512) + .. ',' .. ('/B'):rep(2048) .. '/nvim/site/after' + .. ',' .. ('/A'):rep(2048) .. '/nvim/site/after' + .. ',' .. ('/X'):rep(4096) .. '/nvim/site/after' + .. (',' .. '/c/nvim/after'):rep(512) + .. ',' .. ('/b'):rep(2048) .. '/nvim/after' + .. ',' .. ('/a'):rep(2048) .. '/nvim/after' + .. ',' .. ('/x'):rep(4096) .. '/nvim/after' + ), meths.get_option('runtimepath')) + eq('.,' .. ('/X'):rep(4096) .. '/nvim/backup', + meths.get_option('backupdir')) + eq(('/X'):rep(4096) .. '/nvim/swap//', meths.get_option('directory')) + eq(('/X'):rep(4096) .. '/nvim/undo', meths.get_option('undodir')) + eq(('/X'):rep(4096) .. '/nvim/view', meths.get_option('viewdir')) + end) + end) + + describe('with XDG variables that can be expanded', function() + before_each(function() + clear({env={ + XDG_CONFIG_HOME='$XDG_DATA_HOME', + XDG_CONFIG_DIRS='$XDG_DATA_DIRS', + XDG_DATA_HOME='$XDG_CONFIG_HOME', + XDG_DATA_DIRS='$XDG_CONFIG_DIRS', + }}) + end) + + it('are not expanded', function() + eq(('$XDG_DATA_HOME/nvim' + .. ',$XDG_DATA_DIRS/nvim' + .. ',$XDG_CONFIG_HOME/nvim/site' + .. ',$XDG_CONFIG_DIRS/nvim/site' + .. ',' .. eval('$VIMRUNTIME') + .. ',$XDG_CONFIG_DIRS/nvim/site/after' + .. ',$XDG_CONFIG_HOME/nvim/site/after' + .. ',$XDG_DATA_DIRS/nvim/after' + .. ',$XDG_DATA_HOME/nvim/after' + ), meths.get_option('runtimepath')) + meths.command('set runtimepath&') + meths.command('set backupdir&') + meths.command('set directory&') + meths.command('set undodir&') + meths.command('set viewdir&') + eq(('$XDG_DATA_HOME/nvim' + .. ',$XDG_DATA_DIRS/nvim' + .. ',$XDG_CONFIG_HOME/nvim/site' + .. ',$XDG_CONFIG_DIRS/nvim/site' + .. ',' .. eval('$VIMRUNTIME') + .. ',$XDG_CONFIG_DIRS/nvim/site/after' + .. ',$XDG_CONFIG_HOME/nvim/site/after' + .. ',$XDG_DATA_DIRS/nvim/after' + .. ',$XDG_DATA_HOME/nvim/after' + ), meths.get_option('runtimepath')) + eq('.,$XDG_CONFIG_HOME/nvim/backup', meths.get_option('backupdir')) + eq('$XDG_CONFIG_HOME/nvim/swap//', meths.get_option('directory')) + eq('$XDG_CONFIG_HOME/nvim/undo', meths.get_option('undodir')) + eq('$XDG_CONFIG_HOME/nvim/view', meths.get_option('viewdir')) + meths.command('set all&') + eq(('$XDG_DATA_HOME/nvim' + .. ',$XDG_DATA_DIRS/nvim' + .. ',$XDG_CONFIG_HOME/nvim/site' + .. ',$XDG_CONFIG_DIRS/nvim/site' + .. ',' .. eval('$VIMRUNTIME') + .. ',$XDG_CONFIG_DIRS/nvim/site/after' + .. ',$XDG_CONFIG_HOME/nvim/site/after' + .. ',$XDG_DATA_DIRS/nvim/after' + .. ',$XDG_DATA_HOME/nvim/after' + ), meths.get_option('runtimepath')) + eq('.,$XDG_CONFIG_HOME/nvim/backup', meths.get_option('backupdir')) + eq('$XDG_CONFIG_HOME/nvim/swap//', meths.get_option('directory')) + eq('$XDG_CONFIG_HOME/nvim/undo', meths.get_option('undodir')) + eq('$XDG_CONFIG_HOME/nvim/view', meths.get_option('viewdir')) + end) + end) + describe('with commas', function() + before_each(function() + clear({env={ + XDG_CONFIG_HOME=', , ,', + XDG_CONFIG_DIRS=',-,-,:-,-,-', + XDG_DATA_HOME=',=,=,', + XDG_DATA_DIRS=',≡,≡,:≡,≡,≡', + }}) + end) + + it('are escaped properly', function() + eq(('\\, \\, \\,/nvim' + .. ',\\,-\\,-\\,/nvim' + .. ',-\\,-\\,-/nvim' + .. ',\\,=\\,=\\,/nvim/site' + .. ',\\,≡\\,≡\\,/nvim/site' + .. ',≡\\,≡\\,≡/nvim/site' + .. ',' .. eval('$VIMRUNTIME') + .. ',≡\\,≡\\,≡/nvim/site/after' + .. ',\\,≡\\,≡\\,/nvim/site/after' + .. ',\\,=\\,=\\,/nvim/site/after' + .. ',-\\,-\\,-/nvim/after' + .. ',\\,-\\,-\\,/nvim/after' + .. ',\\, \\, \\,/nvim/after' + ), meths.get_option('runtimepath')) + meths.command('set runtimepath&') + meths.command('set backupdir&') + meths.command('set directory&') + meths.command('set undodir&') + meths.command('set viewdir&') + eq(('\\, \\, \\,/nvim' + .. ',\\,-\\,-\\,/nvim' + .. ',-\\,-\\,-/nvim' + .. ',\\,=\\,=\\,/nvim/site' + .. ',\\,≡\\,≡\\,/nvim/site' + .. ',≡\\,≡\\,≡/nvim/site' + .. ',' .. eval('$VIMRUNTIME') + .. ',≡\\,≡\\,≡/nvim/site/after' + .. ',\\,≡\\,≡\\,/nvim/site/after' + .. ',\\,=\\,=\\,/nvim/site/after' + .. ',-\\,-\\,-/nvim/after' + .. ',\\,-\\,-\\,/nvim/after' + .. ',\\, \\, \\,/nvim/after' + ), meths.get_option('runtimepath')) + eq('.,\\,=\\,=\\,/nvim/backup', meths.get_option('backupdir')) + eq('\\,=\\,=\\,/nvim/swap//', meths.get_option('directory')) + eq('\\,=\\,=\\,/nvim/undo', meths.get_option('undodir')) + eq('\\,=\\,=\\,/nvim/view', meths.get_option('viewdir')) + end) + end) +end) diff --git a/test/functional/options/shortmess_spec.lua b/test/functional/options/shortmess_spec.lua index d531e47e28..22e8a39b79 100644 --- a/test/functional/options/shortmess_spec.lua +++ b/test/functional/options/shortmess_spec.lua @@ -2,6 +2,8 @@ local helpers = require('test.functional.helpers')(after_each) local Screen = require('test.functional.ui.screen') local clear, execute = helpers.clear, helpers.execute +if helpers.pending_win32(pending) then return end + describe("'shortmess'", function() local screen diff --git a/test/functional/plugin/health_spec.lua b/test/functional/plugin/health_spec.lua new file mode 100644 index 0000000000..4bcaab009f --- /dev/null +++ b/test/functional/plugin/health_spec.lua @@ -0,0 +1,85 @@ +local helpers = require('test.functional.helpers')(after_each) +local plugin_helpers = require('test.functional.plugin.helpers') + +describe('health.vim', function() + before_each(function() + plugin_helpers.reset() + -- Provides functions: + -- health#broken#check() + -- health#success1#check() + -- health#success2#check() + helpers.execute("set runtimepath+=test/functional/fixtures") + end) + + it("reports", function() + helpers.source([[ + let g:health_report = execute([ + \ "call health#report_start('Check Bar')", + \ "call health#report_ok('Bar status')", + \ "call health#report_ok('Other Bar status')", + \ "call health#report_warn('Zub')", + \ "call health#report_start('Baz')", + \ "call health#report_warn('Zim', ['suggestion 1', 'suggestion 2'])" + \ ]) + ]]) + local result = helpers.eval("g:health_report") + + helpers.eq(helpers.dedent([[ + + + ## Check Bar + - SUCCESS: Bar status + - SUCCESS: Other Bar status + - WARNING: Zub + + ## Baz + - WARNING: Zim + - SUGGESTIONS: + - suggestion 1 + - suggestion 2]]), + result) + end) + + + describe(":CheckHealth", function() + it("concatenates multiple reports", function() + helpers.execute("CheckHealth success1 success2") + helpers.expect([[ + + health#success1#check + ================================================================================ + ## report 1 + - SUCCESS: everything is fine + + ## report 2 + - SUCCESS: nothing to see here + + health#success2#check + ================================================================================ + ## another 1 + - SUCCESS: ok + ]]) + end) + + it("gracefully handles broken healthcheck", function() + helpers.execute("CheckHealth broken") + helpers.expect([[ + + health#broken#check + ================================================================================ + - ERROR: Failed to run healthcheck for "broken" plugin. Exception: + caused an error + ]]) + end) + + it("gracefully handles invalid healthcheck", function() + helpers.execute("CheckHealth non_existent_healthcheck") + helpers.expect([[ + + health#non_existent_healthcheck#check + ================================================================================ + - ERROR: No healthcheck found for "non_existent_healthcheck" plugin. + ]]) + end) + end) +end) diff --git a/test/functional/plugin/matchparen_spec.lua b/test/functional/plugin/matchparen_spec.lua index 4181f69263..5990942de6 100644 --- a/test/functional/plugin/matchparen_spec.lua +++ b/test/functional/plugin/matchparen_spec.lua @@ -16,7 +16,10 @@ describe('matchparen', function() reset() screen = Screen.new(20,5) screen:attach() - screen:set_default_attr_ignore( {{bold=true, foreground=Screen.colors.Blue}} ) + screen:set_default_attr_ids( { + [0] = {bold=true, foreground=255}, + [1] = {bold=true}, + } ) end) it('uses correct column after i_<Up>. Vim patch 7.4.1296', function() @@ -37,7 +40,7 @@ describe('matchparen', function() ^ | } | {1:-- INSERT --} | - ]], {[1] = {bold = true}}) + ]]) end) end) diff --git a/test/functional/plugin/shada_spec.lua b/test/functional/plugin/shada_spec.lua index e18e9ef428..b1209a22e9 100644 --- a/test/functional/plugin/shada_spec.lua +++ b/test/functional/plugin/shada_spec.lua @@ -43,6 +43,8 @@ local wshada, _, fname = get_shada_rw('Xtest-functional-plugin-shada.shada') local wshada_tmp, _, fname_tmp = get_shada_rw('Xtest-functional-plugin-shada.shada.tmp.f') +if helpers.pending_win32(pending) then return end + describe('In autoload/shada.vim', function() local epoch = os.date('%Y-%m-%dT%H:%M:%S', 0) before_each(function() @@ -2461,17 +2463,17 @@ describe('ftplugin/shada.vim', function() nvim_command('setlocal filetype=shada') funcs.setline(1, ' Replacement with timestamp ' .. epoch) nvim_feed('ggA:\027') - eq('Replacement with timestamp ' .. epoch .. ':', curbuf('get_line', 0)) + eq('Replacement with timestamp ' .. epoch .. ':', curbuf('get_lines', 0, 1, true)[1]) nvim_feed('o-\027') - eq(' -', curbuf('get_line', 1)) + eq({' -'}, curbuf('get_lines', 1, 2, true)) nvim_feed('ggO+\027') - eq('+', curbuf('get_line', 0)) + eq({'+'}, curbuf('get_lines', 0, 1, true)) nvim_feed('GO*\027') - eq(' *', curbuf('get_line', 2)) + eq({' *'}, curbuf('get_lines', 2, 3, true)) nvim_feed('ggO /\027') - eq(' /', curbuf('get_line', 0)) + eq({' /'}, curbuf('get_lines', 0, 1, true)) nvim_feed('ggOx\027') - eq('x', curbuf('get_line', 0)) + eq({'x'}, curbuf('get_lines', 0, 1, true)) end) end) diff --git a/test/functional/shada/buffers_spec.lua b/test/functional/shada/buffers_spec.lua index e4d02c268b..01952560d6 100644 --- a/test/functional/shada/buffers_spec.lua +++ b/test/functional/shada/buffers_spec.lua @@ -8,6 +8,8 @@ local reset, set_additional_cmd, clear = shada_helpers.reset, shada_helpers.set_additional_cmd, shada_helpers.clear +if helpers.pending_win32(pending) then return end + describe('ShaDa support code', function() local testfilename = 'Xtestfile-functional-shada-buffers' local testfilename_2 = 'Xtestfile-functional-shada-buffers-2' @@ -78,9 +80,9 @@ describe('ShaDa support code', function() it('does not dump unnamed buffers', function() set_additional_cmd('set shada+=% hidden') reset() - curbufmeths.set_line(0, 'foo') + curbufmeths.set_lines(0, 1, true, {'foo'}) nvim_command('enew') - curbufmeths.set_line(0, 'bar') + curbufmeths.set_lines(0, 1, true, {'bar'}) eq(2, funcs.bufnr('$')) nvim_command('qall!') reset() diff --git a/test/functional/shada/helpers.lua b/test/functional/shada/helpers.lua index bb2919d4fb..8e2c0cc1f6 100644 --- a/test/functional/shada/helpers.lua +++ b/test/functional/shada/helpers.lua @@ -5,11 +5,11 @@ local write_file, merge_args = helpers.write_file, helpers.merge_args local mpack = require('mpack') -local tmpname = os.tmpname() +local tmpname = helpers.tmpname() local additional_cmd = '' -local function nvim_argv() - local argv = {nvim_prog, '-u', 'NONE', '-i', tmpname, '-N', +local function nvim_argv(shada_file) + local argv = {nvim_prog, '-u', 'NONE', '-i', shada_file or tmpname, '-N', '--cmd', 'set shortmess+=I background=light noswapfile', '--cmd', additional_cmd, '--embed'} @@ -20,8 +20,8 @@ local function nvim_argv() end end -local reset = function() - set_session(spawn(nvim_argv())) +local reset = function(shada_file) + set_session(spawn(nvim_argv(shada_file))) meths.set_var('tmpname', tmpname) end diff --git a/test/functional/shada/marks_spec.lua b/test/functional/shada/marks_spec.lua index ace3c74a62..646b0b692e 100644 --- a/test/functional/shada/marks_spec.lua +++ b/test/functional/shada/marks_spec.lua @@ -14,6 +14,8 @@ local nvim_current_line = function() return curwinmeths.get_cursor()[1] end +if helpers.pending_win32(pending) then return end + describe('ShaDa support code', function() local testfilename = 'Xtestfile-functional-shada-marks' local testfilename_2 = 'Xtestfile-functional-shada-marks-2' diff --git a/test/functional/shada/shada_spec.lua b/test/functional/shada/shada_spec.lua index 32e7b16fc5..f845f6f93b 100644 --- a/test/functional/shada/shada_spec.lua +++ b/test/functional/shada/shada_spec.lua @@ -5,6 +5,7 @@ local meths, nvim_command, funcs, eq = local write_file, spawn, set_session, nvim_prog, exc_exec = helpers.write_file, helpers.spawn, helpers.set_session, helpers.nvim_prog, helpers.exc_exec + local lfs = require('lfs') local paths = require('test.config.paths') @@ -14,15 +15,22 @@ local shada_helpers = require('test.functional.shada.helpers') local reset, clear, get_shada_rw = shada_helpers.reset, shada_helpers.clear, shada_helpers.get_shada_rw local read_shada_file = shada_helpers.read_shada_file +local set_additional_cmd = shada_helpers.set_additional_cmd local wshada, _, shada_fname, clean = get_shada_rw('Xtest-functional-shada-shada.shada') +local dirname = 'Xtest-functional-shada-shada.d' +local dirshada = dirname .. '/main.shada' + +if helpers.pending_win32(pending) then return end + describe('ShaDa support code', function() before_each(reset) after_each(function() clear() clean() + lfs.rmdir(dirname) end) it('preserves `s` item size limit with unknown entries', function() @@ -230,4 +238,17 @@ describe('ShaDa support code', function() eq('', meths.get_option('viminfo')) eq('', meths.get_option('shada')) end) + + it('does not crash when ShaDa file directory is not writable', function() + funcs.mkdir(dirname, '', 0) + eq(0, funcs.filewritable(dirname)) + set_additional_cmd('set shada=') + reset(dirshada) + meths.set_option('shada', '\'10') + eq('Vim(wshada):E886: System error while opening ShaDa file ' + .. 'Xtest-functional-shada-shada.d/main.shada for reading to merge ' + .. 'before writing it: permission denied', + exc_exec('wshada')) + meths.set_option('shada', '') + end) end) diff --git a/test/functional/shell/bang_filter_spec.lua b/test/functional/shell/bang_filter_spec.lua index cd5325c4e1..a320e6d018 100644 --- a/test/functional/shell/bang_filter_spec.lua +++ b/test/functional/shell/bang_filter_spec.lua @@ -4,6 +4,8 @@ local helpers = require('test.functional.helpers')(after_each) local feed, execute, clear = helpers.feed, helpers.execute, helpers.clear local mkdir, write_file, rmdir = helpers.mkdir, helpers.write_file, helpers.rmdir +if helpers.pending_win32(pending) then return end + local Screen = require('test.functional.ui.screen') diff --git a/test/functional/shell/viml_system_spec.lua b/test/functional/shell/viml_system_spec.lua index 3de022cbd9..b8de7cc86f 100644 --- a/test/functional/shell/viml_system_spec.lua +++ b/test/functional/shell/viml_system_spec.lua @@ -8,6 +8,7 @@ local eq, clear, eval, feed, nvim = local Screen = require('test.functional.ui.screen') +if helpers.pending_win32(pending) then return end local function create_file_with_nuls(name) return function() diff --git a/test/functional/terminal/altscreen_spec.lua b/test/functional/terminal/altscreen_spec.lua index e1760c8ad8..4526037808 100644 --- a/test/functional/terminal/altscreen_spec.lua +++ b/test/functional/terminal/altscreen_spec.lua @@ -6,6 +6,8 @@ local feed_data = thelpers.feed_data local enter_altscreen = thelpers.enter_altscreen local exit_altscreen = thelpers.exit_altscreen +if helpers.pending_win32(pending) then return end + describe('terminal altscreen', function() local screen @@ -21,7 +23,7 @@ describe('terminal altscreen', function() line7 | line8 | {1: } | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) enter_altscreen() screen:expect([[ @@ -31,7 +33,7 @@ describe('terminal altscreen', function() | | {1: } | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) eq(10, curbuf('line_count')) end) @@ -60,7 +62,7 @@ describe('terminal altscreen', function() line7 | line8 | {1: } | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) feed('<c-\\><c-n>gg') screen:expect([[ @@ -86,7 +88,7 @@ describe('terminal altscreen', function() line15 | line16 | {1: } | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) end) @@ -116,7 +118,7 @@ describe('terminal altscreen', function() | rows: 4, cols: 50 | {1: } | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) end @@ -149,7 +151,7 @@ describe('terminal altscreen', function() line5 | line6 | line7 | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) end) end) diff --git a/test/functional/terminal/buffer_spec.lua b/test/functional/terminal/buffer_spec.lua index 8a535d6864..427aa011e9 100644 --- a/test/functional/terminal/buffer_spec.lua +++ b/test/functional/terminal/buffer_spec.lua @@ -5,6 +5,7 @@ local wait = helpers.wait local eval, execute, source = helpers.eval, helpers.execute, helpers.source local eq, neq = helpers.eq, helpers.neq +if helpers.pending_win32(pending) then return end describe('terminal buffer', function() local screen @@ -21,11 +22,11 @@ describe('terminal buffer', function() feed('<c-\\><c-n>:set bufhidden=wipe<cr>:enew<cr>') screen:expect([[ ^ | - ~ | - ~ | - ~ | - ~ | - ~ | + {4:~ }| + {4:~ }| + {4:~ }| + {4:~ }| + {4:~ }| :enew | ]]) end) @@ -34,11 +35,11 @@ describe('terminal buffer', function() feed(':bnext:l<esc>') screen:expect([[ ^ | - ~ | - ~ | - ~ | - ~ | - ~ | + {4:~ }| + {4:~ }| + {4:~ }| + {4:~ }| + {4:~ }| | ]]) end) @@ -78,7 +79,7 @@ describe('terminal buffer', function() | | ^ | - E21: Cannot make changes, 'modifiable' is off | + {8:E21: Cannot make changes, 'modifiable' is off} | ]]) end) @@ -138,21 +139,21 @@ describe('terminal buffer', function() feed('<c-\\><c-n>:bd!<cr>') screen:expect([[ ^ | - ~ | - ~ | - ~ | - ~ | - ~ | + {4:~ }| + {4:~ }| + {4:~ }| + {4:~ }| + {4:~ }| :bd! | ]]) execute('bnext') screen:expect([[ ^ | - ~ | - ~ | - ~ | - ~ | - ~ | + {4:~ }| + {4:~ }| + {4:~ }| + {4:~ }| + {4:~ }| :bnext | ]]) end) @@ -180,8 +181,8 @@ describe('terminal buffer', function() -- We should be in a new buffer now. screen:expect([[ ab^c | - ~ | - ========== | + {4:~ }| + {5:========== }| rows: 2, cols: 50 | {2: } | {1:========== }| diff --git a/test/functional/terminal/cursor_spec.lua b/test/functional/terminal/cursor_spec.lua index 461ddd0ec7..1953022a7a 100644 --- a/test/functional/terminal/cursor_spec.lua +++ b/test/functional/terminal/cursor_spec.lua @@ -6,6 +6,7 @@ local nvim_dir, execute = helpers.nvim_dir, helpers.execute local hide_cursor = thelpers.hide_cursor local show_cursor = thelpers.show_cursor +if helpers.pending_win32(pending) then return end describe('terminal cursor', function() local screen @@ -25,7 +26,7 @@ describe('terminal cursor', function() | | | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) end) @@ -49,12 +50,12 @@ describe('terminal cursor', function() it('is positioned correctly when unfocused', function() screen:expect([[ - 1 tty ready | - 2 {2: } | - 3 | - 4 | - 5 | - 6 ^ | + {7: 1 }tty ready | + {7: 2 }{2: } | + {7: 3 } | + {7: 4 } | + {7: 5 } | + {7: 6 }^ | :set number | ]]) end) @@ -83,7 +84,7 @@ describe('terminal cursor', function() | | | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) show_cursor() screen:expect([[ @@ -93,7 +94,7 @@ describe('terminal cursor', function() | | | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) -- same for when the terminal is unfocused feed('<c-\\><c-n>') @@ -132,16 +133,10 @@ describe('cursor with customized highlighting', function() screen = Screen.new(50, 7) screen:set_default_attr_ids({ [1] = {foreground = 45, background = 46}, - [2] = {foreground = 55, background = 56} - }) - screen:set_default_attr_ignore({ - [1] = {bold = true}, - [2] = {foreground = 12}, - [3] = {bold = true, reverse = true}, - [5] = {background = 11}, - [6] = {foreground = 130}, + [2] = {foreground = 55, background = 56}, + [3] = {bold = true}, }) - screen:attach(false) + screen:attach({rgb=false}) execute('call termopen(["'..nvim_dir..'/tty-test"]) | startinsert') end) @@ -153,7 +148,7 @@ describe('cursor with customized highlighting', function() | | | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) feed('<c-\\><c-n>') screen:expect([[ diff --git a/test/functional/terminal/edit_spec.lua b/test/functional/terminal/edit_spec.lua index c98aef70b1..1936f70b82 100644 --- a/test/functional/terminal/edit_spec.lua +++ b/test/functional/terminal/edit_spec.lua @@ -12,7 +12,7 @@ local eq = helpers.eq describe(':edit term://*', function() local get_screen = function(columns, lines) local scr = screen.new(columns, lines) - scr:attach(false) + scr:attach({rgb=false}) return scr end diff --git a/test/functional/terminal/ex_terminal_spec.lua b/test/functional/terminal/ex_terminal_spec.lua index 458fa02fca..6f929f17e4 100644 --- a/test/functional/terminal/ex_terminal_spec.lua +++ b/test/functional/terminal/ex_terminal_spec.lua @@ -4,13 +4,15 @@ local clear, wait, nvim = helpers.clear, helpers.wait, helpers.nvim local nvim_dir, source, eq = helpers.nvim_dir, helpers.source, helpers.eq local execute, eval = helpers.execute, helpers.eval +if helpers.pending_win32(pending) then return end + describe(':terminal', function() local screen before_each(function() clear() screen = Screen.new(50, 4) - screen:attach(false) + screen:attach({rgb=false}) nvim('set_option', 'shell', nvim_dir..'/shell-test') nvim('set_option', 'shellcmdflag', 'EXE') diff --git a/test/functional/terminal/helpers.lua b/test/functional/terminal/helpers.lua index 3d1530bd90..aacf109f2f 100644 --- a/test/functional/terminal/helpers.lua +++ b/test/functional/terminal/helpers.lua @@ -44,17 +44,16 @@ local function screen_setup(extra_height, command) screen:set_default_attr_ids({ [1] = {reverse = true}, -- focused cursor [2] = {background = 11}, -- unfocused cursor - }) - screen:set_default_attr_ignore({ - [1] = {bold = true}, - [2] = {foreground = 12}, - [3] = {bold = true, reverse = true}, - [5] = {background = 11}, - [6] = {foreground = 130}, - [7] = {foreground = 15, background = 1}, -- error message + [3] = {bold = true}, + [4] = {foreground = 12}, + [5] = {bold = true, reverse = true}, + [6] = {background = 11}, + [7] = {foreground = 130}, + [8] = {foreground = 15, background = 1}, -- error message + [9] = {foreground = 4}, }) - screen:attach(false) + screen:attach({rgb=false}) -- tty-test puts the terminal into raw mode and echoes all input. tests are -- done by feeding it with terminfo codes to control the display and -- verifying output with screen:expect. @@ -76,7 +75,7 @@ local function screen_setup(extra_height, command) table.insert(expected, empty_line) end - table.insert(expected, '-- TERMINAL -- ') + table.insert(expected, '{3:-- TERMINAL --} ') screen:expect(table.concat(expected, '\n')) else wait() diff --git a/test/functional/terminal/highlight_spec.lua b/test/functional/terminal/highlight_spec.lua index 8d7c7451d3..377f335c5c 100644 --- a/test/functional/terminal/highlight_spec.lua +++ b/test/functional/terminal/highlight_spec.lua @@ -5,6 +5,7 @@ local feed, clear, nvim = helpers.feed, helpers.clear, helpers.nvim local nvim_dir, execute = helpers.nvim_dir, helpers.execute local eq, eval = helpers.eq, helpers.eval +if helpers.pending_win32(pending) then return end describe('terminal window highlighting', function() local screen @@ -16,33 +17,32 @@ describe('terminal window highlighting', function() [1] = {foreground = 45}, [2] = {background = 46}, [3] = {foreground = 45, background = 46}, - [4] = {bold = true, italic = true, underline = true} - }) - screen:set_default_attr_ignore({ - [1] = {bold = true}, - [2] = {foreground = 12}, - [3] = {bold = true, reverse = true}, - [5] = {background = 11}, - [6] = {foreground = 130}, - [7] = {reverse = true}, + [4] = {bold = true, italic = true, underline = true}, + [5] = {bold = true}, + [6] = {foreground = 12}, + [7] = {bold = true, reverse = true}, [8] = {background = 11}, + [9] = {foreground = 130}, + [10] = {reverse = true}, + [11] = {background = 11}, }) - screen:attach(false) + screen:attach({rgb=false}) execute('enew | call termopen(["'..nvim_dir..'/tty-test"]) | startinsert') screen:expect([[ tty ready | + {10: } | | | | | - | - -- TERMINAL -- | + {5:-- TERMINAL --} | ]]) end) local function descr(title, attr_num, set_attrs_fn) local function sub(s) - return s:gsub('NUM', attr_num) + local str = s:gsub('NUM', attr_num) + return str end describe(title, function() @@ -54,16 +54,15 @@ describe('terminal window highlighting', function() end) local function pass_attrs() - local s = sub([[ + screen:expect(sub([[ tty ready | - {NUM:text}text | + {NUM:text}text{10: } | | | | | - -- TERMINAL -- | - ]]) - screen:expect(s) + {5:-- TERMINAL --} | + ]])) end it('will pass the corresponding attributes', pass_attrs) @@ -82,11 +81,11 @@ describe('terminal window highlighting', function() line6 | line7 | line8 | - | - -- TERMINAL -- | + {10: } | + {5:-- TERMINAL --} | ]]) feed('<c-\\><c-n>gg') - local s = sub([[ + screen:expect(sub([[ ^tty ready | {NUM:text}textline1 | line2 | @@ -94,8 +93,7 @@ describe('terminal window highlighting', function() line4 | line5 | | - ]]) - screen:expect(s) + ]])) end) end) end @@ -121,28 +119,26 @@ describe('terminal window highlighting with custom palette', function() clear() screen = Screen.new(50, 7) screen:set_default_attr_ids({ - [1] = {foreground = 1193046, special = Screen.colors.Black} - }) - screen:set_default_attr_ignore({ - [1] = {bold = true}, + [1] = {foreground = 1193046, special = Screen.colors.Black}, [2] = {foreground = 12}, [3] = {bold = true, reverse = true}, [5] = {background = 11}, [6] = {foreground = 130}, [7] = {reverse = true}, [8] = {background = 11}, + [9] = {bold = true}, }) - screen:attach(true) + screen:attach({rgb=true}) nvim('set_var', 'terminal_color_3', '#123456') execute('enew | call termopen(["'..nvim_dir..'/tty-test"]) | startinsert') screen:expect([[ tty ready | + {7: } | | | | | - | - -- TERMINAL -- | + {9:-- TERMINAL --} | ]]) end) @@ -153,12 +149,12 @@ describe('terminal window highlighting with custom palette', function() thelpers.feed_data('text') screen:expect([[ tty ready | - {1:text}text | + {1:text}text{7: } | | | | | - -- TERMINAL -- | + {9:-- TERMINAL --} | ]]) end) end) @@ -176,8 +172,8 @@ describe('synIDattr()', function() it('returns cterm-color if RGB-capable UI is _not_ attached', function() eq('252', eval('synIDattr(hlID("Normal"), "fg")')) eq('252', eval('synIDattr(hlID("Normal"), "fg#")')) - eq('-1', eval('synIDattr(hlID("Normal"), "bg")')) - eq('-1', eval('synIDattr(hlID("Normal"), "bg#")')) + eq('', eval('synIDattr(hlID("Normal"), "bg")')) + eq('', eval('synIDattr(hlID("Normal"), "bg#")')) eq('79', eval('synIDattr(hlID("Keyword"), "fg")')) eq('79', eval('synIDattr(hlID("Keyword"), "fg#")')) eq('', eval('synIDattr(hlID("Keyword"), "sp")')) @@ -190,7 +186,7 @@ describe('synIDattr()', function() end) it('returns gui-color if RGB-capable UI is attached', function() - screen:attach(true) + screen:attach({rgb=true}) eq('#ff0000', eval('synIDattr(hlID("Normal"), "fg")')) eq('Black', eval('synIDattr(hlID("Normal"), "bg")')) eq('Salmon', eval('synIDattr(hlID("Keyword"), "fg")')) @@ -198,16 +194,66 @@ describe('synIDattr()', function() end) it('returns #RRGGBB value for fg#/bg#/sp#', function() - screen:attach(true) - eq('#ff0000', eval('synIDattr(hlID("Normal"), "fg#")')) - eq('#000000', eval('synIDattr(hlID("Normal"), "bg#")')) + screen:attach({rgb=true}) + eq('#ff0000', eval('synIDattr(hlID("Normal"), "fg#")')) + eq('#000000', eval('synIDattr(hlID("Normal"), "bg#")')) eq('#fa8072', eval('synIDattr(hlID("Keyword"), "fg#")')) eq('#800000', eval('synIDattr(hlID("Keyword"), "sp#")')) end) it('returns color number if non-GUI', function() - screen:attach(false) + screen:attach({rgb=false}) eq('252', eval('synIDattr(hlID("Normal"), "fg")')) eq('79', eval('synIDattr(hlID("Keyword"), "fg")')) end) end) + +describe('fg/bg special colors', function() + local screen + before_each(function() + clear() + screen = Screen.new(50, 7) + execute('highlight Normal ctermfg=145 ctermbg=16 guifg=#ff0000 guibg=Black') + execute('highlight Visual ctermfg=bg ctermbg=fg guifg=bg guibg=fg guisp=bg') + end) + + it('resolve to "Normal" values', function() + eq(eval('synIDattr(hlID("Normal"), "bg")'), + eval('synIDattr(hlID("Visual"), "fg")')) + eq(eval('synIDattr(hlID("Normal"), "bg#")'), + eval('synIDattr(hlID("Visual"), "fg#")')) + eq(eval('synIDattr(hlID("Normal"), "fg")'), + eval('synIDattr(hlID("Visual"), "bg")')) + eq(eval('synIDattr(hlID("Normal"), "fg#")'), + eval('synIDattr(hlID("Visual"), "bg#")')) + eq('bg', eval('synIDattr(hlID("Visual"), "fg", "gui")')) + eq('bg', eval('synIDattr(hlID("Visual"), "fg#", "gui")')) + eq('fg', eval('synIDattr(hlID("Visual"), "bg", "gui")')) + eq('fg', eval('synIDattr(hlID("Visual"), "bg#", "gui")')) + eq('bg', eval('synIDattr(hlID("Visual"), "sp", "gui")')) + eq('bg', eval('synIDattr(hlID("Visual"), "sp#", "gui")')) + end) + + it('resolve to "Normal" values in RGB-capable UI', function() + screen:attach({rgb=true}) + eq('bg', eval('synIDattr(hlID("Visual"), "fg")')) + eq(eval('synIDattr(hlID("Normal"), "bg#")'), + eval('synIDattr(hlID("Visual"), "fg#")')) + eq('fg', eval('synIDattr(hlID("Visual"), "bg")')) + eq(eval('synIDattr(hlID("Normal"), "fg#")'), + eval('synIDattr(hlID("Visual"), "bg#")')) + eq('bg', eval('synIDattr(hlID("Visual"), "sp")')) + eq(eval('synIDattr(hlID("Normal"), "bg#")'), + eval('synIDattr(hlID("Visual"), "sp#")')) + end) + + it('resolve after the "Normal" group is modified', function() + screen:attach({rgb=true}) + local new_guibg = '#282c34' + local new_guifg = '#abb2bf' + execute('highlight Normal guifg='..new_guifg..' guibg='..new_guibg) + eq(new_guibg, eval('synIDattr(hlID("Visual"), "fg#")')) + eq(new_guifg, eval('synIDattr(hlID("Visual"), "bg#")')) + eq(new_guibg, eval('synIDattr(hlID("Visual"), "sp#")')) + end) +end) diff --git a/test/functional/terminal/mouse_spec.lua b/test/functional/terminal/mouse_spec.lua index a86615184d..ecb0b2beb0 100644 --- a/test/functional/terminal/mouse_spec.lua +++ b/test/functional/terminal/mouse_spec.lua @@ -4,6 +4,8 @@ local clear = helpers.clear local feed, nvim = helpers.feed, helpers.nvim local feed_data = thelpers.feed_data +if helpers.pending_win32(pending) then return end + describe('terminal mouse', function() local screen @@ -27,7 +29,7 @@ describe('terminal mouse', function() line29 | line30 | {1: } | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) end) @@ -74,7 +76,7 @@ describe('terminal mouse', function() line30 | mouse enabled | {1: } | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) end) @@ -87,7 +89,7 @@ describe('terminal mouse', function() line30 | mouse enabled | "#{1: } | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) end) @@ -100,7 +102,7 @@ describe('terminal mouse', function() line30 | mouse enabled | `!!{1: } | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) end) end) @@ -119,79 +121,79 @@ describe('terminal mouse', function() ]]) feed(':enew | set number<cr>') screen:expect([[ - 1 ^ |line28 | - ~ |line29 | - ~ |line30 | - ~ |rows: 5, cols: 25 | - ~ |{2: } | + {7: 1 }^ |line28 | + {4:~ }|line29 | + {4:~ }|line30 | + {4:~ }|rows: 5, cols: 25 | + {4:~ }|{2: } | ========== ========== | :enew | set number | ]]) feed('30iline\n<esc>') screen:expect([[ - 27 line |line28 | - 28 line |line29 | - 29 line |line30 | - 30 line |rows: 5, cols: 25 | - 31 ^ |{2: } | + {7: 27 }line |line28 | + {7: 28 }line |line29 | + {7: 29 }line |line30 | + {7: 30 }line |rows: 5, cols: 25 | + {7: 31 }^ |{2: } | ========== ========== | | ]]) feed('<c-w>li') screen:expect([[ - 27 line |line29 | - 28 line |line30 | - 29 line |rows: 5, cols: 25 | - 30 line |rows: 5, cols: 24 | - 31 |{1: } | + {7: 27 }line |line29 | + {7: 28 }line |line30 | + {7: 29 }line |rows: 5, cols: 25 | + {7: 30 }line |rows: 5, cols: 24 | + {7: 31 } |{1: } | ========== ========== | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) -- enabling mouse won't affect interaction with other windows thelpers.enable_mouse() thelpers.feed_data('mouse enabled\n') screen:expect([[ - 27 line |line30 | - 28 line |rows: 5, cols: 25 | - 29 line |rows: 5, cols: 24 | - 30 line |mouse enabled | - 31 |{1: } | + {7: 27 }line |line30 | + {7: 28 }line |rows: 5, cols: 25 | + {7: 29 }line |rows: 5, cols: 24 | + {7: 30 }line |mouse enabled | + {7: 31 } |{1: } | ========== ========== | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) end) it('wont lose focus if another window is scrolled', function() feed('<MouseDown><0,0><MouseDown><0,0>') screen:expect([[ - 21 line |line30 | - 22 line |rows: 5, cols: 25 | - 23 line |rows: 5, cols: 24 | - 24 line |mouse enabled | - 25 line |{1: } | + {7: 21 }line |line30 | + {7: 22 }line |rows: 5, cols: 25 | + {7: 23 }line |rows: 5, cols: 24 | + {7: 24 }line |mouse enabled | + {7: 25 }line |{1: } | ========== ========== | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) feed('<S-MouseUp><0,0>') screen:expect([[ - 26 line |line30 | - 27 line |rows: 5, cols: 25 | - 28 line |rows: 5, cols: 24 | - 29 line |mouse enabled | - 30 line |{1: } | + {7: 26 }line |line30 | + {7: 27 }line |rows: 5, cols: 25 | + {7: 28 }line |rows: 5, cols: 24 | + {7: 29 }line |mouse enabled | + {7: 30 }line |{1: } | ========== ========== | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) end) it('will lose focus if another window is clicked', function() feed('<LeftMouse><5,1>') screen:expect([[ - 27 line |line30 | - 28 l^ine |rows: 5, cols: 25 | - 29 line |rows: 5, cols: 24 | - 30 line |mouse enabled | - 31 |{2: } | + {7: 27 }line |line30 | + {7: 28 }l^ine |rows: 5, cols: 25 | + {7: 29 }line |rows: 5, cols: 24 | + {7: 30 }line |mouse enabled | + {7: 31 } |{2: } | ========== ========== | | ]]) diff --git a/test/functional/terminal/scrollback_spec.lua b/test/functional/terminal/scrollback_spec.lua index 7914e30a44..d60819af65 100644 --- a/test/functional/terminal/scrollback_spec.lua +++ b/test/functional/terminal/scrollback_spec.lua @@ -6,6 +6,8 @@ local feed, nvim_dir, execute = helpers.feed, helpers.nvim_dir, helpers.execute local wait = helpers.wait local feed_data = thelpers.feed_data +if helpers.pending_win32(pending) then return end + describe('terminal scrollback', function() local screen @@ -33,7 +35,7 @@ describe('terminal scrollback', function() line29 | line30 | {1: } | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) end) @@ -61,7 +63,7 @@ describe('terminal scrollback', function() line3 | line4 | {1: } | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) end) @@ -76,7 +78,7 @@ describe('terminal scrollback', function() line4 | line5 | {1: } | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) eq(7, curbuf('line_count')) end) @@ -92,7 +94,7 @@ describe('terminal scrollback', function() line6 | line7 | line8{1: } | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) feed('<c-\\><c-n>6k') @@ -141,7 +143,7 @@ describe('terminal scrollback', function() line4 | rows: 5, cols: 50 | {1: } | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) end @@ -158,7 +160,7 @@ describe('terminal scrollback', function() rows: 5, cols: 50 | rows: 3, cols: 50 | {1: } | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) eq(8, curbuf('line_count')) feed('<c-\\><c-n>3k') @@ -185,7 +187,7 @@ describe('terminal scrollback', function() rows: 4, cols: 50 | {1: } | | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) eq(4, curbuf('line_count')) end @@ -203,7 +205,7 @@ describe('terminal scrollback', function() rows: 4, cols: 50 | rows: 3, cols: 50 | {1: } | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) eq(4, curbuf('line_count')) feed('<c-\\><c-n>gg') @@ -218,7 +220,7 @@ describe('terminal scrollback', function() rows: 4, cols: 50 | rows: 3, cols: 50 | {1: } | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) end) end) @@ -235,14 +237,14 @@ describe('terminal scrollback', function() line3 | line4 | {1: } | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) screen:try_resize(screen._width, screen._height - 3) screen:expect([[ line4 | rows: 3, cols: 50 | {1: } | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) eq(7, curbuf('line_count')) end) @@ -255,7 +257,7 @@ describe('terminal scrollback', function() rows: 3, cols: 50 | rows: 4, cols: 50 | {1: } | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) end @@ -277,7 +279,7 @@ describe('terminal scrollback', function() rows: 4, cols: 50 | rows: 7, cols: 50 | {1: } | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) eq(9, curbuf('line_count')) feed('<c-\\><c-n>gg') @@ -315,7 +317,7 @@ describe('terminal scrollback', function() rows: 11, cols: 50 | {1: } | | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) -- since there's an empty line after the cursor, the buffer line -- count equals the terminal screen height @@ -331,7 +333,7 @@ describe('terminal prints more lines than the screen height and exits', function it('will push extra lines to scrollback', function() clear() local screen = Screen.new(50, 7) - screen:attach(false) + screen:attach({rgb=false}) execute('call termopen(["'..nvim_dir..'/tty-test", "10"]) | startinsert') wait() screen:expect([[ diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua index e6586c7892..27f00e8550 100644 --- a/test/functional/terminal/tui_spec.lua +++ b/test/functional/terminal/tui_spec.lua @@ -6,6 +6,8 @@ local feed = thelpers.feed_data local execute = helpers.execute local nvim_dir = helpers.nvim_dir +if helpers.pending_win32(pending) then return end + describe('tui', function() local screen @@ -17,12 +19,12 @@ describe('tui', function() screen.timeout = 60000 screen:expect([[ {1: } | - ~ | - ~ | - ~ | - [No Name] | + {4:~ }| + {4:~ }| + {4:~ }| + {5:[No Name] }| | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) end) @@ -36,20 +38,20 @@ describe('tui', function() abc | test1 | test2{1: } | - ~ | - [No Name] [+] | - -- INSERT -- | - -- TERMINAL -- | + {4:~ }| + {5:[No Name] [+] }| + {3:-- INSERT --} | + {3:-- TERMINAL --} | ]]) feed('\027') screen:expect([[ abc | test1 | test{1:2} | - ~ | - [No Name] [+] | + {4:~ }| + {5:[No Name] [+] }| | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) end) @@ -64,9 +66,9 @@ describe('tui', function() alt-k | alt-l | {1: } | - [No Name] [+] | + {5:[No Name] [+] }| | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) feed('gg') screen:expect([[ @@ -74,9 +76,9 @@ describe('tui', function() alt-f | alt-g | alt-h | - [No Name] [+] | + {5:[No Name] [+] }| | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) end) @@ -90,12 +92,12 @@ describe('tui', function() feed('i\027j') screen:expect([[ j{1: } | - ~ | - ~ | - ~ | - [No Name] [+] | - -- INSERT -- | - -- TERMINAL -- | + {4:~ }| + {4:~ }| + {4:~ }| + {5:[No Name] [+] }| + {3:-- INSERT --} | + {3:-- TERMINAL --} | ]]) end) @@ -105,46 +107,46 @@ describe('tui', function() feed('\022\022') -- ctrl+v feed('\022\013') -- ctrl+m screen:expect([[ - {3:^G^V^M}{1: } | - ~ | - ~ | - ~ | - [No Name] [+] | - -- INSERT -- | - -- TERMINAL -- | - ]], {[1] = {reverse = true}, [2] = {background = 11}, [3] = {foreground = 4}}) + {9:^G^V^M}{1: } | + {4:~ }| + {4:~ }| + {4:~ }| + {5:[No Name] [+] }| + {3:-- INSERT --} | + {3:-- TERMINAL --} | + ]]) end) it('automatically sends <Paste> for bracketed paste sequences', function() feed('i\027[200~') screen:expect([[ {1: } | - ~ | - ~ | - ~ | - [No Name] | - -- INSERT (paste) -- | - -- TERMINAL -- | + {4:~ }| + {4:~ }| + {4:~ }| + {5:[No Name] }| + {3:-- INSERT (paste) --} | + {3:-- TERMINAL --} | ]]) feed('pasted from terminal') screen:expect([[ pasted from terminal{1: } | - ~ | - ~ | - ~ | - [No Name] [+] | - -- INSERT (paste) -- | - -- TERMINAL -- | + {4:~ }| + {4:~ }| + {4:~ }| + {5:[No Name] [+] }| + {3:-- INSERT (paste) --} | + {3:-- TERMINAL --} | ]]) feed('\027[201~') screen:expect([[ pasted from terminal{1: } | - ~ | - ~ | - ~ | - [No Name] [+] | - -- INSERT -- | - -- TERMINAL -- | + {4:~ }| + {4:~ }| + {4:~ }| + {5:[No Name] [+] }| + {3:-- INSERT --} | + {3:-- TERMINAL --} | ]]) end) @@ -160,9 +162,9 @@ describe('tui', function() item 2998 | item 2999 | item 3000{1: } | - [No Name] [+] 3000,10 Bot| - -- INSERT -- | - -- TERMINAL -- | + {5:[No Name] [+] 3000,10 Bot}| + {3:-- INSERT --} | + {3:-- TERMINAL --} | ]]) end) end) @@ -176,17 +178,15 @@ describe('tui with non-tty file descriptors', function() it('can handle pipes as stdout and stderr', function() local screen = thelpers.screen_setup(0, '"'..helpers.nvim_prog..' -u NONE -i NONE --cmd \'set noswapfile\' --cmd \'normal iabc\' > /dev/null 2>&1 && cat testF && rm testF"') - screen:set_default_attr_ids({}) - screen:set_default_attr_ignore(true) feed(':w testF\n:q\n') screen:expect([[ :w testF | :q | abc | | - [Process exited 0] | + [Process exited 0]{1: } | | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) end) end) @@ -205,23 +205,23 @@ describe('tui focus event handling', function() feed('\027[I') screen:expect([[ {1: } | - ~ | - ~ | - ~ | - [No Name] | + {4:~ }| + {4:~ }| + {4:~ }| + {5:[No Name] }| gained | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) feed('\027[O') screen:expect([[ {1: } | - ~ | - ~ | - ~ | - [No Name] | + {4:~ }| + {4:~ }| + {4:~ }| + {5:[No Name] }| lost | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) end) @@ -231,22 +231,22 @@ describe('tui focus event handling', function() feed('\027[I') screen:expect([[ {1: } | - ~ | - ~ | - ~ | - [No Name] | + {4:~ }| + {4:~ }| + {4:~ }| + {5:[No Name] }| gained | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) feed('\027[O') screen:expect([[ {1: } | - ~ | - ~ | - ~ | - [No Name] | + {4:~ }| + {4:~ }| + {4:~ }| + {5:[No Name] }| lost | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) end) @@ -255,22 +255,22 @@ describe('tui focus event handling', function() feed('\027[I') screen:expect([[ | - ~ | - ~ | - ~ | - [No Name] | + {4:~ }| + {4:~ }| + {4:~ }| + {5:[No Name] }| g{1:a}ined | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) feed('\027[O') screen:expect([[ | - ~ | - ~ | - ~ | - [No Name] | + {4:~ }| + {4:~ }| + {4:~ }| + {5:[No Name] }| l{1:o}st | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) end) @@ -287,7 +287,7 @@ describe('tui focus event handling', function() | | gained | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) feed('\027[O') screen:expect([[ @@ -297,7 +297,7 @@ describe('tui focus event handling', function() | | lost | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) end) end) @@ -319,15 +319,21 @@ describe("tui 't_Co' (terminal colors)", function() helpers.nvim_prog)) thelpers.feed_data(":echo &t_Co\n") + local tline + if maxcolors == 8 then + tline = "~ " + else + tline = "{4:~ }" + end screen:expect(string.format([[ {1: } | - ~ | - ~ | - ~ | - [No Name] | + %s| + %s| + %s| + {5:[No Name] }| %-3s | - -- TERMINAL -- | - ]], tostring(maxcolors and maxcolors or ""))) + {3:-- TERMINAL --} | + ]], tline, tline, tline, tostring(maxcolors and maxcolors or ""))) end it("unknown TERM sets empty 't_Co'", function() diff --git a/test/functional/terminal/window_spec.lua b/test/functional/terminal/window_spec.lua index eec8b53f4d..70c234d897 100644 --- a/test/functional/terminal/window_spec.lua +++ b/test/functional/terminal/window_spec.lua @@ -4,6 +4,8 @@ local feed, clear = helpers.feed, helpers.clear local wait = helpers.wait local execute = helpers.execute +if helpers.pending_win32(pending) then return end + describe('terminal window', function() local screen @@ -52,7 +54,7 @@ describe('terminal window', function() | | | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) end) end) @@ -68,7 +70,7 @@ describe('terminal window', function() line3 | line4 | {1: } | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) end) diff --git a/test/functional/terminal/window_split_tab_spec.lua b/test/functional/terminal/window_split_tab_spec.lua index 644060103a..6951b84a69 100644 --- a/test/functional/terminal/window_split_tab_spec.lua +++ b/test/functional/terminal/window_split_tab_spec.lua @@ -4,6 +4,8 @@ local clear = helpers.clear local feed, nvim = helpers.feed, helpers.nvim local execute = helpers.execute +if helpers.pending_win32(pending) then return end + describe('terminal', function() local screen @@ -32,8 +34,8 @@ describe('terminal', function() tty ready | rows: 2, cols: 50 | {2: } | - ~ | - ~ | + {4:~ }| + {4:~ }| ========== | | ]]) @@ -58,8 +60,8 @@ describe('terminal', function() rows: 5, cols: 50 | rows: 2, cols: 50 | {2: } | - ~ | - ~ | + {4:~ }| + {4:~ }| ========== | :wincmd p | ]]) @@ -83,7 +85,7 @@ describe('terminal', function() | | | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) screen:try_resize(screen._width - 6, screen._height - 10) screen:expect([[ @@ -91,7 +93,7 @@ describe('terminal', function() rows: 14, cols: 53 | rows: 4, cols: 47 | {1: } | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) end) end) diff --git a/test/functional/ui/bufhl_spec.lua b/test/functional/ui/bufhl_spec.lua index f91aa8d402..53fe303762 100644 --- a/test/functional/ui/bufhl_spec.lua +++ b/test/functional/ui/bufhl_spec.lua @@ -3,37 +3,29 @@ local Screen = require('test.functional.ui.screen') local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert local execute, request, neq = helpers.execute, helpers.request, helpers.neq +if helpers.pending_win32(pending) then return end describe('Buffer highlighting', function() local screen local curbuf - local hl_colors = { - NonText = Screen.colors.Blue, - Question = Screen.colors.SeaGreen, - String = Screen.colors.Fuchsia, - Statement = Screen.colors.Brown, - Special = Screen.colors.SlateBlue, - Identifier = Screen.colors.DarkCyan - } - before_each(function() clear() execute("syntax on") screen = Screen.new(40, 8) screen:attach() - screen:set_default_attr_ignore( {{bold=true, foreground=hl_colors.NonText}} ) screen:set_default_attr_ids({ - [1] = {foreground = hl_colors.String}, - [2] = {foreground = hl_colors.Statement, bold = true}, - [3] = {foreground = hl_colors.Special}, - [4] = {bold = true, foreground = hl_colors.Special}, - [5] = {foreground = hl_colors.Identifier}, - [6] = {bold = true}, - [7] = {underline = true, bold = true, foreground = hl_colors.Special}, - [8] = {foreground = hl_colors.Special, underline = true} + [1] = {bold=true, foreground=Screen.colors.Blue}, + [2] = {foreground = Screen.colors.Fuchsia}, -- String + [3] = {foreground = Screen.colors.Brown, bold = true}, -- Statement + [4] = {foreground = Screen.colors.SlateBlue}, -- Special + [5] = {bold = true, foreground = Screen.colors.SlateBlue}, + [6] = {foreground = Screen.colors.DarkCyan}, -- Identifier + [7] = {bold = true}, + [8] = {underline = true, bold = true, foreground = Screen.colors.SlateBlue}, + [9] = {foreground = Screen.colors.SlateBlue, underline = true} }) - curbuf = request('vim_get_current_buffer') + curbuf = request('nvim_get_current_buf') end) after_each(function() @@ -41,11 +33,11 @@ describe('Buffer highlighting', function() end) local function add_hl(...) - return request('buffer_add_highlight', curbuf, ...) + return request('nvim_buf_add_highlight', curbuf, ...) end local function clear_hl(...) - return request('buffer_clear_highlight', curbuf, ...) + return request('nvim_buf_clear_highlight', curbuf, ...) end @@ -58,11 +50,11 @@ describe('Buffer highlighting', function() screen:expect([[ these are some lines | with colorful tex^t | - ~ | - ~ | - ~ | - ~ | - ~ | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| | ]]) @@ -70,25 +62,25 @@ describe('Buffer highlighting', function() add_hl(-1, "Statement", 1 , 5, -1) screen:expect([[ - these are {1:some} lines | - with {2:colorful tex^t} | - ~ | - ~ | - ~ | - ~ | - ~ | + these are {2:some} lines | + with {3:colorful tex^t} | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| | ]]) feed("ggo<esc>") screen:expect([[ - these are {1:some} lines | + these are {2:some} lines | ^ | - with {2:colorful text} | - ~ | - ~ | - ~ | - ~ | + with {3:colorful text} | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| | ]]) @@ -97,10 +89,10 @@ describe('Buffer highlighting', function() these are some lines | ^ | with colorful text | - ~ | - ~ | - ~ | - ~ | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| | ]]) end) @@ -120,21 +112,25 @@ describe('Buffer highlighting', function() add_hl(id1, "ImportantWord", 2, 0, 9) add_hl(id1, "ImportantWord", 3, 5, 14) - id2 = add_hl(0, "Special", 0, 2, 8) + -- add_highlight can be called like this to get a new source + -- without adding any highlight + id2 = add_hl(0, "", 0, 0, 0) + neq(id1, id2) + + add_hl(id2, "Special", 0, 2, 8) add_hl(id2, "Identifier", 1, 3, 8) add_hl(id2, "Special", 1, 14, 20) add_hl(id2, "Underlined", 2, 6, 12) add_hl(id2, "Underlined", 3, 0, 9) - neq(id1, id2) screen:expect([[ - a {4:longer} example | - in {5:order} to {6:de}{4:monstr}{6:ate} | - {6:combin}{7:ing}{8: hi}ghlights | - {8:from }{7:diff}{6:erent} source^s | - ~ | - ~ | - ~ | + a {5:longer} example | + in {6:order} to {7:de}{5:monstr}{7:ate} | + {7:combin}{8:ing}{9: hi}ghlights | + {9:from }{8:diff}{7:erent} source^s | + {1:~ }| + {1:~ }| + {1:~ }| :hi ImportantWord gui=bold cterm=bold | ]]) end) @@ -142,13 +138,13 @@ describe('Buffer highlighting', function() it('and clearing the first added', function() clear_hl(id1, 0, -1) screen:expect([[ - a {3:longer} example | - in {5:order} to de{3:monstr}ate | - combin{8:ing hi}ghlights | - {8:from diff}erent source^s | - ~ | - ~ | - ~ | + a {4:longer} example | + in {6:order} to de{4:monstr}ate | + combin{9:ing hi}ghlights | + {9:from diff}erent source^s | + {1:~ }| + {1:~ }| + {1:~ }| :hi ImportantWord gui=bold cterm=bold | ]]) end) @@ -156,13 +152,13 @@ describe('Buffer highlighting', function() it('and clearing the second added', function() clear_hl(id2, 0, -1) screen:expect([[ - a {6:longer} example | - in order to {6:demonstrate} | - {6:combining} highlights | - from {6:different} source^s | - ~ | - ~ | - ~ | + a {7:longer} example | + in order to {7:demonstrate} | + {7:combining} highlights | + from {7:different} source^s | + {1:~ }| + {1:~ }| + {1:~ }| :hi ImportantWord gui=bold cterm=bold | ]]) end) @@ -173,12 +169,12 @@ describe('Buffer highlighting', function() clear_hl(id2, 2, -1) screen:expect([[ a longer example | - in {5:order} to de{3:monstr}ate | - {6:combining} highlights | - from {6:different} source^s | - ~ | - ~ | - ~ | + in {6:order} to de{4:monstr}ate | + {7:combining} highlights | + from {7:different} source^s | + {1:~ }| + {1:~ }| + {1:~ }| :hi ImportantWord gui=bold cterm=bold | ]]) end) @@ -186,25 +182,25 @@ describe('Buffer highlighting', function() it('and renumbering lines', function() feed('3Gddggo<esc>') screen:expect([[ - a {4:longer} example | + a {5:longer} example | ^ | - in {5:order} to {6:de}{4:monstr}{6:ate} | - {8:from }{7:diff}{6:erent} sources | - ~ | - ~ | - ~ | + in {6:order} to {7:de}{5:monstr}{7:ate} | + {9:from }{8:diff}{7:erent} sources | + {1:~ }| + {1:~ }| + {1:~ }| | ]]) execute(':3move 4') screen:expect([[ - a {4:longer} example | + a {5:longer} example | | - {8:from }{7:diff}{6:erent} sources | - ^in {5:order} to {6:de}{4:monstr}{6:ate} | - ~ | - ~ | - ~ | + {9:from }{8:diff}{7:erent} sources | + ^in {6:order} to {7:de}{5:monstr}{7:ate} | + {1:~ }| + {1:~ }| + {1:~ }| ::3move 4 | ]]) end) @@ -218,25 +214,25 @@ describe('Buffer highlighting', function() local id = add_hl(0, "Special", 0, 0, 9) screen:expect([[ - {3:three ove}{5:rlapp}{1:ing color}^s | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | + {4:three ove}{6:rlapp}{2:ing color}^s | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| | ]]) clear_hl(id, 0, 1) screen:expect([[ - three {5:overlapp}{1:ing color}^s | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | + three {6:overlapp}{2:ing color}^s | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| | ]]) end) @@ -248,13 +244,13 @@ describe('Buffer highlighting', function() add_hl(-1, "String", 0, 16, 21) screen:expect([[ - Ta {5:båten} över {1:sjön}^! | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | + Ta {6:båten} över {2:sjön}^! | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| | ]]) end) diff --git a/test/functional/ui/highlight_spec.lua b/test/functional/ui/highlight_spec.lua index 6ef40fff62..945b16ef92 100644 --- a/test/functional/ui/highlight_spec.lua +++ b/test/functional/ui/highlight_spec.lua @@ -4,6 +4,7 @@ local os = require('os') local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert local execute, request, eq = helpers.execute, helpers.request, helpers.eq +if helpers.pending_win32(pending) then return end describe('color scheme compatibility', function() before_each(function() @@ -12,7 +13,7 @@ describe('color scheme compatibility', function() it('t_Co is set to 256 by default', function() eq('256', request('vim_eval', '&t_Co')) - request('vim_set_option', 't_Co', '88') + request('nvim_set_option', 't_Co', '88') eq('88', request('vim_eval', '&t_Co')) end) end) @@ -27,10 +28,11 @@ describe('manual syntax highlight', function() clear() screen = Screen.new(20,5) screen:attach() - --ignore highligting of ~-lines - screen:set_default_attr_ignore( {{bold=true, foreground=Screen.colors.Blue}} ) --syntax highlight for vimcscripts "echo" - screen:set_default_attr_ids( {[1] = {bold=true, foreground=Screen.colors.Brown}} ) + screen:set_default_attr_ids( { + [0] = {bold=true, foreground=Screen.colors.Blue}, + [1] = {bold=true, foreground=Screen.colors.Brown} + } ) end) after_each(function() @@ -53,9 +55,9 @@ describe('manual syntax highlight', function() execute('bp') screen:expect([[ {1:^echo} 1 | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| <f 1 --100%-- col 1 | ]]) end) @@ -75,9 +77,9 @@ describe('manual syntax highlight', function() execute('bp') screen:expect([[ {1:^echo} 1 | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| <ht.tmp.vim" 1L, 7C | ]]) end) @@ -89,17 +91,10 @@ describe('Default highlight groups', function() -- command local screen - local hlgroup_colors = { - NonText = Screen.colors.Blue, - Question = Screen.colors.SeaGreen - } - before_each(function() clear() screen = Screen.new() screen:attach() - --ignore highligting of ~-lines - screen:set_default_attr_ignore( {{bold=true, foreground=hlgroup_colors.NonText}} ) end) after_each(function() @@ -108,23 +103,24 @@ describe('Default highlight groups', function() it('window status bar', function() screen:set_default_attr_ids({ + [0] = {bold=true, foreground=Screen.colors.Blue}, [1] = {reverse = true, bold = true}, -- StatusLine [2] = {reverse = true} -- StatusLineNC }) execute('sp', 'vsp', 'vsp') screen:expect([[ ^ {2:|} {2:|} | - ~ {2:|}~ {2:|}~ | - ~ {2:|}~ {2:|}~ | - ~ {2:|}~ {2:|}~ | - ~ {2:|}~ {2:|}~ | - ~ {2:|}~ {2:|}~ | + {0:~ }{2:|}{0:~ }{2:|}{0:~ }| + {0:~ }{2:|}{0:~ }{2:|}{0:~ }| + {0:~ }{2:|}{0:~ }{2:|}{0:~ }| + {0:~ }{2:|}{0:~ }{2:|}{0:~ }| + {0:~ }{2:|}{0:~ }{2:|}{0:~ }| {1:[No Name] }{2:[No Name] [No Name] }| | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| {2:[No Name] }| | ]]) @@ -132,17 +128,17 @@ describe('Default highlight groups', function() feed('<c-w>j') screen:expect([[ {2:|} {2:|} | - ~ {2:|}~ {2:|}~ | - ~ {2:|}~ {2:|}~ | - ~ {2:|}~ {2:|}~ | - ~ {2:|}~ {2:|}~ | - ~ {2:|}~ {2:|}~ | + {0:~ }{2:|}{0:~ }{2:|}{0:~ }| + {0:~ }{2:|}{0:~ }{2:|}{0:~ }| + {0:~ }{2:|}{0:~ }{2:|}{0:~ }| + {0:~ }{2:|}{0:~ }{2:|}{0:~ }| + {0:~ }{2:|}{0:~ }{2:|}{0:~ }| {2:[No Name] [No Name] [No Name] }| ^ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| {1:[No Name] }| | ]]) @@ -152,51 +148,51 @@ describe('Default highlight groups', function() feed('<c-w>k<c-w>l') screen:expect([[ {2:|}^ {2:|} | - ~ {2:|}~ {2:|}~ | - ~ {2:|}~ {2:|}~ | - ~ {2:|}~ {2:|}~ | - ~ {2:|}~ {2:|}~ | - ~ {2:|}~ {2:|}~ | + {0:~ }{2:|}{0:~ }{2:|}{0:~ }| + {0:~ }{2:|}{0:~ }{2:|}{0:~ }| + {0:~ }{2:|}{0:~ }{2:|}{0:~ }| + {0:~ }{2:|}{0:~ }{2:|}{0:~ }| + {0:~ }{2:|}{0:~ }{2:|}{0:~ }| {2:[No Name] }{1:[No Name] }{2:[No Name] }| | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| {2:[No Name] }| | ]]) feed('<c-w>l') screen:expect([[ {2:|} {2:|}^ | - ~ {2:|}~ {2:|}~ | - ~ {2:|}~ {2:|}~ | - ~ {2:|}~ {2:|}~ | - ~ {2:|}~ {2:|}~ | - ~ {2:|}~ {2:|}~ | + {0:~ }{2:|}{0:~ }{2:|}{0:~ }| + {0:~ }{2:|}{0:~ }{2:|}{0:~ }| + {0:~ }{2:|}{0:~ }{2:|}{0:~ }| + {0:~ }{2:|}{0:~ }{2:|}{0:~ }| + {0:~ }{2:|}{0:~ }{2:|}{0:~ }| {2:[No Name] [No Name] }{1:[No Name] }| | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| {2:[No Name] }| | ]]) feed('<c-w>h<c-w>h') screen:expect([[ ^ {2:|} {2:|} | - ~ {2:|}~ {2:|}~ | - ~ {2:|}~ {2:|}~ | - ~ {2:|}~ {2:|}~ | - ~ {2:|}~ {2:|}~ | - ~ {2:|}~ {2:|}~ | + {0:~ }{2:|}{0:~ }{2:|}{0:~ }| + {0:~ }{2:|}{0:~ }{2:|}{0:~ }| + {0:~ }{2:|}{0:~ }{2:|}{0:~ }| + {0:~ }{2:|}{0:~ }{2:|}{0:~ }| + {0:~ }{2:|}{0:~ }{2:|}{0:~ }| {1:[No Name] }{2:[No Name] [No Name] }| | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| {2:[No Name] }| | ]]) @@ -206,20 +202,21 @@ describe('Default highlight groups', function() feed('i') screen:expect([[ ^ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| {1:-- INSERT --} | - ]], {[1] = {bold = true}}) + ]], {[0] = {bold=true, foreground=Screen.colors.Blue}, + [1] = {bold = true}}) end) it('end of file markers', function() @@ -238,27 +235,28 @@ describe('Default highlight groups', function() {1:~ }| {1:~ }| | - ]], {[1] = {bold = true, foreground = hlgroup_colors.NonText}}) + ]], {[1] = {bold = true, foreground = Screen.colors.Blue}}) end) it('"wait return" text', function() feed(':ls<cr>') screen:expect([[ - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| :ls | 1 %a "[No Name]" line 1 | {1:Press ENTER or type command to continue}^ | - ]], {[1] = {bold = true, foreground = hlgroup_colors.Question}}) + ]], {[0] = {bold=true, foreground=Screen.colors.Blue}, + [1] = {bold = true, foreground = Screen.colors.SeaGreen}}) feed('<cr>') -- skip the "Press ENTER..." state or tests will hang end) it('can be cleared and linked to other highlight groups', function() @@ -266,40 +264,42 @@ describe('Default highlight groups', function() feed('i') screen:expect([[ ^ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| -- INSERT -- | - ]], {}) + ]], {[0] = {bold=true, foreground=Screen.colors.Blue}, + [1] = {bold=true}}) feed('<esc>') execute('highlight CustomHLGroup guifg=red guibg=green') execute('highlight link ModeMsg CustomHLGroup') feed('i') screen:expect([[ ^ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| {1:-- INSERT --} | - ]], {[1] = {foreground = Screen.colors.Red, background = Screen.colors.Green}}) + ]], {[0] = {bold=true, foreground=Screen.colors.Blue}, + [1] = {foreground = Screen.colors.Red, background = Screen.colors.Green}}) end) it('can be cleared by assigning NONE', function() execute('syn keyword TmpKeyword neovim') @@ -307,40 +307,41 @@ describe('Default highlight groups', function() insert('neovim') screen:expect([[ {1:neovi^m} | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| | ]], { + [0] = {bold=true, foreground=Screen.colors.Blue}, [1] = {foreground = Screen.colors.White, background = Screen.colors.Red} }) execute("hi ErrorMsg term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE" .. " gui=NONE guifg=NONE guibg=NONE guisp=NONE") screen:expect([[ neovi^m | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| | - ]], {}) + ]], {[0] = {bold=true, foreground=Screen.colors.Blue}}) end) end) @@ -351,10 +352,6 @@ describe('guisp (special/undercurl)', function() clear() screen = Screen.new(25,10) screen:attach() - screen:set_default_attr_ignore({ - [1] = {bold = true, foreground = Screen.colors.Blue}, - [2] = {bold = true} - }) end) it('can be set and is applied like foreground or background', function() @@ -389,14 +386,16 @@ describe('guisp (special/undercurl)', function() {4:specialwithfg} | | {1:neovim} tabbed^ | - ~ | - -- INSERT -- | + {0:~ }| + {5:-- INSERT --} | ]],{ + [0] = {bold=true, foreground=Screen.colors.Blue}, [1] = {background = Screen.colors.Yellow, foreground = Screen.colors.Red, special = Screen.colors.Red}, [2] = {special = Screen.colors.Red}, [3] = {special = Screen.colors.Red, background = Screen.colors.Yellow}, [4] = {foreground = Screen.colors.Red, special = Screen.colors.Red}, + [5] = {bold=true}, }) end) @@ -405,13 +404,6 @@ end) describe("'cursorline' with 'listchars'", function() local screen - local hlgroup_colors = { - NonText = Screen.colors.Blue, - Cursorline = Screen.colors.Grey90, - SpecialKey = Screen.colors.Red, - Visual = Screen.colors.LightGrey, - } - before_each(function() clear() screen = Screen.new(20,5) @@ -423,48 +415,50 @@ describe("'cursorline' with 'listchars'", function() end) it("'cursorline' and 'cursorcolumn'", function() - screen:set_default_attr_ids({[1] = {background=hlgroup_colors.Cursorline}}) - screen:set_default_attr_ignore( {{bold=true, foreground=hlgroup_colors.NonText}} ) + screen:set_default_attr_ids({ + [0] = {bold=true, foreground=Screen.colors.Blue}, + [1] = {background=Screen.colors.Grey90} + }) execute('highlight clear ModeMsg') execute('set cursorline') feed('i') screen:expect([[ {1:^ }| - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| -- INSERT -- | ]]) feed('abcdefg<cr>kkasdf') screen:expect([[ abcdefg | {1:kkasdf^ }| - ~ | - ~ | + {0:~ }| + {0:~ }| -- INSERT -- | ]]) feed('<esc>') screen:expect([[ abcdefg | {1:kkasd^f }| - ~ | - ~ | + {0:~ }| + {0:~ }| | ]]) execute('set nocursorline') screen:expect([[ abcdefg | kkasd^f | - ~ | - ~ | + {0:~ }| + {0:~ }| :set nocursorline | ]]) feed('k') screen:expect([[ abcde^fg | kkasdf | - ~ | - ~ | + {0:~ }| + {0:~ }| :set nocursorline | ]]) feed('jjji<cr><cr><cr><esc>') @@ -497,22 +491,22 @@ describe("'cursorline' with 'listchars'", function() it("'cursorline' and with 'listchar' option: space, eol, tab, and trail", function() screen:set_default_attr_ids({ - [1] = {background=hlgroup_colors.Cursorline}, + [1] = {background=Screen.colors.Grey90}, [2] = { - foreground=hlgroup_colors.SpecialKey, - background=hlgroup_colors.Cursorline, + foreground=Screen.colors.Red, + background=Screen.colors.Grey90, }, [3] = { - background=hlgroup_colors.Cursorline, - foreground=hlgroup_colors.NonText, + background=Screen.colors.Grey90, + foreground=Screen.colors.Blue, bold=true, }, [4] = { - foreground=hlgroup_colors.NonText, + foreground=Screen.colors.Blue, bold=true, }, [5] = { - foreground=hlgroup_colors.SpecialKey, + foreground=Screen.colors.Red, }, }) execute('highlight clear ModeMsg') @@ -581,33 +575,33 @@ describe("'cursorline' with 'listchars'", function() it("'listchar' in visual mode", function() screen:set_default_attr_ids({ - [1] = {background=hlgroup_colors.Cursorline}, + [1] = {background=Screen.colors.Grey90}, [2] = { - foreground=hlgroup_colors.SpecialKey, - background=hlgroup_colors.Cursorline, + foreground=Screen.colors.Red, + background=Screen.colors.Grey90, }, [3] = { - background=hlgroup_colors.Cursorline, - foreground=hlgroup_colors.NonText, + background=Screen.colors.Grey90, + foreground=Screen.colors.Blue, bold=true, }, [4] = { - foreground=hlgroup_colors.NonText, + foreground=Screen.colors.Blue, bold=true, }, [5] = { - foreground=hlgroup_colors.SpecialKey, + foreground=Screen.colors.Red, }, [6] = { - background=hlgroup_colors.Visual, + background=Screen.colors.LightGrey, }, [7] = { - background=hlgroup_colors.Visual, - foreground=hlgroup_colors.SpecialKey, + background=Screen.colors.LightGrey, + foreground=Screen.colors.Red, }, [8] = { - background=hlgroup_colors.Visual, - foreground=hlgroup_colors.NonText, + background=Screen.colors.LightGrey, + foreground=Screen.colors.Blue, bold=true, }, }) diff --git a/test/functional/ui/input_spec.lua b/test/functional/ui/input_spec.lua index 407c576002..cec19250d2 100644 --- a/test/functional/ui/input_spec.lua +++ b/test/functional/ui/input_spec.lua @@ -4,6 +4,8 @@ local feed, next_message, eq = helpers.feed, helpers.next_message, helpers.eq local expect = helpers.expect local Screen = require('test.functional.ui.screen') +if helpers.pending_win32(pending) then return end + describe('mappings', function() local cid diff --git a/test/functional/ui/mouse_spec.lua b/test/functional/ui/mouse_spec.lua index 7b820347ac..13bfe9e23f 100644 --- a/test/functional/ui/mouse_spec.lua +++ b/test/functional/ui/mouse_spec.lua @@ -4,39 +4,38 @@ local clear, feed, meths = helpers.clear, helpers.feed, helpers.meths local insert, execute = helpers.insert, helpers.execute local eq, funcs = helpers.eq, helpers.funcs +if helpers.pending_win32(pending) then return end + describe('Mouse input', function() local screen - local hlgroup_colors = { - NonText = Screen.colors.Blue, - Visual = Screen.colors.LightGrey - } - before_each(function() clear() meths.set_option('mouse', 'a') meths.set_option('listchars', 'eol:$') - -- set mouset to very high value to ensure that even in valgrind/travis, + -- set mousetime to very high value to ensure that even in valgrind/travis, -- nvim will still pick multiple clicks - meths.set_option('mouset', 5000) + meths.set_option('mousetime', 5000) screen = Screen.new(25, 5) screen:attach() screen:set_default_attr_ids({ - [1] = {background = hlgroup_colors.Visual}, + [0] = {bold=true, foreground=Screen.colors.Blue}, + [1] = {background = Screen.colors.LightGrey}, [2] = {bold = true}, [3] = { - foreground = hlgroup_colors.NonText, - background = hlgroup_colors.Visual, + foreground = Screen.colors.Blue, + background = Screen.colors.LightGrey, bold = true, }, + [4] = {reverse = true}, + [5] = {bold = true, reverse = true}, }) - screen:set_default_attr_ignore( {{bold=true, foreground=hlgroup_colors.NonText}} ) feed('itesting<cr>mouse<cr>support and selection<esc>') screen:expect([[ testing | mouse | support and selectio^n | - ~ | + {0:~ }| | ]]) end) @@ -45,13 +44,13 @@ describe('Mouse input', function() screen:detach() end) - it('left click moves cursor', function() + it('single left click moves cursor', function() feed('<LeftMouse><2,1>') screen:expect([[ testing | mo^use | support and selection | - ~ | + {0:~ }| | ]]) feed('<LeftMouse><0,0>') @@ -59,17 +58,294 @@ describe('Mouse input', function() ^testing | mouse | support and selection | - ~ | + {0:~ }| | ]]) end) + it('double left click enters visual mode', function() + feed('<LeftMouse><0,0>') + feed('<LeftRelease><0,0>') + feed('<LeftMouse><0,0>') + feed('<LeftRelease><0,0>') + screen:expect([[ + {1:testin}^g | + mouse | + support and selection | + {0:~ }| + {2:-- VISUAL --} | + ]]) + end) + + it('triple left click enters visual line mode', function() + feed('<LeftMouse><0,0>') + feed('<LeftRelease><0,0>') + feed('<LeftMouse><0,0>') + feed('<LeftRelease><0,0>') + feed('<LeftMouse><0,0>') + feed('<LeftRelease><0,0>') + screen:expect([[ + ^t{1:esting}{3: } | + mouse | + support and selection | + {0:~ }| + {2:-- VISUAL LINE --} | + ]]) + end) + + it('quadruple left click enters visual block mode', function() + feed('<LeftMouse><0,0>') + feed('<LeftRelease><0,0>') + feed('<LeftMouse><0,0>') + feed('<LeftRelease><0,0>') + feed('<LeftMouse><0,0>') + feed('<LeftRelease><0,0>') + feed('<LeftMouse><0,0>') + feed('<LeftRelease><0,0>') + screen:expect([[ + ^testing | + mouse | + support and selection | + {0:~ }| + {2:-- VISUAL BLOCK --} | + ]]) + end) + + describe('tab drag', function() + before_each(function() + screen:set_default_attr_ids( { + [0] = {bold=true, foreground=Screen.colors.Blue}, + tab = { background=Screen.colors.LightGrey, underline=true }, + sel = { bold=true }, + fill = { reverse=true } + }) + screen.timeout = 15000 + end) + + it('in tabline on filler space moves tab to the end', function() + execute('%delete') + insert('this is foo') + execute('silent file foo | tabnew | file bar') + insert('this is bar') + screen:expect([[ + {tab: + foo }{sel: + bar }{fill: }{tab:X}| + this is ba^r | + {0:~ }| + {0:~ }| + | + ]]) + feed('<LeftMouse><4,0>') + screen:expect([[ + {sel: + foo }{tab: + bar }{fill: }{tab:X}| + this is fo^o | + {0:~ }| + {0:~ }| + | + ]]) + feed('<LeftDrag><14,0>') + screen:expect([[ + {tab: + bar }{sel: + foo }{fill: }{tab:X}| + this is fo^o | + {0:~ }| + {0:~ }| + | + ]]) + end) + + it('in tabline to the left moves tab left', function() + if os.getenv("TRAVIS") and helpers.os_name() == "osx" then + pending("[Fails on Travis macOS. #4874]", function() end) + return + end + + execute('%delete') + insert('this is foo') + execute('silent file foo | tabnew | file bar') + insert('this is bar') + screen:expect([[ + {tab: + foo }{sel: + bar }{fill: }{tab:X}| + this is ba^r | + {0:~ }| + {0:~ }| + | + ]]) + feed('<LeftMouse><11,0>') + screen:expect([[ + {tab: + foo }{sel: + bar }{fill: }{tab:X}| + this is ba^r | + {0:~ }| + {0:~ }| + | + ]]) + feed('<LeftDrag><6,0>') + screen:expect([[ + {sel: + bar }{tab: + foo }{fill: }{tab:X}| + this is ba^r | + {0:~ }| + {0:~ }| + | + ]]) + end) + + it('in tabline to the right moves tab right', function() + execute('%delete') + insert('this is foo') + execute('silent file foo | tabnew | file bar') + insert('this is bar') + screen:expect([[ + {tab: + foo }{sel: + bar }{fill: }{tab:X}| + this is ba^r | + {0:~ }| + {0:~ }| + | + ]]) + feed('<LeftMouse><4,0>') + screen:expect([[ + {sel: + foo }{tab: + bar }{fill: }{tab:X}| + this is fo^o | + {0:~ }| + {0:~ }| + | + ]]) + feed('<LeftDrag><7,0>') + screen:expect([[ + {tab: + bar }{sel: + foo }{fill: }{tab:X}| + this is fo^o | + {0:~ }| + {0:~ }| + | + ]]) + end) + + it('out of tabline under filler space moves tab to the end', function() + execute('%delete') + insert('this is foo') + execute('silent file foo | tabnew | file bar') + insert('this is bar') + screen:expect([[ + {tab: + foo }{sel: + bar }{fill: }{tab:X}| + this is ba^r | + {0:~ }| + {0:~ }| + | + ]]) + feed('<LeftMouse><4,0>') + screen:expect([[ + {sel: + foo }{tab: + bar }{fill: }{tab:X}| + this is fo^o | + {0:~ }| + {0:~ }| + | + ]]) + feed('<LeftDrag><4,1>') + screen:expect([[ + {sel: + foo }{tab: + bar }{fill: }{tab:X}| + this is fo^o | + {0:~ }| + {0:~ }| + | + ]]) + feed('<LeftDrag><14,1>') + screen:expect([[ + {tab: + bar }{sel: + foo }{fill: }{tab:X}| + this is fo^o | + {0:~ }| + {0:~ }| + | + ]]) + end) + + it('out of tabline to the left moves tab left', function() + if os.getenv("TRAVIS") and helpers.os_name() == "osx" then + pending("[Fails on Travis macOS. #4874]", function() end) + return + end + + execute('%delete') + insert('this is foo') + execute('silent file foo | tabnew | file bar') + insert('this is bar') + screen:expect([[ + {tab: + foo }{sel: + bar }{fill: }{tab:X}| + this is ba^r | + {0:~ }| + {0:~ }| + | + ]]) + feed('<LeftMouse><11,0>') + screen:expect([[ + {tab: + foo }{sel: + bar }{fill: }{tab:X}| + this is ba^r | + {0:~ }| + {0:~ }| + | + ]]) + feed('<LeftDrag><11,1>') + screen:expect([[ + {tab: + foo }{sel: + bar }{fill: }{tab:X}| + this is ba^r | + {0:~ }| + {0:~ }| + | + ]]) + feed('<LeftDrag><6,1>') + screen:expect([[ + {sel: + bar }{tab: + foo }{fill: }{tab:X}| + this is ba^r | + {0:~ }| + {0:~ }| + | + ]]) + end) + + it('out of tabline to the right moves tab right', function() + execute('%delete') + insert('this is foo') + execute('silent file foo | tabnew | file bar') + insert('this is bar') + screen:expect([[ + {tab: + foo }{sel: + bar }{fill: }{tab:X}| + this is ba^r | + {0:~ }| + {0:~ }| + | + ]]) + feed('<LeftMouse><4,0>') + screen:expect([[ + {sel: + foo }{tab: + bar }{fill: }{tab:X}| + this is fo^o | + {0:~ }| + {0:~ }| + | + ]]) + feed('<LeftDrag><4,1>') + screen:expect([[ + {sel: + foo }{tab: + bar }{fill: }{tab:X}| + this is fo^o | + {0:~ }| + {0:~ }| + | + ]]) + feed('<LeftDrag><7,1>') + screen:expect([[ + {tab: + bar }{sel: + foo }{fill: }{tab:X}| + this is fo^o | + {0:~ }| + {0:~ }| + | + ]]) + end) + end) + describe('tabline', function() - local tab_attrs = { - tab = { background=Screen.colors.LightGrey, underline=true }, - sel = { bold=true }, - fill = { reverse=true } - } + before_each(function() + screen:set_default_attr_ids( { + [0] = {bold=true, foreground=Screen.colors.Blue}, + tab = { background=Screen.colors.LightGrey, underline=true }, + sel = { bold=true }, + fill = { reverse=true } + }) + end) it('left click in default tabline (position 4) switches to tab', function() execute('%delete') @@ -79,18 +355,18 @@ describe('Mouse input', function() screen:expect([[ {tab: + foo }{sel: + bar }{fill: }{tab:X}| this is ba^r | - ~ | - ~ | + {0:~ }| + {0:~ }| | - ]], tab_attrs) + ]]) feed('<LeftMouse><4,0>') screen:expect([[ {sel: + foo }{tab: + bar }{fill: }{tab:X}| this is fo^o | - ~ | - ~ | + {0:~ }| + {0:~ }| | - ]], tab_attrs) + ]]) end) it('left click in default tabline (position 24) closes tab', function() @@ -102,18 +378,18 @@ describe('Mouse input', function() screen:expect([[ {tab: + foo }{sel: + bar }{fill: }{tab:X}| this is ba^r | - ~ | - ~ | + {0:~ }| + {0:~ }| | - ]], tab_attrs) + ]]) feed('<LeftMouse><24,0>') screen:expect([[ this is fo^o | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| | - ]], tab_attrs) + ]]) end) it('double click in default tabline (position 4) opens new tab', function() @@ -125,18 +401,18 @@ describe('Mouse input', function() screen:expect([[ {tab: + foo }{sel: + bar }{fill: }{tab:X}| this is ba^r | - ~ | - ~ | + {0:~ }| + {0:~ }| | - ]], tab_attrs) + ]]) feed('<2-LeftMouse><4,0>') screen:expect([[ {sel: Name] }{tab: + foo + bar }{fill: }{tab:X}| ^ | - ~ | - ~ | + {0:~ }| + {0:~ }| | - ]], tab_attrs) + ]]) end) describe('%@ label', function() @@ -158,9 +434,9 @@ describe('Mouse input', function() {fill:test-test2 }| mouse | support and selectio^n | - ~ | + {0:~ }| | - ]], tab_attrs) + ]]) meths.set_var('reply', {}) end) @@ -216,7 +492,7 @@ describe('Mouse input', function() testing | mo^use | support and selection | - ~ | + {0:~ }| | ]]) feed('<LeftDrag><4,1>') @@ -224,7 +500,7 @@ describe('Mouse input', function() testing | mo{1:us}^e | support and selection | - ~ | + {0:~ }| {2:-- VISUAL --} | ]]) feed('<LeftDrag><2,2>') @@ -232,7 +508,7 @@ describe('Mouse input', function() testing | mo{1:use}{3: } | {1:su}^pport and selection | - ~ | + {0:~ }| {2:-- VISUAL --} | ]]) feed('<LeftDrag><0,0>') @@ -240,18 +516,19 @@ describe('Mouse input', function() ^t{1:esting}{3: } | {1:mou}se | support and selection | - ~ | + {0:~ }| {2:-- VISUAL --} | ]]) end) it('left drag changes visual selection after tab click', function() - local tab_attrs = { + screen:set_default_attr_ids({ + [0] = {bold=true, foreground=Screen.colors.Blue}, tab = { background=Screen.colors.LightGrey, underline=true }, sel = { bold=true }, fill = { reverse=true }, vis = { background=Screen.colors.LightGrey } - } + }) execute('silent file foo | tabnew | file bar') insert('this is bar') execute('tabprevious') -- go to first tab @@ -259,27 +536,27 @@ describe('Mouse input', function() {sel: + foo }{tab: + bar }{fill: }{tab:X}| mouse | support and selectio^n | - ~ | + {0:~ }| | - ]], tab_attrs) + ]]) feed('<LeftMouse><10,0><LeftRelease>') -- go to second tab helpers.wait() feed('<LeftMouse><0,1>') screen:expect([[ {tab: + foo }{sel: + bar }{fill: }{tab:X}| ^this is bar | - ~ | - ~ | + {0:~ }| + {0:~ }| | - ]], tab_attrs) + ]]) feed('<LeftDrag><4,1>') screen:expect([[ {tab: + foo }{sel: + bar }{fill: }{tab:X}| {vis:this}^ is bar | - ~ | - ~ | + {0:~ }| + {0:~ }| {sel:-- VISUAL --} | - ]], tab_attrs) + ]]) end) it('two clicks will select the word and enter VISUAL', function() @@ -288,7 +565,7 @@ describe('Mouse input', function() testing | mouse | {1:suppor}^t and selection | - ~ | + {0:~ }| {2:-- VISUAL --} | ]]) end) @@ -299,7 +576,7 @@ describe('Mouse input', function() testing | mouse | {1:su}^p{1:port and selection}{3: } | - ~ | + {0:~ }| {2:-- VISUAL LINE --} | ]]) end) @@ -310,7 +587,7 @@ describe('Mouse input', function() testing | mouse | su^pport and selection | - ~ | + {0:~ }| {2:-- VISUAL BLOCK --} | ]]) end) @@ -321,7 +598,7 @@ describe('Mouse input', function() ^testing | mouse | support and selection | - ~ | + {0:~ }| | ]]) feed('<RightMouse><2,2>') @@ -329,7 +606,7 @@ describe('Mouse input', function() {1:testing}{3: } | {1:mouse}{3: } | {1:su}^pport and selection | - ~ | + {0:~ }| {2:-- VISUAL --} | ]]) end) @@ -361,73 +638,71 @@ describe('Mouse input', function() ]]) screen:try_resize(53, 14) execute('sp', 'vsp') - screen:set_default_attr_ignore( {{bold=true, foreground=hlgroup_colors.NonText}, - {reverse=true}, {bold=true, reverse=true}} ) screen:expect([[ - lines |lines | - to |to | - test |test | - mouse scrolling |mouse scrolling | - ^ | | - ~ |~ | - [No Name] [+] [No Name] [+] | + lines {4:|}lines | + to {4:|}to | + test {4:|}test | + mouse scrolling {4:|}mouse scrolling | + ^ {4:|} | + {0:~ }{4:|}{0:~ }| + {5:[No Name] [+] }{4:[No Name] [+] }| to | test | mouse scrolling | | - ~ | - [No Name] [+] | + {0:~ }| + {4:[No Name] [+] }| :vsp | ]]) feed('<MouseUp><0,0>') screen:expect([[ - mouse scrolling |lines | - ^ |to | - ~ |test | - ~ |mouse scrolling | - ~ | | - ~ |~ | - [No Name] [+] [No Name] [+] | + mouse scrolling {4:|}lines | + ^ {4:|}to | + {0:~ }{4:|}test | + {0:~ }{4:|}mouse scrolling | + {0:~ }{4:|} | + {0:~ }{4:|}{0:~ }| + {5:[No Name] [+] }{4:[No Name] [+] }| to | test | mouse scrolling | | - ~ | - [No Name] [+] | + {0:~ }| + {4:[No Name] [+] }| | ]]) feed('<MouseDown><27,0>') screen:expect([[ - mouse scrolling |text | - ^ |with | - ~ |many | - ~ |lines | - ~ |to | - ~ |test | - [No Name] [+] [No Name] [+] | + mouse scrolling {4:|}text | + ^ {4:|}with | + {0:~ }{4:|}many | + {0:~ }{4:|}lines | + {0:~ }{4:|}to | + {0:~ }{4:|}test | + {5:[No Name] [+] }{4:[No Name] [+] }| to | test | mouse scrolling | | - ~ | - [No Name] [+] | + {0:~ }| + {4:[No Name] [+] }| | ]]) feed('<MouseDown><27,7><MouseDown>') screen:expect([[ - mouse scrolling |text | - ^ |with | - ~ |many | - ~ |lines | - ~ |to | - ~ |test | - [No Name] [+] [No Name] [+] | + mouse scrolling {4:|}text | + ^ {4:|}with | + {0:~ }{4:|}many | + {0:~ }{4:|}lines | + {0:~ }{4:|}to | + {0:~ }{4:|}test | + {5:[No Name] [+] }{4:[No Name] [+] }| Inserting | text | with | many | lines | - [No Name] [+] | + {4:[No Name] [+] }| | ]]) end) @@ -440,7 +715,7 @@ describe('Mouse input', function() | | bbbbbbbbbbbbbbb^b | - ~ | + {0:~ }| | ]]) @@ -449,7 +724,7 @@ describe('Mouse input', function() | | n bbbbbbbbbbbbbbbbbbb^b | - ~ | + {0:~ }| | ]]) @@ -458,7 +733,7 @@ describe('Mouse input', function() g | | ^t and selection bbbbbbbbb| - ~ | + {0:~ }| | ]]) end) @@ -466,12 +741,13 @@ describe('Mouse input', function() describe('on concealed text', function() -- Helpful for reading the test expectations: -- :match Error /\^/ - local concealed = { - c = { foreground = Screen.colors.LightGrey, background = Screen.colors.DarkGray } - } before_each(function() screen:try_resize(25, 7) + screen:set_default_attr_ids({ + [0] = {bold=true, foreground=Screen.colors.Blue}, + c = { foreground = Screen.colors.LightGrey, background = Screen.colors.DarkGray }, + }) feed('ggdG') execute('set concealcursor=n') @@ -497,44 +773,44 @@ describe('Mouse input', function() {c:^Y}rem ip{c:X}um do{c: } {c:X}it {c: }, con| {c:X}tet {c: }ta ka{c:X}d {c:X}ber{c:X}en, no| | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| | - ]], concealed) + ]]) feed('<esc><LeftMouse><1,0>') screen:expect([[ {c:Y}^rem ip{c:X}um do{c: } {c:X}it {c: }, con| {c:X}tet {c: }ta ka{c:X}d {c:X}ber{c:X}en, no| | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| | - ]], concealed) + ]]) feed('<esc><LeftMouse><15,0>') screen:expect([[ {c:Y}rem ip{c:X}um do{c: } {c:^X}it {c: }, con| {c:X}tet {c: }ta ka{c:X}d {c:X}ber{c:X}en, no| | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| | - ]], concealed) + ]]) feed('<esc><LeftMouse><15,1>') screen:expect([[ {c:Y}rem ip{c:X}um do{c: } {c:X}it {c: }, con| {c:X}tet {c: }ta ka{c:X}d {c:X}^ber{c:X}en, no| | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| | - ]], concealed) + ]]) end) -- level 1 - non wrapped it('(level 1) click on wrapped lines', function() @@ -549,7 +825,7 @@ describe('Mouse input', function() , no {c:X}ea takimata {c:X}anctu{c:X}| e{c:X}t. | | - ]], concealed) + ]]) feed('<esc><LeftMouse><6,1>') screen:expect([[ @@ -560,7 +836,7 @@ describe('Mouse input', function() , no {c:X}ea takimata {c:X}anctu{c:X}| e{c:X}t. | | - ]], concealed) + ]]) feed('<esc><LeftMouse><15,1>') screen:expect([[ @@ -571,7 +847,7 @@ describe('Mouse input', function() , no {c:X}ea takimata {c:X}anctu{c:X}| e{c:X}t. | | - ]], concealed) + ]]) feed('<esc><LeftMouse><15,3>') screen:expect([[ @@ -582,7 +858,7 @@ describe('Mouse input', function() , no {c:X}ea takimata {c:X}anctu{c:X}| e{c:X}t. | | - ]], concealed) + ]]) end) -- level 1 - wrapped @@ -594,44 +870,44 @@ describe('Mouse input', function() {c:^Y}rem ip{c:X}um do {c:X}it , con{c:X}e| {c:X}tet ta ka{c:X}d {c:X}ber{c:X}en, no | | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| | - ]], concealed) + ]]) feed('<esc><LeftMouse><1,0>') screen:expect([[ {c:Y}^rem ip{c:X}um do {c:X}it , con{c:X}e| {c:X}tet ta ka{c:X}d {c:X}ber{c:X}en, no | | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| | - ]], concealed) + ]]) feed('<esc><LeftMouse><15,0>') screen:expect([[ {c:Y}rem ip{c:X}um do {c:X}^it , con{c:X}e| {c:X}tet ta ka{c:X}d {c:X}ber{c:X}en, no | | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| | - ]], concealed) + ]]) feed('<esc><LeftMouse><15,1>') screen:expect([[ {c:Y}rem ip{c:X}um do {c:X}it , con{c:X}e| {c:X}tet ta ka{c:X}d {c:X}b^er{c:X}en, no | | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| | - ]], concealed) + ]]) end) -- level 2 - non wrapped it('(level 2) click on wrapped lines', function() @@ -646,7 +922,7 @@ describe('Mouse input', function() , no {c:X}ea takimata {c:X}anctu{c:X}| e{c:X}t. | | - ]], concealed) + ]]) feed('<esc><LeftMouse><6,1>') screen:expect([[ @@ -657,7 +933,7 @@ describe('Mouse input', function() , no {c:X}ea takimata {c:X}anctu{c:X}| e{c:X}t. | | - ]], concealed) + ]]) feed('<esc><LeftMouse><15,1>') screen:expect([[ @@ -668,7 +944,7 @@ describe('Mouse input', function() , no {c:X}ea takimata {c:X}anctu{c:X}| e{c:X}t. | | - ]], concealed) + ]]) feed('<esc><LeftMouse><15,3>') screen:expect([[ @@ -679,7 +955,7 @@ describe('Mouse input', function() , no {c:X}ea takimata {c:X}anctu{c:X}| e{c:X}t. | | - ]], concealed) + ]]) end) -- level 2 - wrapped @@ -691,44 +967,44 @@ describe('Mouse input', function() ^rem ipum do it , conetetu| tet ta kad beren, no ea t| | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| | - ]], concealed) + ]]) feed('<esc><LeftMouse><1,0>') screen:expect([[ r^em ipum do it , conetetu| tet ta kad beren, no ea t| | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| | - ]], concealed) + ]]) feed('<esc><LeftMouse><15,0>') screen:expect([[ rem ipum do it ^, conetetu| tet ta kad beren, no ea t| | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| | - ]], concealed) + ]]) feed('<esc><LeftMouse><15,1>') screen:expect([[ rem ipum do it , conetetu| tet ta kad bere^n, no ea t| | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| | - ]], concealed) + ]]) end) -- level 3 - non wrapped it('(level 3) click on wrapped lines', function() @@ -743,7 +1019,7 @@ describe('Mouse input', function() , no ea takimata anctu | et. | | - ]], concealed) + ]]) feed('<esc><LeftMouse><6,1>') screen:expect([[ @@ -754,7 +1030,7 @@ describe('Mouse input', function() , no ea takimata anctu | et. | | - ]], concealed) + ]]) feed('<esc><LeftMouse><15,1>') screen:expect([[ @@ -765,7 +1041,7 @@ describe('Mouse input', function() , no ea takimata anctu | et. | | - ]], concealed) + ]]) feed('<esc><LeftMouse><15,3>') screen:expect([[ @@ -776,7 +1052,7 @@ describe('Mouse input', function() , no ea takimata anctu | et. | | - ]], concealed) + ]]) end) -- level 3 - wrapped end) end) diff --git a/test/functional/ui/output_spec.lua b/test/functional/ui/output_spec.lua index c7c8986527..c58bbe9147 100644 --- a/test/functional/ui/output_spec.lua +++ b/test/functional/ui/output_spec.lua @@ -1,6 +1,8 @@ local session = require('test.functional.helpers')(after_each) local child_session = require('test.functional.terminal.helpers') +if session.pending_win32(pending) then return end + describe("shell command :!", function() local screen before_each(function() @@ -9,16 +11,17 @@ describe("shell command :!", function() '", "-u", "NONE", "-i", "NONE", "--cmd", "set noswapfile"]') screen:expect([[ {1: } | - ~ | - ~ | - ~ | - [No Name] | + {4:~ }| + {4:~ }| + {4:~ }| + {5:[No Name] }| | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) end) after_each(function() + child_session.feed_data("\3") -- Ctrl-C screen:detach() end) @@ -27,13 +30,13 @@ describe("shell command :!", function() -- to avoid triggering a UI flush. child_session.feed_data(":!printf foo; sleep 200\n") screen:expect([[ - ~ | - ~ | - [No Name] | + {4:~ }| + {4:~ }| + {5:[No Name] }| :!printf foo; sleep 200 | | foo | - -- TERMINAL -- | + {3:-- TERMINAL --} | ]]) end) end) diff --git a/test/functional/ui/quickfix_spec.lua b/test/functional/ui/quickfix_spec.lua new file mode 100644 index 0000000000..29b28fe9f0 --- /dev/null +++ b/test/functional/ui/quickfix_spec.lua @@ -0,0 +1,196 @@ +local helpers = require('test.functional.helpers')(after_each) +local Screen = require('test.functional.ui.screen') +local clear, feed, meths = helpers.clear, helpers.feed, helpers.meths +local insert, execute = helpers.insert, helpers.execute + + +describe('quickfix selection highlight', function() + local screen + + before_each(function() + clear() + + screen = Screen.new(25, 10) + screen:attach() + screen:set_default_attr_ids({ + [1] = { bold = true, foreground = Screen.colors.Blue }, + [2] = {reverse = true}, + [3] = {foreground = Screen.colors.Brown}, + [4] = {bold = true, reverse = true}, + [5] = {background = Screen.colors.Green}, + [6] = {foreground = Screen.colors.Brown, background = Screen.colors.Green}, + [7] = {background = Screen.colors.Red}, + [8] = {foreground = Screen.colors.Brown, background = Screen.colors.Red}, + [9] = {background = Screen.colors.Fuchsia}, + [10] = {foreground = Screen.colors.Red, background = Screen.colors.Fuchsia}, + [11] = {foreground = Screen.colors.Red}, + [12] = {foreground = Screen.colors.Brown, background = Screen.colors.Fuchsia}, + }) + + meths.set_option('errorformat', '%m %l') + execute('syntax on') + execute('highlight Search guibg=Green') + + insert([[ + Line 1 + Line 2 + Line 3 + Line 4 + Line 5 + ]]) + + execute('cad') + feed('gg') + + screen:expect([[ + ^Line 1 | + Line 2 | + Line 3 | + Line 4 | + Line 5 | + | + {1:~ }| + {1:~ }| + {1:~ }| + :cad | + ]]) + end) + + it('using default Search highlight group', function() + execute('copen') + + screen:expect([[ + Line 1 | + {2:[No Name] [+] }| + {5:^|}{6:1}{5:| Line }| + |{3:2}| Line | + |{3:3}| Line | + |{3:4}| Line | + |{3:5}| Line | + || | + {4:[Quickfix List] }| + :copen | + ]]) + + execute('cnext') + + screen:expect([[ + Line 1 | + {2:[No Name] [+] }| + |{3:1}| Line | + {5:^|}{6:2}{5:| Line }| + |{3:3}| Line | + |{3:4}| Line | + |{3:5}| Line | + || | + {4:[Quickfix List] }| + :cnext | + ]]) + end) + + it('using QuickFixLine highlight group', function() + execute('highlight QuickFixLine guibg=Red') + + execute('copen') + + screen:expect([[ + Line 1 | + {2:[No Name] [+] }| + {7:^|}{8:1}{7:| Line }| + |{3:2}| Line | + |{3:3}| Line | + |{3:4}| Line | + |{3:5}| Line | + || | + {4:[Quickfix List] }| + :copen | + ]]) + + execute('cnext') + + screen:expect([[ + Line 1 | + {2:[No Name] [+] }| + |{3:1}| Line | + {7:^|}{8:2}{7:| Line }| + |{3:3}| Line | + |{3:4}| Line | + |{3:5}| Line | + || | + {4:[Quickfix List] }| + :cnext | + ]]) + end) + + it('combines with CursorLine', function() + execute('set cursorline') + execute('highlight QuickFixLine guifg=Red') + execute('highlight CursorLine guibg=Fuchsia') + + execute('copen') + + screen:expect([[ + {9:Line 1 }| + {2:[No Name] [+] }| + {10:^|1| Line }| + |{3:2}| Line | + |{3:3}| Line | + |{3:4}| Line | + |{3:5}| Line | + || | + {4:[Quickfix List] }| + :copen | + ]]) + + feed('j') + + screen:expect([[ + {9:Line 1 }| + {2:[No Name] [+] }| + {11:|1| Line }| + {9:^|}{12:2}{9:| Line }| + |{3:3}| Line | + |{3:4}| Line | + |{3:5}| Line | + || | + {4:[Quickfix List] }| + :copen | + ]]) + end) + + it('QuickFixLine background takes precedence over CursorLine', function() + execute('set cursorline') + execute('highlight QuickFixLine guibg=Red') + execute('highlight CursorLine guibg=Fuchsia') + + execute('copen') + + screen:expect([[ + {9:Line 1 }| + {2:[No Name] [+] }| + {7:^|}{8:1}{7:| Line }| + |{3:2}| Line | + |{3:3}| Line | + |{3:4}| Line | + |{3:5}| Line | + || | + {4:[Quickfix List] }| + :copen | + ]]) + + feed('j') + + screen:expect([[ + {9:Line 1 }| + {2:[No Name] [+] }| + {7:|}{8:1}{7:| Line }| + {9:^|}{12:2}{9:| Line }| + |{3:3}| Line | + |{3:4}| Line | + |{3:5}| Line | + || | + {4:[Quickfix List] }| + :copen | + ]]) + end) +end) diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua index d7af2a4fce..96324bfac5 100644 --- a/test/functional/ui/screen.lua +++ b/test/functional/ui/screen.lua @@ -106,7 +106,7 @@ -- use `screen:snapshot_util({},true)` local helpers = require('test.functional.helpers')(nil) -local request, run = helpers.request, helpers.run +local request, run, uimeths = helpers.request, helpers.run, helpers.uimeths local dedent = helpers.dedent local Screen = {} @@ -192,22 +192,22 @@ function Screen:set_default_attr_ignore(attr_ignore) self._default_attr_ignore = attr_ignore end -function Screen:attach(rgb) - if rgb == nil then - rgb = true +function Screen:attach(options) + if options == nil then + options = {rgb=true} end - request('ui_attach', self._width, self._height, rgb) + uimeths.attach(self._width, self._height, options) end function Screen:detach() - request('ui_detach') + uimeths.detach() end function Screen:try_resize(columns, rows) - request('ui_try_resize', columns, rows) + uimeths.try_resize(columns, rows) end -function Screen:expect(expected, attr_ids, attr_ignore) +function Screen:expect(expected, attr_ids, attr_ignore, condition) -- remove the last line and dedent expected = dedent(expected:gsub('\n[ ]+$', '')) local expected_rows = {} @@ -219,6 +219,12 @@ function Screen:expect(expected, attr_ids, attr_ignore) local ids = attr_ids or self._default_attr_ids local ignore = attr_ignore or self._default_attr_ignore self:wait(function() + if condition ~= nil then + local status, res = pcall(condition) + if not status then + return tostring(res) + end + end local actual_rows = {} for i = 1, self._height do actual_rows[i] = self:_row_repr(self._rows[i], ids, ignore) @@ -234,8 +240,10 @@ function Screen:expect(expected, attr_ids, attr_ignore) return ( 'Row ' .. tostring(i) .. ' didn\'t match.\n' .. 'Expected:\n|' .. table.concat(msg_expected_rows, '|\n|') .. '|\n' - .. 'Actual:\n|' .. table.concat(actual_rows, '|\n|') .. '|' - ) + .. 'Actual:\n|' .. table.concat(actual_rows, '|\n|') .. '|\n\n' .. [[ +To print the expect() call that would assert the current screen state, use +screen:snaphot_util(). In case of non-deterministic failures, use +screen:redraw_debug() to show all intermediate screen states. ]]) end end end) @@ -301,12 +309,20 @@ function Screen:_redraw(updates) local method = update[1] for i = 2, #update do local handler = self['_handle_'..method] - handler(self, unpack(update[i])) + if handler ~= nil then + handler(self, unpack(update[i])) + else + self._on_event(method, update[i]) + end end -- print(self:_current_screen()) end end +function Screen:set_on_event_handler(callback) + self._on_event = callback +end + function Screen:_handle_resize(width, height) local rows = {} for _ = 1, height do diff --git a/test/functional/ui/screen_basic_spec.lua b/test/functional/ui/screen_basic_spec.lua index 9249be4aec..2b44b92336 100644 --- a/test/functional/ui/screen_basic_spec.lua +++ b/test/functional/ui/screen_basic_spec.lua @@ -4,6 +4,8 @@ local spawn, set_session, clear = helpers.spawn, helpers.set_session, helpers.cl local feed, execute = helpers.feed, helpers.execute local insert = helpers.insert +if helpers.pending_win32(pending) then return end + describe('Initial screen', function() local screen local nvim_argv = {helpers.nvim_prog, '-u', 'NONE', '-i', 'NONE', '-N', @@ -15,7 +17,10 @@ describe('Initial screen', function() set_session(screen_nvim) screen = Screen.new() screen:attach() - screen:set_default_attr_ignore( {{bold=true, foreground=255}} ) + screen:set_default_attr_ids( { + [0] = {bold=true, foreground=255}, + [1] = {bold=true, reverse=true}, + } ) end) after_each(function() @@ -25,18 +30,18 @@ describe('Initial screen', function() it('is the default initial screen', function() screen:expect([[ ^ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - [No Name] | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {1:[No Name] }| | ]]) end) @@ -49,7 +54,16 @@ describe('Screen', function() clear() screen = Screen.new() screen:attach() - screen:set_default_attr_ignore( {{bold=true, foreground=255}} ) + screen:set_default_attr_ids( { + [0] = {bold=true, foreground=255}, + [1] = {bold=true, reverse=true}, + [2] = {bold=true}, + [3] = {reverse=true}, + [4] = {background = Screen.colors.LightGrey, underline = true}, + [5] = {background = Screen.colors.LightGrey, underline = true, bold = true, foreground = Screen.colors.Fuchsia}, + [6] = {bold = true, foreground = Screen.colors.Fuchsia}, + [7] = {bold = true, foreground = Screen.colors.SeaGreen}, + } ) end) after_each(function() @@ -147,18 +161,18 @@ describe('Screen', function() execute('sp') screen:expect([[ ^ | - ~ | - ~ | - ~ | - ~ | - ~ | - [No Name] | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {1:[No Name] }| | - ~ | - ~ | - ~ | - ~ | - [No Name] | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {3:[No Name] }| :sp | ]]) end) @@ -168,18 +182,18 @@ describe('Screen', function() execute('resize 8') screen:expect([[ ^ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - [No Name] | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {1:[No Name] }| | - ~ | - ~ | - [No Name] | + {0:~ }| + {0:~ }| + {3:[No Name] }| :resize 8 | ]]) end) @@ -187,36 +201,36 @@ describe('Screen', function() it('horizontal and vertical', function() execute('sp', 'vsp', 'vsp') screen:expect([[ - ^ | | | - ~ |~ |~ | - ~ |~ |~ | - ~ |~ |~ | - ~ |~ |~ | - ~ |~ |~ | - [No Name] [No Name] [No Name] | + ^ {3:|} {3:|} | + {0:~ }{3:|}{0:~ }{3:|}{0:~ }| + {0:~ }{3:|}{0:~ }{3:|}{0:~ }| + {0:~ }{3:|}{0:~ }{3:|}{0:~ }| + {0:~ }{3:|}{0:~ }{3:|}{0:~ }| + {0:~ }{3:|}{0:~ }{3:|}{0:~ }| + {1:[No Name] }{3:[No Name] [No Name] }| | - ~ | - ~ | - ~ | - ~ | - [No Name] | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {3:[No Name] }| | ]]) insert('hello') screen:expect([[ - hell^o |hello |hello | - ~ |~ |~ | - ~ |~ |~ | - ~ |~ |~ | - ~ |~ |~ | - ~ |~ |~ | - [No Name] [+] [No Name] [+] [No Name] [+] | + hell^o {3:|}hello {3:|}hello | + {0:~ }{3:|}{0:~ }{3:|}{0:~ }| + {0:~ }{3:|}{0:~ }{3:|}{0:~ }| + {0:~ }{3:|}{0:~ }{3:|}{0:~ }| + {0:~ }{3:|}{0:~ }{3:|}{0:~ }| + {0:~ }{3:|}{0:~ }{3:|}{0:~ }| + {1:[No Name] [+] }{3:[No Name] [+] [No Name] [+] }| hello | - ~ | - ~ | - ~ | - ~ | - [No Name] [+] | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {3:[No Name] [+] }| | ]]) end) @@ -228,55 +242,55 @@ describe('Screen', function() execute('sp', 'vsp', 'vsp') insert('hello') screen:expect([[ - hell^o |hello |hello | - ~ |~ |~ | - ~ |~ |~ | - ~ |~ |~ | - ~ |~ |~ | - ~ |~ |~ | - [No Name] [+] [No Name] [+] [No Name] [+] | + hell^o {3:|}hello {3:|}hello | + {0:~ }{3:|}{0:~ }{3:|}{0:~ }| + {0:~ }{3:|}{0:~ }{3:|}{0:~ }| + {0:~ }{3:|}{0:~ }{3:|}{0:~ }| + {0:~ }{3:|}{0:~ }{3:|}{0:~ }| + {0:~ }{3:|}{0:~ }{3:|}{0:~ }| + {1:[No Name] [+] }{3:[No Name] [+] [No Name] [+] }| hello | - ~ | - ~ | - ~ | - ~ | - [No Name] [+] | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {3:[No Name] [+] }| | ]]) execute('tabnew') insert('hello2') feed('h') screen:expect([[ - 4+ [No Name] + [No Name] X| + {4: }{5:4}{4:+ [No Name] }{2: + [No Name] }{3: }{4:X}| hell^o2 | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| | ]]) execute('tabprevious') screen:expect([[ - 4+ [No Name] + [No Name] X| - hell^o |hello |hello | - ~ |~ |~ | - ~ |~ |~ | - ~ |~ |~ | - ~ |~ |~ | - ~ |~ |~ | - [No Name] [+] [No Name] [+] [No Name] [+] | + {2: }{6:4}{2:+ [No Name] }{4: + [No Name] }{3: }{4:X}| + hell^o {3:|}hello {3:|}hello | + {0:~ }{3:|}{0:~ }{3:|}{0:~ }| + {0:~ }{3:|}{0:~ }{3:|}{0:~ }| + {0:~ }{3:|}{0:~ }{3:|}{0:~ }| + {0:~ }{3:|}{0:~ }{3:|}{0:~ }| + {0:~ }{3:|}{0:~ }{3:|}{0:~ }| + {1:[No Name] [+] }{3:[No Name] [+] [No Name] [+] }| hello | - ~ | - ~ | - ~ | - [No Name] [+] | + {0:~ }| + {0:~ }| + {0:~ }| + {3:[No Name] [+] }| | ]]) end) @@ -289,17 +303,17 @@ describe('Screen', function() line 1 | line 2 | ^ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - -- INSERT -- | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {2:-- INSERT --} | ]]) end) end) @@ -314,17 +328,17 @@ describe('Screen', function() screen:expect([[ 0123^456 | 789 | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| :set ruler 1,5 All | ]]) end) @@ -335,18 +349,18 @@ describe('Screen', function() feed(':ls') screen:expect([[ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| :ls^ | ]]) end) @@ -354,20 +368,20 @@ describe('Screen', function() it('execute command with multi-line output', function() feed(':ls<cr>') screen:expect([[ - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| :ls | 1 %a "[No Name]" line 1 | - Press ENTER or type command to continue^ | + {7:Press ENTER or type command to continue}^ | ]]) feed('<cr>') -- skip the "Press ENTER..." state or tests will hang end) @@ -392,19 +406,19 @@ describe('Screen', function() ]]) execute('sp', 'vsp', 'vsp') screen:expect([[ - and |and |and | - clearing |clearing |clearing | - in |in |in | - split |split |split | - windows |windows |windows | - ^ | | | - [No Name] [+] [No Name] [+] [No Name] [+] | + and {3:|}and {3:|}and | + clearing {3:|}clearing {3:|}clearing | + in {3:|}in {3:|}in | + split {3:|}split {3:|}split | + windows {3:|}windows {3:|}windows | + ^ {3:|} {3:|} | + {1:[No Name] [+] }{3:[No Name] [+] [No Name] [+] }| clearing | in | split | windows | | - [No Name] [+] | + {3:[No Name] [+] }| | ]]) end) @@ -412,121 +426,121 @@ describe('Screen', function() it('only affects the current scroll region', function() feed('6k') screen:expect([[ - ^scrolling |and |and | - and |clearing |clearing | - clearing |in |in | - in |split |split | - split |windows |windows | - windows | | | - [No Name] [+] [No Name] [+] [No Name] [+] | + ^scrolling {3:|}and {3:|}and | + and {3:|}clearing {3:|}clearing | + clearing {3:|}in {3:|}in | + in {3:|}split {3:|}split | + split {3:|}windows {3:|}windows | + windows {3:|} {3:|} | + {1:[No Name] [+] }{3:[No Name] [+] [No Name] [+] }| clearing | in | split | windows | | - [No Name] [+] | + {3:[No Name] [+] }| | ]]) feed('<c-w>l') screen:expect([[ - scrolling |and |and | - and |clearing |clearing | - clearing |in |in | - in |split |split | - split |windows |windows | - windows |^ | | - [No Name] [+] [No Name] [+] <Name] [+] | + scrolling {3:|}and {3:|}and | + and {3:|}clearing {3:|}clearing | + clearing {3:|}in {3:|}in | + in {3:|}split {3:|}split | + split {3:|}windows {3:|}windows | + windows {3:|}^ {3:|} | + {3:[No Name] [+] }{1:[No Name] [+] }{3:<Name] [+] }| clearing | in | split | windows | | - [No Name] [+] | + {3:[No Name] [+] }| | ]]) feed('gg') screen:expect([[ - scrolling |^Inserting |and | - and |text |clearing | - clearing |with |in | - in |many |split | - split |lines |windows | - windows |to | | - [No Name] [+] [No Name] [+] <Name] [+] | + scrolling {3:|}^Inserting {3:|}and | + and {3:|}text {3:|}clearing | + clearing {3:|}with {3:|}in | + in {3:|}many {3:|}split | + split {3:|}lines {3:|}windows | + windows {3:|}to {3:|} | + {3:[No Name] [+] }{1:[No Name] [+] }{3:<Name] [+] }| clearing | in | split | windows | | - [No Name] [+] | + {3:[No Name] [+] }| | ]]) feed('7j') screen:expect([[ - scrolling |with |and | - and |many |clearing | - clearing |lines |in | - in |to |split | - split |test |windows | - windows |^scrolling | | - [No Name] [+] [No Name] [+] <Name] [+] | + scrolling {3:|}with {3:|}and | + and {3:|}many {3:|}clearing | + clearing {3:|}lines {3:|}in | + in {3:|}to {3:|}split | + split {3:|}test {3:|}windows | + windows {3:|}^scrolling {3:|} | + {3:[No Name] [+] }{1:[No Name] [+] }{3:<Name] [+] }| clearing | in | split | windows | | - [No Name] [+] | + {3:[No Name] [+] }| | ]]) feed('2j') screen:expect([[ - scrolling |lines |and | - and |to |clearing | - clearing |test |in | - in |scrolling |split | - split |and |windows | - windows |^clearing | | - [No Name] [+] [No Name] [+] <Name] [+] | + scrolling {3:|}lines {3:|}and | + and {3:|}to {3:|}clearing | + clearing {3:|}test {3:|}in | + in {3:|}scrolling {3:|}split | + split {3:|}and {3:|}windows | + windows {3:|}^clearing {3:|} | + {3:[No Name] [+] }{1:[No Name] [+] }{3:<Name] [+] }| clearing | in | split | windows | | - [No Name] [+] | + {3:[No Name] [+] }| | ]]) feed('5k') screen:expect([[ - scrolling |^lines |and | - and |to |clearing | - clearing |test |in | - in |scrolling |split | - split |and |windows | - windows |clearing | | - [No Name] [+] [No Name] [+] <Name] [+] | + scrolling {3:|}^lines {3:|}and | + and {3:|}to {3:|}clearing | + clearing {3:|}test {3:|}in | + in {3:|}scrolling {3:|}split | + split {3:|}and {3:|}windows | + windows {3:|}clearing {3:|} | + {3:[No Name] [+] }{1:[No Name] [+] }{3:<Name] [+] }| clearing | in | split | windows | | - [No Name] [+] | + {3:[No Name] [+] }| | ]]) feed('k') screen:expect([[ - scrolling |^many |and | - and |lines |clearing | - clearing |to |in | - in |test |split | - split |scrolling |windows | - windows |and | | - [No Name] [+] [No Name] [+] <Name] [+] | + scrolling {3:|}^many {3:|}and | + and {3:|}lines {3:|}clearing | + clearing {3:|}to {3:|}in | + in {3:|}test {3:|}split | + split {3:|}scrolling {3:|}windows | + windows {3:|}and {3:|} | + {3:[No Name] [+] }{1:[No Name] [+] }{3:<Name] [+] }| clearing | in | split | windows | | - [No Name] [+] | + {3:[No Name] [+] }| | ]]) end) @@ -541,10 +555,10 @@ describe('Screen', function() it('rebuilds the whole screen', function() screen:expect([[ resize^ | - ~ | - ~ | - ~ | - -- INSERT -- | + {0:~ }| + {0:~ }| + {0:~ }| + {2:-- INSERT --} | ]]) end) diff --git a/test/functional/ui/searchhl_spec.lua b/test/functional/ui/searchhl_spec.lua index 894a75d355..3914648e8f 100644 --- a/test/functional/ui/searchhl_spec.lua +++ b/test/functional/ui/searchhl_spec.lua @@ -3,26 +3,22 @@ local Screen = require('test.functional.ui.screen') local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert local execute = helpers.execute +if helpers.pending_win32(pending) then return end + describe('search highlighting', function() local screen local colors = Screen.colors - local hl_colors = { - NonText = colors.Blue, - Search = colors.Yellow, - Message = colors.Red, - } before_each(function() clear() screen = Screen.new(40, 7) screen:attach() - --ignore highligting of ~-lines screen:set_default_attr_ids( { - [1] = {background = hl_colors.Search}, - [2] = {reverse = true}, - [3] = {foreground = hl_colors.Message}, + [1] = {bold=true, foreground=Screen.colors.Blue}, + [2] = {background = colors.Yellow}, -- Search + [3] = {reverse = true}, + [4] = {foreground = colors.Red}, -- Message }) - screen:set_default_attr_ignore( {{bold=true, foreground=hl_colors.NonText}} ) end) it('is disabled by ":set nohlsearch"', function() @@ -32,10 +28,10 @@ describe('search highlighting', function() screen:expect([[ some ^text | more text | - ~ | - ~ | - ~ | - ~ | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| /text | ]]) end) @@ -51,35 +47,35 @@ describe('search highlighting', function() -- 'hlsearch' is enabled by default. #2859 feed("gg/text<cr>") screen:expect([[ - some {1:^text} | - more {1:text}stuff | - stupid{1:texttext}stuff | - a {1:text} word | + some {2:^text} | + more {2:text}stuff | + stupid{2:texttext}stuff | + a {2:text} word | | - ~ | + {1:~ }| /text | ]]) -- overlapping matches not allowed feed("3nx") screen:expect([[ - some {1:text} | - more {1:text}stuff | - stupid{1:text}^extstuff | - a {1:text} word | + some {2:text} | + more {2:text}stuff | + stupid{2:text}^extstuff | + a {2:text} word | | - ~ | + {1:~ }| /text | ]]) feed("ggn*") -- search for entire word screen:expect([[ - some {1:text} | + some {2:text} | more textstuff | stupidtextextstuff | - a {1:^text} word | + a {2:^text} word | | - ~ | + {1:~ }| /\<text\> | ]]) @@ -90,7 +86,7 @@ describe('search highlighting', function() stupidtextextstuff | a ^text word | | - ~ | + {1:~ }| :nohlsearch | ]]) end) @@ -104,45 +100,45 @@ describe('search highlighting', function() ]]) feed("gg/li") screen:expect([[ - the first {2:li}ne | + the first {3:li}ne | in a little file | | - ~ | - ~ | - ~ | + {1:~ }| + {1:~ }| + {1:~ }| /li^ | ]]) feed("t") screen:expect([[ the first line | - in a {2:lit}tle file | + in a {3:lit}tle file | | - ~ | - ~ | - ~ | + {1:~ }| + {1:~ }| + {1:~ }| /lit^ | ]]) feed("<cr>") screen:expect([[ the first line | - in a {1:^lit}tle file | + in a {2:^lit}tle file | | - ~ | - ~ | - ~ | + {1:~ }| + {1:~ }| + {1:~ }| /lit | ]]) feed("/fir") screen:expect([[ - the {2:fir}st line | - in a {1:lit}tle file | + the {3:fir}st line | + in a {2:lit}tle file | | - ~ | - ~ | - ~ | + {1:~ }| + {1:~ }| + {1:~ }| /fir^ | ]]) @@ -150,11 +146,11 @@ describe('search highlighting', function() feed("<esc>/ttle") screen:expect([[ the first line | - in a {1:li}{2:ttle} file | + in a {2:li}{3:ttle} file | | - ~ | - ~ | - ~ | + {1:~ }| + {1:~ }| + {1:~ }| /ttle^ | ]]) end) @@ -168,12 +164,12 @@ describe('search highlighting', function() feed("gg/mat/e") screen:expect([[ - not the {2:mat}ch you're looking for | + not the {3:mat}ch you're looking for | the match is here | - ~ | - ~ | - ~ | - ~ | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| /mat/e^ | ]]) @@ -181,22 +177,22 @@ describe('search highlighting', function() feed("<esc>2/mat/e") screen:expect([[ not the match you're looking for | - the {2:mat}ch is here | - ~ | - ~ | - ~ | - ~ | + the {3:mat}ch is here | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| /mat/e^ | ]]) feed("<cr>") screen:expect([[ - not the {1:mat}ch you're looking for | - the {1:ma^t}ch is here | - ~ | - ~ | - ~ | - ~ | + not the {2:mat}ch you're looking for | + the {2:ma^t}ch is here | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| /mat/e | ]]) end) @@ -207,28 +203,37 @@ describe('search highlighting', function() feed('/line\\na<cr>') screen:expect([[ | - a repeated {1:^line} | - {1:a} repeated {1:line} | - {1:a} repeated {1:line} | - {1:a} repeated line | - ~ | - {3:search hit BOTTOM, continuing at TOP} | + a repeated {2:^line} | + {2:a} repeated {2:line} | + {2:a} repeated {2:line} | + {2:a} repeated line | + {1:~ }| + {4:search hit BOTTOM, continuing at TOP} | ]]) -- it redraws rows above the changed one feed('4Grb') screen:expect([[ | - a repeated {1:line} | - {1:a} repeated line | - ^b repeated {1:line} | - {1:a} repeated line | - ~ | - {3:search hit BOTTOM, continuing at TOP} | + a repeated {2:line} | + {2:a} repeated line | + ^b repeated {2:line} | + {2:a} repeated line | + {1:~ }| + {4:search hit BOTTOM, continuing at TOP} | ]]) end) it('works with matchadd and syntax', function() + screen:set_default_attr_ids( { + [1] = {bold=true, foreground=Screen.colors.Blue}, + [2] = {background = colors.Yellow}, + [3] = {reverse = true}, + [4] = {foreground = colors.Red}, + [5] = {bold = true, background = colors.Green}, + [6] = {italic = true, background = colors.Magenta}, + [7] = {bold = true, background = colors.Yellow}, + } ) execute('set hlsearch') insert([[ very special text @@ -243,25 +248,23 @@ describe('search highlighting', function() -- is used (and matches with lower priorities are not combined) execute("/ial te") screen:expect([[ - very {4:spec^ial}{1: te}{5:xt} | + very {5:spec^ial}{2: te}{6:xt} | | - ~ | - ~ | - ~ | - ~ | - {3:search hit BOTTOM, continuing at TOP} | - ]], {[1] = {background = hl_colors.Search}, [2] = {reverse = true}, - [3] = {foreground = hl_colors.Message}, [4] = {bold = true, background = - colors.Green}, [5] = {italic = true, background = colors.Magenta}}) + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {4:search hit BOTTOM, continuing at TOP} | + ]]) execute("call clearmatches()") screen:expect([[ - very spec{1:^ial te}xt | + very spec{2:^ial te}xt | | - ~ | - ~ | - ~ | - ~ | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| :call clearmatches() | ]]) @@ -269,16 +272,14 @@ describe('search highlighting', function() -- nonconflicting attributes are combined execute("syntax keyword MyGroup special") screen:expect([[ - very {4:spec}{5:^ial}{1: te}xt | + very {5:spec}{7:^ial}{2: te}xt | | - ~ | - ~ | - ~ | - ~ | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| :syntax keyword MyGroup special | - ]], {[1] = {background = hl_colors.Search}, [2] = {reverse = true}, - [3] = {foreground = hl_colors.Message}, [4] = {bold = true, - background = colors.Green}, [5] = {bold = true, background = hl_colors.Search}}) + ]]) end) end) diff --git a/test/functional/ui/sign_spec.lua b/test/functional/ui/sign_spec.lua index 2b6e294627..d02fc83809 100644 --- a/test/functional/ui/sign_spec.lua +++ b/test/functional/ui/sign_spec.lua @@ -2,6 +2,8 @@ local helpers = require('test.functional.helpers')(after_each) local Screen = require('test.functional.ui.screen') local clear, feed, execute = helpers.clear, helpers.feed, helpers.execute +if helpers.pending_win32(pending) then return end + describe('Signs', function() local screen @@ -9,7 +11,11 @@ describe('Signs', function() clear() screen = Screen.new() screen:attach() - screen:set_default_attr_ignore( {{}, {bold=true, foreground=255}} ) + screen:set_default_attr_ids( { + [0] = {bold=true, foreground=255}, + [1] = {background = Screen.colors.Yellow}, + [2] = {foreground = Screen.colors.DarkBlue, background = Screen.colors.Grey}, + } ) end) after_each(function() @@ -25,19 +31,19 @@ describe('Signs', function() execute('sign place 2 line=3 name=piet buffer=1') execute('sign place 3 line=1 name=pietx buffer=1') screen:expect([[ - >!a | - b | - >>c | - ^ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | + {1:>!}a | + {2: }b | + {1:>>}c | + {2: }^ | + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| :sign place 3 line=1 name=pietx buffer=1 | ]]) end) diff --git a/test/functional/ui/syntax_conceal_spec.lua b/test/functional/ui/syntax_conceal_spec.lua index c2ab0711c0..58e3597233 100644 --- a/test/functional/ui/syntax_conceal_spec.lua +++ b/test/functional/ui/syntax_conceal_spec.lua @@ -3,6 +3,8 @@ local Screen = require('test.functional.ui.screen') local clear, feed, execute = helpers.clear, helpers.feed, helpers.execute local insert = helpers.insert +if helpers.pending_win32(pending) then return end + describe('Screen', function() local screen @@ -10,8 +12,10 @@ describe('Screen', function() clear() screen = Screen.new(nil,10) screen:attach() - screen:set_default_attr_ignore( {{bold=true, foreground=255}} ) - screen:set_default_attr_ids( {{foreground = Screen.colors.LightGrey, background = Screen.colors.DarkGray}} ) + screen:set_default_attr_ids( { + [0] = {bold=true, foreground=Screen.colors.Blue}, + [1] = {foreground = Screen.colors.LightGrey, background = Screen.colors.DarkGray} + } ) end) after_each(function() @@ -46,8 +50,8 @@ describe('Screen', function() {1:∧} | {1:∧} | ^ | - ~ | - ~ | + {0:~ }| + {0:~ }| :syn match dAmpersand '[&][&]' conceal cchar=∧ | ]]) end) @@ -62,8 +66,8 @@ describe('Screen', function() {1:∧} | ^&& | | - ~ | - ~ | + {0:~ }| + {0:~ }| :syn match dAmpersand '[&][&]' conceal cchar=∧ | ]]) end) @@ -78,8 +82,8 @@ describe('Screen', function() {1:∧} | {1:∧} | | - ~ | - ~ | + {0:~ }| + {0:~ }| :syn match dAmpersand '[&][&]' conceal cchar=∧ | ]]) end) @@ -94,8 +98,8 @@ describe('Screen', function() {1:∧} | {1:∧} | | - ~ | - ~ | + {0:~ }| + {0:~ }| :syn match dAmpersand '[&][&]' conceal cchar=∧ | ]]) end) @@ -110,8 +114,8 @@ describe('Screen', function() {1:∧} | {1:∧} | ^ | - ~ | - ~ | + {0:~ }| + {0:~ }| :syn match dAmpersand '[&][&]' conceal cchar=∧ | ]]) end) @@ -125,12 +129,12 @@ describe('Screen', function() {1:λ} | {1:λ} | ^ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| :syn keyword kLambda lambda conceal cchar=λ | ]]) end) -- Keyword @@ -149,12 +153,12 @@ describe('Screen', function() {1:R} | {1:R} | ^ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| | ]]) end) @@ -167,12 +171,12 @@ describe('Screen', function() {1: } a region of text {1:-} | {1: } a region of text {1:-} | ^ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| | ]]) end) @@ -186,10 +190,10 @@ describe('Screen', function() {1: } A region with {1: } a nested {1: } nested region.{1:-} | {1:-} {1:-} | ^ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| | ]]) end) @@ -208,12 +212,12 @@ describe('Screen', function() {1:-} | {1:-} | ^ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| :syn region rText start='<r>' end='</r>' cchar=- | ]]) end) @@ -229,10 +233,10 @@ describe('Screen', function() <i> italian text </i> | <i> italian text </i> | ^ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| :syn region iText start='<i>' end='</i>' cchar=* | ]]) execute("syntax conceal on") @@ -243,10 +247,10 @@ describe('Screen', function() {1:*} | {1:*} | ^ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| :syn region iText start='<i>' end='</i>' cchar=* | ]]) end) @@ -271,10 +275,10 @@ describe('Screen', function() + With cchar | | ^ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| :let &conceallevel=0 | ]]) end) @@ -287,10 +291,10 @@ describe('Screen', function() {1:C} | | ^ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| :let &conceallevel=1 | ]]) end) @@ -303,10 +307,10 @@ describe('Screen', function() {1:C} | | ^ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| :let &conceallevel=2 | ]]) end) @@ -319,10 +323,10 @@ describe('Screen', function() | | ^ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| :let &conceallevel=3 | ]]) end) diff --git a/test/functional/ui/wildmode_spec.lua b/test/functional/ui/wildmode_spec.lua index 2a55d27567..6a6dc99c3d 100644 --- a/test/functional/ui/wildmode_spec.lua +++ b/test/functional/ui/wildmode_spec.lua @@ -3,6 +3,8 @@ local Screen = require('test.functional.ui.screen') local clear, feed, execute = helpers.clear, helpers.feed, helpers.execute local funcs = helpers.funcs +if helpers.pending_win32(pending) then return end + describe("'wildmode'", function() local screen @@ -39,7 +41,7 @@ describe('command line completion', function() clear() screen = Screen.new(40, 5) screen:attach() - screen:set_default_attr_ignore({{bold=true, foreground=Screen.colors.Blue}}) + screen:set_default_attr_ids({[1]={bold=true, foreground=Screen.colors.Blue}}) end) after_each(function() @@ -55,9 +57,9 @@ describe('command line completion', function() feed(':!<tab><bs>') screen:expect([[ | - ~ | - ~ | - ~ | + {1:~ }| + {1:~ }| + {1:~ }| :!Xtest-functional-viml-compl-dir^ | ]]) end) diff --git a/test/functional/viml/completion_spec.lua b/test/functional/viml/completion_spec.lua index 33f481bae2..0897c2d836 100644 --- a/test/functional/viml/completion_spec.lua +++ b/test/functional/viml/completion_spec.lua @@ -4,6 +4,8 @@ local clear, feed = helpers.clear, helpers.feed local eval, eq, neq = helpers.eval, helpers.eq, helpers.neq local execute, source, expect = helpers.execute, helpers.source, helpers.expect +if helpers.pending_win32(pending) then return end + describe('completion', function() local screen @@ -11,8 +13,8 @@ describe('completion', function() clear() screen = Screen.new(60, 8) screen:attach() - screen:set_default_attr_ignore({{bold=true, foreground=Screen.colors.Blue}}) screen:set_default_attr_ids({ + [0] = {bold=true, foreground=Screen.colors.Blue}, [1] = {background = Screen.colors.LightMagenta}, [2] = {background = Screen.colors.Grey}, [3] = {bold = true}, @@ -20,6 +22,8 @@ describe('completion', function() [5] = {foreground = Screen.colors.Red}, [6] = {background = Screen.colors.Black}, [7] = {foreground = Screen.colors.White, background = Screen.colors.Red}, + [8] = {reverse = true}, + [9] = {bold = true, reverse = true}, }) end) @@ -32,22 +36,22 @@ describe('completion', function() screen:expect([[ foo | foo^ | - ~ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| {3:-- Keyword Local completion (^N^P) The only match} | ]]) feed('<C-e>') screen:expect([[ foo | ^ | - ~ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| {3:-- INSERT --} | ]]) feed('<ESC>') @@ -95,12 +99,12 @@ describe('completion', function() eq('foo', eval('getline(1)')) screen:expect([[ foo^ | - {2:bar foobaz baz } | - {1:abbr kind menu } | - ~ | - ~ | - ~ | - ~ | + {2:bar foobaz baz }{0: }| + {1:abbr kind menu }{0: }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| {3:-- Omni completion (^O^N^P) }{4:match 1 of 2} | ]]) eq({word = 'foo', abbr = 'bar', menu = 'baz', @@ -125,11 +129,11 @@ describe('completion', function() screen:expect([[ foo | ^ | - ~ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| {3:-- INSERT --} | ]]) feed('<C-x>') @@ -137,22 +141,22 @@ describe('completion', function() screen:expect([[ foo | ^ | - ~ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| {3:-- ^X mode (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y)} | ]]) feed('<C-n>') screen:expect([[ foo | foo^ | - {2:foo } | - ~ | - ~ | - ~ | - ~ | + {2:foo }{0: }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| {3:-- Keyword Local completion (^N^P) The only match} | ]]) feed('bar<ESC>') @@ -162,10 +166,10 @@ describe('completion', function() foo | foobar | foo^ | - {2:foo } | - ~ | - ~ | - ~ | + {2:foo }{0: }| + {0:~ }| + {0:~ }| + {0:~ }| {3:-- INSERT --} | ]]) eq('foo', eval('getline(3)')) @@ -176,22 +180,22 @@ describe('completion', function() screen:expect([[ foo | ^ | - {2:foo } | - ~ | - ~ | - ~ | - ~ | + {2:foo }{0: }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| {3:-- Keyword Local completion (^N^P) The only match} | ]]) feed('<C-y>') screen:expect([[ foo | foo^ | - ~ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| {3:-- INSERT --} | ]]) feed('<ESC>') @@ -201,10 +205,10 @@ describe('completion', function() foo | foo | ^ | - {2:foo } | - ~ | - ~ | - ~ | + {2:foo }{0: }| + {0:~ }| + {0:~ }| + {0:~ }| {3:-- INSERT --} | ]]) feed('<C-y><ESC>') @@ -216,22 +220,22 @@ describe('completion', function() screen:expect([[ foo | ^ | - {1:foo } | - ~ | - ~ | - ~ | - ~ | + {1:foo }{0: }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| {3:-- Keyword Local completion (^N^P) }{5:Back at original} | ]]) feed('b') screen:expect([[ foo | b^ | - ~ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| {3:-- Keyword Local completion (^N^P) }{5:Back at original} | ]]) feed('ar<ESC>') @@ -241,10 +245,10 @@ describe('completion', function() foo | bar | ^ | - {1:foo } | - ~ | - ~ | - ~ | + {1:foo }{0: }| + {0:~ }| + {0:~ }| + {0:~ }| {3:-- INSERT --} | ]]) feed('bar<ESC>') @@ -256,22 +260,22 @@ describe('completion', function() screen:expect([[ foo | ^ | - {1:foo } | - ~ | - ~ | - ~ | - ~ | + {1:foo }{0: }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| {3:-- Keyword Local completion (^N^P) }{5:Back at original} | ]]) feed('<ESC>') screen:expect([[ foo | ^ | - ~ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| | ]]) eq('', eval('getline(2)')) @@ -280,10 +284,10 @@ describe('completion', function() foo | | ^ | - {1:foo } | - ~ | - ~ | - ~ | + {1:foo }{0: }| + {0:~ }| + {0:~ }| + {0:~ }| {3:-- INSERT --} | ]]) feed('<ESC>') @@ -291,10 +295,10 @@ describe('completion', function() foo | | ^ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| | ]]) eq('', eval('getline(3)')) @@ -344,56 +348,56 @@ describe('completion', function() feed('i<C-x><C-u>') screen:expect([[ ^ | - {1:January }{6: } | - {1:February }{6: } | - {1:March }{6: } | - {1:April }{2: } | - {1:May }{2: } | - {1:June }{2: } | + {1:January }{6: }{0: }| + {1:February }{6: }{0: }| + {1:March }{6: }{0: }| + {1:April }{2: }{0: }| + {1:May }{2: }{0: }| + {1:June }{2: }{0: }| {3:-- User defined completion (^U^N^P) }{5:Back at original} | ]]) feed('u') screen:expect([[ u^ | - {1:January } | - {1:February } | - {1:June } | - {1:July } | - {1:August } | - ~ | + {1:January }{0: }| + {1:February }{0: }| + {1:June }{0: }| + {1:July }{0: }| + {1:August }{0: }| + {0:~ }| {3:-- User defined completion (^U^N^P) }{5:Back at original} | ]]) feed('g') screen:expect([[ ug^ | - {1:August } | - ~ | - ~ | - ~ | - ~ | - ~ | + {1:August }{0: }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| {3:-- User defined completion (^U^N^P) }{5:Back at original} | ]]) feed('<Down>') screen:expect([[ ug^ | - {2:August } | - ~ | - ~ | - ~ | - ~ | - ~ | + {2:August }{0: }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| {3:-- User defined completion (^U^N^P) The only match} | ]]) feed('<C-y>') screen:expect([[ August^ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| {3:-- INSERT --} | ]]) expect('August') @@ -403,55 +407,55 @@ describe('completion', function() screen:expect([[ | Ja^ | - {1:January } | - ~ | - ~ | - ~ | - ~ | + {1:January }{0: }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| {3:-- User defined completion (^U^N^P) }{5:Back at original} | ]]) feed('<BS>') screen:expect([[ | J^ | - {1:January } | - {1:June } | - {1:July } | - ~ | - ~ | + {1:January }{0: }| + {1:June }{0: }| + {1:July }{0: }| + {0:~ }| + {0:~ }| {3:-- User defined completion (^U^N^P) }{5:Back at original} | ]]) feed('<C-n>') screen:expect([[ | January^ | - {2:January } | - {1:June } | - {1:July } | - ~ | - ~ | + {2:January }{0: }| + {1:June }{0: }| + {1:July }{0: }| + {0:~ }| + {0:~ }| {3:-- User defined completion (^U^N^P) }{4:match 1 of 3} | ]]) feed('<C-n>') screen:expect([[ | June^ | - {1:January } | - {2:June } | - {1:July } | - ~ | - ~ | + {1:January }{0: }| + {2:June }{0: }| + {1:July }{0: }| + {0:~ }| + {0:~ }| {3:-- User defined completion (^U^N^P) }{4:match 2 of 3} | ]]) feed('<Esc>') screen:expect([[ | Jun^e | - ~ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| | ]]) feed('.') @@ -459,10 +463,10 @@ describe('completion', function() | June | Jun^e | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| | ]]) expect([[ @@ -487,45 +491,45 @@ describe('completion', function() feed('i<C-r>=TestComplete()<CR>') screen:expect([[ ^ | - {1:0 }{6: } | - {1:1 }{2: } | - {1:2 }{2: } | - {1:3 }{2: } | - {1:4 }{2: } | - {1:5 }{2: } | + {1:0 }{6: }{0: }| + {1:1 }{2: }{0: }| + {1:2 }{2: }{0: }| + {1:3 }{2: }{0: }| + {1:4 }{2: }{0: }| + {1:5 }{2: }{0: }| {3:-- INSERT --} | ]]) feed('7') screen:expect([[ 7^ | - {1:7 }{6: } | - {1:70 }{6: } | - {1:71 }{6: } | - {1:72 }{2: } | - {1:73 }{2: } | - {1:74 }{2: } | + {1:7 }{6: }{0: }| + {1:70 }{6: }{0: }| + {1:71 }{6: }{0: }| + {1:72 }{2: }{0: }| + {1:73 }{2: }{0: }| + {1:74 }{2: }{0: }| {3:-- INSERT --} | ]]) feed('<c-n>') screen:expect([[ 7^ | - {2:7 }{6: } | - {1:70 }{6: } | - {1:71 }{6: } | - {1:72 }{2: } | - {1:73 }{2: } | - {1:74 }{2: } | + {2:7 }{6: }{0: }| + {1:70 }{6: }{0: }| + {1:71 }{6: }{0: }| + {1:72 }{2: }{0: }| + {1:73 }{2: }{0: }| + {1:74 }{2: }{0: }| {3:-- INSERT --} | ]]) feed('<c-n>') screen:expect([[ 70^ | - {1:7 }{6: } | - {2:70 }{6: } | - {1:71 }{6: } | - {1:72 }{2: } | - {1:73 }{2: } | - {1:74 }{2: } | + {1:7 }{6: }{0: }| + {2:70 }{6: }{0: }| + {1:71 }{6: }{0: }| + {1:72 }{2: }{0: }| + {1:73 }{2: }{0: }| + {1:74 }{2: }{0: }| {3:-- INSERT --} | ]]) end) @@ -534,111 +538,111 @@ describe('completion', function() feed('i<C-r>=TestComplete()<CR>') screen:expect([[ ^ | - {1:0 }{6: } | - {1:1 }{2: } | - {1:2 }{2: } | - {1:3 }{2: } | - {1:4 }{2: } | - {1:5 }{2: } | + {1:0 }{6: }{0: }| + {1:1 }{2: }{0: }| + {1:2 }{2: }{0: }| + {1:3 }{2: }{0: }| + {1:4 }{2: }{0: }| + {1:5 }{2: }{0: }| {3:-- INSERT --} | ]]) feed('<PageDown>') screen:expect([[ ^ | - {1:0 }{6: } | - {1:1 }{2: } | - {1:2 }{2: } | - {2:3 } | - {1:4 }{2: } | - {1:5 }{2: } | + {1:0 }{6: }{0: }| + {1:1 }{2: }{0: }| + {1:2 }{2: }{0: }| + {2:3 }{0: }| + {1:4 }{2: }{0: }| + {1:5 }{2: }{0: }| {3:-- INSERT --} | ]]) feed('<PageDown>') screen:expect([[ ^ | - {1:5 }{6: } | - {1:6 }{2: } | - {2:7 } | - {1:8 }{2: } | - {1:9 }{2: } | - {1:10 }{2: } | + {1:5 }{6: }{0: }| + {1:6 }{2: }{0: }| + {2:7 }{0: }| + {1:8 }{2: }{0: }| + {1:9 }{2: }{0: }| + {1:10 }{2: }{0: }| {3:-- INSERT --} | ]]) feed('<Down>') screen:expect([[ ^ | - {1:5 }{6: } | - {1:6 }{2: } | - {1:7 }{2: } | - {2:8 } | - {1:9 }{2: } | - {1:10 }{2: } | + {1:5 }{6: }{0: }| + {1:6 }{2: }{0: }| + {1:7 }{2: }{0: }| + {2:8 }{0: }| + {1:9 }{2: }{0: }| + {1:10 }{2: }{0: }| {3:-- INSERT --} | ]]) feed('<PageUp>') screen:expect([[ ^ | - {1:2 }{6: } | - {1:3 }{2: } | - {2:4 } | - {1:5 }{2: } | - {1:6 }{2: } | - {1:7 }{2: } | + {1:2 }{6: }{0: }| + {1:3 }{2: }{0: }| + {2:4 }{0: }| + {1:5 }{2: }{0: }| + {1:6 }{2: }{0: }| + {1:7 }{2: }{0: }| {3:-- INSERT --} | ]]) feed('<PageUp>') -- stop on first item screen:expect([[ ^ | - {2:0 }{6: } | - {1:1 }{2: } | - {1:2 }{2: } | - {1:3 }{2: } | - {1:4 }{2: } | - {1:5 }{2: } | + {2:0 }{6: }{0: }| + {1:1 }{2: }{0: }| + {1:2 }{2: }{0: }| + {1:3 }{2: }{0: }| + {1:4 }{2: }{0: }| + {1:5 }{2: }{0: }| {3:-- INSERT --} | ]]) feed('<PageUp>') -- when on first item, unselect screen:expect([[ ^ | - {1:0 }{6: } | - {1:1 }{2: } | - {1:2 }{2: } | - {1:3 }{2: } | - {1:4 }{2: } | - {1:5 }{2: } | + {1:0 }{6: }{0: }| + {1:1 }{2: }{0: }| + {1:2 }{2: }{0: }| + {1:3 }{2: }{0: }| + {1:4 }{2: }{0: }| + {1:5 }{2: }{0: }| {3:-- INSERT --} | ]]) feed('<PageUp>') -- when unselected, select last item screen:expect([[ ^ | - {1:95 }{2: } | - {1:96 }{2: } | - {1:97 }{2: } | - {1:98 }{2: } | - {1:99 }{2: } | - {2:100 }{6: } | + {1:95 }{2: }{0: }| + {1:96 }{2: }{0: }| + {1:97 }{2: }{0: }| + {1:98 }{2: }{0: }| + {1:99 }{2: }{0: }| + {2:100 }{6: }{0: }| {3:-- INSERT --} | ]]) feed('<PageUp>') screen:expect([[ ^ | - {1:94 }{2: } | - {1:95 }{2: } | - {2:96 } | - {1:97 }{2: } | - {1:98 }{2: } | - {1:99 }{6: } | + {1:94 }{2: }{0: }| + {1:95 }{2: }{0: }| + {2:96 }{0: }| + {1:97 }{2: }{0: }| + {1:98 }{2: }{0: }| + {1:99 }{6: }{0: }| {3:-- INSERT --} | ]]) feed('<cr>') screen:expect([[ 96^ | - ~ | - ~ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| {3:-- INSERT --} | ]]) end) @@ -651,22 +655,22 @@ describe('completion', function() screen:expect([[ ^foo | bar | - ~ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| | ]]) feed('A<C-x><C-l>') screen:expect([[ foo^ | bar | - ~ | - ~ | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| {3:-- Whole line completion (^L^N^P) }{7:Pattern not found} | ]]) eq(-1, eval('foldclosed(1)')) @@ -679,11 +683,11 @@ describe('completion', function() screen:expect([[ foobar fooegg | fooegg^ | - {1:foobar } | - {2:fooegg } | - ~ | - ~ | - ~ | + {1:foobar }{0: }| + {2:fooegg }{0: }| + {0:~ }| + {0:~ }| + {0:~ }| {3:-- Keyword completion (^N^P) }{4:match 1 of 2} | ]]) @@ -692,11 +696,11 @@ describe('completion', function() screen:expect([[ foobar fooegg | fooegg^ | - {1:foobar } | - {2:fooegg } | - ~ | - ~ | - ~ | + {1:foobar }{0: }| + {2:fooegg }{0: }| + {0:~ }| + {0:~ }| + {0:~ }| {3:-- Keyword completion (^N^P) }{4:match 1 of 2} | ]]) @@ -705,11 +709,11 @@ describe('completion', function() screen:expect([[ foobar fooegg | foobar^ | - {2:foobar } | - {1:fooegg } | - ~ | - ~ | - ~ | + {2:foobar }{0: }| + {1:fooegg }{0: }| + {0:~ }| + {0:~ }| + {0:~ }| {3:-- Keyword completion (^N^P) }{4:match 2 of 2} | ]]) end) @@ -722,43 +726,137 @@ describe('completion', function() screen:expect([[ | {8:[No Name] }| - :foo faa fee f^ | - :~ | - :~ | - :~ | + {0::}foo faa fee f^ | + {0::~ }| + {0::~ }| + {0::~ }| {9:[Command Line] }| {3:-- INSERT --} | - ]], {[3] = {bold = true}, - [4] = {bold = true, foreground = Screen.colors.SeaGreen}, - [8] = {reverse = true}, - [9] = {bold = true, reverse = true}}) + ]] ) feed('<c-x><c-n>') screen:expect([[ | {8:[No Name] }| - :foo faa fee foo^ | - :~ {2: foo } | - :~ {1: faa } | - :~ {1: fee } | + {0::}foo faa fee foo^ | + {0::~ }{2: foo }{0: }| + {0::~ }{1: faa }{0: }| + {0::~ }{1: fee }{0: }| {9:[Command Line] }| {3:-- Keyword Local completion (^N^P) }{4:match 1 of 3} | - ]],{[1] = {background = Screen.colors.LightMagenta}, - [2] = {background = Screen.colors.Grey}, - [3] = {bold = true}, - [4] = {bold = true, foreground = Screen.colors.SeaGreen}, - [8] = {reverse = true}, - [9] = {bold = true, reverse = true}}) + ]]) feed('<c-c>') screen:expect([[ | {8:[No Name] }| - :foo faa fee foo | - :~ | - :~ | - :~ | + {0::}foo faa fee foo | + {0::~ }| + {0::~ }| + {0::~ }| {9:[Command Line] }| :foo faa fee foo^ | - ]], {[8] = {reverse = true}, [9] = {bold = true, reverse = true}}) + ]]) + end) + end) + +end) + +describe('External completion popupmenu', function() + local screen + local items, selected, anchor + before_each(function() + clear() + screen = Screen.new(60, 8) + screen:attach({rgb=true, popupmenu_external=true}) + screen:set_default_attr_ids({ + [1] = {bold=true, foreground=Screen.colors.Blue}, + [2] = {bold = true}, + }) + screen:set_on_event_handler(function(name, data) + if name == "popupmenu_show" then + local row, col + items, selected, row, col = unpack(data) + anchor = {row, col} + elseif name == "popupmenu_select" then + selected = data[1] + elseif name == "popupmenu_hide" then + items = nil + end + end) + end) + + it('works', function() + source([[ + function! TestComplete() abort + call complete(1, ['foo', 'bar', 'spam']) + return '' + endfunction + ]]) + local expected = { + {'foo', '', '', ''}, + {'bar', '', '', ''}, + {'spam', '', '', ''}, + } + feed('o<C-r>=TestComplete()<CR>') + screen:expect([[ + | + foo^ | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {2:-- INSERT --} | + ]], nil, nil, function() + eq(expected, items) + eq(0, selected) + eq({1,0}, anchor) + end) + + feed('<c-p>') + screen:expect([[ + | + ^ | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {2:-- INSERT --} | + ]], nil, nil, function() + eq(expected, items) + eq(-1, selected) + eq({1,0}, anchor) + end) + + -- down moves the selection in the menu, but does not insert anything + feed('<down><down>') + screen:expect([[ + | + ^ | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {2:-- INSERT --} | + ]], nil, nil, function() + eq(expected, items) + eq(1, selected) + eq({1,0}, anchor) + end) + + feed('<cr>') + screen:expect([[ + | + bar^ | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {2:-- INSERT --} | + ]], nil, nil, function() + eq(nil, items) -- popupmenu was hidden end) end) end) diff --git a/test/functional/viml/function_spec.lua b/test/functional/viml/function_spec.lua index f0a4406593..776e760aaf 100644 --- a/test/functional/viml/function_spec.lua +++ b/test/functional/viml/function_spec.lua @@ -2,7 +2,6 @@ local helpers = require('test.functional.helpers')(after_each) local clear = helpers.clear local eq = helpers.eq -local eval = helpers.eval local exc_exec = helpers.exc_exec describe('Up to MAX_FUNC_ARGS arguments are handled by', function() @@ -28,11 +27,3 @@ describe('Up to MAX_FUNC_ARGS arguments are handled by', function() eq('Vim(call):E740: Too many arguments for function rpcnotify', ret) end) end) - -describe('api_info()', function() - before_each(clear) - it('has the right keys', function() - local api_keys = eval("sort(keys(api_info()))") - eq({'error_types', 'functions', 'types'}, api_keys) - end) -end) diff --git a/test/unit/buffer_spec.lua b/test/unit/buffer_spec.lua index 317c9be6e7..49a4d84279 100644 --- a/test/unit/buffer_spec.lua +++ b/test/unit/buffer_spec.lua @@ -87,7 +87,7 @@ describe('buffer functions', function() it('should find exact matches', function() local buf = buflist_new(path1, buffer.BLN_LISTED) - eq(buf.b_fnum, buflist_findpat(path1, ONLY_LISTED)) + eq(buf.handle, buflist_findpat(path1, ONLY_LISTED)) close_buffer(NULL, buf, buffer.DOBUF_WIPE, 0) end) @@ -97,9 +97,9 @@ describe('buffer functions', function() local buf2 = buflist_new(path2, buffer.BLN_LISTED) local buf3 = buflist_new(path3, buffer.BLN_LISTED) - eq(buf1.b_fnum, buflist_findpat("test", ONLY_LISTED)) - eq(buf2.b_fnum, buflist_findpat("file", ONLY_LISTED)) - eq(buf3.b_fnum, buflist_findpat("path", ONLY_LISTED)) + eq(buf1.handle, buflist_findpat("test", ONLY_LISTED)) + eq(buf2.handle, buflist_findpat("file", ONLY_LISTED)) + eq(buf3.handle, buflist_findpat("path", ONLY_LISTED)) close_buffer(NULL, buf1, buffer.DOBUF_WIPE, 0) close_buffer(NULL, buf2, buffer.DOBUF_WIPE, 0) @@ -113,7 +113,7 @@ describe('buffer functions', function() local buf3 = buflist_new(path3, buffer.BLN_LISTED) -- Then: buf2 is the buffer that is found - eq(buf2.b_fnum, buflist_findpat("test", ONLY_LISTED)) + eq(buf2.handle, buflist_findpat("test", ONLY_LISTED)) --} --{ When: We close buf2 @@ -123,7 +123,7 @@ describe('buffer functions', function() local buf1 = buflist_new(path1, buffer.BLN_LISTED) -- Then: buf3 is found since 'file' appears at the end of the name - eq(buf3.b_fnum, buflist_findpat("file", ONLY_LISTED)) + eq(buf3.handle, buflist_findpat("file", ONLY_LISTED)) --} close_buffer(NULL, buf1, buffer.DOBUF_WIPE, 0) @@ -135,7 +135,7 @@ describe('buffer functions', function() local buf2 = buflist_new(path2, buffer.BLN_LISTED) local buf3 = buflist_new(path3, buffer.BLN_LISTED) - eq(buf3.b_fnum, buflist_findpat("_test_", ONLY_LISTED)) + eq(buf3.handle, buflist_findpat("_test_", ONLY_LISTED)) close_buffer(NULL, buf1, buffer.DOBUF_WIPE, 0) close_buffer(NULL, buf2, buffer.DOBUF_WIPE, 0) @@ -147,7 +147,7 @@ describe('buffer functions', function() local buf3 = buflist_new(path3, buffer.BLN_LISTED) -- Then: We should find the buffer when it is given a unique pattern - eq(buf3.b_fnum, buflist_findpat("_test_", ONLY_LISTED)) + eq(buf3.handle, buflist_findpat("_test_", ONLY_LISTED)) --} --{ When: We unlist the buffer @@ -157,7 +157,7 @@ describe('buffer functions', function() eq(-1, buflist_findpat("_test_", ONLY_LISTED)) -- And: It should find the buffer when including unlisted buffers - eq(buf3.b_fnum, buflist_findpat("_test_", ALLOW_UNLISTED)) + eq(buf3.handle, buflist_findpat("_test_", ALLOW_UNLISTED)) --} --{ When: We wipe the buffer @@ -175,7 +175,7 @@ describe('buffer functions', function() local buf2 = buflist_new(path2, buffer.BLN_LISTED) -- Then: The first buffer is preferred when both are listed - eq(buf1.b_fnum, buflist_findpat("test", ONLY_LISTED)) + eq(buf1.handle, buflist_findpat("test", ONLY_LISTED)) --} --{ When: The first buffer is unlisted @@ -183,13 +183,13 @@ describe('buffer functions', function() -- Then: The second buffer is preferred because -- unlisted buffers are not allowed - eq(buf2.b_fnum, buflist_findpat("test", ONLY_LISTED)) + eq(buf2.handle, buflist_findpat("test", ONLY_LISTED)) --} --{ When: We allow unlisted buffers -- Then: The second buffer is still preferred -- because listed buffers are preferred to unlisted - eq(buf2.b_fnum, buflist_findpat("test", ALLOW_UNLISTED)) + eq(buf2.handle, buflist_findpat("test", ALLOW_UNLISTED)) --} --{ When: We unlist the second buffer @@ -198,7 +198,7 @@ describe('buffer functions', function() -- Then: The first buffer is preferred again -- because buf1 matches better which takes precedence -- when both buffers have the same listing status. - eq(buf1.b_fnum, buflist_findpat("test", ALLOW_UNLISTED)) + eq(buf1.handle, buflist_findpat("test", ALLOW_UNLISTED)) -- And: Neither buffer is returned when ignoring unlisted eq(-1, buflist_findpat("test", ONLY_LISTED)) diff --git a/test/unit/option_spec.lua b/test/unit/option_spec.lua new file mode 100644 index 0000000000..8bab0194a2 --- /dev/null +++ b/test/unit/option_spec.lua @@ -0,0 +1,51 @@ +local helpers = require("test.unit.helpers") + +local to_cstr = helpers.to_cstr +local eq = helpers.eq + +local option = helpers.cimport("./src/nvim/option.h") +local globals = helpers.cimport("./src/nvim/globals.h") + +local check_ff_value = function(ff) + return option.check_ff_value(to_cstr(ff)) +end + +describe('check_ff_value', function() + + it('views empty string as valid', function() + eq(1, check_ff_value("")) + end) + + it('views "unix", "dos" and "mac" as valid', function() + eq(1, check_ff_value("unix")) + eq(1, check_ff_value("dos")) + eq(1, check_ff_value("mac")) + end) + + it('views "foo" as invalid', function() + eq(0, check_ff_value("foo")) + end) +end) + +describe('get_sts_value', function() + it([[returns 'softtabstop' when it is non-negative]], function() + globals.curbuf.b_p_sts = 5 + eq(5, option.get_sts_value()) + + globals.curbuf.b_p_sts = 0 + eq(0, option.get_sts_value()) + end) + + it([[returns "effective shiftwidth" when 'softtabstop' is negative]], function() + local shiftwidth = 2 + globals.curbuf.b_p_sw = shiftwidth + local tabstop = 5 + globals.curbuf.b_p_ts = tabstop + globals.curbuf.b_p_sts = -2 + eq(shiftwidth, option.get_sts_value()) + + shiftwidth = 0 + globals.curbuf.b_p_sw = shiftwidth + eq(tabstop, option.get_sts_value()) + end) +end) diff --git a/test/unit/os/shell_spec.lua b/test/unit/os/shell_spec.lua index 906f950308..3603403daf 100644 --- a/test/unit/os/shell_spec.lua +++ b/test/unit/os/shell_spec.lua @@ -1,15 +1,3 @@ --- not all operating systems support the system()-tests, as of yet. -local allowed_os = { - Linux = true, - OSX = true, - BSD = true, - POSIX = true -} - -if allowed_os[jit.os] ~= true then - return -end - local helpers = require('test.unit.helpers') local cimported = helpers.cimport( './src/nvim/os/shell.h', @@ -24,10 +12,12 @@ local to_cstr = helpers.to_cstr local NULL = ffi.cast('void *', 0) describe('shell functions', function() - setup(function() + before_each(function() -- os_system() can't work when the p_sh and p_shcf variables are unset cimported.p_sh = to_cstr('/bin/bash') cimported.p_shcf = to_cstr('-c') + cimported.p_sxq = to_cstr('') + cimported.p_sxe = to_cstr('') end) local function shell_build_argv(cmd, extra_args) @@ -126,5 +116,50 @@ describe('shell functions', function() '-c', 'abc def'}, shell_build_argv('abc def', 'ghi jkl')) end) + + it('applies shellxescape (p_sxe) and shellxquote (p_sxq)', function() + cimported.p_sxq = to_cstr('(') + cimported.p_sxe = to_cstr('"&|<>()@^') + + local argv = ffi.cast('char**', + cimported.shell_build_argv(to_cstr('echo &|<>()@^'), nil)) + eq(ffi.string(argv[0]), '/bin/bash') + eq(ffi.string(argv[1]), '-c') + eq(ffi.string(argv[2]), '(echo ^&^|^<^>^(^)^@^^)') + eq(nil, argv[3]) + end) + + it('applies shellxquote="(', function() + cimported.p_sxq = to_cstr('"(') + cimported.p_sxe = to_cstr('"&|<>()@^') + + local argv = ffi.cast('char**', cimported.shell_build_argv( + to_cstr('echo -n some text'), nil)) + eq(ffi.string(argv[0]), '/bin/bash') + eq(ffi.string(argv[1]), '-c') + eq(ffi.string(argv[2]), '"(echo -n some text)"') + eq(nil, argv[3]) + end) + + it('applies shellxquote="', function() + cimported.p_sxq = to_cstr('"') + cimported.p_sxe = to_cstr('') + + local argv = ffi.cast('char**', cimported.shell_build_argv( + to_cstr('echo -n some text'), nil)) + eq(ffi.string(argv[0]), '/bin/bash') + eq(ffi.string(argv[1]), '-c') + eq(ffi.string(argv[2]), '"echo -n some text"') + eq(nil, argv[3]) + end) + + it('with empty shellxquote/shellxescape', function() + local argv = ffi.cast('char**', cimported.shell_build_argv( + to_cstr('echo -n some text'), nil)) + eq(ffi.string(argv[0]), '/bin/bash') + eq(ffi.string(argv[1]), '-c') + eq(ffi.string(argv[2]), 'echo -n some text') + eq(nil, argv[3]) + end) end) end) diff --git a/third-party/CMakeLists.txt b/third-party/CMakeLists.txt index 9fc1b2eb36..e0dcf6e04c 100644 --- a/third-party/CMakeLists.txt +++ b/third-party/CMakeLists.txt @@ -5,6 +5,12 @@ project(NEOVIM_DEPS) # Point CMake at any custom modules we may ship list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") +# In Windows/MSVC CMAKE_BUILD_TYPE changes the paths/linking of the build +# recipes (libuv, msgpack), make sure it is set +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Release) +endif() + set(DEPS_INSTALL_DIR "${CMAKE_BINARY_DIR}/usr" CACHE PATH "Dependencies install directory.") set(DEPS_BIN_DIR "${DEPS_INSTALL_DIR}/bin" CACHE PATH "Dependencies binary install directory.") set(DEPS_LIB_DIR "${DEPS_INSTALL_DIR}/lib" CACHE PATH "Dependencies library install directory.") @@ -26,6 +32,12 @@ option(USE_BUNDLED_LUV "Use the bundled version of luv." ${USE_BUNDLED}) # build it unless explicitly requested option(USE_BUNDLED_LUA "Use the bundled version of lua." OFF) +if(USE_BUNDLED AND (NOT WIN32)) + option(USE_BUNDLED_GPERF "Use the bundled version of gperf." ON) +else() + option(USE_BUNDLED_GPERF "Use the bundled version of gperf." OFF) +endif() + option(USE_EXISTING_SRC_DIR "Skip download of deps sources in case of existing source directory." OFF) if(UNIX) @@ -75,8 +87,8 @@ endif() include(ExternalProject) -set(LIBUV_URL https://github.com/libuv/libuv/archive/v1.8.0.tar.gz) -set(LIBUV_SHA256 906e1a5c673c95cb261adeacdb7308a65b4a8f7c9c50d85f3021364951fa9cde) +set(LIBUV_URL https://github.com/libuv/libuv/archive/v1.9.1.tar.gz) +set(LIBUV_SHA256 a6ca9f0648973d1463f46b495ce546ddcbe7cce2f04b32e802a15539e46c57ad) set(MSGPACK_URL https://github.com/msgpack/msgpack-c/archive/cpp-1.0.0.tar.gz) set(MSGPACK_SHA256 afda64ca445203bb7092372b822bae8b2539fdcebbfc3f753f393628c2bcfe7d) @@ -102,8 +114,11 @@ set(LIBVTERM_SHA256 1a4272be91d9614dc183a503786df83b6584e4afaab7feaaa5409f841afb set(JEMALLOC_URL https://github.com/jemalloc/jemalloc/releases/download/4.2.1/jemalloc-4.2.1.tar.bz2) set(JEMALLOC_SHA256 5630650d5c1caab95d2f0898de4fe5ab8519dc680b04963b38bb425ef6a42d57) -set(LUV_URL https://github.com/luvit/luv/archive/146f1ce4c08c3b67f604c9ee1e124b1cf5c15cf3.tar.gz) -set(LUV_SHA256 3d537f8eb9fa5adb146a083eae22af886aee324ec268e2aa0fa75f2f1c52ca7a) +set(LUV_URL https://github.com/luvit/luv/archive/1.9.1-0.tar.gz) +set(LUV_SHA256 86a199403856018cd8e5529c8527450c83664a3d36f52d5253cbe909ea6c5a06) + +set(GPERF_URL http://ftp.gnu.org/pub/gnu/gperf/gperf-3.0.4.tar.gz) +set(GPERF_SHA256 767112a204407e62dbc3106647cf839ed544f3cf5d0f0523aaa2508623aad63e) if(USE_BUNDLED_UNIBILIUM) include(BuildUnibilium) @@ -145,6 +160,10 @@ if(USE_BUNDLED_LUV) include(BuildLuv) endif() +if(USE_BUNDLED_GPERF) + include(BuildGperf) +endif() + add_custom_target(clean-shared-libraries COMMAND ${CMAKE_COMMAND} -DREMOVE_FILE_GLOB=${DEPS_INSTALL_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}*${CMAKE_SHARED_LIBRARY_SUFFIX}* diff --git a/third-party/cmake/BuildGperf.cmake b/third-party/cmake/BuildGperf.cmake new file mode 100644 index 0000000000..494d0d9717 --- /dev/null +++ b/third-party/cmake/BuildGperf.cmake @@ -0,0 +1,51 @@ +# Gperf recipe. Gperf is only required when building Neovim, when +# cross compiling we still want to build for the HOST system, whenever +# writing a recipe that is meant for cross-compile, use the HOSTDEPS_* variables +# instead of DEPS_* - check the main CMakeLists.txt for a list. + +# BuildGperf(CONFIGURE_COMMAND ... BUILD_COMMAND ... INSTALL_COMMAND ...) +# Reusable function to build Gperf, wraps ExternalProject_Add. +# Failing to pass a command argument will result in no command being run +function(BuildGperf) + cmake_parse_arguments(_gperf + "" + "" + "CONFIGURE_COMMAND;BUILD_COMMAND;INSTALL_COMMAND" + ${ARGN}) + + if(NOT _gperf_CONFIGURE_COMMAND AND NOT _gperf_BUILD_COMMAND + AND NOT _gperf_INSTALL_COMMAND) + message(FATAL_ERROR "Must pass at least one of CONFIGURE_COMMAND, BUILD_COMMAND, INSTALL_COMMAND") + endif() + + ExternalProject_Add(gperf + PREFIX ${DEPS_BUILD_DIR} + URL ${GPERF_URL} + DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/gperf + DOWNLOAD_COMMAND ${CMAKE_COMMAND} + -DPREFIX=${DEPS_BUILD_DIR} + -DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/gperf + -DURL=${GPERF_URL} + -DEXPECTED_SHA256=${GPERF_SHA256} + -DTARGET=gperf + -DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR} + -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake + BUILD_IN_SOURCE 1 + CONFIGURE_COMMAND "${_gperf_CONFIGURE_COMMAND}" + BUILD_COMMAND "${_gperf_BUILD_COMMAND}" + INSTALL_COMMAND "${_gperf_INSTALL_COMMAND}") +endfunction() + +set(GPERF_BUILDARGS CC=${HOSTDEPS_C_COMPILER} LD=${HOSTDEPS_C_COMPILER}) + +if(UNIX OR (MINGW AND CMAKE_CROSSCOMPILING)) + + BuildGperf( + CONFIGURE_COMMAND ${DEPS_BUILD_DIR}/src/gperf/configure + --prefix=${HOSTDEPS_INSTALL_DIR} + INSTALL_COMMAND ${MAKE_PRG} install) + +else() + message(FATAL_ERROR "Trying to build gperf in an unsupported system ${CMAKE_SYSTEM_NAME}/${CMAKE_C_COMPILER_ID}") +endif() + diff --git a/third-party/cmake/BuildLibuv.cmake b/third-party/cmake/BuildLibuv.cmake index 1d8d69e64e..5482f28557 100644 --- a/third-party/cmake/BuildLibuv.cmake +++ b/third-party/cmake/BuildLibuv.cmake @@ -5,7 +5,7 @@ include(CMakeParseArguments) # Failing to pass a command argument will result in no command being run function(BuildLibuv) cmake_parse_arguments(_libuv - "" + "BUILD_IN_SOURCE" "TARGET" "CONFIGURE_COMMAND;BUILD_COMMAND;INSTALL_COMMAND" ${ARGN}) @@ -30,6 +30,7 @@ function(BuildLibuv) -DTARGET=${_libuv_TARGET} -DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake + BUILD_IN_SOURCE ${_libuv_BUILD_IN_SOURCE} CONFIGURE_COMMAND "${_libuv_CONFIGURE_COMMAND}" BUILD_COMMAND "${_libuv_BUILD_COMMAND}" INSTALL_COMMAND "${_libuv_INSTALL_COMMAND}") @@ -56,6 +57,16 @@ elseif(MINGW AND CMAKE_CROSSCOMPILING) CONFIGURE_COMMAND ${UNIX_CFGCMD} --host=${CROSS_TARGET} INSTALL_COMMAND ${MAKE_PRG} V=1 install) +elseif(MINGW) + + # Native MinGW + BuildLibUv(BUILD_IN_SOURCE + BUILD_COMMAND ${CMAKE_MAKE_PROGRAM} -f Makefile.mingw + INSTALL_COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_INSTALL_DIR}/lib + COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/libuv/libuv.a ${DEPS_INSTALL_DIR}/lib + COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_INSTALL_DIR}/include + COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPS_BUILD_DIR}/src/libuv/include ${DEPS_INSTALL_DIR}/include + ) elseif(WIN32 AND MSVC) @@ -70,11 +81,17 @@ elseif(WIN32 AND MSVC) else() set(VS_ARCH x64) endif() - BuildLibuv( - # By default this creates Debug builds - BUILD_COMMAND set PYTHON=${PYTHON_EXECUTABLE} COMMAND ${DEPS_BUILD_DIR}/src/libuv/vcbuild.bat static debug ${VS_ARCH} + string(TOLOWER ${CMAKE_BUILD_TYPE} LOWERCASE_BUILD_TYPE) + set(UV_OUTPUT_DIR ${DEPS_BUILD_DIR}/src/libuv/${CMAKE_BUILD_TYPE}) + BuildLibUv( + BUILD_COMMAND set PYTHON=${PYTHON_EXECUTABLE} COMMAND ${DEPS_BUILD_DIR}/src/libuv/vcbuild.bat shared ${LOWERCASE_BUILD_TYPE} ${VS_ARCH} INSTALL_COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_INSTALL_DIR}/lib - COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/libuv/Debug/lib/libuv.lib ${DEPS_INSTALL_DIR}/lib + COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_INSTALL_DIR}/bin + COMMAND ${CMAKE_COMMAND} -E copy ${UV_OUTPUT_DIR}/libuv.lib ${DEPS_INSTALL_DIR}/lib + # Some applications (lua-client/luarocks) look for uv.lib instead of libuv.lib + COMMAND ${CMAKE_COMMAND} -E copy ${UV_OUTPUT_DIR}/libuv.lib ${DEPS_INSTALL_DIR}/lib/uv.lib + COMMAND ${CMAKE_COMMAND} -E copy ${UV_OUTPUT_DIR}/libuv.dll ${DEPS_INSTALL_DIR}/bin/ + COMMAND ${CMAKE_COMMAND} -E copy ${UV_OUTPUT_DIR}/libuv.dll ${DEPS_INSTALL_DIR}/bin/uv.dll COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_INSTALL_DIR}/include COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPS_BUILD_DIR}/src/libuv/include ${DEPS_INSTALL_DIR}/include) diff --git a/third-party/cmake/BuildLibvterm.cmake b/third-party/cmake/BuildLibvterm.cmake index ec9ba0d741..5ea8314da5 100644 --- a/third-party/cmake/BuildLibvterm.cmake +++ b/third-party/cmake/BuildLibvterm.cmake @@ -1,26 +1,59 @@ +include(CMakeParseArguments) + +# BuildLibvterm(CONFIGURE_COMMAND ... BUILD_COMMAND ... INSTALL_COMMAND ...) +# Failing to pass a command argument will result in no command being run +function(BuildLibvterm) + cmake_parse_arguments(_libvterm + "" + "" + "CONFIGURE_COMMAND;BUILD_COMMAND;INSTALL_COMMAND" + ${ARGN}) + + if(NOT _libvterm_CONFIGURE_COMMAND AND NOT _libvterm_BUILD_COMMAND + AND NOT _libvterm_INSTALL_COMMAND) + message(FATAL_ERROR "Must pass at least one of CONFIGURE_COMMAND, BUILD_COMMAND, INSTALL_COMMAND") + endif() + + ExternalProject_Add(libvterm + PREFIX ${DEPS_BUILD_DIR} + URL ${LIBVTERM_URL} + DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/libvterm + DOWNLOAD_COMMAND ${CMAKE_COMMAND} + -DPREFIX=${DEPS_BUILD_DIR} + -DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/libvterm + -DURL=${LIBVTERM_URL} + -DEXPECTED_SHA256=${LIBVTERM_SHA256} + -DTARGET=libvterm + -DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR} + -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake + CONFIGURE_COMMAND "" + BUILD_IN_SOURCE 1 + CONFIGURE_COMMAND "${_libvterm_CONFIGURE_COMMAND}" + BUILD_COMMAND "${_libvterm_BUILD_COMMAND}" + INSTALL_COMMAND "${_libvterm_INSTALL_COMMAND}") +endfunction() + if(WIN32) - message(STATUS "Building libvterm in Windows is not supported (skipping)") - return() + # MinGW + set(LIBVTERM_CONFIGURE_COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_SOURCE_DIR}/cmake/LibvtermCMakeLists.txt + ${DEPS_BUILD_DIR}/src/libvterm/CMakeLists.txt + COMMAND ${CMAKE_COMMAND} ${DEPS_BUILD_DIR}/src/libvterm + -DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR} + -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} + "-DCMAKE_C_FLAGS:STRING=${CMAKE_C_COMPILER_ARG1} -fPIC" + -DCMAKE_GENERATOR=${CMAKE_GENERATOR}) + set(LIBVTERM_BUILD_COMMAND ${CMAKE_COMMAND} --build . --config ${CMAKE_BUILD_TYPE}) + set(LIBVTERM_INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config ${CMAKE_BUILD_TYPE}) +else() + set(LIBVTERM_INSTALL_COMMAND ${MAKE_PRG} CC=${DEPS_C_COMPILER} + PREFIX=${DEPS_INSTALL_DIR} + CFLAGS=-fPIC + install) endif() -ExternalProject_Add(libvterm - PREFIX ${DEPS_BUILD_DIR} - URL ${LIBVTERM_URL} - DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/libvterm - DOWNLOAD_COMMAND ${CMAKE_COMMAND} - -DPREFIX=${DEPS_BUILD_DIR} - -DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/libvterm - -DURL=${LIBVTERM_URL} - -DEXPECTED_SHA256=${LIBVTERM_SHA256} - -DTARGET=libvterm - -DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR} - -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake - CONFIGURE_COMMAND "" - BUILD_IN_SOURCE 1 - BUILD_COMMAND "" - INSTALL_COMMAND ${MAKE_PRG} CC=${DEPS_C_COMPILER} - PREFIX=${DEPS_INSTALL_DIR} - CFLAGS=-fPIC - install) +BuildLibvterm(CONFIGURE_COMMAND ${LIBVTERM_CONFIGURE_COMMAND} + BUILD_COMMAND ${LIBVTERM_BUILD_COMMAND} + INSTALL_COMMAND ${LIBVTERM_INSTALL_COMMAND}) list(APPEND THIRD_PARTY_DEPS libvterm) diff --git a/third-party/cmake/BuildLuajit.cmake b/third-party/cmake/BuildLuajit.cmake index 83aceecb59..c8eee282bf 100644 --- a/third-party/cmake/BuildLuajit.cmake +++ b/third-party/cmake/BuildLuajit.cmake @@ -40,7 +40,6 @@ set(INSTALLCMD_UNIX ${MAKE_PRG} CFLAGS=-fPIC CFLAGS+=-DLUA_USE_APICHECK CFLAGS+=-DLUA_USE_ASSERT CCDEBUG+=-g - BUILDMODE=static Q= install) @@ -71,13 +70,36 @@ elseif(MINGW AND CMAKE_CROSSCOMPILING) Q= INSTALL_TSYMNAME=luajit.exe) -elseif(WIN32 AND MSVC) +elseif(MINGW) + + + BuildLuaJit(BUILD_COMMAND ${CMAKE_MAKE_PROGRAM} CC=${DEPS_C_COMPILER} + PREFIX=${DEPS_INSTALL_DIR} + CFLAGS+=-DLUAJIT_DISABLE_JIT + CFLAGS+=-DLUA_USE_APICHECK + CFLAGS+=-DLUA_USE_ASSERT + CCDEBUG+=-g + BUILDMODE=static + # Build a DLL too + COMMAND ${CMAKE_MAKE_PROGRAM} CC=${DEPS_C_COMPILER} BUILDMODE=dynamic + + INSTALL_COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_INSTALL_DIR}/bin + COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/luajit.exe ${DEPS_INSTALL_DIR}/bin + COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/lua51.dll ${DEPS_INSTALL_DIR}/bin + COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_INSTALL_DIR}/lib + # Luarocks searches for lua51.dll in lib + COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/lua51.dll ${DEPS_INSTALL_DIR}/lib + COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/libluajit.a ${DEPS_INSTALL_DIR}/lib + COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_INSTALL_DIR}/include/luajit-2.0 + COMMAND ${CMAKE_COMMAND} -DFROM_GLOB=${DEPS_BUILD_DIR}/src/luajit/src/*.h -DTO=${DEPS_INSTALL_DIR}/include/luajit-2.0 -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/CopyFilesGlob.cmake + ) +elseif(MSVC) BuildLuaJit( - BUILD_COMMAND ${CMAKE_COMMAND} -E chdir ${DEPS_BUILD_DIR}/src/luajit/src ${DEPS_BUILD_DIR}/src/luajit/src/msvcbuild.bat static + BUILD_COMMAND ${CMAKE_COMMAND} -E chdir ${DEPS_BUILD_DIR}/src/luajit/src ${DEPS_BUILD_DIR}/src/luajit/src/msvcbuild.bat INSTALL_COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_INSTALL_DIR}/bin COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/luajit.exe ${DEPS_INSTALL_DIR}/bin - COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/lua51.lib ${DEPS_INSTALL_DIR}/bin + COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/lua51.dll ${DEPS_INSTALL_DIR}/bin COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_INSTALL_DIR}/lib COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/lua51.lib ${DEPS_INSTALL_DIR}/lib COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_INSTALL_DIR}/include/luajit-2.0 diff --git a/third-party/cmake/BuildLuarocks.cmake b/third-party/cmake/BuildLuarocks.cmake index 0041bb1a03..fee8dba207 100644 --- a/third-party/cmake/BuildLuarocks.cmake +++ b/third-party/cmake/BuildLuarocks.cmake @@ -3,11 +3,7 @@ # writing a recipe that is meant for cross-compile, use the HOSTDEPS_* variables # instead of DEPS_* - check the main CMakeLists.txt for a list. -if(MSVC) - message(STATUS "Building busted in Windows is not supported (skipping)") -else() - option(USE_BUNDLED_BUSTED "Use the bundled version of busted to run tests." ON) -endif() +option(USE_BUNDLED_BUSTED "Use the bundled version of busted to run tests." ON) # BuildLuarocks(CONFIGURE_COMMAND ... BUILD_COMMAND ... INSTALL_COMMAND ...) # Reusable function to build luarocks, wraps ExternalProject_Add. @@ -46,11 +42,9 @@ endfunction() set(LUAROCKS_BINARY ${HOSTDEPS_BIN_DIR}/luarocks) # Arguments for calls to 'luarocks build' -if(MSVC) - # In native Win32 don't pass the compiler/linker to luarocks, the bundled +if(NOT MSVC) + # In MSVC don't pass the compiler/linker to luarocks, the bundled # version already knows, and passing them here breaks the build - set(LUAROCKS_BUILDARGS CFLAGS=/MT) -else() set(LUAROCKS_BUILDARGS CC=${HOSTDEPS_C_COMPILER} LD=${HOSTDEPS_C_COMPILER}) endif() @@ -67,8 +61,12 @@ if(UNIX OR (MINGW AND CMAKE_CROSSCOMPILING)) --prefix=${HOSTDEPS_INSTALL_DIR} --force-config ${LUAROCKS_OPTS} --lua-suffix=jit INSTALL_COMMAND ${MAKE_PRG} bootstrap) +elseif(MSVC OR MINGW) + + if(MINGW) + set(MINGW_FLAG /MW) + endif() -elseif(MSVC) # Ignore USE_BUNDLED_LUAJIT - always ON for native Win32 BuildLuarocks(INSTALL_COMMAND install.bat /FORCECONFIG /NOREG /NOADMIN /Q /F /LUA ${DEPS_INSTALL_DIR} @@ -78,6 +76,7 @@ elseif(MSVC) /P ${DEPS_INSTALL_DIR} /TREE ${DEPS_INSTALL_DIR} /SCRIPTS ${DEPS_BIN_DIR} /CMOD ${DEPS_BIN_DIR} + ${MINGW_FLAG} /LUAMOD ${DEPS_BIN_DIR}/lua) set(LUAROCKS_BINARY ${DEPS_INSTALL_DIR}/2.2/luarocks.bat) @@ -124,12 +123,24 @@ add_custom_target(inspect list(APPEND THIRD_PARTY_DEPS inspect) if(USE_BUNDLED_BUSTED) - add_custom_command(OUTPUT ${HOSTDEPS_BIN_DIR}/busted + add_custom_command(OUTPUT ${HOSTDEPS_LIB_DIR}/luarocks/rocks/penlight/1.3.2-2 + COMMAND ${LUAROCKS_BINARY} + ARGS build penlight 1.3.2-2 ${LUAROCKS_BUILDARGS} + DEPENDS inspect) + add_custom_target(penlight + DEPENDS ${HOSTDEPS_LIB_DIR}/luarocks/rocks/penlight/1.3.2-2) + + if(WIN32) + set(BUSTED_EXE "${HOSTDEPS_BIN_DIR}/busted.bat") + else() + set(BUSTED_EXE "${HOSTDEPS_BIN_DIR}/busted") + endif() + add_custom_command(OUTPUT ${BUSTED_EXE} COMMAND ${LUAROCKS_BINARY} ARGS build https://raw.githubusercontent.com/Olivine-Labs/busted/v2.0.rc11-0/busted-2.0.rc11-0.rockspec ${LUAROCKS_BUILDARGS} - DEPENDS lpeg) + DEPENDS penlight) add_custom_target(busted - DEPENDS ${HOSTDEPS_BIN_DIR}/busted) + DEPENDS ${BUSTED_EXE}) add_custom_command(OUTPUT ${HOSTDEPS_BIN_DIR}/luacheck COMMAND ${LUAROCKS_BINARY} @@ -142,9 +153,9 @@ if(USE_BUNDLED_BUSTED) if(MINGW AND CMAKE_CROSSCOMPILING) set(LUV_DEPS ${LUV_DEPS} libuv_host) endif() - set(LUV_ARGS CFLAGS='-O0 -g3 -fPIC') + set(LUV_ARGS "CFLAGS=-O0 -g3 -fPIC") if(USE_BUNDLED_LIBUV) - set(LUV_ARGS LIBUV_DIR=${HOSTDEPS_INSTALL_DIR} CFLAGS='-O0 -g3 -fPIC') + list(APPEND LUV_ARGS LIBUV_DIR=${HOSTDEPS_INSTALL_DIR}) endif() add_custom_command(OUTPUT ${HOSTDEPS_LIB_DIR}/luarocks/rocks/luv COMMAND ${LUAROCKS_BINARY} @@ -156,7 +167,7 @@ if(USE_BUNDLED_BUSTED) add_custom_command(OUTPUT ${HOSTDEPS_LIB_DIR}/luarocks/rocks/nvim-client COMMAND ${LUAROCKS_BINARY} - ARGS build https://raw.githubusercontent.com/neovim/lua-client/0.0.1-24/nvim-client-0.0.1-24.rockspec ${LUAROCKS_BUILDARGS} + ARGS build https://raw.githubusercontent.com/neovim/lua-client/0.0.1-25/nvim-client-0.0.1-25.rockspec ${LUAROCKS_BUILDARGS} DEPENDS luv) add_custom_target(nvim-client DEPENDS ${HOSTDEPS_LIB_DIR}/luarocks/rocks/nvim-client) diff --git a/third-party/cmake/BuildLuv.cmake b/third-party/cmake/BuildLuv.cmake index 3060590bce..8ba4a0b41b 100644 --- a/third-party/cmake/BuildLuv.cmake +++ b/third-party/cmake/BuildLuv.cmake @@ -43,6 +43,7 @@ set(LUV_PATCH_COMMAND set(LUV_CONFIGURE_COMMAND_COMMON ${CMAKE_COMMAND} ${LUV_SRC_DIR} + -DCMAKE_GENERATOR=${CMAKE_GENERATOR} -DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR} -DLUA_BUILD_TYPE=System -DWITH_SHARED_LIBUV=ON diff --git a/third-party/cmake/BuildMsgpack.cmake b/third-party/cmake/BuildMsgpack.cmake index 4b6b361e85..6b38508b0b 100644 --- a/third-party/cmake/BuildMsgpack.cmake +++ b/third-party/cmake/BuildMsgpack.cmake @@ -37,10 +37,12 @@ set(MSGPACK_CONFIGURE_COMMAND ${CMAKE_COMMAND} ${DEPS_BUILD_DIR}/src/msgpack -DMSGPACK_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} - "-DCMAKE_C_FLAGS:STRING=${CMAKE_C_COMPILER_ARG1} -fPIC") + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + "-DCMAKE_C_FLAGS:STRING=${CMAKE_C_COMPILER_ARG1} -fPIC" + -DCMAKE_GENERATOR=${CMAKE_GENERATOR}) -set(MSGPACK_BUILD_COMMAND ${CMAKE_COMMAND} --build .) -set(MSGPACK_INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install) +set(MSGPACK_BUILD_COMMAND ${CMAKE_COMMAND} --build . --config ${CMAKE_BUILD_TYPE}) +set(MSGPACK_INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config ${CMAKE_BUILD_TYPE}) if(MINGW AND CMAKE_CROSSCOMPILING) get_filename_component(TOOLCHAIN ${CMAKE_TOOLCHAIN_FILE} REALPATH) @@ -50,6 +52,7 @@ if(MINGW AND CMAKE_CROSSCOMPILING) -DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR} # Pass toolchain -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN} + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} # Hack to avoid -rdynamic in Mingw -DCMAKE_SHARED_LIBRARY_LINK_C_FLAGS="") elseif(MSVC) @@ -60,12 +63,13 @@ elseif(MSVC) -DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} "-DCMAKE_C_FLAGS:STRING=${CMAKE_C_COMPILER_ARG1}" + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} # Make sure we use the same generator, otherwise we may # accidentaly end up using different MSVC runtimes - -DCMAKE_GENERATOR=${CMAKE_GENERATOR} - # Use static runtime - -DCMAKE_C_FLAGS_DEBUG="-MTd" - -DCMAKE_C_FLAGS_RELEASE="-MT") + -DCMAKE_GENERATOR=${CMAKE_GENERATOR}) + # Place the DLL in the bin folder + set(MSGPACK_INSTALL_COMMAND ${MSGPACK_INSTALL_COMMAND} + COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_INSTALL_DIR}/lib/msgpack.dll ${DEPS_INSTALL_DIR}/bin) endif() BuildMsgpack(CONFIGURE_COMMAND ${MSGPACK_CONFIGURE_COMMAND} diff --git a/third-party/cmake/CopyFilesGlob.cmake b/third-party/cmake/CopyFilesGlob.cmake index 056da32fd4..8950ead1e5 100644 --- a/third-party/cmake/CopyFilesGlob.cmake +++ b/third-party/cmake/CopyFilesGlob.cmake @@ -9,6 +9,8 @@ if(NOT TO) message(FATAL_ERROR "TO must be set") endif() +execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${TO}) + file(GLOB files ${FROM_GLOB}) foreach(file ${files}) execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${file} ${TO} RESULT_VARIABLE rv) diff --git a/third-party/cmake/LibvtermCMakeLists.txt b/third-party/cmake/LibvtermCMakeLists.txt new file mode 100644 index 0000000000..72183e4b4c --- /dev/null +++ b/third-party/cmake/LibvtermCMakeLists.txt @@ -0,0 +1,72 @@ +cmake_minimum_required(VERSION 2.8.11) +project(libvterm LANGUAGES C) + +include(GNUInstallDirs) +find_package(Perl REQUIRED) + +if(MSVC) + add_definitions(/W3 -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE) +else() + add_definitions(-Wall -std=c99) +endif() + +# Generate includes from tables +file(GLOB TBL_FILES ${CMAKE_SOURCE_DIR}/src/encoding/*.tbl) +set(TBL_FILES_HEADERS) +foreach(file ${TBL_FILES}) + get_filename_component(basename ${file} NAME_WE) + set(tname encoding/${basename}.inc) + add_custom_command(OUTPUT + COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/encoding/ + COMMAND ${PERL_EXECUTABLE} -CSD ${CMAKE_SOURCE_DIR}/tbl2inc_c.pl ${file} > ${CMAKE_BINARY_DIR}/${tname} + COMMENT "Generating ${tname}" + OUTPUT ${CMAKE_BINARY_DIR}/${tname} + ) + list(APPEND TBL_FILES_HEADERS ${tname}) +endforeach() + +include_directories(${CMAKE_SOURCE_DIR}/include) +include_directories(${CMAKE_BINARY_DIR}) + +file(GLOB VTERM_SOURCES ${CMAKE_SOURCE_DIR}/src/*.c) +add_library(vterm ${VTERM_SOURCES} ${TBL_FILES_HEADERS}) +install(TARGETS vterm ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +add_library(vterm-shared SHARED ${VTERM_SOURCES} ${TBL_FILES_HEADERS}) +set_target_properties(vterm-shared PROPERTIES + OUTPUT_NAME vterm + SOVERSION 0) +install(TARGETS vterm-shared + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + +install(FILES include/vterm.h include/vterm_keycodes.h + DESTINATION include) + +if(NOT WIN32) + file(GLOB BIN_SOURCES ${CMAKE_SOURCE_DIR}/bin/*.c) + foreach(EXE_C ${BIN_SOURCES}) + get_filename_component(target_name ${EXE_C} NAME_WE) + add_executable(${target_name} ${EXE_C}) + target_link_libraries(${target_name} vterm) + install(TARGETS ${target_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + endforeach() +endif() + +# Tests +add_executable(harness EXCLUDE_FROM_ALL t/harness.c) +target_link_libraries(harness vterm) +set_target_properties(harness PROPERTIES + # run-test.pl expects to find the harness in t/.libs/ + RUNTIME_OUTPUT_DIRECTORY t/.libs) + +file(GLOB TESTFILES ${CMAKE_SOURCE_DIR}/t/*.test) +add_custom_target(check) +foreach(testfile ${TESTFILES}) + get_filename_component(target_name ${testfile} NAME_WE) + add_custom_target(${target_name} + COMMAND ${PERL_EXECUTABLE} ${CMAKE_SOURCE_DIR}/t/run-test.pl ${testfile} + COMMENT "**${target_name} **" + DEPENDS harness) + add_dependencies(check ${target_name}) +endforeach() |