mirror of https://github.com/neovim/neovim.git
Compare commits
4 Commits
561363d967
...
bb1093fc79
Author | SHA1 | Date |
---|---|---|
Gregory Anders | bb1093fc79 | |
dundargoc | c18d7941ef | |
Gregory Anders | d72a4beebe | |
Gregory Anders | 94c92e8659 |
|
@ -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})
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
#include "nvim/lua/treesitter.h"
|
||||
#include "nvim/macros_defs.h"
|
||||
#include "nvim/main.h"
|
||||
#include "nvim/mapping.h"
|
||||
#include "nvim/memline.h"
|
||||
#include "nvim/memory.h"
|
||||
#include "nvim/memory_defs.h"
|
||||
|
@ -2358,11 +2359,17 @@ void nlua_init_defaults(void)
|
|||
lua_State *const L = global_lstate;
|
||||
assert(L);
|
||||
|
||||
// All maps created here are marked as default maps.
|
||||
map_set_default(true);
|
||||
|
||||
lua_getglobal(L, "require");
|
||||
lua_pushstring(L, "vim._defaults");
|
||||
if (nlua_pcall(L, 1, 0)) {
|
||||
fprintf(stderr, "%s\n", lua_tostring(L, -1));
|
||||
}
|
||||
|
||||
// All maps created after this function exits are not default maps.
|
||||
map_set_default(false);
|
||||
}
|
||||
|
||||
/// check lua function exist
|
||||
|
|
|
@ -132,6 +132,16 @@ static const char e_entries_missing_in_mapset_dict_argument[]
|
|||
static const char e_illegal_map_mode_string_str[]
|
||||
= N_("E1276: Illegal map mode string: '%s'");
|
||||
|
||||
/// Whether new mappings should be marked as "default". This is modified only in map_set_default().
|
||||
static bool create_default_maps;
|
||||
|
||||
/// Enable or disable creationg of default mappings.
|
||||
///
|
||||
/// @param value True if new mappings should be marked as default mappings.
|
||||
void map_set_default(bool value) {
|
||||
create_default_maps = value;
|
||||
}
|
||||
|
||||
/// Get the start of the hashed map list for "state" and first character "c".
|
||||
mapblock_T *get_maphash_list(int state, int c)
|
||||
{
|
||||
|
@ -541,6 +551,8 @@ static void map_add(buf_T *buf, mapblock_T **map_table, mapblock_T **abbr_table,
|
|||
mp->m_desc = xstrdup(args->desc);
|
||||
}
|
||||
|
||||
mp->m_default = create_default_maps;
|
||||
|
||||
// add the new entry in front of the abbrlist or maphash[] list
|
||||
if (is_abbr) {
|
||||
mp->m_next = *abbr_table;
|
||||
|
@ -2118,6 +2130,9 @@ static Dictionary mapblock_fill_dict(const mapblock_T *const mp, const char *lhs
|
|||
PUT_C(dict, "mode", CSTR_AS_OBJ(mapmode));
|
||||
PUT_C(dict, "abbr", INTEGER_OBJ(abbr ? 1 : 0));
|
||||
PUT_C(dict, "mode_bits", INTEGER_OBJ(mp->m_mode));
|
||||
if (mp->m_default) {
|
||||
PUT_C(dict, "default", INTEGER_OBJ(1));
|
||||
}
|
||||
|
||||
return dict;
|
||||
}
|
||||
|
|
|
@ -24,4 +24,5 @@ struct mapblock {
|
|||
sctx_T m_script_ctx; ///< SCTX where map was defined
|
||||
char *m_desc; ///< description of mapping
|
||||
bool m_replace_keycodes; ///< replace keycodes in result of expression
|
||||
bool m_default; ///< true if this is a |default-mapping|
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue