Mercurial > vim
comparison src/gui.c @ 2282:a888ed7ba375 vim73
Make updating text for conceal mode simpler. A few compiler warning fixes.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Fri, 02 Jul 2010 20:20:09 +0200 |
parents | f42e0b5ff9e9 |
children | ccda151dde4e |
comparison
equal
deleted
inserted
replaced
2281:e41433ea71df | 2282:a888ed7ba375 |
---|---|
4906 * Update the current window and the screen. | 4906 * Update the current window and the screen. |
4907 */ | 4907 */ |
4908 void | 4908 void |
4909 gui_update_screen() | 4909 gui_update_screen() |
4910 { | 4910 { |
4911 #ifdef FEAT_CONCEAL | |
4912 linenr_T conceal_old_cursor_line = 0; | |
4913 linenr_T conceal_new_cursor_line = 0; | |
4914 int conceal_update_lines = FALSE; | |
4915 #endif | |
4916 | |
4911 update_topline(); | 4917 update_topline(); |
4912 validate_cursor(); | 4918 validate_cursor(); |
4913 #ifdef FEAT_AUTOCMD | 4919 |
4920 #if defined(FEAT_AUTOCMD) || defined(FEAT_CONCEAL) | |
4914 /* Trigger CursorMoved if the cursor moved. */ | 4921 /* Trigger CursorMoved if the cursor moved. */ |
4915 if (!finish_op && has_cursormoved() | 4922 if (!finish_op && ( |
4916 && !equalpos(last_cursormoved, curwin->w_cursor)) | 4923 # ifdef FEAT_AUTOCMD |
4917 { | 4924 has_cursormoved() |
4918 apply_autocmds(EVENT_CURSORMOVED, NULL, NULL, FALSE, curbuf); | 4925 # endif |
4926 # if defined(FEAT_AUTOCMD) && defined(FEAT_CONCEAL) | |
4927 || | |
4928 # endif | |
4929 # ifdef FEAT_CONCEAL | |
4930 curwin->w_p_conceal | |
4931 # endif | |
4932 ) | |
4933 && !equalpos(last_cursormoved, curwin->w_cursor)) | |
4934 { | |
4935 # ifdef FEAT_AUTOCMD | |
4936 if (has_cursormoved()) | |
4937 apply_autocmds(EVENT_CURSORMOVED, NULL, NULL, FALSE, curbuf); | |
4938 # endif | |
4939 # ifdef FEAT_CONCEAL | |
4940 if (curwin->w_p_conceal) | |
4941 { | |
4942 conceal_old_cursor_line = last_cursormoved.lnum; | |
4943 conceal_new_cursor_line = curwin->w_cursor.lnum; | |
4944 conceal_update_lines = TRUE; | |
4945 } | |
4946 # endif | |
4919 last_cursormoved = curwin->w_cursor; | 4947 last_cursormoved = curwin->w_cursor; |
4920 } | 4948 } |
4921 #endif | 4949 #endif |
4950 | |
4922 update_screen(0); /* may need to update the screen */ | 4951 update_screen(0); /* may need to update the screen */ |
4923 setcursor(); | 4952 setcursor(); |
4953 # if defined(FEAT_CONCEAL) | |
4954 if (conceal_update_lines | |
4955 && conceal_old_cursor_line != conceal_new_cursor_line) | |
4956 { | |
4957 update_single_line(curwin, conceal_old_cursor_line); | |
4958 update_single_line(curwin, conceal_new_cursor_line); | |
4959 curwin->w_valid &= ~VALID_CROW; | |
4960 } | |
4961 # endif | |
4924 out_flush(); /* make sure output has been written */ | 4962 out_flush(); /* make sure output has been written */ |
4925 gui_update_cursor(TRUE, FALSE); | 4963 gui_update_cursor(TRUE, FALSE); |
4926 gui_mch_flush(); | 4964 gui_mch_flush(); |
4927 } | 4965 } |
4928 #endif | 4966 #endif |