(&mut self)
| 268 | } |
| 269 | |
| 270 | pub(crate) fn decrease_current_line_indentation(&mut self) { |
| 271 | if self.is_current_line_empty() { |
| 272 | return; |
| 273 | } |
| 274 | |
| 275 | if self.lines[self.cursor.row][0].character != ' ' { |
| 276 | return; |
| 277 | } |
| 278 | |
| 279 | let mut indent_width = self.settings.tab_width; |
| 280 | if self.lines[self.cursor.row].len() < self.settings.tab_width { |
| 281 | indent_width = self.lines[self.cursor.row].len(); |
| 282 | } |
| 283 | |
| 284 | for _ in 0..indent_width { |
| 285 | if self.lines[self.cursor.row][0].character == ' ' { |
| 286 | if !self.is_cursor_at_line_start() { |
| 287 | self.move_cursor_left(); |
| 288 | } |
| 289 | self.lines[self.cursor.row].remove(0); |
| 290 | } else { |
| 291 | break; |
| 292 | } |
| 293 | } |
| 294 | } |
| 295 | |
| 296 | |
| 297 |
no test coverage detected