Closed papirosko closed 10 months ago
Cuda 1.76.0.0
CudaText last versions must be used: 1.203 is current.
Also: did you try to set monospaced font for text?
same problem with 1.203.0.1
(latest from sourceforge).
tried to change fonts here (Options > Fonts > Select document font). It actually didn't change any font on any tab:
yes, font-chooser don't affect current font, but after app restart font is changed. Try to restart app.
yep. restarted app with monospaced font:
still very smooth and the sellection is wrong.
also in viewer the word wrap is broken. compare how the 1st line is wrapped:
correct (only 1st line in new document):
wrong (whole document in viewer):
wrong selection is a bug.
not related to wrong selection: dialog to change document font did not apply font to editor-txt and to viewer. will be fixed in next update.
The fonts are too smooth:
Pls tell detailed: what does it mean? 'smooth'. what is wrong and where?
шрифты очень мыльные. вот скрины покрупнее:
мыло в viewer
четкие в обычном редакторе
превью, конечно, жмет так, что оба - мыло. но первый - в реальности читать невозможно, 2ой - очень четкий
Ok, I see now that text-viewer makes double-buffered paint ALWAYS which is bad for macOS. I must change it to use dbl-buffering only when option tells so. To fix.
Splitted 'word-wrap bug' to new issue #5294.
About wrong selection: I cant reproduce it yet but I'm on linux. before I try it on Mac, give me the small sample file. What word on what line must I select there?
actual selection works correctly, the pasted text is what it should be. the problem is with the selection box, it is shifted:
the selected word is Community
. I bet the problem is the same as with word wrap (wrong detection of char widths)
#include "libtorrent/torrent_handle.hpp"
#include "libtorrent/announce_entry.hpp"
#include "libtorrent/torrent_info.hpp"
#include "libtorrent/tracker_manager.hpp"
the sellection in the beginning of the line is almost ok:
but in the end it is shifted:
both were selected with double click.
mouse selection (dragging) draws selection box correctly, but selects wrong text
can you repro this selection bug on 1st 1-3 lines of file? if so, cut these 3 lines to a new file, attach file here, please.
this is the end of 1st line:
"http://world-fusigi.net","//4.ipv6.systems/screens/69-195-143-148e7197bb67a2bef57e4b4ad54ccb691bhttp-world-fusigi-net--.jpeg","不思議.net","","不思議.net,怖い話,オカルト,2ちゃんねる,宇宙",\N,"147.92.146.242","world-fusigi.net",\N,\N,"872723",\N,"WO",".net","[jpn,dan,jpn,eng,jpn,tha,jpn,jpn,nld]","94","Community and Society > Holidays and Seasonal Events"
"http://fitgirl-repacks.site","//4.ipv6.systems/screens/69-195-143-14ef76273c3c0b57f9882ee49a8a15e8cahttp-fitgirl-repacks-site--.jpeg","FitGirl Repacks - The ONLY official site for FitGirl Repacks. Every single FG repack installer has a link inside, which leads here. Do not fall for fake and scam sites, which are using my name.","The ONLY official site for FitGirl Repacks. Every single FG repack installer has a link inside, which leads here. Do not fall for fake and scam sites, which are using my name.","",\N,"190.115.31.179","fitgirl-repacks.site",\N,\N,"3044001",\N,"WO",".site","[eng]","51","Games > Roleplaying Games"
"http://acesso.gov.br","//4.ipv6.systems/screens/69-195-143-14d7a34d2038782ac0e6968047b31e68f5http-acesso-gov-br--.jpeg","Acesso GovBR","","",\N,"189.9.113.9","acesso.gov.br",\N,\N,"24195144","4","BR",".br","[por,eng,eng]","16","Law and Government > Government"
fixed the part of issue. word wrap works ok now.
Jairo, don't bother. I have repro of selection bug if i change encoding of viewer to UTF8.
wrong selection is easy to see, if I change font to proportional.
@jairomartineza Hi; can you make the 1.204 distro and attach it? I want that you and @papirosko test my changes. for me, 2-3 of 3 bugs are fixed now:
Updating Lazarus and getting your last sources...
Ready Alex,
@papirosko Can you check bugs on build from above post, please?
much better. Font rendering is ok, word wrapping is ok.
selection on double click is still broken:
btw, not sure why, but the cursor is too slow. when I tap arrow down
10 times, the last caret movement finishes in 2-3 seconds after I stopped tapping.
btw, it is slow even on latest release. there is slight latency between tap and the caret movement
and the caret movement
you mean scrolling? because text-viewer don't have a caret.
i mean regular editing mode. i think it should be moved to a separate issue
yes, please create a new issue about slow caret movement on macOS. this issue is about text viewer only. i can suggest options tweaking in that new issue.
is viewer rendering slow?
viewer: rendering is OK. scrolling speed is ok.
@JairoMartinezA did not reproduce the slow speed of reaction of editor on typing. on Mac. I also have very old Macbook (OSX 10.10 or 10.12?) and did not see the Cud is slow. so, @papirosko , I cannot repro.
did you install several interactive plugins (with events)? do you see that clean Cud is slow?
maybe, i was testing yaml file with syntax highlighting:
yaml file with highlighting must be still fast. if you didn't install interactive plugins for yaml (seems you didnt). maybe macOS 14 is reason, but I don't have such hardware + OS.
it's definitely something with lexer. if i switch lexer from yaml
to none
, it starts working faster
it would be nice to have a feature, where you will collect metrics. e.g. a histogram of the delay between keypressed event and the end of the rendering (or smth like that, not sure if it is possible)
- how much lines does Yaml file have?
124 lines
- what if you take 20 lines Yaml file? copy first 20 lines to a new tab
20 lines work much faster
130 lines is small file too. and you don't have event-plugins. strange! (if file don't have huge lines with len=50K for example)
Compare to my speed of cursor
https://github.com/Alexey-T/CudaText/assets/1061424/d8193812-819a-47f5-8ef6-2333f08c06d7
@papirosko
Let's add option in user.json: "log_timing": true,
it gives the red-font indicator in the left-bottom corner of editor. so for 'slow case' it must show big time of screen painting in mseconds?
'Json' case shows timing ~20msec for caret move. if you see the time on very slow case you will get 30-40 msec? so rendering is slow for you.
where did you see that? i can see
I saw 18 msec so i said '20'. ok, you have 14msec. it is fast (comparing to my pc).
btw, it is slow even on latest release. there is slight latency between tap and the caret movement
there is a pause, yes. for 14msec it is small pause.
@papirosko, could you please share your YAML if possible? Maybe it's because of a nested element. On the other hand, you can copy the source from https://learnxinyminutes.com/docs/yaml/ multiple times as I did and proceed with the same test.
lowercaseOutputName: true
rules:
# Special cases and very specific rules
- pattern : kafka.server<type=(.+), name=(.+), clientId=(.+), topic=(.+), partition=(.*)><>Value
name: kafka_server_$1_$2
type: GAUGE
labels:
clientId: "$3"
topic: "$4"
partition: "$5"
- pattern : kafka.server<type=(.+), name=(.+), clientId=(.+), brokerHost=(.+), brokerPort=(.+)><>Value
name: kafka_server_$1_$2
type: GAUGE
labels:
clientId: "$3"
broker: "$4:$5"
- pattern : kafka.coordinator.(\w+)<type=(.+), name=(.+)><>Value
name: kafka_coordinator_$1_$2_$3
type: GAUGE
# Generic per-second counters with 0-2 key/value pairs
- pattern: kafka.(\w+)<type=(.+), name=(.+)PerSec\w*, (.+)=(.+), (.+)=(.+)><>Count
name: kafka_$1_$2_$3_total
type: COUNTER
labels:
"$4": "$5"
"$6": "$7"
- pattern: kafka.(\w+)<type=(.+), name=(.+)PerSec\w*, (.+)=(.+)><>Count
name: kafka_$1_$2_$3_total
type: COUNTER
labels:
"$4": "$5"
- pattern: kafka.(\w+)<type=(.+), name=(.+)PerSec\w*><>Count
name: kafka_$1_$2_$3_total
type: COUNTER
# Quota specific rules
- pattern: kafka.server<type=(.+), user=(.+), client-id=(.+)><>([a-z-]+)
name: kafka_server_quota_$4
type: GAUGE
labels:
resource: "$1"
user: "$2"
clientId: "$3"
- pattern: kafka.server<type=(.+), client-id=(.+)><>([a-z-]+)
name: kafka_server_quota_$3
type: GAUGE
labels:
resource: "$1"
clientId: "$2"
- pattern: kafka.server<type=(.+), user=(.+)><>([a-z-]+)
name: kafka_server_quota_$3
type: GAUGE
labels:
resource: "$1"
user: "$2"
# Generic gauges with 0-2 key/value pairs
- pattern: kafka.(\w+)<type=(.+), name=(.+), (.+)=(.+), (.+)=(.+)><>Value
name: kafka_$1_$2_$3
type: GAUGE
labels:
"$4": "$5"
"$6": "$7"
- pattern: kafka.(\w+)<type=(.+), name=(.+), (.+)=(.+)><>Value
name: kafka_$1_$2_$3
type: GAUGE
labels:
"$4": "$5"
- pattern: kafka.(\w+)<type=(.+), name=(.+)><>Value
name: kafka_$1_$2_$3
type: GAUGE
# Emulate Prometheus 'Summary' metrics for the exported 'Histogram's.
#
# Note that these are missing the '_sum' metric!
- pattern: kafka.(\w+)<type=(.+), name=(.+), (.+)=(.+), (.+)=(.+)><>Count
name: kafka_$1_$2_$3_count
type: COUNTER
labels:
"$4": "$5"
"$6": "$7"
- pattern: kafka.(\w+)<type=(.+), name=(.+), (.+)=(.*), (.+)=(.+)><>(\d+)thPercentile
name: kafka_$1_$2_$3
type: GAUGE
labels:
"$4": "$5"
"$6": "$7"
quantile: "0.$8"
- pattern: kafka.(\w+)<type=(.+), name=(.+), (.+)=(.+)><>Count
name: kafka_$1_$2_$3_count
type: COUNTER
labels:
"$4": "$5"
- pattern: kafka.(\w+)<type=(.+), name=(.+), (.+)=(.*)><>(\d+)thPercentile
name: kafka_$1_$2_$3
type: GAUGE
labels:
"$4": "$5"
quantile: "0.$6"
- pattern: kafka.(\w+)<type=(.+), name=(.+)><>Count
name: kafka_$1_$2_$3_count
type: COUNTER
- pattern: kafka.(\w+)<type=(.+), name=(.+)><>(\d+)thPercentile
name: kafka_$1_$2_$3
type: GAUGE
labels:
quantile: "0.$4"
# Generic gauges for MeanRate Percent
# Ex) kafka.server<type=KafkaRequestHandlerPool, name=RequestHandlerAvgIdlePercent><>MeanRate
- pattern: kafka.(\w+)<type=(.+), name=(.+)Percent\w*><>MeanRate
name: kafka_$1_$2_$3_percent
type: GAUGE
- pattern: kafka.(\w+)<type=(.+), name=(.+)Percent\w*><>Value
name: kafka_$1_$2_$3_percent
type: GAUGE
- pattern: kafka.(\w+)<type=(.+), name=(.+)Percent\w*, (.+)=(.+)><>Value
name: kafka_$1_$2_$3_percent
type: GAUGE
labels:
"$4": "$5"
VS generic YAML test:
https://github.com/Alexey-T/CudaText/assets/5806694/0fdc7cf4-a75e-4024-9c9c-006ef1af3a56
BTW, option "renderer_tweaks__mac"
affects the speed. check it is not present in user.json.
this is what i have:
{
"ui_theme" : "sub",
"ui_theme_syntax" : "sub",
"ui_sidebar_show" : false,
"minimap_show" : true,
"ui_toolbar_show" : false,
"font_name__mac" : "Menlo",
"font_size__mac" : 9,
"ui_font_output_name__mac" : "Helvetica",
"ui_font_output_size__mac" : 9,
"ui_font_name__mac" : "Arial",
"ui_font_size__mac" : 9,
"ui_statusbar_show" : true,
"log_timing" : true
}```
sorry for long delay.
The only left bug with Viewer was: if we dbl-click words far from left side of window, selection is shifted. Reason: macOS uses non-integer widths of chars (e.g. 11.2 pixels).
I now found: the reproduction of dbl-click selection is possible even on linux. on Qt5 version. So i made the fix for Qt5 and tested it on linux. must work for macOS too! made fix in ATBinHex repo. @jairomartineza, can you please pull ATBinHex update and test dbl-click selection on macOS?
Cuda 1.76.0.0. Macos: Sonoma 14.1.1.
File size is 1.37Gb. Opened with
Viewer - text mode
. The fonts are too smooth:Copied the 1st line from that file and pasted into new document:
Also selection is broken. Here I doubleclicked on
official
word: