Mercurial > vim
comparison src/os_mswin.c @ 18251:c8a53c0daeed v8.1.2120
patch 8.1.2120: some MB_ macros are more complicated than necessary
Commit: https://github.com/vim/vim/commit/1614a14901558ca091329315d14a7d5e1b53aa47
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Oct 6 22:00:13 2019 +0200
patch 8.1.2120: some MB_ macros are more complicated than necessary
Problem: Some MB_ macros are more complicated than necessary. (Dominique
Pelle)
Solution: Simplify the macros. Expand inline.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 06 Oct 2019 22:15:04 +0200 |
parents | 59bc3cd42cf5 |
children | 38a3bef525e6 |
comparison
equal
deleted
inserted
replaced
18250:f1d9d3f76c98 | 18251:c8a53c0daeed |
---|---|
1652 vim_free(wp); | 1652 vim_free(wp); |
1653 prt_pos_x += (sz.cx - prt_tm.tmOverhang); | 1653 prt_pos_x += (sz.cx - prt_tm.tmOverhang); |
1654 /* This is wrong when printing spaces for a TAB. */ | 1654 /* This is wrong when printing spaces for a TAB. */ |
1655 if (p[len] != NUL) | 1655 if (p[len] != NUL) |
1656 { | 1656 { |
1657 wlen = MB_PTR2LEN(p + len); | 1657 wlen = mb_ptr2len(p + len); |
1658 wp = enc_to_utf16(p + len, &wlen); | 1658 wp = enc_to_utf16(p + len, &wlen); |
1659 if (wp != NULL) | 1659 if (wp != NULL) |
1660 { | 1660 { |
1661 GetTextExtentPoint32W(prt_dlg.hDC, wp, 1, &sz); | 1661 GetTextExtentPoint32W(prt_dlg.hDC, wp, 1, &sz); |
1662 ret = (prt_pos_x + prt_left_margin + sz.cx > prt_right_margin); | 1662 ret = (prt_pos_x + prt_left_margin + sz.cx > prt_right_margin); |