Re: [Zim-wiki] Copy-pasing verbatim text pastes unwanted newline at the end
This happens when selecting individual lines as well, not only multiple lines. And I select until the end of the line with Shift+End. Pressing Shift+Right arrow to unselect the last newline actually unselects the last character, so the selection doesn't contain the newline char at the end of the line. But the pasted text contains a newline. Thanks. -- Fita Adrian On Thu, Apr 25, 2013 at 1:33 AM, andré and...@laposte.net wrote: Adrian Fita a écrit : Hi. I'm using Zim 0.59 on Windows 7. So I write some text over multiple lines and then I format it as Verbatim with CTRL+T. All good so far. The problem I'm experiencing is when I copy-paste whole lines from the Verbatim formatted text. The pasted text contains an additional newline character at the end. This is very annoying (and possibly dangerous) when pasting in a terminal: the newline causes the pasted text to be run immediately without the possibility of editing it before. I think this is a bug, when I copy the text I don't copy the newline at the end of the line because I don't move the cursor at the beginning of the next line. I hope you understood what I mean, it's kind of hard to explain... Thanks, -- Fita Adrian When you select, is the last line highlighted to the end of the line ? If so, you have selected the newline. To avoid selecting the last newline, when selecting hold the shift key and press the left arrow. The highlight should then terminate at the end of the text instead of end of line, indicating that the newline is no longer selected. Conversely, if you want to ensure that the newline is selected, sometimes one must press the right arrow so that the entire line is highlighted. Note that many other applications show the cursor at the beginning of the next line when the newline is selected. Personnally, I think Zim's display is more coherent, although it can be confusing at first. Regards -- André __**_ Mailing list: https://launchpad.net/~zim-**wikihttps://launchpad.net/~zim-wiki Post to : zim-wiki@lists.launchpad.net Unsubscribe : https://launchpad.net/~zim-**wikihttps://launchpad.net/~zim-wiki More help : https://help.launchpad.net/**ListHelphttps://help.launchpad.net/ListHelp ___ Mailing list: https://launchpad.net/~zim-wiki Post to : zim-wiki@lists.launchpad.net Unsubscribe : https://launchpad.net/~zim-wiki More help : https://help.launchpad.net/ListHelp
Re: [Zim-wiki] Copy-pasing verbatim text pastes unwanted newline at the end
Adrian Fita a écrit : This happens when selecting individual lines as well, not only multiple lines. And I select until the end of the line with Shift+End. Pressing Shift+Right arrow to unselect the last newline actually unselects the last character, so the selection doesn't contain the newline char at the end of the line. But the pasted text contains a newline. Thanks. -- Fita Adrian Doesn't work like that on Linux. What happens if you add a space at the end of the line, then unselect the space ? Or alternately, select the lines you want by placing the cursor at the beginning of the line, using the down arrow to select the line(s) wanted, then backspacing to the last caracter of the line ? (Just in case the shift-end code was still present when you used it.) Or again, using only the mouse to select the text, without using shift-end ? Regards -- André ___ Mailing list: https://launchpad.net/~zim-wiki Post to : zim-wiki@lists.launchpad.net Unsubscribe : https://launchpad.net/~zim-wiki More help : https://help.launchpad.net/ListHelp
Re: [Zim-wiki] Copy-pasing verbatim text pastes unwanted newline at the end
On 25/04/13 09:38, andré wrote: Adrian Fita a écrit : This happens when selecting individual lines as well, not only multiple lines. And I select until the end of the line with Shift+End. Pressing Shift+Right arrow to unselect the last newline actually unselects the last character, so the selection doesn't contain the newline char at the end of the line. But the pasted text contains a newline. Thanks. -- Fita Adrian Doesn't work like that on Linux. Hm. I just tested in Linux (the same v0.59) and it happens in Linux as well. Steps to reproduce: 1. write some lines in a page 2. select the lines and press Ctrl+T (or select Verbatim from the Format menu) 3. Hit the Home key and copy-paste until the end of the line from the Verbatim-formatted text in another text editor. The pasted text contains a newline at the end What happens if you add a space at the end of the line, then unselect the space ? It happens even when I have space at the end and select until the end of the line, then unselect the last space: the pasted text contains a new line at the end. The newline is even present when I only select a part of a line. But I just figured something: if I don't select from the begining of the line, the newline is not pasted. So it seems to be related with the begining of the lines in Verbatim-formatted text. Or alternately, select the lines you want by placing the cursor at the beginning of the line, using the down arrow to select the line(s) wanted, then backspacing to the last caracter of the line ? (Just in case the shift-end code was still present when you used it.) Or again, using only the mouse to select the text, without using shift-end ? Regards Selecting with the mouse is the same. -- Adrian Fita ___ Mailing list: https://launchpad.net/~zim-wiki Post to : zim-wiki@lists.launchpad.net Unsubscribe : https://launchpad.net/~zim-wiki More help : https://help.launchpad.net/ListHelp
Re: [Zim-wiki] Date/time issues
On Thu, Apr 25, 2013 at 5:46 PM, Alexander Bryan amb...@umich.edu wrote: Hi I am a new Zim user and the calendar features are not working for me. Specifically... 1. When creating a new page, no date shows up after Created. 2. When opening up a new journal page, no dates appear—rather === appears and the word to Do you have the journal set to weekly pages ? If so this is a known issue that will be fixed in the upcoming release. Regards, Jaap ___ Mailing list: https://launchpad.net/~zim-wiki Post to : zim-wiki@lists.launchpad.net Unsubscribe : https://launchpad.net/~zim-wiki More help : https://help.launchpad.net/ListHelp
Re: [Zim-wiki] Copy-pasing verbatim text pastes unwanted newline at the end
May I suggest opening a bug report for this ? Regards, Jaap On Thu, Apr 25, 2013 at 6:12 PM, Adrian Fita adrian.f...@gmail.com wrote: On 25/04/13 09:38, andré wrote: Adrian Fita a écrit : This happens when selecting individual lines as well, not only multiple lines. And I select until the end of the line with Shift+End. Pressing Shift+Right arrow to unselect the last newline actually unselects the last character, so the selection doesn't contain the newline char at the end of the line. But the pasted text contains a newline. Thanks. -- Fita Adrian Doesn't work like that on Linux. Hm. I just tested in Linux (the same v0.59) and it happens in Linux as well. Steps to reproduce: 1. write some lines in a page 2. select the lines and press Ctrl+T (or select Verbatim from the Format menu) 3. Hit the Home key and copy-paste until the end of the line from the Verbatim-formatted text in another text editor. The pasted text contains a newline at the end What happens if you add a space at the end of the line, then unselect the space ? It happens even when I have space at the end and select until the end of the line, then unselect the last space: the pasted text contains a new line at the end. The newline is even present when I only select a part of a line. But I just figured something: if I don't select from the begining of the line, the newline is not pasted. So it seems to be related with the begining of the lines in Verbatim-formatted text. Or alternately, select the lines you want by placing the cursor at the beginning of the line, using the down arrow to select the line(s) wanted, then backspacing to the last caracter of the line ? (Just in case the shift-end code was still present when you used it.) Or again, using only the mouse to select the text, without using shift-end ? Regards Selecting with the mouse is the same. -- Adrian Fita ___ Mailing list: https://launchpad.net/~zim-wiki Post to : zim-wiki@lists.launchpad.net Unsubscribe : https://launchpad.net/~zim-wiki More help : https://help.launchpad.net/ListHelp ___ Mailing list: https://launchpad.net/~zim-wiki Post to : zim-wiki@lists.launchpad.net Unsubscribe : https://launchpad.net/~zim-wiki More help : https://help.launchpad.net/ListHelp
Re: [Zim-wiki] Date/time issues
Thanks for your response, Jaap. Yes, but the same issue occurs with daily pages only without the to. I don't think it's a bug with Zim, unless it's a compatibility issue with Macs. My suspicion is the problem lies in how I have installed python and/or Zim such that the strftime command in the Default.txt and Journal.txt templates are failing. Not sure how to test that though—I've never used python until 2 days ago! On Thu, Apr 25, 2013 at 2:23 PM, Jaap Karssenberg jaap.karssenb...@gmail.com wrote: On Thu, Apr 25, 2013 at 5:46 PM, Alexander Bryan amb...@umich.edu wrote: Hi I am a new Zim user and the calendar features are not working for me. Specifically... 1. When creating a new page, no date shows up after Created. 2. When opening up a new journal page, no dates appear—rather === appears and the word to Do you have the journal set to weekly pages ? If so this is a known issue that will be fixed in the upcoming release. Regards, Jaap ___ Mailing list: https://launchpad.net/~zim-wiki Post to : zim-wiki@lists.launchpad.net Unsubscribe : https://launchpad.net/~zim-wiki More help : https://help.launchpad.net/ListHelp
Re: [Zim-wiki] Date/time issues
On Thu, Apr 25, 2013 at 8:37 PM, Alexander Bryan amb...@umich.edu wrote: Thanks for your response, Jaap. Yes, but the same issue occurs with daily pages only without the to. I don't think it's a bug with Zim, unless it's a compatibility issue with Macs. My suspicion is the problem lies in how I have installed python and/or Zim such that the strftime command in the Default.txt and Journal.txt templates are failing. Not sure how to test that though—I've never used python until 2 days ago! You can do a quick check by running the following command in a terminal: $ python -c import datetime; print datetime.datetime.now().strftime('%c') If it prints a date to the terminal, the python module is working fine. You can also try running zim -D to check for error logging in the debug output. Regards, Jaap ___ Mailing list: https://launchpad.net/~zim-wiki Post to : zim-wiki@lists.launchpad.net Unsubscribe : https://launchpad.net/~zim-wiki More help : https://help.launchpad.net/ListHelp
Re: [Zim-wiki] Copy-pasing verbatim text pastes unwanted newline at the end
On 25/04/13 21:25, Jaap Karssenberg wrote: May I suggest opening a bug report for this ? Regards, Jaap Reported as Bug #1172862: https://bugs.launchpad.net/zim/+bug/1172862 . Thanks, -- Adrian Fita ___ Mailing list: https://launchpad.net/~zim-wiki Post to : zim-wiki@lists.launchpad.net Unsubscribe : https://launchpad.net/~zim-wiki More help : https://help.launchpad.net/ListHelp
Re: [Zim-wiki] Date/time issues
Thanks Jaap. The command successfully printed out a date and time. However, is the calendar.py and datetimetz.py modules included in the Zim package different from the defaults in the python package? Should I be directing python to the Zim modules as opposed to the python defaults? If so, how? I am not sure my export PYTHONPATH ... is doing that correctly. Two potentially relevant insights from debug mode: 1. After opening Zim with python2.6 ./zim.py -D: DEBUG: Set XDG_DATA_HOME to /Users/ambrya/.local/share There is no XDG in the above directory. The only files in this directory are: zim/templates/Default.txt zim/templates/Journal.txt 2. After creating a new page: ERROR: Error in strftime %A %d %B %Y Traceback (most recent call last): File /Users/ambrya/source/zim-0.59/zim/templates.py, line 742, in __call__ return string.decode(locale.getpreferredencoding()) LookupError: unknown encoding: After line 742, there is comment that I don't understand and am not sure is relevant: # strftime returns locale as understood by the C api # unfortunately there is no guarantee we can actually # decode it ... Thoughts? Thanks so much for your help, Jaap. Best, Alex On Thu, Apr 25, 2013 at 2:47 PM, Jaap Karssenberg jaap.karssenb...@gmail.com wrote: On Thu, Apr 25, 2013 at 8:37 PM, Alexander Bryan amb...@umich.edu wrote: Thanks for your response, Jaap. Yes, but the same issue occurs with daily pages only without the to. I don't think it's a bug with Zim, unless it's a compatibility issue with Macs. My suspicion is the problem lies in how I have installed python and/or Zim such that the strftime command in the Default.txt and Journal.txt templates are failing. Not sure how to test that though—I've never used python until 2 days ago! You can do a quick check by running the following command in a terminal: $ python -c import datetime; print datetime.datetime.now().strftime('%c') If it prints a date to the terminal, the python module is working fine. You can also try running zim -D to check for error logging in the debug output. Regards, Jaap ___ Mailing list: https://launchpad.net/~zim-wiki Post to : zim-wiki@lists.launchpad.net Unsubscribe : https://launchpad.net/~zim-wiki More help : https://help.launchpad.net/ListHelp
Re: [Zim-wiki] Date/time issues
On Thu, Apr 25, 2013 at 9:28 PM, Alexander Bryan amb...@umich.edu wrote: 2. After creating a new page: ERROR: Error in strftime %A %d %B %Y Traceback (most recent call last): File /Users/ambrya/source/zim-0.59/zim/templates.py, line 742, in __call__ return string.decode(locale.getpreferredencoding()) LookupError: unknown encoding: This is the real issue - don't worry about the python path or the XDG config. Could you run: $ python -c import locale; print locale.getpreferredencoding() I suspect that it will return empty - if so apparently on your system python has no idea what locale settings you are using. Typically should be something like UTF-8. Replacing line 742 by: return string.decode('utf-8') should fix it in that case (mind the line indenting) Regards, Jaap ___ Mailing list: https://launchpad.net/~zim-wiki Post to : zim-wiki@lists.launchpad.net Unsubscribe : https://launchpad.net/~zim-wiki More help : https://help.launchpad.net/ListHelp
Re: [Zim-wiki] Date/time issues
Genius! That did it. Running the command returned US-ASCII—not empty—but your change to line 742 did the trick. Thanks so much, Jaap! I will await the next release for when the === disappears from the top line in the weekly journal pages. Best, Alex On Thu, Apr 25, 2013 at 3:34 PM, Jaap Karssenberg jaap.karssenb...@gmail.com wrote: On Thu, Apr 25, 2013 at 9:28 PM, Alexander Bryan amb...@umich.edu wrote: 2. After creating a new page: ERROR: Error in strftime %A %d %B %Y Traceback (most recent call last): File /Users/ambrya/source/zim-0.59/zim/templates.py, line 742, in __call__ return string.decode(locale.getpreferredencoding()) LookupError: unknown encoding: This is the real issue - don't worry about the python path or the XDG config. Could you run: $ python -c import locale; print locale.getpreferredencoding() I suspect that it will return empty - if so apparently on your system python has no idea what locale settings you are using. Typically should be something like UTF-8. Replacing line 742 by: return string.decode('utf-8') should fix it in that case (mind the line indenting) Regards, Jaap ___ Mailing list: https://launchpad.net/~zim-wiki Post to : zim-wiki@lists.launchpad.net Unsubscribe : https://launchpad.net/~zim-wiki More help : https://help.launchpad.net/ListHelp