0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 9.0.1208: code is indented more than necessary

Problem:    Code is indented more than necessary.
Solution:   Use an early return where it makes sense. (Yegappan Lakshmanan,
            closes #11819)
This commit is contained in:
Yegappan Lakshmanan
2023-01-16 18:19:05 +00:00
committed by Bram Moolenaar
parent 450c7a97d1
commit a41e221935
12 changed files with 1318 additions and 1312 deletions

View File

@@ -67,38 +67,38 @@ clip_mch_request_selection(Clipboard_T *cbd)
char_u *clip_text = NULL;
cbdata = PhClipboardPasteStart(PhInputGroup(NULL));
if (cbdata != NULL)
if (cbdata == NULL)
return;
// Look for the vim specific clip first
clip_header = PhClipboardPasteType(cbdata, CLIP_TYPE_VIM);
if (clip_header != NULL && clip_header->data != NULL)
{
// Look for the vim specific clip first
clip_header = PhClipboardPasteType(cbdata, CLIP_TYPE_VIM);
if (clip_header != NULL && clip_header->data != NULL)
switch(*(char *) clip_header->data)
{
switch(*(char *) clip_header->data)
{
default: // fallthrough to line type
case 'L': type = MLINE; break;
case 'C': type = MCHAR; break;
case 'B': type = MBLOCK; break;
}
is_type_set = TRUE;
default: // fallthrough to line type
case 'L': type = MLINE; break;
case 'C': type = MCHAR; break;
case 'B': type = MBLOCK; break;
}
// Try for just normal text
clip_header = PhClipboardPasteType(cbdata, CLIP_TYPE_TEXT);
if (clip_header != NULL)
{
clip_text = clip_header->data;
clip_length = clip_header->length - 1;
if (clip_text != NULL && is_type_set == FALSE)
type = MAUTO;
}
if ((clip_text != NULL) && (clip_length > 0))
clip_yank_selection(type, clip_text, clip_length, cbd);
PhClipboardPasteFinish(cbdata);
is_type_set = TRUE;
}
// Try for just normal text
clip_header = PhClipboardPasteType(cbdata, CLIP_TYPE_TEXT);
if (clip_header != NULL)
{
clip_text = clip_header->data;
clip_length = clip_header->length - 1;
if (clip_text != NULL && is_type_set == FALSE)
type = MAUTO;
}
if ((clip_text != NULL) && (clip_length > 0))
clip_yank_selection(type, clip_text, clip_length, cbd);
PhClipboardPasteFinish(cbdata);
}
void