Mercurial > vim
comparison src/ops.c @ 28856:948877671c54 v8.2.4951
patch 8.2.4951: smart indenting done when not enabled
Commit: https://github.com/vim/vim/commit/de5cf287812510d2c8ffe66b99cf33c4e1a6e6f1
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat May 14 11:52:23 2022 +0100
patch 8.2.4951: smart indenting done when not enabled
Problem: Smart indenting done when not enabled.
Solution: Check option values before setting can_si. (closes https://github.com/vim/vim/issues/10420)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 14 May 2022 13:00:05 +0200 |
parents | 647d7f439622 |
children | 6a4edacbd178 |
comparison
equal
deleted
inserted
replaced
28855:39fddf7b52c1 | 28856:948877671c54 |
---|---|
1716 l = oap->start.col; | 1716 l = oap->start.col; |
1717 if (oap->motion_type == MLINE) | 1717 if (oap->motion_type == MLINE) |
1718 { | 1718 { |
1719 l = 0; | 1719 l = 0; |
1720 #ifdef FEAT_SMARTINDENT | 1720 #ifdef FEAT_SMARTINDENT |
1721 if (!p_paste && curbuf->b_p_si | 1721 can_si = may_do_si(); // Like opening a new line, do smart indent |
1722 # ifdef FEAT_CINDENT | |
1723 && !curbuf->b_p_cin | |
1724 # endif | |
1725 ) | |
1726 can_si = TRUE; // It's like opening a new line, do si | |
1727 #endif | 1722 #endif |
1728 } | 1723 } |
1729 | 1724 |
1730 // First delete the text in the region. In an empty buffer only need to | 1725 // First delete the text in the region. In an empty buffer only need to |
1731 // save for undo | 1726 // save for undo |