Skip to content

Commit

Permalink
Initialize bstack variables in context_init() and add bstack_clear() …
Browse files Browse the repository at this point in the history
…in mainwin keypress handler to eliminate initial shift-left issue.
  • Loading branch information
David C. Rankin committed Oct 1, 2018
1 parent 372517e commit 26e2b6a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ The editor provides case-conversion, lower-to-upper, upper-to-lower, and title-c

Word-completion is provided by GtkSourceView. [Return] is used to activate the selected proposal. Word-completion can be enabled/disabed in Settings->File Load/Save->Word-completion. The settings dialog allows setting the minimum number of characters typed before the word-completion dialog appears. (default: 3)

A custom keypress input handler for `Ctrl+Shift+Right-Arrow` and `Ctrl+Shift+Left-Arrow` to correct the annoying default gtk handler that will *select-to-end-of-next-word* when used in leading whitespace instead of the desired behavior of *select-to-beginning-of-next-word*. A cusom keypress hanlder for `Shift+Left-Arrow` is also included as part of the fix to allows reduction of the selection original selection on a per-character basis by releasing the `Ctrl` key and using `Shift+Left-Arrow`. (no corresponding `Shift+Right-Arrow` is required as the default behavior handles reduction of the slection started with `Ctrl+Shift+Right-Arrow` just fine. A configuration option in Settings, `Appearance->Cursor & Selection->Ctrl + Shift + Right-Arrow fix`. This enables a corresponding keypress handler for `Ctrl+Shift+Left-Arrow` and small stack to track sequential `Ctrl+Shift+Left/Right` events. This is set on by default. To restore default gtk handling, simply uncheck the box in settings.
A custom keypress input handler for `Ctrl+Shift+Right-Arrow` and `Ctrl+Shift+Left-Arrow` to correct the annoying default gtk handler that will *select-to-end-of-next-word* when used in leading whitespace instead of the desired behavior of *select-to-beginning-of-next-word*. A cusom keypress hanlder for `Shift+Left-Arrow` is also included as part of the fix to allow reduction of the selection original selection on a per-character basis by releasing the `Ctrl` key and using `Shift+Left-Arrow`. (no corresponding `Shift+Right-Arrow` is required as the default behavior handles reduction of the slection started with `Ctrl+Shift+Right-Arrow` just fine. A configuration option in Settings, `Appearance->Cursor & Selection->Ctrl + Shift + Right-Arrow fix`. This enables a corresponding keypress handler for `Ctrl+Shift+Left-Arrow` and small stack to track sequential `Ctrl+Shift+Left/Right` events. This is set on by default. To restore default gtk handling, simply uncheck the box in settings.

End-of-line detection (`LF`, `CRLF` and `CR`) is provided on file-open and can be selected in the `Tools` menu. Default EOL for new files on each operating system except DOS/Windows is `LF` (line-feed), with the DOS/Windows default being `CRLF`. Pre-OSX `CR` will be detected and set on File-Open, but no specific pre-processor check tests for earlier MacOS. After open, or change of any new file, selecting a different EOL (from the `Tools menu` or within `Settings`) will convert the file to the selected EOL. `Settings->File Load/Save->End-of-Line Handling/Selection` allows for a persistent EOL to be selected along with options for `Use EOL from File` or `Use OS Default` (default). When set to anything other than `Use EOL from File`, a prompt on file-open is presented to convert to the persistent EOL setting if the file EOL differs from the persistent setting. Once open, the `Tools->End of Line Selection` operates independent of the persistent setting allowing conversion to/from any of the line endings without affecting the persistent setting.

Expand Down
3 changes: 3 additions & 0 deletions gtk_appdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,9 @@ void context_init (kwinst *app, char **argv)
/* load default values */
context_set_defaults (app, argv);

/* initialze bstack variables zero */
bstack_clear (app);

/* create an empty key_file */
app->keyfile = g_key_file_new();

Expand Down
2 changes: 1 addition & 1 deletion gtk_filebuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1561,7 +1561,7 @@ void ibar_eol_chk_default (kwinst *app)
g_free (msg);
}
}
g_print ("ibar_eol_chk_default - out\n");

}

/** EOL check against default setting on file open to warn of mismatch */
Expand Down
4 changes: 4 additions & 0 deletions gtk_windef.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,10 @@ gboolean on_keypress (GtkWidget *widget, GdkEventKey *event, kwinst *app)

app->kphome = FALSE; /* reset kphome - return above protects needed TRUE */

/* if any other key and bindex or bstack[0], clear stack */
if (app->bindex || app->bstack[0])
bstack_clear (app);

return FALSE;

if (widget) {}
Expand Down

0 comments on commit 26e2b6a

Please sign in to comment.