Mercurial > vim
comparison src/indent.c @ 20229:06a1dd50463e v8.2.0670
patch 8.2.0670: cannot change window when evaluating 'completefunc'
Commit: https://github.com/vim/vim/commit/6adb9ea0a6ca01414f4b591f379b0f829a8273c0
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Apr 30 22:31:18 2020 +0200
patch 8.2.0670: cannot change window when evaluating 'completefunc'
Problem: Cannot change window when evaluating 'completefunc'.
Solution: Make a difference between not changing text or buffers and also
not changing window.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 30 Apr 2020 22:45:04 +0200 |
parents | a4be2f9cfb01 |
children | 87e85a13e9cf |
comparison
equal
deleted
inserted
replaced
20228:4fb1da5a5031 | 20229:06a1dd50463e |
---|---|
1758 save_curswant = curwin->w_curswant; | 1758 save_curswant = curwin->w_curswant; |
1759 save_set_curswant = curwin->w_set_curswant; | 1759 save_set_curswant = curwin->w_set_curswant; |
1760 set_vim_var_nr(VV_LNUM, curwin->w_cursor.lnum); | 1760 set_vim_var_nr(VV_LNUM, curwin->w_cursor.lnum); |
1761 if (use_sandbox) | 1761 if (use_sandbox) |
1762 ++sandbox; | 1762 ++sandbox; |
1763 ++textlock; | 1763 ++textwinlock; |
1764 | 1764 |
1765 // Need to make a copy, the 'indentexpr' option could be changed while | 1765 // Need to make a copy, the 'indentexpr' option could be changed while |
1766 // evaluating it. | 1766 // evaluating it. |
1767 inde_copy = vim_strsave(curbuf->b_p_inde); | 1767 inde_copy = vim_strsave(curbuf->b_p_inde); |
1768 if (inde_copy != NULL) | 1768 if (inde_copy != NULL) |
1771 vim_free(inde_copy); | 1771 vim_free(inde_copy); |
1772 } | 1772 } |
1773 | 1773 |
1774 if (use_sandbox) | 1774 if (use_sandbox) |
1775 --sandbox; | 1775 --sandbox; |
1776 --textlock; | 1776 --textwinlock; |
1777 | 1777 |
1778 // Restore the cursor position so that 'indentexpr' doesn't need to. | 1778 // Restore the cursor position so that 'indentexpr' doesn't need to. |
1779 // Pretend to be in Insert mode, allow cursor past end of line for "o" | 1779 // Pretend to be in Insert mode, allow cursor past end of line for "o" |
1780 // command. | 1780 // command. |
1781 save_State = State; | 1781 save_State = State; |