I've implemented a function to filter the current selection through an external program in rlworkbench. Here is a demo of it.
Right now, the filter program is hard coded to one that formats C code.
One idea with this external formatting is that you could spend more time inputing text that actually does something instead of being distracted by formatting issues.
in #rlworkbench
I've implemented an special select mode in rlworkbench that simplifies selecting different portions of a document. Here is a demo of it.
The select mode is entered by pressing ctrl+l for se(l)ect. The mode is a quasimode meaning that it is only active while the 'l' key is still pressed. (The ctrl key can be released.)
In the select mode buttons to different things:
Pressing 'r' extends the selection to the current (r)egion leaped over
Pressing 'e' extends the selection to lin(e) boundaries
Pressing 'a' extends the selection to p(a)ragraph boundaries
The editor is also in select mode when clicking and dragging with the mouse. So the same keys can be used there. (That is why all the keys are on the left side of the keyboard, since, for me, I operate the mouse with the right hand.)
Having an explicit select mode frees up more keys for select operations. So far I find it a little uncomfortable sustaining the 'l' key, but I feel like it has potential.
Ran 5.31 km in 33:34 (06:19 /km).
Ran 6.63 km in 37:45 (05:41 /km).
I've implemented selection of text with the mouse in rlworkbench. Here is a demo.
The selection goes into the X11/Wayland "primary selection" clipboard which can be pasted with the middle mouse button.
Sometimes when writing a document, I do that by copy and pasting text from various sources. I do that with the mouse. So it has been very convenient to be able to use the mouse in rlworkbench as well. It's starting to feel more and more like a "native application".
in #rlworkbench
Today I learned that copy and paste only works if the program that you copy from is still running.
The SDL API documentation gave me the clue that i might work like this. Because in some situations, you need to provide a callback to transfer data to the clipboard.
I wonder if this is only on Linux, or other operating systems as well?
in #rlworkbench
Last month I decided to try to make rlworkbench a fully modeless editor.
In theory, I get why modeless editing is good. However, I'm a long time, happy Vim user. Vim is probably the most common example of a modal editor. The opposite of modeless. Despite that I want to try. This is a note about my current thoughts and experiences.
One thing that I like about editing in Vim is that I seldom have to press multiple keys at once. That is comfortable for my hands and fingers. My right arm is quite sensitive to bad ergonomics. For example, I often feel a slight pain after working on a laptop keyboard for an hour or so. I'm afraid that a modeless editing interface can not preserve this ergonomics.
In Vim, you are by default in "normal mode" where key presses don't usually insert characters but instead perform operations such as moving the cursor. With a modeless editor interface, you are by default in "insert mode" where key presses insert characters. Now that rlworkbench has a modeless editing interface, I'm sometimes afraid of accidentally inserting characters. Maybe I just have a bad habit of moving the cursor around and I should stop doing that. However, the feeling is that always insert mode feels a little scary.
In modeless editors the default mode is insert mode, and you issue commands by holding down control for example. Why is that? Can we invert that so that the default mode is "command mode" and you have to press and hold a key to insert characters? My guess is that I spend more time navigating than typing.
The Humane Interface (p. 59) argues that the hope is that most time is spent creating content (aka insert mode) and that should be as easy as possible. But I wonder if that is really true. Issuing commands can create content as well, right? For example, there might be a command to format a piece of source code. The formatting might be important for readability. Making the content more readable. Isn't that then part of "creating content"?
This is a short note about my experience with C.
I've previously written about how I feel that C slow me down. Partly because it is a lower-level language than I'm used to. Partly because I don't know it that well.
But yesterday when I worked on rlworkbench I felt that making a change was not that hard. It might even have felt slightly easier.
This feels like a breakthrough for me in my C journey. Perhaps I've learned C well enough for it to not be in my way? Perhaps I've got enough primitives implemented so that I can do some high level programming without more effort? Perhaps the C programming paradigm is more productive? I don't know. But I'm starting to like C more and more.
in #rlworkbench #c
Ran 18.01 km in 01:43:59 (05:46 /km).
I've implemented the ability to extend the selection to line boundaries in rlworkbench.
This can be used to more easily select a number of lines and do operations on them.
I plan to extend this mechanism with more text objects. Things that come to mind are word, sentence, paragraph, and function if you are writing code.
in #rlworkbench
I've implemented copy and paste in rlworkbench, and this is a demo of the current state.
You can make a selection as I demonstrated in the previous demo. Then you can copy that selection with ctrl+c and paste it with ctrl+v.
This also works with external programs.
The next step in copy paste is probably to allow selection of text with the mouse which puts the selection in a clipboard that can be pasted with the third mouse button.
Copy and paste felt like a big step towards a usable editor. Especially when writing code. I often copy and paste code and make small modifications. Now that is possible in rlworkbench.
in #rlworkbench
Ran 5.32 km in 32:17 (06:03 /km).
in #rlworkbench
Ran 10.43 km in 01:00:05 (05:45 /km).
Ran 5.24 km in 32:18 (06:09 /km).
Ran 18.02 km in 01:45:03 (05:49 /km).
I've just got selection working in rlworkbench and this is a demo of the current state.
The navigation and selection mechanism is taken from the Canon Cat. You navigate with a kind of incremental search called LEAP. The text that you just LEAPed over can be selected and deleted.
in #rlworkbench
Ran 12.02 km in 01:09:00 (05:44 /km).
in #rlworkbench
Ran 5.16 km in 29:28 (05:42 /km).
Ran 16.07 km in 01:32:55 (05:46 /km).
Ran 4.50 km in 28:27 (06:19 /km).
in #rlworkbench
Ran 5.45 km in 32:43 (06:00 /km).
in #rlworkbench
in #rlworkbench
Ran 7.92 km in 43:50 (05:32 /km).
Ran 5.30 km in 32:02 (06:02 /km).
in #rlworkbench
Ran 15.10 km in 01:29:25 (05:55 /km).
Ran 6.60 km in 37:34 (05:41 /km).
Ran 4.96 km in 27:51 (05:36 /km).
Ran 5.28 km in 30:57 (05:51 /km).
Ran 10.17 km in 01:00:08 (05:54 /km).
What is Rickard working on and thinking about right now?
Every month I write a newsletter about just that. You will get updates about my current projects and thoughts about programming, and also get a chance to hit reply and interact with me. Subscribe to it below.