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

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

Jump to the original submission

Thu 23 Dec 2021 09:05:22 AM UTC, comment #6: 

comment #5:

> Released in nano-6.0.  Thanks again for reporting.


Thanks for fixing the bug and then letting me know what version the fix will be released in. Much appreciated!

Elias Jonsson <eliasjonsson>
Thu 16 Dec 2021 10:01:49 AM UTC, comment #5: 

Released in nano-6.0.  Thanks again for reporting.

Benno Schulenberg <bens>
Group administrator
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>
Group administrator
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>
Group administrator
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>
Group administrator
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>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

 

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
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 11 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-12-16 bens Open/ClosedOpen Closed
    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.13-d3ae.
    Corresponding source code