New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
undoを実行したときのメッセージが表示されない場合がある #466
Comments
iOS版Vim(7.3.315)でも再現しました。 |
直感的にはなんかやってそうね。 |
という流れのようです。 |
foldmethod が manual 以外だとメッセージ表示されますね。 undo後は常に画面全体を再描画させれば良いとすると、以下の変更でどうでしょうか。 diff --git a/src/undo.c b/src/undo.c
--- a/src/undo.c
+++ b/src/undo.c
@@ -2723,7 +2723,7 @@
FOR_ALL_WINDOWS(wp)
{
- if (wp->w_buffer == curbuf && wp->w_p_cole > 0)
+ if (wp->w_buffer == curbuf)
redraw_win_later(wp, NOT_VALID);
}
} |
とても良さそうな感じですが、 diff --git a/src/undo.c b/src/undo.c
--- a/src/undo.c
+++ b/src/undo.c
@@ -2728,6 +2728,7 @@
}
}
#endif
+ redraw_later(NOT_VALID);
smsg((char_u *)_("%ld %s; %s #%ld %s"),
u_oldcount < 0 ? -u_oldcount : u_oldcount, |
|
よく分からないので、投げてしまいました。問題があれば、Bram氏が直してくれることでしょう。 @ichizok さんの名前を出しておくべきだったかなあ? |
redraw_later() でメッセージ部分だけ再描画の指定ができるようになっていると、一番良さそうな気がしますが… |
Bram氏からの回答:
ダメ出しされました。 |
おつかれさまです。 いちおう気づいたので
|
あと redo も同じですね |
すこし試した感じそれで直りそうですね。 |
GJ! |
メモ clear_cmdline が TRUE になって
コマンドラインがクリアされる
ここで分岐
|
あなるほどそれでNOT_VALIDか |
すいませんマクロかなんかで複数のコマンドを実行したときにまずかったみたいです。
|
うっ、何かいい案あります? |
メッセージを適当なタイミングで消すのがうまくいってないので |
フラグは msg_didout があるっぽいです けっきょく NOT_VALID が安定なんですかねえ |
todo入りしましたが、"Doesn't work properly" なのでどうしたものか…
|
元の |
コメントの意味を考えるとこれではBram氏の意図とは違う動作になるのかという気も… diff -r e91143b9ad7a src/screen.c
--- a/src/screen.c Wed Feb 05 22:46:52 2014 +0100
+++ b/src/screen.c Fri Feb 07 22:27:43 2014 +0900
@@ -9086,7 +9086,7 @@
* when scrolling, the message on the command line should be cleared,
* otherwise it will stay there forever.
*/
- clear_cmdline = TRUE;
+ clear_cmdline = FALSE;
/*
* If the terminal can set a scroll region, use that. |
それもありますが、 |
ではこんな感じで… diff -r e91143b9ad7a src/screen.c
--- a/src/screen.c Wed Feb 05 22:46:52 2014 +0100
+++ b/src/screen.c Mon Feb 10 01:51:44 2014 +0900
@@ -8497,21 +8497,11 @@
LineWraps[i] = FALSE;
}
- if (can_clear(T_CL))
- {
- out_str(T_CL); /* clear the display */
- clear_cmdline = FALSE;
- mode_displayed = FALSE;
- }
- else
- {
- /* can't clear the screen, mark all chars with invalid attributes */
- for (i = 0; i < Rows; ++i)
- lineinvalid(LineOffset[i], (int)Columns);
- clear_cmdline = TRUE;
- }
-
- screen_cleared = TRUE; /* can use contents of ScreenLines now */
+ for (i = 0; i < cmdline_row; ++i)
+ lineinvalid(LineOffset[i], (int)Columns);
+ clear_cmdline = TRUE;
+
+ screen_cleared = FALSE;
win_rest_invalid(firstwin);
redraw_cmdline = TRUE;
@@ -9086,7 +9076,7 @@
* when scrolling, the message on the command line should be cleared,
* otherwise it will stay there forever.
*/
- clear_cmdline = TRUE;
+ clear_cmdline = FALSE;
/*
* If the terminal can set a scroll region, use that. |
上記パッチは失敗しています。 |
特殊処理で失敗してるパターンかな… diff -r e91143b9ad7a src/screen.c
--- a/src/screen.c Wed Feb 05 22:46:52 2014 +0100
+++ b/src/screen.c Mon Feb 10 16:57:40 2014 +0900
@@ -1470,33 +1470,10 @@
}
}
- /* When starting redraw in the first line, redraw all lines. When
- * there is only one window it's probably faster to clear the screen
- * first. */
if (mid_start == 0)
{
mid_end = wp->w_height;
- if (lastwin == firstwin)
- {
- /* Clear the screen when it was not done by win_del_lines() or
- * win_ins_lines() above, "screen_cleared" is FALSE or MAYBE
- * then. */
- if (screen_cleared != TRUE)
- screenclear();
-#ifdef FEAT_WINDOWS
- /* The screen was cleared, redraw the tab pages line. */
- if (redraw_tabline)
- draw_tabline();
-#endif
- }
- }
-
- /* When win_del_lines() or win_ins_lines() caused the screen to be
- * cleared (only happens for the first window) or when screenclear()
- * was called directly above, "must_redraw" will have been set to
- * NOT_VALID, need to reset it here to avoid redrawing twice. */
- if (screen_cleared == TRUE)
- must_redraw = 0;
+ }
}
else
{
@@ -9086,7 +9063,7 @@
* when scrolling, the message on the command line should be cleared,
* otherwise it will stay there forever.
*/
- clear_cmdline = TRUE;
+ clear_cmdline = FALSE;
/*
* If the terminal can set a scroll region, use that. |
Bramしだいですけど、メッセージがずっと残るのは厳しい気がします。わかりませんが。 |
多少核心には近くなったんですが、パッチ後半の clear_cmdline = TRUE は根本的解決ではないのでさらに追及します。 |
私はVimを使いこんでいないので(単にPCの前にあまりいない)、いつメッセージが消えるのが望ましいか、また残すべきタイミングを把握できていない、という問題を持っていることに気づかされました。もうしばらく使い込んでみて、きっちり把握できたら再挑戦します。 |
Related: vim/vim#1635 |
undoを実行すると、
1 行 削除しました; 前方 #16 1 秒経過しています
というようなメッセージがコマンドライン領域に表示されるはずですが、表示されない場合があります。
7.3.429 (Linux), 7.4.016 (Windows) にて確認しました。
vim -N -u NONE -U NONE
ifoo<CR><Esc>
などで適当に1行入力。.
で 25回以上(=画面の行数以上)繰り返し。gg
で1行目に移動し、u
で undo。ggu
を繰り返し。画面の最下行より後にファイルが続いている間は、undoのメッセージが出ません。
行数が少なくなり、画面内にファイルの末尾が収まるようになると、メッセージが出るようになります。バグでしょうか。
The text was updated successfully, but these errors were encountered: