Indentation Formatting

If you have ever looked at someone’s code that seems to have no regard for proper (or even consistent) indentation in their code, you will immediately appreciate TKE’s indentation formatting feature.

To adjust the indentation formatting for an entire file, open the file in an editing buffer and, while the editing buffer is the current buffer, select the “Edit / Indentation / Format Text” menu option. After a few moments, like magic, TKE will automatically adjust the indentation of the entire file.

Hard to read code
Easy to read code (and that’s why the function failed to compile)

 

 

To adjust a portion of the file, simply highlight the text to adjust, select the same “Edit / Indentation / Format Text” menu option and only the selected text will have its indentation adjusted.

If you want to guarantee that none of your indentation adjustments are accidentally saved to the file (i.e., if you are simply attempting to better understand a piece of code rather than take ownership of said code), simply lock the editing buffer using either the “File / Lock” menu option or right-click on the editing buffer’s tab and select the “Lock” option there. As long as the file is locked, you may make all of the file adjustments that you like without worrying about saving those changes to the file.

Now go and tell that individual that he/she needs to start using TKE with its awesome auto-indentation capabilities so they can start writing some code that everyone can feel better about!

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

Indentation Formatting

The current_line Plugin

Perhaps its just a case of aging eyes, but sometimes I find myself searching for the current line that the cursor is on. I could adjust my theme’s cursor color to change it to make it easier to find; however, there is a plugin called the “current_line” plugin which highlights the entire line that the insertion cursor is currently on.

To install the plugin, click on the “Plugin” menu in the main menu and select the “Install…” menu option. In the resulting plugin preview window either type a portion of the name “current_line” or use the up/down arrows to find and select the plugin and hit the RETURN key. At the bottom of the TKE main window, a message indicating that the current_plugin is now installed will be displayed.

 

From that point on, all editing buffers will highlight the current line. What’s nice is that if you change the theme, the current line plugin will continue to work, adjusting the current line to go nicely with the theme’s background color.

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

The current_line Plugin

Pane Alignment and Synchronized Scrolling

Every once in a while, I find myself needing to visually compare two files side-by-side. Unfortunately, there are few tools available (apart from difference tools which typically only allow a read-only view) that allow you to quickly align textual lines and keep them in sync when scrolling one of the files.

Now in TKE (as of version 2.8) there is a great solution. Simply open the two files in separate panes. You can do this by opening the two files, selecting one of the files, right click on the tab and choose the “Move to Other Pane” option.

Once both files are in view, place the insertion cursor on the line in each file that you want to synchronize (you will only the insertion cursor in the active editing buffer but TKE remembers the last insertion point in an editing buffer). The lines do not need to be aligned, just in view. Then select the “View / Panes / Align Panes” menu option. This will cause both of the lines in each buffer to align themselves to each other.

Once the panes have been aligned, you can keep those lines aligned by choosing the “View / Panes / Enable Synchronized Scrolling”. When either buffer is scrolled, the other pane will match itself. Nice.

You can visually know that synchronized scrolling is enabled for the two buffers because the scrollbars in each buffer will be colored differently (usually in a red color but this can be changed within the theme editor). What’s even better is that pane synchronization is remembered for pairs of editing buffers. Change one of the pane’s buffers and synchronized scrolling is disabled for that pair. Re-select the original editing buffers and they will remain synchronized. Very nice.

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

Pane Alignment and Synchronized Scrolling