1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-24 22:33:52 +03:00

Fix the background rect when drawing

This commit is contained in:
Tae Won Ha 2016-07-13 20:16:04 +02:00
parent ec602f737b
commit 5e12c218b1
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44
2 changed files with 1 additions and 40 deletions

View File

@ -5,41 +5,6 @@
import Cocoa
enum Mode {
/*
#define NORMAL 0x01 /* Normal mode, command expected */
#define VISUAL 0x02 /* Visual mode - use get_real_state() */
#define OP_PENDING 0x04 /* Normal mode, operator is pending - use
get_real_state() */
#define CMDLINE 0x08 /* Editing command line */
#define INSERT 0x10 /* Insert mode */
#define LANGMAP 0x20 /* Language mapping, can be combined with
INSERT and CMDLINE */
#define REPLACE_FLAG 0x40 /* Replace mode flag */
#define REPLACE (REPLACE_FLAG + INSERT)
# define VREPLACE_FLAG 0x80 /* Virtual-replace mode flag */
# define VREPLACE (REPLACE_FLAG + VREPLACE_FLAG + INSERT)
#define LREPLACE (REPLACE_FLAG + LANGMAP)
#define NORMAL_BUSY (0x100 + NORMAL) /* Normal mode, busy with a command */
#define HITRETURN (0x200 + NORMAL) /* waiting for return or command */
#define ASKMORE 0x300 /* Asking if you want --more-- */
#define SETWSIZE 0x400 /* window size has changed */
#define ABBREV 0x500 /* abbreviation instead of mapping */
#define EXTERNCMD 0x600 /* executing an external command */
#define SHOWMATCH (0x700 + INSERT) /* show matching paren */
#define CONFIRM 0x800 /* ":confirm" prompt */
#define SELECTMODE 0x1000 /* Select mode, only for mappings */
#define TERM_FOCUS 0x2000 // Terminal focus mode
// all mode bits used for mapping
#define MAP_ALL_MODES (0x3f | SELECTMODE | TERM_FOCUS)
*/
}
/// Contiguous piece of cells of a row that has the same attributes.
private struct RowRun: CustomStringConvertible {
@ -224,7 +189,7 @@ public class NeoVimView: NSView {
ColorUtils.colorIgnoringAlpha(background).set()
let backgroundRect = CGRect(
x: positions[0].x, y: positions[0].y,
width: positions.last!.x + self.cellSize.width, height: self.cellSize.height
width: CGFloat(positions.count) * self.cellSize.width, height: self.cellSize.height
)
backgroundRect.fill()
}
@ -323,4 +288,3 @@ public class NeoVimView: NSView {
fatalError("init(coder:) has not been implemented")
}
}

View File

@ -60,9 +60,6 @@ extension NeoVimView: NSTextInputClient {
self.markedText = nil
self.markedPosition = Position.null
self.keyDownDone = true
// TODO: necessary?
self.setNeedsDisplayInRect(self.cellRectFor(row: self.grid.putPosition.row, column: self.grid.putPosition.column))
}
public override func doCommandBySelector(aSelector: Selector) {