teepee has quit [Remote host closed the connection]
teepee has joined #openscad
snakedGT has joined #openscad
snakedLX has quit [Ping timeout: 252 seconds]
ferdna has joined #openscad
LordOfBikes has quit [Ping timeout: 246 seconds]
LordOfBikes has joined #openscad
califax- has joined #openscad
califax has quit [Ping timeout: 276 seconds]
califax- is now known as califax
ur5us_ has joined #openscad
ur5us_ has quit [Ping timeout: 260 seconds]
ferdna has quit [Quit: Leaving]
Guest64 has joined #openscad
Guest64 has quit [Client Quit]
Jack21 has joined #openscad
<Jack21>
InPhase: found the reason for the crash - it is the "Alt+arrow" thingy - i could replicate this with minimal data - so open a new file put in a number ⇒ change that number with "alt+arrow" (scroll doesn't cause the crash) ⇒ open a second new file and as soon you click in an type it will crash
<Jack21>
btw: also i found if you overwrite an existiting file you get the warning twice - first in the safe dialoge and then directly after that dialog closes
<InPhase>
Hmm. Yes. Yes it does.
<Jack21>
so again the last action before opening a new file must not be the use of the "alt arrow"
<InPhase>
It does not require files. Launch with a new file, x = 5; alt-uparrow, new tab, type any character, crash.
<Jack21>
oh
<InPhase>
I guess not many people are using alt-arrows.
<InPhase>
Otherwise surely we would have gotten this report already.
<InPhase>
Do you have a github account to open an issue for this?
<Jack21>
no sorry no github account
<InPhase>
I'm about to fall asleep, it's late. I left myself a digital post-it about this for tomorrow.
<InPhase>
Thanks for sorting out the steps.
<Jack21>
it is mornig here so i just woke up .. also interessting that after the crash the open dialog doesn't show the last saved file
<Jack21>
seems this alt+arrow combo causes a bad state
<Jack21>
and yea not many use this as it is not advertised a lot - i was building me a new mouse with a macro to do exactly this (changing the numbers up/down) when i discovered that this functionality already exist
<Jack21>
with "new tab" did you mean "control+N" or that + icon (as i can not find any "new tab" here ) however good night
ur5us_ has joined #openscad
califax has quit [Remote host closed the connection]
califax has joined #openscad
ur5us_ has quit [Ping timeout: 260 seconds]
teepee has quit [Remote host closed the connection]
teepee has joined #openscad
ali1234 has quit [Ping timeout: 246 seconds]
ali1234 has joined #openscad
la1yv_a has quit [Read error: Connection reset by peer]
la1yv_a has joined #openscad
Punkt has joined #openscad
<knielsen>
cbmuser: I have a new openscad upload that I'd like you to sponsor: https://mentors.debian.net/package/openscad/ . This fixes a FTBFS (plus a few other minor things)
<teepee>
hmm, maybe there's a new qscintilla released
<InPhase>
Slightly newer, although that assertion is still there.
<InPhase>
Presumably the assertion is there for a good reason though, so something else has gone wrong in state either in qscintilla or in our code.
<InPhase>
I googled the assertion text output, and found no hits, but qscintilla is niche enough that this might not exist even if it's crashing other things.
califax has quit [Remote host closed the connection]
<InPhase>
I'm going to take a break, because it's the weekend, but mostly I want to focus back in on the use<> performance issue. I just wanted to document the Jack21 crash, since crashes are important. So if someone else wants to dive into looking at cause, go ahead. :)
califax has joined #openscad
<Jack21>
bit unsettling if it is outside of oscad code .. however as i now know (known error) i can at least circumvent it - Ü
<InPhase>
What is your circumvention technique?
<InPhase>
It can be informative to identify the minimum action required to not crash. :)
<Jack21>
just type a character and delete before changing the tab (yeah happes also when you change into an already open tab)
<InPhase>
Ah, so any other character press before the tab switch.
<Jack21>
or enter or space .. everything which stoppes that "alt+arrow" mode
<Jack21>
it is like something takes focus on that and without release it crashes
<InPhase>
I've updated my post with that info. This will be helpful.
<teepee>
the assert already hints on the issue
<InPhase>
Most likely something about the alt-uparrow code then is not handling undo logic properly.
<teepee>
it seems like the undo/redo transaction logic gets out of sync
<InPhase>
That's good news, because it sounds like we can fix it internally.
<teepee>
so maybe we need to handle lost focus or something like that
<InPhase>
We just need whatever logic happens at keypresses to happen when the alt-uparrow is processed.
<Jack21>
maybe after every arrow action that function need to release the value ( like adding and deleting a space character - probably there are better ways to do this)
<Jack21>
or it had to do with the triggered actualisation/preview after the arrow keypress
<Jack21>
- also interessting that it doesn't happens with scrolling
<Jack21>
so alt scroll is doing something different not leaving it unstable
<Jack21>
while just clicking anywhere else doesn't
<Jack21>
ok just pressing "alt" also helps .. or only arrow to move the cursor somewhere else
<Jack21>
any keypress before tab switch helps
<Jack21>
could it be this is how QT handling keypresses?
<Jack21>
- i am using a special keyboard layout (neo.org) and in oscad i always need to keypress twice for characters on the 3rd level (this is like shift but with another key)
<teepee>
no, I don't think it's qt, it's likely specifically in qscintilla beginUndoAction()/endUndoAction() - at least that's what I guess based on the assert message
arebil has quit [Quit: My keyboard has gone to sleep. ZZZzzz…]
<InPhase>
handleWheelEventNavigateNumber below it has similar questionable logic, just structured a little differently.
<InPhase>
The deeper structural problem is that modifyNumber both does the change and reveals if it did it.
snakedLX is now known as snaked
<InPhase>
I suppose the easy fix, is move the Undo into modifyNumber...
<teepee>
ah, yes, that fits the assert
<teepee>
it can't go into modifyNumber though, I think that would defeat the purpos
<teepee>
e
<teepee>
point of that is to group the undo, so if you do 3xALT+UP and then CTRL-Z it goes back to where it started, not just one step
<teepee>
but that logic with static wasChanged is fishy
<InPhase>
Oh. I just got done editing it into modifyNumber.
<teepee>
ok, I'll take it back with static state it could be anywhere ;-)
<InPhase>
But how would it group it anyway?
<InPhase>
It needs outside information to know that a different edit has happened.
<teepee>
the main issue is that the state tracking does not depend on the editor
<InPhase>
Although I am not sure what the current grouping logic is anyway. I type x = 5; hit preview, type y = 6; on the next line, hit preview, hit undo, and the document is empty again.
<teepee>
so maybe the issue is just that it's a global static instead of an instance variable?
<teepee>
hmm, yes, that sounds wrong
t4nk_freenode has quit [Remote host closed the connection]
<InPhase>
I've grown used to vim's user-established undo boundaries by modal switch.
<InPhase>
After decades of almost exclusively this, I don't even have a mental model for how this is to be done without modal features. :)
<InPhase>
Let's see if I have any inferior text editors lurking around...
<InPhase>
Mousepad does word boundaries, triggering on whitespace.
t4nk_freenode has joined #openscad
<InPhase>
Okay. The good news is I fixed the bug.
<InPhase>
It simply undoes the scrolling one at a time.
<InPhase>
Crashing is no longer a feature.
<teepee>
crashing is certainly a bad option
<InPhase>
I think some comprehensive undo logic is probably a good idea, but I will declare we don't currently have it in a broad sense. I think I will PR this fix separate from broader undo features.
<InPhase>
It's not obvious how one would actually achieve that in a localized manner, because what it's really asking for is coordination between editing types.
<teepee>
I think the bug is simply that it's using a global static across multiple instances of ScintillaEditor
<teepee>
the undo state obviously is specific to the editor instance
<InPhase>
Uhm, yeah.
<InPhase>
That's probably part of it.
<InPhase>
Also, boundaries should probably be established with endUndoAction/beginUndoAction injected where boundaries belong, rather than begin/dostuff/end
<InPhase>
But the rest of the code appears to be begin/dostuff/end.
<InPhase>
And if needed, tab switches should end/switch/begin
<InPhase>
But, out of scope for what I set out to do today. :)
<InPhase>
Or, what I did not set out to do today, but did anyway because it looked easy when I understood it...
<InPhase>
I do not edit files while they are still in tabbed form. :)
<teepee>
there's an "ignore whitspaces" on github :)
<InPhase>
Really? Where is that button.
<InPhase>
Ah, under the gear. Good tip.
<teepee>
yep, it's a bit hidden and also resets every time which is a bit annoying
<InPhase>
Well it would be hazardous if it stayed on for Python.
<InPhase>
I'd forget it's on, and miss bugs.
<InPhase>
Less hidden, file-extension-based (in a configurable way), and with a prominent count of whitespace changes, would be ideal.
<InPhase>
But clicking it on would be helpful. Only rarely does some fool clobber a small change with a lot of whitespace edits. :)
<InPhase>
Jack21: If you weren't following along, a fix was sorted out. Thanks for figuring out a simple reproduction. :) Crashes are bad.
<Jack21>
InPhase: Thx for letting me know, just read through (and only understood half of it) but glad you could fix this - great work both
<Jack21>
i assume it will still remove the higher digits when decreasing (so you can't increase them when going over 0)
<teepee>
it's losing a bit of the undo stuff, but that is messy and I guess worth getting the crash fix
<teepee>
we can worry about the undo later if needed
<Jack21>
so using that altArrow was also the cause that undo jumped to very early stages of a file and removed actual history?
<Jack21>
never crossed my mind this could be connected
<teepee>
that's quite likely
<teepee>
it's trying to group the modification but if it goes wrong the groups may be totally random
<Jack21>
tbh this functionality is the only reason i am not using an external editor
snaked has quit [Ping timeout: 252 seconds]
<teepee>
using include/use much? then I might have some more useful stuff hopefully soon :)
<Jack21>
yes all my designs are based on my library - so i start everything with a template including it (also some variables for 3D-print are set there)
snaked has joined #openscad
<teepee>
autocompleting the file path
<Jack21>
ah nice .. as i have everything in one lib i only need to include one (260k at the moment)
<teepee>
then a custom code snippet is probably even simpler :)
<Jack21>
what does that mean?
<teepee>
ALT+Insert
<teepee>
or context menu -> insert template
<Jack21>
i only have 6 entries in that list - should that include all modules of a lib?
<teepee>
no, that's just some example templates
<teepee>
there's no gui but you can add files into a folder to add more code snippets
<Jack21>
ah that is what the templates folder is for
<teepee>
yeah, you could add a simple one having the include for your library
<Jack21>
i put a template.scad into the examples folder/list when starting oscad
<Jack21>
(also including a line that checks the version of my lib to ensure the design is compatible with it)
<Jack21>
so every design can access a different version of modules from the lib if there were bigger changes in a module
<Jack21>
so can the templates folder, the json also have variables and like text blocks?
<Jack21>
teepee: i have added a new test.json but it is not shown in the list - what did i forget?
<teepee>
did you restart openscad?
<teepee>
it might read that only once, not sure
<Jack21>
yes it reads it into memory but i put in a variable and seems this breaks it
<Jack21>
nah i used some wrong syntax
snakedGT has joined #openscad
snaked has quit [Ping timeout: 265 seconds]
<Jack21>
teepee: where can i learn/lookup that »^~^« position the cursor at that location?
<Jack21>
i am not familiar with that - in C this isn't an expression i am aware of
<teepee>
it's not, very special only for openscad templates, suggested and nick named by InPhase :)
<Jack21>
so this is some customized oscad syntax - as \n \t are normal C escapes
snakedGT has quit [Ping timeout: 252 seconds]
<teepee>
yes, there's no common "cursor here" marker I know of
<Jack21>
is there a list what else is available .. like is there a "put marked text in here" ?
snakedGT has joined #openscad
<teepee>
I think otherwise that's it, the only other magic is that it will do block insert
<teepee>
so if the first line is indented by 1 tab and you have a \n it will still do the indent for the 2nd line too
<Jack21>
ok .. but wouldn't it be nice to select some lines and choose "union" and it would parenthesize them with union()
<teepee>
yes, I like that idea
<teepee>
so we need another marker for "current selection"?
<Jack21>
∨∧∨Δ∇ probably it should be ascii characters |>^<| .. mabe just ~^~ or ^~~^ .. in the end people use those functionality only if they are aware that it exist
ali1234 has quit [Remote host closed the connection]
<InPhase>
Jack21: We needed an arbitrary symbol which was very short and guaranteed to not be present in OpenSCAD code.
<InPhase>
Jack21: My other consideration was something like @CURSOR@ which I've used before as a marker syntax, but a short symbol does a better job of not disrupting the template text alignment too much.
<InPhase>
Jack21: That logical excuse, plus the bat symbol was amusing.
<InPhase>
I'm not sure if we actually explained templates in the manual anywhere, but maybe that would be good for someone to do.
<Jack21>
if there was a feedback of usage statistics one could but those not used into tips displayed when starting (this could work also without submitting any data)
ur5us_ has joined #openscad
<Jack21>
teepee: another for?
<teepee>
declaring where the current selection should go into the template