Comments (2)
{
std::ifstream t(fileToEdit);
if (t.good()) {
std::string str((std::istreambuf_iterator<char>(t)), std::istreambuf_iterator<char>());
editor.SetText(str);
}
}
Should be outside update loop. I had that, but this fixed it!
from imguicolortextedit.
just use std::call_once
#include <mutex>
std::once_flag m_set_text_flag = {};
std::string your_text = "123";
TextEditor m_code_editor;
static void TextEditorUpdate(std::string data)
{
m_code_editor.SetText(data);
}
std::call_once(m_set_text_flag, TextEditorUpdate, your_text);
from imguicolortextedit.
Related Issues (20)
- bug ? add 1 CR each time you call SetText... HOT 2
- IME dose not follow the cursor
- assert() may not be available
- GLSL language definition
- i cant write HOT 3
- Dead project? HOT 10
- Auto-Scroll Issue HOT 4
- Big scripts cause lag and crashes in lua HOT 2
- Keywords in C++ colorizer not working. HOT 1
- Suggestion: Ctrl + Backspace HOT 2
- Add the interface that can set the font list.
- Coloring sections programmatically
- Threading?
- The Color Highlight of identifiers gets removed on the 10th line HOT 3
- Annoucing Dear ImGui Bundle including ImGuiColorTextEdit and many others; with support for C++, Python and emscripten HOT 3
- cant handle enter key HOT 1
- [Suggestion] Java syntax-highlighting
- A code editor i made with this library
- [Suggestion] Search box
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imguicolortextedit.