jdev082 / editor

0 stars 1 forks source link

Line Numbers #1

Open jdev082 opened 2 years ago

kccuber-scratch commented 2 years ago

it looks like the div that holds the line number can be backspaced out of existence?

jdev082 commented 2 years ago

oh? the one with content editing enabled. Then how would anyone type text then?

webdev03 commented 2 years ago

OK, let me see. I think this would require some JS. also where is script.js?

jdev082 commented 2 years ago

OK, let me see. I think this would require some JS. also where is script.js?

i didnt push my changes yet.

webdev03 commented 2 years ago

OK!

jdev082 commented 2 years ago

I can't push my changes, i hate it when i forget to commit my changes before merging PRs, Now I can't merge it! I didn't add anything anyway.

webdev03 commented 2 years ago

What happened? What's the error?

jdev082 commented 2 years ago

@webdev03 i said i didnt even change much

webdev03 commented 2 years ago

But why can't you push your changes?

jdev082 commented 2 years ago

just fix the bug i cant fix :(

webdev03 commented 2 years ago

https://stackoverflow.com/questions/1995370/adding-line-numbers-to-html-textarea

jdev082 commented 2 years ago

[nvm]

webdev03 commented 2 years ago

You could use a textarea if this works.

jdev082 commented 2 years ago

@webdev03 im not using jquery

jdev082 commented 2 years ago

I can use this cool copy paste code if i was boring

var editor = CodeMirror.fromTextArea(document.getElementById('code'), {
    lineNumbers: true,
    mode: 'text/x-perl',
    theme: 'abbott',
});

<script language="javascript" type="text/javascript" src="https://codemirror.net/lib/codemirror.js"></script>
<script language="javascript" type="text/javascript" src="https://codemirror.net/mode/perl/perl.js"></script>

<link rel="stylesheet" type="text/css" href="https://codemirror.net/lib/codemirror.css"></link>
<link rel="stylesheet" type="text/css" href="https://codemirror.net/theme/abbott.css"></link>

<textarea id="code" name="code">
if($cool_variable) {
    doTheCoolThing();     # it's PRETTY cool, imho
}</textarea>
webdev03 commented 2 years ago

Ok, so https://codemirror.net/ may help. Or https://stackoverflow.com/a/61053609/17333186

webdev03 commented 2 years ago

I'd suggest modifying https://stackoverflow.com/a/61053609/17333186 and it would work. But then we could also have another solution which I can tell you.

jdev082 commented 2 years ago

code mirror doesn't have line numbers

webdev03 commented 2 years ago

It does. But then it would ruin the whole point of making it ourself if we use it.

jdev082 commented 2 years ago

@webdev03 No it doesn't, very clearly when I copied and pasted the code it didn't have anything but an editable text area.

kccuber-scratch commented 2 years ago

no codemirror, that's cheaty

jdev082 commented 2 years ago

@kccuber-scratch with plain HTML/CSS/JS (which i want to do it in) that's the only option.

jdev082 commented 2 years ago

https://www.thatsoftwaredude.com/content/8912/create-a-basic-text-editor-in-javascript the tutorial i originally followed

jdev082 commented 2 years ago

the site is unusable because of the unblockable popups you cant get rid of.

kccuber-scratch commented 2 years ago

the site is unusable because of the unblockable popups you cant get rid of.

it literally has 2 popups, the other can be blocked by an adblocker

jdev082 commented 2 years ago

the site is unusable because of the unblockable popups you cant get rid of.

it literally has 2 popups, the other can be blocked by an adblocker

both are in the WAY of the stuff on the web page.

jdev082 commented 2 years ago

also the guide doesn't have line numbers, which i need

kccuber-scratch commented 2 years ago

the site is unusable because of the unblockable popups you cant get rid of.

it literally has 2 popups, the other can be blocked by an adblocker

both are in the WAY of the stuff on the web page.

no, i was able to close them. on the first one theres a big text that says "X close" and on the second one there's a small "no thanks" at the bottom right corner

jdev082 commented 2 years ago

there's no X on the email asking one.

kccuber-scratch commented 2 years ago

there's no X on the email asking one.

it's right below the box that asks for your email, screenshot pls

jdev082 commented 2 years ago

image

here's what i found (and pasted) so far. i have found copied and pasted all the source. so this is what i have.

jdev082 commented 2 years ago

still no line numbers tho.

jdev082 commented 2 years ago

i cant type in it anymore?

jdev082 commented 2 years ago

fixed.

jdev082 commented 2 years ago

none of the formatting buttons work tho

jdev082 commented 2 years ago

nvm they do.

jdev082 commented 2 years ago

not on gh-pages tho, github messed up my changes. and so did vscode.

jdev082 commented 2 years ago

fixed.

webdev03 commented 2 years ago

???

webdev03 commented 2 years ago

@JaydenDev did you switch to VSCode? I thought you used vim.

jdev082 commented 2 years ago

@webdev03 I use vscode any time I'm dealing with multiple files, it also has better syntax highlighting. Also a built in terminal and ... [...]

webdev03 commented 2 years ago

Oh, ok. I use it too, you don't need to explain why it's better.

jdev082 commented 2 years ago

Also it's nice to use jefallo's live server hosting extension for VSCODE. so that I can easily have it automatically reload every file save and have an easy server hosted on localhost for me to test.

webdev03 commented 2 years ago

Same! Jeffalo's extension is awesome for working on static projects 🤣

jdev082 commented 2 years ago

image

jdev082 commented 2 years ago

gh copilot doesn't work since im still in the waiting list.

webdev03 commented 2 years ago

I just joined the waiting list. I hope I get in! :smile: