bugGNU nano - Bugs: bug #61361, Rust code wrongly colored as being...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #61361: Rust code wrongly colored as being within a string

Submitted by:  Elias Jonsson <eliasjonsson>
Submitted on:  Thu 21 Oct 2021 04:23:35 AM UTC  
 
Severity:  3 - Normal Status:  Fixed
Assigned to:  Benno Schulenberg <bens> Open/Closed:  Open

Fri 22 Oct 2021 08:49:10 AM UTC, comment #4: 

Thanks for verifying.

Fixed in git, commit d57bfc05, by excluding an unescaped double quote from the contents of a string.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Thu 21 Oct 2021 05:32:26 PM UTC, comment #3: 

comment #2:

> Attached is a patch that should fix the observed problem.  When you can, please try it out.
>
> (file #52140)


I can confirm that the behavior now is as expected. It works. Thank you!

Elias Jonsson <eliasjonsson>
Thu 21 Oct 2021 09:38:53 AM UTC, comment #2: 

Attached is a patch that should fix the observed problem.  When you can, please try it out.

(file #52140)

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Thu 21 Oct 2021 09:26:12 AM UTC, comment #1: 

Hello, Elias.  Thanks for reporting.

(Recasting your report into words.)

To reproduce, run:

echo '"first string" something between "second string"' >text.rs
src/nano --rcfile=syntax/rust.nanorc text.rs

See that the 'something between' is colored as if it were part of a string.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Thu 21 Oct 2021 04:23:35 AM UTC, original submission:  

See attached screenshots for explanation.

Work around:
A line break helps nano understand that code does not reside within a quote.

Elias Jonsson <eliasjonsson>

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (Posted a comment)
  • -email is unavailable- added by eliasjonsson (Submitted the item)
  • -email is unavailable- added by eliasjonsson
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-10-22 bens StatusReady For Test => Fixed
        SummaryRust code wrongly interpreted as being within a quote => Rust code wrongly colored as being within a string
    2021-10-21 bens Attached File- => Added 0001-syntax-rust-do-not-colorize-the-text-between-two-str.patch, #52140
        StatusIn Progress => Ready For Test
    2021-10-21 bens StatusNone => In Progress
        Assigned toNone => bens
    2021-10-21 eliasjonsson Attached File- => Added Screenshot_20211021_061035.png, #52137
        Attached File- => Added Screenshot_20211021_061201.png, #52138
        Attached File- => Added Screenshot_20211021_061105.png, #52139
        Carbon-Copy- => Added -email is unavailable-

    Back to the top


    Powered by Savane 3.7