mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
patch 8.2.0631: Haiku file formatted with wrong tabstop
Problem: Haiku file formatted with wrong tabstop. Solution: Use normal tabstop. Fix white space.
This commit is contained in:
176
src/gui_haiku.cc
176
src/gui_haiku.cc
@@ -863,7 +863,7 @@ VimApp::MessageReceived(BMessage *m)
|
||||
{
|
||||
BFilePanel *panel;
|
||||
m->FindPointer("source", (void**)&panel);
|
||||
if(fFilePanelSem != -1 && panel == fFilePanel)
|
||||
if (fFilePanelSem != -1 && panel == fFilePanel)
|
||||
{
|
||||
delete_sem(fFilePanelSem);
|
||||
fFilePanelSem = -1;
|
||||
@@ -1593,7 +1593,7 @@ VimTextAreaView::MessageReceived(BMessage *m)
|
||||
switch(opcode)
|
||||
{
|
||||
case B_INPUT_METHOD_STARTED:
|
||||
if(!IMData.messenger) delete IMData.messenger;
|
||||
if (!IMData.messenger) delete IMData.messenger;
|
||||
IMData.messenger = new BMessenger();
|
||||
m->FindMessenger("be:reply_to", IMData.messenger);
|
||||
break;
|
||||
@@ -1601,7 +1601,7 @@ VimTextAreaView::MessageReceived(BMessage *m)
|
||||
{
|
||||
BString str;
|
||||
bool confirmed;
|
||||
if(IMData.message) *(IMData.message) = *m;
|
||||
if (IMData.message) *(IMData.message) = *m;
|
||||
else IMData.message = new BMessage(*m);
|
||||
DrawIMString();
|
||||
m->FindBool("be:confirmed", &confirmed);
|
||||
@@ -1660,7 +1660,7 @@ VimTextAreaView::MessageReceived(BMessage *m)
|
||||
VimTextAreaView::mchInitFont(char_u *name)
|
||||
{
|
||||
VimFont *newFont = (VimFont *)gui_mch_get_font(name, 1);
|
||||
if(newFont != NOFONT) {
|
||||
if (newFont != NOFONT) {
|
||||
gui.norm_font = (GuiFont)newFont;
|
||||
gui_mch_set_font((GuiFont)newFont);
|
||||
if (name && STRCMP(name, "*") != 0)
|
||||
@@ -1691,9 +1691,9 @@ VimTextAreaView::mchDrawString(int row, int col, char_u *s, int len, int flags)
|
||||
if (!(flags & DRAW_TRANSP)) {
|
||||
int cells;
|
||||
cells = 0;
|
||||
for(int i=0; i<len; i++) {
|
||||
for (int i=0; i<len; i++) {
|
||||
int cn = utf_ptr2cells((char_u *)(s+i));
|
||||
if(cn<4) cells += cn;
|
||||
if (cn<4) cells += cn;
|
||||
}
|
||||
|
||||
BRect r(FILL_X(col), FILL_Y(row),
|
||||
@@ -1703,13 +1703,13 @@ VimTextAreaView::mchDrawString(int row, int col, char_u *s, int len, int flags)
|
||||
|
||||
BFont font;
|
||||
this->GetFont(&font);
|
||||
if(!font.IsFixed())
|
||||
if (!font.IsFixed())
|
||||
{
|
||||
char* p = (char*)s;
|
||||
int32 clen, lastpos = 0;
|
||||
BPoint where;
|
||||
int cells;
|
||||
while((p - (char*)s) < len) {
|
||||
while ((p - (char*)s) < len) {
|
||||
clen = utf_ptr2len((u_char*)p);
|
||||
where.Set(TEXT_X(col+lastpos), TEXT_Y(row));
|
||||
DrawString(p, clen, where);
|
||||
@@ -1720,7 +1720,7 @@ VimTextAreaView::mchDrawString(int row, int col, char_u *s, int len, int flags)
|
||||
SetDrawingMode(B_OP_COPY);
|
||||
}
|
||||
cells = utf_ptr2cells((char_u *)p);
|
||||
if(cells<4) lastpos += cells;
|
||||
if (cells<4) lastpos += cells;
|
||||
else lastpos++;
|
||||
p += clen;
|
||||
}
|
||||
@@ -1740,9 +1740,9 @@ VimTextAreaView::mchDrawString(int row, int col, char_u *s, int len, int flags)
|
||||
if (flags & DRAW_UNDERL) {
|
||||
int cells;
|
||||
cells = 0;
|
||||
for(int i=0; i<len; i++) {
|
||||
for (int i=0; i<len; i++) {
|
||||
int cn = utf_ptr2cells((char_u *)(s+i));
|
||||
if(cn<4) cells += cn;
|
||||
if (cn<4) cells += cn;
|
||||
}
|
||||
|
||||
BPoint start(FILL_X(col), FILL_Y(row + 1) - PEN_WIDTH);
|
||||
@@ -2073,10 +2073,10 @@ VimDialog::VimDialog(int type, const char *title, const char *message,
|
||||
{
|
||||
// master view
|
||||
VimDialog::View* view = new VimDialog::View(Bounds());
|
||||
if(view == NULL)
|
||||
if (view == NULL)
|
||||
return;
|
||||
|
||||
if(title == NULL)
|
||||
if (title == NULL)
|
||||
SetTitle("Vim " VIM_VERSION_MEDIUM);
|
||||
|
||||
AddChild(view);
|
||||
@@ -2094,7 +2094,7 @@ VimDialog::VimDialog(int type, const char *title, const char *message,
|
||||
strButtons.RemoveAll("&");
|
||||
do {
|
||||
int32 end = strButtons.FindFirst('\n');
|
||||
if(end != B_ERROR)
|
||||
if (end != B_ERROR)
|
||||
strButtons.SetByteAt(end, '\0');
|
||||
|
||||
BButton *button = _CreateButton(which++, strButtons.String());
|
||||
@@ -2106,11 +2106,11 @@ VimDialog::VimDialog(int type, const char *title, const char *message,
|
||||
buttonsWidth += button->Bounds().Width();
|
||||
buttonsHeight += button->Bounds().Height();
|
||||
|
||||
if(end == B_ERROR)
|
||||
if (end == B_ERROR)
|
||||
break;
|
||||
|
||||
strButtons.Remove(0, end + 1);
|
||||
} while(true);
|
||||
} while (true);
|
||||
|
||||
int32 buttonsCount = fButtonsList.CountItems();
|
||||
buttonsWidth += kVimDialogButtonsSpacingX * (buttonsCount - 1);
|
||||
@@ -2122,7 +2122,7 @@ VimDialog::VimDialog(int type, const char *title, const char *message,
|
||||
// Check 'v' flag in 'guioptions': vertical button placement.
|
||||
bool vertical = (vim_strchr(p_go, GO_VERTICAL) != NULL) ||
|
||||
dialogWidth >= gui.vimWindow->Bounds().Width();
|
||||
if(vertical) {
|
||||
if (vertical) {
|
||||
dialogWidth -= buttonsWidth;
|
||||
dialogWidth += maxButtonWidth;
|
||||
dialogHeight -= maxButtonHeight;
|
||||
@@ -2156,7 +2156,7 @@ VimDialog::VimDialog(int type, const char *title, const char *message,
|
||||
dialogHeight += messageHeight;
|
||||
|
||||
// input view
|
||||
if(fInputValue != NULL) {
|
||||
if (fInputValue != NULL) {
|
||||
rect.top =
|
||||
rect.bottom += messageHeight + kVimDialogSpacingY;
|
||||
fInputControl = new BTextControl(rect, "_iv_", NULL, fInputValue, NULL,
|
||||
@@ -2184,16 +2184,16 @@ VimDialog::VimDialog(int type, const char *title, const char *message,
|
||||
origin.x -= kVimDialogSpacingX + (vertical ? buttonWidth : buttonsWidth);
|
||||
origin.y -= kVimDialogSpacingY + (vertical ? buttonsHeight : maxButtonHeight);
|
||||
|
||||
for(int32 i = 0 ; i < buttonsCount; i++) {
|
||||
for (int32 i = 0 ; i < buttonsCount; i++) {
|
||||
BButton *button = (BButton*)fButtonsList.ItemAt(i);
|
||||
button->MoveTo(origin);
|
||||
if(vertical) {
|
||||
if (vertical) {
|
||||
origin.y += button->Frame().Height() + kVimDialogButtonsSpacingY;
|
||||
button->ResizeTo(buttonWidth, button->Frame().Height());
|
||||
} else
|
||||
origin.x += button->Frame().Width() + kVimDialogButtonsSpacingX;
|
||||
|
||||
if(dfltbutton == i + 1) {
|
||||
if (dfltbutton == i + 1) {
|
||||
button->MakeDefault(true);
|
||||
button->MakeFocus(fInputControl == NULL);
|
||||
}
|
||||
@@ -2202,7 +2202,7 @@ VimDialog::VimDialog(int type, const char *title, const char *message,
|
||||
|
||||
VimDialog::~VimDialog()
|
||||
{
|
||||
if(fDialogSem > B_OK)
|
||||
if (fDialogSem > B_OK)
|
||||
delete_sem(fDialogSem);
|
||||
}
|
||||
|
||||
@@ -2210,20 +2210,20 @@ VimDialog::~VimDialog()
|
||||
VimDialog::Go()
|
||||
{
|
||||
fDialogSem = create_sem(0, "VimDialogSem");
|
||||
if(fDialogSem < B_OK) {
|
||||
if (fDialogSem < B_OK) {
|
||||
Quit();
|
||||
return fDialogValue;
|
||||
}
|
||||
|
||||
Show();
|
||||
|
||||
while(acquire_sem(fDialogSem) == B_INTERRUPTED);
|
||||
while (acquire_sem(fDialogSem) == B_INTERRUPTED);
|
||||
|
||||
int retValue = fDialogValue;
|
||||
if(fInputValue != NULL)
|
||||
if (fInputValue != NULL)
|
||||
vim_strncpy((char_u*)fInputValue, (char_u*)fInputControl->Text(), IOSIZE - 1);
|
||||
|
||||
if(Lock())
|
||||
if (Lock())
|
||||
Quit();
|
||||
|
||||
return retValue;
|
||||
@@ -2232,7 +2232,7 @@ VimDialog::Go()
|
||||
void VimDialog::MessageReceived(BMessage *msg)
|
||||
{
|
||||
int32 which = 0;
|
||||
if(msg->what != kVimDialogButtonMsg ||
|
||||
if (msg->what != kVimDialogButtonMsg ||
|
||||
msg->FindInt32("which", &which) != B_OK)
|
||||
return BWindow::MessageReceived(msg);
|
||||
|
||||
@@ -2279,7 +2279,7 @@ void VimDialog::View::Draw(BRect updateRect)
|
||||
SetHighColor(tint_color(ViewColor(), B_DARKEN_1_TINT));
|
||||
FillRect(stripeRect);
|
||||
|
||||
if(fIconBitmap == NULL)
|
||||
if (fIconBitmap == NULL)
|
||||
return;
|
||||
|
||||
SetDrawingMode(B_OP_ALPHA);
|
||||
@@ -2289,12 +2289,12 @@ void VimDialog::View::Draw(BRect updateRect)
|
||||
|
||||
void VimDialog::View::InitIcon(int32 type)
|
||||
{
|
||||
if(type == VIM_GENERIC)
|
||||
if (type == VIM_GENERIC)
|
||||
return;
|
||||
|
||||
BPath path;
|
||||
status_t status = find_directory(B_BEOS_SERVERS_DIRECTORY, &path);
|
||||
if(status != B_OK) {
|
||||
if (status != B_OK) {
|
||||
fprintf(stderr, "Cannot retrieve app info:%s\n", strerror(status));
|
||||
return;
|
||||
}
|
||||
@@ -2302,14 +2302,14 @@ void VimDialog::View::InitIcon(int32 type)
|
||||
path.Append("app_server");
|
||||
|
||||
BFile file(path.Path(), O_RDONLY);
|
||||
if(file.InitCheck() != B_OK) {
|
||||
if (file.InitCheck() != B_OK) {
|
||||
fprintf(stderr, "App file assignment failed:%s\n",
|
||||
strerror(file.InitCheck()));
|
||||
return;
|
||||
}
|
||||
|
||||
BResources resources(&file);
|
||||
if(resources.InitCheck() != B_OK) {
|
||||
if (resources.InitCheck() != B_OK) {
|
||||
fprintf(stderr, "App server resources assignment failed:%s\n",
|
||||
strerror(resources.InitCheck()));
|
||||
return;
|
||||
@@ -2326,7 +2326,7 @@ void VimDialog::View::InitIcon(int32 type)
|
||||
|
||||
int32 iconSize = 32;
|
||||
fIconBitmap = new BBitmap(BRect(0, 0, iconSize - 1, iconSize - 1), 0, B_RGBA32);
|
||||
if(fIconBitmap == NULL || fIconBitmap->InitCheck() != B_OK) {
|
||||
if (fIconBitmap == NULL || fIconBitmap->InitCheck() != B_OK) {
|
||||
fprintf(stderr, "Icon bitmap allocation failed:%s\n",
|
||||
(fIconBitmap == NULL) ? "null" : strerror(fIconBitmap->InitCheck()));
|
||||
return;
|
||||
@@ -2336,19 +2336,19 @@ void VimDialog::View::InitIcon(int32 type)
|
||||
const uint8* iconData = NULL;
|
||||
// try vector icon first?
|
||||
iconData = (const uint8*)resources.LoadResource(B_VECTOR_ICON_TYPE, name, &size);
|
||||
if(iconData != NULL && BIconUtils::GetVectorIcon(iconData, size, fIconBitmap) == B_OK)
|
||||
if (iconData != NULL && BIconUtils::GetVectorIcon(iconData, size, fIconBitmap) == B_OK)
|
||||
return;
|
||||
|
||||
// try bitmap icon now
|
||||
iconData = (const uint8*)resources.LoadResource(B_LARGE_ICON_TYPE, name, &size);
|
||||
if(iconData == NULL) {
|
||||
if (iconData == NULL) {
|
||||
fprintf(stderr, "Bitmap icon resource not found\n");
|
||||
delete fIconBitmap;
|
||||
fIconBitmap = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
if(fIconBitmap->ColorSpace() != B_CMAP8)
|
||||
if (fIconBitmap->ColorSpace() != B_CMAP8)
|
||||
BIconUtils::ConvertFromCMAP8(iconData, iconSize, iconSize, iconSize, fIconBitmap);
|
||||
}
|
||||
|
||||
@@ -2555,7 +2555,7 @@ VimSelectFontDialog::~VimSelectFontDialog()
|
||||
void
|
||||
VimSelectFontDialog::_CleanList(BListView* list)
|
||||
{
|
||||
while(0 < list->CountItems())
|
||||
while (0 < list->CountItems())
|
||||
delete (dynamic_cast<BStringItem*>(list->RemoveItem((int32)0)));
|
||||
}
|
||||
|
||||
@@ -2568,18 +2568,18 @@ VimSelectFontDialog::Go()
|
||||
}
|
||||
|
||||
fDialogSem = create_sem(0, "VimFontSelectDialogSem");
|
||||
if(fDialogSem < B_OK) {
|
||||
if (fDialogSem < B_OK) {
|
||||
Quit();
|
||||
return fDialogValue;
|
||||
}
|
||||
|
||||
Show();
|
||||
|
||||
while(acquire_sem(fDialogSem) == B_INTERRUPTED);
|
||||
while (acquire_sem(fDialogSem) == B_INTERRUPTED);
|
||||
|
||||
bool retValue = fDialogValue;
|
||||
|
||||
if(Lock())
|
||||
if (Lock())
|
||||
Quit();
|
||||
|
||||
return retValue;
|
||||
@@ -2724,7 +2724,7 @@ VimToolbar::VimToolbar(BRect frame, const char *name) :
|
||||
VimToolbar::~VimToolbar()
|
||||
{
|
||||
int32 count = fButtonsList.CountItems();
|
||||
for(int32 i = 0; i < count; i++)
|
||||
for (int32 i = 0; i < count; i++)
|
||||
delete (BPictureButton*)fButtonsList.ItemAt(i);
|
||||
fButtonsList.MakeEmpty();
|
||||
|
||||
@@ -2757,7 +2757,7 @@ VimToolbar::ModifyBitmapToGrayed(BBitmap *bitmap)
|
||||
|
||||
rgb_color *bits = (rgb_color*)bitmap->Bits();
|
||||
int32 pixels = bitmap->BitsLength() / 4;
|
||||
for(int32 i = 0; i < pixels; i++) {
|
||||
for (int32 i = 0; i < pixels; i++) {
|
||||
bits[i].red = bits[i].green =
|
||||
bits[i].blue = ((uint32)bits[i].red + bits[i].green + bits[i].blue) / 3;
|
||||
bits[i].alpha /= 4;
|
||||
@@ -2771,18 +2771,18 @@ VimToolbar::PrepareButtonBitmaps()
|
||||
{
|
||||
// first try to load potentially customized $VIRUNTIME/bitmaps/builtin-tools.png
|
||||
normalButtonsBitmap = LoadVimBitmap("builtin-tools.png");
|
||||
if(normalButtonsBitmap == NULL)
|
||||
if (normalButtonsBitmap == NULL)
|
||||
// customized not found? dig application resources for "builtin-tools" one
|
||||
normalButtonsBitmap = BTranslationUtils::GetBitmap(B_PNG_FORMAT, "builtin-tools");
|
||||
|
||||
if(normalButtonsBitmap == NULL)
|
||||
if (normalButtonsBitmap == NULL)
|
||||
return false;
|
||||
|
||||
BMessage archive;
|
||||
normalButtonsBitmap->Archive(&archive);
|
||||
|
||||
grayedButtonsBitmap = new BBitmap(&archive);
|
||||
if(grayedButtonsBitmap == NULL)
|
||||
if (grayedButtonsBitmap == NULL)
|
||||
return false;
|
||||
|
||||
// modify grayed bitmap
|
||||
@@ -2797,13 +2797,13 @@ BBitmap *VimToolbar::LoadVimBitmap(const char* fileName)
|
||||
|
||||
int mustfree = 0;
|
||||
char_u* runtimePath = vim_getenv((char_u*)"VIMRUNTIME", &mustfree);
|
||||
if(runtimePath != NULL && fileName != NULL) {
|
||||
if (runtimePath != NULL && fileName != NULL) {
|
||||
BString strPath((char*)runtimePath);
|
||||
strPath << "/bitmaps/" << fileName;
|
||||
bitmap = BTranslationUtils::GetBitmap(strPath.String());
|
||||
}
|
||||
|
||||
if(mustfree)
|
||||
if (mustfree)
|
||||
vim_free(runtimePath);
|
||||
|
||||
return bitmap;
|
||||
@@ -2831,7 +2831,7 @@ VimToolbar::GetPictureFromBitmap(BPicture *pictureTo, int32 index, BBitmap *bitm
|
||||
|
||||
view.DrawBitmap(bitmapFrom, source, destination);
|
||||
|
||||
if(pressed) {
|
||||
if (pressed) {
|
||||
rgb_color shineColor = ui_color(B_SHINE_COLOR);
|
||||
rgb_color shadowColor = ui_color(B_SHADOW_COLOR);
|
||||
size += ButtonMargin * 2 - 1;
|
||||
@@ -2853,7 +2853,7 @@ VimToolbar::GetPictureFromBitmap(BPicture *pictureTo, int32 index, BBitmap *bitm
|
||||
VimToolbar::AddButton(int32 index, vimmenu_T *menu)
|
||||
{
|
||||
BPictureButton *button = NULL;
|
||||
if(!menu_is_separator(menu->name)) {
|
||||
if (!menu_is_separator(menu->name)) {
|
||||
float size = normalButtonsBitmap ?
|
||||
normalButtonsBitmap->Bounds().Height() + 1. + ButtonMargin * 2 : 18.;
|
||||
BRect frame(0, 0, size, size);
|
||||
@@ -2861,7 +2861,7 @@ VimToolbar::AddButton(int32 index, vimmenu_T *menu)
|
||||
BPicture pictureOff;
|
||||
BPicture pictureGray;
|
||||
|
||||
if(menu->iconfile == NULL && menu->iconidx >= 0 && normalButtonsBitmap) {
|
||||
if (menu->iconfile == NULL && menu->iconidx >= 0 && normalButtonsBitmap) {
|
||||
GetPictureFromBitmap(&pictureOn, menu->iconidx, normalButtonsBitmap, true);
|
||||
GetPictureFromBitmap(&pictureOff, menu->iconidx, normalButtonsBitmap, false);
|
||||
GetPictureFromBitmap(&pictureGray, menu->iconidx, grayedButtonsBitmap, false);
|
||||
@@ -2870,15 +2870,15 @@ VimToolbar::AddButton(int32 index, vimmenu_T *menu)
|
||||
char_u buffer[MAXPATHL] = {0};
|
||||
BBitmap *bitmap = NULL;
|
||||
|
||||
if(menu->iconfile) {
|
||||
if (menu->iconfile) {
|
||||
gui_find_iconfile(menu->iconfile, buffer, (char*)"png");
|
||||
bitmap = BTranslationUtils::GetBitmap((char*)buffer);
|
||||
}
|
||||
|
||||
if(bitmap == NULL && gui_find_bitmap(menu->name, buffer, (char*)"png") == OK)
|
||||
if (bitmap == NULL && gui_find_bitmap(menu->name, buffer, (char*)"png") == OK)
|
||||
bitmap = BTranslationUtils::GetBitmap((char*)buffer);
|
||||
|
||||
if(bitmap == NULL)
|
||||
if (bitmap == NULL)
|
||||
bitmap = new BBitmap(BRect(0, 0, size, size), B_RGB32);
|
||||
|
||||
GetPictureFromBitmap(&pictureOn, 0, bitmap, true);
|
||||
@@ -2910,8 +2910,8 @@ VimToolbar::AddButton(int32 index, vimmenu_T *menu)
|
||||
bool
|
||||
VimToolbar::RemoveButton(vimmenu_T *menu)
|
||||
{
|
||||
if(menu->button) {
|
||||
if(fButtonsList.RemoveItem(menu->button)) {
|
||||
if (menu->button) {
|
||||
if (fButtonsList.RemoveItem(menu->button)) {
|
||||
delete menu->button;
|
||||
menu->button = NULL;
|
||||
}
|
||||
@@ -2922,9 +2922,9 @@ VimToolbar::RemoveButton(vimmenu_T *menu)
|
||||
bool
|
||||
VimToolbar::GrayButton(vimmenu_T *menu, int grey)
|
||||
{
|
||||
if(menu->button) {
|
||||
if (menu->button) {
|
||||
int32 index = fButtonsList.IndexOf(menu->button);
|
||||
if(index >= 0)
|
||||
if (index >= 0)
|
||||
menu->button->SetEnabled(grey ? false : true);
|
||||
}
|
||||
return true;
|
||||
@@ -2935,9 +2935,9 @@ VimToolbar::InvalidateLayout()
|
||||
{
|
||||
int32 offset = ToolbarMargin;
|
||||
int32 count = fButtonsList.CountItems();
|
||||
for(int32 i = 0; i < count; i++) {
|
||||
for (int32 i = 0; i < count; i++) {
|
||||
BPictureButton *button = (BPictureButton *)fButtonsList.ItemAt(i);
|
||||
if(button) {
|
||||
if (button) {
|
||||
button->MoveTo(offset, ToolbarMargin);
|
||||
offset += button->Bounds().Width() + ToolbarMargin;
|
||||
} else
|
||||
@@ -2960,7 +2960,7 @@ VimTabLine::TablineHeight() const
|
||||
void
|
||||
VimTabLine::MouseDown(BPoint point)
|
||||
{
|
||||
if(!gui_mch_showing_tabline())
|
||||
if (!gui_mch_showing_tabline())
|
||||
return;
|
||||
|
||||
BMessage *m = Window()->CurrentMessage();
|
||||
@@ -2974,7 +2974,7 @@ VimTabLine::MouseDown(BPoint point)
|
||||
|
||||
int index = 0; // 0 means here - no tab found
|
||||
for (int i = 0; i < CountTabs(); i++) {
|
||||
if(TabFrame(i).Contains(point)) {
|
||||
if (TabFrame(i).Contains(point)) {
|
||||
index = i + 1; // indexes are 1-based
|
||||
break;
|
||||
}
|
||||
@@ -3027,15 +3027,15 @@ VimTabLine::VimTab::Select(BView* owner)
|
||||
BTab::Select(owner);
|
||||
|
||||
VimTabLine *tabLine = gui.vimForm->TabLine();
|
||||
if(tabLine != NULL) {
|
||||
if (tabLine != NULL) {
|
||||
|
||||
int32 i = 0;
|
||||
for (; i < tabLine->CountTabs(); i++)
|
||||
if(this == tabLine->TabAt(i))
|
||||
if (this == tabLine->TabAt(i))
|
||||
break;
|
||||
|
||||
// printf("%d:%d:%s\n", i, tabLine->CountTabs(), tabLine->TabAt(i)->Label());
|
||||
if(i < tabLine->CountTabs()) {
|
||||
if (i < tabLine->CountTabs()) {
|
||||
VimTablineMsg tm;
|
||||
tm.index = i + 1;
|
||||
write_port(gui.vdcmp, VimMsg::Tabline, &tm, sizeof(tm));
|
||||
@@ -3566,7 +3566,7 @@ gui_mch_set_text_area_pos(
|
||||
gui.vimTextArea->ResizeTo(w - PEN_WIDTH, h - PEN_WIDTH);
|
||||
|
||||
#ifdef FEAT_GUI_TABLINE
|
||||
if(gui.vimForm->TabLine() != NULL) {
|
||||
if (gui.vimForm->TabLine() != NULL) {
|
||||
gui.vimForm->TabLine()->ResizeTo(w, gui.vimForm->TablineHeight());
|
||||
}
|
||||
#endif // FEAT_GUI_TABLINE
|
||||
@@ -3658,7 +3658,7 @@ gui_mch_set_scrollbar_pos(
|
||||
float vsbx = x, vsby = y;
|
||||
VimScrollBar *vsb = sb->id;
|
||||
vsb->ResizeTo(w - PEN_WIDTH, h - PEN_WIDTH);
|
||||
if(winb.right-(x+w)<w) vsbx = winb.right - (w - PEN_WIDTH);
|
||||
if (winb.right-(x+w)<w) vsbx = winb.right - (w - PEN_WIDTH);
|
||||
vsb->MoveTo(vsbx, vsby);
|
||||
gui.vimWindow->Unlock();
|
||||
}
|
||||
@@ -3829,7 +3829,7 @@ gui_mch_get_font(
|
||||
float size = 0.f;
|
||||
|
||||
if (name == 0 && be_fixed_font == 0) {
|
||||
if(giveErrorIfMissing)
|
||||
if (giveErrorIfMissing)
|
||||
semsg(_(e_font), name);
|
||||
return NOFONT;
|
||||
}
|
||||
@@ -3864,7 +3864,7 @@ gui_mch_get_font(
|
||||
size = atof((style_s != 0) ? strtok(0, "/\0") : "0");
|
||||
|
||||
if (useSelectGUI) {
|
||||
if(gui_mch_font_dialog(&family, &style, &size) == NOFONT)
|
||||
if (gui_mch_font_dialog(&family, &style, &size) == NOFONT)
|
||||
return FAIL;
|
||||
// compose for further processing
|
||||
vim_snprintf(font_name, buff_size,
|
||||
@@ -3895,7 +3895,7 @@ gui_mch_get_font(
|
||||
VimFont *font = new VimFont();
|
||||
font->name = vim_strsave((char_u*)font_name);
|
||||
|
||||
if(count_font_styles(family) <= 0) {
|
||||
if (count_font_styles(family) <= 0) {
|
||||
if (giveErrorIfMissing)
|
||||
semsg(_(e_font), font->name);
|
||||
delete font;
|
||||
@@ -3907,7 +3907,7 @@ gui_mch_get_font(
|
||||
fontList = font;
|
||||
|
||||
font->SetFamilyAndStyle(family, style);
|
||||
if(size > 0.f)
|
||||
if (size > 0.f)
|
||||
font->SetSize(size);
|
||||
|
||||
font->SetSpacing(B_FIXED_SPACING);
|
||||
@@ -3944,7 +3944,7 @@ void
|
||||
gui_mch_free_font(
|
||||
GuiFont font)
|
||||
{
|
||||
if(font == NOFONT)
|
||||
if (font == NOFONT)
|
||||
return;
|
||||
VimFont *f = (VimFont *)font;
|
||||
if (--f->refcount <= 0) {
|
||||
@@ -4401,7 +4401,7 @@ gui_mch_draw_hollow_cursor(guicolor_T color)
|
||||
r.left = FILL_X(gui.col);
|
||||
r.top = FILL_Y(gui.row);
|
||||
int cells = utf_off2cells(LineOffset[gui.row] + gui.col, 100); // TODO-TODO
|
||||
if(cells>=4) cells = 1;
|
||||
if (cells>=4) cells = 1;
|
||||
r.right = r.left + cells*gui.char_width - PEN_WIDTH;
|
||||
r.bottom = r.top + gui.char_height - PEN_WIDTH;
|
||||
|
||||
@@ -4711,9 +4711,9 @@ gui_mch_add_menu_item(
|
||||
if (gui.vimWindow->Lock())
|
||||
{
|
||||
#ifdef FEAT_TOOLBAR
|
||||
if(menu_is_toolbar(parent->name)) {
|
||||
if (menu_is_toolbar(parent->name)) {
|
||||
VimToolbar *toolbar = gui.vimForm->ToolBar();
|
||||
if(toolbar != NULL) {
|
||||
if (toolbar != NULL) {
|
||||
toolbar->AddButton(idx, menu);
|
||||
}
|
||||
} else
|
||||
@@ -4750,9 +4750,9 @@ gui_mch_destroy_menu(
|
||||
if (gui.vimWindow->Lock())
|
||||
{
|
||||
#ifdef FEAT_TOOLBAR
|
||||
if(menu->parent && menu_is_toolbar(menu->parent->name)) {
|
||||
if (menu->parent && menu_is_toolbar(menu->parent->name)) {
|
||||
VimToolbar *toolbar = gui.vimForm->ToolBar();
|
||||
if(toolbar != NULL) {
|
||||
if (toolbar != NULL) {
|
||||
toolbar->RemoveButton(menu);
|
||||
}
|
||||
} else
|
||||
@@ -4798,10 +4798,10 @@ gui_mch_menu_grey(
|
||||
int grey)
|
||||
{
|
||||
#ifdef FEAT_TOOLBAR
|
||||
if(menu->parent && menu_is_toolbar(menu->parent->name)) {
|
||||
if (menu->parent && menu_is_toolbar(menu->parent->name)) {
|
||||
if (gui.vimWindow->Lock()) {
|
||||
VimToolbar *toolbar = gui.vimForm->ToolBar();
|
||||
if(toolbar != NULL) {
|
||||
if (toolbar != NULL) {
|
||||
toolbar->GrayButton(menu, grey);
|
||||
}
|
||||
gui.vimWindow->Unlock();
|
||||
@@ -4844,7 +4844,7 @@ gui_mch_show_popupmenu(vimmenu_T *menu)
|
||||
return;
|
||||
|
||||
BPoint point;
|
||||
if(gui.vimWindow->Lock()) {
|
||||
if (gui.vimWindow->Lock()) {
|
||||
uint32 buttons = 0;
|
||||
gui.vimTextArea->GetMouse(&point, &buttons);
|
||||
gui.vimTextArea->ConvertToScreen(&point);
|
||||
@@ -5028,14 +5028,14 @@ gui_mch_browse(
|
||||
|
||||
gui.vimApp->fFilePanelSem = create_sem(0, "FilePanelSem");
|
||||
|
||||
while(acquire_sem(gui.vimApp->fFilePanelSem) == B_INTERRUPTED);
|
||||
while (acquire_sem(gui.vimApp->fFilePanelSem) == B_INTERRUPTED);
|
||||
|
||||
char_u *fileName = NULL;
|
||||
status_t result = gui.vimApp->fBrowsedPath.InitCheck();
|
||||
if(result == B_OK) {
|
||||
if (result == B_OK) {
|
||||
fileName = vim_strsave((char_u*)gui.vimApp->fBrowsedPath.Path());
|
||||
} else
|
||||
if(result != B_NO_INIT) {
|
||||
if (result != B_NO_INIT) {
|
||||
fprintf(stderr, "gui_mch_browse: BPath error: %#08x (%s)\n",
|
||||
result, strerror(result));
|
||||
}
|
||||
@@ -5108,7 +5108,7 @@ gui_mch_setmouse(int x, int y)
|
||||
void
|
||||
im_set_position(int row, int col)
|
||||
{
|
||||
if(gui.vimWindow->Lock())
|
||||
if (gui.vimWindow->Lock())
|
||||
{
|
||||
gui.vimTextArea->DrawIMString();
|
||||
gui.vimWindow->Unlock();
|
||||
@@ -5128,7 +5128,7 @@ gui_mch_show_toolbar(int showit)
|
||||
gui_mch_set_toolbar_pos(int x, int y, int w, int h)
|
||||
{
|
||||
VimToolbar *toolbar = gui.vimForm->ToolBar();
|
||||
if(toolbar != NULL) {
|
||||
if (toolbar != NULL) {
|
||||
if (gui.vimWindow->Lock()) {
|
||||
toolbar->MoveTo(x, y);
|
||||
toolbar->ResizeTo(w - 1, h - 1);
|
||||
@@ -5160,7 +5160,7 @@ gui_mch_show_tabline(int showit)
|
||||
gui_mch_set_tabline_pos(int x, int y, int w, int h)
|
||||
{
|
||||
VimTabLine *tabLine = gui.vimForm->TabLine();
|
||||
if(tabLine != NULL) {
|
||||
if (tabLine != NULL) {
|
||||
if (gui.vimWindow->Lock()) {
|
||||
tabLine->MoveTo(x, y);
|
||||
tabLine->ResizeTo(w - 1, h - 1);
|
||||
@@ -5217,7 +5217,7 @@ gui_mch_update_tabline()
|
||||
while (nr < tabLine->CountTabs())
|
||||
tabLine->RemoveTab(nr);
|
||||
|
||||
if(tabLine->Selection() != curtabidx)
|
||||
if (tabLine->Selection() != curtabidx)
|
||||
tabLine->Select(curtabidx);
|
||||
|
||||
gui.vimWindow->Unlock();
|
||||
@@ -5230,12 +5230,12 @@ gui_mch_update_tabline()
|
||||
gui_mch_set_curtab(int nr)
|
||||
{
|
||||
VimTabLine *tabLine = gui.vimForm->TabLine();
|
||||
if(tabLine == NULL)
|
||||
if (tabLine == NULL)
|
||||
return;
|
||||
|
||||
gui.vimWindow->Lock();
|
||||
|
||||
if(tabLine->Selection() != nr -1)
|
||||
if (tabLine->Selection() != nr -1)
|
||||
tabLine->Select(nr -1);
|
||||
|
||||
gui.vimWindow->Unlock();
|
||||
|
@@ -746,6 +746,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
631,
|
||||
/**/
|
||||
630,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user