Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow lineheight in font #597

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Allow lineheight in font #597

wants to merge 2 commits into from

Conversation

hackpirodev
Copy link
Collaborator

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

[ ] Yes
[ ] No

Other information

Copy link

codesandbox bot commented Dec 6, 2023

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link

changeset-bot bot commented Dec 6, 2023

⚠️ No Changeset found

Latest commit: ef68a01

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

github-actions bot commented Dec 6, 2023

Deploy preview for codeimage-website-dev ready!

✅ Preview
https://codeimage-website-bi834nv70-riccardoperra.vercel.app
https://codeimage-website-pr-597.vercel.app

Built with commit ef68a01.
This pull request is being automatically deployed with vercel-action

Copy link
Contributor

github-actions bot commented Dec 6, 2023

Deploy preview for codeimage-highlight-dev ready!

✅ Preview
https://codeimage-highlight-bnrw0e1ht-riccardoperra.vercel.app
https://codeimage-highlight-pr-597.vercel.app

Built with commit ef68a01.
This pull request is being automatically deployed with vercel-action

Copy link
Contributor

github-actions bot commented Dec 6, 2023

Deploy preview for codeimage ready!

✅ Preview
https://codeimage-kly9dybgi-riccardoperra.vercel.app
https://codeimage-app-pr-597.vercel.app

Built with commit ef68a01.
This pull request is being automatically deployed with vercel-action

Comment on lines +195 to +200
<>
<pre>{editorState.options.lineHeight}</pre>
<code class={`language-${selectedLanguage()?.id ?? 'default'}`}>
<div ref={setRef} />
</code>
</>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<>
<pre>{editorState.options.lineHeight}</pre>
<code class={`language-${selectedLanguage()?.id ?? 'default'}`}>
<div ref={setRef} />
</code>
</>
<>
<code class={`language-${selectedLanguage()?.id ?? 'default'}`}>
<div ref={setRef} />
</code>
</>

we've to remove this

Comment on lines +102 to +103
.hold(store.commands.setLineHeight, (linheHeight, {set}) => {
set('options', 'lineHeight', linheHeight);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.hold(store.commands.setLineHeight, (linheHeight, {set}) => {
set('options', 'lineHeight', linheHeight);
.hold(store.commands.setLineHeight, (lineHeight, {set}) => {
set('options', 'lineHeight', lineHeight);

@@ -153,6 +153,7 @@ export default function CustomEditor(props: VoidProps<CustomEditorProps>) {
fontFamily: `${fontName}, monospace`,
fontWeight: fontWeight,
fontVariantLigatures,
lineHeight: editorState.options.lineHeight,
Copy link
Owner

@riccardoperra riccardoperra Dec 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'd handle this separately to be more performant. createExtension will create a code mirror "compartment" then it will change only when lineHeight effectively changes.

createExtension(() => {
  const lineHeight = editor.lineHeight;
  if (!lineHeight) return null;
  return EditorView.theme({
    '.cm-content': { lineHeight }
  })
})

<SuspenseEditorItem
fallback={<SkeletonLine width={'85%'} height={'26px'} />}
>
<input
Copy link
Owner

@riccardoperra riccardoperra Dec 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have to change it with NumberField of @codeui/kit when available.

riccardoperra/codeui#39

currently it's still in progress due to a Maskito bug with float numbers. I'll probably leave that solution

Copy link

stale bot commented Feb 10, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Feb 10, 2024
Copy link

stale bot commented Apr 12, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Apr 12, 2024
@stale stale bot closed this Aug 11, 2024
@riccardoperra riccardoperra reopened this Aug 11, 2024
@stale stale bot removed the wontfix This will not be worked on label Aug 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants