diff --git a/include/rofi.h b/include/rofi.h index 8ee0e88e..432c94f2 100644 --- a/include/rofi.h +++ b/include/rofi.h @@ -81,7 +81,7 @@ typedef int ( *menu_match_cb )( char **tokens, const char *input, int index, voi MenuReturn menu ( char **lines, char **input, char *prompt, Time *time, int *shift, menu_match_cb mmc, void *mmc_data, - int *selected_line ) __attribute__ ((nonnull(1,2,3,8))); + int *selected_line ) __attribute__ ( ( nonnull ( 1, 2, 3, 8 ) ) ); void catch_exit ( __attribute__( ( unused ) ) int sig ); diff --git a/include/textbox.h b/include/textbox.h index e3b7b87c..18681acd 100644 --- a/include/textbox.h +++ b/include/textbox.h @@ -19,12 +19,12 @@ typedef struct typedef enum { - TB_AUTOHEIGHT = 1 << 0, - TB_AUTOWIDTH = 1 << 1, - TB_LEFT = 1 << 16, - TB_RIGHT = 1 << 17, - TB_CENTER = 1 << 18, - TB_EDITABLE = 1 << 19, + TB_AUTOHEIGHT = 1 << 0, + TB_AUTOWIDTH = 1 << 1, + TB_LEFT = 1 << 16, + TB_RIGHT = 1 << 17, + TB_CENTER = 1 << 18, + TB_EDITABLE = 1 << 19, } TextboxFlags; typedef enum diff --git a/source/rofi.c b/source/rofi.c index 2153b8b8..1090fbe6 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -1338,7 +1338,8 @@ MenuReturn menu ( char **lines, char **input, char *prompt, Time *time, int *shi KeySym key = XkbKeycodeToKeysym ( display, ev.xkey.keycode, 0, 0 ); - if ( ( ( ev.xkey.state & ControlMask ) == ControlMask ) && key == XK_v ) + if ( ( ( ( ev.xkey.state & ControlMask ) == ControlMask ) && key == XK_v ) || + key == XK_Insert ) { // TODO move these. Atom clip = XInternAtom ( display, "CLIPBOARD", False ); diff --git a/source/textbox.c b/source/textbox.c index a7599475..045d6573 100644 --- a/source/textbox.c +++ b/source/textbox.c @@ -239,8 +239,8 @@ void textbox_draw ( textbox *tb ) // Trailing spaces still go wrong.... // The replace by _ is needed, one way or the other. // Make a copy, and replace all trailing spaces. - char *test = strdup(text); - for(int iter = strlen(text)-1; iter >= 0 && test[iter] == ' '; iter--) + char *test = strdup ( text ); + for ( int iter = strlen ( text ) - 1; iter >= 0 && test[iter] == ' '; iter-- ) { test[iter] = '_'; } @@ -248,7 +248,7 @@ void textbox_draw ( textbox *tb ) XftTextExtentsUtf8 ( display, tb->font, ( unsigned char * ) test, cursor_offset, &extents ); // Add a small 4px offset between cursor and last glyph. cursor_x = extents.width + ( ( extents.width > 0 ) ? 2 : 0 ); - free(test); + free ( test ); } // calc full input text width