mirror of https://github.com/neovim/neovim.git
Compare commits
13 Commits
f8b5067d64
...
5742a8fb2f
Author | SHA1 | Date |
---|---|---|
sus-domesticus | 5742a8fb2f | |
dundargoc | c18d7941ef | |
sus-domesticus | af67eb275e | |
sus-domesticus | ea85d651c1 | |
sus-domesticus | 852bdda396 | |
sus-domesticus | ff52025e8e | |
sus-domesticus | 9963e85f93 | |
sus-domesticus | 438593d7f3 | |
sus-domesticus | 8372a48a35 | |
sus-domesticus | 2a47a48d42 | |
sus-domesticus | dbf30e4cc7 | |
sus-domesticus | 24fc129a80 | |
sus-domesticus | 0df9d7ef1f |
|
@ -50,11 +50,6 @@ file(GLOB DOCFILES CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/runtime/doc/*.txt)
|
|||
set_directory_properties(PROPERTIES
|
||||
EP_PREFIX "${DEPS_BUILD_DIR}")
|
||||
|
||||
find_program(CCACHE_PRG ccache)
|
||||
if(CCACHE_PRG)
|
||||
set(CMAKE_C_COMPILER_LAUNCHER ${CMAKE_COMMAND} -E env CCACHE_SLOPPINESS=pch_defines,time_macros ${CCACHE_PRG})
|
||||
endif()
|
||||
|
||||
if(NOT CI_BUILD)
|
||||
set(CMAKE_INSTALL_MESSAGE NEVER)
|
||||
endif()
|
||||
|
|
|
@ -23,6 +23,12 @@ if(POLICY CMP0092)
|
|||
list(APPEND DEPS_CMAKE_ARGS -D CMAKE_POLICY_DEFAULT_CMP0092=NEW)
|
||||
endif()
|
||||
|
||||
find_program(CACHE_PRG NAMES ccache sccache)
|
||||
if(CACHE_PRG)
|
||||
set(CMAKE_C_COMPILER_LAUNCHER ${CMAKE_COMMAND} -E env CCACHE_SLOPPINESS=pch_defines,time_macros ${CACHE_PRG})
|
||||
list(APPEND DEPS_CMAKE_CACHE_ARGS -DCMAKE_C_COMPILER_LAUNCHER:STRING=${CMAKE_C_COMPILER_LAUNCHER})
|
||||
endif()
|
||||
|
||||
# MAKE_PRG
|
||||
if(UNIX)
|
||||
find_program(MAKE_PRG NAMES gmake make)
|
||||
|
@ -58,7 +64,8 @@ function(get_externalproject_options name DEPS_IGNORE_SHA)
|
|||
|
||||
set(EXTERNALPROJECT_OPTIONS
|
||||
DOWNLOAD_NO_PROGRESS TRUE
|
||||
EXTERNALPROJECT_OPTIONS URL ${${name_allcaps}_URL})
|
||||
EXTERNALPROJECT_OPTIONS URL ${${name_allcaps}_URL}
|
||||
CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS})
|
||||
|
||||
if(NOT ${DEPS_IGNORE_SHA})
|
||||
list(APPEND EXTERNALPROJECT_OPTIONS URL_HASH SHA256=${${name_allcaps}_SHA256})
|
||||
|
|
|
@ -76,6 +76,11 @@ root *editorconfig.root*
|
|||
directories. This property must be at the top-level of the `.editorconfig`
|
||||
file (i.e. it must not be within a glob section).
|
||||
|
||||
spelling_language *editorconfig.spelling_language*
|
||||
A code of the format ss or ss-TT, where ss is an ISO 639 language code and
|
||||
TT is an ISO 3166 territory identifier. Sets the 'spell' and 'spelllang'
|
||||
options.
|
||||
|
||||
tab_width *editorconfig.tab_width*
|
||||
The display size of a single tab character. Sets the 'tabstop' option.
|
||||
|
||||
|
|
|
@ -236,6 +236,9 @@ The following new APIs and features were added.
|
|||
• Navigating the |jumplist| with CTRL+O, CTRL+I behaves more intuitively
|
||||
when deleting buffers, and avoids "invalid buffer" cases. #25461
|
||||
|
||||
• Editorconfig
|
||||
• spelling_language property is now supported.
|
||||
|
||||
• LSP
|
||||
• LSP method names are available in |vim.lsp.protocol.Methods|.
|
||||
• Implemented LSP inlay hints: |lsp-inlay_hint|
|
||||
|
|
|
@ -191,6 +191,29 @@ function properties.insert_final_newline(bufnr, val)
|
|||
end
|
||||
end
|
||||
|
||||
--- A code of the format ss or ss-TT, where ss is an ISO 639 language code and TT is an ISO 3166 territory identifier.
|
||||
--- Sets the 'spell' and 'spelllang' options.
|
||||
function properties.spelling_language(bufnr, val)
|
||||
local error_msg =
|
||||
'spelling_language must be of the format ss or ss-TT, where ss is an ISO 639 language code and TT is an ISO 3166 territory identifier.'
|
||||
|
||||
assert(val:len() == 2 or val:len() == 5, error_msg)
|
||||
|
||||
local language_code = val:sub(1, 2):lower()
|
||||
assert(language_code:match('%l%l'), error_msg)
|
||||
if val:len() == 2 then
|
||||
vim.bo[bufnr].spelllang = language_code
|
||||
else
|
||||
assert(val:sub(3, 3) == '-', error_msg)
|
||||
|
||||
local territory_code = val:sub(4, 5):lower()
|
||||
assert(territory_code:match('%l%l'), error_msg)
|
||||
vim.bo[bufnr].spelllang = language_code .. '_' .. territory_code
|
||||
end
|
||||
|
||||
vim.o.spell = true
|
||||
end
|
||||
|
||||
--- @private
|
||||
--- Modified version of [glob2regpat()] that does not match path separators on `*`.
|
||||
---
|
||||
|
|
|
@ -16,8 +16,16 @@ local testdir = 'Xtest-editorconfig'
|
|||
local function test_case(name, expected)
|
||||
local filename = testdir .. pathsep .. name
|
||||
command('edit ' .. filename)
|
||||
|
||||
for opt, val in pairs(expected) do
|
||||
eq(val, api.nvim_get_option_value(opt, { buf = 0 }), name)
|
||||
local opt_info = api.nvim_get_option_info2(opt, {})
|
||||
if opt_info.scope == 'win' then
|
||||
eq(val, api.nvim_get_option_value(opt, { win = 0 }), name)
|
||||
elseif opt_info.scope == 'buf' then
|
||||
eq(val, api.nvim_get_option_value(opt, { buf = 0 }), name)
|
||||
else
|
||||
eq(val, api.nvim_get_option_value(opt, {}), name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -93,6 +101,12 @@ setup(function()
|
|||
|
||||
[max_line_length.txt]
|
||||
max_line_length = 42
|
||||
|
||||
[short_spelling_language.txt]
|
||||
spelling_language = de
|
||||
|
||||
[long_spelling_language.txt]
|
||||
spelling_language = en-NZ
|
||||
]]
|
||||
)
|
||||
end)
|
||||
|
@ -222,4 +236,9 @@ But not this one
|
|||
|
||||
eq(true, ok, err)
|
||||
end)
|
||||
|
||||
it('sets spell, spelllang options', function()
|
||||
test_case('short_spelling_language.txt', { spell = true, spelllang = 'de' })
|
||||
test_case('long_spelling_language.txt', { spell = true, spelllang = 'en_nz' })
|
||||
end)
|
||||
end)
|
||||
|
|
Loading…
Reference in New Issue