mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 14:43:46 +01:00
Merge pull request #32135 from overleaf/mg-comment-empty-select
Allow adding comments on empty selection GitOrigin-RevId: 14e742bb563fab99624be860691f1a9d2dabc00e
This commit is contained in:
+2
-1
@@ -16,6 +16,7 @@ import { isMac } from '@/shared/utils/os'
|
||||
import { useProjectContext } from '@/shared/context/project-context'
|
||||
import { useEditorPropertiesContext } from '@/features/ide-react/context/editor-properties-context'
|
||||
import { usePermissionsContext } from '@/features/ide-react/context/permissions-context'
|
||||
import { isCursorOnEmptyLine } from '@/features/source-editor/utils/is-cursor-on-empty-line'
|
||||
|
||||
const addCommentFromToolbar = () => commands.addComment('toolbar')
|
||||
|
||||
@@ -136,7 +137,7 @@ export const ToolbarItems: FC<{
|
||||
<ToolbarButton
|
||||
id="toolbar-add-comment"
|
||||
label={t('add_comment')}
|
||||
disabled={state.selection.main.empty}
|
||||
disabled={isCursorOnEmptyLine(state)}
|
||||
command={addCommentFromToolbar}
|
||||
icon="add_comment"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user