summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsrc/Makefile14
-rw-r--r--src/cmds.c4
-rw-r--r--src/cmds_insert.c2
-rw-r--r--src/file.c15
-rw-r--r--src/tui.c2
5 files changed, 30 insertions, 7 deletions
diff --git a/src/Makefile b/src/Makefile
index beae590..e42ce58 100755
--- a/src/Makefile
+++ b/src/Makefile
@@ -87,8 +87,8 @@ ifneq (, $(shell which gnuplot))
CFLAGS += -DGNUPLOT
endif
-# dynamic linking (should not be used in FreeBSD
-ifneq ($(shell uname -s),FreeBSD)
+# dynamic linking (not available in BSD)
+ifneq ($(shell uname -s | grep -o BSD),BSD)
LDLIBS += -ldl
endif
@@ -133,6 +133,16 @@ else ifeq ($(shell uname -s),Darwin)
# macOS' ncurses is built with wide-char support
LDFLAGS += -lncurses
+else ifeq ($(shell uname -s),NetBSD)
+ # NetBSD without pkg-config
+
+ CFLAGS += -I/usr/pkg/include
+ CFLAGS += -I/usr/pkg/include/ncursesw
+
+ LDFLAGS += -L/usr/pkg/lib
+ LDFLAGS += -Wl,-R/usr/pkg/lib
+
+ LDLIBS += -lncursesw
else
LDFLAGS += -lncursesw
endif
diff --git a/src/cmds.c b/src/cmds.c
index ff99310..c5d0b23 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -722,6 +722,10 @@ void formatcol(int c) {
case 'h':
case OKEY_LEFT:
for (i = curcol; i < curcol + arg; i++) {
+ if (fwidth[i] == 1) {
+ sc_error("Cannot resize column any longer");
+ return;
+ }
fwidth[i]--;
if (fwidth[i] < 1)
fwidth[i] = 1;
diff --git a/src/cmds_insert.c b/src/cmds_insert.c
index 4b0c6fe..5de24c9 100644
--- a/src/cmds_insert.c
+++ b/src/cmds_insert.c
@@ -167,7 +167,7 @@ void do_insertmode(struct block * sb) {
if (insert_history->pos == 0)
del_wchar(get_line_from_history(insert_history, insert_history->pos), real_inputline_pos); // Clean history
#endif
- //ui_show_header();
+ ui_show_header();
} else if (sb->value == OKEY_TAB) { // TAB
if (inputline_pos && wcslen(inputline) >= inputline_pos) {
diff --git a/src/file.c b/src/file.c
index 7fe945c..5d9e2f3 100644
--- a/src/file.c
+++ b/src/file.c
@@ -444,8 +444,17 @@ void write_fd(register FILE *f, int r0, int c0, int rn, int cn) {
}
- // write locked cells
- // lock should be stored after any other command
+
+
+ }
+ }
+
+ // write locked cells
+ // lock should be stored after any other command
+ for (r = r0; r <= rn; r++) {
+ pp = ATBL(tbl, r, c0);
+ for (c = c0; c <= cn; c++, pp++)
+ if (*pp) {
// previous implementation
//if ((*pp)->flags & is_locked)
// (void) fprintf(f, "lock %s%d\n", coltoa((*pp)->col), (*pp)->row);
@@ -460,8 +469,6 @@ void write_fd(register FILE *f, int r0, int c0, int rn, int cn) {
else
fprintf(f, "\n");
}
-
-
}
}
diff --git a/src/tui.c b/src/tui.c
index 81998cd..6c75c34 100644
--- a/src/tui.c
+++ b/src/tui.c
@@ -806,6 +806,8 @@ void ui_show_content(WINDOW * win, int mxrow, int mxcol) {
#ifdef USECOLORS
if ((*p) && (*p)->cellerror) { // cellerror
ui_set_ucolor(win, &ucolors[CELL_ERROR]);
+ } else if ((*p) && (*p)->v < 0) { // cell negative
+ ui_set_ucolor(win, &ucolors[CELL_NEGATIVE]);
} else if ((*p) && (*p)->expr) {
ui_set_ucolor(win, &ucolors[EXPRESSION]);
} else if ((*p) && (*p)->label) { // string