- support for $BE_USER_SETTINGS to store config files under standard

Haiku settings directory instead of $HOME;
 - minor cleanup;
This commit is contained in:
Siarzhuk Zharski
2010-05-04 19:34:50 +00:00
parent b43dd8cf96
commit 0f54d11f4f

View File

@@ -94,7 +94,6 @@ diff -Naur vim72/src/Makefile vim72.haiku/src/Makefile
objects/os_beos.o: os_beos.c
$(CCC) -o $@ os_beos.c
+# rc -o $@ os_beos.rdef
+objects/os_beos.rsrc: os_beos.rdef
+ cat $< | $(CCC) -E - | grep -v '^#' | rc -o "$@" -
+
@@ -5120,6 +5119,40 @@ diff -Naur vim72/src/gui_beos.h vim72.haiku/src/gui_beos.h
+typedef struct VimScrollBar VimScrollBar;
+
+#endif
diff -Naur vim72/src/misc1.c vim72.haiku/src/misc1.c
--- vim72/src/misc1.c 2008-07-12 19:20:53.065536000 +0000
+++ vim72.haiku/src/misc1.c 2010-05-04 21:02:55.588251136 +0000
@@ -14,6 +14,10 @@
#include "vim.h"
#include "version.h"
+#if defined(__HAIKU__)
+#include <storage/FindDirectory.h>
+#endif
+
static char_u *vim_version_dir __ARGS((char_u *vimdir));
static char_u *remove_tail __ARGS((char_u *p, char_u *pend, char_u *name));
static int copy_indent __ARGS((int size, char_u *src));
@@ -3875,7 +3879,18 @@
vimruntime = (STRCMP(name, "VIMRUNTIME") == 0);
if (!vimruntime && STRCMP(name, "VIM") != 0)
- return NULL;
+#if defined(__HAIKU__)
+ // special handling for user settings directory...
+ if(STRCMP(name, "BE_USER_SETTINGS") == 0) {
+ static char userSettingsPath[MAXPATHL] = {0};
+ if(B_OK == find_directory(B_USER_SETTINGS_DIRECTORY, 0,
+ false, userSettingsPath, MAXPATHL))
+ {
+ return userSettingsPath;
+ }
+ } else
+#endif
+ return NULL;
/*
* When expanding $VIMRUNTIME fails, try using $VIM/vim<version> or $VIM.
diff -Naur vim72/src/normal.c vim72.haiku/src/normal.c
--- vim72/src/normal.c 2009-04-19 20:53:33.000000000 +0000
+++ vim72.haiku/src/normal.c 2009-04-18 09:16:31.000000000 +0000
@@ -5166,7 +5199,7 @@ diff -Naur vim72/src/os_beos.c vim72.haiku/src/os_beos.c
#include <termios.h>
#include <kernel/OS.h>
#include "vim.h"
+#include "os_beos.h"
+//#include "os_beos.h"
#if USE_THREAD_FOR_INPUT_WITH_TIMEOUT
@@ -5272,8 +5305,15 @@ diff -Naur vim72/src/os_beos.c vim72.haiku/src/os_beos.c
diff -Naur vim72/src/os_beos.h vim72.haiku/src/os_beos.h
--- vim72/src/os_beos.h 2009-04-19 20:52:33.000000000 +0000
+++ vim72.haiku/src/os_beos.h 2009-04-18 09:16:37.000000000 +0000
@@ -22,4 +22,4 @@
@@ -20,6 +20,11 @@
#undef BEOS_DR8
#define BEOS_PR_OR_BETTER
+#define USR_VIMRC_FILE "$BE_USER_SETTINGS/vim/vimrc"
+#define USR_GVIMRC_FILE "$BE_USER_SETTINGS/vim/gvimrc"
+
+#define VIMINFO_FILE "$BE_USER_SETTINGS/vim/viminfo"
+
/* select emulation */
-#include <net/socket.h> /* for typedefs and #defines only */