Closed nksingh62 closed 9 years ago
Thanks for reporting this issue. I cannot reproduce the problem here. What version of editR are you using?
I am using 0.1.2 version of editR on windows 7 (along with Java version 7, update 71 and Firefox version 34.0.5).
Ok. There has been some changes since then. Can you try the last version currently available?
Here is the code to install it (some dependencies have changed since v1.2):
install.packages(c("shiny", "shinyFiles", "rmarkdown"))
if (!require("devtools")) install.packages("devtools")
devtools::install_github("trestletech/shinyAce")
devtools::install_github("ebailey78/shinyBS")
devtools::install_github("swarm-lab/editR")
library(editR)
Thanks! Results in files saved with editR are displaying reactively in v1.4 but it still inserting extra blank lines in document.
Where are these extra blank lines added? I can't reproduce it here. Can you also tell me what OS you use? It might be a platform specific problem.
Additional blank lines are inserted after existing new line char in .Rmd file. I am using windows 7 as OS.
Ok, this is really confusing. Can you post an example that shows this problem?
I can try it on my machine later today, but off the top of my head it could be due to behavior of windows newline creation.
@sjmgarnier I looked briefly through the code (nice!), it looks like you are overwriting the md file using cat
- correct? This could be a bug in the way cat
--> readChar
--> cat
--> etc. behave on windows.
@dpastoor This is a good point. Yes, I use cat to overwrite the file when saving it. I don't have a windows machine available so I never got to try the code on windows. I can install a virtual windows machine on my computer later this week.
Oh, and thanks for finding my code "nice!" ;-)
I can also give it a try - my work comp is a windows computer @nksingh62 is it possible for you to make a small reproducible example? Eg if I use the default markdown template will it add those line additions?
@dpastoor It'd be great if you can give it a try. I'm in the process of moving my lab to new facilities and I won't have much time until next week to install a windows virtual machine and find the root of this problem.
I am attaching two files temp3.md q and temp3_after.md. Temp3.md is orginal file. Temp3_after.md is saved version (through edit R).
On Thu, Jan 15, 2015 at 7:47 AM, Simon Garnier notifications@github.com wrote:
@dpastoor https://github.com/dpastoor It'd be great if you can give it a try. I'm in the process of moving my lab to new facilities and I won't have much time until next week to install a windows virtual machine and find the root of this problem.
Reply to this email directly or view it on GitHub https://github.com/swarm-lab/editR/issues/2#issuecomment-70029902.
Webpage:http://independent.academia.edu/NandKishoreSingh Yahoo Mail Account:nk_singh1@yahoo.com
@nksingh62 GitHub doesn't know how to handle attachments in issue reports (except for images). Can you create a public gist for each of these example files at https://gist.github.com/ and then share the link here?
Thanks for your help.
(1) I think problem is with markdown. When I saw saved file temp3_after.md in "Notepad", it is not showing extra lines. (2) Although I have uploaded both code "temp3.md "and "temp3_after.md" at public gist (https://gist.github.com/nksingh62/959c468ef62ef76478a0) as you suggested but it may not be sufficient to explain the problem because gist editor distort the problem with its own way to handle the newline. I have loaded screenshots and steps as public document ( https://docs.google.com/document/d/1CS1RKBqHbqeePpe0aTlLfW8UtET44wgRkAQAYD61aO4/edit?usp=sharing) so that it may be clear that editR puts some not printable char at end of line for which markdown (and gist editor) is sensitive but "Notepad" (or MS Word) is not snesitive.
On Thu, Jan 15, 2015 at 7:51 PM, Simon Garnier notifications@github.com wrote:
@nksingh62 https://github.com/nksingh62 GitHub doesn't know how to handle attachments in issue reports (except for images). Can you create a public gist for each of these example files at https://gist.github.com/ and then share the link here?
Thanks for your help.
Reply to this email directly or view it on GitHub https://github.com/swarm-lab/editR/issues/2#issuecomment-70091636.
Webpage:http://independent.academia.edu/NandKishoreSingh Yahoo Mail Account:nk_singh1@yahoo.com
I analysed both file format of temp3.md and temp3_after.md files and found that ediR adds an extra end-of-line char (at time of saving) i.e. "/r" in the file "temp3_after.md" which yields to extra line.
OK fyi, I have also reproduced this bug on my computer with windows 8.1. I'm going to try an alternate method of saving to see if that works better (@ least on windows systems)
Thanks @dpastoor. I don't have a windows computer available and won't have the time to install a virtual machine on my mac and linux machines before the end of next week I think. I suspect that cat is the guilty function here, though I'm not sure why and how to fix the problem.
fixed! at least in my testing on the template rmd on mac and windows it behaved as expected.
Ok, thanks. I'll take a look at it as soon as possible.
I merged @dpastoor fix. It should work fine now. For some reason I had decided deliberately to use cat rather than writeChar, but I can't remember why. We'll see what happens now :-)