Toggle code "closing" is not working as intended

Steps to reproduce

Reproducible on Sandbox Vault

  • Active “Toggle Code”: `` appears
  • Write “some stuff”: `some stuff`
  • Active “Toggle Code”: `some stuff```

Expected result

  • Active “Toggle Code”: `some stuff` (cursor at the end)

I expect the same result that I have with “Toggle Bold” or “Toggle Italics”.

  • Active “Toggle Italics”: **
  • Write “some stuff”: *some stuff*
  • Active “Toggle Italics”: *some stuff* (cursor at the end)

Actual result

The cursor is in a middle of new ``, which is not intuitive.

Environment

  • Operating system: Ubuntu 20.04

  • Debug info:

SYSTEM INFO:
	Obsidian version: v0.14.6
	Installer version: v0.13.30
	Operating system: #32-Ubuntu SMP Fri Mar 18 13:27:43 UTC 2022 5.14.0-1029-oem
	Login status: not logged in
	Insider build toggle: off
	Live preview: on
	Legacy editor: off
	Base theme: dark
	Community theme: none
	Snippets enabled: 0
	Safe mode: on

RECOMMENDATIONS:
	none

Might be worth updating the installer / Electron version and testing again:

Angel

Hello Angel,

I updated the installer version to 0.14.6 and it does not fix the problem.
Thanks for your quick reply

SYSTEM INFO:
	Obsidian version: v0.14.6
	Installer version: v0.14.6
	Operating system: #32-Ubuntu SMP Fri Mar 18 13:27:43 UTC 2022 5.14.0-1029-oem
	Login status: not logged in
	Insider build toggle: off
	Live preview: on
	Legacy editor: off
	Base theme: dark
	Community theme: none
	Snippets enabled: 0
	Safe mode: on

RECOMMENDATIONS:
	none
1 Like

Hello, AwePhD

Ah, shame. Works on macOS. Hope the devs or someone else can offer a solution.

Angel

1 Like

This is how toggle code works. We changed bold and italics recently. I am not sure we shoudl do the same for code. Open a feature request for toggle code.

1 Like

Apologies. I misunderstood. I am using backticks directly; not the toggle hotkey or command palette.

If you type a backtick, you should get opening and closing backticks, and if you then type a backtick again the code closes and the cursor moves on. You probably already know this. Oops. My bad.

Angel