Mercurial > vim
annotate src/xpm_w32.c @ 22858:52b5aa2e8c8f v8.2.1976
patch 8.2.1976: cannot backspace in prompt buffer after using cursor-left
Commit: https://github.com/vim/vim/commit/6f6244855fbce5aaa718cd5001a29aac3c5c15d6
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Nov 11 20:52:40 2020 +0100
patch 8.2.1976: cannot backspace in prompt buffer after using cursor-left
Problem: Cannot backspace in prompt buffer after using cursor-left. (Maxim
Kim)
Solution: Ignore "arrow_used" in a prompt buffer. (closes #7281)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 11 Nov 2020 21:00:05 +0100 |
parents | 15539899a112 |
children |
rev | line source |
---|---|
10042
4aead6a9b7a9
commit https://github.com/vim/vim/commit/edf3f97ae2af024708ebb4ac614227327033ca47
Christian Brabandt <cb@256bit.org>
parents:
7837
diff
changeset
|
1 /* vi:set ts=8 sts=4 sw=4 noet: |
3322 | 2 * |
7 | 3 * Load XPM image. |
4 * | |
5 * This function is placed in separate file because Xpm headers conflict with | |
6 * Vim ones :( | |
7 * | |
8 * Written by Sergey Khorev. | |
9 * http://iamphet.nm.ru/vim/index.html | |
10 */ | |
11 | |
12 #ifndef WIN32_LEAN_AND_MEAN | |
13 # define WIN32_LEAN_AND_MEAN | |
14 #endif | |
15 #include <windows.h> | |
16 | |
17 #include "xpm_w32.h" | |
18 | |
18816
15539899a112
patch 8.1.2396: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
10042
diff
changeset
|
19 // Engage Windows support in libXpm |
7 | 20 #define FOR_MSW |
21 | |
22 #include "xpm.h" | |
23 | |
24 /* | |
3322 | 25 * Tries to load an Xpm image from the file "filename". |
26 * Returns -1 on failure. | |
27 * Returns 0 on success and stores image and mask BITMAPS in "hImage" and | |
28 * "hShape". | |
7 | 29 */ |
30 int | |
7837
33ba2adb6065
commit https://github.com/vim/vim/commit/b638a7be952544ceb03052c25b84224577a6494b
Christian Brabandt <cb@256bit.org>
parents:
7807
diff
changeset
|
31 LoadXpmImage( |
33ba2adb6065
commit https://github.com/vim/vim/commit/b638a7be952544ceb03052c25b84224577a6494b
Christian Brabandt <cb@256bit.org>
parents:
7807
diff
changeset
|
32 char *filename, |
33ba2adb6065
commit https://github.com/vim/vim/commit/b638a7be952544ceb03052c25b84224577a6494b
Christian Brabandt <cb@256bit.org>
parents:
7807
diff
changeset
|
33 HBITMAP *hImage, |
33ba2adb6065
commit https://github.com/vim/vim/commit/b638a7be952544ceb03052c25b84224577a6494b
Christian Brabandt <cb@256bit.org>
parents:
7807
diff
changeset
|
34 HBITMAP *hShape) |
7 | 35 { |
18816
15539899a112
patch 8.1.2396: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
10042
diff
changeset
|
36 XImage *img; // loaded image |
15539899a112
patch 8.1.2396: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
10042
diff
changeset
|
37 XImage *shp; // shapeimage |
7 | 38 XpmAttributes attr; |
39 int res; | |
40 HDC hdc = CreateCompatibleDC(NULL); | |
41 | |
42 attr.valuemask = 0; | |
43 res = XpmReadFileToImage(&hdc, filename, &img, &shp, &attr); | |
44 DeleteDC(hdc); | |
45 if (res < 0) | |
46 return -1; | |
3322 | 47 if (shp == NULL) |
7 | 48 { |
3935 | 49 if (img) |
3322 | 50 XDestroyImage(img); |
51 return -1; | |
7 | 52 } |
3322 | 53 *hImage = img->bitmap; |
54 *hShape = shp->bitmap; | |
55 return 0; | |
7 | 56 } |