0
Fixed

Formatting is pasted into editor with disabled formatting (2.0.2-beta-1)

burrum 11 years ago updated by Alex Jenter 11 years ago 1

There may be more than one bug here.


Preparation:

1. Make a portable CN 2.0.2-beta-1 installation (name: CN-Consolas)

2. Allow multiple instances

3. Disable formatting (Options > Editor > Text formatting)

4. Set note body font to Consolas-12 (Options > Notes List)

5. Create a copy of this portable installation (name: CN-Lucida)

6. In the copy, set note body font to Lucida Console-10

7. Get both running side-by-side.


Now let's play.


Case 1:

1. Create a note in both CNs.

2. Open both notes for edit

3. Copy text from CN-Lucida

4. Paste text into CN-Consolas


Result: Text is pasted with Courier New font, size 12! Probably because 12 is the size set for target CN, and Courier New is the "editor.fonts.monospace" for source CN (or target CN?).

Expected: Text is pasted without any formatting or font information (besides Consolas-12 font of target CN). Like pasting to a plain notepad.

Extra: This font is not saved in target CN. After reopening editor it gets normal.


Case 2: Same as Case 1, but swap source and target. Text from Consolas-12 editor is pasted as Courier New-10 text into Lucida Console-10 editor.


Case 3: If target editor has Courier New, pasted text gets this font.


Case 4:

1. In CN-Lucida, enable formatting (Options > Editor > Text formatting)

2. Open a note and make something bold

3. Copy bold text (apparently with Lucida Console-10 font and bold effect)

4. Paste into CN-Consolas


Result: Text is pasted as Courier New-12 bold. This means that not only font, but formatting is also pasted. Also works for italics and bullet lists.


Case 5: We can paste bullets into editor with disabled formatting. And these will be saved (separate bug).


Case 6:

1. Enable formatting

2. Apply some formatting in note, save

3. Disable formatting

4. Open note


Result: formatting is not rendered in editor, but is rendered in preview. I guess this is the intended behavior, but this looks inconsistent and weird.


Case 7:

1. Set font to any monospace but Courier New. Say, Consolas.

2. Enable formatting

3. Create note, make some text (renders with Consolas)

4. Select some text and apply Format > Monospace.


Result: a piece of Courier New monospace among Consolas monospace. This is weird! I prefer Consolas as the base font for notes, so this case is about using "monospace" formatting if the font is already monospace.


Conclusion:

* Font set for Editor in settings is copied to clipboard even if formatting is disabled. And this font is not related with formatting (yes, this sounds weird).

* Font set for Editor may be written to the .db (unsure)

* Things are getting complex with formatting. I wish I could completely disable it to ensure my notes are always plaintext and no formatting is written into .db under any circumstances. This is a topic for a separate feature request.

* This is hard to test, this bug report is hard to read, and probably hard to sort out.

viewing editing clipboard text-formatting

Answer

Answer
Fixed
Released in 2.0.2


+1

Thanks for the report!

1-5) Confirmed, will be fixed.

6) This is by design to avoid deleting formatting by mistake

7) I don't see the problem here. Just don't use monospace formatting if you don't need it. If other cases, it can be handy to have a different monospace style. Disabling monospace formatting altogether when the note font is monospace won't bring any extra benefits IMO.

Answer
Fixed
Released in 2.0.2