rpeshkov / vscode-text-tables

VSCode extension that brings the power of Emacs table editing
MIT License
38 stars 14 forks source link

Conflicting with suggestions #54

Open NeoFantom opened 4 years ago

NeoFantom commented 4 years ago

Sometimes I need to use word suggestions provided by vscode. But I have to commit the suggested word with tab or enter. Problem is: when I'm in table mode, both tab and enter has cell-ralated functions which overrides the default suggestion-commiting. How to make this work for me? Below is a gif of what happens after I press enter: cannotCommitSuggestion

rpeshkov commented 4 years ago

Hi @NeoFantom,

You could try to remap keys a bit.

{ "key": "tab", "command": "-text-tables.gotoNextCell", "when": "tableMode" },
{ "key": "tab", "command": "text-tables.gotoNextCell", "when": "tableMode && !suggestWidgetVisible" },
{ "key": "enter", "command": "-text-tables.nextRow", "when": "tableMode" },
{ "key": "enter", "command": "text-tables.nextRow", "when": "tableMode && !suggestWidgetVisible" }

These lines remove Tab and Enter bindings that extension brings and map them back with additional when clause. After you apply this settings in your keybindings file, Tab and Enter will have default behavior when suggestions list is visible.

NeoFantom commented 4 years ago

Perfect solution! Can't stress enough how grateful I am!

rpeshkov commented 4 years ago

Glad that it helped you. I guess I will make changes into keybinding of extension so that this behavior will be default.