mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-11 13:50:48 -05:00
Reduce scope and unneeded check.
This commit is contained in:
parent
000c113925
commit
dfeb5940d4
2 changed files with 3 additions and 5 deletions
|
@ -514,7 +514,7 @@ static int drun_token_match ( const Mode *data, GRegex **tokens, unsigned int in
|
|||
int test = 0;
|
||||
GRegex *ftokens[2] = { tokens[j], NULL };
|
||||
// Match name
|
||||
if ( !test && rmpd->entry_list[index].name &&
|
||||
if ( rmpd->entry_list[index].name &&
|
||||
helper_token_match ( ftokens, rmpd->entry_list[index].name ) ) {
|
||||
test = 1;
|
||||
}
|
||||
|
|
|
@ -333,8 +333,6 @@ static void textbox_draw ( widget *wid, cairo_t *draw )
|
|||
textbox *tb = (textbox *) wid;
|
||||
unsigned int offset = ( tb->flags & TB_INDICATOR ) ? DOT_OFFSET : 0;
|
||||
|
||||
int cursor_x = 0;
|
||||
int cursor_y = 0;
|
||||
|
||||
if ( tb->changed ) {
|
||||
__textbox_update_pango_text ( tb );
|
||||
|
@ -371,8 +369,8 @@ static void textbox_draw ( widget *wid, cairo_t *draw )
|
|||
// convert to byte location.
|
||||
char *offset = g_utf8_offset_to_pointer ( text, cursor_offset );
|
||||
pango_layout_get_cursor_pos ( tb->layout, offset - text, &pos, NULL );
|
||||
cursor_x = pos.x / PANGO_SCALE;
|
||||
cursor_y = pos.y / PANGO_SCALE;
|
||||
int cursor_x = pos.x / PANGO_SCALE;
|
||||
int cursor_y = pos.y / PANGO_SCALE;
|
||||
int cursor_height = pos.height / PANGO_SCALE;
|
||||
int cursor_width = 2;
|
||||
cairo_rectangle ( draw, x + cursor_x, y + cursor_y, cursor_width, cursor_height );
|
||||
|
|
Loading…
Reference in a new issue