se

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

keep_cursor_col.h (522B)


      1 #ifndef KEEP_CURSOR_COL_H_
      2 #define KEEP_CURSOR_COL_H_
      3 
      4 static int
      5 keep_cursor_col_callback(struct window_buffer* buf, enum cursor_reason callback_reason)
      6 {
      7 	if (callback_reason == CURSOR_COMMAND_MOVEMENT || callback_reason == CURSOR_RIGHT_LEFT_MOVEMENT) {
      8 		int y, tmp;
      9 		fb_offset_to_xy(get_fb(buf), buf->cursor_offset, 0, buf->y_scroll, &buf->cursor_col, &y, &tmp);
     10 	}
     11     return 0;
     12 }
     13 
     14 static const struct extension keep_cursor_col = {
     15     .wb_cursor_movement = keep_cursor_col_callback
     16 };
     17 
     18 #endif // KEEP_CURSOR_COL_H_