I want to make a text editor in Love2D.
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
I want to make a text editor in Love2D.
Now that it has the ability to resize windows dynamically, I really want to make a text editor. I have enough knowledge to do it, but if there's anything you'd like to point out for help I'd love to hear it! I am particularly worried about editing long files - won't Lua load the entire file into memory if I use io.open? Thanks for any help.
- Ranguna259
- Party member
- Posts: 911
- Joined: Tue Jun 18, 2013 10:58 pm
- Location: I'm right next to you
Re: I want to make a text editor in Love2D.
I suggest using the [wiki]love.thread[/wiki] module to load files.
Re: I want to make a text editor in Love2D.
Thanks for that, I'll keep that in mind.
Re: I want to make a text editor in Love2D.
Sure it will load all the file. This is what most text editors do anyways (unfortunately). For really large files, you could use file:seek() and file:read(buffersize) to read the file partially. But if it fits in the memory, reading it all makes things simpler (searching, browsing, etc).Lua Hal wrote:Now that it has the ability to resize windows dynamically, I really want to make a text editor. I have enough knowledge to do it, but if there's anything you'd like to point out for help I'd love to hear it! I am particularly worried about editing long files - won't Lua load the entire file into memory if I use io.open? Thanks for any help.
Also, saving files will be limited only to the user's data directory (i.e., you will not be able to save to any location).
My lovely code lives at GitHub: http://github.com/miko/Love2d-samples
Re: I want to make a text editor in Love2D.
Ah, okay. I suppose I'll have to just use the regular io library then.
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot], Semrush [Bot] and 5 guests