comparison src/keyboard.c @ 66019:26e41053c306

(make_lispy_position): Fix buffer calculations for mouse click or movement in right fringe and the margins.
author Kim F. Storm <storm@cua.dk>
date Tue, 11 Oct 2005 15:07:28 +0000
parents 070aaff00398
children 33c8db02dc18 08b4dd6a6e87
comparison
equal deleted inserted replaced
66018:7810bc0b0259 66019:26e41053c306
5088 rx = wx, ry = wy; 5088 rx = wx, ry = wy;
5089 string = marginal_area_string (w, part, &rx, &ry, &charpos, 5089 string = marginal_area_string (w, part, &rx, &ry, &charpos,
5090 &object, &dx, &dy, &width, &height); 5090 &object, &dx, &dy, &width, &height);
5091 if (STRINGP (string)) 5091 if (STRINGP (string))
5092 string_info = Fcons (string, make_number (charpos)); 5092 string_info = Fcons (string, make_number (charpos));
5093 } 5093 if (part == ON_LEFT_MARGIN)
5094 else if (part == ON_LEFT_FRINGE || part == ON_RIGHT_FRINGE) 5094 wx = 0;
5095 { 5095 else
5096 posn = (part == ON_LEFT_FRINGE) ? Qleft_fringe : Qright_fringe; 5096 wx = window_box_right_offset (w, TEXT_AREA) - 1;
5097 }
5098 else if (part == ON_LEFT_FRINGE)
5099 {
5100 posn = Qleft_fringe;
5097 rx = 0; 5101 rx = 0;
5098 dx = wx; 5102 dx = wx;
5099 wx = (part == ON_LEFT_FRINGE) ? 0 : window_box_width (w, TEXT_AREA); 5103 wx = (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)
5100 if (part == ON_RIGHT_FRINGE) 5104 ? 0
5101 dx -= (window_box_width (w, LEFT_MARGIN_AREA) 5105 : window_box_width (w, LEFT_MARGIN_AREA));
5102 + window_box_width (w, TEXT_AREA) 5106 dx -= wx;
5103 + (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w) 5107 }
5104 ? window_box_width (w, RIGHT_MARGIN_AREA) 5108 else if (part == ON_RIGHT_FRINGE)
5105 : 0)); 5109 {
5106 else if (!WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)) 5110 posn = Qright_fringe;
5107 dx -= window_box_width (w, LEFT_MARGIN_AREA); 5111 rx = 0;
5112 dx = wx;
5113 wx = (window_box_width (w, LEFT_MARGIN_AREA)
5114 + window_box_width (w, TEXT_AREA)
5115 + (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)
5116 ? window_box_width (w, RIGHT_MARGIN_AREA)
5117 : 0));
5118 dx -= wx;
5119 }
5120 else
5121 {
5122 /* Note: We have no special posn for part == ON_SCROLL_BAR. */
5123 wx = max (WINDOW_LEFT_MARGIN_WIDTH (w), wx);
5108 } 5124 }
5109 5125
5110 if (textpos < 0) 5126 if (textpos < 0)
5111 { 5127 {
5112 Lisp_Object string2, object2 = Qnil; 5128 Lisp_Object string2, object2 = Qnil;
5113 struct display_pos p; 5129 struct display_pos p;
5114 int dx2, dy2; 5130 int dx2, dy2;
5115 int width2, height2; 5131 int width2, height2;
5116 wx = max (WINDOW_LEFT_MARGIN_WIDTH (w), wx);
5117 string2 = buffer_posn_from_coords (w, &wx, &wy, &p, 5132 string2 = buffer_posn_from_coords (w, &wx, &wy, &p,
5118 &object2, &dx2, &dy2, 5133 &object2, &dx2, &dy2,
5119 &width2, &height2); 5134 &width2, &height2);
5120 textpos = CHARPOS (p.pos); 5135 textpos = CHARPOS (p.pos);
5121 if (rx < 0) rx = wx; 5136 if (rx < 0) rx = wx;