Mercurial > vim
comparison src/mouse.c @ 29451:057c26b5c33a v9.0.0067
patch 9.0.0067: cannot show virtual text
Commit: https://github.com/vim/vim/commit/7f9969c559b51446632ac7e8f76cde07e7d0078d
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Jul 25 18:13:54 2022 +0100
patch 9.0.0067: cannot show virtual text
Problem: Cannot show virtual text.
Solution: Initial changes for virtual text support, using text properties.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 25 Jul 2022 19:15:06 +0200 |
parents | 34e93e046526 |
children | eb07470d0395 |
comparison
equal
deleted
inserted
replaced
29450:67f31c24291b | 29451:057c26b5c33a |
---|---|
3099 * The first column is one. | 3099 * The first column is one. |
3100 */ | 3100 */ |
3101 int | 3101 int |
3102 vcol2col(win_T *wp, linenr_T lnum, int vcol) | 3102 vcol2col(win_T *wp, linenr_T lnum, int vcol) |
3103 { | 3103 { |
3104 char_u *line; | |
3105 chartabsize_T cts; | |
3106 | |
3104 // try to advance to the specified column | 3107 // try to advance to the specified column |
3105 int count = 0; | 3108 line = ml_get_buf(wp->w_buffer, lnum, FALSE); |
3106 char_u *ptr; | 3109 init_chartabsize_arg(&cts, wp, lnum, 0, line, line); |
3107 char_u *line; | 3110 while (cts.cts_vcol < vcol && *cts.cts_ptr != NUL) |
3108 | 3111 { |
3109 line = ptr = ml_get_buf(wp->w_buffer, lnum, FALSE); | 3112 cts.cts_vcol += win_lbr_chartabsize(&cts, NULL); |
3110 while (count < vcol && *ptr != NUL) | 3113 MB_PTR_ADV(cts.cts_ptr); |
3111 { | 3114 } |
3112 count += win_lbr_chartabsize(wp, line, ptr, count, NULL); | 3115 clear_chartabsize_arg(&cts); |
3113 MB_PTR_ADV(ptr); | 3116 |
3114 } | 3117 return (int)(cts.cts_ptr - line); |
3115 return (int)(ptr - line); | |
3116 } | 3118 } |
3117 #endif | 3119 #endif |
3118 | 3120 |
3119 #if defined(FEAT_EVAL) || defined(PROTO) | 3121 #if defined(FEAT_EVAL) || defined(PROTO) |
3120 void | 3122 void |