Ticket #1496 (closed defect: fixed)

Opened 10 years ago

Last modified 10 years ago

Search backwards is broken

Reported by: dborca Owned by: angel_il
Priority: major Milestone: 4.7.0-pre2
Component: mcedit Version: 4.7.0-pre1
Keywords: Cc:
Blocked By: Blocking:
Branch state: Votes for changeset: committed-master

Description

It is.

Attachments

mc-4.7.0-pre1.search_backwards.patch (2.0 KB) - added by dborca 10 years ago.

Change History

Changed 10 years ago by dborca

comment:1 follow-up: ↓ 3 Changed 10 years ago by angel_il

Search backwards is broken

realy?

comment:2 Changed 10 years ago by angel_il

how can i reproduce this?

comment:3 in reply to: ↑ 1 ; follow-up: ↓ 4 Changed 10 years ago by dborca

Replying to angel_il:

Search backwards is broken

realy?

Yes, realy!

comment:4 in reply to: ↑ 3 Changed 10 years ago by angel_il

Replying to dborca:

Replying to angel_il:

Search backwards is broken

realy?

Yes, realy!

Thanks for the good answer :)

comment:5 Changed 10 years ago by angel_il

branch: 1496_search_backwards_broken (parent: master)
changeset: 85901dd9c9173f632381a68224d9c5495e8eb207

comment:6 Changed 10 years ago by dborca

Replying to angel_il:

how can i reproduce this?

Have a file containing the following text: "broken is broken"

  1. Position cursor at the second "broken" (column 10). Now search backwards for "broken". It will find the word beneath cursor. If memory serves me, the text under cursor should not be considered backwards.
  1. To make things worse, position cursor at column 9. Now search backwards for "broken". It will find the word at column 10. That is definitely NOT backwards.
  1. If that's not enough, position cursor at column 8. Alas, what foul magic is this? It will still find the word at column 10. Backwards, you say?

Partially responsible for this is signed/unsigned mismatch in the following test:
if (search_end - search_start > edit->search->original_len && ...)
which I changed to
if (search_end > search_start + edit->search->original_len && ...)

I also had to add another test (you can see in the patch)
edit->search->normal_offset == search_start
but I REALLY can't remember why. Maybe to have consistent results between normal, regex?

comment:7 follow-up: ↓ 8 Changed 10 years ago by angel_il

It will find the word beneath cursor. If memory serves me, the text under cursor should not be considered backwards.

It will find the word at column 10

i see... you right, it's bug.

Backwards, you say?

i say? :) no, this SlavaZ's code :)

comment:8 in reply to: ↑ 7 Changed 10 years ago by dborca

Replying to angel_il:

It will find the word beneath cursor. If memory serves me, the text under cursor should not be considered backwards.

It will find the word at column 10

i see... you right, it's bug.

Backwards, you say?

i say? :) no, this SlavaZ's code :)

;)

comment:9 follow-up: ↓ 10 Changed 10 years ago by angel_il

signed/unsigned mismatch

of course, you right... but i think need new ticket for this

if (search_end - search_start > edit->search->original_len && ...) 

bureaucracy :)

comment:10 in reply to: ↑ 9 ; follow-up: ↓ 12 Changed 10 years ago by dborca

Replying to angel_il:

signed/unsigned mismatch

of course, you right... but i think need new ticket for this

if (search_end - search_start > edit->search->original_len && ...) 

bureaucracy :)

Oh my god, you must be kidding me :))

comment:11 Changed 10 years ago by slavazanko

i say? :) no, this SlavaZ's code :)

Why are you talking about 'Slavaz'? I have an alibi: I'm don't remebmer, that this my code. ;)

Well, stop spam, please. Funny, but need fix this bug. Remember about :)

comment:12 in reply to: ↑ 10 Changed 10 years ago by angel_il

Replying to dborca:

Replying to angel_il:

signed/unsigned mismatch

of course, you right... but i think need new ticket for this

if (search_end - search_start > edit->search->original_len && ...) 

bureaucracy :)

Oh my god, you must be kidding me :))

i'm so sorry :) but #1499

comment:13 Changed 10 years ago by angel_il

branch: 1496_search_backwards_broken (forced update)
changeset: e9d186ea1a59b1b564bbd02e50fb9ed0bc9a20ec

fix for mcview in #1499

comment:14 Changed 10 years ago by angel_il

  • Votes for changeset set to angel_il
  • severity changed from no branch to on review

comment:15 Changed 10 years ago by angel_il

  • Status changed from new to accepted
  • Owner set to angel_il

comment:16 Changed 10 years ago by iNode

  • Votes for changeset changed from angel_il to angel_il iNode
  • severity changed from on review to approved

comment:17 Changed 10 years ago by slavazanko

  • Status changed from accepted to testing
  • Votes for changeset changed from angel_il iNode to commited-master
  • Resolution set to fixed
  • severity changed from approved to merged

comment:18 Changed 10 years ago by slavazanko

  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.