Menu

#2 Corrupted Wrap Selection results

1.0
open
nobody
None
2020-05-07
2020-05-07
David
No

Corrupted comments when existing multiple comments explicitly wrapped using Wrap Selection. Using 1.0.0.4.

[Settings]
ContinueComments=0
EnableAutoWrap=1
WrapAtColumn=55

Sample selected existing comments:

// we don't want to set focus or tip on any more elements after the first during form submit validation, so we set validting=true to bypass those routines on the next call. remember, this routine is called in a loop during form submit only, not instantly when input is entered / updated. 
    //so how does validiting get set to false again when this is all done? because focus is set on the first invalid input, and when focus is lost (onblur) blt.require is called, which sets validting=false then calls this routine to ensure input is valid, then follows the call with validating=false again.
    // conversely, if everything is valid then the variable remains true, but we don't care because we're moving to the next page now.

Result:

// we don't want to set focus or tip on any more
    //selements after the first during form submit <-- corrupted text "selements"
    //validation, so we set validting=true to bypass
    //those routines on the next call. remember, this
    //routine is called in a loop during form submit
    //only, not instantly when input is entered /
    //updated. o how does validiting get set to false <-- corrupted text "updated. o how"
    //again when this is all done? because focus is set
    //on the first invalid input, and when focus is
    //lost (onblur) blt.require is called, which sets
    //validting=false then calls this routine to ensure
    //input is valid, then follows the call with
    //validating=false again.  conversely, if
    //everything is valid then the variable remains
    //true, but we don't care because we're moving to
    //the next page now.

It appears that the "s" from the original second comment "so how do we..." is getting cut and prepended to the generated second comment. Notice that "elements after the first..." becomes "selements after the first..." after wrapping, and "so how does validating..." becomes "o how does validating..."

Discussion

  • Kered13

    Kered13 - 2020-05-07

    This is happening because the first line has the prefix "// " (note the space). Therefore when wrapping the second line the first three characters ("//s") are ignored and the rest is wrapped. Line prefixes are recalculated every line, which is why the rest of the comment has the two character prefix "//" after wrapping.

    I'll have to think about what the best way to fix this is.

     
  • David

    David - 2020-05-07

    Don't sweat it. Just though I'd let you know. Thanks!

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.