Mercurial > vim
comparison src/os_qnx.c @ 31752:3365a601e73b v9.0.1208
patch 9.0.1208: code is indented more than necessary
Commit: https://github.com/vim/vim/commit/a41e221935edab62672a15123af48f4f14ac1c7d
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Mon Jan 16 18:19:05 2023 +0000
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 16 Jan 2023 19:30:04 +0100 |
parents | 44b855153d8e |
children | 97255d909654 |
comparison
equal
deleted
inserted
replaced
31751:997105f91449 | 31752:3365a601e73b |
---|---|
65 void *cbdata; | 65 void *cbdata; |
66 PhClipHeader *clip_header; | 66 PhClipHeader *clip_header; |
67 char_u *clip_text = NULL; | 67 char_u *clip_text = NULL; |
68 | 68 |
69 cbdata = PhClipboardPasteStart(PhInputGroup(NULL)); | 69 cbdata = PhClipboardPasteStart(PhInputGroup(NULL)); |
70 if (cbdata != NULL) | 70 if (cbdata == NULL) |
71 return; | |
72 | |
73 // Look for the vim specific clip first | |
74 clip_header = PhClipboardPasteType(cbdata, CLIP_TYPE_VIM); | |
75 if (clip_header != NULL && clip_header->data != NULL) | |
71 { | 76 { |
72 // Look for the vim specific clip first | 77 switch(*(char *) clip_header->data) |
73 clip_header = PhClipboardPasteType(cbdata, CLIP_TYPE_VIM); | |
74 if (clip_header != NULL && clip_header->data != NULL) | |
75 { | 78 { |
76 switch(*(char *) clip_header->data) | 79 default: // fallthrough to line type |
77 { | 80 case 'L': type = MLINE; break; |
78 default: // fallthrough to line type | 81 case 'C': type = MCHAR; break; |
79 case 'L': type = MLINE; break; | 82 case 'B': type = MBLOCK; break; |
80 case 'C': type = MCHAR; break; | |
81 case 'B': type = MBLOCK; break; | |
82 } | |
83 is_type_set = TRUE; | |
84 } | 83 } |
84 is_type_set = TRUE; | |
85 } | |
85 | 86 |
86 // Try for just normal text | 87 // Try for just normal text |
87 clip_header = PhClipboardPasteType(cbdata, CLIP_TYPE_TEXT); | 88 clip_header = PhClipboardPasteType(cbdata, CLIP_TYPE_TEXT); |
88 if (clip_header != NULL) | 89 if (clip_header != NULL) |
89 { | 90 { |
90 clip_text = clip_header->data; | 91 clip_text = clip_header->data; |
91 clip_length = clip_header->length - 1; | 92 clip_length = clip_header->length - 1; |
92 | 93 |
93 if (clip_text != NULL && is_type_set == FALSE) | 94 if (clip_text != NULL && is_type_set == FALSE) |
94 type = MAUTO; | 95 type = MAUTO; |
95 } | 96 } |
96 | 97 |
97 if ((clip_text != NULL) && (clip_length > 0)) | 98 if ((clip_text != NULL) && (clip_length > 0)) |
98 clip_yank_selection(type, clip_text, clip_length, cbd); | 99 clip_yank_selection(type, clip_text, clip_length, cbd); |
99 | 100 |
100 PhClipboardPasteFinish(cbdata); | 101 PhClipboardPasteFinish(cbdata); |
101 } | |
102 } | 102 } |
103 | 103 |
104 void | 104 void |
105 clip_mch_set_selection(Clipboard_T *cbd) | 105 clip_mch_set_selection(Clipboard_T *cbd) |
106 { | 106 { |