Mercurial > vim
comparison src/gui_haiku.cc @ 20277:8a694c9447d7 v8.2.0694
patch 8.2.0694: Haiku: channel and terminal do not work
Commit: https://github.com/vim/vim/commit/80a8d3889bf1341c47f1c88c59825f183b2b4753
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun May 3 22:57:32 2020 +0200
patch 8.2.0694: Haiku: channel and terminal do not work
Problem: Haiku: channel and terminal do not work.
Solution: Close files when the job has finished. (Ozaki Kiichi,
closes #6039)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 03 May 2020 23:00:04 +0200 |
parents | 993d820196b9 |
children | fcccc29bd386 |
comparison
equal
deleted
inserted
replaced
20276:36edcb98d341 | 20277:8a694c9447d7 |
---|---|
1143 // ---------------- VimTextAreaView ---------------- | 1143 // ---------------- VimTextAreaView ---------------- |
1144 | 1144 |
1145 VimTextAreaView::VimTextAreaView(BRect frame): | 1145 VimTextAreaView::VimTextAreaView(BRect frame): |
1146 BView(frame, "VimTextAreaView", B_FOLLOW_ALL_SIDES, | 1146 BView(frame, "VimTextAreaView", B_FOLLOW_ALL_SIDES, |
1147 #ifdef FEAT_MBYTE_IME | 1147 #ifdef FEAT_MBYTE_IME |
1148 B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE | B_INPUT_METHOD_AWARE), | 1148 B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE | B_INPUT_METHOD_AWARE |
1149 #else | 1149 #else |
1150 B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE), | 1150 B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE |
1151 #endif | 1151 #endif |
1152 ), | |
1152 mouseDragEventCount(0) | 1153 mouseDragEventCount(0) |
1153 { | 1154 { |
1154 #ifdef FEAT_MBYTE_IME | 1155 #ifdef FEAT_MBYTE_IME |
1155 IMData.messenger = NULL; | 1156 IMData.messenger = NULL; |
1156 IMData.message = NULL; | 1157 IMData.message = NULL; |
3091 add_to_input_buf(buf, 2); | 3092 add_to_input_buf(buf, 2); |
3092 } | 3093 } |
3093 } | 3094 } |
3094 } | 3095 } |
3095 #else | 3096 #else |
3096 add_to_input_buf_csi(string, len); | 3097 add_to_input_buf_csi(string, len); |
3097 #endif | 3098 #endif |
3098 else | 3099 else |
3099 add_to_input_buf(string, len); | 3100 add_to_input_buf(string, len); |
3100 } | 3101 } |
3101 break; | 3102 break; |
4435 int | 4436 int |
4436 gui_mch_wait_for_chars( | 4437 gui_mch_wait_for_chars( |
4437 int wtime) | 4438 int wtime) |
4438 { | 4439 { |
4439 int focus; | 4440 int focus; |
4440 bigtime_t until, timeout; | 4441 bigtime_t until, timeout; |
4441 status_t st; | 4442 status_t st; |
4442 | 4443 |
4443 if (wtime >= 0) { | 4444 if (wtime >= 0) |
4445 { | |
4444 timeout = wtime * 1000; | 4446 timeout = wtime * 1000; |
4445 until = system_time() + timeout; | 4447 until = system_time() + timeout; |
4446 } else { | 4448 } |
4449 else | |
4447 timeout = B_INFINITE_TIMEOUT; | 4450 timeout = B_INFINITE_TIMEOUT; |
4448 } | |
4449 | 4451 |
4450 focus = gui.in_focus; | 4452 focus = gui.in_focus; |
4451 for (;;) | 4453 for (;;) |
4452 { | 4454 { |
4453 // Stop or start blinking when focus changes | 4455 // Stop or start blinking when focus changes |
4459 gui_mch_stop_blink(TRUE); | 4461 gui_mch_stop_blink(TRUE); |
4460 focus = gui.in_focus; | 4462 focus = gui.in_focus; |
4461 } | 4463 } |
4462 | 4464 |
4463 gui_mch_flush(); | 4465 gui_mch_flush(); |
4466 | |
4467 #ifdef MESSAGE_QUEUE | |
4468 # ifdef FEAT_TIMERS | |
4469 did_add_timer = FALSE; | |
4470 # endif | |
4471 parse_queued_messages(); | |
4472 # ifdef FEAT_TIMERS | |
4473 if (did_add_timer) | |
4474 // Need to recompute the waiting time. | |
4475 break; | |
4476 # endif | |
4477 # ifdef FEAT_JOB_CHANNEL | |
4478 if (has_any_channel()) | |
4479 { | |
4480 if (wtime < 0 || timeout > 20000) | |
4481 timeout = 20000; | |
4482 } | |
4483 else if (wtime < 0) | |
4484 timeout = B_INFINITE_TIMEOUT; | |
4485 # endif | |
4486 #endif | |
4487 | |
4464 /* | 4488 /* |
4465 * Don't use gui_mch_update() because then we will spin-lock until a | 4489 * Don't use gui_mch_update() because then we will spin-lock until a |
4466 * char arrives, instead we use gui_haiku_process_event() to hang until | 4490 * char arrives, instead we use gui_haiku_process_event() to hang until |
4467 * an event arrives. No need to check for input_buf_full because we | 4491 * an event arrives. No need to check for input_buf_full because we |
4468 * are returning as soon as it contains a single char. | 4492 * are returning as soon as it contains a single char. |
4476 | 4500 |
4477 /* | 4501 /* |
4478 * Calculate how much longer we're willing to wait for the | 4502 * Calculate how much longer we're willing to wait for the |
4479 * next event. | 4503 * next event. |
4480 */ | 4504 */ |
4481 if (wtime >= 0) { | 4505 if (wtime >= 0) |
4506 { | |
4482 timeout = until - system_time(); | 4507 timeout = until - system_time(); |
4483 if (timeout < 0) | 4508 if (timeout < 0) |
4484 break; | 4509 break; |
4485 } | 4510 } |
4486 } | 4511 } |