Processing pasted tabs

I have ‘Indent Unit’ set to 4 in Inkdrop and TAB is entered as Space x 4.

However, when I copy and paste a code snippet from another editor, the tab does not expand into a space, but remains \t, which is Space x 2.

I have to readjust the indentation in Inkdrop every time.

I think it would be appropriate if pasted tabs were also rendered according to the ‘Indent Unit’.

Info

  • Platform: (Windows)
  • Platform version: (10)
  • App Version: (5.3.1)

Reproduce

Copy and paste code or documents that contain tabs.

Hey Avis,

Let me answer after the paternity break!

Congratulations on that!
I’m not in a hurry, so it’s okay.

CodeMirror has an option tabSize: https://codemirror.net/doc/manual.html#option_tabSize
So, it’d be nice to support it instead of converting tabs into spaces.

Thank you for your answer.
Do you have any plans to support this in inkdrop?

I’m currently working on the mobile app.
You can specify it with init.js like so:

inkdrop.onEditorLoad(() => {
  var cm = inkdrop.getActiveEditorOrThrowError().cm
  cm.setOption('tabSize', 2)
})

Thanks, that was very helpful.
I am now able to adjust the CodeMirror settings.

I no longer need to rework the snippet after I put it up.

However, it doesn’t match the settings in Inkdrop, so hopefully this will be improved someday.

1 Like

Yes, it’ll be supported in the next release!

1 Like

It’s now supported in v5.4.0:tada:

1 Like