mirror of
https://github.com/neovim/neovim.git
synced 2025-09-11 05:48:17 +00:00
refactor(style): switch-case formatting, "uncrustify:indent-off" #15669
* refactor: disable formatting for attribute in macro * fixup: disable/enable uncrustify with uncrustify:indent-off/on * fixup: stop indenting contents inside braces in case * fixup: remove case brace if no variable declaration
This commit is contained in:
@@ -44,12 +44,12 @@ disable_processing_nl_cont = false # true/false
|
||||
# file.
|
||||
#
|
||||
# Default: *INDENT-OFF*
|
||||
disable_processing_cmt = " *INDENT-OFF*" # string
|
||||
disable_processing_cmt = "uncrustify:indent-off" # string
|
||||
|
||||
# Specify the marker used in comments to (re)enable processing in a file.
|
||||
#
|
||||
# Default: *INDENT-ON*
|
||||
enable_processing_cmt = " *INDENT-ON*" # string
|
||||
enable_processing_cmt = "uncrustify:indent-on" # string
|
||||
|
||||
# Enable parsing of digraphs.
|
||||
enable_digraphs = false # true/false
|
||||
@@ -1194,7 +1194,7 @@ indent_switch_case = 0 # unsigned number
|
||||
# Spaces to indent '{' from 'case'. By default, the brace will appear under
|
||||
# the 'c' in case. Usually set to 0 or indent_columns. Negative values are OK.
|
||||
# It might wise to choose the same value for the option indent_switch_case.
|
||||
indent_case_brace = 2 # number
|
||||
indent_case_brace = 0 # number
|
||||
|
||||
# indent 'break' with 'case' from 'switch'.
|
||||
indent_switch_break_with_case = false # true/false
|
||||
@@ -2987,7 +2987,7 @@ mod_move_case_break = false # true/false
|
||||
|
||||
# Add or remove braces around a fully braced case statement. Will only remove
|
||||
# braces if there are no variable declarations in the block.
|
||||
mod_case_brace = ignore # ignore/add/remove/force/not_defined
|
||||
mod_case_brace = remove # ignore/add/remove/force/not_defined
|
||||
|
||||
# Whether to remove a void 'return;' that appears as the last statement in a
|
||||
# function.
|
||||
@@ -3279,5 +3279,5 @@ set PREPROC REAL_FATTR_CONST
|
||||
set PREPROC REAL_FATTR_NONNULL_ALL
|
||||
set PREPROC REAL_FATTR_PURE
|
||||
set PREPROC REAL_FATTR_WARN_UNUSED_RESULT
|
||||
# option(s) with 'not default' value: 59
|
||||
# option(s) with 'not default' value: 61
|
||||
#
|
||||
|
@@ -1,37 +1,36 @@
|
||||
// This is an open source non-commercial project. Dear PVS-Studio, please check
|
||||
// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <msgpack.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include <uv.h>
|
||||
#include <msgpack.h>
|
||||
|
||||
#include "nvim/api/private/helpers.h"
|
||||
#include "nvim/api/vim.h"
|
||||
#include "nvim/api/ui.h"
|
||||
#include "nvim/channel.h"
|
||||
#include "nvim/msgpack_rpc/channel.h"
|
||||
#include "nvim/event/loop.h"
|
||||
#include "nvim/event/libuv_process.h"
|
||||
#include "nvim/event/rstream.h"
|
||||
#include "nvim/event/wstream.h"
|
||||
#include "nvim/event/socket.h"
|
||||
#include "nvim/msgpack_rpc/helpers.h"
|
||||
#include "nvim/vim.h"
|
||||
#include "nvim/main.h"
|
||||
#include "nvim/api/vim.h"
|
||||
#include "nvim/ascii.h"
|
||||
#include "nvim/memory.h"
|
||||
#include "nvim/channel.h"
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/os_unix.h"
|
||||
#include "nvim/message.h"
|
||||
#include "nvim/map.h"
|
||||
#include "nvim/log.h"
|
||||
#include "nvim/misc1.h"
|
||||
#include "nvim/event/libuv_process.h"
|
||||
#include "nvim/event/loop.h"
|
||||
#include "nvim/event/rstream.h"
|
||||
#include "nvim/event/socket.h"
|
||||
#include "nvim/event/wstream.h"
|
||||
#include "nvim/lib/kvec.h"
|
||||
#include "nvim/log.h"
|
||||
#include "nvim/main.h"
|
||||
#include "nvim/map.h"
|
||||
#include "nvim/memory.h"
|
||||
#include "nvim/message.h"
|
||||
#include "nvim/misc1.h"
|
||||
#include "nvim/msgpack_rpc/channel.h"
|
||||
#include "nvim/msgpack_rpc/helpers.h"
|
||||
#include "nvim/os/input.h"
|
||||
#include "nvim/os_unix.h"
|
||||
#include "nvim/ui.h"
|
||||
#include "nvim/vim.h"
|
||||
|
||||
#if MIN_LOG_LEVEL > DEBUG_LOG_LEVEL
|
||||
#define log_client_msg(...)
|
||||
@@ -116,10 +115,7 @@ bool rpc_send_event(uint64_t id, const char *name, Array args)
|
||||
/// @param args Array with method arguments
|
||||
/// @param[out] error True if the return value is an error
|
||||
/// @return Whatever the remote method returned
|
||||
Object rpc_send_call(uint64_t id,
|
||||
const char *method_name,
|
||||
Array args,
|
||||
Error *err)
|
||||
Object rpc_send_call(uint64_t id, const char *method_name, Array args, Error *err)
|
||||
{
|
||||
Channel *channel = NULL;
|
||||
|
||||
@@ -206,8 +202,7 @@ void rpc_unsubscribe(uint64_t id, char *event)
|
||||
unsubscribe(channel, event);
|
||||
}
|
||||
|
||||
static void receive_msgpack(Stream *stream, RBuffer *rbuf, size_t c,
|
||||
void *data, bool eof)
|
||||
static void receive_msgpack(Stream *stream, RBuffer *rbuf, size_t c, void *data, bool eof)
|
||||
{
|
||||
Channel *channel = data;
|
||||
channel_incref(channel);
|
||||
@@ -463,10 +458,7 @@ static void send_error(Channel *chan, MessageType type, uint32_t id, char *err)
|
||||
api_clear_error(&e);
|
||||
}
|
||||
|
||||
static void send_request(Channel *channel,
|
||||
uint32_t id,
|
||||
const char *name,
|
||||
Array args)
|
||||
static void send_request(Channel *channel, uint32_t id, const char *name, Array args)
|
||||
{
|
||||
const String method = cstr_as_string((char *)name);
|
||||
channel_write(channel, serialize_request(channel->id,
|
||||
@@ -477,9 +469,7 @@ static void send_request(Channel *channel,
|
||||
1));
|
||||
}
|
||||
|
||||
static void send_event(Channel *channel,
|
||||
const char *name,
|
||||
Array args)
|
||||
static void send_event(Channel *channel, const char *name, Array args)
|
||||
{
|
||||
const String method = cstr_as_string((char *)name);
|
||||
channel_write(channel, serialize_request(channel->id,
|
||||
@@ -634,12 +624,8 @@ static void call_set_error(Channel *channel, char *msg, int loglevel)
|
||||
channel_close(channel->id, kChannelPartRpc, NULL);
|
||||
}
|
||||
|
||||
static WBuffer *serialize_request(uint64_t channel_id,
|
||||
uint32_t request_id,
|
||||
const String method,
|
||||
Array args,
|
||||
msgpack_sbuffer *sbuffer,
|
||||
size_t refcount)
|
||||
static WBuffer *serialize_request(uint64_t channel_id, uint32_t request_id, const String method,
|
||||
Array args, msgpack_sbuffer *sbuffer, size_t refcount)
|
||||
{
|
||||
msgpack_packer pac;
|
||||
msgpack_packer_init(&pac, sbuffer, msgpack_sbuffer_write);
|
||||
@@ -654,12 +640,8 @@ static WBuffer *serialize_request(uint64_t channel_id,
|
||||
return rv;
|
||||
}
|
||||
|
||||
static WBuffer *serialize_response(uint64_t channel_id,
|
||||
MessageType type,
|
||||
uint32_t response_id,
|
||||
Error *err,
|
||||
Object arg,
|
||||
msgpack_sbuffer *sbuffer)
|
||||
static WBuffer *serialize_response(uint64_t channel_id, MessageType type, uint32_t response_id,
|
||||
Error *err, Object arg, msgpack_sbuffer *sbuffer)
|
||||
{
|
||||
msgpack_packer pac;
|
||||
msgpack_packer_init(&pac, sbuffer, msgpack_sbuffer_write);
|
||||
@@ -733,8 +715,7 @@ static const char *const msgpack_error_messages[] = {
|
||||
[MSGPACK_UNPACK_NOMEM_ERROR + MUR_OFF] = "not enough memory",
|
||||
};
|
||||
|
||||
static void log_server_msg(uint64_t channel_id,
|
||||
msgpack_sbuffer *packed)
|
||||
static void log_server_msg(uint64_t channel_id, msgpack_sbuffer *packed)
|
||||
{
|
||||
msgpack_unpacked unpacked;
|
||||
msgpack_unpacked_init(&unpacked);
|
||||
@@ -762,8 +743,7 @@ static void log_server_msg(uint64_t channel_id,
|
||||
.type = MSGPACK_OBJECT_STR,
|
||||
.via.str = {
|
||||
.ptr = (char *)msgpack_error_messages[result + MUR_OFF],
|
||||
.size = (uint32_t)strlen(
|
||||
msgpack_error_messages[result + MUR_OFF]),
|
||||
.size = (uint32_t)strlen(msgpack_error_messages[result + MUR_OFF]),
|
||||
},
|
||||
});
|
||||
break;
|
||||
@@ -771,9 +751,7 @@ static void log_server_msg(uint64_t channel_id,
|
||||
}
|
||||
}
|
||||
|
||||
static void log_client_msg(uint64_t channel_id,
|
||||
bool is_request,
|
||||
msgpack_object msg)
|
||||
static void log_client_msg(uint64_t channel_id, bool is_request, msgpack_object msg)
|
||||
{
|
||||
DLOGN("RPC <-ch %" PRIu64 ": ", channel_id);
|
||||
log_lock();
|
||||
|
@@ -1,19 +1,18 @@
|
||||
// This is an open source non-commercial project. Dear PVS-Studio, please check
|
||||
// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include <msgpack.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "nvim/api/private/dispatch.h"
|
||||
#include "nvim/api/private/helpers.h"
|
||||
#include "nvim/msgpack_rpc/helpers.h"
|
||||
#include "nvim/assert.h"
|
||||
#include "nvim/lib/kvec.h"
|
||||
#include "nvim/vim.h"
|
||||
#include "nvim/log.h"
|
||||
#include "nvim/memory.h"
|
||||
#include "nvim/assert.h"
|
||||
#include "nvim/msgpack_rpc/helpers.h"
|
||||
#include "nvim/vim.h"
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "msgpack_rpc/helpers.c.generated.h"
|
||||
@@ -48,7 +47,9 @@ static msgpack_sbuffer sbuffer;
|
||||
} \
|
||||
\
|
||||
static void msgpack_rpc_from_##lt(Integer o, msgpack_packer *res) \
|
||||
/* uncrustify:indent-off */ \
|
||||
FUNC_ATTR_NONNULL_ARG(2) \
|
||||
/* uncrustify:indent-on */ \
|
||||
{ \
|
||||
msgpack_packer pac; \
|
||||
msgpack_packer_init(&pac, &sbuffer, msgpack_sbuffer_write); \
|
||||
@@ -100,20 +101,17 @@ bool msgpack_rpc_to_object(const msgpack_object *const obj, Object *const arg)
|
||||
*cur.aobj = NIL;
|
||||
}
|
||||
switch (cur.mobj->type) {
|
||||
case MSGPACK_OBJECT_NIL: {
|
||||
case MSGPACK_OBJECT_NIL:
|
||||
break;
|
||||
}
|
||||
case MSGPACK_OBJECT_BOOLEAN: {
|
||||
case MSGPACK_OBJECT_BOOLEAN:
|
||||
*cur.aobj = BOOLEAN_OBJ(cur.mobj->via.boolean);
|
||||
break;
|
||||
}
|
||||
case MSGPACK_OBJECT_NEGATIVE_INTEGER: {
|
||||
case MSGPACK_OBJECT_NEGATIVE_INTEGER:
|
||||
STATIC_ASSERT(sizeof(Integer) == sizeof(cur.mobj->via.i64),
|
||||
"Msgpack integer size does not match API integer");
|
||||
*cur.aobj = INTEGER_OBJ(cur.mobj->via.i64);
|
||||
break;
|
||||
}
|
||||
case MSGPACK_OBJECT_POSITIVE_INTEGER: {
|
||||
case MSGPACK_OBJECT_POSITIVE_INTEGER:
|
||||
STATIC_ASSERT(sizeof(Integer) == sizeof(cur.mobj->via.u64),
|
||||
"Msgpack integer size does not match API integer");
|
||||
if (cur.mobj->via.u64 > API_INTEGER_MAX) {
|
||||
@@ -122,7 +120,6 @@ bool msgpack_rpc_to_object(const msgpack_object *const obj, Object *const arg)
|
||||
*cur.aobj = INTEGER_OBJ((Integer)cur.mobj->via.u64);
|
||||
}
|
||||
break;
|
||||
}
|
||||
#ifdef NVIM_MSGPACK_HAS_FLOAT32
|
||||
case MSGPACK_OBJECT_FLOAT32:
|
||||
case MSGPACK_OBJECT_FLOAT64:
|
||||
@@ -136,7 +133,7 @@ bool msgpack_rpc_to_object(const msgpack_object *const obj, Object *const arg)
|
||||
break;
|
||||
}
|
||||
#define STR_CASE(type, attr, obj, dest, conv) \
|
||||
case type: { \
|
||||
case type: { \
|
||||
dest = conv(((String) { \
|
||||
.size = obj->via.attr.size, \
|
||||
.data = (obj->via.attr.ptr == NULL || obj->via.attr.size == 0 \
|
||||
@@ -144,7 +141,7 @@ bool msgpack_rpc_to_object(const msgpack_object *const obj, Object *const arg)
|
||||
: xmemdupz(obj->via.attr.ptr, obj->via.attr.size)), \
|
||||
})); \
|
||||
break; \
|
||||
}
|
||||
}
|
||||
STR_CASE(MSGPACK_OBJECT_STR, str, cur.mobj, *cur.aobj, STRING_OBJ)
|
||||
STR_CASE(MSGPACK_OBJECT_BIN, bin, cur.mobj, *cur.aobj, STRING_OBJ)
|
||||
case MSGPACK_OBJECT_ARRAY: {
|
||||
@@ -204,11 +201,10 @@ bool msgpack_rpc_to_object(const msgpack_object *const obj, Object *const arg)
|
||||
#endif
|
||||
case MSGPACK_OBJECT_EXT:
|
||||
case MSGPACK_OBJECT_MAP:
|
||||
case MSGPACK_OBJECT_ARRAY: {
|
||||
case MSGPACK_OBJECT_ARRAY:
|
||||
ret = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ret) {
|
||||
kvi_push(stack, ((MPToAPIObjectStackItem) {
|
||||
.mobj = &cur.mobj->via.map.ptr[idx].val,
|
||||
@@ -230,23 +226,20 @@ bool msgpack_rpc_to_object(const msgpack_object *const obj, Object *const arg)
|
||||
}
|
||||
break;
|
||||
}
|
||||
case MSGPACK_OBJECT_EXT: {
|
||||
case MSGPACK_OBJECT_EXT:
|
||||
switch ((ObjectType)(cur.mobj->via.ext.type + EXT_OBJECT_TYPE_SHIFT)) {
|
||||
case kObjectTypeBuffer: {
|
||||
case kObjectTypeBuffer:
|
||||
cur.aobj->type = kObjectTypeBuffer;
|
||||
ret = msgpack_rpc_to_buffer(cur.mobj, &cur.aobj->data.integer);
|
||||
break;
|
||||
}
|
||||
case kObjectTypeWindow: {
|
||||
case kObjectTypeWindow:
|
||||
cur.aobj->type = kObjectTypeWindow;
|
||||
ret = msgpack_rpc_to_window(cur.mobj, &cur.aobj->data.integer);
|
||||
break;
|
||||
}
|
||||
case kObjectTypeTabpage: {
|
||||
case kObjectTypeTabpage:
|
||||
cur.aobj->type = kObjectTypeTabpage;
|
||||
ret = msgpack_rpc_to_tabpage(cur.mobj, &cur.aobj->data.integer);
|
||||
break;
|
||||
}
|
||||
case kObjectTypeNil:
|
||||
case kObjectTypeBoolean:
|
||||
case kObjectTypeInteger:
|
||||
@@ -254,12 +247,10 @@ bool msgpack_rpc_to_object(const msgpack_object *const obj, Object *const arg)
|
||||
case kObjectTypeString:
|
||||
case kObjectTypeArray:
|
||||
case kObjectTypeDictionary:
|
||||
case kObjectTypeLuaRef: {
|
||||
case kObjectTypeLuaRef:
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
#undef STR_CASE
|
||||
}
|
||||
if (!cur.container) {
|
||||
@@ -270,8 +261,7 @@ bool msgpack_rpc_to_object(const msgpack_object *const obj, Object *const arg)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static bool msgpack_rpc_to_string(const msgpack_object *const obj,
|
||||
String *const arg)
|
||||
static bool msgpack_rpc_to_string(const msgpack_object *const obj, String *const arg)
|
||||
FUNC_ATTR_NONNULL_ALL
|
||||
{
|
||||
if (obj->type == MSGPACK_OBJECT_BIN || obj->type == MSGPACK_OBJECT_STR) {
|
||||
@@ -303,8 +293,7 @@ bool msgpack_rpc_to_array(const msgpack_object *const obj, Array *const arg)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool msgpack_rpc_to_dictionary(const msgpack_object *const obj,
|
||||
Dictionary *const arg)
|
||||
bool msgpack_rpc_to_dictionary(const msgpack_object *const obj, Dictionary *const arg)
|
||||
FUNC_ATTR_NONNULL_ALL
|
||||
{
|
||||
if (obj->type != MSGPACK_OBJECT_MAP) {
|
||||
@@ -386,41 +375,33 @@ void msgpack_rpc_from_object(const Object result, msgpack_packer *const res)
|
||||
"Buffer, window and tabpage enum items are in order");
|
||||
switch (cur.aobj->type) {
|
||||
case kObjectTypeNil:
|
||||
case kObjectTypeLuaRef: {
|
||||
case kObjectTypeLuaRef:
|
||||
// TODO(bfredl): could also be an error. Though kObjectTypeLuaRef
|
||||
// should only appear when the caller has opted in to handle references,
|
||||
// see nlua_pop_Object.
|
||||
msgpack_pack_nil(res);
|
||||
break;
|
||||
}
|
||||
case kObjectTypeBoolean: {
|
||||
case kObjectTypeBoolean:
|
||||
msgpack_rpc_from_boolean(cur.aobj->data.boolean, res);
|
||||
break;
|
||||
}
|
||||
case kObjectTypeInteger: {
|
||||
case kObjectTypeInteger:
|
||||
msgpack_rpc_from_integer(cur.aobj->data.integer, res);
|
||||
break;
|
||||
}
|
||||
case kObjectTypeFloat: {
|
||||
case kObjectTypeFloat:
|
||||
msgpack_rpc_from_float(cur.aobj->data.floating, res);
|
||||
break;
|
||||
}
|
||||
case kObjectTypeString: {
|
||||
case kObjectTypeString:
|
||||
msgpack_rpc_from_string(cur.aobj->data.string, res);
|
||||
break;
|
||||
}
|
||||
case kObjectTypeBuffer: {
|
||||
case kObjectTypeBuffer:
|
||||
msgpack_rpc_from_buffer(cur.aobj->data.integer, res);
|
||||
break;
|
||||
}
|
||||
case kObjectTypeWindow: {
|
||||
case kObjectTypeWindow:
|
||||
msgpack_rpc_from_window(cur.aobj->data.integer, res);
|
||||
break;
|
||||
}
|
||||
case kObjectTypeTabpage: {
|
||||
case kObjectTypeTabpage:
|
||||
msgpack_rpc_from_tabpage(cur.aobj->data.integer, res);
|
||||
break;
|
||||
}
|
||||
case kObjectTypeArray: {
|
||||
const size_t size = cur.aobj->data.array.size;
|
||||
if (cur.container) {
|
||||
@@ -495,9 +476,7 @@ void msgpack_rpc_from_dictionary(Dictionary result, msgpack_packer *res)
|
||||
}
|
||||
|
||||
/// Serializes a msgpack-rpc request or notification(id == 0)
|
||||
void msgpack_rpc_serialize_request(uint32_t request_id,
|
||||
const String method,
|
||||
Array args,
|
||||
void msgpack_rpc_serialize_request(uint32_t request_id, const String method, Array args,
|
||||
msgpack_packer *pac)
|
||||
FUNC_ATTR_NONNULL_ARG(4)
|
||||
{
|
||||
@@ -513,9 +492,7 @@ void msgpack_rpc_serialize_request(uint32_t request_id,
|
||||
}
|
||||
|
||||
/// Serializes a msgpack-rpc response
|
||||
void msgpack_rpc_serialize_response(uint32_t response_id,
|
||||
Error *err,
|
||||
Object arg,
|
||||
void msgpack_rpc_serialize_response(uint32_t response_id, Error *err, Object arg,
|
||||
msgpack_packer *pac)
|
||||
FUNC_ATTR_NONNULL_ARG(2, 4)
|
||||
{
|
||||
@@ -567,8 +544,7 @@ static msgpack_object *msgpack_rpc_msg_id(msgpack_object *req)
|
||||
return obj->type == MSGPACK_OBJECT_POSITIVE_INTEGER ? obj : NULL;
|
||||
}
|
||||
|
||||
MessageType msgpack_rpc_validate(uint32_t *response_id, msgpack_object *req,
|
||||
Error *err)
|
||||
MessageType msgpack_rpc_validate(uint32_t *response_id, msgpack_object *req, Error *err)
|
||||
{
|
||||
*response_id = 0;
|
||||
// Validate the basic structure of the msgpack-rpc payload
|
||||
|
@@ -2,24 +2,24 @@
|
||||
// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
|
||||
|
||||
#include <assert.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "nvim/ascii.h"
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/event/socket.h"
|
||||
#include "nvim/fileio.h"
|
||||
#include "nvim/garray.h"
|
||||
#include "nvim/log.h"
|
||||
#include "nvim/main.h"
|
||||
#include "nvim/memory.h"
|
||||
#include "nvim/msgpack_rpc/channel.h"
|
||||
#include "nvim/msgpack_rpc/server.h"
|
||||
#include "nvim/os/os.h"
|
||||
#include "nvim/event/socket.h"
|
||||
#include "nvim/ascii.h"
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/garray.h"
|
||||
#include "nvim/vim.h"
|
||||
#include "nvim/main.h"
|
||||
#include "nvim/memory.h"
|
||||
#include "nvim/log.h"
|
||||
#include "nvim/fileio.h"
|
||||
#include "nvim/path.h"
|
||||
#include "nvim/strings.h"
|
||||
#include "nvim/vim.h"
|
||||
|
||||
#define MAX_CONNECTIONS 32
|
||||
#define LISTEN_ADDRESS_ENV_VAR "NVIM_LISTEN_ADDRESS"
|
||||
|
@@ -2473,9 +2473,8 @@ bool do_mouse(oparg_T *oap, int c, int dir, long count, bool fixindent)
|
||||
in_tab_line = true;
|
||||
c1 = tab_page_click_defs[mouse_col].tabnr;
|
||||
switch (tab_page_click_defs[mouse_col].type) {
|
||||
case kStlClickDisabled: {
|
||||
case kStlClickDisabled:
|
||||
break;
|
||||
}
|
||||
case kStlClickTabClose: {
|
||||
tabpage_T *tp;
|
||||
|
||||
@@ -2494,7 +2493,7 @@ bool do_mouse(oparg_T *oap, int c, int dir, long count, bool fixindent)
|
||||
}
|
||||
break;
|
||||
}
|
||||
case kStlClickTabSwitch: {
|
||||
case kStlClickTabSwitch:
|
||||
if ((mod_mask & MOD_MASK_MULTI_CLICK) == MOD_MASK_2CLICK) {
|
||||
// double click opens new page
|
||||
end_visual_mode();
|
||||
@@ -2511,7 +2510,6 @@ bool do_mouse(oparg_T *oap, int c, int dir, long count, bool fixindent)
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case kStlClickFuncRun: {
|
||||
typval_T argv[] = {
|
||||
{
|
||||
|
@@ -6221,24 +6221,20 @@ static void set_clipboard(int name, yankreg_T *reg)
|
||||
|
||||
char regtype;
|
||||
switch (reg->y_type) {
|
||||
case kMTLineWise: {
|
||||
case kMTLineWise:
|
||||
regtype = 'V';
|
||||
tv_list_append_string(lines, NULL, 0);
|
||||
break;
|
||||
}
|
||||
case kMTCharWise: {
|
||||
case kMTCharWise:
|
||||
regtype = 'v';
|
||||
break;
|
||||
}
|
||||
case kMTBlockWise: {
|
||||
case kMTBlockWise:
|
||||
regtype = 'b';
|
||||
tv_list_append_string(lines, NULL, 0);
|
||||
break;
|
||||
}
|
||||
case kMTUnknown: {
|
||||
case kMTUnknown:
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
list_T *args = tv_list_alloc(3);
|
||||
tv_list_append_list(args, lines);
|
||||
|
Reference in New Issue
Block a user