mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	vim-patch:9.0.1183: code is indented more than necessary (#21773)
Problem:    Code is indented more than necessary.
Solution:   Use an early return where it makes sense. (Yegappan Lakshmanan,
            closes vim/vim#11805)
0233bdfa2b
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
			
			
This commit is contained in:
		| @@ -1396,13 +1396,15 @@ void fixthisline(IndentGetter get_the_indent) | |||||||
| { | { | ||||||
|   int amount = get_the_indent(); |   int amount = get_the_indent(); | ||||||
|  |  | ||||||
|   if (amount >= 0) { |   if (amount < 0) { | ||||||
|  |     return; | ||||||
|  |   } | ||||||
|  |  | ||||||
|   change_indent(INDENT_SET, amount, false, 0, true); |   change_indent(INDENT_SET, amount, false, 0, true); | ||||||
|   if (linewhite(curwin->w_cursor.lnum)) { |   if (linewhite(curwin->w_cursor.lnum)) { | ||||||
|     did_ai = true;  // delete the indent if the line stays empty |     did_ai = true;  // delete the indent if the line stays empty | ||||||
|   } |   } | ||||||
| } | } | ||||||
| } |  | ||||||
|  |  | ||||||
| /// Return true if 'indentexpr' should be used for Lisp indenting. | /// Return true if 'indentexpr' should be used for Lisp indenting. | ||||||
| /// Caller may want to check 'autoindent'. | /// Caller may want to check 'autoindent'. | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 zeertzjq
					zeertzjq