rebound paste, removed useless max widths
b81c1e88
2 file(s) · +10 −9
| 55 | 55 | defines the prompt to be displayed to the left of the input field. |
|
| 56 | 56 | .TP |
|
| 57 | 57 | .BI \-fn " font" |
|
| 58 | - | defines the font set used. |
|
| 58 | + | defines the font or font set used. |
|
| 59 | 59 | .TP |
|
| 60 | 60 | .BI \-nb " color" |
|
| 61 | 61 | defines the normal background color. |
|
| 93 | 93 | .B Escape (Control\-c) |
|
| 94 | 94 | Exit without selecting an item, returning failure. |
|
| 95 | 95 | .TP |
|
| 96 | - | .B Control\-y |
|
| 96 | + | .B Shift\-Insert |
|
| 97 | 97 | Paste the current X selection into the input field. |
|
| 98 | 98 | .SH SEE ALSO |
|
| 99 | 99 | .BR dwm (1) |
|
| 83 | 83 | n = mw - (promptw + inputw + dc_textw(dc, "<") + dc_textw(dc, ">")); |
|
| 84 | 84 | ||
| 85 | 85 | for(i = 0, next = curr; next; next = next->right) |
|
| 86 | - | if((i += (lines > 0) ? bh : MIN(dc_textw(dc, next->text), mw/3)) > n) |
|
| 86 | + | if((i += (lines > 0) ? bh : dc_textw(dc, next->text)) > n) |
|
| 87 | 87 | break; |
|
| 88 | 88 | for(i = 0, prev = curr; prev && prev->left; prev = prev->left) |
|
| 89 | - | if((i += (lines > 0) ? bh : MIN(dc_textw(dc, prev->left->text), mw/3)) > n) |
|
| 89 | + | if((i += (lines > 0) ? bh : dc_textw(dc, prev->left->text)) > n) |
|
| 90 | 90 | break; |
|
| 91 | 91 | } |
|
| 92 | 92 | ||
| 124 | 124 | dc_drawtext(dc, "<", normcol); |
|
| 125 | 125 | for(item = curr; item != next; item = item->right) { |
|
| 126 | 126 | dc->x += dc->w; |
|
| 127 | - | dc->w = MIN(dc_textw(dc, item->text), mw/3); |
|
| 127 | + | dc->w = dc_textw(dc, item->text); |
|
| 128 | 128 | dc_drawtext(dc, item->text, (item == sel) ? selcol : normcol); |
|
| 129 | 129 | } |
|
| 130 | 130 | dc->w = dc_textw(dc, ">"); |
|
| 226 | 226 | while(cursor > 0 && text[nextrune(-1)] != ' ') |
|
| 227 | 227 | insert(NULL, nextrune(-1) - cursor); |
|
| 228 | 228 | break; |
|
| 229 | - | case XK_y: /* paste selection */ |
|
| 230 | - | XConvertSelection(dc->dpy, XA_PRIMARY, utf8, utf8, win, CurrentTime); |
|
| 231 | - | return; |
|
| 232 | 229 | } |
|
| 233 | 230 | } |
|
| 234 | 231 | switch(ksym) { |
|
| 266 | 263 | sel = curr = matches; |
|
| 267 | 264 | calcoffsets(); |
|
| 268 | 265 | break; |
|
| 266 | + | case XK_Insert: /* paste selection */ |
|
| 267 | + | if(ev->state & ShiftMask) |
|
| 268 | + | XConvertSelection(dc->dpy, XA_PRIMARY, utf8, utf8, win, CurrentTime); |
|
| 269 | + | return; |
|
| 269 | 270 | case XK_Left: |
|
| 270 | 271 | if(cursor > 0 && (!sel || !sel->left || lines > 0)) { |
|
| 271 | 272 | cursor = nextrune(-1); |
|
| 480 | 481 | grabkeyboard(); |
|
| 481 | 482 | dc_resize(dc, mw, mh); |
|
| 482 | 483 | inputw = MIN(inputw, mw/3); |
|
| 483 | - | promptw = prompt ? MIN(dc_textw(dc, prompt), mw/5) : 0; |
|
| 484 | + | promptw = prompt ? dc_textw(dc, prompt) : 0; |
|
| 484 | 485 | XMapRaised(dc->dpy, win); |
|
| 485 | 486 | text[0] = '\0'; |
|
| 486 | 487 | match(); |
|