Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom_caret crashes settings textbox #496

Open
ergoithz opened this issue Nov 2, 2024 · 1 comment
Open

custom_caret crashes settings textbox #496

ergoithz opened this issue Nov 2, 2024 · 1 comment

Comments

@ergoithz
Copy link

ergoithz commented Nov 2, 2024

Plugins: custom_caret, settings and lineguide used to reproduce the issue.

Clicking lineguide ruler "Add" dialog textbox will crash lite-xl if custom_caret is active (see screenshot), disabling custom_caret prevents the issue.

image

Error: /usr/share/lite-xl/core/doc/init.lua:287: attempt to compare number with nil

stack traceback:
	/usr/share/lite-xl/core/doc/init.lua:287: in function 'core.doc.sanitize_position'
	/usr/share/lite-xl/core/doc/init.lua:352: in function 'core.doc.get_char'
	/home/orpheus/.config/lite-xl/plugins/custom_caret.lua:115: in function 'core.docview.draw_caret'
	/usr/share/lite-xl/core/docview.lua:557: in upvalue 'draw_overlay'
	/usr/share/lite-xl/plugins/lineguide.lua:108: in function 'core.docview.draw_overlay'
	/home/orpheus/.config/lite-xl/libraries/widget/textbox.lua:98: in method 'draw'
	/home/orpheus/.config/lite-xl/libraries/widget/textbox.lua:298: in function 'libraries.widget.textbox.draw'
	/home/orpheus/.config/lite-xl/libraries/widget/init.lua:1268: in function 'libraries.widget.draw'
	/home/orpheus/.config/lite-xl/libraries/widget/dialog.lua:152: in function 'libraries.widget.dialog.draw'
	/usr/share/lite-xl/core/rootview.lua:483: in upvalue 'root_view_draw'
	/home/orpheus/.config/lite-xl/libraries/widget/init.lua:1468: in upvalue 'root_view_draw'
	...s/.config/lite-xl/plugins/plugin_manager/plugin_view.lua:66: in upvalue 'draw'
	/usr/share/lite-xl/plugins/autocomplete.lua:598: in upvalue 'root_view_draw'
	/usr/share/lite-xl/plugins/contextmenu.lua:32: in upvalue 'root_view_draw'
	/home/orpheus/.config/lite-xl/plugins/lsp/listbox.lua:520: in upvalue 'root_view_draw'
	/usr/share/lite-xl/plugins/treeview.lua:498: in function 'core.rootview.draw'
	/usr/share/lite-xl/core/init.lua:1341: in function 'core.step'
	/usr/share/lite-xl/core/init.lua:1401: in upvalue 'core_run'
	/home/orpheus/.config/lite-xl/plugins/settings.lua:1896: in function 'core.run'
	(...tail calls...)
	[string "local core..."]:14: in function <[string "local core..."]:6>
	[C]: in function 'xpcall'
	[string "local core..."]:6: in main chunk
@Guldoman
Copy link
Member

Guldoman commented Nov 2, 2024

Can repro.
The issue is that custom_caret expects that for each :update call there is up to 1 :draw call, which is a fair assumption.
But somewhere in widget (used by settings) :draw is getting called twice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants