Support a literal Tab
See original GitHub issueTipTap currently does not support a literal tab charicter when you press tab (particularly annoying in a code block), the browser will move focus to the next input on the page. This should probably be the default behaviour, see:
https://discuss.prosemirror.net/t/tab-stops/225 https://discuss.prosemirror.net/t/parsedom-for-tab/723
However maybe include a standard extension (such as below) to add support, note that due to https://github.com/ueberdosis/tiptap-next/issues/115 this would need to be after the list extensions as you would want the standard tab indent behaviour for them.
import { Extension } from '@tiptap/core';
export const LiteralTab = Extension.create({
name: 'literalTab',
addKeyboardShortcuts() {
return {
Tab: () => {
console.log('test');
return this.editor.commands.insertText('\t')
}
}
}
})
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:9 (8 by maintainers)
Top Results From Across the Web
How do I enter a literal tab character in a bash shell?
It allows you to enter a string, but also have escaped characters. Double quoting literally prints \t If you leave off the quotes...
Read more >How do I type a literal tab character in Eclipse? - Stack Overflow
Only way I can find to do it in Eclipse (version=Juno) was to type say XXX where I wanted the tab character and...
Read more >How to insert a literal tab character? · Issue #2478 · fish-shell ...
In bash Ctrl+V followed by Tab worked fine. Unfortunatelly this doesn't work on Fish.
Read more >218762 – Request ability to insert literal TAB using ... - Bugs
Build ID: M20071023-1652 Steps To Reproduce: 1. Editors | Text Editors preference is set to 'insert spaces for tabs' 2. Try to insert...
Read more >Insert tabs in INSERT mode when expandtab is set
Instead of just pressing Tab , first press Ctrl-V and then press Tab . This can be used to insert a variety of...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Here is my solution that allows to insert tabs while editing the text in code block:
I think we should focus on building the CodeMirror extension, before we try to improve the CodeBlock extension. Closing this here for now. ✌️