vicoapp / vico

Mac Programmers Text Editor
http://www.vicoapp.com/
657 stars 89 forks source link

"%s/\n/sometext/g" does not work well #42

Closed moistrot closed 11 years ago

moistrot commented 11 years ago

I found replace "\n" to some text does not work.

Shadowfiend commented 11 years ago

What behavior do you see instead?

godDLL commented 11 years ago

@moistrot can you please give us an example of your text that doesn't work well with global replace?

Shadowfiend commented 11 years ago

I'll be closing this issue if additional details aren't added in the next week or two, just a heads up :)

moistrot commented 11 years ago

sorry so late.

any text has "\n" like this:

abcd efgh

if we exec "%s/\n/,/g" ,then result "abcd,efgh",but it's not. nothing happend.

you can try it.

Shadowfiend commented 11 years ago

Got it, thanks!

Shadowfiend commented 11 years ago

Yep, looks like we're doing the find/replace linewise rather than on the whole text. Looking into this some more to see if there's a relatively straightforward way to expand that to go more than linewise.

moistrot commented 11 years ago

%s/^/,/g worked well.

Shadowfiend commented 11 years ago

Yeah, but this is a broader issue with how \n interacts with :s handling in Vico. It means you can't really do multiline find/replace, which is suboptimal. I think I'm nearing a fix.

Shadowfiend commented 11 years ago

@moistrot See if using the branch in PR #45 takes care of this for you :)

moistrot commented 11 years ago

@Shadowfiend thx!!

Shadowfiend commented 11 years ago

Whoops, I merged the multiline :s fixes into master a little over a week ago. This should be fixed on master!