markusressel / kodeeditor Goto Github PK
View Code? Open in Web Editor NEWA simple code editor with syntax highlighting and pinch to zoom
License: MIT License
A simple code editor with syntax highlighting and pinch to zoom
License: MIT License
Is your feature request related to a problem? Please describe.
Sometimes the minimap can get in the way of the editor content, due to its size and static positioning.
Describe the solution you'd like
Provide a gravity setting (left, top, right, bottom), that allows a user to position the minimap along the editor view border.
Describe alternatives you've considered
Provide an api to set the specific location and dimensions of the minimap.
Is your feature request related to a problem? Please describe.
Currently line numbers (if enabled) pan and zoom off the screen.
Describe the solution you'd like
The line numbers scale and move up/down in sync with the actual text editor but always stay pinned to the left/right of the editor.
Describe alternatives you've considered
None
Additional context
None
10-06 09:17:17.796 29733-29733/com.apkzube.learnpythonpro E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.apkzube.learnpythonpro, PID: 29733
java.lang.IllegalArgumentException: Cannot round NaN value.
at kotlin.math.MathKt__MathJVMKt.roundToInt(MathJVM.kt:1132)
at de.markusressel.kodeeditor.library.view.CodeEditorLayout$updateLineNumbers$1.run(CodeEditorLayout.kt:477)
at android.os.Handler.handleCallback(Handler.java:742)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5603)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:774)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:652)
It might be a good idea to distinguish python2 and python3.
https://github.com/ccampbell/rainbow/blob/master/src/language/python.js
Syntax highlighting of spannables shouldn't be tied to the code editor. Therefore it should be extracted to a separate library called KodeHighlighter.
Maybe the CodeTextView could be part of it too but I'm not sure about this yet.
I though this would work, but it seems that color is not resolved correctly here: (and same thing a few lines later because it is used twice)
Seems to be linked to this, but don't know how to fix it without breaking everything: https://stackoverflow.com/a/46477727/8261566
Is your feature request related to a problem? Please describe.
When editing a document the cursor can go offscreen.
Describe the solution you'd like
The view should follow the cursor maintaining the current zoom level.
How do I set highlight colors?
Is your feature request related to a problem? Please describe.
When editing a very large document and/or zoomed in far it can be hard to tell where exactly you are in the document.
Describe the solution you'd like
An optional minimap of the whole document with an indication of what part of the document is currently visible.
Describe alternatives you've considered
None.
RxJava is very useful but seems to be unnecessarily complex for this library and may even cause compatibility issues. To remedy this all code that uses RxJava methods shall be replaced by custom implementations with a much smaller footprint.
EDIT:
Kotlin Flow seems like a very reasonable choice for this.
Describe the bug
Hi, I was trying to use this module (KodeEditor) By following the instructions written in the README.md file.
When i was syncing build.gradle, an error occurred :
Failed to resolve: com.github.markusressel.KodeEditor:v3.0.2: Affected Modules: app
To Reproduce
Steps to reproduce the behavior:
maven { url "https://jitpack.io" }
into build.gradle (Project) def codeEditorVersion = "v3.0.2" implementation("com.github.markusressel.KodeEditor:${codeEditorVersion}")
to the build.gradle (Module: App)Expected behavior
Gradle synced successfully
Smartphone (please complete the following information):
How to change the text color for the background text in the CodeEditorLayout?
By default, it's black in color.
I have tried android:textColor="@color/white"
but its not working.
Maybe something like app:ke_editor_textColor
similar to app:ke_lineNumbers_textColor
can help in this.
Describe the bug
CodeEditorView.text
returns a "null" string instead of an actual null value or an empty string when asked too early.
This is because of the way the current text is retrieved in this lines:
var text: String
get() = codeEditText.text.toString()
where text
is an Editable
that may be null and the toString()
is the kotlin extension function that can handle null
values which in this case is not desirable.
To Reproduce
Steps to reproduce the behavior:
Call codeEditorView.text
before a text has been set either by code or layout phase (I an empty string will have been set automatically by the time the view is rendered).
Expected behavior
return an empty string or an actual null
value.
Imo the null
value doesn't add any useful information to the method so I think just returning an empty string and in doing so keeping the non-nullability of the property is better.
This should improve layout measurement performance by 2x
Describe the bug
When trying to sync Gradle.
Shows this error:
ERROR: Failed to resolve: com.github.markusressel.KodeEditor:library:v2.1.1
Show in Project Structure dialog
Affected Modules: app
To Reproduce
Steps to reproduce the behavior:
maven { url "https://jitpack.io" }
to build.gradle (project)def codeEditorVersion = "v2.1.1" implementation("com.github.markusressel.KodeEditor:library:${codeEditorVersion}")
to dependencies in build.gradle(module app
)Expected behavior
Successfully sync Gradle and add libraries to the project.
Smartphone
Is your feature request related to a problem? Please describe.
Navigating long lines can be cumbersome.
Describe the solution you'd like
Allow automatic line wrapping.
Wrapped lines should not increase line count.
Describe the bug
Using Android Support views in an AndroidX app prevent the app to build (gradle errors)
To Reproduce
Steps to reproduce the behavior:
Additional context
KodeEditor/library/build.gradle
Lines 36 to 37 in ee19acd
Also see this question on StackOverflow explaining the problem: https://stackoverflow.com/questions/55217992/manifest-merger-failed-attribute-applicationappcomponentfactory-androidx
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.