Fix existing: Extrude from command bar selects extrude line after (#3547)
* Fix existing: Extrude from command bar selects extrude line after #3545 * remove as --------- Co-authored-by: Frank Noirot <frank@zoo.dev> Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
This commit is contained in:
@ -1,6 +1,5 @@
|
||||
import { Completion } from '@codemirror/autocomplete'
|
||||
import { EditorView, ViewUpdate } from '@codemirror/view'
|
||||
import { EditorState } from '@codemirror/state'
|
||||
import { CustomIcon } from 'components/CustomIcon'
|
||||
import { useCommandsContext } from 'hooks/useCommandsContext'
|
||||
import { useSettingsAuthContext } from 'hooks/useSettingsAuthContext'
|
||||
@ -84,17 +83,13 @@ function CommandBarKclInput({
|
||||
if (event.key === 'Backspace' && value === '') {
|
||||
event.preventDefault()
|
||||
stepBack()
|
||||
} else if (event.key === 'Enter') {
|
||||
event.preventDefault()
|
||||
handleSubmit()
|
||||
}
|
||||
},
|
||||
}),
|
||||
varMentions(varMentionData),
|
||||
EditorState.transactionFilter.of((tr) => {
|
||||
if (tr.newDoc.lines > 1) {
|
||||
handleSubmit()
|
||||
return []
|
||||
}
|
||||
return tr
|
||||
}),
|
||||
EditorView.updateListener.of((vu: ViewUpdate) => {
|
||||
if (vu.docChanged) {
|
||||
setValue(vu.state.doc.toString())
|
||||
|
Reference in New Issue
Block a user