Text Replacement

In the previous betas, the program respected system-wide text replacements specifically the ability to have a period through two spaces, and the first letter of a new sentence was capitalized. The latest version still does the two spaces turn into a period bit, but doesn’t capitalize the first letter of a new sentence anymore. Can we have that back?

macosxguru

Are you sure this was ever working in Bike?

I’m building the Bike text editor from ground up, meaning I don’t get all the free behavior from NSTextView. This makes lots of Bike’s features possible, it also means Bike lags behind in some features such as text replacement.

There’s also a bit of mystery in this approach. The underlying text input API’s that I’m making use of aren’t quite as well explored or explained as other parts of appkit. Anyway that is all to say that I think I’m getting the “two spaces inserts a period” from the text input system NSTextInputClient.

I don’t think NSTextInputClient does autocapitalization, and so I don’t think Bike has ever supported autocapitalization either. But I could be wrong and would like to know… maybe I can use NSTextInputClient to get auto capitalization.

In any case I do plan to eventually implement the full macOS text system experience, it just takes time. In this last week I have been exploring the API’s further with this example project (GitHub - jessegrosjean/NSTextInputClient), but I haven’t yet integrated any of that work into Bike.

I thought it did, but I could be wrong. My auto-shifting Planck keyboard might have confused me.

However that is a feature which I rely on and makes typing easier in native apps. Looking forward to Bike supporting that in future versions.

I’m pretty sure this has never worked in Bike, because the “add a period if you type 2 spaces” thing is part and parcel with the Text Shortcut replacements you can create in System Preferences: Keyboard: Text. Those replacements don’t work in BBEdit, either, because BBEdit uses its own written from the ground up editing environment too. And (checks notes…) BBEdit has been around for a couple of years.

It is always intimidating to contradict John Gruber, the creator of Markdown.

You are right about BBEdit not supporting these text replacement features.

I have the settings that you mention in the Keyboard>Text preference pane.

The two spaces turn into a period works. The capitalization doesn’t.

The proof is in the video.
CleanShot 2022-03-18 at 16.42.41.mp4.zip (1.2 MB)

Huh, how about that! I guess I should have tried turning on “Add period with doube-space” before saying it didn’t work! Bad assumption on my part. No reason to be intimidated — my family tells me I’m wrong all the time!