Embedding KTextEditor in FreeCAD
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Be nice to others! Read the FreeCAD code of conduct!
Re: Embedding KTextEditor in FreeCAD
My twopenny (or probably wrench in the cogs): any plans for vim bindings?
More seriously though, I think I'm more of the opinion that there will be as many editor preferences as users (or probably more, somehow). I am more of the opinion that its best to use an external editor, and make sure freecad is able to keep track of the fact that something has changed.
More seriously though, I think I'm more of the opinion that there will be as many editor preferences as users (or probably more, somehow). I am more of the opinion that its best to use an external editor, and make sure freecad is able to keep track of the fact that something has changed.
My latest (or last) project: B-spline Construction Project.
- kkremitzki
- Veteran
- Posts: 2515
- Joined: Thu Mar 03, 2016 9:52 pm
- Location: Illinois
Re: Embedding KTextEditor in FreeCAD
A vi-style input mode would come for free with KTextEditor integration, another nice benefit, this can be demoed Kate: https://kate-editor.org/
Re: Embedding KTextEditor in FreeCAD
Well, doesn't that sound enticing!kkremitzki wrote: ↑Fri Aug 06, 2021 1:57 pm A vi-style input mode would come for free with KTextEditor integration, another nice benefit, this can be demoed Kate: https://kate-editor.org/
My latest (or last) project: B-spline Construction Project.
- adrianinsaval
- Veteran
- Posts: 5551
- Joined: Thu Apr 05, 2018 5:15 pm
Re: Embedding KTextEditor in FreeCAD
it seems there is demand for a feature like that https://forum.freecadweb.org/viewtopic. ... 10#p524410alonso_jamm wrote: ↑Tue Jul 27, 2021 4:19 pm And there are more widgets from KDE that I think could be useful in FreeCAD; for example, KCommandBar could be a good addition to FreeCAD too.
- alonso_jamm
- Posts: 77
- Joined: Mon Nov 11, 2019 11:32 pm
Re: Embedding KTextEditor in FreeCAD
A command search would be useful for using hard to find commands. I found CommandManager while trying to embed KTextEditor in FreeCAD which has a method getAllCommands which returns all the commands registered in FreeCAD. And KCommandBar requires a vector of actions. So I think it may be possible to use the actions from the commands given by getAllCommands to setup KCommandBar.
However, right now I am busy trying to embed KTextEditor nicely in FreeCAD. The undo/redo history from KTextEditor doesn't interface nicely with FreeCAD undo/redo commands.
Re: Embedding KTextEditor in FreeCAD
Hi.
These integration is usable, how I can test?
These integration is usable, how I can test?
- alonso_jamm
- Posts: 77
- Joined: Mon Nov 11, 2019 11:32 pm
Re: Embedding KTextEditor in FreeCAD
I haven't uploaded the code to github yet because I have been busy and I spent a lot of time trying to interface the undo/redo history of KTextEditor with FreeCAD's undo/redo commands. I am now trying to clean up the code and hopefully I will be able to upload the code to github by tomorrow.
Re: Embedding KTextEditor in FreeCAD
Ok thanks to answer my question, and your work.
Re: Embedding KTextEditor in FreeCAD
alonso_jamm wrote: ↑Sat Sep 11, 2021 2:39 pm I haven't uploaded the code to github yet because I have been busy and I spent a lot of time trying to interface the undo/redo history of KTextEditor with FreeCAD's undo/redo commands. I am now trying to clean up the code and hopefully I will be able to upload the code to github by tomorrow.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
- alonso_jamm
- Posts: 77
- Joined: Mon Nov 11, 2019 11:32 pm
Re: Embedding KTextEditor in FreeCAD
I pushed the KTextEditor branch to github. It should contain all the needed changes to use KTextEditor as a text editor for FreeCAD. The dependencies needed to build this branch are the same than to build FreeCAD plus ktexteditor. ktexteditor should be provided by any major linux distro; for example, in arch linux is called ktexteditor or in ubuntu it is called libkf5texteditor-dev. I made optional to build FreeCAD with KTextEditor. So in order to build FreeCAD with KTextEditor it is needed to turn on the cmake switch "BUILD_KTEXTEDITOR." Then after building FreeCAD it is needed to turn on the preference to use KTextEditor in the preferences dialog:
And that's it!, FreeCAD should then use KTextEditor when opening a macro file or a text file. There is still some polishing to do in order to better integrate KTextEditor with FreeCAD (for example, to be able to execute macro files when editing them with KTextEditor).
And that's it!, FreeCAD should then use KTextEditor when opening a macro file or a text file. There is still some polishing to do in order to better integrate KTextEditor with FreeCAD (for example, to be able to execute macro files when editing them with KTextEditor).