From 902698788081d3e28422ee287d7f55e69372adca Mon Sep 17 00:00:00 2001 From: Assistant Date: Tue, 8 Nov 2022 15:10:21 -0400 Subject: [PATCH] fix: use correct python identation (#1666) * Fix python identation bug caused by #1411 * Added entry to CHANGELOG.md * Update python indentation to pep8 and fix comment * Updated CHANGELOG.md to match --- CHANGELOG.md | 1 + lapce-core/src/language.rs | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 576977d2..5973621a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ ### Bug Fixes - [#1588](https://github.com/lapce/lapce/issues/1588): Fixed an issue where new windows would never be created after closing all windows on macOS. +- [#1637](https://github.com/lapce/lapce/issues/1637): Fix python using 7 spaces instead of 4 spaces to indent ## 0.2.2 diff --git a/lapce-core/src/language.rs b/lapce-core/src/language.rs index 60912b69..f58f5a11 100644 --- a/lapce-core/src/language.rs +++ b/lapce-core/src/language.rs @@ -84,7 +84,7 @@ struct SyntaxProperties { injection: Option<&'static str>, /// The comment token. "#" for python, "//" for rust for example. comment: &'static str, - /// The indent unit. "\t" for python, " " for rust, for example. + /// The indent unit. " " for javascript, " " for rust, for example. indent: &'static str, /// TODO: someone more knowledgeable please describe what the two lists are. /// Anyway, the second element of the tuple is a "ignore list". See @@ -626,7 +626,7 @@ pub enum LapceLanguage { highlight: tree_sitter_python::HIGHLIGHT_QUERY, injection: None, comment: "#", - indent: " ", + indent: " ", code_lens: ( &[ "source_file", @@ -676,7 +676,6 @@ pub enum LapceLanguage { indent: " ", code_lens: (DEFAULT_CODE_LENS_LIST, DEFAULT_CODE_LENS_IGNORE_LIST), sticky_headers: &["module", "class", "method", "do_block"], - extensions: &["rb"], }, #[cfg(feature = "lang-rust")]