Line Wrapping

To line wrap or to not line wrap, that is the question! For a long time, TKE did not provide the ability to wrap lines. Why? Well, first of all, line wrapped programming code can be a bit hard to read. Second, it is creating an editing view that may be inconsistent with other users of the file, leading to potential formatting issues (this is the same argument as to why TKE generally replaces TAB characters with spaces when editing). Third, adding a feature like line wrapping can lead to some tricky corner cases in code. Finally, and probably not least, there were other features that TKE’s developers wanted to get into the tool before it 🙂 However, the latest version of TKE (3.2 as of this writing) fully supports line wrapping, so let’s briefly go over how you can put it to work.

Line wrapping support is a feature which is enabled/disabled by each programming language syntax file. So a programming language like C++ will have line wrapping disabled by default while a writing language like Markdown will enable line wrapping by default. You can, at any time and with any language, temporarily override the default line wrapping behavior by toggling the state of the View / Line Wrapping menu option. When line wrapping is enabled, lines will wrap at the editing buffer ruler location (which is controllable in the Preferences window in the Editor panel).

If you want the line wrapping behavior to be remembered between invocations of TKE, you can do so in the Preferences window within the View panel. Here you can set how TKE should determine the line wrapping state using the Line Wrapping Default option menu at the bottom of the panel. The three option values are as follows:

  • syntax: Use the syntax-specified line wrapping indication to dictate if line wrapping should be enabled or disabled.
  • enable: Always enable line wrapping mode.
  • disable: Always disable line wrapping mode.

For Vim users, wrapped lines offer a few additional cursor motion commands which are as follows (note that logical lines share the same line number within the file but displayed lines are created due to wrapping):

  • g0: Moves the cursor to the first character of the currently displayed line.
  • g^: Moves the cursor to the first non-whitespace character of the currently displayed line.
  • g$: Moves the cursor to the last character of the currently displayed line.
  • gm: Moves the cursor to the middle-most character of the currently displayed line.

Once you have “wrapped” your mind around this feature, you can take your editing to new levels of Zen.

To see more information and download your copy of the TKE code editor, visit http://tke.sourceforge.net.

Advertisements
Line Wrapping

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s